papermario/ver/us/asm/nonmatchings/33450/func_80058050.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

753 lines
38 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.section .rodata
glabel D_80098930
.double 1.99996
.section .text
glabel func_80058050
/* 33450 80058050 27BDFFA0 */ addiu $sp, $sp, -0x60
/* 33454 80058054 AFB60050 */ sw $s6, 0x50($sp)
/* 33458 80058058 00A0B02D */ daddu $s6, $a1, $zero
/* 3345C 8005805C AFB1003C */ sw $s1, 0x3c($sp)
/* 33460 80058060 02C0882D */ daddu $s1, $s6, $zero
/* 33464 80058064 AFB70054 */ sw $s7, 0x54($sp)
/* 33468 80058068 AFA40060 */ sw $a0, 0x60($sp)
/* 3346C 8005806C 24970048 */ addiu $s7, $a0, 0x48
/* 33470 80058070 24880038 */ addiu $t0, $a0, 0x38
/* 33474 80058074 AFB20040 */ sw $s2, 0x40($sp)
/* 33478 80058078 AFBF005C */ sw $ra, 0x5c($sp)
/* 3347C 8005807C AFBE0058 */ sw $fp, 0x58($sp)
/* 33480 80058080 AFB5004C */ sw $s5, 0x4c($sp)
/* 33484 80058084 AFB40048 */ sw $s4, 0x48($sp)
/* 33488 80058088 AFB30044 */ sw $s3, 0x44($sp)
/* 3348C 8005808C AFB00038 */ sw $s0, 0x38($sp)
/* 33490 80058090 AFA80020 */ sw $t0, 0x20($sp)
/* 33494 80058094 8C830070 */ lw $v1, 0x70($a0)
/* 33498 80058098 24020001 */ addiu $v0, $zero, 1
/* 3349C 8005809C 14620293 */ bne $v1, $v0, .L80058AEC
/* 334A0 800580A0 24920004 */ addiu $s2, $a0, 4
/* 334A4 800580A4 8FA80060 */ lw $t0, 0x60($sp)
/* 334A8 800580A8 C500003C */ lwc1 $f0, 0x3c($t0)
/* 334AC 800580AC 3C01800A */ lui $at, %hi(D_80098930)
/* 334B0 800580B0 D4228930 */ ldc1 $f2, %lo(D_80098930)($at)
/* 334B4 800580B4 46000021 */ cvt.d.s $f0, $f0
/* 334B8 800580B8 4620103C */ c.lt.d $f2, $f0
/* 334BC 800580BC 00000000 */ nop
/* 334C0 800580C0 45000007 */ bc1f .L800580E0
/* 334C4 800580C4 241E0170 */ addiu $fp, $zero, 0x170
/* 334C8 800580C8 3C013FFF */ lui $at, 0x3fff
/* 334CC 800580CC 3421FEB0 */ ori $at, $at, 0xfeb0
/* 334D0 800580D0 44810000 */ mtc1 $at, $f0
/* 334D4 800580D4 00000000 */ nop
/* 334D8 800580D8 E500003C */ swc1 $f0, 0x3c($t0)
/* 334DC 800580DC 8FA80060 */ lw $t0, 0x60($sp)
.L800580E0:
/* 334E0 800580E0 3C014700 */ lui $at, 0x4700
/* 334E4 800580E4 44811000 */ mtc1 $at, $f2
/* 334E8 800580E8 C500003C */ lwc1 $f0, 0x3c($t0)
/* 334EC 800580EC 46020002 */ mul.s $f0, $f0, $f2
/* 334F0 800580F0 00000000 */ nop
/* 334F4 800580F4 4600018D */ trunc.w.s $f6, $f0
/* 334F8 800580F8 44023000 */ mfc1 $v0, $f6
/* 334FC 800580FC 3C013800 */ lui $at, 0x3800
/* 33500 80058100 44810000 */ mtc1 $at, $f0
/* 33504 80058104 44822000 */ mtc1 $v0, $f4
/* 33508 80058108 00000000 */ nop
/* 3350C 8005810C 46802120 */ cvt.s.w $f4, $f4
/* 33510 80058110 46002102 */ mul.s $f4, $f4, $f0
/* 33514 80058114 00000000 */ nop
/* 33518 80058118 3C014338 */ lui $at, 0x4338
/* 3351C 8005811C 44810000 */ mtc1 $at, $f0
/* 33520 80058120 00000000 */ nop
/* 33524 80058124 46002002 */ mul.s $f0, $f4, $f0
/* 33528 80058128 00000000 */ nop
/* 3352C 8005812C 8FA80060 */ lw $t0, 0x60($sp)
/* 33530 80058130 C5020040 */ lwc1 $f2, 0x40($t0)
/* 33534 80058134 46001080 */ add.s $f2, $f2, $f0
/* 33538 80058138 4600118D */ trunc.w.s $f6, $f2
/* 3353C 8005813C 44143000 */ mfc1 $s4, $f6
/* 33540 80058140 00000000 */ nop
/* 33544 80058144 44940000 */ mtc1 $s4, $f0
/* 33548 80058148 00000000 */ nop
/* 3354C 8005814C 46800020 */ cvt.s.w $f0, $f0
/* 33550 80058150 46001081 */ sub.s $f2, $f2, $f0
/* 33554 80058154 8FA80060 */ lw $t0, 0x60($sp)
/* 33558 80058158 E504003C */ swc1 $f4, 0x3c($t0)
/* 3355C 8005815C 128001BA */ beqz $s4, .L80058848
/* 33560 80058160 E5020040 */ swc1 $f2, 0x40($t0)
/* 33564 80058164 8E470014 */ lw $a3, 0x14($s2)
/* 33568 80058168 90E20024 */ lbu $v0, 0x24($a3)
/* 3356C 8005816C 144000F2 */ bnez $v0, .L80058538
/* 33570 80058170 3C0300FF */ lui $v1, 0xff
/* 33574 80058174 3463FFFF */ ori $v1, $v1, 0xffff
/* 33578 80058178 AFA00024 */ sw $zero, 0x24($sp)
/* 3357C 8005817C 8D02001C */ lw $v0, 0x1c($t0)
/* 33580 80058180 3C041FFF */ lui $a0, 0x1fff
/* 33584 80058184 00431024 */ and $v0, $v0, $v1
/* 33588 80058188 3C030B00 */ lui $v1, 0xb00
/* 3358C 8005818C 00431025 */ or $v0, $v0, $v1
/* 33590 80058190 AE220000 */ sw $v0, ($s1)
/* 33594 80058194 8E420014 */ lw $v0, 0x14($s2)
/* 33598 80058198 3484FFFF */ ori $a0, $a0, 0xffff
/* 3359C 8005819C 8C420018 */ lw $v0, 0x18($v0)
/* 335A0 800581A0 8FA50024 */ lw $a1, 0x24($sp)
/* 335A4 800581A4 00441024 */ and $v0, $v0, $a0
/* 335A8 800581A8 AE220004 */ sw $v0, 4($s1)
/* 335AC 800581AC 8D040028 */ lw $a0, 0x28($t0)
/* 335B0 800581B0 8D030010 */ lw $v1, 0x10($t0)
/* 335B4 800581B4 02841021 */ addu $v0, $s4, $a0
/* 335B8 800581B8 0062102B */ sltu $v0, $v1, $v0
/* 335BC 800581BC 10400003 */ beqz $v0, .L800581CC
/* 335C0 800581C0 26D60008 */ addiu $s6, $s6, 8
/* 335C4 800581C4 8D020014 */ lw $v0, 0x14($t0)
/* 335C8 800581C8 0002282B */ sltu $a1, $zero, $v0
.L800581CC:
/* 335CC 800581CC 10A00002 */ beqz $a1, .L800581D8
/* 335D0 800581D0 0280802D */ daddu $s0, $s4, $zero
/* 335D4 800581D4 00648023 */ subu $s0, $v1, $a0
.L800581D8:
/* 335D8 800581D8 8E430028 */ lw $v1, 0x28($s2)
/* 335DC 800581DC 10600003 */ beqz $v1, .L800581EC
/* 335E0 800581E0 24020010 */ addiu $v0, $zero, 0x10
/* 335E4 800581E4 0801607C */ j .L800581F0
/* 335E8 800581E8 0043A823 */ subu $s5, $v0, $v1
.L800581EC:
/* 335EC 800581EC 0000A82D */ daddu $s5, $zero, $zero
.L800581F0:
/* 335F0 800581F0 02153023 */ subu $a2, $s0, $s5
/* 335F4 800581F4 04C20001 */ bltzl $a2, .L800581FC
/* 335F8 800581F8 0000302D */ daddu $a2, $zero, $zero
.L800581FC:
/* 335FC 800581FC 24C2000F */ addiu $v0, $a2, 0xf
/* 33600 80058200 00028903 */ sra $s1, $v0, 4
/* 33604 80058204 001110C0 */ sll $v0, $s1, 3
/* 33608 80058208 10A00072 */ beqz $a1, .L800583D4
/* 3360C 8005820C 00513821 */ addu $a3, $v0, $s1
/* 33610 80058210 02C0202D */ daddu $a0, $s6, $zero
/* 33614 80058214 001E1400 */ sll $v0, $fp, 0x10
/* 33618 80058218 00021403 */ sra $v0, $v0, 0x10
/* 3361C 8005821C AFA20010 */ sw $v0, 0x10($sp)
/* 33620 80058220 AFA00014 */ sw $zero, 0x14($sp)
/* 33624 80058224 8E42002C */ lw $v0, 0x2c($s2)
/* 33628 80058228 0240282D */ daddu $a1, $s2, $zero
/* 3362C 8005822C 0C0162C8 */ jal func_80058B20
/* 33630 80058230 AFA20018 */ sw $v0, 0x18($sp)
/* 33634 80058234 8E430028 */ lw $v1, 0x28($s2)
/* 33638 80058238 10600005 */ beqz $v1, .L80058250
/* 3363C 8005823C 0040B02D */ daddu $s6, $v0, $zero
/* 33640 80058240 9642002A */ lhu $v0, 0x2a($s2)
/* 33644 80058244 00021040 */ sll $v0, $v0, 1
/* 33648 80058248 08016095 */ j .L80058254
/* 3364C 8005824C 03C2F021 */ addu $fp, $fp, $v0
.L80058250:
/* 33650 80058250 27DE0020 */ addiu $fp, $fp, 0x20
.L80058254:
/* 33654 80058254 001E2C00 */ sll $a1, $fp, 0x10
/* 33658 80058258 8E420008 */ lw $v0, 8($s2)
/* 3365C 8005825C 00059C03 */ sra $s3, $a1, 0x10
/* 33660 80058260 3042000F */ andi $v0, $v0, 0xf
/* 33664 80058264 AE420028 */ sw $v0, 0x28($s2)
/* 33668 80058268 8E420014 */ lw $v0, 0x14($s2)
/* 3366C 8005826C 8E430008 */ lw $v1, 8($s2)
/* 33670 80058270 8C440000 */ lw $a0, ($v0)
/* 33674 80058274 0060102D */ daddu $v0, $v1, $zero
/* 33678 80058278 00031902 */ srl $v1, $v1, 4
/* 3367C 8005827C 24630001 */ addiu $v1, $v1, 1
/* 33680 80058280 AE420024 */ sw $v0, 0x24($s2)
/* 33684 80058284 000310C0 */ sll $v0, $v1, 3
/* 33688 80058288 00431021 */ addu $v0, $v0, $v1
/* 3368C 8005828C 00822021 */ addu $a0, $a0, $v0
/* 33690 80058290 0214102A */ slt $v0, $s0, $s4
/* 33694 80058294 10400042 */ beqz $v0, .L800583A0
/* 33698 80058298 AE440030 */ sw $a0, 0x30($s2)
/* 3369C 8005829C 0000402D */ daddu $t0, $zero, $zero
/* 336A0 800582A0 00081400 */ sll $v0, $t0, 0x10
/* 336A4 800582A4 00021403 */ sra $v0, $v0, 0x10
/* 336A8 800582A8 AFA2002C */ sw $v0, 0x2c($sp)
.L800582AC:
/* 336AC 800582AC 26220001 */ addiu $v0, $s1, 1
/* 336B0 800582B0 00021140 */ sll $v0, $v0, 5
/* 336B4 800582B4 02621021 */ addu $v0, $s3, $v0
/* 336B8 800582B8 00101840 */ sll $v1, $s0, 1
/* 336BC 800582BC 02639821 */ addu $s3, $s3, $v1
/* 336C0 800582C0 24420010 */ addiu $v0, $v0, 0x10
/* 336C4 800582C4 2403FFE0 */ addiu $v1, $zero, -0x20
/* 336C8 800582C8 0043A824 */ and $s5, $v0, $v1
/* 336CC 800582CC 8E430010 */ lw $v1, 0x10($s2)
/* 336D0 800582D0 2402FFFF */ addiu $v0, $zero, -1
/* 336D4 800582D4 10620004 */ beq $v1, $v0, .L800582E8
/* 336D8 800582D8 0290A023 */ subu $s4, $s4, $s0
/* 336DC 800582DC 10600002 */ beqz $v1, .L800582E8
/* 336E0 800582E0 00621021 */ addu $v0, $v1, $v0
/* 336E4 800582E4 AE420010 */ sw $v0, 0x10($s2)
.L800582E8:
/* 336E8 800582E8 8E43000C */ lw $v1, 0xc($s2)
/* 336EC 800582EC 8E420008 */ lw $v0, 8($s2)
/* 336F0 800582F0 00621823 */ subu $v1, $v1, $v0
/* 336F4 800582F4 0283102B */ sltu $v0, $s4, $v1
/* 336F8 800582F8 14400002 */ bnez $v0, .L80058304
/* 336FC 800582FC 0280802D */ daddu $s0, $s4, $zero
/* 33700 80058300 0060802D */ daddu $s0, $v1, $zero
.L80058304:
/* 33704 80058304 8E420028 */ lw $v0, 0x28($s2)
/* 33708 80058308 2442FFF0 */ addiu $v0, $v0, -0x10
/* 3370C 8005830C 02023021 */ addu $a2, $s0, $v0
/* 33710 80058310 04C20001 */ bltzl $a2, .L80058318
/* 33714 80058314 0000302D */ daddu $a2, $zero, $zero
.L80058318:
/* 33718 80058318 24C2000F */ addiu $v0, $a2, 0xf
/* 3371C 8005831C 00028903 */ sra $s1, $v0, 4
/* 33720 80058320 02C0202D */ daddu $a0, $s6, $zero
/* 33724 80058324 0240282D */ daddu $a1, $s2, $zero
/* 33728 80058328 00151400 */ sll $v0, $s5, 0x10
/* 3372C 8005832C 00021403 */ sra $v0, $v0, 0x10
/* 33730 80058330 8FA8002C */ lw $t0, 0x2c($sp)
/* 33734 80058334 001138C0 */ sll $a3, $s1, 3
/* 33738 80058338 AFA20010 */ sw $v0, 0x10($sp)
/* 3373C 8005833C AFA80014 */ sw $t0, 0x14($sp)
/* 33740 80058340 8E42002C */ lw $v0, 0x2c($s2)
/* 33744 80058344 00F13821 */ addu $a3, $a3, $s1
/* 33748 80058348 34420002 */ ori $v0, $v0, 2
/* 3374C 8005834C 0C0162C8 */ jal func_80058B20
/* 33750 80058350 AFA20018 */ sw $v0, 0x18($sp)
/* 33754 80058354 0040B02D */ daddu $s6, $v0, $zero
/* 33758 80058358 02C0282D */ daddu $a1, $s6, $zero
/* 3375C 8005835C 3C0600FF */ lui $a2, 0xff
/* 33760 80058360 34C6FFFF */ ori $a2, $a2, 0xffff
/* 33764 80058364 00132400 */ sll $a0, $s3, 0x10
/* 33768 80058368 00101840 */ sll $v1, $s0, 1
/* 3376C 8005836C 3063FFFF */ andi $v1, $v1, 0xffff
/* 33770 80058370 00832025 */ or $a0, $a0, $v1
/* 33774 80058374 8E420028 */ lw $v0, 0x28($s2)
/* 33778 80058378 3C030A00 */ lui $v1, 0xa00
/* 3377C 8005837C ACA40004 */ sw $a0, 4($a1)
/* 33780 80058380 00021040 */ sll $v0, $v0, 1
/* 33784 80058384 02A21021 */ addu $v0, $s5, $v0
/* 33788 80058388 00461024 */ and $v0, $v0, $a2
/* 3378C 8005838C 00431025 */ or $v0, $v0, $v1
/* 33790 80058390 ACA20000 */ sw $v0, ($a1)
/* 33794 80058394 0214102A */ slt $v0, $s0, $s4
/* 33798 80058398 1440FFC4 */ bnez $v0, .L800582AC
/* 3379C 8005839C 26D60008 */ addiu $s6, $s6, 8
.L800583A0:
/* 337A0 800583A0 8E420028 */ lw $v0, 0x28($s2)
/* 337A4 800583A4 8E430024 */ lw $v1, 0x24($s2)
/* 337A8 800583A8 02821021 */ addu $v0, $s4, $v0
/* 337AC 800583AC 3042000F */ andi $v0, $v0, 0xf
/* 337B0 800583B0 00741821 */ addu $v1, $v1, $s4
/* 337B4 800583B4 AE420028 */ sw $v0, 0x28($s2)
/* 337B8 800583B8 001110C0 */ sll $v0, $s1, 3
/* 337BC 800583BC AE430024 */ sw $v1, 0x24($s2)
/* 337C0 800583C0 8E430030 */ lw $v1, 0x30($s2)
/* 337C4 800583C4 00511021 */ addu $v0, $v0, $s1
/* 337C8 800583C8 00621821 */ addu $v1, $v1, $v0
/* 337CC 800583CC 08016212 */ j .L80058848
/* 337D0 800583D0 AE430030 */ sw $v1, 0x30($s2)
.L800583D4:
/* 337D4 800583D4 8E440014 */ lw $a0, 0x14($s2)
/* 337D8 800583D8 8E430030 */ lw $v1, 0x30($s2)
/* 337DC 800583DC 8C820000 */ lw $v0, ($a0)
/* 337E0 800583E0 8C840004 */ lw $a0, 4($a0)
/* 337E4 800583E4 00671821 */ addu $v1, $v1, $a3
/* 337E8 800583E8 00441021 */ addu $v0, $v0, $a0
/* 337EC 800583EC 00622023 */ subu $a0, $v1, $v0
/* 337F0 800583F0 1C800003 */ bgtz $a0, .L80058400
/* 337F4 800583F4 00118100 */ sll $s0, $s1, 4
/* 337F8 800583F8 08016101 */ j .L80058404
/* 337FC 800583FC 0000202D */ daddu $a0, $zero, $zero
.L80058400:
/* 33800 80058400 AEE00028 */ sw $zero, 0x28($s7)
.L80058404:
/* 33804 80058404 3C0238E3 */ lui $v0, 0x38e3
/* 33808 80058408 34428E39 */ ori $v0, $v0, 0x8e39
/* 3380C 8005840C 00820018 */ mult $a0, $v0
/* 33810 80058410 00041FC3 */ sra $v1, $a0, 0x1f
/* 33814 80058414 00004010 */ mfhi $t0
/* 33818 80058418 00081043 */ sra $v0, $t0, 1
/* 3381C 8005841C 00431023 */ subu $v0, $v0, $v1
/* 33820 80058420 00029900 */ sll $s3, $v0, 4
/* 33824 80058424 02151821 */ addu $v1, $s0, $s5
/* 33828 80058428 0073102A */ slt $v0, $v1, $s3
/* 3382C 8005842C 54400001 */ bnel $v0, $zero, .L80058434
/* 33830 80058430 0060982D */ daddu $s3, $v1, $zero
.L80058434:
/* 33834 80058434 3262000F */ andi $v0, $s3, 0xf
/* 33838 80058438 02621023 */ subu $v0, $s3, $v0
/* 3383C 8005843C 0054102A */ slt $v0, $v0, $s4
/* 33840 80058440 10400020 */ beqz $v0, .L800584C4
/* 33844 80058444 00E43823 */ subu $a3, $a3, $a0
/* 33848 80058448 24080001 */ addiu $t0, $zero, 1
/* 3384C 8005844C 02C0202D */ daddu $a0, $s6, $zero
/* 33850 80058450 0240282D */ daddu $a1, $s2, $zero
/* 33854 80058454 001E1400 */ sll $v0, $fp, 0x10
/* 33858 80058458 00021403 */ sra $v0, $v0, 0x10
/* 3385C 8005845C AFA80024 */ sw $t0, 0x24($sp)
/* 33860 80058460 AFA20010 */ sw $v0, 0x10($sp)
/* 33864 80058464 AFA00014 */ sw $zero, 0x14($sp)
/* 33868 80058468 8E42002C */ lw $v0, 0x2c($s2)
/* 3386C 8005846C 02133023 */ subu $a2, $s0, $s3
/* 33870 80058470 0C0162C8 */ jal func_80058B20
/* 33874 80058474 AFA20018 */ sw $v0, 0x18($sp)
/* 33878 80058478 8E430028 */ lw $v1, 0x28($s2)
/* 3387C 8005847C 10600005 */ beqz $v1, .L80058494
/* 33880 80058480 0040B02D */ daddu $s6, $v0, $zero
/* 33884 80058484 9642002A */ lhu $v0, 0x2a($s2)
/* 33888 80058488 00021040 */ sll $v0, $v0, 1
/* 3388C 8005848C 08016126 */ j .L80058498
/* 33890 80058490 03C2F021 */ addu $fp, $fp, $v0
.L80058494:
/* 33894 80058494 27DE0020 */ addiu $fp, $fp, 0x20
.L80058498:
/* 33898 80058498 8E420028 */ lw $v0, 0x28($s2)
/* 3389C 8005849C 8E430024 */ lw $v1, 0x24($s2)
/* 338A0 800584A0 02821021 */ addu $v0, $s4, $v0
/* 338A4 800584A4 3042000F */ andi $v0, $v0, 0xf
/* 338A8 800584A8 00741821 */ addu $v1, $v1, $s4
/* 338AC 800584AC AE420028 */ sw $v0, 0x28($s2)
/* 338B0 800584B0 001110C0 */ sll $v0, $s1, 3
/* 338B4 800584B4 AE430024 */ sw $v1, 0x24($s2)
/* 338B8 800584B8 8E430030 */ lw $v1, 0x30($s2)
/* 338BC 800584BC 08016135 */ j .L800584D4
/* 338C0 800584C0 00511021 */ addu $v0, $v0, $s1
.L800584C4:
/* 338C4 800584C4 001110C0 */ sll $v0, $s1, 3
/* 338C8 800584C8 8E430030 */ lw $v1, 0x30($s2)
/* 338CC 800584CC 00511021 */ addu $v0, $v0, $s1
/* 338D0 800584D0 AE400028 */ sw $zero, 0x28($s2)
.L800584D4:
/* 338D4 800584D4 00621821 */ addu $v1, $v1, $v0
/* 338D8 800584D8 126000DB */ beqz $s3, .L80058848
/* 338DC 800584DC AE430030 */ sw $v1, 0x30($s2)
/* 338E0 800584E0 AE400028 */ sw $zero, 0x28($s2)
/* 338E4 800584E4 8FA80024 */ lw $t0, 0x24($sp)
/* 338E8 800584E8 11000004 */ beqz $t0, .L800584FC
/* 338EC 800584EC 02B01021 */ addu $v0, $s5, $s0
/* 338F0 800584F0 00531023 */ subu $v0, $v0, $s3
/* 338F4 800584F4 08016140 */ j .L80058500
/* 338F8 800584F8 00022840 */ sll $a1, $v0, 1
.L800584FC:
/* 338FC 800584FC 0000282D */ daddu $a1, $zero, $zero
.L80058500:
/* 33900 80058500 02C0202D */ daddu $a0, $s6, $zero
/* 33904 80058504 26D60008 */ addiu $s6, $s6, 8
/* 33908 80058508 3C0300FF */ lui $v1, 0xff
/* 3390C 8005850C 3463FFFF */ ori $v1, $v1, 0xffff
/* 33910 80058510 001E1400 */ sll $v0, $fp, 0x10
/* 33914 80058514 00021403 */ sra $v0, $v0, 0x10
/* 33918 80058518 00A21021 */ addu $v0, $a1, $v0
/* 3391C 8005851C 00431024 */ and $v0, $v0, $v1
/* 33920 80058520 3C030200 */ lui $v1, 0x200
/* 33924 80058524 00431025 */ or $v0, $v0, $v1
/* 33928 80058528 AC820000 */ sw $v0, ($a0)
/* 3392C 8005852C 00131040 */ sll $v0, $s3, 1
/* 33930 80058530 08016212 */ j .L80058848
/* 33934 80058534 AC820004 */ sw $v0, 4($a0)
.L80058538:
/* 33938 80058538 8FA80060 */ lw $t0, 0x60($sp)
/* 3393C 8005853C 8D040028 */ lw $a0, 0x28($t0)
/* 33940 80058540 8D030010 */ lw $v1, 0x10($t0)
/* 33944 80058544 02841021 */ addu $v0, $s4, $a0
/* 33948 80058548 0062102B */ sltu $v0, $v1, $v0
/* 3394C 8005854C 10400079 */ beqz $v0, .L80058734
/* 33950 80058550 00148040 */ sll $s0, $s4, 1
/* 33954 80058554 8D020014 */ lw $v0, 0x14($t0)
/* 33958 80058558 10400076 */ beqz $v0, .L80058734
/* 3395C 8005855C 00649823 */ subu $s3, $v1, $a0
/* 33960 80058560 1A600017 */ blez $s3, .L800585C0
/* 33964 80058564 00138040 */ sll $s0, $s3, 1
/* 33968 80058568 0200282D */ daddu $a1, $s0, $zero
/* 3396C 8005856C 8D040034 */ lw $a0, 0x34($t0)
/* 33970 80058570 8D060024 */ lw $a2, 0x24($t0)
/* 33974 80058574 90E70025 */ lbu $a3, 0x25($a3)
/* 33978 80058578 8D020020 */ lw $v0, 0x20($t0)
/* 3397C 8005857C 0040F809 */ jalr $v0
/* 33980 80058580 26D60008 */ addiu $s6, $s6, 8
/* 33984 80058584 0040382D */ daddu $a3, $v0, $zero
/* 33988 80058588 30E60007 */ andi $a2, $a3, 7
/* 3398C 8005858C 02068021 */ addu $s0, $s0, $a2
/* 33990 80058590 3C030400 */ lui $v1, 0x400
/* 33994 80058594 34630170 */ ori $v1, $v1, 0x170
/* 33998 80058598 32020007 */ andi $v0, $s0, 7
/* 3399C 8005859C 2442FFF8 */ addiu $v0, $v0, -8
/* 339A0 800585A0 02021023 */ subu $v0, $s0, $v0
/* 339A4 800585A4 30420FFF */ andi $v0, $v0, 0xfff
/* 339A8 800585A8 00021300 */ sll $v0, $v0, 0xc
/* 339AC 800585AC 00431025 */ or $v0, $v0, $v1
/* 339B0 800585B0 AE220000 */ sw $v0, ($s1)
/* 339B4 800585B4 00E61023 */ subu $v0, $a3, $a2
/* 339B8 800585B8 08016171 */ j .L800585C4
/* 339BC 800585BC AE220004 */ sw $v0, 4($s1)
.L800585C0:
/* 339C0 800585C0 0000302D */ daddu $a2, $zero, $zero
.L800585C4:
/* 339C4 800585C4 03C61021 */ addu $v0, $fp, $a2
/* 339C8 800585C8 0040F02D */ daddu $fp, $v0, $zero
/* 339CC 800585CC 00021400 */ sll $v0, $v0, 0x10
/* 339D0 800585D0 0002AC03 */ sra $s5, $v0, 0x10
/* 339D4 800585D4 0274102A */ slt $v0, $s3, $s4
/* 339D8 800585D8 8E430008 */ lw $v1, 8($s2)
/* 339DC 800585DC 8E440014 */ lw $a0, 0x14($s2)
/* 339E0 800585E0 0060282D */ daddu $a1, $v1, $zero
/* 339E4 800585E4 8C840000 */ lw $a0, ($a0)
/* 339E8 800585E8 00031840 */ sll $v1, $v1, 1
/* 339EC 800585EC AE450024 */ sw $a1, 0x24($s2)
/* 339F0 800585F0 00832021 */ addu $a0, $a0, $v1
/* 339F4 800585F4 10400047 */ beqz $v0, .L80058714
/* 339F8 800585F8 AE440030 */ sw $a0, 0x30($s2)
/* 339FC 800585FC 26D1FFFC */ addiu $s1, $s6, -4
/* 33A00 80058600 00131040 */ sll $v0, $s3, 1
.L80058604:
/* 33A04 80058604 02A2A821 */ addu $s5, $s5, $v0
/* 33A08 80058608 8E430010 */ lw $v1, 0x10($s2)
/* 33A0C 8005860C 2402FFFF */ addiu $v0, $zero, -1
/* 33A10 80058610 10620004 */ beq $v1, $v0, .L80058624
/* 33A14 80058614 0293A023 */ subu $s4, $s4, $s3
/* 33A18 80058618 10600002 */ beqz $v1, .L80058624
/* 33A1C 8005861C 00621021 */ addu $v0, $v1, $v0
/* 33A20 80058620 AE420010 */ sw $v0, 0x10($s2)
.L80058624:
/* 33A24 80058624 8E43000C */ lw $v1, 0xc($s2)
/* 33A28 80058628 8E420008 */ lw $v0, 8($s2)
/* 33A2C 8005862C 00621823 */ subu $v1, $v1, $v0
/* 33A30 80058630 0283102B */ sltu $v0, $s4, $v1
/* 33A34 80058634 14400002 */ bnez $v0, .L80058640
/* 33A38 80058638 0280982D */ daddu $s3, $s4, $zero
/* 33A3C 8005863C 0060982D */ daddu $s3, $v1, $zero
.L80058640:
/* 33A40 80058640 00138040 */ sll $s0, $s3, 1
/* 33A44 80058644 8E440030 */ lw $a0, 0x30($s2)
/* 33A48 80058648 8E420014 */ lw $v0, 0x14($s2)
/* 33A4C 8005864C 8E460020 */ lw $a2, 0x20($s2)
/* 33A50 80058650 90470025 */ lbu $a3, 0x25($v0)
/* 33A54 80058654 8E42001C */ lw $v0, 0x1c($s2)
/* 33A58 80058658 0040F809 */ jalr $v0
/* 33A5C 8005865C 0200282D */ daddu $a1, $s0, $zero
/* 33A60 80058660 0040382D */ daddu $a3, $v0, $zero
/* 33A64 80058664 30E60007 */ andi $a2, $a3, 7
/* 33A68 80058668 32A30007 */ andi $v1, $s5, 7
/* 33A6C 8005866C 10600004 */ beqz $v1, .L80058680
/* 33A70 80058670 02068021 */ addu $s0, $s0, $a2
/* 33A74 80058674 24020008 */ addiu $v0, $zero, 8
/* 33A78 80058678 080161A1 */ j .L80058684
/* 33A7C 8005867C 00432823 */ subu $a1, $v0, $v1
.L80058680:
/* 33A80 80058680 0000282D */ daddu $a1, $zero, $zero
.L80058684:
/* 33A84 80058684 26310008 */ addiu $s1, $s1, 8
/* 33A88 80058688 26D60008 */ addiu $s6, $s6, 8
/* 33A8C 8005868C 32020007 */ andi $v0, $s0, 7
/* 33A90 80058690 2442FFF8 */ addiu $v0, $v0, -8
/* 33A94 80058694 02021023 */ subu $v0, $s0, $v0
/* 33A98 80058698 30420FFF */ andi $v0, $v0, 0xfff
/* 33A9C 8005869C 00021300 */ sll $v0, $v0, 0xc
/* 33AA0 800586A0 02A51821 */ addu $v1, $s5, $a1
/* 33AA4 800586A4 30630FFF */ andi $v1, $v1, 0xfff
/* 33AA8 800586A8 3C040400 */ lui $a0, 0x400
/* 33AAC 800586AC 00641825 */ or $v1, $v1, $a0
/* 33AB0 800586B0 00431025 */ or $v0, $v0, $v1
/* 33AB4 800586B4 AE22FFFC */ sw $v0, -4($s1)
/* 33AB8 800586B8 00E61023 */ subu $v0, $a3, $a2
/* 33ABC 800586BC 14C00003 */ bnez $a2, .L800586CC
/* 33AC0 800586C0 AE220000 */ sw $v0, ($s1)
/* 33AC4 800586C4 10A00011 */ beqz $a1, .L8005870C
/* 33AC8 800586C8 0274102A */ slt $v0, $s3, $s4
.L800586CC:
/* 33ACC 800586CC 26310008 */ addiu $s1, $s1, 8
/* 33AD0 800586D0 26D60008 */ addiu $s6, $s6, 8
/* 33AD4 800586D4 3C0300FF */ lui $v1, 0xff
/* 33AD8 800586D8 3463FFFF */ ori $v1, $v1, 0xffff
/* 33ADC 800586DC 02A61021 */ addu $v0, $s5, $a2
/* 33AE0 800586E0 00451021 */ addu $v0, $v0, $a1
/* 33AE4 800586E4 00431024 */ and $v0, $v0, $v1
/* 33AE8 800586E8 3C030A00 */ lui $v1, 0xa00
/* 33AEC 800586EC 00431025 */ or $v0, $v0, $v1
/* 33AF0 800586F0 00151C00 */ sll $v1, $s5, 0x10
/* 33AF4 800586F4 AE22FFFC */ sw $v0, -4($s1)
/* 33AF8 800586F8 00131040 */ sll $v0, $s3, 1
/* 33AFC 800586FC 3042FFFF */ andi $v0, $v0, 0xffff
/* 33B00 80058700 00621825 */ or $v1, $v1, $v0
/* 33B04 80058704 AE230000 */ sw $v1, ($s1)
/* 33B08 80058708 0274102A */ slt $v0, $s3, $s4
.L8005870C:
/* 33B0C 8005870C 1440FFBD */ bnez $v0, .L80058604
/* 33B10 80058710 00131040 */ sll $v0, $s3, 1
.L80058714:
/* 33B14 80058714 8E420024 */ lw $v0, 0x24($s2)
/* 33B18 80058718 00541021 */ addu $v0, $v0, $s4
/* 33B1C 8005871C AE420024 */ sw $v0, 0x24($s2)
/* 33B20 80058720 8E420030 */ lw $v0, 0x30($s2)
/* 33B24 80058724 00141840 */ sll $v1, $s4, 1
/* 33B28 80058728 00431021 */ addu $v0, $v0, $v1
/* 33B2C 8005872C 08016212 */ j .L80058848
/* 33B30 80058730 AE420030 */ sw $v0, 0x30($s2)
.L80058734:
/* 33B34 80058734 8E440014 */ lw $a0, 0x14($s2)
/* 33B38 80058738 8E430030 */ lw $v1, 0x30($s2)
/* 33B3C 8005873C 8C820000 */ lw $v0, ($a0)
/* 33B40 80058740 8C840004 */ lw $a0, 4($a0)
/* 33B44 80058744 00701821 */ addu $v1, $v1, $s0
/* 33B48 80058748 00441021 */ addu $v0, $v0, $a0
/* 33B4C 8005874C 00628823 */ subu $s1, $v1, $v0
/* 33B50 80058750 5E200002 */ bgtzl $s1, .L8005875C
/* 33B54 80058754 AEE00028 */ sw $zero, 0x28($s7)
/* 33B58 80058758 0000882D */ daddu $s1, $zero, $zero
.L8005875C:
/* 33B5C 8005875C 0211102A */ slt $v0, $s0, $s1
/* 33B60 80058760 54400001 */ bnel $v0, $zero, .L80058768
/* 33B64 80058764 0200882D */ daddu $s1, $s0, $zero
.L80058768:
/* 33B68 80058768 0230102A */ slt $v0, $s1, $s0
/* 33B6C 8005876C 10400021 */ beqz $v0, .L800587F4
/* 33B70 80058770 00000000 */ nop
/* 33B74 80058774 1A80001A */ blez $s4, .L800587E0
/* 33B78 80058778 02118023 */ subu $s0, $s0, $s1
/* 33B7C 8005877C 8E440030 */ lw $a0, 0x30($s2)
/* 33B80 80058780 8E420014 */ lw $v0, 0x14($s2)
/* 33B84 80058784 8E460020 */ lw $a2, 0x20($s2)
/* 33B88 80058788 90470025 */ lbu $a3, 0x25($v0)
/* 33B8C 8005878C 8E42001C */ lw $v0, 0x1c($s2)
/* 33B90 80058790 0040F809 */ jalr $v0
/* 33B94 80058794 0200282D */ daddu $a1, $s0, $zero
/* 33B98 80058798 0040382D */ daddu $a3, $v0, $zero
/* 33B9C 8005879C 30E60007 */ andi $a2, $a3, 7
/* 33BA0 800587A0 02068021 */ addu $s0, $s0, $a2
/* 33BA4 800587A4 02C0282D */ daddu $a1, $s6, $zero
/* 33BA8 800587A8 26D60008 */ addiu $s6, $s6, 8
/* 33BAC 800587AC 32020007 */ andi $v0, $s0, 7
/* 33BB0 800587B0 2442FFF8 */ addiu $v0, $v0, -8
/* 33BB4 800587B4 02021023 */ subu $v0, $s0, $v0
/* 33BB8 800587B8 30420FFF */ andi $v0, $v0, 0xfff
/* 33BBC 800587BC 00021300 */ sll $v0, $v0, 0xc
/* 33BC0 800587C0 33C30FFF */ andi $v1, $fp, 0xfff
/* 33BC4 800587C4 3C040400 */ lui $a0, 0x400
/* 33BC8 800587C8 00641825 */ or $v1, $v1, $a0
/* 33BCC 800587CC 00431025 */ or $v0, $v0, $v1
/* 33BD0 800587D0 ACA20000 */ sw $v0, ($a1)
/* 33BD4 800587D4 00E61023 */ subu $v0, $a3, $a2
/* 33BD8 800587D8 080161F9 */ j .L800587E4
/* 33BDC 800587DC ACA20004 */ sw $v0, 4($a1)
.L800587E0:
/* 33BE0 800587E0 0000302D */ daddu $a2, $zero, $zero
.L800587E4:
/* 33BE4 800587E4 8E420024 */ lw $v0, 0x24($s2)
/* 33BE8 800587E8 03C6F021 */ addu $fp, $fp, $a2
/* 33BEC 800587EC 00541021 */ addu $v0, $v0, $s4
/* 33BF0 800587F0 AE420024 */ sw $v0, 0x24($s2)
.L800587F4:
/* 33BF4 800587F4 8E420030 */ lw $v0, 0x30($s2)
/* 33BF8 800587F8 00141840 */ sll $v1, $s4, 1
/* 33BFC 800587FC 00431021 */ addu $v0, $v0, $v1
/* 33C00 80058800 12200011 */ beqz $s1, .L80058848
/* 33C04 80058804 AE420030 */ sw $v0, 0x30($s2)
/* 33C08 80058808 00141040 */ sll $v0, $s4, 1
/* 33C0C 8005880C 00512823 */ subu $a1, $v0, $s1
/* 33C10 80058810 04A20001 */ bltzl $a1, .L80058818
/* 33C14 80058814 0000282D */ daddu $a1, $zero, $zero
.L80058818:
/* 33C18 80058818 02C0202D */ daddu $a0, $s6, $zero
/* 33C1C 8005881C 26D60008 */ addiu $s6, $s6, 8
/* 33C20 80058820 3C0300FF */ lui $v1, 0xff
/* 33C24 80058824 3463FFFF */ ori $v1, $v1, 0xffff
/* 33C28 80058828 001E1400 */ sll $v0, $fp, 0x10
/* 33C2C 8005882C 00021403 */ sra $v0, $v0, 0x10
/* 33C30 80058830 00A21021 */ addu $v0, $a1, $v0
/* 33C34 80058834 00431024 */ and $v0, $v0, $v1
/* 33C38 80058838 3C030200 */ lui $v1, 0x200
/* 33C3C 8005883C 00431025 */ or $v0, $v0, $v1
/* 33C40 80058840 AC820000 */ sw $v0, ($a0)
/* 33C44 80058844 AC910004 */ sw $s1, 4($a0)
.L80058848:
/* 33C48 80058848 8FA80020 */ lw $t0, 0x20($sp)
/* 33C4C 8005884C 3C014700 */ lui $at, 0x4700
/* 33C50 80058850 44811000 */ mtc1 $at, $f2
/* 33C54 80058854 C5000004 */ lwc1 $f0, 4($t0)
/* 33C58 80058858 46020002 */ mul.s $f0, $f0, $f2
/* 33C5C 8005885C 00000000 */ nop
/* 33C60 80058860 8D040000 */ lw $a0, ($t0)
/* 33C64 80058864 4600018D */ trunc.w.s $f6, $f0
/* 33C68 80058868 44103000 */ mfc1 $s0, $f6
/* 33C6C 8005886C 0C0187A4 */ jal osVirtualToPhysical
/* 33C70 80058870 3210FFFF */ andi $s0, $s0, 0xffff
/* 33C74 80058874 3C0300FF */ lui $v1, 0xff
/* 33C78 80058878 3463FFFF */ ori $v1, $v1, 0xffff
/* 33C7C 8005887C 02C0202D */ daddu $a0, $s6, $zero
/* 33C80 80058880 00431024 */ and $v0, $v0, $v1
/* 33C84 80058884 3C030500 */ lui $v1, 0x500
/* 33C88 80058888 00431025 */ or $v0, $v0, $v1
/* 33C8C 8005888C 00108380 */ sll $s0, $s0, 0xe
/* 33C90 80058890 AC820000 */ sw $v0, ($a0)
/* 33C94 80058894 8FA80020 */ lw $t0, 0x20($sp)
/* 33C98 80058898 33C20FFF */ andi $v0, $fp, 0xfff
/* 33C9C 8005889C 8D03000C */ lw $v1, 0xc($t0)
/* 33CA0 800588A0 00021080 */ sll $v0, $v0, 2
/* 33CA4 800588A4 00031F80 */ sll $v1, $v1, 0x1e
/* 33CA8 800588A8 00701825 */ or $v1, $v1, $s0
/* 33CAC 800588AC 00621825 */ or $v1, $v1, $v0
/* 33CB0 800588B0 AC830004 */ sw $v1, 4($a0)
/* 33CB4 800588B4 AD00000C */ sw $zero, 0xc($t0)
/* 33CB8 800588B8 8EE20024 */ lw $v0, 0x24($s7)
/* 33CBC 800588BC 10400069 */ beqz $v0, .L80058A64
/* 33CC0 800588C0 26D60008 */ addiu $s6, $s6, 8
/* 33CC4 800588C4 3C028008 */ lui $v0, %hi(D_80078181)
/* 33CC8 800588C8 24428181 */ addiu $v0, $v0, %lo(D_80078181)
/* 33CCC 800588CC 90420000 */ lbu $v0, ($v0)
/* 33CD0 800588D0 1440000C */ bnez $v0, .L80058904
/* 33CD4 800588D4 AEE00024 */ sw $zero, 0x24($s7)
/* 33CD8 800588D8 3C048008 */ lui $a0, %hi(D_80078E60)
/* 33CDC 800588DC 24848E60 */ addiu $a0, $a0, %lo(D_80078E60)
/* 33CE0 800588E0 86E30006 */ lh $v1, 6($s7)
/* 33CE4 800588E4 84820080 */ lh $v0, 0x80($a0)
/* 33CE8 800588E8 00620018 */ mult $v1, $v0
/* 33CEC 800588EC 00004012 */ mflo $t0
/* 33CF0 800588F0 000813C3 */ sra $v0, $t0, 0xf
/* 33CF4 800588F4 A6E20014 */ sh $v0, 0x14($s7)
/* 33CF8 800588F8 84820080 */ lh $v0, 0x80($a0)
/* 33CFC 800588FC 08016254 */ j .L80058950
/* 33D00 80058900 00620018 */ mult $v1, $v0
.L80058904:
/* 33D04 80058904 86E20004 */ lh $v0, 4($s7)
/* 33D08 80058908 86E30006 */ lh $v1, 6($s7)
/* 33D0C 8005890C 00021040 */ sll $v0, $v0, 1
/* 33D10 80058910 3C018008 */ lui $at, %hi(D_80078E60)
/* 33D14 80058914 00220821 */ addu $at, $at, $v0
/* 33D18 80058918 84228E60 */ lh $v0, %lo(D_80078E60)($at)
/* 33D1C 8005891C 00620018 */ mult $v1, $v0
/* 33D20 80058920 86E30004 */ lh $v1, 4($s7)
/* 33D24 80058924 00004012 */ mflo $t0
/* 33D28 80058928 000813C3 */ sra $v0, $t0, 0xf
/* 33D2C 8005892C A6E20014 */ sh $v0, 0x14($s7)
/* 33D30 80058930 2402007F */ addiu $v0, $zero, 0x7f
/* 33D34 80058934 00431023 */ subu $v0, $v0, $v1
/* 33D38 80058938 00021040 */ sll $v0, $v0, 1
/* 33D3C 8005893C 86E30006 */ lh $v1, 6($s7)
/* 33D40 80058940 3C018008 */ lui $at, %hi(D_80078E60)
/* 33D44 80058944 00220821 */ addu $at, $at, $v0
/* 33D48 80058948 84228E60 */ lh $v0, %lo(D_80078E60)($at)
/* 33D4C 8005894C 00620018 */ mult $v1, $v0
.L80058950:
/* 33D50 80058950 00004012 */ mflo $t0
/* 33D54 80058954 000813C3 */ sra $v0, $t0, 0xf
/* 33D58 80058958 A6E2001A */ sh $v0, 0x1a($s7)
/* 33D5C 8005895C 86E30008 */ lh $v1, 8($s7)
/* 33D60 80058960 86E40014 */ lh $a0, 0x14($s7)
/* 33D64 80058964 8EE50020 */ lw $a1, 0x20($s7)
/* 33D68 80058968 26E20010 */ addiu $v0, $s7, 0x10
/* 33D6C 8005896C AFA20014 */ sw $v0, 0x14($sp)
/* 33D70 80058970 44836000 */ mtc1 $v1, $f12
/* 33D74 80058974 00000000 */ nop
/* 33D78 80058978 46806321 */ cvt.d.w $f12, $f12
/* 33D7C 8005897C 44847000 */ mtc1 $a0, $f14
/* 33D80 80058980 00000000 */ nop
/* 33D84 80058984 468073A1 */ cvt.d.w $f14, $f14
/* 33D88 80058988 0C01631B */ jal func_80058C6C
/* 33D8C 8005898C AFA50010 */ sw $a1, 0x10($sp)
/* 33D90 80058990 86E3000A */ lh $v1, 0xa($s7)
/* 33D94 80058994 86E4001A */ lh $a0, 0x1a($s7)
/* 33D98 80058998 8EE50020 */ lw $a1, 0x20($s7)
/* 33D9C 8005899C A6E20012 */ sh $v0, 0x12($s7)
/* 33DA0 800589A0 26E20016 */ addiu $v0, $s7, 0x16
/* 33DA4 800589A4 AFA20014 */ sw $v0, 0x14($sp)
/* 33DA8 800589A8 44836000 */ mtc1 $v1, $f12
/* 33DAC 800589AC 00000000 */ nop
/* 33DB0 800589B0 46806321 */ cvt.d.w $f12, $f12
/* 33DB4 800589B4 44847000 */ mtc1 $a0, $f14
/* 33DB8 800589B8 00000000 */ nop
/* 33DBC 800589BC 468073A1 */ cvt.d.w $f14, $f14
/* 33DC0 800589C0 0C01631B */ jal func_80058C6C
/* 33DC4 800589C4 AFA50010 */ sw $a1, 0x10($sp)
/* 33DC8 800589C8 02C0202D */ daddu $a0, $s6, $zero
/* 33DCC 800589CC 26D60008 */ addiu $s6, $s6, 8
/* 33DD0 800589D0 02C0282D */ daddu $a1, $s6, $zero
/* 33DD4 800589D4 26D60008 */ addiu $s6, $s6, 8
/* 33DD8 800589D8 02C0302D */ daddu $a2, $s6, $zero
/* 33DDC 800589DC 26D60008 */ addiu $s6, $s6, 8
/* 33DE0 800589E0 3C030900 */ lui $v1, 0x900
/* 33DE4 800589E4 A6E20018 */ sh $v0, 0x18($s7)
/* 33DE8 800589E8 96E20014 */ lhu $v0, 0x14($s7)
/* 33DEC 800589EC 02C0802D */ daddu $s0, $s6, $zero
/* 33DF0 800589F0 00431025 */ or $v0, $v0, $v1
/* 33DF4 800589F4 AC820000 */ sw $v0, ($a0)
/* 33DF8 800589F8 96E20012 */ lhu $v0, 0x12($s7)
/* 33DFC 800589FC 96E30010 */ lhu $v1, 0x10($s7)
/* 33E00 80058A00 00021400 */ sll $v0, $v0, 0x10
/* 33E04 80058A04 00431025 */ or $v0, $v0, $v1
/* 33E08 80058A08 AC820004 */ sw $v0, 4($a0)
/* 33E0C 80058A0C 96E20008 */ lhu $v0, 8($s7)
/* 33E10 80058A10 3C030906 */ lui $v1, 0x906
/* 33E14 80058A14 00431025 */ or $v0, $v0, $v1
/* 33E18 80058A18 ACA20000 */ sw $v0, ($a1)
/* 33E1C 80058A1C 96E2000C */ lhu $v0, 0xc($s7)
/* 33E20 80058A20 96E3000E */ lhu $v1, 0xe($s7)
/* 33E24 80058A24 00021400 */ sll $v0, $v0, 0x10
/* 33E28 80058A28 00431025 */ or $v0, $v0, $v1
/* 33E2C 80058A2C ACA20004 */ sw $v0, 4($a1)
/* 33E30 80058A30 96E2001A */ lhu $v0, 0x1a($s7)
/* 33E34 80058A34 3C030904 */ lui $v1, 0x904
/* 33E38 80058A38 00431025 */ or $v0, $v0, $v1
/* 33E3C 80058A3C ACC20000 */ sw $v0, ($a2)
/* 33E40 80058A40 96E20018 */ lhu $v0, 0x18($s7)
/* 33E44 80058A44 96E30016 */ lhu $v1, 0x16($s7)
/* 33E48 80058A48 00021400 */ sll $v0, $v0, 0x10
/* 33E4C 80058A4C 00431025 */ or $v0, $v0, $v1
/* 33E50 80058A50 ACC20004 */ sw $v0, 4($a2)
/* 33E54 80058A54 96E2000A */ lhu $v0, 0xa($s7)
/* 33E58 80058A58 3C030301 */ lui $v1, 0x301
/* 33E5C 80058A5C 0801629B */ j .L80058A6C
/* 33E60 80058A60 00431025 */ or $v0, $v0, $v1
.L80058A64:
/* 33E64 80058A64 02C0802D */ daddu $s0, $s6, $zero
/* 33E68 80058A68 3C020300 */ lui $v0, 0x300
.L80058A6C:
/* 33E6C 80058A6C AE020000 */ sw $v0, ($s0)
/* 33E70 80058A70 8EE40000 */ lw $a0, ($s7)
/* 33E74 80058A74 0C0187A4 */ jal osVirtualToPhysical
/* 33E78 80058A78 26D60008 */ addiu $s6, $s6, 8
/* 33E7C 80058A7C AE020004 */ sw $v0, 4($s0)
/* 33E80 80058A80 8EE2001C */ lw $v0, 0x1c($s7)
/* 33E84 80058A84 8EE30020 */ lw $v1, 0x20($s7)
/* 33E88 80058A88 244200B8 */ addiu $v0, $v0, 0xb8
/* 33E8C 80058A8C AEE2001C */ sw $v0, 0x1c($s7)
/* 33E90 80058A90 0062102A */ slt $v0, $v1, $v0
/* 33E94 80058A94 54400001 */ bnel $v0, $zero, .L80058A9C
/* 33E98 80058A98 AEE3001C */ sw $v1, 0x1c($s7)
.L80058A9C:
/* 33E9C 80058A9C 8EE20028 */ lw $v0, 0x28($s7)
/* 33EA0 80058AA0 14400013 */ bnez $v0, .L80058AF0
/* 33EA4 80058AA4 02C0102D */ daddu $v0, $s6, $zero
/* 33EA8 80058AA8 24020001 */ addiu $v0, $zero, 1
/* 33EAC 80058AAC AEE20024 */ sw $v0, 0x24($s7)
/* 33EB0 80058AB0 A6E20006 */ sh $v0, 6($s7)
/* 33EB4 80058AB4 8FA80020 */ lw $t0, 0x20($sp)
/* 33EB8 80058AB8 AD000008 */ sw $zero, 8($t0)
/* 33EBC 80058ABC AD02000C */ sw $v0, 0xc($t0)
/* 33EC0 80058AC0 8E430014 */ lw $v1, 0x14($s2)
/* 33EC4 80058AC4 AE400028 */ sw $zero, 0x28($s2)
/* 33EC8 80058AC8 AE42002C */ sw $v0, 0x2c($s2)
/* 33ECC 80058ACC AE400024 */ sw $zero, 0x24($s2)
/* 33ED0 80058AD0 8C620000 */ lw $v0, ($v1)
/* 33ED4 80058AD4 AE420030 */ sw $v0, 0x30($s2)
/* 33ED8 80058AD8 8C620014 */ lw $v0, 0x14($v1)
/* 33EDC 80058ADC AE420010 */ sw $v0, 0x10($s2)
/* 33EE0 80058AE0 8FA80060 */ lw $t0, 0x60($sp)
/* 33EE4 80058AE4 0C014B8C */ jal func_80052E30
/* 33EE8 80058AE8 91040079 */ lbu $a0, 0x79($t0)
.L80058AEC:
/* 33EEC 80058AEC 02C0102D */ daddu $v0, $s6, $zero
.L80058AF0:
/* 33EF0 80058AF0 8FBF005C */ lw $ra, 0x5c($sp)
/* 33EF4 80058AF4 8FBE0058 */ lw $fp, 0x58($sp)
/* 33EF8 80058AF8 8FB70054 */ lw $s7, 0x54($sp)
/* 33EFC 80058AFC 8FB60050 */ lw $s6, 0x50($sp)
/* 33F00 80058B00 8FB5004C */ lw $s5, 0x4c($sp)
/* 33F04 80058B04 8FB40048 */ lw $s4, 0x48($sp)
/* 33F08 80058B08 8FB30044 */ lw $s3, 0x44($sp)
/* 33F0C 80058B0C 8FB20040 */ lw $s2, 0x40($sp)
/* 33F10 80058B10 8FB1003C */ lw $s1, 0x3c($sp)
/* 33F14 80058B14 8FB00038 */ lw $s0, 0x38($sp)
/* 33F18 80058B18 03E00008 */ jr $ra
/* 33F1C 80058B1C 27BD0060 */ addiu $sp, $sp, 0x60