papermario/ver/jp/asm/nonmatchings/3BC0/func_80028844.s
Alex Bates a8c85b377a
Share 1370.c across versions (#509)
* split jp gfxRetrace_Callback

* func_80025F70

* use 1370_len_7d0 on jp

* rename 1370_len_7d0 to main

* coverage.py
2021-10-31 03:53:55 +09:00

461 lines
23 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80028844
/* 3C44 80028844 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 3C48 80028848 AFB20018 */ sw $s2, 0x18($sp)
/* 3C4C 8002884C 3C128007 */ lui $s2, %hi(gGameStatusPtr)
/* 3C50 80028850 2652417C */ addiu $s2, $s2, %lo(gGameStatusPtr)
/* 3C54 80028854 AFBF001C */ sw $ra, 0x1c($sp)
/* 3C58 80028858 AFB10014 */ sw $s1, 0x14($sp)
/* 3C5C 8002885C AFB00010 */ sw $s0, 0x10($sp)
/* 3C60 80028860 8E420000 */ lw $v0, ($s2)
/* 3C64 80028864 90420073 */ lbu $v0, 0x73($v0)
/* 3C68 80028868 3C11800A */ lui $s1, %hi(D_8009A598)
/* 3C6C 8002886C 2631A598 */ addiu $s1, $s1, %lo(D_8009A598)
/* 3C70 80028870 30420001 */ andi $v0, $v0, 1
/* 3C74 80028874 10400005 */ beqz $v0, .L8002888C
/* 3C78 80028878 0000802D */ daddu $s0, $zero, $zero
/* 3C7C 8002887C 24100001 */ addiu $s0, $zero, 1
/* 3C80 80028880 0220202D */ daddu $a0, $s1, $zero
/* 3C84 80028884 0C017CC0 */ jal func_8005F300
/* 3C88 80028888 0000282D */ daddu $a1, $zero, $zero
.L8002888C:
/* 3C8C 8002888C 8E430000 */ lw $v1, ($s2)
/* 3C90 80028890 80620071 */ lb $v0, 0x71($v1)
/* 3C94 80028894 10400015 */ beqz $v0, .L800288EC
/* 3C98 80028898 28420002 */ slti $v0, $v0, 2
/* 3C9C 8002889C 10400008 */ beqz $v0, .L800288C0
/* 3CA0 800288A0 00000000 */ nop
/* 3CA4 800288A4 96220000 */ lhu $v0, ($s1)
/* 3CA8 800288A8 3042F000 */ andi $v0, $v0, 0xf000
/* 3CAC 800288AC 10400004 */ beqz $v0, .L800288C0
/* 3CB0 800288B0 0200102D */ daddu $v0, $s0, $zero
/* 3CB4 800288B4 10400002 */ beqz $v0, .L800288C0
/* 3CB8 800288B8 24020002 */ addiu $v0, $zero, 2
/* 3CBC 800288BC A0620071 */ sb $v0, 0x71($v1)
.L800288C0:
/* 3CC0 800288C0 3C048007 */ lui $a0, %hi(gGameStatusPtr)
/* 3CC4 800288C4 2484417C */ addiu $a0, $a0, %lo(gGameStatusPtr)
/* 3CC8 800288C8 8C830000 */ lw $v1, ($a0)
/* 3CCC 800288CC 94620068 */ lhu $v0, 0x68($v1)
/* 3CD0 800288D0 A6220000 */ sh $v0, ($s1)
/* 3CD4 800288D4 9062006A */ lbu $v0, 0x6a($v1)
/* 3CD8 800288D8 8C830000 */ lw $v1, ($a0)
/* 3CDC 800288DC A2220002 */ sb $v0, 2($s1)
/* 3CE0 800288E0 9062006B */ lbu $v0, 0x6b($v1)
/* 3CE4 800288E4 24100001 */ addiu $s0, $zero, 1
/* 3CE8 800288E8 A2220003 */ sb $v0, 3($s1)
.L800288EC:
/* 3CEC 800288EC 0200102D */ daddu $v0, $s0, $zero
/* 3CF0 800288F0 10400166 */ beqz $v0, .L80028E8C
/* 3CF4 800288F4 00000000 */ nop
/* 3CF8 800288F8 92230003 */ lbu $v1, 3($s1)
/* 3CFC 800288FC 92220002 */ lbu $v0, 2($s1)
/* 3D00 80028900 00031E00 */ sll $v1, $v1, 0x18
/* 3D04 80028904 00033E03 */ sra $a3, $v1, 0x18
/* 3D08 80028908 00021600 */ sll $v0, $v0, 0x18
/* 3D0C 8002890C 18400007 */ blez $v0, .L8002892C
/* 3D10 80028910 00022E03 */ sra $a1, $v0, 0x18
/* 3D14 80028914 24A2FFFC */ addiu $v0, $a1, -4
/* 3D18 80028918 0040282D */ daddu $a1, $v0, $zero
/* 3D1C 8002891C 00021400 */ sll $v0, $v0, 0x10
/* 3D20 80028920 0441000B */ bgez $v0, .L80028950
/* 3D24 80028924 00071400 */ sll $v0, $a3, 0x10
/* 3D28 80028928 0000282D */ daddu $a1, $zero, $zero
.L8002892C:
/* 3D2C 8002892C 00051400 */ sll $v0, $a1, 0x10
/* 3D30 80028930 04410007 */ bgez $v0, .L80028950
/* 3D34 80028934 00071400 */ sll $v0, $a3, 0x10
/* 3D38 80028938 24A20004 */ addiu $v0, $a1, 4
/* 3D3C 8002893C 0040282D */ daddu $a1, $v0, $zero
/* 3D40 80028940 00021400 */ sll $v0, $v0, 0x10
/* 3D44 80028944 5C400001 */ bgtzl $v0, .L8002894C
/* 3D48 80028948 0000282D */ daddu $a1, $zero, $zero
.L8002894C:
/* 3D4C 8002894C 00071400 */ sll $v0, $a3, 0x10
.L80028950:
/* 3D50 80028950 18400006 */ blez $v0, .L8002896C
/* 3D54 80028954 24E2FFFC */ addiu $v0, $a3, -4
/* 3D58 80028958 0040382D */ daddu $a3, $v0, $zero
/* 3D5C 8002895C 00021400 */ sll $v0, $v0, 0x10
/* 3D60 80028960 04410009 */ bgez $v0, .L80028988
/* 3D64 80028964 00000000 */ nop
/* 3D68 80028968 0000382D */ daddu $a3, $zero, $zero
.L8002896C:
/* 3D6C 8002896C 00071400 */ sll $v0, $a3, 0x10
/* 3D70 80028970 04410005 */ bgez $v0, .L80028988
/* 3D74 80028974 24E20004 */ addiu $v0, $a3, 4
/* 3D78 80028978 0040382D */ daddu $a3, $v0, $zero
/* 3D7C 8002897C 00021400 */ sll $v0, $v0, 0x10
/* 3D80 80028980 5C400001 */ bgtzl $v0, .L80028988
/* 3D84 80028984 0000382D */ daddu $a3, $zero, $zero
.L80028988:
/* 3D88 80028988 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* 3D8C 8002898C 2463417C */ addiu $v1, $v1, %lo(gGameStatusPtr)
/* 3D90 80028990 8C620000 */ lw $v0, ($v1)
/* 3D94 80028994 A0450040 */ sb $a1, 0x40($v0)
/* 3D98 80028998 8C620000 */ lw $v0, ($v1)
/* 3D9C 8002899C A0470044 */ sb $a3, 0x44($v0)
/* 3DA0 800289A0 00051400 */ sll $v0, $a1, 0x10
/* 3DA4 800289A4 00023403 */ sra $a2, $v0, 0x10
/* 3DA8 800289A8 28C20021 */ slti $v0, $a2, 0x21
/* 3DAC 800289AC 96240000 */ lhu $a0, ($s1)
/* 3DB0 800289B0 1440001B */ bnez $v0, .L80028A20
/* 3DB4 800289B4 0000402D */ daddu $t0, $zero, $zero
/* 3DB8 800289B8 24080001 */ addiu $t0, $zero, 1
/* 3DBC 800289BC 8C620000 */ lw $v0, ($v1)
/* 3DC0 800289C0 3C030008 */ lui $v1, 8
/* 3DC4 800289C4 8C420030 */ lw $v0, 0x30($v0)
/* 3DC8 800289C8 00431024 */ and $v0, $v0, $v1
/* 3DCC 800289CC 14400005 */ bnez $v0, .L800289E4
/* 3DD0 800289D0 00832025 */ or $a0, $a0, $v1
/* 3DD4 800289D4 3C01800A */ lui $at, %hi(D_8009A680)
/* 3DD8 800289D8 A425A680 */ sh $a1, %lo(D_8009A680)($at)
/* 3DDC 800289DC 0800A289 */ j .L80028A24
/* 3DE0 800289E0 00051400 */ sll $v0, $a1, 0x10
.L800289E4:
/* 3DE4 800289E4 3C02800A */ lui $v0, %hi(D_8009A684)
/* 3DE8 800289E8 8442A684 */ lh $v0, %lo(D_8009A684)($v0)
/* 3DEC 800289EC 14400006 */ bnez $v0, .L80028A08
/* 3DF0 800289F0 00000000 */ nop
/* 3DF4 800289F4 3C03800A */ lui $v1, %hi(D_8009A680)
/* 3DF8 800289F8 2463A680 */ addiu $v1, $v1, %lo(D_8009A680)
/* 3DFC 800289FC 84620000 */ lh $v0, ($v1)
/* 3E00 80028A00 0800A286 */ j .L80028A18
/* 3E04 80028A04 0046102A */ slt $v0, $v0, $a2
.L80028A08:
/* 3E08 80028A08 3C03800A */ lui $v1, %hi(D_8009A680)
/* 3E0C 80028A0C 2463A680 */ addiu $v1, $v1, %lo(D_8009A680)
/* 3E10 80028A10 84620000 */ lh $v0, ($v1)
/* 3E14 80028A14 00C2102A */ slt $v0, $a2, $v0
.L80028A18:
/* 3E18 80028A18 54400001 */ bnel $v0, $zero, .L80028A20
/* 3E1C 80028A1C A4650000 */ sh $a1, ($v1)
.L80028A20:
/* 3E20 80028A20 00051400 */ sll $v0, $a1, 0x10
.L80028A24:
/* 3E24 80028A24 00023403 */ sra $a2, $v0, 0x10
/* 3E28 80028A28 28C2FFE0 */ slti $v0, $a2, -0x20
/* 3E2C 80028A2C 1040001D */ beqz $v0, .L80028AA4
/* 3E30 80028A30 0100102D */ daddu $v0, $t0, $zero
/* 3E34 80028A34 24080001 */ addiu $t0, $zero, 1
/* 3E38 80028A38 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 3E3C 80028A3C 8C42417C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 3E40 80028A40 3C030004 */ lui $v1, 4
/* 3E44 80028A44 8C420030 */ lw $v0, 0x30($v0)
/* 3E48 80028A48 00431024 */ and $v0, $v0, $v1
/* 3E4C 80028A4C 14400005 */ bnez $v0, .L80028A64
/* 3E50 80028A50 00832025 */ or $a0, $a0, $v1
/* 3E54 80028A54 3C01800A */ lui $at, %hi(D_8009A680)
/* 3E58 80028A58 A425A680 */ sh $a1, %lo(D_8009A680)($at)
/* 3E5C 80028A5C 0800A2A9 */ j .L80028AA4
/* 3E60 80028A60 0100102D */ daddu $v0, $t0, $zero
.L80028A64:
/* 3E64 80028A64 3C02800A */ lui $v0, %hi(D_8009A684)
/* 3E68 80028A68 8442A684 */ lh $v0, %lo(D_8009A684)($v0)
/* 3E6C 80028A6C 14400006 */ bnez $v0, .L80028A88
/* 3E70 80028A70 00000000 */ nop
/* 3E74 80028A74 3C03800A */ lui $v1, %hi(D_8009A680)
/* 3E78 80028A78 2463A680 */ addiu $v1, $v1, %lo(D_8009A680)
/* 3E7C 80028A7C 84620000 */ lh $v0, ($v1)
/* 3E80 80028A80 0800A2A6 */ j .L80028A98
/* 3E84 80028A84 00C2102A */ slt $v0, $a2, $v0
.L80028A88:
/* 3E88 80028A88 3C03800A */ lui $v1, %hi(D_8009A680)
/* 3E8C 80028A8C 2463A680 */ addiu $v1, $v1, %lo(D_8009A680)
/* 3E90 80028A90 84620000 */ lh $v0, ($v1)
/* 3E94 80028A94 0046102A */ slt $v0, $v0, $a2
.L80028A98:
/* 3E98 80028A98 54400001 */ bnel $v0, $zero, .L80028AA0
/* 3E9C 80028A9C A4650000 */ sh $a1, ($v1)
.L80028AA0:
/* 3EA0 80028AA0 0100102D */ daddu $v0, $t0, $zero
.L80028AA4:
/* 3EA4 80028AA4 14400005 */ bnez $v0, .L80028ABC
/* 3EA8 80028AA8 00071400 */ sll $v0, $a3, 0x10
/* 3EAC 80028AAC 3C01800A */ lui $at, %hi(D_8009A684)
/* 3EB0 80028AB0 A420A684 */ sh $zero, %lo(D_8009A684)($at)
/* 3EB4 80028AB4 3C01800A */ lui $at, %hi(D_8009A680)
/* 3EB8 80028AB8 A425A680 */ sh $a1, %lo(D_8009A680)($at)
.L80028ABC:
/* 3EBC 80028ABC 00023403 */ sra $a2, $v0, 0x10
/* 3EC0 80028AC0 28C20021 */ slti $v0, $a2, 0x21
/* 3EC4 80028AC4 1440001C */ bnez $v0, .L80028B38
/* 3EC8 80028AC8 0000402D */ daddu $t0, $zero, $zero
/* 3ECC 80028ACC 24080001 */ addiu $t0, $zero, 1
/* 3ED0 80028AD0 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 3ED4 80028AD4 8C42417C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 3ED8 80028AD8 3C030001 */ lui $v1, 1
/* 3EDC 80028ADC 8C420030 */ lw $v0, 0x30($v0)
/* 3EE0 80028AE0 00431024 */ and $v0, $v0, $v1
/* 3EE4 80028AE4 14400005 */ bnez $v0, .L80028AFC
/* 3EE8 80028AE8 00832025 */ or $a0, $a0, $v1
/* 3EEC 80028AEC 3C01800A */ lui $at, %hi(D_8009A682)
/* 3EF0 80028AF0 A427A682 */ sh $a3, %lo(D_8009A682)($at)
/* 3EF4 80028AF4 0800A2CF */ j .L80028B3C
/* 3EF8 80028AF8 00071400 */ sll $v0, $a3, 0x10
.L80028AFC:
/* 3EFC 80028AFC 3C02800A */ lui $v0, %hi(D_8009A686)
/* 3F00 80028B00 8442A686 */ lh $v0, %lo(D_8009A686)($v0)
/* 3F04 80028B04 14400006 */ bnez $v0, .L80028B20
/* 3F08 80028B08 00000000 */ nop
/* 3F0C 80028B0C 3C03800A */ lui $v1, %hi(D_8009A682)
/* 3F10 80028B10 2463A682 */ addiu $v1, $v1, %lo(D_8009A682)
/* 3F14 80028B14 84620000 */ lh $v0, ($v1)
/* 3F18 80028B18 0800A2CC */ j .L80028B30
/* 3F1C 80028B1C 0046102A */ slt $v0, $v0, $a2
.L80028B20:
/* 3F20 80028B20 3C03800A */ lui $v1, %hi(D_8009A682)
/* 3F24 80028B24 2463A682 */ addiu $v1, $v1, %lo(D_8009A682)
/* 3F28 80028B28 84620000 */ lh $v0, ($v1)
/* 3F2C 80028B2C 00C2102A */ slt $v0, $a2, $v0
.L80028B30:
/* 3F30 80028B30 54400001 */ bnel $v0, $zero, .L80028B38
/* 3F34 80028B34 A4670000 */ sh $a3, ($v1)
.L80028B38:
/* 3F38 80028B38 00071400 */ sll $v0, $a3, 0x10
.L80028B3C:
/* 3F3C 80028B3C 00023403 */ sra $a2, $v0, 0x10
/* 3F40 80028B40 28C2FFE0 */ slti $v0, $a2, -0x20
/* 3F44 80028B44 1040002B */ beqz $v0, .L80028BF4
/* 3F48 80028B48 0100102D */ daddu $v0, $t0, $zero
/* 3F4C 80028B4C 24080001 */ addiu $t0, $zero, 1
/* 3F50 80028B50 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 3F54 80028B54 8C42417C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 3F58 80028B58 3C030002 */ lui $v1, 2
/* 3F5C 80028B5C 8C420030 */ lw $v0, 0x30($v0)
/* 3F60 80028B60 00431024 */ and $v0, $v0, $v1
/* 3F64 80028B64 14400005 */ bnez $v0, .L80028B7C
/* 3F68 80028B68 00832025 */ or $a0, $a0, $v1
/* 3F6C 80028B6C 3C01800A */ lui $at, %hi(D_8009A682)
/* 3F70 80028B70 A427A682 */ sh $a3, %lo(D_8009A682)($at)
/* 3F74 80028B74 0800A2FD */ j .L80028BF4
/* 3F78 80028B78 0100102D */ daddu $v0, $t0, $zero
.L80028B7C:
/* 3F7C 80028B7C 3C02800A */ lui $v0, %hi(D_8009A686)
/* 3F80 80028B80 8442A686 */ lh $v0, %lo(D_8009A686)($v0)
/* 3F84 80028B84 14400014 */ bnez $v0, .L80028BD8
/* 3F88 80028B88 00000000 */ nop
/* 3F8C 80028B8C 3C03800A */ lui $v1, %hi(D_8009A682)
/* 3F90 80028B90 2463A682 */ addiu $v1, $v1, %lo(D_8009A682)
/* 3F94 80028B94 84620000 */ lh $v0, ($v1)
/* 3F98 80028B98 0800A2FA */ j .L80028BE8
/* 3F9C 80028B9C 00C2102A */ slt $v0, $a2, $v0
.L80028BA0:
/* 3FA0 80028BA0 8CA30000 */ lw $v1, ($a1)
/* 3FA4 80028BA4 8CA40030 */ lw $a0, 0x30($a1)
/* 3FA8 80028BA8 2402FFFF */ addiu $v0, $zero, -1
/* 3FAC 80028BAC A4A20060 */ sh $v0, 0x60($a1)
/* 3FB0 80028BB0 8CA20000 */ lw $v0, ($a1)
/* 3FB4 80028BB4 00641826 */ xor $v1, $v1, $a0
/* 3FB8 80028BB8 94A40048 */ lhu $a0, 0x48($a1)
/* 3FBC 80028BBC ACA30020 */ sw $v1, 0x20($a1)
/* 3FC0 80028BC0 00621824 */ and $v1, $v1, $v0
/* 3FC4 80028BC4 ACA30020 */ sw $v1, 0x20($a1)
/* 3FC8 80028BC8 0800A39F */ j .L80028E7C
/* 3FCC 80028BCC A4A40058 */ sh $a0, 0x58($a1)
.L80028BD0:
/* 3FD0 80028BD0 0800A39F */ j .L80028E7C
/* 3FD4 80028BD4 ACA00020 */ sw $zero, 0x20($a1)
.L80028BD8:
/* 3FD8 80028BD8 3C03800A */ lui $v1, %hi(D_8009A682)
/* 3FDC 80028BDC 2463A682 */ addiu $v1, $v1, %lo(D_8009A682)
/* 3FE0 80028BE0 84620000 */ lh $v0, ($v1)
/* 3FE4 80028BE4 0046102A */ slt $v0, $v0, $a2
.L80028BE8:
/* 3FE8 80028BE8 54400001 */ bnel $v0, $zero, .L80028BF0
/* 3FEC 80028BEC A4670000 */ sh $a3, ($v1)
.L80028BF0:
/* 3FF0 80028BF0 0100102D */ daddu $v0, $t0, $zero
.L80028BF4:
/* 3FF4 80028BF4 14400005 */ bnez $v0, .L80028C0C
/* 3FF8 80028BF8 00051400 */ sll $v0, $a1, 0x10
/* 3FFC 80028BFC 3C01800A */ lui $at, %hi(D_8009A686)
/* 4000 80028C00 A420A686 */ sh $zero, %lo(D_8009A686)($at)
/* 4004 80028C04 3C01800A */ lui $at, %hi(D_8009A682)
/* 4008 80028C08 A427A682 */ sh $a3, %lo(D_8009A682)($at)
.L80028C0C:
/* 400C 80028C0C 00023403 */ sra $a2, $v0, 0x10
/* 4010 80028C10 28C20021 */ slti $v0, $a2, 0x21
/* 4014 80028C14 1440001C */ bnez $v0, .L80028C88
/* 4018 80028C18 00051400 */ sll $v0, $a1, 0x10
/* 401C 80028C1C 3C08800A */ lui $t0, %hi(D_8009A684)
/* 4020 80028C20 2508A684 */ addiu $t0, $t0, %lo(D_8009A684)
/* 4024 80028C24 85030000 */ lh $v1, ($t0)
/* 4028 80028C28 24020001 */ addiu $v0, $zero, 1
/* 402C 80028C2C 1462000A */ bne $v1, $v0, .L80028C58
/* 4030 80028C30 00000000 */ nop
/* 4034 80028C34 3C02800A */ lui $v0, %hi(D_8009A680)
/* 4038 80028C38 8442A680 */ lh $v0, %lo(D_8009A680)($v0)
/* 403C 80028C3C 00C21023 */ subu $v0, $a2, $v0
/* 4040 80028C40 28420011 */ slti $v0, $v0, 0x11
/* 4044 80028C44 14400004 */ bnez $v0, .L80028C58
/* 4048 80028C48 3C02FFF7 */ lui $v0, 0xfff7
/* 404C 80028C4C 3442FFFF */ ori $v0, $v0, 0xffff
/* 4050 80028C50 00822024 */ and $a0, $a0, $v0
/* 4054 80028C54 A5000000 */ sh $zero, ($t0)
.L80028C58:
/* 4058 80028C58 3C03800A */ lui $v1, %hi(D_8009A680)
/* 405C 80028C5C 8463A680 */ lh $v1, %lo(D_8009A680)($v1)
/* 4060 80028C60 00051400 */ sll $v0, $a1, 0x10
/* 4064 80028C64 00021403 */ sra $v0, $v0, 0x10
/* 4068 80028C68 00621823 */ subu $v1, $v1, $v0
/* 406C 80028C6C 28630011 */ slti $v1, $v1, 0x11
/* 4070 80028C70 14600005 */ bnez $v1, .L80028C88
/* 4074 80028C74 00051400 */ sll $v0, $a1, 0x10
/* 4078 80028C78 24020001 */ addiu $v0, $zero, 1
/* 407C 80028C7C 3C01800A */ lui $at, %hi(D_8009A684)
/* 4080 80028C80 A422A684 */ sh $v0, %lo(D_8009A684)($at)
/* 4084 80028C84 00051400 */ sll $v0, $a1, 0x10
.L80028C88:
/* 4088 80028C88 00023403 */ sra $a2, $v0, 0x10
/* 408C 80028C8C 28C2FFE0 */ slti $v0, $a2, -0x20
/* 4090 80028C90 1040001B */ beqz $v0, .L80028D00
/* 4094 80028C94 24020001 */ addiu $v0, $zero, 1
/* 4098 80028C98 3C08800A */ lui $t0, %hi(D_8009A684)
/* 409C 80028C9C 2508A684 */ addiu $t0, $t0, %lo(D_8009A684)
/* 40A0 80028CA0 85030000 */ lh $v1, ($t0)
/* 40A4 80028CA4 1462000C */ bne $v1, $v0, .L80028CD8
/* 40A8 80028CA8 00051400 */ sll $v0, $a1, 0x10
/* 40AC 80028CAC 3C02800A */ lui $v0, %hi(D_8009A680)
/* 40B0 80028CB0 8442A680 */ lh $v0, %lo(D_8009A680)($v0)
/* 40B4 80028CB4 00461023 */ subu $v0, $v0, $a2
/* 40B8 80028CB8 28420011 */ slti $v0, $v0, 0x11
/* 40BC 80028CBC 14400006 */ bnez $v0, .L80028CD8
/* 40C0 80028CC0 00051400 */ sll $v0, $a1, 0x10
/* 40C4 80028CC4 3C02FFFB */ lui $v0, 0xfffb
/* 40C8 80028CC8 3442FFFF */ ori $v0, $v0, 0xffff
/* 40CC 80028CCC 00822024 */ and $a0, $a0, $v0
/* 40D0 80028CD0 A5000000 */ sh $zero, ($t0)
/* 40D4 80028CD4 00051400 */ sll $v0, $a1, 0x10
.L80028CD8:
/* 40D8 80028CD8 3C03800A */ lui $v1, %hi(D_8009A680)
/* 40DC 80028CDC 8463A680 */ lh $v1, %lo(D_8009A680)($v1)
/* 40E0 80028CE0 00021403 */ sra $v0, $v0, 0x10
/* 40E4 80028CE4 00431023 */ subu $v0, $v0, $v1
/* 40E8 80028CE8 28420011 */ slti $v0, $v0, 0x11
/* 40EC 80028CEC 14400005 */ bnez $v0, .L80028D04
/* 40F0 80028CF0 00071400 */ sll $v0, $a3, 0x10
/* 40F4 80028CF4 24020001 */ addiu $v0, $zero, 1
/* 40F8 80028CF8 3C01800A */ lui $at, %hi(D_8009A684)
/* 40FC 80028CFC A422A684 */ sh $v0, %lo(D_8009A684)($at)
.L80028D00:
/* 4100 80028D00 00071400 */ sll $v0, $a3, 0x10
.L80028D04:
/* 4104 80028D04 00022C03 */ sra $a1, $v0, 0x10
/* 4108 80028D08 28A20021 */ slti $v0, $a1, 0x21
/* 410C 80028D0C 1440001C */ bnez $v0, .L80028D80
/* 4110 80028D10 00071400 */ sll $v0, $a3, 0x10
/* 4114 80028D14 3C06800A */ lui $a2, %hi(D_8009A686)
/* 4118 80028D18 24C6A686 */ addiu $a2, $a2, %lo(D_8009A686)
/* 411C 80028D1C 84C30000 */ lh $v1, ($a2)
/* 4120 80028D20 24020001 */ addiu $v0, $zero, 1
/* 4124 80028D24 1462000A */ bne $v1, $v0, .L80028D50
/* 4128 80028D28 00000000 */ nop
/* 412C 80028D2C 3C02800A */ lui $v0, %hi(D_8009A682)
/* 4130 80028D30 8442A682 */ lh $v0, %lo(D_8009A682)($v0)
/* 4134 80028D34 00A21023 */ subu $v0, $a1, $v0
/* 4138 80028D38 28420011 */ slti $v0, $v0, 0x11
/* 413C 80028D3C 14400004 */ bnez $v0, .L80028D50
/* 4140 80028D40 3C02FFFE */ lui $v0, 0xfffe
/* 4144 80028D44 3442FFFF */ ori $v0, $v0, 0xffff
/* 4148 80028D48 00822024 */ and $a0, $a0, $v0
/* 414C 80028D4C A4C00000 */ sh $zero, ($a2)
.L80028D50:
/* 4150 80028D50 3C03800A */ lui $v1, %hi(D_8009A682)
/* 4154 80028D54 8463A682 */ lh $v1, %lo(D_8009A682)($v1)
/* 4158 80028D58 00071400 */ sll $v0, $a3, 0x10
/* 415C 80028D5C 00021403 */ sra $v0, $v0, 0x10
/* 4160 80028D60 00621823 */ subu $v1, $v1, $v0
/* 4164 80028D64 28630011 */ slti $v1, $v1, 0x11
/* 4168 80028D68 14600005 */ bnez $v1, .L80028D80
/* 416C 80028D6C 00071400 */ sll $v0, $a3, 0x10
/* 4170 80028D70 24020001 */ addiu $v0, $zero, 1
/* 4174 80028D74 3C01800A */ lui $at, %hi(D_8009A686)
/* 4178 80028D78 A422A686 */ sh $v0, %lo(D_8009A686)($at)
/* 417C 80028D7C 00071400 */ sll $v0, $a3, 0x10
.L80028D80:
/* 4180 80028D80 00022C03 */ sra $a1, $v0, 0x10
/* 4184 80028D84 28A2FFE0 */ slti $v0, $a1, -0x20
/* 4188 80028D88 1040001A */ beqz $v0, .L80028DF4
/* 418C 80028D8C 24020001 */ addiu $v0, $zero, 1
/* 4190 80028D90 3C06800A */ lui $a2, %hi(D_8009A686)
/* 4194 80028D94 24C6A686 */ addiu $a2, $a2, %lo(D_8009A686)
/* 4198 80028D98 84C30000 */ lh $v1, ($a2)
/* 419C 80028D9C 1462000C */ bne $v1, $v0, .L80028DD0
/* 41A0 80028DA0 00071400 */ sll $v0, $a3, 0x10
/* 41A4 80028DA4 3C02800A */ lui $v0, %hi(D_8009A682)
/* 41A8 80028DA8 8442A682 */ lh $v0, %lo(D_8009A682)($v0)
/* 41AC 80028DAC 00451023 */ subu $v0, $v0, $a1
/* 41B0 80028DB0 28420011 */ slti $v0, $v0, 0x11
/* 41B4 80028DB4 14400006 */ bnez $v0, .L80028DD0
/* 41B8 80028DB8 00071400 */ sll $v0, $a3, 0x10
/* 41BC 80028DBC 3C02FFFD */ lui $v0, 0xfffd
/* 41C0 80028DC0 3442FFFF */ ori $v0, $v0, 0xffff
/* 41C4 80028DC4 00822024 */ and $a0, $a0, $v0
/* 41C8 80028DC8 A4C00000 */ sh $zero, ($a2)
/* 41CC 80028DCC 00071400 */ sll $v0, $a3, 0x10
.L80028DD0:
/* 41D0 80028DD0 3C03800A */ lui $v1, %hi(D_8009A682)
/* 41D4 80028DD4 8463A682 */ lh $v1, %lo(D_8009A682)($v1)
/* 41D8 80028DD8 00021403 */ sra $v0, $v0, 0x10
/* 41DC 80028DDC 00431023 */ subu $v0, $v0, $v1
/* 41E0 80028DE0 28420011 */ slti $v0, $v0, 0x11
/* 41E4 80028DE4 14400003 */ bnez $v0, .L80028DF4
/* 41E8 80028DE8 24020001 */ addiu $v0, $zero, 1
/* 41EC 80028DEC 3C01800A */ lui $at, %hi(D_8009A686)
/* 41F0 80028DF0 A422A686 */ sh $v0, %lo(D_8009A686)($at)
.L80028DF4:
/* 41F4 80028DF4 3C058007 */ lui $a1, %hi(gGameStatusPtr)
/* 41F8 80028DF8 8CA5417C */ lw $a1, %lo(gGameStatusPtr)($a1)
/* 41FC 80028DFC 8CA20030 */ lw $v0, 0x30($a1)
/* 4200 80028E00 ACA40000 */ sw $a0, ($a1)
/* 4204 80028E04 0080182D */ daddu $v1, $a0, $zero
/* 4208 80028E08 00821026 */ xor $v0, $a0, $v0
/* 420C 80028E0C ACA20010 */ sw $v0, 0x10($a1)
/* 4210 80028E10 00431024 */ and $v0, $v0, $v1
/* 4214 80028E14 1060FF6E */ beqz $v1, .L80028BD0
/* 4218 80028E18 ACA20010 */ sw $v0, 0x10($a1)
/* 421C 80028E1C 8CA20030 */ lw $v0, 0x30($a1)
/* 4220 80028E20 5443FF5F */ bnel $v0, $v1, .L80028BA0
/* 4224 80028E24 ACA30020 */ sw $v1, 0x20($a1)
/* 4228 80028E28 84A20060 */ lh $v0, 0x60($a1)
/* 422C 80028E2C 94A30060 */ lhu $v1, 0x60($a1)
/* 4230 80028E30 04400008 */ bltz $v0, .L80028E54
/* 4234 80028E34 2462FFFF */ addiu $v0, $v1, -1
/* 4238 80028E38 A4A20060 */ sh $v0, 0x60($a1)
/* 423C 80028E3C 00021400 */ sll $v0, $v0, 0x10
/* 4240 80028E40 1440FF63 */ bnez $v0, .L80028BD0
/* 4244 80028E44 0080102D */ daddu $v0, $a0, $zero
/* 4248 80028E48 94A30050 */ lhu $v1, 0x50($a1)
/* 424C 80028E4C 0800A39E */ j .L80028E78
/* 4250 80028E50 ACA20020 */ sw $v0, 0x20($a1)
.L80028E54:
/* 4254 80028E54 94A20058 */ lhu $v0, 0x58($a1)
/* 4258 80028E58 2442FFFF */ addiu $v0, $v0, -1
/* 425C 80028E5C A4A20058 */ sh $v0, 0x58($a1)
/* 4260 80028E60 00021400 */ sll $v0, $v0, 0x10
/* 4264 80028E64 54400005 */ bnel $v0, $zero, .L80028E7C
/* 4268 80028E68 ACA00020 */ sw $zero, 0x20($a1)
/* 426C 80028E6C 8CA20000 */ lw $v0, ($a1)
/* 4270 80028E70 94A30050 */ lhu $v1, 0x50($a1)
/* 4274 80028E74 ACA20020 */ sw $v0, 0x20($a1)
.L80028E78:
/* 4278 80028E78 A4A30060 */ sh $v1, 0x60($a1)
.L80028E7C:
/* 427C 80028E7C 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* 4280 80028E80 8C63417C */ lw $v1, %lo(gGameStatusPtr)($v1)
/* 4284 80028E84 8C620000 */ lw $v0, ($v1)
/* 4288 80028E88 AC620030 */ sw $v0, 0x30($v1)
.L80028E8C:
/* 428C 80028E8C 8FBF001C */ lw $ra, 0x1c($sp)
/* 4290 80028E90 8FB20018 */ lw $s2, 0x18($sp)
/* 4294 80028E94 8FB10014 */ lw $s1, 0x14($sp)
/* 4298 80028E98 8FB00010 */ lw $s0, 0x10($sp)
/* 429C 80028E9C 03E00008 */ jr $ra
/* 42A0 80028EA0 27BD0020 */ addiu $sp, $sp, 0x20
/* 42A4 80028EA4 00000000 */ nop
/* 42A8 80028EA8 00000000 */ nop
/* 42AC 80028EAC 00000000 */ nop