.set noat # allow manual use of $at .set noreorder # don't insert nops after branches glabel func_80059F94 /* 035394 80059F94 27BDFFC8 */ addiu $sp, $sp, -0x38 /* 035398 80059F98 F7B40030 */ sdc1 $f20, 0x30($sp) /* 03539C 80059F9C 3C014080 */ lui $at, 0x4080 /* 0353A0 80059FA0 4481A000 */ mtc1 $at, $f20 /* 0353A4 80059FA4 AFB10014 */ sw $s1, 0x14($sp) /* 0353A8 80059FA8 24110001 */ addiu $s1, $zero, 1 /* 0353AC 80059FAC AFB20018 */ sw $s2, 0x18($sp) /* 0353B0 80059FB0 0000902D */ daddu $s2, $zero, $zero /* 0353B4 80059FB4 AFB50024 */ sw $s5, 0x24($sp) /* 0353B8 80059FB8 3C15800B */ lui $s5, 0x800b /* 0353BC 80059FBC 26B51D80 */ addiu $s5, $s5, 0x1d80 /* 0353C0 80059FC0 AFB00010 */ sw $s0, 0x10($sp) /* 0353C4 80059FC4 3C10800A */ lui $s0, 0x800a /* 0353C8 80059FC8 2610A66C */ addiu $s0, $s0, -0x5994 /* 0353CC 80059FCC AFB40020 */ sw $s4, 0x20($sp) /* 0353D0 80059FD0 24140002 */ addiu $s4, $zero, 2 /* 0353D4 80059FD4 AFB3001C */ sw $s3, 0x1c($sp) /* 0353D8 80059FD8 3413FFFE */ ori $s3, $zero, 0xfffe /* 0353DC 80059FDC AFBF0028 */ sw $ra, 0x28($sp) /* 0353E0 80059FE0 00121080 */ sll $v0, $s2, 2 .L80059FE4: /* 0353E4 80059FE4 3C0E800B */ lui $t6, 0x800b /* 0353E8 80059FE8 01C27021 */ addu $t6, $t6, $v0 /* 0353EC 80059FEC 8DCE4398 */ lw $t6, 0x4398($t6) /* 0353F0 80059FF0 51C000A5 */ beql $t6, $zero, .L8005A288 /* 0353F4 80059FF4 26520001 */ addiu $s2, $s2, 1 /* 0353F8 80059FF8 8DC30000 */ lw $v1, ($t6) /* 0353FC 80059FFC 30620001 */ andi $v0, $v1, 1 /* 035400 8005A000 504000A1 */ beql $v0, $zero, .L8005A288 /* 035404 8005A004 26520001 */ addiu $s2, $s2, 1 /* 035408 8005A008 30620008 */ andi $v0, $v1, 8 /* 03540C 8005A00C 5040009E */ beql $v0, $zero, .L8005A288 /* 035410 8005A010 26520001 */ addiu $s2, $s2, 1 /* 035414 8005A014 3C028007 */ lui $v0, 0x8007 /* 035418 8005A018 8C42419C */ lw $v0, 0x419c($v0) /* 03541C 8005A01C 80420070 */ lb $v0, 0x70($v0) /* 035420 8005A020 10400005 */ beqz $v0, .L8005A038 /* 035424 8005A024 30620004 */ andi $v0, $v1, 4 /* 035428 8005A028 50400097 */ beql $v0, $zero, .L8005A288 /* 03542C 8005A02C 26520001 */ addiu $s2, $s2, 1 /* 035430 8005A030 08016810 */ j .L8005A040 /* 035434 8005A034 00000000 */ nop .L8005A038: /* 035438 8005A038 54400093 */ bnel $v0, $zero, .L8005A288 /* 03543C 8005A03C 26520001 */ addiu $s2, $s2, 1 .L8005A040: /* 035440 8005A040 8DC20010 */ lw $v0, 0x10($t6) /* 035444 8005A044 8C4F0018 */ lw $t7, 0x18($v0) /* 035448 8005A048 3C028006 */ lui $v0, 0x8006 /* 03544C 8005A04C 24429C80 */ addiu $v0, $v0, -0x6380 /* 035450 8005A050 51E2008D */ beql $t7, $v0, .L8005A288 /* 035454 8005A054 26520001 */ addiu $s2, $s2, 1 /* 035458 8005A058 12200088 */ beqz $s1, .L8005A27C /* 03545C 8005A05C 3C04DC08 */ lui $a0, 0xdc08 /* 035460 8005A060 34840008 */ ori $a0, $a0, 8 /* 035464 8005A064 3C06D9FF */ lui $a2, 0xd9ff /* 035468 8005A068 34C6FFFF */ ori $a2, $a2, 0xffff /* 03546C 8005A06C 3C050020 */ lui $a1, 0x20 /* 035470 8005A070 34A50405 */ ori $a1, $a1, 0x405 /* 035474 8005A074 3C07DB04 */ lui $a3, 0xdb04 /* 035478 8005A078 34E70004 */ ori $a3, $a3, 4 /* 03547C 8005A07C 3C08DB04 */ lui $t0, 0xdb04 /* 035480 8005A080 3508000C */ ori $t0, $t0, 0xc /* 035484 8005A084 3C09DB04 */ lui $t1, 0xdb04 /* 035488 8005A088 35290014 */ ori $t1, $t1, 0x14 /* 03548C 8005A08C 3C0ADB04 */ lui $t2, 0xdb04 /* 035490 8005A090 8E0B0000 */ lw $t3, ($s0) /* 035494 8005A094 354A001C */ ori $t2, $t2, 0x1c /* 035498 8005A098 0160182D */ daddu $v1, $t3, $zero /* 03549C 8005A09C 256B0008 */ addiu $t3, $t3, 8 /* 0354A0 8005A0A0 AE0B0000 */ sw $t3, ($s0) /* 0354A4 8005A0A4 3C0D8007 */ lui $t5, 0x8007 /* 0354A8 8005A0A8 8DAD7410 */ lw $t5, 0x7410($t5) /* 0354AC 8005A0AC 3C02E700 */ lui $v0, 0xe700 /* 0354B0 8005A0B0 AC620000 */ sw $v0, ($v1) /* 0354B4 8005A0B4 25620008 */ addiu $v0, $t3, 8 /* 0354B8 8005A0B8 AC600004 */ sw $zero, 4($v1) /* 0354BC 8005A0BC AE020000 */ sw $v0, ($s0) /* 0354C0 8005A0C0 AD640000 */ sw $a0, ($t3) /* 0354C4 8005A0C4 3C04ED00 */ lui $a0, 0xed00 /* 0354C8 8005A0C8 000D1080 */ sll $v0, $t5, 2 /* 0354CC 8005A0CC 004D1021 */ addu $v0, $v0, $t5 /* 0354D0 8005A0D0 00021080 */ sll $v0, $v0, 2 /* 0354D4 8005A0D4 004D1023 */ subu $v0, $v0, $t5 /* 0354D8 8005A0D8 000218C0 */ sll $v1, $v0, 3 /* 0354DC 8005A0DC 00431021 */ addu $v0, $v0, $v1 /* 0354E0 8005A0E0 000210C0 */ sll $v0, $v0, 3 /* 0354E4 8005A0E4 00556021 */ addu $t4, $v0, $s5 /* 0354E8 8005A0E8 258200A0 */ addiu $v0, $t4, 0xa0 /* 0354EC 8005A0EC AD620004 */ sw $v0, 4($t3) /* 0354F0 8005A0F0 25620010 */ addiu $v0, $t3, 0x10 /* 0354F4 8005A0F4 AE020000 */ sw $v0, ($s0) /* 0354F8 8005A0F8 3C02D900 */ lui $v0, 0xd900 /* 0354FC 8005A0FC AD620008 */ sw $v0, 8($t3) /* 035500 8005A100 25620018 */ addiu $v0, $t3, 0x18 /* 035504 8005A104 AD60000C */ sw $zero, 0xc($t3) /* 035508 8005A108 AE020000 */ sw $v0, ($s0) /* 03550C 8005A10C 25620020 */ addiu $v0, $t3, 0x20 /* 035510 8005A110 AD660010 */ sw $a2, 0x10($t3) /* 035514 8005A114 AD650014 */ sw $a1, 0x14($t3) /* 035518 8005A118 AE020000 */ sw $v0, ($s0) /* 03551C 8005A11C 8583000E */ lh $v1, 0xe($t4) /* 035520 8005A120 25620028 */ addiu $v0, $t3, 0x28 /* 035524 8005A124 AE020000 */ sw $v0, ($s0) /* 035528 8005A128 44831000 */ mtc1 $v1, $f2 /* 03552C 8005A12C 00000000 */ nop /* 035530 8005A130 468010A0 */ cvt.s.w $f2, $f2 /* 035534 8005A134 46141082 */ mul.s $f2, $f2, $f20 /* 035538 8005A138 00000000 */ nop /* 03553C 8005A13C 85830010 */ lh $v1, 0x10($t4) /* 035540 8005A140 25620030 */ addiu $v0, $t3, 0x30 /* 035544 8005A144 AE020000 */ sw $v0, ($s0) /* 035548 8005A148 25620038 */ addiu $v0, $t3, 0x38 /* 03554C 8005A14C 44830000 */ mtc1 $v1, $f0 /* 035550 8005A150 00000000 */ nop /* 035554 8005A154 46800020 */ cvt.s.w $f0, $f0 /* 035558 8005A158 46140002 */ mul.s $f0, $f0, $f20 /* 03555C 8005A15C 00000000 */ nop /* 035560 8005A160 AE020000 */ sw $v0, ($s0) /* 035564 8005A164 4600110D */ trunc.w.s $f4, $f2 /* 035568 8005A168 44032000 */ mfc1 $v1, $f4 /* 03556C 8005A16C 00000000 */ nop /* 035570 8005A170 30630FFF */ andi $v1, $v1, 0xfff /* 035574 8005A174 00031B00 */ sll $v1, $v1, 0xc /* 035578 8005A178 4600010D */ trunc.w.s $f4, $f0 /* 03557C 8005A17C 44022000 */ mfc1 $v0, $f4 /* 035580 8005A180 00000000 */ nop /* 035584 8005A184 30420FFF */ andi $v0, $v0, 0xfff /* 035588 8005A188 00441025 */ or $v0, $v0, $a0 /* 03558C 8005A18C 00621825 */ or $v1, $v1, $v0 /* 035590 8005A190 AD630018 */ sw $v1, 0x18($t3) /* 035594 8005A194 8583000E */ lh $v1, 0xe($t4) /* 035598 8005A198 8585000A */ lh $a1, 0xa($t4) /* 03559C 8005A19C 85840010 */ lh $a0, 0x10($t4) /* 0355A0 8005A1A0 8586000C */ lh $a2, 0xc($t4) /* 0355A4 8005A1A4 25620040 */ addiu $v0, $t3, 0x40 /* 0355A8 8005A1A8 AE020000 */ sw $v0, ($s0) /* 0355AC 8005A1AC AD670020 */ sw $a3, 0x20($t3) /* 0355B0 8005A1B0 AD740024 */ sw $s4, 0x24($t3) /* 0355B4 8005A1B4 AD680028 */ sw $t0, 0x28($t3) /* 0355B8 8005A1B8 00651821 */ addu $v1, $v1, $a1 /* 0355BC 8005A1BC 44831000 */ mtc1 $v1, $f2 /* 0355C0 8005A1C0 00000000 */ nop /* 0355C4 8005A1C4 468010A0 */ cvt.s.w $f2, $f2 /* 0355C8 8005A1C8 46141082 */ mul.s $f2, $f2, $f20 /* 0355CC 8005A1CC 00000000 */ nop /* 0355D0 8005A1D0 AD74002C */ sw $s4, 0x2c($t3) /* 0355D4 8005A1D4 AD690030 */ sw $t1, 0x30($t3) /* 0355D8 8005A1D8 00862021 */ addu $a0, $a0, $a2 /* 0355DC 8005A1DC 44840000 */ mtc1 $a0, $f0 /* 0355E0 8005A1E0 00000000 */ nop /* 0355E4 8005A1E4 46800020 */ cvt.s.w $f0, $f0 /* 0355E8 8005A1E8 46140002 */ mul.s $f0, $f0, $f20 /* 0355EC 8005A1EC 00000000 */ nop /* 0355F0 8005A1F0 AD730034 */ sw $s3, 0x34($t3) /* 0355F4 8005A1F4 4600110D */ trunc.w.s $f4, $f2 /* 0355F8 8005A1F8 44032000 */ mfc1 $v1, $f4 /* 0355FC 8005A1FC 00000000 */ nop /* 035600 8005A200 30630FFF */ andi $v1, $v1, 0xfff /* 035604 8005A204 00031B00 */ sll $v1, $v1, 0xc /* 035608 8005A208 4600010D */ trunc.w.s $f4, $f0 /* 03560C 8005A20C 44022000 */ mfc1 $v0, $f4 /* 035610 8005A210 00000000 */ nop /* 035614 8005A214 30420FFF */ andi $v0, $v0, 0xfff /* 035618 8005A218 00621825 */ or $v1, $v1, $v0 /* 03561C 8005A21C AD63001C */ sw $v1, 0x1c($t3) /* 035620 8005A220 AD6A0038 */ sw $t2, 0x38($t3) /* 035624 8005A224 AD73003C */ sw $s3, 0x3c($t3) /* 035628 8005A228 95820000 */ lhu $v0, ($t4) /* 03562C 8005A22C 30420010 */ andi $v0, $v0, 0x10 /* 035630 8005A230 14400012 */ bnez $v0, .L8005A27C /* 035634 8005A234 0000882D */ daddu $s1, $zero, $zero /* 035638 8005A238 3C04DA38 */ lui $a0, 0xda38 /* 03563C 8005A23C 34840007 */ ori $a0, $a0, 7 /* 035640 8005A240 25620048 */ addiu $v0, $t3, 0x48 /* 035644 8005A244 AE020000 */ sw $v0, ($s0) /* 035648 8005A248 3C02DB0E */ lui $v0, 0xdb0e /* 03564C 8005A24C AD620040 */ sw $v0, 0x40($t3) /* 035650 8005A250 95830038 */ lhu $v1, 0x38($t4) /* 035654 8005A254 25620050 */ addiu $v0, $t3, 0x50 /* 035658 8005A258 AE020000 */ sw $v0, ($s0) /* 03565C 8005A25C 000D1180 */ sll $v0, $t5, 6 /* 035660 8005A260 AD630044 */ sw $v1, 0x44($t3) /* 035664 8005A264 3C03800A */ lui $v1, 0x800a /* 035668 8005A268 8C63A674 */ lw $v1, -0x598c($v1) /* 03566C 8005A26C 24420030 */ addiu $v0, $v0, 0x30 /* 035670 8005A270 AD640048 */ sw $a0, 0x48($t3) /* 035674 8005A274 00621821 */ addu $v1, $v1, $v0 /* 035678 8005A278 AD63004C */ sw $v1, 0x4c($t3) .L8005A27C: /* 03567C 8005A27C 01E0F809 */ jalr $t7 /* 035680 8005A280 01C0202D */ daddu $a0, $t6, $zero /* 035684 8005A284 26520001 */ addiu $s2, $s2, 1 .L8005A288: /* 035688 8005A288 2A420060 */ slti $v0, $s2, 0x60 /* 03568C 8005A28C 5440FF55 */ bnel $v0, $zero, .L80059FE4 /* 035690 8005A290 00121080 */ sll $v0, $s2, 2 /* 035694 8005A294 8FBF0028 */ lw $ra, 0x28($sp) /* 035698 8005A298 8FB50024 */ lw $s5, 0x24($sp) /* 03569C 8005A29C 8FB40020 */ lw $s4, 0x20($sp) /* 0356A0 8005A2A0 8FB3001C */ lw $s3, 0x1c($sp) /* 0356A4 8005A2A4 8FB20018 */ lw $s2, 0x18($sp) /* 0356A8 8005A2A8 8FB10014 */ lw $s1, 0x14($sp) /* 0356AC 8005A2AC 8FB00010 */ lw $s0, 0x10($sp) /* 0356B0 8005A2B0 D7B40030 */ ldc1 $f20, 0x30($sp) /* 0356B4 8005A2B4 03E00008 */ jr $ra /* 0356B8 8005A2B8 27BD0038 */ addiu $sp, $sp, 0x38 /* 0356BC 8005A2BC 27BDFFE0 */ addiu $sp, $sp, -0x20 /* 0356C0 8005A2C0 AFB20018 */ sw $s2, 0x18($sp) /* 0356C4 8005A2C4 0080902D */ daddu $s2, $a0, $zero /* 0356C8 8005A2C8 AFB00010 */ sw $s0, 0x10($sp) /* 0356CC 8005A2CC 0000802D */ daddu $s0, $zero, $zero /* 0356D0 8005A2D0 3C03800B */ lui $v1, 0x800b /* 0356D4 8005A2D4 24634398 */ addiu $v1, $v1, 0x4398 /* 0356D8 8005A2D8 AFBF001C */ sw $ra, 0x1c($sp) /* 0356DC 8005A2DC AFB10014 */ sw $s1, 0x14($sp) .L8005A2E0: /* 0356E0 8005A2E0 8C620000 */ lw $v0, ($v1) /* 0356E4 8005A2E4 10400006 */ beqz $v0, .L8005A300 /* 0356E8 8005A2E8 2A020060 */ slti $v0, $s0, 0x60 /* 0356EC 8005A2EC 26100001 */ addiu $s0, $s0, 1 /* 0356F0 8005A2F0 2A020060 */ slti $v0, $s0, 0x60 /* 0356F4 8005A2F4 1440FFFA */ bnez $v0, .L8005A2E0 /* 0356F8 8005A2F8 24630004 */ addiu $v1, $v1, 4 /* 0356FC 8005A2FC 2A020060 */ slti $v0, $s0, 0x60 .L8005A300: /* 035700 8005A300 14400003 */ bnez $v0, .L8005A310 /* 035704 8005A304 00000000 */ nop .L8005A308: /* 035708 8005A308 080168C2 */ j .L8005A308 /* 03570C 8005A30C 00000000 */ nop .L8005A310: /* 035710 8005A310 0C00AB0A */ jal general_heap_malloc /* 035714 8005A314 24040014 */ addiu $a0, $zero, 0x14 /* 035718 8005A318 00101880 */ sll $v1, $s0, 2 /* 03571C 8005A31C 0040882D */ daddu $s1, $v0, $zero /* 035720 8005A320 3C01800B */ lui $at, 0x800b /* 035724 8005A324 00230821 */ addu $at, $at, $v1 /* 035728 8005A328 AC314398 */ sw $s1, 0x4398($at) /* 03572C 8005A32C 16200003 */ bnez $s1, .L8005A33C /* 035730 8005A330 0000802D */ daddu $s0, $zero, $zero .L8005A334: /* 035734 8005A334 080168CD */ j .L8005A334 /* 035738 8005A338 00000000 */ nop .L8005A33C: /* 03573C 8005A33C 3C04800A */ lui $a0, 0x800a /* 035740 8005A340 24844000 */ addiu $a0, $a0, 0x4000 /* 035744 8005A344 8E430004 */ lw $v1, 4($s2) /* 035748 8005A348 24020001 */ addiu $v0, $zero, 1 /* 03574C 8005A34C AE220000 */ sw $v0, ($s1) /* 035750 8005A350 AE230004 */ sw $v1, 4($s1) .L8005A354: /* 035754 8005A354 8C820000 */ lw $v0, ($a0) /* 035758 8005A358 30420001 */ andi $v0, $v0, 1 /* 03575C 8005A35C 50400006 */ beql $v0, $zero, .L8005A378 /* 035760 8005A360 26100001 */ addiu $s0, $s0, 1 /* 035764 8005A364 8C830004 */ lw $v1, 4($a0) /* 035768 8005A368 8E420004 */ lw $v0, 4($s2) /* 03576C 8005A36C 10620006 */ beq $v1, $v0, .L8005A388 /* 035770 8005A370 2A02000F */ slti $v0, $s0, 0xf /* 035774 8005A374 26100001 */ addiu $s0, $s0, 1 .L8005A378: /* 035778 8005A378 2A02000F */ slti $v0, $s0, 0xf /* 03577C 8005A37C 1440FFF5 */ bnez $v0, .L8005A354 /* 035780 8005A380 24840020 */ addiu $a0, $a0, 0x20 /* 035784 8005A384 2A02000F */ slti $v0, $s0, 0xf .L8005A388: /* 035788 8005A388 14400003 */ bnez $v0, .L8005A398 /* 03578C 8005A38C 00000000 */ nop .L8005A390: /* 035790 8005A390 080168E4 */ j .L8005A390 /* 035794 8005A394 00000000 */ nop .L8005A398: /* 035798 8005A398 8C820008 */ lw $v0, 8($a0) /* 03579C 8005A39C 14400016 */ bnez $v0, .L8005A3F8 /* 0357A0 8005A3A0 24420001 */ addiu $v0, $v0, 1 /* 0357A4 8005A3A4 8E42000C */ lw $v0, 0xc($s2) /* 0357A8 8005A3A8 14400004 */ bnez $v0, .L8005A3BC /* 0357AC 8005A3AC AC820010 */ sw $v0, 0x10($a0) /* 0357B0 8005A3B0 3C028006 */ lui $v0, 0x8006 /* 0357B4 8005A3B4 24429C80 */ addiu $v0, $v0, -0x6380 /* 0357B8 8005A3B8 AC820014 */ sw $v0, 0x14($a0) .L8005A3BC: /* 0357BC 8005A3BC 8E420010 */ lw $v0, 0x10($s2) /* 0357C0 8005A3C0 8C830018 */ lw $v1, 0x18($a0) /* 0357C4 8005A3C4 14600004 */ bnez $v1, .L8005A3D8 /* 0357C8 8005A3C8 AC820014 */ sw $v0, 0x14($a0) /* 0357CC 8005A3CC 3C028006 */ lui $v0, 0x8006 /* 0357D0 8005A3D0 24429C80 */ addiu $v0, $v0, -0x6380 /* 0357D4 8005A3D4 AC820018 */ sw $v0, 0x18($a0) .L8005A3D8: /* 0357D8 8005A3D8 8E420014 */ lw $v0, 0x14($s2) /* 0357DC 8005A3DC 14400004 */ bnez $v0, .L8005A3F0 /* 0357E0 8005A3E0 AC820018 */ sw $v0, 0x18($a0) /* 0357E4 8005A3E4 3C028006 */ lui $v0, 0x8006 /* 0357E8 8005A3E8 24429C80 */ addiu $v0, $v0, -0x6380 /* 0357EC 8005A3EC AC820018 */ sw $v0, 0x18($a0) .L8005A3F0: /* 0357F0 8005A3F0 8C820008 */ lw $v0, 8($a0) /* 0357F4 8005A3F4 24420001 */ addiu $v0, $v0, 1 .L8005A3F8: /* 0357F8 8005A3F8 AC820008 */ sw $v0, 8($a0) /* 0357FC 8005A3FC AE240010 */ sw $a0, 0x10($s1) /* 035800 8005A400 8E420008 */ lw $v0, 8($s2) /* 035804 8005A404 10400003 */ beqz $v0, .L8005A414 /* 035808 8005A408 00000000 */ nop /* 03580C 8005A40C 0040F809 */ jalr $v0 /* 035810 8005A410 0220202D */ daddu $a0, $s1, $zero .L8005A414: /* 035814 8005A414 3C028007 */ lui $v0, 0x8007 /* 035818 8005A418 8C42419C */ lw $v0, 0x419c($v0) /* 03581C 8005A41C 80420070 */ lb $v0, 0x70($v0) /* 035820 8005A420 10400005 */ beqz $v0, .L8005A438 /* 035824 8005A424 0220102D */ daddu $v0, $s1, $zero /* 035828 8005A428 8E220000 */ lw $v0, ($s1) /* 03582C 8005A42C 34420004 */ ori $v0, $v0, 4 /* 035830 8005A430 AE220000 */ sw $v0, ($s1) /* 035834 8005A434 0220102D */ daddu $v0, $s1, $zero .L8005A438: /* 035838 8005A438 8FBF001C */ lw $ra, 0x1c($sp) /* 03583C 8005A43C 8FB20018 */ lw $s2, 0x18($sp) /* 035840 8005A440 8FB10014 */ lw $s1, 0x14($sp) /* 035844 8005A444 8FB00010 */ lw $s0, 0x10($sp) /* 035848 8005A448 03E00008 */ jr $ra /* 03584C 8005A44C 27BD0020 */ addiu $sp, $sp, 0x20