.set noat # allow manual use of $at .set noreorder # don't insert nops after branches glabel func_80066BE0 /* 41FE0 80066BE0 27BDFFD0 */ addiu $sp, $sp, -0x30 /* 41FE4 80066BE4 AFB00018 */ sw $s0, 0x18($sp) /* 41FE8 80066BE8 00808021 */ addu $s0, $a0, $zero /* 41FEC 80066BEC AFBF002C */ sw $ra, 0x2c($sp) /* 41FF0 80066BF0 AFB40028 */ sw $s4, 0x28($sp) /* 41FF4 80066BF4 AFB30024 */ sw $s3, 0x24($sp) /* 41FF8 80066BF8 AFB20020 */ sw $s2, 0x20($sp) /* 41FFC 80066BFC AFB1001C */ sw $s1, 0x1c($sp) /* 42000 80066C00 0C01B2E0 */ jal func_8006CB80 /* 42004 80066C04 AFA00010 */ sw $zero, 0x10($sp) /* 42008 80066C08 94420002 */ lhu $v0, 2($v0) /* 4200C 80066C0C 3C01800B */ lui $at, %hi(D_800AF8F0) /* 42010 80066C10 A422F8F0 */ sh $v0, %lo(D_800AF8F0)($at) /* 42014 80066C14 14400004 */ bnez $v0, .L80066C28 /* 42018 80066C18 00008821 */ addu $s1, $zero, $zero /* 4201C 80066C1C 24020001 */ addiu $v0, $zero, 1 /* 42020 80066C20 3C01800B */ lui $at, %hi(D_800AF8F0) /* 42024 80066C24 A422F8F0 */ sh $v0, %lo(D_800AF8F0)($at) .L80066C28: /* 42028 80066C28 02009021 */ addu $s2, $s0, $zero /* 4202C 80066C2C 2414000D */ addiu $s4, $zero, 0xd /* 42030 80066C30 2413000E */ addiu $s3, $zero, 0xe .L80066C34: /* 42034 80066C34 8E44000C */ lw $a0, 0xc($s2) /* 42038 80066C38 27A50010 */ addiu $a1, $sp, 0x10 /* 4203C 80066C3C 0C0195B0 */ jal func_800656C0 /* 42040 80066C40 24060001 */ addiu $a2, $zero, 1 /* 42044 80066C44 8FA20010 */ lw $v0, 0x10($sp) /* 42048 80066C48 94420000 */ lhu $v0, ($v0) /* 4204C 80066C4C 10540005 */ beq $v0, $s4, .L80066C64 /* 42050 80066C50 00000000 */ nop /* 42054 80066C54 1053003C */ beq $v0, $s3, .L80066D48 /* 42058 80066C58 00000000 */ nop /* 4205C 80066C5C 08019B0D */ j .L80066C34 /* 42060 80066C60 00000000 */ nop .L80066C64: /* 42064 80066C64 0C019C10 */ jal func_80067040 /* 42068 80066C68 00000000 */ nop /* 4206C 80066C6C 3C02800B */ lui $v0, %hi(D_800AF8F0) /* 42070 80066C70 9442F8F0 */ lhu $v0, %lo(D_800AF8F0)($v0) /* 42074 80066C74 2442FFFF */ addiu $v0, $v0, -1 /* 42078 80066C78 3C01800B */ lui $at, %hi(D_800AF8F0) /* 4207C 80066C7C A422F8F0 */ sh $v0, %lo(D_800AF8F0)($at) /* 42080 80066C80 3042FFFF */ andi $v0, $v0, 0xffff /* 42084 80066C84 1440000C */ bnez $v0, .L80066CB8 /* 42088 80066C88 00000000 */ nop /* 4208C 80066C8C 0C01B2E0 */ jal func_8006CB80 /* 42090 80066C90 00000000 */ nop /* 42094 80066C94 8C440010 */ lw $a0, 0x10($v0) /* 42098 80066C98 10800004 */ beqz $a0, .L80066CAC /* 4209C 80066C9C 00408021 */ addu $s0, $v0, $zero /* 420A0 80066CA0 8E050014 */ lw $a1, 0x14($s0) /* 420A4 80066CA4 0C0195FC */ jal func_800657F0 /* 420A8 80066CA8 00003021 */ addu $a2, $zero, $zero .L80066CAC: /* 420AC 80066CAC 96020002 */ lhu $v0, 2($s0) /* 420B0 80066CB0 3C01800B */ lui $at, %hi(D_800AF8F0) /* 420B4 80066CB4 A422F8F0 */ sh $v0, %lo(D_800AF8F0)($at) .L80066CB8: /* 420B8 80066CB8 3C02800A */ lui $v0, %hi(D_8009A5C4) /* 420BC 80066CBC 8C42A5C4 */ lw $v0, %lo(D_8009A5C4)($v0) /* 420C0 80066CC0 24420001 */ addiu $v0, $v0, 1 /* 420C4 80066CC4 3C01800A */ lui $at, %hi(D_8009A5C4) /* 420C8 80066CC8 1220000A */ beqz $s1, .L80066CF4 /* 420CC 80066CCC AC22A5C4 */ sw $v0, %lo(D_8009A5C4)($at) /* 420D0 80066CD0 0C019674 */ jal func_800659D0 /* 420D4 80066CD4 00008821 */ addu $s1, $zero, $zero /* 420D8 80066CD8 00408021 */ addu $s0, $v0, $zero /* 420DC 80066CDC 02001821 */ addu $v1, $s0, $zero /* 420E0 80066CE0 00001021 */ addu $v0, $zero, $zero /* 420E4 80066CE4 3C01800A */ lui $at, %hi(D_8009A5E8) /* 420E8 80066CE8 AC22A5E8 */ sw $v0, %lo(D_8009A5E8)($at) /* 420EC 80066CEC 3C01800A */ lui $at, %hi(D_8009A5EC) /* 420F0 80066CF0 AC23A5EC */ sw $v1, %lo(D_8009A5EC)($at) .L80066CF4: /* 420F4 80066CF4 3C10800A */ lui $s0, %hi(D_8009A5A8) /* 420F8 80066CF8 0C019674 */ jal func_800659D0 /* 420FC 80066CFC 8E10A5A8 */ lw $s0, %lo(D_8009A5A8)($s0) /* 42100 80066D00 3C01800A */ lui $at, %hi(D_8009A5A8) /* 42104 80066D04 AC22A5A8 */ sw $v0, %lo(D_8009A5A8)($at) /* 42108 80066D08 00508023 */ subu $s0, $v0, $s0 /* 4210C 80066D0C 3C02800A */ lui $v0, %hi(D_8009A5E8) /* 42110 80066D10 8C42A5E8 */ lw $v0, %lo(D_8009A5E8)($v0) /* 42114 80066D14 3C03800A */ lui $v1, %hi(D_8009A5EC) /* 42118 80066D18 8C63A5EC */ lw $v1, %lo(D_8009A5EC)($v1) /* 4211C 80066D1C 02002821 */ addu $a1, $s0, $zero /* 42120 80066D20 00002021 */ addu $a0, $zero, $zero /* 42124 80066D24 00651821 */ addu $v1, $v1, $a1 /* 42128 80066D28 0065302B */ sltu $a2, $v1, $a1 /* 4212C 80066D2C 00441021 */ addu $v0, $v0, $a0 /* 42130 80066D30 00461021 */ addu $v0, $v0, $a2 /* 42134 80066D34 3C01800A */ lui $at, %hi(D_8009A5E8) /* 42138 80066D38 AC22A5E8 */ sw $v0, %lo(D_8009A5E8)($at) /* 4213C 80066D3C 3C01800A */ lui $at, %hi(D_8009A5EC) /* 42140 80066D40 08019B0D */ j .L80066C34 /* 42144 80066D44 AC23A5EC */ sw $v1, %lo(D_8009A5EC)($at) .L80066D48: /* 42148 80066D48 0C019929 */ jal func_800664A4 /* 4214C 80066D4C 00000000 */ nop /* 42150 80066D50 08019B0D */ j .L80066C34 /* 42154 80066D54 00000000 */ nop /* 42158 80066D58 8FBF002C */ lw $ra, 0x2c($sp) /* 4215C 80066D5C 8FB40028 */ lw $s4, 0x28($sp) /* 42160 80066D60 8FB30024 */ lw $s3, 0x24($sp) /* 42164 80066D64 8FB20020 */ lw $s2, 0x20($sp) /* 42168 80066D68 8FB1001C */ lw $s1, 0x1c($sp) /* 4216C 80066D6C 8FB00018 */ lw $s0, 0x18($sp) /* 42170 80066D70 03E00008 */ jr $ra /* 42174 80066D74 27BD0030 */ addiu $sp, $sp, 0x30 /* 42178 80066D78 00000000 */ nop /* 4217C 80066D7C 00000000 */ nop