papermario/ver/jp/asm/nonmatchings/3FE70/_Printf.s
Ethan Roseman 3315d6010f
Splat refactor (#257)
* all non-world rodata migrated

* data disasm

* kinda working

* updated yaml

* bloop

* linker header

* configure 2.0

* bin

* mass rename to remove code_

* pause rename

* battle partner stuff

* whew

* more renames

* more renames

* more renaming

* it builds!

* updates

* remove main prefix

* one more thing

* crc, yay0

* .data, .rodata, .bss

* img

* dead_atan2

* it buildsgit add -A

* split battle/partner/6FAD10

* rm &s on sleepy_sheep syms

* sha1sum ninja rule description

* OK but commented out PaperMarioMapFS and PaperMarioNpcSprites

* uncomment

* fix mapfs

* match func_8003CFB4

* .

* clean up and name npc_iter_no_op

* npc.c

* enable cc warnings

* name npc_find_near

* use singular options.asset_path

* smores

* cc_dsl only when needed

* kinda fix configure for splat refactor2

* ok!

* new msg format

* remove old msg format docs

* slight bug fixes, splat adjustment

* git subrepo pull (merge) --force tools/splat

subrepo:
  subdir:   "tools/splat"
  merged:   "cfc140bb76"
upstream:
  origin:   "https://github.com/ethteck/splat.git"
  branch:   "master"
  commit:   "cfc140bb76"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

* git subrepo pull (merge) --force tools/splat

subrepo:
  subdir:   "tools/splat"
  merged:   "85349befcd"
upstream:
  origin:   "https://github.com/ethteck/splat.git"
  branch:   "master"
  commit:   "85349befcd"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

* Update symbol addrs

* git subrepo pull tools/splat

subrepo:
  subdir:   "tools/splat"
  merged:   "a44631e194"
upstream:
  origin:   "https://github.com/ethteck/splat.git"
  branch:   "master"
  commit:   "a44631e194"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

Co-authored-by: Alex Bates <hi@imalex.xyz>
2021-04-13 16:47:52 +09:00

399 lines
20 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel _Printf
/* 3FE70 80064A70 27BDFF50 */ addiu $sp, $sp, -0xb0
/* 3FE74 80064A74 AFB400A0 */ sw $s4, 0xa0($sp)
/* 3FE78 80064A78 0080A021 */ addu $s4, $a0, $zero
/* 3FE7C 80064A7C AFB3009C */ sw $s3, 0x9c($sp)
/* 3FE80 80064A80 00A09821 */ addu $s3, $a1, $zero
/* 3FE84 80064A84 00C02821 */ addu $a1, $a2, $zero
/* 3FE88 80064A88 AFB500A4 */ sw $s5, 0xa4($sp)
/* 3FE8C 80064A8C 3C15800A */ lui $s5, %hi(D_80099BD0)
/* 3FE90 80064A90 26B59BD0 */ addiu $s5, $s5, %lo(D_80099BD0)
/* 3FE94 80064A94 AFBF00A8 */ sw $ra, 0xa8($sp)
/* 3FE98 80064A98 AFB20098 */ sw $s2, 0x98($sp)
/* 3FE9C 80064A9C AFB10094 */ sw $s1, 0x94($sp)
/* 3FEA0 80064AA0 AFB00090 */ sw $s0, 0x90($sp)
/* 3FEA4 80064AA4 AFA700BC */ sw $a3, 0xbc($sp)
/* 3FEA8 80064AA8 AFA0003C */ sw $zero, 0x3c($sp)
.L80064AAC:
/* 3FEAC 80064AAC 80A20000 */ lb $v0, ($a1)
/* 3FEB0 80064AB0 90B10000 */ lbu $s1, ($a1)
/* 3FEB4 80064AB4 080192B1 */ j .L80064AC4
/* 3FEB8 80064AB8 00A09021 */ addu $s2, $a1, $zero
.L80064ABC:
/* 3FEBC 80064ABC 82420000 */ lb $v0, ($s2)
/* 3FEC0 80064AC0 92510000 */ lbu $s1, ($s2)
.L80064AC4:
/* 3FEC4 80064AC4 0002182B */ sltu $v1, $zero, $v0
/* 3FEC8 80064AC8 38420025 */ xori $v0, $v0, 0x25
/* 3FECC 80064ACC 0002102B */ sltu $v0, $zero, $v0
/* 3FED0 80064AD0 00621824 */ and $v1, $v1, $v0
/* 3FED4 80064AD4 5460FFF9 */ bnel $v1, $zero, .L80064ABC
/* 3FED8 80064AD8 26520001 */ addiu $s2, $s2, 1
/* 3FEDC 80064ADC 02458023 */ subu $s0, $s2, $a1
/* 3FEE0 80064AE0 1A000009 */ blez $s0, .L80064B08
/* 3FEE4 80064AE4 02602021 */ addu $a0, $s3, $zero
/* 3FEE8 80064AE8 0280F809 */ jalr $s4
/* 3FEEC 80064AEC 02003021 */ addu $a2, $s0, $zero
/* 3FEF0 80064AF0 00409821 */ addu $s3, $v0, $zero
/* 3FEF4 80064AF4 12600134 */ beqz $s3, .L80064FC8
/* 3FEF8 80064AF8 00000000 */ nop
/* 3FEFC 80064AFC 8FA2003C */ lw $v0, 0x3c($sp)
/* 3FF00 80064B00 00501021 */ addu $v0, $v0, $s0
/* 3FF04 80064B04 AFA2003C */ sw $v0, 0x3c($sp)
.L80064B08:
/* 3FF08 80064B08 1220012F */ beqz $s1, .L80064FC8
/* 3FF0C 80064B0C 26520001 */ addiu $s2, $s2, 1
/* 3FF10 80064B10 AFA00040 */ sw $zero, 0x40($sp)
/* 3FF14 80064B14 3C10800A */ lui $s0, %hi(D_80099BD8)
/* 3FF18 80064B18 26109BD8 */ addiu $s0, $s0, %lo(D_80099BD8)
.L80064B1C:
/* 3FF1C 80064B1C 82450000 */ lb $a1, ($s2)
/* 3FF20 80064B20 0C019278 */ jal func_800649E0
/* 3FF24 80064B24 02A02021 */ addu $a0, $s5, $zero
/* 3FF28 80064B28 10400009 */ beqz $v0, .L80064B50
/* 3FF2C 80064B2C 00551023 */ subu $v0, $v0, $s5
/* 3FF30 80064B30 00021080 */ sll $v0, $v0, 2
/* 3FF34 80064B34 00501021 */ addu $v0, $v0, $s0
/* 3FF38 80064B38 8FA30040 */ lw $v1, 0x40($sp)
/* 3FF3C 80064B3C 8C420000 */ lw $v0, ($v0)
/* 3FF40 80064B40 26520001 */ addiu $s2, $s2, 1
/* 3FF44 80064B44 00621825 */ or $v1, $v1, $v0
/* 3FF48 80064B48 080192C7 */ j .L80064B1C
/* 3FF4C 80064B4C AFA30040 */ sw $v1, 0x40($sp)
.L80064B50:
/* 3FF50 80064B50 82430000 */ lb $v1, ($s2)
/* 3FF54 80064B54 2402002A */ addiu $v0, $zero, 0x2a
/* 3FF58 80064B58 14620011 */ bne $v1, $v0, .L80064BA0
/* 3FF5C 80064B5C 00602021 */ addu $a0, $v1, $zero
/* 3FF60 80064B60 8FA200BC */ lw $v0, 0xbc($sp)
/* 3FF64 80064B64 2403FFFC */ addiu $v1, $zero, -4
/* 3FF68 80064B68 24420003 */ addiu $v0, $v0, 3
/* 3FF6C 80064B6C 00431024 */ and $v0, $v0, $v1
/* 3FF70 80064B70 24430004 */ addiu $v1, $v0, 4
/* 3FF74 80064B74 AFA300BC */ sw $v1, 0xbc($sp)
/* 3FF78 80064B78 8C420000 */ lw $v0, ($v0)
/* 3FF7C 80064B7C 04410006 */ bgez $v0, .L80064B98
/* 3FF80 80064B80 AFA20038 */ sw $v0, 0x38($sp)
/* 3FF84 80064B84 8FA30040 */ lw $v1, 0x40($sp)
/* 3FF88 80064B88 00021023 */ negu $v0, $v0
/* 3FF8C 80064B8C AFA20038 */ sw $v0, 0x38($sp)
/* 3FF90 80064B90 34630004 */ ori $v1, $v1, 4
/* 3FF94 80064B94 AFA30040 */ sw $v1, 0x40($sp)
.L80064B98:
/* 3FF98 80064B98 080192FE */ j .L80064BF8
/* 3FF9C 80064B9C 26520001 */ addiu $s2, $s2, 1
.L80064BA0:
/* 3FFA0 80064BA0 2482FFD0 */ addiu $v0, $a0, -0x30
/* 3FFA4 80064BA4 304200FF */ andi $v0, $v0, 0xff
/* 3FFA8 80064BA8 2C42000A */ sltiu $v0, $v0, 0xa
/* 3FFAC 80064BAC 10400012 */ beqz $v0, .L80064BF8
/* 3FFB0 80064BB0 AFA00038 */ sw $zero, 0x38($sp)
.L80064BB4:
/* 3FFB4 80064BB4 8FA40038 */ lw $a0, 0x38($sp)
/* 3FFB8 80064BB8 288203E7 */ slti $v0, $a0, 0x3e7
/* 3FFBC 80064BBC 50400009 */ beql $v0, $zero, .L80064BE4
/* 3FFC0 80064BC0 26520001 */ addiu $s2, $s2, 1
/* 3FFC4 80064BC4 00041080 */ sll $v0, $a0, 2
/* 3FFC8 80064BC8 82430000 */ lb $v1, ($s2)
/* 3FFCC 80064BCC 00441021 */ addu $v0, $v0, $a0
/* 3FFD0 80064BD0 00021040 */ sll $v0, $v0, 1
/* 3FFD4 80064BD4 00431021 */ addu $v0, $v0, $v1
/* 3FFD8 80064BD8 2442FFD0 */ addiu $v0, $v0, -0x30
/* 3FFDC 80064BDC AFA20038 */ sw $v0, 0x38($sp)
/* 3FFE0 80064BE0 26520001 */ addiu $s2, $s2, 1
.L80064BE4:
/* 3FFE4 80064BE4 92420000 */ lbu $v0, ($s2)
/* 3FFE8 80064BE8 2442FFD0 */ addiu $v0, $v0, -0x30
/* 3FFEC 80064BEC 2C42000A */ sltiu $v0, $v0, 0xa
/* 3FFF0 80064BF0 1440FFF0 */ bnez $v0, .L80064BB4
/* 3FFF4 80064BF4 00000000 */ nop
.L80064BF8:
/* 3FFF8 80064BF8 82430000 */ lb $v1, ($s2)
/* 3FFFC 80064BFC 2402002E */ addiu $v0, $zero, 0x2e
/* 40000 80064C00 10620003 */ beq $v1, $v0, .L80064C10
/* 40004 80064C04 2402FFFF */ addiu $v0, $zero, -1
/* 40008 80064C08 08019329 */ j .L80064CA4
/* 4000C 80064C0C AFA20034 */ sw $v0, 0x34($sp)
.L80064C10:
/* 40010 80064C10 26520001 */ addiu $s2, $s2, 1
/* 40014 80064C14 82430000 */ lb $v1, ($s2)
/* 40018 80064C18 2402002A */ addiu $v0, $zero, 0x2a
/* 4001C 80064C1C 1462000B */ bne $v1, $v0, .L80064C4C
/* 40020 80064C20 00602021 */ addu $a0, $v1, $zero
/* 40024 80064C24 8FA300BC */ lw $v1, 0xbc($sp)
/* 40028 80064C28 2402FFFC */ addiu $v0, $zero, -4
/* 4002C 80064C2C 24630003 */ addiu $v1, $v1, 3
/* 40030 80064C30 00621824 */ and $v1, $v1, $v0
/* 40034 80064C34 24620004 */ addiu $v0, $v1, 4
/* 40038 80064C38 AFA200BC */ sw $v0, 0xbc($sp)
/* 4003C 80064C3C 8C620000 */ lw $v0, ($v1)
/* 40040 80064C40 26520001 */ addiu $s2, $s2, 1
/* 40044 80064C44 08019329 */ j .L80064CA4
/* 40048 80064C48 AFA20034 */ sw $v0, 0x34($sp)
.L80064C4C:
/* 4004C 80064C4C 2482FFD0 */ addiu $v0, $a0, -0x30
/* 40050 80064C50 304200FF */ andi $v0, $v0, 0xff
/* 40054 80064C54 2C42000A */ sltiu $v0, $v0, 0xa
/* 40058 80064C58 10400012 */ beqz $v0, .L80064CA4
/* 4005C 80064C5C AFA00034 */ sw $zero, 0x34($sp)
.L80064C60:
/* 40060 80064C60 8FA40034 */ lw $a0, 0x34($sp)
/* 40064 80064C64 288203E7 */ slti $v0, $a0, 0x3e7
/* 40068 80064C68 50400009 */ beql $v0, $zero, .L80064C90
/* 4006C 80064C6C 26520001 */ addiu $s2, $s2, 1
/* 40070 80064C70 00041080 */ sll $v0, $a0, 2
/* 40074 80064C74 82430000 */ lb $v1, ($s2)
/* 40078 80064C78 00441021 */ addu $v0, $v0, $a0
/* 4007C 80064C7C 00021040 */ sll $v0, $v0, 1
/* 40080 80064C80 00431021 */ addu $v0, $v0, $v1
/* 40084 80064C84 2442FFD0 */ addiu $v0, $v0, -0x30
/* 40088 80064C88 AFA20034 */ sw $v0, 0x34($sp)
/* 4008C 80064C8C 26520001 */ addiu $s2, $s2, 1
.L80064C90:
/* 40090 80064C90 92420000 */ lbu $v0, ($s2)
/* 40094 80064C94 2442FFD0 */ addiu $v0, $v0, -0x30
/* 40098 80064C98 2C42000A */ sltiu $v0, $v0, 0xa
/* 4009C 80064C9C 1440FFF0 */ bnez $v0, .L80064C60
/* 400A0 80064CA0 00000000 */ nop
.L80064CA4:
/* 400A4 80064CA4 82450000 */ lb $a1, ($s2)
/* 400A8 80064CA8 3C04800A */ lui $a0, %hi(D_80099BF0)
/* 400AC 80064CAC 24849BF0 */ addiu $a0, $a0, %lo(D_80099BF0)
/* 400B0 80064CB0 0C019278 */ jal func_800649E0
/* 400B4 80064CB4 00A08021 */ addu $s0, $a1, $zero
/* 400B8 80064CB8 10400003 */ beqz $v0, .L80064CC8
/* 400BC 80064CBC 02001021 */ addu $v0, $s0, $zero
/* 400C0 80064CC0 08019333 */ j .L80064CCC
/* 400C4 80064CC4 26520001 */ addiu $s2, $s2, 1
.L80064CC8:
/* 400C8 80064CC8 00001021 */ addu $v0, $zero, $zero
.L80064CCC:
/* 400CC 80064CCC A3A20044 */ sb $v0, 0x44($sp)
/* 400D0 80064CD0 00021600 */ sll $v0, $v0, 0x18
/* 400D4 80064CD4 00021E03 */ sra $v1, $v0, 0x18
/* 400D8 80064CD8 2402006C */ addiu $v0, $zero, 0x6c
/* 400DC 80064CDC 14620007 */ bne $v1, $v0, .L80064CFC
/* 400E0 80064CE0 27A40010 */ addiu $a0, $sp, 0x10
/* 400E4 80064CE4 82420000 */ lb $v0, ($s2)
/* 400E8 80064CE8 14430004 */ bne $v0, $v1, .L80064CFC
/* 400EC 80064CEC 2402004C */ addiu $v0, $zero, 0x4c
/* 400F0 80064CF0 A3A20044 */ sb $v0, 0x44($sp)
/* 400F4 80064CF4 26520001 */ addiu $s2, $s2, 1
/* 400F8 80064CF8 27A40010 */ addiu $a0, $sp, 0x10
.L80064CFC:
/* 400FC 80064CFC 82460000 */ lb $a2, ($s2)
/* 40100 80064D00 27A500BC */ addiu $a1, $sp, 0xbc
/* 40104 80064D04 0C0193FC */ jal func_80064FF0
/* 40108 80064D08 27A70048 */ addiu $a3, $sp, 0x48
/* 4010C 80064D0C 8FA3001C */ lw $v1, 0x1c($sp)
/* 40110 80064D10 8FA20020 */ lw $v0, 0x20($sp)
/* 40114 80064D14 00621821 */ addu $v1, $v1, $v0
/* 40118 80064D18 8FA20024 */ lw $v0, 0x24($sp)
/* 4011C 80064D1C 8FA40028 */ lw $a0, 0x28($sp)
/* 40120 80064D20 8FA5002C */ lw $a1, 0x2c($sp)
/* 40124 80064D24 00621821 */ addu $v1, $v1, $v0
/* 40128 80064D28 00641821 */ addu $v1, $v1, $a0
/* 4012C 80064D2C 00651821 */ addu $v1, $v1, $a1
/* 40130 80064D30 8FA40030 */ lw $a0, 0x30($sp)
/* 40134 80064D34 8FA50038 */ lw $a1, 0x38($sp)
/* 40138 80064D38 8FA20040 */ lw $v0, 0x40($sp)
/* 4013C 80064D3C 00641821 */ addu $v1, $v1, $a0
/* 40140 80064D40 00A32823 */ subu $a1, $a1, $v1
/* 40144 80064D44 30420004 */ andi $v0, $v0, 4
/* 40148 80064D48 14400017 */ bnez $v0, .L80064DA8
/* 4014C 80064D4C AFA50038 */ sw $a1, 0x38($sp)
/* 40150 80064D50 18A00015 */ blez $a1, .L80064DA8
/* 40154 80064D54 00000000 */ nop
/* 40158 80064D58 00A08821 */ addu $s1, $a1, $zero
/* 4015C 80064D5C 2E220021 */ sltiu $v0, $s1, 0x21
.L80064D60:
/* 40160 80064D60 10400002 */ beqz $v0, .L80064D6C
/* 40164 80064D64 24100020 */ addiu $s0, $zero, 0x20
/* 40168 80064D68 02208021 */ addu $s0, $s1, $zero
.L80064D6C:
/* 4016C 80064D6C 5A00000C */ blezl $s0, .L80064DA0
/* 40170 80064D70 02308823 */ subu $s1, $s1, $s0
/* 40174 80064D74 02602021 */ addu $a0, $s3, $zero
/* 40178 80064D78 3C058009 */ lui $a1, %hi(D_800945C0)
/* 4017C 80064D7C 24A545C0 */ addiu $a1, $a1, %lo(D_800945C0)
/* 40180 80064D80 0280F809 */ jalr $s4
/* 40184 80064D84 02003021 */ addu $a2, $s0, $zero
/* 40188 80064D88 00409821 */ addu $s3, $v0, $zero
/* 4018C 80064D8C 1260008E */ beqz $s3, .L80064FC8
/* 40190 80064D90 02308823 */ subu $s1, $s1, $s0
/* 40194 80064D94 8FA2003C */ lw $v0, 0x3c($sp)
/* 40198 80064D98 00501021 */ addu $v0, $v0, $s0
/* 4019C 80064D9C AFA2003C */ sw $v0, 0x3c($sp)
.L80064DA0:
/* 401A0 80064DA0 1E20FFEF */ bgtz $s1, .L80064D60
/* 401A4 80064DA4 2E220021 */ sltiu $v0, $s1, 0x21
.L80064DA8:
/* 401A8 80064DA8 8FA6001C */ lw $a2, 0x1c($sp)
/* 401AC 80064DAC 18C0000A */ blez $a2, .L80064DD8
/* 401B0 80064DB0 02602021 */ addu $a0, $s3, $zero
/* 401B4 80064DB4 0280F809 */ jalr $s4
/* 401B8 80064DB8 27A50048 */ addiu $a1, $sp, 0x48
/* 401BC 80064DBC 00409821 */ addu $s3, $v0, $zero
/* 401C0 80064DC0 12600081 */ beqz $s3, .L80064FC8
/* 401C4 80064DC4 00000000 */ nop
/* 401C8 80064DC8 8FA2003C */ lw $v0, 0x3c($sp)
/* 401CC 80064DCC 8FA3001C */ lw $v1, 0x1c($sp)
/* 401D0 80064DD0 00431021 */ addu $v0, $v0, $v1
/* 401D4 80064DD4 AFA2003C */ sw $v0, 0x3c($sp)
.L80064DD8:
/* 401D8 80064DD8 8FA20020 */ lw $v0, 0x20($sp)
/* 401DC 80064DDC 18400015 */ blez $v0, .L80064E34
/* 401E0 80064DE0 00000000 */ nop
/* 401E4 80064DE4 00408821 */ addu $s1, $v0, $zero
/* 401E8 80064DE8 2E220021 */ sltiu $v0, $s1, 0x21
.L80064DEC:
/* 401EC 80064DEC 10400002 */ beqz $v0, .L80064DF8
/* 401F0 80064DF0 24100020 */ addiu $s0, $zero, 0x20
/* 401F4 80064DF4 02208021 */ addu $s0, $s1, $zero
.L80064DF8:
/* 401F8 80064DF8 5A00000C */ blezl $s0, .L80064E2C
/* 401FC 80064DFC 02308823 */ subu $s1, $s1, $s0
/* 40200 80064E00 02602021 */ addu $a0, $s3, $zero
/* 40204 80064E04 3C058009 */ lui $a1, %hi(D_800945E4)
/* 40208 80064E08 24A545E4 */ addiu $a1, $a1, %lo(D_800945E4)
/* 4020C 80064E0C 0280F809 */ jalr $s4
/* 40210 80064E10 02003021 */ addu $a2, $s0, $zero
/* 40214 80064E14 00409821 */ addu $s3, $v0, $zero
/* 40218 80064E18 1260006B */ beqz $s3, .L80064FC8
/* 4021C 80064E1C 02308823 */ subu $s1, $s1, $s0
/* 40220 80064E20 8FA2003C */ lw $v0, 0x3c($sp)
/* 40224 80064E24 00501021 */ addu $v0, $v0, $s0
/* 40228 80064E28 AFA2003C */ sw $v0, 0x3c($sp)
.L80064E2C:
/* 4022C 80064E2C 1E20FFEF */ bgtz $s1, .L80064DEC
/* 40230 80064E30 2E220021 */ sltiu $v0, $s1, 0x21
.L80064E34:
/* 40234 80064E34 8FA60024 */ lw $a2, 0x24($sp)
/* 40238 80064E38 18C0000B */ blez $a2, .L80064E68
/* 4023C 80064E3C 00000000 */ nop
/* 40240 80064E40 8FA50018 */ lw $a1, 0x18($sp)
/* 40244 80064E44 0280F809 */ jalr $s4
/* 40248 80064E48 02602021 */ addu $a0, $s3, $zero
/* 4024C 80064E4C 00409821 */ addu $s3, $v0, $zero
/* 40250 80064E50 1260005D */ beqz $s3, .L80064FC8
/* 40254 80064E54 00000000 */ nop
/* 40258 80064E58 8FA2003C */ lw $v0, 0x3c($sp)
/* 4025C 80064E5C 8FA30024 */ lw $v1, 0x24($sp)
/* 40260 80064E60 00431021 */ addu $v0, $v0, $v1
/* 40264 80064E64 AFA2003C */ sw $v0, 0x3c($sp)
.L80064E68:
/* 40268 80064E68 8FA20028 */ lw $v0, 0x28($sp)
/* 4026C 80064E6C 18400015 */ blez $v0, .L80064EC4
/* 40270 80064E70 00000000 */ nop
/* 40274 80064E74 00408821 */ addu $s1, $v0, $zero
/* 40278 80064E78 2E220021 */ sltiu $v0, $s1, 0x21
.L80064E7C:
/* 4027C 80064E7C 10400002 */ beqz $v0, .L80064E88
/* 40280 80064E80 24100020 */ addiu $s0, $zero, 0x20
/* 40284 80064E84 02208021 */ addu $s0, $s1, $zero
.L80064E88:
/* 40288 80064E88 5A00000C */ blezl $s0, .L80064EBC
/* 4028C 80064E8C 02308823 */ subu $s1, $s1, $s0
/* 40290 80064E90 02602021 */ addu $a0, $s3, $zero
/* 40294 80064E94 3C058009 */ lui $a1, %hi(D_800945E4)
/* 40298 80064E98 24A545E4 */ addiu $a1, $a1, %lo(D_800945E4)
/* 4029C 80064E9C 0280F809 */ jalr $s4
/* 402A0 80064EA0 02003021 */ addu $a2, $s0, $zero
/* 402A4 80064EA4 00409821 */ addu $s3, $v0, $zero
/* 402A8 80064EA8 12600047 */ beqz $s3, .L80064FC8
/* 402AC 80064EAC 02308823 */ subu $s1, $s1, $s0
/* 402B0 80064EB0 8FA2003C */ lw $v0, 0x3c($sp)
/* 402B4 80064EB4 00501021 */ addu $v0, $v0, $s0
/* 402B8 80064EB8 AFA2003C */ sw $v0, 0x3c($sp)
.L80064EBC:
/* 402BC 80064EBC 1E20FFEF */ bgtz $s1, .L80064E7C
/* 402C0 80064EC0 2E220021 */ sltiu $v0, $s1, 0x21
.L80064EC4:
/* 402C4 80064EC4 8FA6002C */ lw $a2, 0x2c($sp)
/* 402C8 80064EC8 18C0000C */ blez $a2, .L80064EFC
/* 402CC 80064ECC 02602021 */ addu $a0, $s3, $zero
/* 402D0 80064ED0 8FA20018 */ lw $v0, 0x18($sp)
/* 402D4 80064ED4 8FA50024 */ lw $a1, 0x24($sp)
/* 402D8 80064ED8 0280F809 */ jalr $s4
/* 402DC 80064EDC 00452821 */ addu $a1, $v0, $a1
/* 402E0 80064EE0 00409821 */ addu $s3, $v0, $zero
/* 402E4 80064EE4 12600038 */ beqz $s3, .L80064FC8
/* 402E8 80064EE8 00000000 */ nop
/* 402EC 80064EEC 8FA2003C */ lw $v0, 0x3c($sp)
/* 402F0 80064EF0 8FA3002C */ lw $v1, 0x2c($sp)
/* 402F4 80064EF4 00431021 */ addu $v0, $v0, $v1
/* 402F8 80064EF8 AFA2003C */ sw $v0, 0x3c($sp)
.L80064EFC:
/* 402FC 80064EFC 8FA20030 */ lw $v0, 0x30($sp)
/* 40300 80064F00 18400015 */ blez $v0, .L80064F58
/* 40304 80064F04 00000000 */ nop
/* 40308 80064F08 00408821 */ addu $s1, $v0, $zero
/* 4030C 80064F0C 2E220021 */ sltiu $v0, $s1, 0x21
.L80064F10:
/* 40310 80064F10 10400002 */ beqz $v0, .L80064F1C
/* 40314 80064F14 24100020 */ addiu $s0, $zero, 0x20
/* 40318 80064F18 02208021 */ addu $s0, $s1, $zero
.L80064F1C:
/* 4031C 80064F1C 5A00000C */ blezl $s0, .L80064F50
/* 40320 80064F20 02308823 */ subu $s1, $s1, $s0
/* 40324 80064F24 02602021 */ addu $a0, $s3, $zero
/* 40328 80064F28 3C058009 */ lui $a1, %hi(D_800945E4)
/* 4032C 80064F2C 24A545E4 */ addiu $a1, $a1, %lo(D_800945E4)
/* 40330 80064F30 0280F809 */ jalr $s4
/* 40334 80064F34 02003021 */ addu $a2, $s0, $zero
/* 40338 80064F38 00409821 */ addu $s3, $v0, $zero
/* 4033C 80064F3C 12600022 */ beqz $s3, .L80064FC8
/* 40340 80064F40 02308823 */ subu $s1, $s1, $s0
/* 40344 80064F44 8FA2003C */ lw $v0, 0x3c($sp)
/* 40348 80064F48 00501021 */ addu $v0, $v0, $s0
/* 4034C 80064F4C AFA2003C */ sw $v0, 0x3c($sp)
.L80064F50:
/* 40350 80064F50 1E20FFEF */ bgtz $s1, .L80064F10
/* 40354 80064F54 2E220021 */ sltiu $v0, $s1, 0x21
.L80064F58:
/* 40358 80064F58 8FA20040 */ lw $v0, 0x40($sp)
/* 4035C 80064F5C 30420004 */ andi $v0, $v0, 4
/* 40360 80064F60 1040FED2 */ beqz $v0, .L80064AAC
/* 40364 80064F64 26450001 */ addiu $a1, $s2, 1
/* 40368 80064F68 8FA20038 */ lw $v0, 0x38($sp)
/* 4036C 80064F6C 1840FECF */ blez $v0, .L80064AAC
/* 40370 80064F70 00408821 */ addu $s1, $v0, $zero
/* 40374 80064F74 2E220021 */ sltiu $v0, $s1, 0x21
.L80064F78:
/* 40378 80064F78 10400002 */ beqz $v0, .L80064F84
/* 4037C 80064F7C 24100020 */ addiu $s0, $zero, 0x20
/* 40380 80064F80 02208021 */ addu $s0, $s1, $zero
.L80064F84:
/* 40384 80064F84 5A00000C */ blezl $s0, .L80064FB8
/* 40388 80064F88 02308823 */ subu $s1, $s1, $s0
/* 4038C 80064F8C 02602021 */ addu $a0, $s3, $zero
/* 40390 80064F90 3C058009 */ lui $a1, %hi(D_800945C0)
/* 40394 80064F94 24A545C0 */ addiu $a1, $a1, %lo(D_800945C0)
/* 40398 80064F98 0280F809 */ jalr $s4
/* 4039C 80064F9C 02003021 */ addu $a2, $s0, $zero
/* 403A0 80064FA0 00409821 */ addu $s3, $v0, $zero
/* 403A4 80064FA4 12600008 */ beqz $s3, .L80064FC8
/* 403A8 80064FA8 02308823 */ subu $s1, $s1, $s0
/* 403AC 80064FAC 8FA2003C */ lw $v0, 0x3c($sp)
/* 403B0 80064FB0 00501021 */ addu $v0, $v0, $s0
/* 403B4 80064FB4 AFA2003C */ sw $v0, 0x3c($sp)
.L80064FB8:
/* 403B8 80064FB8 1E20FFEF */ bgtz $s1, .L80064F78
/* 403BC 80064FBC 2E220021 */ sltiu $v0, $s1, 0x21
/* 403C0 80064FC0 080192AB */ j .L80064AAC
/* 403C4 80064FC4 26450001 */ addiu $a1, $s2, 1
.L80064FC8:
/* 403C8 80064FC8 8FA2003C */ lw $v0, 0x3c($sp)
/* 403CC 80064FCC 8FBF00A8 */ lw $ra, 0xa8($sp)
/* 403D0 80064FD0 8FB500A4 */ lw $s5, 0xa4($sp)
/* 403D4 80064FD4 8FB400A0 */ lw $s4, 0xa0($sp)
/* 403D8 80064FD8 8FB3009C */ lw $s3, 0x9c($sp)
/* 403DC 80064FDC 8FB20098 */ lw $s2, 0x98($sp)
/* 403E0 80064FE0 8FB10094 */ lw $s1, 0x94($sp)
/* 403E4 80064FE4 8FB00090 */ lw $s0, 0x90($sp)
/* 403E8 80064FE8 03E00008 */ jr $ra
/* 403EC 80064FEC 27BD00B0 */ addiu $sp, $sp, 0xb0