donut-decomp/asm/MSL_C.PPCEABI.bare.H/MSL_Common/Src/mbstring.s

181 lines
7.2 KiB
ArmAsm

.include "macros.inc"
.section .text, "ax" # 0x80006A00 - 0x80406260 ; 0x003FF860
.global mbtowc
mbtowc:
/* 8000AB54 00006994 3C C0 80 42 */ lis r6, _current_locale@ha
/* 8000AB58 00006998 38 C6 15 10 */ addi r6, r6, _current_locale@l
/* 8000AB5C 0000699C 80 C6 00 38 */ lwz r6, 0x38(r6)
/* 8000AB60 000069A0 81 86 00 20 */ lwz r12, 0x20(r6)
/* 8000AB64 000069A4 7D 89 03 A6 */ mtctr r12
/* 8000AB68 000069A8 4E 80 04 20 */ bctr
.global __mbtowc_noconv
__mbtowc_noconv:
/* 8000AB6C 000069AC 2C 04 00 00 */ cmpwi r4, 0x0
/* 8000AB70 000069B0 40 82 00 0C */ bne lbl_8000AB7C
/* 8000AB74 000069B4 38 60 00 00 */ li r3, 0x0
/* 8000AB78 000069B8 4E 80 00 20 */ blr
.global lbl_8000AB7C
lbl_8000AB7C:
/* 8000AB7C 000069BC 2C 05 00 00 */ cmpwi r5, 0x0
/* 8000AB80 000069C0 40 82 00 0C */ bne lbl_8000AB8C
/* 8000AB84 000069C4 38 60 FF FF */ li r3, -0x1
/* 8000AB88 000069C8 4E 80 00 20 */ blr
.global lbl_8000AB8C
lbl_8000AB8C:
/* 8000AB8C 000069CC 2C 03 00 00 */ cmpwi r3, 0x0
/* 8000AB90 000069D0 41 82 00 0C */ beq lbl_8000AB9C
/* 8000AB94 000069D4 88 04 00 00 */ lbz r0, 0x0(r4)
/* 8000AB98 000069D8 B0 03 00 00 */ sth r0, 0x0(r3)
.global lbl_8000AB9C
lbl_8000AB9C:
/* 8000AB9C 000069DC 88 04 00 00 */ lbz r0, 0x0(r4)
/* 8000ABA0 000069E0 7C 00 07 75 */ extsb. r0, r0
/* 8000ABA4 000069E4 40 82 00 0C */ bne lbl_8000ABB0
/* 8000ABA8 000069E8 38 60 00 00 */ li r3, 0x0
/* 8000ABAC 000069EC 4E 80 00 20 */ blr
.global lbl_8000ABB0
lbl_8000ABB0:
/* 8000ABB0 000069F0 38 60 00 01 */ li r3, 0x1
/* 8000ABB4 000069F4 4E 80 00 20 */ blr
.global __wctomb_noconv
__wctomb_noconv:
/* 8000ABB8 000069F8 2C 03 00 00 */ cmpwi r3, 0x0
/* 8000ABBC 000069FC 40 82 00 0C */ bne lbl_8000ABC8
/* 8000ABC0 00006A00 38 60 00 00 */ li r3, 0x0
/* 8000ABC4 00006A04 4E 80 00 20 */ blr
.global lbl_8000ABC8
lbl_8000ABC8:
/* 8000ABC8 00006A08 98 83 00 00 */ stb r4, 0x0(r3)
/* 8000ABCC 00006A0C 38 60 00 01 */ li r3, 0x1
/* 8000ABD0 00006A10 4E 80 00 20 */ blr
.global mbstowcs
mbstowcs:
/* 8000ABD4 00006A14 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 8000ABD8 00006A18 7C 08 02 A6 */ mflr r0
/* 8000ABDC 00006A1C 90 01 00 24 */ stw r0, 0x24(r1)
/* 8000ABE0 00006A20 BF 41 00 08 */ stmw r26, 0x8(r1)
/* 8000ABE4 00006A24 7C 9B 23 78 */ mr r27, r4
/* 8000ABE8 00006A28 7C 7A 1B 78 */ mr r26, r3
/* 8000ABEC 00006A2C 7C BC 2B 78 */ mr r28, r5
/* 8000ABF0 00006A30 7F 63 DB 78 */ mr r3, r27
/* 8000ABF4 00006A34 4B FF BE 99 */ bl strlen
/* 8000ABF8 00006A38 2C 1A 00 00 */ cmpwi r26, 0x0
/* 8000ABFC 00006A3C 7C 7D 1B 78 */ mr r29, r3
/* 8000AC00 00006A40 41 82 00 78 */ beq lbl_8000AC78
/* 8000AC04 00006A44 3F E0 80 42 */ lis r31, _current_locale@ha
/* 8000AC08 00006A48 3B C0 00 00 */ li r30, 0x0
/* 8000AC0C 00006A4C 3B FF 15 10 */ addi r31, r31, _current_locale@l
/* 8000AC10 00006A50 48 00 00 5C */ b lbl_8000AC6C
.global lbl_8000AC14
lbl_8000AC14:
/* 8000AC14 00006A54 88 1B 00 00 */ lbz r0, 0x0(r27)
/* 8000AC18 00006A58 7C 00 07 75 */ extsb. r0, r0
/* 8000AC1C 00006A5C 41 82 00 40 */ beq lbl_8000AC5C
/* 8000AC20 00006A60 80 DF 00 38 */ lwz r6, 0x38(r31)
/* 8000AC24 00006A64 7F 43 D3 78 */ mr r3, r26
/* 8000AC28 00006A68 7F 64 DB 78 */ mr r4, r27
/* 8000AC2C 00006A6C 7F A5 EB 78 */ mr r5, r29
/* 8000AC30 00006A70 81 86 00 20 */ lwz r12, 0x20(r6)
/* 8000AC34 00006A74 7D 89 03 A6 */ mtctr r12
/* 8000AC38 00006A78 3B 5A 00 02 */ addi r26, r26, 0x2
/* 8000AC3C 00006A7C 4E 80 04 21 */ bctrl
/* 8000AC40 00006A80 2C 03 00 00 */ cmpwi r3, 0x0
/* 8000AC44 00006A84 40 81 00 10 */ ble lbl_8000AC54
/* 8000AC48 00006A88 7F 7B 1A 14 */ add r27, r27, r3
/* 8000AC4C 00006A8C 7F A3 E8 50 */ subf r29, r3, r29
/* 8000AC50 00006A90 48 00 00 18 */ b lbl_8000AC68
.global lbl_8000AC54
lbl_8000AC54:
/* 8000AC54 00006A94 38 60 FF FF */ li r3, -0x1
/* 8000AC58 00006A98 48 00 00 28 */ b lbl_8000AC80
.global lbl_8000AC5C
lbl_8000AC5C:
/* 8000AC5C 00006A9C 38 00 00 00 */ li r0, 0x0
/* 8000AC60 00006AA0 B0 1A 00 00 */ sth r0, 0x0(r26)
/* 8000AC64 00006AA4 48 00 00 18 */ b lbl_8000AC7C
.global lbl_8000AC68
lbl_8000AC68:
/* 8000AC68 00006AA8 3B DE 00 01 */ addi r30, r30, 0x1
.global lbl_8000AC6C
lbl_8000AC6C:
/* 8000AC6C 00006AAC 7C 1E E0 40 */ cmplw r30, r28
/* 8000AC70 00006AB0 41 80 FF A4 */ blt lbl_8000AC14
/* 8000AC74 00006AB4 48 00 00 08 */ b lbl_8000AC7C
.global lbl_8000AC78
lbl_8000AC78:
/* 8000AC78 00006AB8 3B C0 00 00 */ li r30, 0x0
.global lbl_8000AC7C
lbl_8000AC7C:
/* 8000AC7C 00006ABC 7F C3 F3 78 */ mr r3, r30
.global lbl_8000AC80
lbl_8000AC80:
/* 8000AC80 00006AC0 BB 41 00 08 */ lmw r26, 0x8(r1)
/* 8000AC84 00006AC4 80 01 00 24 */ lwz r0, 0x24(r1)
/* 8000AC88 00006AC8 7C 08 03 A6 */ mtlr r0
/* 8000AC8C 00006ACC 38 21 00 20 */ addi r1, r1, 0x20
/* 8000AC90 00006AD0 4E 80 00 20 */ blr
.global wcstombs
wcstombs:
/* 8000AC94 00006AD4 94 21 FF D0 */ stwu r1, -0x30(r1)
/* 8000AC98 00006AD8 7C 08 02 A6 */ mflr r0
/* 8000AC9C 00006ADC 2C 03 00 00 */ cmpwi r3, 0x0
/* 8000ACA0 00006AE0 90 01 00 34 */ stw r0, 0x34(r1)
/* 8000ACA4 00006AE4 BF 41 00 18 */ stmw r26, 0x18(r1)
/* 8000ACA8 00006AE8 7C 7A 1B 78 */ mr r26, r3
/* 8000ACAC 00006AEC 7C BB 2B 78 */ mr r27, r5
/* 8000ACB0 00006AF0 3B A0 00 00 */ li r29, 0x0
/* 8000ACB4 00006AF4 41 82 00 0C */ beq lbl_8000ACC0
/* 8000ACB8 00006AF8 2C 04 00 00 */ cmpwi r4, 0x0
/* 8000ACBC 00006AFC 40 82 00 0C */ bne lbl_8000ACC8
.global lbl_8000ACC0
lbl_8000ACC0:
/* 8000ACC0 00006B00 38 60 00 00 */ li r3, 0x0
/* 8000ACC4 00006B04 48 00 00 74 */ b lbl_8000AD38
.global lbl_8000ACC8
lbl_8000ACC8:
/* 8000ACC8 00006B08 3F E0 80 42 */ lis r31, _current_locale@ha
/* 8000ACCC 00006B0C 7C 9C 23 78 */ mr r28, r4
/* 8000ACD0 00006B10 3B FF 15 10 */ addi r31, r31, _current_locale@l
/* 8000ACD4 00006B14 48 00 00 58 */ b lbl_8000AD2C
.global lbl_8000ACD8
lbl_8000ACD8:
/* 8000ACD8 00006B18 A0 9C 00 00 */ lhz r4, 0x0(r28)
/* 8000ACDC 00006B1C 2C 04 00 00 */ cmpwi r4, 0x0
/* 8000ACE0 00006B20 40 82 00 10 */ bne lbl_8000ACF0
/* 8000ACE4 00006B24 38 00 00 00 */ li r0, 0x0
/* 8000ACE8 00006B28 7C 1A E9 AE */ stbx r0, r26, r29
/* 8000ACEC 00006B2C 48 00 00 48 */ b lbl_8000AD34
.global lbl_8000ACF0
lbl_8000ACF0:
/* 8000ACF0 00006B30 80 BF 00 38 */ lwz r5, 0x38(r31)
/* 8000ACF4 00006B34 38 61 00 08 */ addi r3, r1, 0x8
/* 8000ACF8 00006B38 81 85 00 24 */ lwz r12, 0x24(r5)
/* 8000ACFC 00006B3C 7D 89 03 A6 */ mtctr r12
/* 8000AD00 00006B40 3B 9C 00 02 */ addi r28, r28, 0x2
/* 8000AD04 00006B44 4E 80 04 21 */ bctrl
/* 8000AD08 00006B48 7C 1D 1A 14 */ add r0, r29, r3
/* 8000AD0C 00006B4C 7C 7E 1B 78 */ mr r30, r3
/* 8000AD10 00006B50 7C 00 D8 40 */ cmplw r0, r27
/* 8000AD14 00006B54 41 81 00 20 */ bgt lbl_8000AD34
/* 8000AD18 00006B58 7F C5 F3 78 */ mr r5, r30
/* 8000AD1C 00006B5C 7C 7A EA 14 */ add r3, r26, r29
/* 8000AD20 00006B60 38 81 00 08 */ addi r4, r1, 0x8
/* 8000AD24 00006B64 48 00 2D 5D */ bl strncpy
/* 8000AD28 00006B68 7F BD F2 14 */ add r29, r29, r30
.global lbl_8000AD2C
lbl_8000AD2C:
/* 8000AD2C 00006B6C 7C 1D D8 40 */ cmplw r29, r27
/* 8000AD30 00006B70 40 81 FF A8 */ ble lbl_8000ACD8
.global lbl_8000AD34
lbl_8000AD34:
/* 8000AD34 00006B74 7F A3 EB 78 */ mr r3, r29
.global lbl_8000AD38
lbl_8000AD38:
/* 8000AD38 00006B78 BB 41 00 18 */ lmw r26, 0x18(r1)
/* 8000AD3C 00006B7C 80 01 00 34 */ lwz r0, 0x34(r1)
/* 8000AD40 00006B80 7C 08 03 A6 */ mtlr r0
/* 8000AD44 00006B84 38 21 00 30 */ addi r1, r1, 0x30
/* 8000AD48 00006B88 4E 80 00 20 */ blr