### RAW ASSEMBLY INSTRUCTIONS:

dlabel D_802A1C54_7A95F4
/* 4169E4 802A1C54 3C02802B */  lui       $v0, %hi(BattleMenuState)
/* 4169E8 802A1C58 9042D000 */  lbu       $v0, %lo(BattleMenuState)($v0)
/* 4169EC 802A1C5C 27BDFF88 */  addiu     $sp, $sp, -0x78
D_802A1C60_7A9600:
/* 4169F0 802A1C60 AFBF0054 */  sw        $ra, 0x54($sp)
/* 4169F4 802A1C64 AFBE0050 */  sw        $fp, 0x50($sp)
/* 4169F8 802A1C68 AFB7004C */  sw        $s7, 0x4C($sp)
/* 4169FC 802A1C6C AFB60048 */  sw        $s6, 0x48($sp)
/* 416A00 802A1C70 AFB50044 */  sw        $s5, 0x44($sp)
D_802A1C74_7A9614:
/* 416A04 802A1C74 AFB40040 */  sw        $s4, 0x40($sp)
/* 416A08 802A1C78 AFB3003C */  sw        $s3, 0x3C($sp)
/* 416A0C 802A1C7C AFB20038 */  sw        $s2, 0x38($sp)
/* 416A10 802A1C80 AFB10034 */  sw        $s1, 0x34($sp)
/* 416A14 802A1C84 AFB00030 */  sw        $s0, 0x30($sp)
D_802A1C88_7A9628:
/* 416A18 802A1C88 F7BA0070 */  sdc1      $f26, 0x70($sp)
/* 416A1C 802A1C8C F7B80068 */  sdc1      $f24, 0x68($sp)
D_802A1C90_7A9630:
/* 416A20 802A1C90 F7B60060 */  sdc1      $f22, 0x60($sp)
/* 416A24 802A1C94 F7B40058 */  sdc1      $f20, 0x58($sp)
/* 416A28 802A1C98 24420001 */  addiu     $v0, $v0, 0x1
/* 416A2C 802A1C9C 00021600 */  sll       $v0, $v0, 24
D_802A1CA0_7A9640:
/* 416A30 802A1CA0 00021E03 */  sra       $v1, $v0, 24
/* 416A34 802A1CA4 2C620020 */  sltiu     $v0, $v1, 0x20
/* 416A38 802A1CA8 10400266 */  beqz      $v0, .L802A2644_7A9FE4
/* 416A3C 802A1CAC 00031080 */   sll      $v0, $v1, 2
/* 416A40 802A1CB0 3C01802B */  lui       $at, %hi(jtbl_802AB770_7B3110)
/* 416A44 802A1CB4 00220821 */  addu      $at, $at, $v0
/* 416A48 802A1CB8 8C22B770 */  lw        $v0, %lo(jtbl_802AB770_7B3110)($at)
/* 416A4C 802A1CBC 00400008 */  jr        $v0
D_802A1CC0_7A9660:
/* 416A50 802A1CC0 00000000 */   nop
/* 416A54 802A1CC4 0C051086 */  jal       func_80144218
/* 416A58 802A1CC8 2404FFFF */   addiu    $a0, $zero, -0x1
.L802A1CCC_7A966C:
/* 416A5C 802A1CCC 3C128080 */  lui       $s2, (0x80808081 >> 16)
D_802A1CD0_7A9670:
/* 416A60 802A1CD0 44800000 */  mtc1      $zero, $f0
D_802A1CD4_7A9674:
/* 416A64 802A1CD4 3C13802B */  lui       $s3, %hi(D_802AD048)
/* 416A68 802A1CD8 8E73D048 */  lw        $s3, %lo(D_802AD048)($s3)
/* 416A6C 802A1CDC 44050000 */  mfc1      $a1, $f0
D_802A1CE0_7A9680:
/* 416A70 802A1CE0 0260202D */  daddu     $a0, $s3, $zero
.L802A1CE4_7A9684:
/* 416A74 802A1CE4 00A0302D */  daddu     $a2, $a1, $zero
/* 416A78 802A1CE8 0C051489 */  jal       hud_element_set_transform_rotation
/* 416A7C 802A1CEC 00A0382D */   daddu    $a3, $a1, $zero
D_802A1CF0_7A9690:
/* 416A80 802A1CF0 3C11802B */  lui       $s1, %hi(D_802AD006)
.L802A1CF4_7A9694:
/* 416A84 802A1CF4 2631D006 */  addiu     $s1, $s1, %lo(D_802AD006)
/* 416A88 802A1CF8 86220000 */  lh        $v0, 0x0($s1)
/* 416A8C 802A1CFC 36528081 */  ori       $s2, $s2, (0x80808081 & 0xFFFF)
/* 416A90 802A1D00 000229C0 */  sll       $a1, $v0, 7
/* 416A94 802A1D04 00A22823 */  subu      $a1, $a1, $v0
/* 416A98 802A1D08 00052840 */  sll       $a1, $a1, 1
/* 416A9C 802A1D0C 00B20018 */  mult      $a1, $s2
D_802A1D10_7A96B0:
/* 416AA0 802A1D10 0260202D */  daddu     $a0, $s3, $zero
/* 416AA4 802A1D14 00004010 */  mfhi      $t0
/* 416AA8 802A1D18 01051021 */  addu      $v0, $t0, $a1
/* 416AAC 802A1D1C 000211C3 */  sra       $v0, $v0, 7
/* 416AB0 802A1D20 00052FC3 */  sra       $a1, $a1, 31
/* 416AB4 802A1D24 0C0513AC */  jal       hud_element_set_alpha
/* 416AB8 802A1D28 00452823 */   subu     $a1, $v0, $a1
/* 416ABC 802A1D2C 0260202D */  daddu     $a0, $s3, $zero
D_802A1D30_7A96D0:
/* 416AC0 802A1D30 3C10802B */  lui       $s0, %hi(D_802AD00A)
/* 416AC4 802A1D34 2610D00A */  addiu     $s0, $s0, %lo(D_802AD00A)
/* 416AC8 802A1D38 86060000 */  lh        $a2, 0x0($s0)
/* 416ACC 802A1D3C 24050F64 */  addiu     $a1, $zero, 0xF64
/* 416AD0 802A1D40 00A62823 */  subu      $a1, $a1, $a2
/* 416AD4 802A1D44 0C051261 */  jal       hud_element_set_render_pos
/* 416AD8 802A1D48 24C600D4 */   addiu    $a2, $a2, 0xD4
D_802A1D4C_7A96EC:
/* 416ADC 802A1D4C 0C05108E */  jal       func_80144238
D_802A1D50_7A96F0:
/* 416AE0 802A1D50 0260202D */   daddu    $a0, $s3, $zero
/* 416AE4 802A1D54 86220000 */  lh        $v0, 0x0($s1)
/* 416AE8 802A1D58 000229C0 */  sll       $a1, $v0, 7
/* 416AEC 802A1D5C 00A22823 */  subu      $a1, $a1, $v0
D_802A1D60_7A9700:
/* 416AF0 802A1D60 00052840 */  sll       $a1, $a1, 1
/* 416AF4 802A1D64 00B20018 */  mult      $a1, $s2
/* 416AF8 802A1D68 3C13802B */  lui       $s3, %hi(D_802AD044)
/* 416AFC 802A1D6C 8E73D044 */  lw        $s3, %lo(D_802AD044)($s3)
D_802A1D70_7A9710:
/* 416B00 802A1D70 0260202D */  daddu     $a0, $s3, $zero
/* 416B04 802A1D74 00004010 */  mfhi      $t0
/* 416B08 802A1D78 01051021 */  addu      $v0, $t0, $a1
/* 416B0C 802A1D7C 000211C3 */  sra       $v0, $v0, 7
D_802A1D80_7A9720:
/* 416B10 802A1D80 00052FC3 */  sra       $a1, $a1, 31
/* 416B14 802A1D84 0C0513AC */  jal       hud_element_set_alpha
D_802A1D88_7A9728:
/* 416B18 802A1D88 00452823 */   subu     $a1, $v0, $a1
/* 416B1C 802A1D8C 0260202D */  daddu     $a0, $s3, $zero
/* 416B20 802A1D90 86060000 */  lh        $a2, 0x0($s0)
/* 416B24 802A1D94 24050028 */  addiu     $a1, $zero, 0x28
/* 416B28 802A1D98 00A62823 */  subu      $a1, $a1, $a2
/* 416B2C 802A1D9C 0C051261 */  jal       hud_element_set_render_pos
D_802A1DA0_7A9740:
/* 416B30 802A1DA0 24C600D4 */   addiu    $a2, $a2, 0xD4
/* 416B34 802A1DA4 0C05108E */  jal       func_80144238
/* 416B38 802A1DA8 0260202D */   daddu    $a0, $s3, $zero
/* 416B3C 802A1DAC 080A8991 */  j         .L802A2644_7A9FE4
/* 416B40 802A1DB0 00000000 */   nop
glabel .L802A1DB4_7A9754
/* 416B44 802A1DB4 3C03802B */  lui       $v1, %hi(D_802AD006)
/* 416B48 802A1DB8 8463D006 */  lh        $v1, %lo(D_802AD006)($v1)
/* 416B4C 802A1DBC 3C02802B */  lui       $v0, %hi(BattleMenuAlpha)
/* 416B50 802A1DC0 8442D008 */  lh        $v0, %lo(BattleMenuAlpha)($v0)
/* 416B54 802A1DC4 00620018 */  mult      $v1, $v0
/* 416B58 802A1DC8 00001812 */  mflo      $v1
/* 416B5C 802A1DCC 3C028080 */  lui       $v0, (0x80808081 >> 16)
.L802A1DD0_7A9770:
/* 416B60 802A1DD0 34428081 */  ori       $v0, $v0, (0x80808081 & 0xFFFF)
/* 416B64 802A1DD4 00620018 */  mult      $v1, $v0
D_802A1DD8_7A9778:
/* 416B68 802A1DD8 2404FFFF */  addiu     $a0, $zero, -0x1
/* 416B6C 802A1DDC 00001010 */  mfhi      $v0
/* 416B70 802A1DE0 00431021 */  addu      $v0, $v0, $v1
.L802A1DE4_7A9784:
/* 416B74 802A1DE4 000211C3 */  sra       $v0, $v0, 7
/* 416B78 802A1DE8 00031FC3 */  sra       $v1, $v1, 31
/* 416B7C 802A1DEC 0C051086 */  jal       func_80144218
/* 416B80 802A1DF0 0043A823 */   subu     $s5, $v0, $v1
/* 416B84 802A1DF4 3C03802B */  lui       $v1, %hi(BattleMenu_CurPos)
/* 416B88 802A1DF8 8063D002 */  lb        $v1, %lo(BattleMenu_CurPos)($v1)
/* 416B8C 802A1DFC 3C02802B */  lui       $v0, %hi(D_802AD100)
D_802A1E00_7A97A0:
/* 416B90 802A1E00 8C42D100 */  lw        $v0, %lo(D_802AD100)($v0)
/* 416B94 802A1E04 00431023 */  subu      $v0, $v0, $v1
D_802A1E08_7A97A8:
/* 416B98 802A1E08 000218C0 */  sll       $v1, $v0, 3
/* 416B9C 802A1E0C 00621823 */  subu      $v1, $v1, $v0
/* 416BA0 802A1E10 00031880 */  sll       $v1, $v1, 2
/* 416BA4 802A1E14 3C02802B */  lui       $v0, %hi(BattleMenu_WheelAngle)
/* 416BA8 802A1E18 2442D06C */  addiu     $v0, $v0, %lo(BattleMenu_WheelAngle)
D_802A1E1C_7A97BC:
/* 416BAC 802A1E1C C4420000 */  lwc1      $f2, 0x0($v0)
D_802A1E20_7A97C0:
/* 416BB0 802A1E20 4483C000 */  mtc1      $v1, $f24
/* 416BB4 802A1E24 00000000 */  nop
/* 416BB8 802A1E28 4680C620 */  cvt.s.w   $f24, $f24
/* 416BBC 802A1E2C 4602C03C */  c.lt.s    $f24, $f2
/* 416BC0 802A1E30 00000000 */  nop
glabel .L802A1E34_7A97D4
/* 416BC4 802A1E34 45000007 */  bc1f      .L802A1E54_7A97F4
/* 416BC8 802A1E38 0000B82D */   daddu    $s7, $zero, $zero
D_802A1E3C_7A97DC:
/* 416BCC 802A1E3C 3C01802B */  lui       $at, %hi(D_802AD070)
/* 416BD0 802A1E40 C420D070 */  lwc1      $f0, %lo(D_802AD070)($at)
/* 416BD4 802A1E44 46001001 */  sub.s     $f0, $f2, $f0
/* 416BD8 802A1E48 4618003C */  c.lt.s    $f0, $f24
/* 416BDC 802A1E4C 080A879F */  j         .L802A1E7C_7A981C
/* 416BE0 802A1E50 E4400000 */   swc1     $f0, 0x0($v0)
.L802A1E54_7A97F4:
/* 416BE4 802A1E54 4618103C */  c.lt.s    $f2, $f24
/* 416BE8 802A1E58 00000000 */  nop
D_802A1E5C_7A97FC:
/* 416BEC 802A1E5C 4502000B */  bc1fl     .L802A1E8C_7A982C
/* 416BF0 802A1E60 24170001 */   addiu    $s7, $zero, 0x1
/* 416BF4 802A1E64 3C01802B */  lui       $at, %hi(D_802AD070)
/* 416BF8 802A1E68 C420D070 */  lwc1      $f0, %lo(D_802AD070)($at)
D_802A1E6C_7A980C:
/* 416BFC 802A1E6C 46001000 */  add.s     $f0, $f2, $f0
D_802A1E70_7A9810:
/* 416C00 802A1E70 E4400000 */  swc1      $f0, 0x0($v0)
/* 416C04 802A1E74 4600C03C */  c.lt.s    $f24, $f0
/* 416C08 802A1E78 00000000 */  nop
.L802A1E7C_7A981C:
/* 416C0C 802A1E7C 45000003 */  bc1f      .L802A1E8C_7A982C
D_802A1E80_7A9820:
/* 416C10 802A1E80 00000000 */   nop
/* 416C14 802A1E84 E4580000 */  swc1      $f24, 0x0($v0)
/* 416C18 802A1E88 24170001 */  addiu     $s7, $zero, 0x1
.L802A1E8C_7A982C:
/* 416C1C 802A1E8C 16E00010 */  bnez      $s7, .L802A1ED0_7A9870
/* 416C20 802A1E90 00000000 */   nop
D_802A1E94_7A9834:
/* 416C24 802A1E94 3C02802B */  lui       $v0, %hi(D_802AD070)
/* 416C28 802A1E98 2442D070 */  addiu     $v0, $v0, %lo(D_802AD070)
/* 416C2C 802A1E9C C4400000 */  lwc1      $f0, 0x0($v0)
.L802A1EA0_7A9840:
/* 416C30 802A1EA0 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
/* 416C34 802A1EA4 44811800 */  mtc1      $at, $f3
/* 416C38 802A1EA8 44801000 */  mtc1      $zero, $f2
/* 416C3C 802A1EAC 46000021 */  cvt.d.s   $f0, $f0
D_802A1EB0_7A9850:
/* 416C40 802A1EB0 46220080 */  add.d     $f2, $f0, $f2
D_802A1EB4_7A9854:
/* 416C44 802A1EB4 46220002 */  mul.d     $f0, $f0, $f2
/* 416C48 802A1EB8 00000000 */  nop
/* 416C4C 802A1EBC 46220002 */  mul.d     $f0, $f0, $f2
/* 416C50 802A1EC0 00000000 */  nop
/* 416C54 802A1EC4 46200020 */  cvt.s.d   $f0, $f0
/* 416C58 802A1EC8 080A87BB */  j         D_802A1EEC_7A988C
/* 416C5C 802A1ECC E4400000 */   swc1     $f0, 0x0($v0)
.L802A1ED0_7A9870:
/* 416C60 802A1ED0 3C013E99 */  lui       $at, (0x3E99999A >> 16)
/* 416C64 802A1ED4 3421999A */  ori       $at, $at, (0x3E99999A & 0xFFFF)
/* 416C68 802A1ED8 44810000 */  mtc1      $at, $f0
/* 416C6C 802A1EDC 3C01802B */  lui       $at, %hi(D_802AD004)
D_802A1EE0_7A9880:
/* 416C70 802A1EE0 A020D004 */  sb        $zero, %lo(D_802AD004)($at)
/* 416C74 802A1EE4 3C01802B */  lui       $at, %hi(D_802AD070)
/* 416C78 802A1EE8 E420D070 */  swc1      $f0, %lo(D_802AD070)($at)
D_802A1EEC_7A988C:
/* 416C7C 802A1EEC 3C02802B */  lui       $v0, %hi(BattleMenu_NumOptions)
/* 416C80 802A1EF0 8C42D0AC */  lw        $v0, %lo(BattleMenu_NumOptions)($v0)
/* 416C84 802A1EF4 3C01802B */  lui       $at, %hi(BattleMenu_WheelAngle)
/* 416C88 802A1EF8 C438D06C */  lwc1      $f24, %lo(BattleMenu_WheelAngle)($at)
/* 416C8C 802A1EFC 1840008A */  blez      $v0, .L802A2128_7A9AC8
/* 416C90 802A1F00 0000A02D */   daddu    $s4, $zero, $zero
/* 416C94 802A1F04 3C118080 */  lui       $s1, (0x80808081 >> 16)
/* 416C98 802A1F08 36318081 */  ori       $s1, $s1, (0x80808081 & 0xFFFF)
glabel .L802A1F0C_7A98AC
/* 416C9C 802A1F0C 00151080 */  sll       $v0, $s5, 2
D_802A1F10_7A98B0:
/* 416CA0 802A1F10 00551021 */  addu      $v0, $v0, $s5
/* 416CA4 802A1F14 00021900 */  sll       $v1, $v0, 4
/* 416CA8 802A1F18 00621823 */  subu      $v1, $v1, $v0
/* 416CAC 802A1F1C 00031840 */  sll       $v1, $v1, 1
/* 416CB0 802A1F20 00710018 */  mult      $v1, $s1
/* 416CB4 802A1F24 4480A000 */  mtc1      $zero, $f20
/* 416CB8 802A1F28 0003B7C3 */  sra       $s6, $v1, 31
/* 416CBC 802A1F2C 00151040 */  sll       $v0, $s5, 1
D_802A1F30_7A98D0:
/* 416CC0 802A1F30 00558021 */  addu      $s0, $v0, $s5
/* 416CC4 802A1F34 00004010 */  mfhi      $t0
/* 416CC8 802A1F38 01031821 */  addu      $v1, $t0, $v1
/* 416CCC 802A1F3C 000391C3 */  sra       $s2, $v1, 7
.L802A1F40_7A98E0:
/* 416CD0 802A1F40 27A40020 */  addiu     $a0, $sp, 0x20
/* 416CD4 802A1F44 3C0642AE */  lui       $a2, (0x42AE0000 >> 16)
/* 416CD8 802A1F48 4407C000 */  mfc1      $a3, $f24
/* 416CDC 802A1F4C 27A50024 */  addiu     $a1, $sp, 0x24
/* 416CE0 802A1F50 E7B40020 */  swc1      $f20, 0x20($sp)
/* 416CE4 802A1F54 0C00A7E7 */  jal       add_vec2D_polar
/* 416CE8 802A1F58 E7B40024 */   swc1     $f20, 0x24($sp)
D_802A1F5C_7A98FC:
/* 416CEC 802A1F5C 00141080 */  sll       $v0, $s4, 2
/* 416CF0 802A1F60 C7A00020 */  lwc1      $f0, 0x20($sp)
/* 416CF4 802A1F64 3C01802B */  lui       $at, %hi(BattleMenu_BasePosX)
/* 416CF8 802A1F68 C422D060 */  lwc1      $f2, %lo(BattleMenu_BasePosX)($at)
D_802A1F6C_7A990C:
/* 416CFC 802A1F6C 468010A0 */  cvt.s.w   $f2, $f2
/* 416D00 802A1F70 46001080 */  add.s     $f2, $f2, $f0
/* 416D04 802A1F74 C7A40024 */  lwc1      $f4, 0x24($sp)
/* 416D08 802A1F78 3C01802B */  lui       $at, %hi(BattleMenu_BasePosY)
/* 416D0C 802A1F7C C420D064 */  lwc1      $f0, %lo(BattleMenu_BasePosY)($at)
/* 416D10 802A1F80 46800020 */  cvt.s.w   $f0, $f0
/* 416D14 802A1F84 46040000 */  add.s     $f0, $f0, $f4
/* 416D18 802A1F88 3C13802B */  lui       $s3, %hi(D_802AD028)
/* 416D1C 802A1F8C 02629821 */  addu      $s3, $s3, $v0
/* 416D20 802A1F90 8E73D028 */  lw        $s3, %lo(D_802AD028)($s3)
/* 416D24 802A1F94 4407A000 */  mfc1      $a3, $f20
/* 416D28 802A1F98 46000187 */  neg.s     $f6, $f0
/* 416D2C 802A1F9C 44051000 */  mfc1      $a1, $f2
/* 416D30 802A1FA0 44063000 */  mfc1      $a2, $f6
/* 416D34 802A1FA4 0260202D */  daddu     $a0, $s3, $zero
/* 416D38 802A1FA8 E7A00024 */  swc1      $f0, 0x24($sp)
/* 416D3C 802A1FAC 0C051461 */  jal       hud_element_set_transform_pos
/* 416D40 802A1FB0 AFA50020 */   sw       $a1, 0x20($sp)
.L802A1FB4_7A9954:
/* 416D44 802A1FB4 0260202D */  daddu     $a0, $s3, $zero
.L802A1FB8_7A9958:
/* 416D48 802A1FB8 0000282D */  daddu     $a1, $zero, $zero
/* 416D4C 802A1FBC 0C051261 */  jal       hud_element_set_render_pos
/* 416D50 802A1FC0 00A0302D */   daddu    $a2, $a1, $zero
/* 416D54 802A1FC4 0260202D */  daddu     $a0, $s3, $zero
glabel .L802A1FC8_7A9968
/* 416D58 802A1FC8 0C0513AC */  jal       hud_element_set_alpha
D_802A1FCC_7A996C:
/* 416D5C 802A1FCC 02562823 */   subu     $a1, $s2, $s6
/* 416D60 802A1FD0 3C014260 */  lui       $at, (0x42600000 >> 16)
/* 416D64 802A1FD4 44810000 */  mtc1      $at, $f0
/* 416D68 802A1FD8 00000000 */  nop
/* 416D6C 802A1FDC 4600C032 */  c.eq.s    $f24, $f0
D_802A1FE0_7A9980:
/* 416D70 802A1FE0 3C053F80 */  lui       $a1, (0x3F800000 >> 16)
/* 416D74 802A1FE4 45000005 */  bc1f      D_802A1FFC_7A999C
glabel .L802A1FE8_7A9988
/* 416D78 802A1FE8 24020001 */   addiu    $v0, $zero, 0x1
D_802A1FEC_7A998C:
/* 416D7C 802A1FEC 16E20003 */  bne       $s7, $v0, D_802A1FFC_7A999C
/* 416D80 802A1FF0 00000000 */   nop
/* 416D84 802A1FF4 3C053FCC */  lui       $a1, (0x3FCCCCCD >> 16)
/* 416D88 802A1FF8 34A5CCCD */  ori       $a1, $a1, (0x3FCCCCCD & 0xFFFF)
D_802A1FFC_7A999C:
/* 416D8C 802A1FFC 0C051308 */  jal       hud_element_set_scale
D_802A2000_7A99A0:
/* 416D90 802A2000 0260202D */   daddu    $a0, $s3, $zero
/* 416D94 802A2004 0C05108E */  jal       func_80144238
/* 416D98 802A2008 0260202D */   daddu    $a0, $s3, $zero
D_802A200C_7A99AC:
/* 416D9C 802A200C 3C02802B */  lui       $v0, %hi(BattleMenu_HomePos)
/* 416DA0 802A2010 8042D06B */  lb        $v0, %lo(BattleMenu_HomePos)($v0)
/* 416DA4 802A2014 3C03802B */  lui       $v1, %hi(BattleMenu_CurPos)
D_802A2018_7A99B8:
/* 416DA8 802A2018 8063D002 */  lb        $v1, %lo(BattleMenu_CurPos)($v1)
/* 416DAC 802A201C 00431021 */  addu      $v0, $v0, $v1
D_802A2020_7A99C0:
/* 416DB0 802A2020 5682003A */  bnel      $s4, $v0, .L802A210C_7A9AAC
/* 416DB4 802A2024 26940001 */   addiu    $s4, $s4, 0x1
/* 416DB8 802A2028 27A40020 */  addiu     $a0, $sp, 0x20
D_802A202C_7A99CC:
/* 416DBC 802A202C 3C0642AE */  lui       $a2, (0x42AE0000 >> 16)
/* 416DC0 802A2030 3C074260 */  lui       $a3, (0x42600000 >> 16)
/* 416DC4 802A2034 27A50024 */  addiu     $a1, $sp, 0x24
/* 416DC8 802A2038 AFA00020 */  sw        $zero, 0x20($sp)
D_802A203C_7A99DC:
/* 416DCC 802A203C 0C00A7E7 */  jal       add_vec2D_polar
glabel .L802A2040_7A99E0
/* 416DD0 802A2040 AFA00024 */   sw       $zero, 0x24($sp)
/* 416DD4 802A2044 C7A00020 */  lwc1      $f0, 0x20($sp)
/* 416DD8 802A2048 3C01802B */  lui       $at, %hi(BattleMenu_BasePosX)
.L802A204C_7A99EC:
/* 416DDC 802A204C C422D060 */  lwc1      $f2, %lo(BattleMenu_BasePosX)($at)
/* 416DE0 802A2050 468010A0 */  cvt.s.w   $f2, $f2
.L802A2054_7A99F4:
/* 416DE4 802A2054 46001080 */  add.s     $f2, $f2, $f0
/* 416DE8 802A2058 C7A40024 */  lwc1      $f4, 0x24($sp)
/* 416DEC 802A205C 3C01802B */  lui       $at, %hi(BattleMenu_BasePosY)
/* 416DF0 802A2060 C420D064 */  lwc1      $f0, %lo(BattleMenu_BasePosY)($at)
/* 416DF4 802A2064 46800020 */  cvt.s.w   $f0, $f0
/* 416DF8 802A2068 46040000 */  add.s     $f0, $f0, $f4
/* 416DFC 802A206C 0000382D */  daddu     $a3, $zero, $zero
/* 416E00 802A2070 3C13802B */  lui       $s3, %hi(D_802AD040)
/* 416E04 802A2074 8E73D040 */  lw        $s3, %lo(D_802AD040)($s3)
/* 416E08 802A2078 46000187 */  neg.s     $f6, $f0
D_802A207C_7A9A1C:
/* 416E0C 802A207C 44051000 */  mfc1      $a1, $f2
glabel .L802A2080_7A9A20
/* 416E10 802A2080 44063000 */  mfc1      $a2, $f6
/* 416E14 802A2084 0260202D */  daddu     $a0, $s3, $zero
/* 416E18 802A2088 E7A00024 */  swc1      $f0, 0x24($sp)
/* 416E1C 802A208C 0C051461 */  jal       hud_element_set_transform_pos
D_802A2090_7A9A30:
/* 416E20 802A2090 AFA50020 */   sw       $a1, 0x20($sp)
/* 416E24 802A2094 0260202D */  daddu     $a0, $s3, $zero
/* 416E28 802A2098 0000282D */  daddu     $a1, $zero, $zero
/* 416E2C 802A209C 0C051261 */  jal       hud_element_set_render_pos
/* 416E30 802A20A0 00A0302D */   daddu    $a2, $a1, $zero
/* 416E34 802A20A4 00102900 */  sll       $a1, $s0, 4
/* 416E38 802A20A8 00B02823 */  subu      $a1, $a1, $s0
/* 416E3C 802A20AC 00052880 */  sll       $a1, $a1, 2
/* 416E40 802A20B0 00B10018 */  mult      $a1, $s1
.L802A20B4_7A9A54:
/* 416E44 802A20B4 0260202D */  daddu     $a0, $s3, $zero
/* 416E48 802A20B8 00004010 */  mfhi      $t0
/* 416E4C 802A20BC 01051021 */  addu      $v0, $t0, $a1
.L802A20C0_7A9A60:
/* 416E50 802A20C0 000211C3 */  sra       $v0, $v0, 7
/* 416E54 802A20C4 00052FC3 */  sra       $a1, $a1, 31
.L802A20C8_7A9A68:
/* 416E58 802A20C8 0C0513AC */  jal       hud_element_set_alpha
D_802A20CC_7A9A6C:
/* 416E5C 802A20CC 00452823 */   subu     $a1, $v0, $a1
D_802A20D0_7A9A70:
/* 416E60 802A20D0 3C053F99 */  lui       $a1, (0x3F99999A >> 16)
/* 416E64 802A20D4 34A5999A */  ori       $a1, $a1, (0x3F99999A & 0xFFFF)
/* 416E68 802A20D8 0C051308 */  jal       hud_element_set_scale
/* 416E6C 802A20DC 0260202D */   daddu    $a0, $s3, $zero
/* 416E70 802A20E0 16E00005 */  bnez      $s7, .L802A20F8_7A9A98
/* 416E74 802A20E4 0260202D */   daddu    $a0, $s3, $zero
/* 416E78 802A20E8 0C051280 */  jal       hud_element_set_flags
/* 416E7C 802A20EC 24050002 */   addiu    $a1, $zero, 0x2
/* 416E80 802A20F0 080A8840 */  j         .L802A2100_7A9AA0
D_802A20F4_7A9A94:
/* 416E84 802A20F4 00000000 */   nop
.L802A20F8_7A9A98:
/* 416E88 802A20F8 0C05128B */  jal       hud_element_clear_flags
D_802A20FC_7A9A9C:
/* 416E8C 802A20FC 24050002 */   addiu    $a1, $zero, 0x2
.L802A2100_7A9AA0:
/* 416E90 802A2100 0C05108E */  jal       func_80144238
.L802A2104_7A9AA4:
/* 416E94 802A2104 0260202D */   daddu    $a0, $s3, $zero
/* 416E98 802A2108 26940001 */  addiu     $s4, $s4, 0x1
.L802A210C_7A9AAC:
/* 416E9C 802A210C 3C02802B */  lui       $v0, %hi(BattleMenu_NumOptions)
D_802A2110_7A9AB0:
/* 416EA0 802A2110 8C42D0AC */  lw        $v0, %lo(BattleMenu_NumOptions)($v0)
/* 416EA4 802A2114 3C0141E0 */  lui       $at, (0x41E00000 >> 16)
.L802A2118_7A9AB8:
/* 416EA8 802A2118 44810000 */  mtc1      $at, $f0
/* 416EAC 802A211C 0282102A */  slt       $v0, $s4, $v0
D_802A2120_7A9AC0:
/* 416EB0 802A2120 1440FF87 */  bnez      $v0, .L802A1F40_7A98E0
/* 416EB4 802A2124 4600C600 */   add.s    $f24, $f24, $f0
.L802A2128_7A9AC8:
/* 416EB8 802A2128 3C11802B */  lui       $s1, %hi(D_802AD100)
/* 416EBC 802A212C 2631D100 */  addiu     $s1, $s1, %lo(D_802AD100)
D_802A2130_7A9AD0:
/* 416EC0 802A2130 3C10802B */  lui       $s0, %hi(BattleMenu_CurPos)
/* 416EC4 802A2134 2610D002 */  addiu     $s0, $s0, %lo(BattleMenu_CurPos)
/* 416EC8 802A2138 82030000 */  lb        $v1, 0x0($s0)
.L802A213C_7A9ADC:
/* 416ECC 802A213C 8E220000 */  lw        $v0, 0x0($s1)
/* 416ED0 802A2140 3C01802B */  lui       $at, %hi(BattleMenu_WheelAngle)
/* 416ED4 802A2144 C420D06C */  lwc1      $f0, %lo(BattleMenu_WheelAngle)($at)
/* 416ED8 802A2148 00431023 */  subu      $v0, $v0, $v1
/* 416EDC 802A214C 000218C0 */  sll       $v1, $v0, 3
D_802A2150_7A9AF0:
/* 416EE0 802A2150 00621823 */  subu      $v1, $v1, $v0
/* 416EE4 802A2154 00031880 */  sll       $v1, $v1, 2
D_802A2158_7A9AF8:
/* 416EE8 802A2158 4483C000 */  mtc1      $v1, $f24
/* 416EEC 802A215C 00000000 */  nop
/* 416EF0 802A2160 4680C620 */  cvt.s.w   $f24, $f24
/* 416EF4 802A2164 46180001 */  sub.s     $f0, $f0, $f24
/* 416EF8 802A2168 3C01802B */  lui       $at, %hi(D_802AB7F0_7B3190)
/* 416EFC 802A216C D43AB7F0 */  ldc1      $f26, %lo(D_802AB7F0_7B3190)($at)
D_802A2170_7A9B10:
/* 416F00 802A2170 46000021 */  cvt.d.s   $f0, $f0
/* 416F04 802A2174 463A0002 */  mul.d     $f0, $f0, $f26
/* 416F08 802A2178 00000000 */  nop
/* 416F0C 802A217C 3C01802B */  lui       $at, %hi(D_802AB7F8_7B3198)
.L802A2180_7A9B20:
/* 416F10 802A2180 D424B7F8 */  ldc1      $f4, %lo(D_802AB7F8_7B3198)($at)
D_802A2184_7A9B24:
/* 416F14 802A2184 46200020 */  cvt.s.d   $f0, $f0
D_802A2188_7A9B28:
/* 416F18 802A2188 46000005 */  abs.s     $f0, $f0
/* 416F1C 802A218C 46000021 */  cvt.d.s   $f0, $f0
D_802A2190_7A9B30:
/* 416F20 802A2190 46240001 */  sub.d     $f0, $f0, $f4
/* 416F24 802A2194 3C01802B */  lui       $at, %hi(D_802AB800_7B31A0)
D_802A2198_7A9B38:
/* 416F28 802A2198 D422B800 */  ldc1      $f2, %lo(D_802AB800_7B31A0)($at)
glabel .L802A219C_7A9B3C
/* 416F2C 802A219C 46200020 */  cvt.s.d   $f0, $f0
D_802A21A0_7A9B40:
/* 416F30 802A21A0 46000005 */  abs.s     $f0, $f0
/* 416F34 802A21A4 46000021 */  cvt.d.s   $f0, $f0
/* 416F38 802A21A8 46240003 */  div.d     $f0, $f0, $f4
/* 416F3C 802A21AC 46220000 */  add.d     $f0, $f0, $f2
/* 416F40 802A21B0 12E00003 */  beqz      $s7, .L802A21C0_7A9B60
/* 416F44 802A21B4 46200620 */   cvt.s.d  $f24, $f0
/* 416F48 802A21B8 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 416F4C 802A21BC 4481C000 */  mtc1      $at, $f24
.L802A21C0_7A9B60:
/* 416F50 802A21C0 0000282D */  daddu     $a1, $zero, $zero
.L802A21C4_7A9B64:
/* 416F54 802A21C4 00A0302D */  daddu     $a2, $a1, $zero
/* 416F58 802A21C8 3C1E8080 */  lui       $fp, (0x80808081 >> 16)
/* 416F5C 802A21CC 37DE8081 */  ori       $fp, $fp, (0x80808081 & 0xFFFF)
/* 416F60 802A21D0 3C13802B */  lui       $s3, %hi(D_802AD04C)
D_802A21D4_7A9B74:
/* 416F64 802A21D4 8E73D04C */  lw        $s3, %lo(D_802AD04C)($s3)
D_802A21D8_7A9B78:
/* 416F68 802A21D8 4480A000 */  mtc1      $zero, $f20
/* 416F6C 802A21DC 0C05149D */  jal       hud_element_set_transform_rotation_pivot
/* 416F70 802A21E0 0260202D */   daddu    $a0, $s3, $zero
.L802A21E4_7A9B84:
/* 416F74 802A21E4 4405A000 */  mfc1      $a1, $f20
/* 416F78 802A21E8 4406A000 */  mfc1      $a2, $f20
/* 416F7C 802A21EC 3C07C22C */  lui       $a3, (0xC22C0000 >> 16)
D_802A21F0_7A9B90:
/* 416F80 802A21F0 0C051489 */  jal       hud_element_set_transform_rotation
/* 416F84 802A21F4 0260202D */   daddu    $a0, $s3, $zero
glabel .L802A21F8_7A9B98
/* 416F88 802A21F8 4405C000 */  mfc1      $a1, $f24
/* 416F8C 802A21FC 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 416F90 802A2200 4481B000 */  mtc1      $at, $f22
/* 416F94 802A2204 0C051308 */  jal       hud_element_set_scale
/* 416F98 802A2208 0260202D */   daddu    $a0, $s3, $zero
/* 416F9C 802A220C 4405B000 */  mfc1      $a1, $f22
/* 416FA0 802A2210 3C063FE6 */  lui       $a2, (0x3FE66666 >> 16)
/* 416FA4 802A2214 34C66666 */  ori       $a2, $a2, (0x3FE66666 & 0xFFFF)
/* 416FA8 802A2218 4407B000 */  mfc1      $a3, $f22
/* 416FAC 802A221C 0C051475 */  jal       hud_element_set_transform_scale
/* 416FB0 802A2220 0260202D */   daddu    $a0, $s3, $zero
/* 416FB4 802A2224 00151040 */  sll       $v0, $s5, 1
/* 416FB8 802A2228 0055B021 */  addu      $s6, $v0, $s5
D_802A222C_7A9BCC:
/* 416FBC 802A222C 001628C0 */  sll       $a1, $s6, 3
D_802A2230_7A9BD0:
/* 416FC0 802A2230 00B52821 */  addu      $a1, $a1, $s5
/* 416FC4 802A2234 000528C0 */  sll       $a1, $a1, 3
/* 416FC8 802A2238 00BE0018 */  mult      $a1, $fp
.L802A223C_7A9BDC:
/* 416FCC 802A223C 0260202D */  daddu     $a0, $s3, $zero
/* 416FD0 802A2240 00004010 */  mfhi      $t0
/* 416FD4 802A2244 01051021 */  addu      $v0, $t0, $a1
/* 416FD8 802A2248 000211C3 */  sra       $v0, $v0, 7
/* 416FDC 802A224C 00052FC3 */  sra       $a1, $a1, 31
.L802A2250_7A9BF0:
/* 416FE0 802A2250 0C0513AC */  jal       hud_element_set_alpha
/* 416FE4 802A2254 00452823 */   subu     $a1, $v0, $a1
/* 416FE8 802A2258 0260202D */  daddu     $a0, $s3, $zero
/* 416FEC 802A225C 2405004F */  addiu     $a1, $zero, 0x4F
D_802A2260_7A9C00:
/* 416FF0 802A2260 0C051261 */  jal       hud_element_set_render_pos
/* 416FF4 802A2264 240600B0 */   addiu    $a2, $zero, 0xB0
/* 416FF8 802A2268 0C05108E */  jal       func_80144238
/* 416FFC 802A226C 0260202D */   daddu    $a0, $s3, $zero
/* 417000 802A2270 82030000 */  lb        $v1, 0x0($s0)
/* 417004 802A2274 8E220000 */  lw        $v0, 0x0($s1)
/* 417008 802A2278 3C01802B */  lui       $at, %hi(BattleMenu_WheelAngle)
D_802A227C_7A9C1C:
/* 41700C 802A227C C420D06C */  lwc1      $f0, %lo(BattleMenu_WheelAngle)($at)
D_802A2280_7A9C20:
/* 417010 802A2280 00431023 */  subu      $v0, $v0, $v1
/* 417014 802A2284 000218C0 */  sll       $v1, $v0, 3
/* 417018 802A2288 00621823 */  subu      $v1, $v1, $v0
/* 41701C 802A228C 00031880 */  sll       $v1, $v1, 2
/* 417020 802A2290 4483C000 */  mtc1      $v1, $f24
/* 417024 802A2294 00000000 */  nop
/* 417028 802A2298 4680C620 */  cvt.s.w   $f24, $f24
D_802A229C_7A9C3C:
/* 41702C 802A229C 46180001 */  sub.s     $f0, $f0, $f24
/* 417030 802A22A0 46000021 */  cvt.d.s   $f0, $f0
/* 417034 802A22A4 463A0002 */  mul.d     $f0, $f0, $f26
/* 417038 802A22A8 00000000 */  nop
D_802A22AC_7A9C4C:
/* 41703C 802A22AC 4405A000 */  mfc1      $a1, $f20
.L802A22B0_7A9C50:
/* 417040 802A22B0 3C13802B */  lui       $s3, %hi(D_802AD048)
/* 417044 802A22B4 8E73D048 */  lw        $s3, %lo(D_802AD048)($s3)
/* 417048 802A22B8 00A0302D */  daddu     $a2, $a1, $zero
D_802A22BC_7A9C5C:
/* 41704C 802A22BC 46200620 */  cvt.s.d   $f24, $f0
/* 417050 802A22C0 4600C607 */  neg.s     $f24, $f24
.L802A22C4_7A9C64:
/* 417054 802A22C4 4407C000 */  mfc1      $a3, $f24
/* 417058 802A22C8 0C051489 */  jal       hud_element_set_transform_rotation
/* 41705C 802A22CC 0260202D */   daddu    $a0, $s3, $zero
/* 417060 802A22D0 0260202D */  daddu     $a0, $s3, $zero
/* 417064 802A22D4 24050012 */  addiu     $a1, $zero, 0x12
/* 417068 802A22D8 0C05149D */  jal       hud_element_set_transform_rotation_pivot
/* 41706C 802A22DC 2406FFEC */   addiu    $a2, $zero, -0x14
/* 417070 802A22E0 3C053F73 */  lui       $a1, (0x3F733333 >> 16)
/* 417074 802A22E4 34A53333 */  ori       $a1, $a1, (0x3F733333 & 0xFFFF)
/* 417078 802A22E8 0C051308 */  jal       hud_element_set_scale
/* 41707C 802A22EC 0260202D */   daddu    $a0, $s3, $zero
/* 417080 802A22F0 001511C0 */  sll       $v0, $s5, 7
/* 417084 802A22F4 00551023 */  subu      $v0, $v0, $s5
/* 417088 802A22F8 00021040 */  sll       $v0, $v0, 1
/* 41708C 802A22FC 005E0018 */  mult      $v0, $fp
/* 417090 802A2300 0000A02D */  daddu     $s4, $zero, $zero
/* 417094 802A2304 0260202D */  daddu     $a0, $s3, $zero
/* 417098 802A2308 00004010 */  mfhi      $t0
/* 41709C 802A230C 01028021 */  addu      $s0, $t0, $v0
/* 4170A0 802A2310 001081C3 */  sra       $s0, $s0, 7
/* 4170A4 802A2314 000217C3 */  sra       $v0, $v0, 31
/* 4170A8 802A2318 02028023 */  subu      $s0, $s0, $v0
/* 4170AC 802A231C 0C0513AC */  jal       hud_element_set_alpha
/* 4170B0 802A2320 0200282D */   daddu    $a1, $s0, $zero
/* 4170B4 802A2324 0260202D */  daddu     $a0, $s3, $zero
/* 4170B8 802A2328 3C11802B */  lui       $s1, %hi(D_802AD00A)
/* 4170BC 802A232C 2631D00A */  addiu     $s1, $s1, %lo(D_802AD00A)
/* 4170C0 802A2330 86260000 */  lh        $a2, 0x0($s1)
/* 4170C4 802A2334 24120028 */  addiu     $s2, $zero, 0x28
/* 4170C8 802A2338 02462823 */  subu      $a1, $s2, $a2
D_802A233C_7A9CDC:
/* 4170CC 802A233C 0C051261 */  jal       hud_element_set_render_pos
/* 4170D0 802A2340 24C600D4 */   addiu    $a2, $a2, 0xD4
/* 4170D4 802A2344 0C05108E */  jal       func_80144238
/* 4170D8 802A2348 0260202D */   daddu    $a0, $s3, $zero
/* 4170DC 802A234C 3C13802B */  lui       $s3, %hi(D_802AD044)
/* 4170E0 802A2350 8E73D044 */  lw        $s3, %lo(D_802AD044)($s3)
/* 4170E4 802A2354 0200282D */  daddu     $a1, $s0, $zero
/* 4170E8 802A2358 0C0513AC */  jal       hud_element_set_alpha
/* 4170EC 802A235C 0260202D */   daddu    $a0, $s3, $zero
/* 4170F0 802A2360 86260000 */  lh        $a2, 0x0($s1)
/* 4170F4 802A2364 0260202D */  daddu     $a0, $s3, $zero
/* 4170F8 802A2368 02462823 */  subu      $a1, $s2, $a2
/* 4170FC 802A236C 0C051261 */  jal       hud_element_set_render_pos
D_802A2370_7A9D10:
/* 417100 802A2370 24C600D4 */   addiu    $a2, $a2, 0xD4
/* 417104 802A2374 4405B000 */  mfc1      $a1, $f22
/* 417108 802A2378 0C051308 */  jal       hud_element_set_scale
/* 41710C 802A237C 0260202D */   daddu    $a0, $s3, $zero
/* 417110 802A2380 0C05108E */  jal       func_80144238
D_802A2384_7A9D24:
/* 417114 802A2384 0260202D */   daddu    $a0, $s3, $zero
/* 417118 802A2388 3C02802B */  lui       $v0, %hi(BattleMenu_NumOptions)
/* 41711C 802A238C 8C42D0AC */  lw        $v0, %lo(BattleMenu_NumOptions)($v0)
D_802A2390_7A9D30:
/* 417120 802A2390 3C01802B */  lui       $at, %hi(BattleMenu_WheelAngle)
/* 417124 802A2394 C438D06C */  lwc1      $f24, %lo(BattleMenu_WheelAngle)($at)
/* 417128 802A2398 1840004D */  blez      $v0, .L802A24D0_7A9E70
/* 41712C 802A239C 00161100 */   sll      $v0, $s6, 4
.L802A23A0_7A9D40:
/* 417130 802A23A0 00561023 */  subu      $v0, $v0, $s6
/* 417134 802A23A4 00021080 */  sll       $v0, $v0, 2
/* 417138 802A23A8 005E0018 */  mult      $v0, $fp
D_802A23AC_7A9D4C:
/* 41713C 802A23AC 24160018 */  addiu     $s6, $zero, 0x18
/* 417140 802A23B0 000247C3 */  sra       $t0, $v0, 31
/* 417144 802A23B4 AFA80028 */  sw        $t0, 0x28($sp)
.L802A23B8_7A9D58:
/* 417148 802A23B8 3C12802B */  lui       $s2, %hi(D_802AD010)
D_802A23BC_7A9D5C:
/* 41714C 802A23BC 2652D010 */  addiu     $s2, $s2, %lo(D_802AD010)
/* 417150 802A23C0 00004010 */  mfhi      $t0
.L802A23C4_7A9D64:
/* 417154 802A23C4 01021021 */  addu      $v0, $t0, $v0
.L802A23C8_7A9D68:
/* 417158 802A23C8 0002F1C3 */  sra       $fp, $v0, 7
.L802A23CC_7A9D6C:
/* 41715C 802A23CC 27A40020 */  addiu     $a0, $sp, 0x20
/* 417160 802A23D0 3C0642AE */  lui       $a2, (0x42AE0000 >> 16)
D_802A23D4_7A9D74:
/* 417164 802A23D4 4407C000 */  mfc1      $a3, $f24
D_802A23D8_7A9D78:
/* 417168 802A23D8 27A50024 */  addiu     $a1, $sp, 0x24
/* 41716C 802A23DC AFA00020 */  sw        $zero, 0x20($sp)
/* 417170 802A23E0 0C00A7E7 */  jal       add_vec2D_polar
/* 417174 802A23E4 AFA00024 */   sw       $zero, 0x24($sp)
D_802A23E8_7A9D88:
/* 417178 802A23E8 0000202D */  daddu     $a0, $zero, $zero
.L802A23EC_7A9D8C:
/* 41717C 802A23EC 0080282D */  daddu     $a1, $a0, $zero
/* 417180 802A23F0 0080302D */  daddu     $a2, $a0, $zero
/* 417184 802A23F4 C7A00020 */  lwc1      $f0, 0x20($sp)
/* 417188 802A23F8 3C01802B */  lui       $at, %hi(BattleMenu_BasePosX)
/* 41718C 802A23FC C424D060 */  lwc1      $f4, %lo(BattleMenu_BasePosX)($at)
/* 417190 802A2400 46802120 */  cvt.s.w   $f4, $f4
/* 417194 802A2404 46002100 */  add.s     $f4, $f4, $f0
/* 417198 802A2408 C7A20024 */  lwc1      $f2, 0x24($sp)
/* 41719C 802A240C 3C01802B */  lui       $at, (0x802B0000 >> 16)

### DECOMPILED C INSTRUCTIONS:

void btl_main_menu_draw(void) {
    s32 id;
    s32 opacity;
    f32 theta;
    s32 cond;
    f32 x, y;
    f32 scale;
    s32 i;
    s32 l, t;

    switch (BattleMenuState) {
        case BTL_MENU_STATE_UNK_1:
            func_80144218(-1);
            id = D_802AD048;
            hud_element_set_transform_rotation(id, 0.0f, 0.0f, 0.0f);
            hud_element_set_alpha(id, (D_802AD006 * 254) / 255);
            hud_element_set_render_pos(id, 3940 - D_802AD00A, D_802AD00A + 212);
            func_80144238(id);
            id = D_802AD044;
            hud_element_set_alpha(id, (D_802AD006 * 254) / 255);
            hud_element_set_render_pos(id, 40 - D_802AD00A, D_802AD00A + 212);
            func_80144238(id);
            break;
        case BTL_MENU_STATE_OPENED_SUBMENU:
        case BTL_MENU_STATE_ACCEPT_INPUT:
        case BTL_MENU_STATE_UNK_A:
        case BTL_MENU_STATE_UNK_14:
        case BTL_MENU_STATE_UNK_1E:
            opacity = (D_802AD006 * BattleMenuAlpha) / 255;
            func_80144218(-1);
            theta = (D_802AD100 - BattleMenu_CurPos) * 28;

            cond = FALSE;
            if (BattleMenu_WheelAngle > theta) {
                BattleMenu_WheelAngle -= D_802AD070;
                if (BattleMenu_WheelAngle < theta) {
                    BattleMenu_WheelAngle = theta;
                    cond = TRUE;
                }
            } else if (BattleMenu_WheelAngle < theta) {
                BattleMenu_WheelAngle += D_802AD070;
                if (BattleMenu_WheelAngle > theta) {
                    BattleMenu_WheelAngle = theta;
                    cond = TRUE;
                }
            } else {
                cond = TRUE;
            }

            if (!cond) {
                D_802AD070 = (D_802AD070 * (D_802AD070 + 1.0) * (D_802AD070 + 1.0));
            } else {
                D_802AD004 = 0;
                D_802AD070 = 0.3f;
            }

            theta = BattleMenu_WheelAngle;
            for (i = 0; i < BattleMenu_NumOptions; i++, theta += 28.0f) {
                x = 0.0f;
                y = 0.0f;
                add_vec2D_polar(&x, &y, 87.0f, theta);
                id = D_802AD028[i];
                x = BattleMenu_BasePosX + x;
                y = BattleMenu_BasePosY + y;
                hud_element_set_transform_pos(id, x, -y, 0.0f);
                hud_element_set_render_pos(id, 0, 0);
                hud_element_set_alpha(id, (opacity * 150) / 255);

                if (theta == 56.0f && cond == TRUE) {
                    hud_element_set_scale(id, 1.6f);
                } else {
                    hud_element_set_scale(id, 1.0f);
                }

                func_80144238(id);
                if (i == BattleMenu_HomePos + BattleMenu_CurPos) {
                    x = 0.0f;
                    y = 0.0f;
                    add_vec2D_polar(&x, &y, 87.0f, 56.0f);
                    x = BattleMenu_BasePosX + x;
                    y = BattleMenu_BasePosY + y;
                    id = D_802AD040;
                    hud_element_set_transform_pos(id, x, -y, 0.0f);
                    hud_element_set_render_pos(id, 0, 0);
                    hud_element_set_alpha(id, (opacity * 180) / 255);
                    hud_element_set_scale(id, 1.2f);
                    if (!cond) {
                        hud_element_set_flags(id, HUD_ELEMENT_FLAG_DISABLED);
                    } else {
                        hud_element_clear_flags(id, HUD_ELEMENT_FLAG_DISABLED);
                    }
                    func_80144238(id);
                }
            }
            theta = (D_802AD100 - BattleMenu_CurPos) * 28;
            scale = (fabsf(fabsf((BattleMenu_WheelAngle - theta) * (45.0 / 28.0)) - 22.5) / 22.5) + 0.01;
            if (cond) {
                scale = 1.0f;
            }

            id = D_802AD04C;
            hud_element_set_transform_rotation_pivot(id, 0, 0);
            hud_element_set_transform_rotation(id, 0.0f, 0.0f, -43.0f);
            hud_element_set_scale(id, scale);
            hud_element_set_transform_scale(id, 1.0f, 1.8f, 1.0f);
            hud_element_set_alpha(id, (opacity * 200) / 255);
            hud_element_set_render_pos(id, 79, 176);
            func_80144238(id);

            id = D_802AD048;
            theta = (D_802AD100 - BattleMenu_CurPos) * 28;
            scale = (BattleMenu_WheelAngle - theta) * (45.0 / 28.0);
            hud_element_set_transform_rotation(id, 0.0f, 0.0f, -scale);
            hud_element_set_transform_rotation_pivot(id, 18, -20);
            hud_element_set_scale(id, 0.95f);
            hud_element_set_alpha(id, (opacity * 254) / 255);
            hud_element_set_render_pos(id, 40 - D_802AD00A, D_802AD00A + 212);
            func_80144238(id);

            id = D_802AD044;
            hud_element_set_alpha(id, (opacity * 254) / 255);
            hud_element_set_render_pos(id, 40 - D_802AD00A, D_802AD00A + 212);
            hud_element_set_scale(id, 1.0f);
            func_80144238(id);

            theta = BattleMenu_WheelAngle;
            for (i = 0; i < BattleMenu_NumOptions; i++, theta += 28.0f) {
                x = 0.0f;
                y = 0.0f;
                add_vec2D_polar(&x, &y, 87.0f, theta);
                l = x = BattleMenu_BasePosX + x;
                t = y = BattleMenu_BasePosY + y;
                btl_draw_prim_quad(0, 0, 0, 0, l - 12, t - 12, 24, 24);
                id = D_802AD010[i];
                hud_element_set_render_pos(id, l, t);
                hud_element_set_alpha(id, (opacity * 180) / 255);
                if (i == BattleMenu_HomePos + BattleMenu_CurPos) {
                    hud_element_set_alpha(id, opacity);
                }
                hud_element_draw_clipped(id);
            }

            if (cond) {
                l = BattleMenu_BasePosX + 20;
                t = BattleMenu_BasePosY - 34;
                btl_draw_prim_quad(0, 0, 0, 0, l + 26, t, 48, 16);
                draw_msg(BattleMenu_TitleMessages[BattleMenu_CurPos + BattleMenu_HomePos], l, t, opacity, MSG_PAL_35, 0);
            }

            if ((gBattleStatus.flags1 & BS_FLAGS1_TUTORIAL_BATTLE) || (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE)) {
                BattleMenu_ShowSwapIcons = FALSE;
            }

            if (BattleMenu_ShowSwapIcons) {
                id = D_802AD05C;
                hud_element_set_alpha(id, (opacity * 200) / 255);
                hud_element_draw_clipped(id);
                id = D_802AD050;
                hud_element_set_alpha(id, opacity);
                hud_element_draw_clipped(id);
                id = D_802AD054;
                hud_element_set_alpha(id, opacity);
                hud_element_draw_clipped(id);
                id = D_802AD058;
                hud_element_set_alpha(id, opacity);
                hud_element_draw_clipped(id);
            }
            break;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_80244008
/* 1728E8 80244008 27BDFFB0 */  addiu     $sp, $sp, -0x50
.L8024400C:
/* 1728EC 8024400C AFB30024 */  sw        $s3, 0x24($sp)
D_80244010:
/* 1728F0 80244010 3C13800E */  lui       $s3, %hi(gBattleStatus)
/* 1728F4 80244014 2673C070 */  addiu     $s3, $s3, %lo(gBattleStatus)
D_80244018:
/* 1728F8 80244018 AFB60030 */  sw        $s6, 0x30($sp)
D_8024401C:
/* 1728FC 8024401C 3C16800B */  lui       $s6, %hi(gCurrentEncounter)
D_80244020:
/* 172900 80244020 26D60F10 */  addiu     $s6, $s6, %lo(gCurrentEncounter)
/* 172904 80244024 AFB5002C */  sw        $s5, 0x2C($sp)
D_80244028:
/* 172908 80244028 3C158011 */  lui       $s5, %hi(gPlayerData)
D_8024402C:
/* 17290C 8024402C 26B5F290 */  addiu     $s5, $s5, %lo(gPlayerData)
D_80244030:
/* 172910 80244030 AFB20020 */  sw        $s2, 0x20($sp)
.L80244034:
/* 172914 80244034 3C12800E */  lui       $s2, %hi(gBattleSubState)
D_80244038:
/* 172918 80244038 2652C4DC */  addiu     $s2, $s2, %lo(gBattleSubState)
arn_04_pad_403C:
/* 17291C 8024403C AFBF0034 */  sw        $ra, 0x34($sp)
D_80244040:
/* 172920 80244040 AFB40028 */  sw        $s4, 0x28($sp)
.L80244044:
/* 172924 80244044 AFB1001C */  sw        $s1, 0x1C($sp)
/* 172928 80244048 AFB00018 */  sw        $s0, 0x18($sp)
D_8024404C:
/* 17292C 8024404C F7B80048 */  sdc1      $f24, 0x48($sp)
D_80244050:
/* 172930 80244050 F7B60040 */  sdc1      $f22, 0x40($sp)
D_80244054:
/* 172934 80244054 F7B40038 */  sdc1      $f20, 0x38($sp)
D_80244058:
/* 172938 80244058 8E7100D8 */  lw        $s1, 0xD8($s3)
/* 17293C 8024405C 8E430000 */  lw        $v1, 0x0($s2)
glabel func_80244060
/* 172940 80244060 8E7000DC */  lw        $s0, 0xDC($s3)
.L80244064:
/* 172944 80244064 10600005 */  beqz      $v1, .L8024407C
.L80244068:
/* 172948 80244068 24020001 */   addiu    $v0, $zero, 0x1
flo_10_pad_406C:
/* 17294C 8024406C 10620024 */  beq       $v1, $v0, D_80244100
dead_flo_16_SFlyingAI_JumpVels:
/* 172950 80244070 24020005 */   addiu    $v0, $zero, 0x5
D_80244074:
/* 172954 80244074 0809104B */  j         D_8024412C
glabel func_80244078
/* 172958 80244078 00000000 */   nop
.L8024407C:
/* 17295C 8024407C 3C03F3FF */  lui       $v1, (0xF3FFFFFF >> 16)
/* 172960 80244080 8E220000 */  lw        $v0, 0x0($s1)
flo_10_pad_4084:
/* 172964 80244084 3463FFFF */  ori       $v1, $v1, (0xF3FFFFFF & 0xFFFF)
/* 172968 80244088 00431024 */  and       $v0, $v0, $v1
D_8024408C:
/* 17296C 8024408C 12000004 */  beqz      $s0, .L802440A0
D_80244090:
/* 172970 80244090 AE220000 */   sw       $v0, 0x0($s1)
/* 172974 80244094 8E020000 */  lw        $v0, 0x0($s0)
/* 172978 80244098 00431024 */  and       $v0, $v0, $v1
/* 17297C 8024409C AE020000 */  sw        $v0, 0x0($s0)
.L802440A0:
/* 172980 802440A0 8262009A */  lb        $v0, 0x9A($s3)
.L802440A4:
/* 172984 802440A4 14400003 */  bnez      $v0, .L802440B4
.L802440A8:
/* 172988 802440A8 A260008C */   sb       $zero, 0x8C($s3)
/* 17298C 802440AC 08091046 */  j         .L80244118
/* 172990 802440B0 24020005 */   addiu    $v0, $zero, 0x5
.L802440B4:
/* 172994 802440B4 18400003 */  blez      $v0, .L802440C4
.L802440B8:
/* 172998 802440B8 24020001 */   addiu    $v0, $zero, 0x1
D_802440BC:
/* 17299C 802440BC 3C01802A */  lui       $at, %hi(D_8029F254)
/* 1729A0 802440C0 AC22F254 */  sw        $v0, %lo(D_8029F254)($at)
.L802440C4:
/* 1729A4 802440C4 2405000A */  addiu     $a1, $zero, 0xA
D_802440C8:
/* 1729A8 802440C8 2402000C */  addiu     $v0, $zero, 0xC
/* 1729AC 802440CC A26201A7 */  sb        $v0, 0x1A7($s3)
glabel func_802440D0
/* 1729B0 802440D0 8E0401CC */  lw        $a0, 0x1CC($s0)
.L802440D4:
/* 1729B4 802440D4 0C0B0CF8 */  jal       start_script
D_802440D8:
/* 1729B8 802440D8 0000302D */   daddu    $a2, $zero, $zero
D_802440DC:
/* 1729BC 802440DC 0040202D */  daddu     $a0, $v0, $zero
D_802440E0:
/* 1729C0 802440E0 AE0401DC */  sw        $a0, 0x1DC($s0)
D_802440E4:
/* 1729C4 802440E4 8C830144 */  lw        $v1, 0x144($a0)
glabel func_802440E8
/* 1729C8 802440E8 24020001 */  addiu     $v0, $zero, 0x1
D_802440EC:
/* 1729CC 802440EC AE420000 */  sw        $v0, 0x0($s2)
D_802440F0:
/* 1729D0 802440F0 24020100 */  addiu     $v0, $zero, 0x100
D_802440F4:
/* 1729D4 802440F4 AE0301EC */  sw        $v1, 0x1EC($s0)
D_802440F8:
/* 1729D8 802440F8 08091047 */  j         D_8024411C
D_802440FC:
/* 1729DC 802440FC AC820148 */   sw       $v0, 0x148($a0)
D_80244100:
/* 1729E0 80244100 8E0401EC */  lw        $a0, 0x1EC($s0)
D_80244104:
/* 1729E4 80244104 0C0B1059 */  jal       does_script_exist
/* 1729E8 80244108 00000000 */   nop
/* 1729EC 8024410C 14400003 */  bnez      $v0, D_8024411C
/* 1729F0 80244110 24020005 */   addiu    $v0, $zero, 0x5
/* 1729F4 80244114 A260009A */  sb        $zero, 0x9A($s3)
.L80244118:
/* 1729F8 80244118 AE420000 */  sw        $v0, 0x0($s2)
D_8024411C:
/* 1729FC 8024411C 3C12800E */  lui       $s2, %hi(gBattleSubState)
/* 172A00 80244120 2652C4DC */  addiu     $s2, $s2, %lo(gBattleSubState)
/* 172A04 80244124 8E430000 */  lw        $v1, 0x0($s2)
/* 172A08 80244128 24020005 */  addiu     $v0, $zero, 0x5
D_8024412C:
/* 172A0C 8024412C 10620005 */  beq       $v1, $v0, D_80244144
D_80244130:
/* 172A10 80244130 2402000A */   addiu    $v0, $zero, 0xA
.L80244134:
/* 172A14 80244134 10620040 */  beq       $v1, $v0, .L80244238
D_80244138:
/* 172A18 80244138 00000000 */   nop
.L8024413C:
/* 172A1C 8024413C 080910A3 */  j         .L8024428C
jtbl_80244140:
/* 172A20 80244140 00000000 */   nop
D_80244144:
/* 172A24 80244144 3C03F3FF */  lui       $v1, (0xF3FFFFFF >> 16)
.L80244148:
/* 172A28 80244148 8E220000 */  lw        $v0, 0x0($s1)
D_8024414C:
/* 172A2C 8024414C 3463FFFF */  ori       $v1, $v1, (0xF3FFFFFF & 0xFFFF)
D_80244150:
/* 172A30 80244150 00431024 */  and       $v0, $v0, $v1
dead_kzn_17_varStash:
/* 172A34 80244154 12000004 */  beqz      $s0, .L80244168
D_80244158:
/* 172A38 80244158 AE220000 */   sw       $v0, 0x0($s1)
/* 172A3C 8024415C 8E020000 */  lw        $v0, 0x0($s0)
D_80244160_ED8380:
/* 172A40 80244160 00431024 */  and       $v0, $v0, $v1
/* 172A44 80244164 AE020000 */  sw        $v0, 0x0($s0)
.L80244168:
/* 172A48 80244168 2402000B */  addiu     $v0, $zero, 0xB
.L8024416C:
/* 172A4C 8024416C 3C05800E */  lui       $a1, %hi(gBattleStatus)
D_80244170:
/* 172A50 80244170 24A5C070 */  addiu     $a1, $a1, %lo(gBattleStatus)
D_80244174:
/* 172A54 80244174 2403FFFD */  addiu     $v1, $zero, -0x3
.L80244178:
/* 172A58 80244178 2406FFF7 */  addiu     $a2, $zero, -0x9
D_8024417C:
/* 172A5C 8024417C AE420000 */  sw        $v0, 0x0($s2)
D_80244180:
/* 172A60 80244180 8CA20004 */  lw        $v0, 0x4($a1)
D_80244184:
/* 172A64 80244184 2404FFEF */  addiu     $a0, $zero, -0x11
D_80244188:
/* 172A68 80244188 00431024 */  and       $v0, $v0, $v1
D_8024418C:
/* 172A6C 8024418C 2403FFFB */  addiu     $v1, $zero, -0x5
.L80244190:
/* 172A70 80244190 00431024 */  and       $v0, $v0, $v1
.L80244194:
/* 172A74 80244194 00461024 */  and       $v0, $v0, $a2
/* 172A78 80244198 8CA30000 */  lw        $v1, 0x0($a1)
/* 172A7C 8024419C 00441024 */  and       $v0, $v0, $a0
D_802441A0:
/* 172A80 802441A0 ACA20004 */  sw        $v0, 0x4($a1)
.L802441A4:
/* 172A84 802441A4 00661824 */  and       $v1, $v1, $a2
D_802441A8:
/* 172A88 802441A8 ACA30000 */  sw        $v1, 0x0($a1)
.L802441AC:
/* 172A8C 802441AC 82220216 */  lb        $v0, 0x216($s1)
D_802441B0:
/* 172A90 802441B0 2414000D */  addiu     $s4, $zero, 0xD
dro_02_pad_41B4:
/* 172A94 802441B4 14540005 */  bne       $v0, $s4, .L802441CC
dead_kzn_17_ItemChoice_HasSelectedItem:
/* 172A98 802441B8 00000000 */   nop
dead_kzn_17_ItemChoice_SelectedItemID:
/* 172A9C 802441BC 0C09C596 */  jal       dispatch_event_player
D_802441C0:
/* 172AA0 802441C0 24040034 */   addiu    $a0, $zero, 0x34
.L802441C4:
/* 172AA4 802441C4 2402000A */  addiu     $v0, $zero, 0xA
D_802441C8:
/* 172AA8 802441C8 AE420000 */  sw        $v0, 0x0($s2)
.L802441CC:
/* 172AAC 802441CC 8E220440 */  lw        $v0, 0x440($s1)
D_802441D0_ED41C0:
/* 172AB0 802441D0 A2200210 */  sb        $zero, 0x210($s1)
D_802441D4:
/* 172AB4 802441D4 A2200212 */  sb        $zero, 0x212($s1)
D_802441D8_ED41C8:
/* 172AB8 802441D8 A2200214 */  sb        $zero, 0x214($s1)
dead_flo_13_FlyingAI_JumpVels:
/* 172ABC 802441DC A2200218 */  sb        $zero, 0x218($s1)
D_802441E0_ED41D0:
/* 172AC0 802441E0 A2200216 */  sb        $zero, 0x216($s1)
D_802441E4:
/* 172AC4 802441E4 A2200217 */  sb        $zero, 0x217($s1)
D_802441E8:
/* 172AC8 802441E8 8C42000C */  lw        $v0, 0xC($v0)
glabel func_802441EC
/* 172ACC 802441EC 12000027 */  beqz      $s0, .L8024428C
D_802441F0:
/* 172AD0 802441F0 AC40003C */   sw       $zero, 0x3C($v0)
.L802441F4:
/* 172AD4 802441F4 82020216 */  lb        $v0, 0x216($s0)
/* 172AD8 802441F8 14540005 */  bne       $v0, $s4, D_80244210
D_802441FC:
/* 172ADC 802441FC 00000000 */   nop
.L80244200:
/* 172AE0 80244200 0C09F7A0 */  jal       dispatch_event_partner
D_80244204:
/* 172AE4 80244204 24040034 */   addiu    $a0, $zero, 0x34
D_80244208:
/* 172AE8 80244208 2402000A */  addiu     $v0, $zero, 0xA
/* 172AEC 8024420C AE420000 */  sw        $v0, 0x0($s2)
D_80244210:
/* 172AF0 80244210 8E020440 */  lw        $v0, 0x440($s0)
.L80244214:
/* 172AF4 80244214 A2000210 */  sb        $zero, 0x210($s0)
D_80244218:
/* 172AF8 80244218 A2000212 */  sb        $zero, 0x212($s0)
/* 172AFC 8024421C A2000214 */  sb        $zero, 0x214($s0)
D_80244220:
/* 172B00 80244220 A2000218 */  sb        $zero, 0x218($s0)
glabel func_80244224
/* 172B04 80244224 A2000216 */  sb        $zero, 0x216($s0)
.L80244228:
/* 172B08 80244228 A2000217 */  sb        $zero, 0x217($s0)
/* 172B0C 8024422C 8C42000C */  lw        $v0, 0xC($v0)
/* 172B10 80244230 080910A3 */  j         .L8024428C
/* 172B14 80244234 AC40003C */   sw       $zero, 0x3C($v0)
.L80244238:
/* 172B18 80244238 8E2201D8 */  lw        $v0, 0x1D8($s1)
D_8024423C:
/* 172B1C 8024423C 10400005 */  beqz      $v0, .L80244254
D_80244240:
/* 172B20 80244240 00000000 */   nop
/* 172B24 80244244 0C0B1059 */  jal       does_script_exist
.L80244248:
/* 172B28 80244248 8E2401E8 */   lw       $a0, 0x1E8($s1)
/* 172B2C 8024424C 1440000F */  bnez      $v0, .L8024428C
.L80244250:
/* 172B30 80244250 00000000 */   nop
.L80244254:
/* 172B34 80244254 1200000A */  beqz      $s0, .L80244280
D_80244258:
/* 172B38 80244258 AE2001D8 */   sw       $zero, 0x1D8($s1)
.L8024425C:
/* 172B3C 8024425C 8E0201D8 */  lw        $v0, 0x1D8($s0)
/* 172B40 80244260 50400007 */  beql      $v0, $zero, .L80244280
.L80244264:
/* 172B44 80244264 AE0001D8 */   sw       $zero, 0x1D8($s0)
/* 172B48 80244268 8E0401E8 */  lw        $a0, 0x1E8($s0)
/* 172B4C 8024426C 0C0B1059 */  jal       does_script_exist
D_80244270:
/* 172B50 80244270 00000000 */   nop
/* 172B54 80244274 14400005 */  bnez      $v0, .L8024428C
/* 172B58 80244278 00000000 */   nop
D_8024427C:
/* 172B5C 8024427C AE0001D8 */  sw        $zero, 0x1D8($s0)
.L80244280:
/* 172B60 80244280 2402000B */  addiu     $v0, $zero, 0xB
D_80244284:
/* 172B64 80244284 3C01800E */  lui       $at, %hi(gBattleSubState)
glabel func_80244288
/* 172B68 80244288 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
.L8024428C:
/* 172B6C 8024428C 3C04800E */  lui       $a0, %hi(gBattleSubState)
D_80244290:
/* 172B70 80244290 2484C4DC */  addiu     $a0, $a0, %lo(gBattleSubState)
/* 172B74 80244294 8C830000 */  lw        $v1, 0x0($a0)
/* 172B78 80244298 2402000B */  addiu     $v0, $zero, 0xB
/* 172B7C 8024429C 14620017 */  bne       $v1, $v0, .L802442FC
glabel func_802442A0
/* 172B80 802442A0 00000000 */   nop
/* 172B84 802442A4 12000006 */  beqz      $s0, D_802442C0
/* 172B88 802442A8 3C030010 */   lui      $v1, (0x100000 >> 16)
.L802442AC:
/* 172B8C 802442AC 3C02800E */  lui       $v0, %hi(gBattleStatus)
D_802442B0:
/* 172B90 802442B0 8C42C070 */  lw        $v0, %lo(gBattleStatus)($v0)
/* 172B94 802442B4 00431024 */  and       $v0, $v0, $v1
D_802442B8:
/* 172B98 802442B8 14400004 */  bnez      $v0, .L802442CC
/* 172B9C 802442BC 2402000C */   addiu    $v0, $zero, 0xC
D_802442C0:
/* 172BA0 802442C0 24020002 */  addiu     $v0, $zero, 0x2
/* 172BA4 802442C4 080910BF */  j         .L802442FC
/* 172BA8 802442C8 AC820000 */   sw       $v0, 0x0($a0)
.L802442CC:
/* 172BAC 802442CC C6000144 */  lwc1      $f0, 0x144($s0)
dead_03_D_802442D0:
/* 172BB0 802442D0 C602014C */  lwc1      $f2, 0x14C($s0)
/* 172BB4 802442D4 E600000C */  swc1      $f0, 0xC($s0)
D_802442D8:
/* 172BB8 802442D8 E6020014 */  swc1      $f2, 0x14($s0)
/* 172BBC 802442DC C6200144 */  lwc1      $f0, 0x144($s1)
D_802442E0:
/* 172BC0 802442E0 AC820000 */  sw        $v0, 0x0($a0)
D_802442E4:
/* 172BC4 802442E4 E6000018 */  swc1      $f0, 0x18($s0)
jtbl_802442E8:
/* 172BC8 802442E8 C620014C */  lwc1      $f0, 0x14C($s1)
/* 172BCC 802442EC 24020004 */  addiu     $v0, $zero, 0x4
D_802442F0:
/* 172BD0 802442F0 A6020070 */  sh        $v0, 0x70($s0)
/* 172BD4 802442F4 AE000054 */  sw        $zero, 0x54($s0)
.L802442F8:
/* 172BD8 802442F8 E6000020 */  swc1      $f0, 0x20($s0)
.L802442FC:
/* 172BDC 802442FC 3C12800E */  lui       $s2, %hi(gBattleSubState)
.L80244300:
/* 172BE0 80244300 2652C4DC */  addiu     $s2, $s2, %lo(gBattleSubState)
/* 172BE4 80244304 8E430000 */  lw        $v1, 0x0($s2)
glabel func_80244308
/* 172BE8 80244308 2402000C */  addiu     $v0, $zero, 0xC
/* 172BEC 8024430C 1462006D */  bne       $v1, $v0, D_802444C4
/* 172BF0 80244310 00000000 */   nop
/* 172BF4 80244314 86020070 */  lh        $v0, 0x70($s0)
jtbl_80244318:
/* 172BF8 80244318 10400022 */  beqz      $v0, .L802443A4
/* 172BFC 8024431C 00000000 */   nop
/* 172C00 80244320 C6000018 */  lwc1      $f0, 0x18($s0)
.L80244324:
/* 172C04 80244324 C6080144 */  lwc1      $f8, 0x144($s0)
D_80244328:
/* 172C08 80244328 C6020020 */  lwc1      $f2, 0x20($s0)
D_8024432C:
/* 172C0C 8024432C 46080001 */  sub.s     $f0, $f0, $f8
D_80244330:
/* 172C10 80244330 C604014C */  lwc1      $f4, 0x14C($s0)
/* 172C14 80244334 46041081 */  sub.s     $f2, $f2, $f4
D_80244338:
/* 172C18 80244338 44823000 */  mtc1      $v0, $f6
.L8024433C:
/* 172C1C 8024433C 00000000 */  nop
D_80244340:
/* 172C20 80244340 468031A0 */  cvt.s.w   $f6, $f6
/* 172C24 80244344 46060003 */  div.s     $f0, $f0, $f6
D_80244348:
/* 172C28 80244348 46004200 */  add.s     $f8, $f8, $f0
.L8024434C:
/* 172C2C 8024434C 46003006 */  mov.s     $f0, $f6
jtbl_80244350:
/* 172C30 80244350 46061083 */  div.s     $f2, $f2, $f6
/* 172C34 80244354 C600000C */  lwc1      $f0, 0xC($s0)
D_80244358:
/* 172C38 80244358 46022100 */  add.s     $f4, $f4, $f2
/* 172C3C 8024435C E6080144 */  swc1      $f8, 0x144($s0)
D_80244360:
/* 172C40 80244360 E604014C */  swc1      $f4, 0x14C($s0)
/* 172C44 80244364 C6240144 */  lwc1      $f4, 0x144($s1)
/* 172C48 80244368 46040001 */  sub.s     $f0, $f0, $f4
/* 172C4C 8024436C 46003086 */  mov.s     $f2, $f6
D_80244370:
/* 172C50 80244370 46060003 */  div.s     $f0, $f0, $f6
D_80244374:
/* 172C54 80244374 46002100 */  add.s     $f4, $f4, $f0
D_80244378:
/* 172C58 80244378 E6240144 */  swc1      $f4, 0x144($s1)
D_8024437C:
/* 172C5C 8024437C C6000014 */  lwc1      $f0, 0x14($s0)
/* 172C60 80244380 C624014C */  lwc1      $f4, 0x14C($s1)
D_80244384:
/* 172C64 80244384 86020070 */  lh        $v0, 0x70($s0)
D_80244388:
/* 172C68 80244388 46040001 */  sub.s     $f0, $f0, $f4
D_8024438C:
/* 172C6C 8024438C 44821000 */  mtc1      $v0, $f2
D_80244390:
/* 172C70 80244390 00000000 */  nop
/* 172C74 80244394 468010A0 */  cvt.s.w   $f2, $f2
/* 172C78 80244398 46020003 */  div.s     $f0, $f0, $f2
/* 172C7C 8024439C 46002100 */  add.s     $f4, $f4, $f0
/* 172C80 802443A0 E624014C */  swc1      $f4, 0x14C($s1)
.L802443A4:
/* 172C84 802443A4 C60C0054 */  lwc1      $f12, 0x54($s0)
D_802443A8:
/* 172C88 802443A8 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
D_802443AC:
/* 172C8C 802443AC 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 172C90 802443B0 4481B000 */  mtc1      $at, $f22
/* 172C94 802443B4 00000000 */  nop
/* 172C98 802443B8 46166302 */  mul.s     $f12, $f12, $f22
/* 172C9C 802443BC 00000000 */  nop
D_802443C0:
/* 172CA0 802443C0 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 172CA4 802443C4 4481C000 */  mtc1      $at, $f24
/* 172CA8 802443C8 3C014180 */  lui       $at, (0x41800000 >> 16)
/* 172CAC 802443CC 4481A000 */  mtc1      $at, $f20
D_802443D0:
/* 172CB0 802443D0 0C00A85B */  jal       sin_rad
/* 172CB4 802443D4 46186303 */   div.s    $f12, $f12, $f24
flo_17_pad_XXX:
/* 172CB8 802443D8 46140002 */  mul.s     $f0, $f0, $f20
D_802443DC:
/* 172CBC 802443DC 00000000 */  nop
D_802443E0:
/* 172CC0 802443E0 C602014C */  lwc1      $f2, 0x14C($s0)
D_802443E4:
/* 172CC4 802443E4 46001080 */  add.s     $f2, $f2, $f0
/* 172CC8 802443E8 C60C0054 */  lwc1      $f12, 0x54($s0)
/* 172CCC 802443EC 46006307 */  neg.s     $f12, $f12
D_802443F0:
/* 172CD0 802443F0 0C00A6C9 */  jal       clamp_angle
/* 172CD4 802443F4 E602014C */   swc1     $f2, 0x14C($s0)
D_802443F8:
/* 172CD8 802443F8 C60C0054 */  lwc1      $f12, 0x54($s0)
.L802443FC:
/* 172CDC 802443FC 46166302 */  mul.s     $f12, $f12, $f22
D_80244400:
/* 172CE0 80244400 00000000 */  nop
.L80244404:
/* 172CE4 80244404 E600018C */  swc1      $f0, 0x18C($s0)
D_80244408:
/* 172CE8 80244408 0C00A85B */  jal       sin_rad
D_8024440C:
/* 172CEC 8024440C 46186303 */   div.s    $f12, $f12, $f24
/* 172CF0 80244410 46140002 */  mul.s     $f0, $f0, $f20
/* 172CF4 80244414 00000000 */  nop
/* 172CF8 80244418 C622014C */  lwc1      $f2, 0x14C($s1)
/* 172CFC 8024441C 46001081 */  sub.s     $f2, $f2, $f0
D_80244420:
/* 172D00 80244420 E622014C */  swc1      $f2, 0x14C($s1)
D_80244424:
/* 172D04 80244424 C60C0054 */  lwc1      $f12, 0x54($s0)
/* 172D08 80244428 0C00A6C9 */  jal       clamp_angle
D_8024442C:
/* 172D0C 8024442C 46006307 */   neg.s    $f12, $f12
/* 172D10 80244430 E620018C */  swc1      $f0, 0x18C($s1)
D_80244434:
/* 172D14 80244434 C6000054 */  lwc1      $f0, 0x54($s0)
D_80244438:
/* 172D18 80244438 3C0142B4 */  lui       $at, (0x42B40000 >> 16)
/* 172D1C 8024443C 44811000 */  mtc1      $at, $f2
.L80244440:
/* 172D20 80244440 86020070 */  lh        $v0, 0x70($s0)
.L80244444:
/* 172D24 80244444 46020000 */  add.s     $f0, $f0, $f2
D_80244448:
/* 172D28 80244448 96030070 */  lhu       $v1, 0x70($s0)
/* 172D2C 8024444C 10400004 */  beqz      $v0, D_80244460
D_80244450:
/* 172D30 80244450 E6000054 */   swc1     $f0, 0x54($s0)
D_80244454:
/* 172D34 80244454 2462FFFF */  addiu     $v0, $v1, -0x1
jtbl_80244458:
/* 172D38 80244458 08091131 */  j         D_802444C4
D_8024445C:
/* 172D3C 8024445C A6020070 */   sh       $v0, 0x70($s0)
D_80244460:
/* 172D40 80244460 C6000018 */  lwc1      $f0, 0x18($s0)
/* 172D44 80244464 C6020020 */  lwc1      $f2, 0x20($s0)
/* 172D48 80244468 C604000C */  lwc1      $f4, 0xC($s0)
/* 172D4C 8024446C E6000144 */  swc1      $f0, 0x144($s0)
/* 172D50 80244470 E602014C */  swc1      $f2, 0x14C($s0)
D_80244474:
/* 172D54 80244474 E6240144 */  swc1      $f4, 0x144($s1)
D_80244478:
/* 172D58 80244478 C6000014 */  lwc1      $f0, 0x14($s0)
/* 172D5C 8024447C 3C05FFEF */  lui       $a1, (0xFFEFFFFF >> 16)
D_80244480:
/* 172D60 80244480 E620014C */  swc1      $f0, 0x14C($s1)
/* 172D64 80244484 C6000144 */  lwc1      $f0, 0x144($s0)
jtbl_80244488:
/* 172D68 80244488 C602014C */  lwc1      $f2, 0x14C($s0)
/* 172D6C 8024448C 34A5FFFF */  ori       $a1, $a1, (0xFFEFFFFF & 0xFFFF)
D_80244490:
/* 172D70 80244490 E6000138 */  swc1      $f0, 0x138($s0)
dead_03_LetterDelivery_SavedNpcAnim:
/* 172D74 80244494 E6020140 */  swc1      $f2, 0x140($s0)
.L80244498:
/* 172D78 80244498 C6200144 */  lwc1      $f0, 0x144($s1)
.L8024449C:
/* 172D7C 8024449C C622014C */  lwc1      $f2, 0x14C($s1)
D_802444A0:
/* 172D80 802444A0 3C04800E */  lui       $a0, %hi(gBattleStatus)
/* 172D84 802444A4 2484C070 */  addiu     $a0, $a0, %lo(gBattleStatus)
D_802444A8:
/* 172D88 802444A8 E6200138 */  swc1      $f0, 0x138($s1)
/* 172D8C 802444AC E6220140 */  swc1      $f2, 0x140($s1)
D_802444B0:
/* 172D90 802444B0 8C820000 */  lw        $v0, 0x0($a0)
D_802444B4:
/* 172D94 802444B4 24030002 */  addiu     $v1, $zero, 0x2
jtbl_802444B8:
/* 172D98 802444B8 AE430000 */  sw        $v1, 0x0($s2)
dead_11_FlyingAI_JumpVels:
/* 172D9C 802444BC 00451024 */  and       $v0, $v0, $a1
D_802444C0:
/* 172DA0 802444C0 AC820000 */  sw        $v0, 0x0($a0)
D_802444C4:
/* 172DA4 802444C4 3C03800E */  lui       $v1, %hi(gBattleSubState)
/* 172DA8 802444C8 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
/* 172DAC 802444CC 24020002 */  addiu     $v0, $zero, 0x2
D_802444D0:
/* 172DB0 802444D0 14620026 */  bne       $v1, $v0, .L8024456C
D_802444D4:
/* 172DB4 802444D4 00000000 */   nop
D_802444D8:
/* 172DB8 802444D8 0C093903 */  jal       func_8024E40C
/* 172DBC 802444DC 0040202D */   daddu    $a0, $v0, $zero
/* 172DC0 802444E0 8263008A */  lb        $v1, 0x8A($s3)
D_802444E4:
/* 172DC4 802444E4 24020003 */  addiu     $v0, $zero, 0x3
glabel func_802444E8
/* 172DC8 802444E8 14620016 */  bne       $v1, $v0, .L80244544
/* 172DCC 802444EC 00000000 */   nop
D_802444F0:
/* 172DD0 802444F0 82620078 */  lb        $v0, 0x78($s3)
.L802444F4:
/* 172DD4 802444F4 14400007 */  bnez      $v0, .L80244514
flo_16_pad_44F8:
/* 172DD8 802444F8 2405000A */   addiu    $a1, $zero, 0xA
/* 172DDC 802444FC 92A2028A */  lbu       $v0, 0x28A($s5)
D_80244500:
/* 172DE0 80244500 A260008A */  sb        $zero, 0x8A($s3)
/* 172DE4 80244504 A6A0028C */  sh        $zero, 0x28C($s5)
D_80244508:
/* 172DE8 80244508 24420001 */  addiu     $v0, $v0, 0x1
/* 172DEC 8024450C 08091150 */  j         .L80244540
/* 172DF0 80244510 A2A2028A */   sb       $v0, 0x28A($s5)
.L80244514:
/* 172DF4 80244514 3C048028 */  lui       $a0, %hi(EVS_Mario_HandlePhase)
/* 172DF8 80244518 24844EBC */  addiu     $a0, $a0, %lo(EVS_Mario_HandlePhase)
D_8024451C:
/* 172DFC 8024451C 0000302D */  daddu     $a2, $zero, $zero
D_80244520:
/* 172E00 80244520 24020016 */  addiu     $v0, $zero, 0x16
/* 172E04 80244524 0C0B0CF8 */  jal       start_script
/* 172E08 80244528 A26201A7 */   sb       $v0, 0x1A7($s3)
/* 172E0C 8024452C 0040202D */  daddu     $a0, $v0, $zero
/* 172E10 80244530 AE2401D4 */  sw        $a0, 0x1D4($s1)
/* 172E14 80244534 8C820144 */  lw        $v0, 0x144($a0)
/* 172E18 80244538 AE2201E4 */  sw        $v0, 0x1E4($s1)
/* 172E1C 8024453C AC800148 */  sw        $zero, 0x148($a0)
.L80244540:
/* 172E20 80244540 24020003 */  addiu     $v0, $zero, 0x3
.L80244544:
/* 172E24 80244544 3C04800E */  lui       $a0, %hi(gBattleStatus)
/* 172E28 80244548 2484C070 */  addiu     $a0, $a0, %lo(gBattleStatus)
D_8024454C:
/* 172E2C 8024454C 3C01800E */  lui       $at, %hi(gBattleSubState)
glabel func_80244550
/* 172E30 80244550 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
/* 172E34 80244554 8C820000 */  lw        $v0, 0x0($a0)
/* 172E38 80244558 2403FFFD */  addiu     $v1, $zero, -0x3
.L8024455C:
/* 172E3C 8024455C 3C01802A */  lui       $at, %hi(D_8029F248)
D_80244560:
/* 172E40 80244560 AC20F248 */  sw        $zero, %lo(D_8029F248)($at)
/* 172E44 80244564 00431024 */  and       $v0, $v0, $v1
/* 172E48 80244568 AC820000 */  sw        $v0, 0x0($a0)
.L8024456C:
/* 172E4C 8024456C 3C12800E */  lui       $s2, %hi(gBattleSubState)
/* 172E50 80244570 2652C4DC */  addiu     $s2, $s2, %lo(gBattleSubState)
/* 172E54 80244574 8E500000 */  lw        $s0, 0x0($s2)
D_80244578:
/* 172E58 80244578 24020003 */  addiu     $v0, $zero, 0x3
/* 172E5C 8024457C 16020020 */  bne       $s0, $v0, D_80244600
/* 172E60 80244580 00000000 */   nop
/* 172E64 80244584 3C03802A */  lui       $v1, %hi(D_8029F248)
/* 172E68 80244588 2463F248 */  addiu     $v1, $v1, %lo(D_8029F248)
/* 172E6C 8024458C 8C620000 */  lw        $v0, 0x0($v1)
D_80244590:
/* 172E70 80244590 10400003 */  beqz      $v0, .L802445A0
/* 172E74 80244594 2442FFFF */   addiu    $v0, $v0, -0x1
/* 172E78 80244598 08091180 */  j         D_80244600
D_8024459C:
/* 172E7C 8024459C AC620000 */   sw       $v0, 0x0($v1)
.L802445A0:
/* 172E80 802445A0 8E2201D4 */  lw        $v0, 0x1D4($s1)
D_802445A4:
/* 172E84 802445A4 50400007 */  beql      $v0, $zero, .L802445C4
D_802445A8:
/* 172E88 802445A8 AE2001D4 */   sw       $zero, 0x1D4($s1)
/* 172E8C 802445AC 8E2401E4 */  lw        $a0, 0x1E4($s1)
/* 172E90 802445B0 0C0B1059 */  jal       does_script_exist
/* 172E94 802445B4 00000000 */   nop
/* 172E98 802445B8 14400011 */  bnez      $v0, D_80244600
/* 172E9C 802445BC 00000000 */   nop
D_802445C0:
/* 172EA0 802445C0 AE2001D4 */  sw        $zero, 0x1D4($s1)
.L802445C4:
/* 172EA4 802445C4 8262008A */  lb        $v0, 0x8A($s3)
jtbl_802445C8:
/* 172EA8 802445C8 10500003 */  beq       $v0, $s0, .L802445D8
/* 172EAC 802445CC 24020004 */   addiu    $v0, $zero, 0x4
D_802445D0:
/* 172EB0 802445D0 08091180 */  j         D_80244600
D_802445D4:
/* 172EB4 802445D4 AE420000 */   sw       $v0, 0x0($s2)
.L802445D8:
/* 172EB8 802445D8 92640078 */  lbu       $a0, 0x78($s3)
/* 172EBC 802445DC 24020014 */  addiu     $v0, $zero, 0x14
/* 172EC0 802445E0 A262007A */  sb        $v0, 0x7A($s3)
.L802445E4:
/* 172EC4 802445E4 92620079 */  lbu       $v0, 0x79($s3)
/* 172EC8 802445E8 24030004 */  addiu     $v1, $zero, 0x4
.L802445EC:
/* 172ECC 802445EC A260008A */  sb        $zero, 0x8A($s3)
D_802445F0:
/* 172ED0 802445F0 AE430000 */  sw        $v1, 0x0($s2)
/* 172ED4 802445F4 00822021 */  addu      $a0, $a0, $v0
D_802445F8:
/* 172ED8 802445F8 00441021 */  addu      $v0, $v0, $a0
D_802445FC:
/* 172EDC 802445FC A2620079 */  sb        $v0, 0x79($s3)
D_80244600:
/* 172EE0 80244600 3C03800E */  lui       $v1, %hi(gBattleSubState)
D_80244604:
/* 172EE4 80244604 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
/* 172EE8 80244608 24020004 */  addiu     $v0, $zero, 0x4
/* 172EEC 8024460C 14620031 */  bne       $v1, $v0, .L802446D4
D_80244610:
/* 172EF0 80244610 00000000 */   nop
/* 172EF4 80244614 82620079 */  lb        $v0, 0x79($s3)
/* 172EF8 80244618 1C40002E */  bgtz      $v0, .L802446D4
.L8024461C:
/* 172EFC 8024461C 3C020100 */   lui      $v0, (0x1000000 >> 16)
D_80244620:
/* 172F00 80244620 3C04800E */  lui       $a0, %hi(gBattleStatus)
/* 172F04 80244624 2484C070 */  addiu     $a0, $a0, %lo(gBattleStatus)
D_80244628:
/* 172F08 80244628 8C830000 */  lw        $v1, 0x0($a0)
D_8024462C_EEABDC:
/* 172F0C 8024462C 00621024 */  and       $v0, $v1, $v0
D_80244630_EEABE0:
/* 172F10 80244630 10400004 */  beqz      $v0, D_80244644
/* 172F14 80244634 3C02FFFB */   lui      $v0, (0xFFFBFFFF >> 16)
jtbl_80244638:
/* 172F18 80244638 3442FFFF */  ori       $v0, $v0, (0xFFFBFFFF & 0xFFFF)
/* 172F1C 8024463C 00621024 */  and       $v0, $v1, $v0
.L80244640:
/* 172F20 80244640 AC820000 */  sw        $v0, 0x0($a0)
D_80244644:
/* 172F24 80244644 96A302A4 */  lhu       $v1, 0x2A4($s5)
/* 172F28 80244648 2C62270F */  sltiu     $v0, $v1, 0x270F
/* 172F2C 8024464C 10400002 */  beqz      $v0, .L80244658
/* 172F30 80244650 24620001 */   addiu    $v0, $v1, 0x1
D_80244654:
/* 172F34 80244654 A6A202A4 */  sh        $v0, 0x2A4($s5)
.L80244658:
/* 172F38 80244658 8C820000 */  lw        $v0, 0x0($a0)
D_8024465C:
/* 172F3C 8024465C 3C030004 */  lui       $v1, (0x40000 >> 16)
/* 172F40 80244660 00431024 */  and       $v0, $v0, $v1
/* 172F44 80244664 10400003 */  beqz      $v0, .L80244674
/* 172F48 80244668 24020003 */   addiu    $v0, $zero, 0x3
/* 172F4C 8024466C 0809119E */  j         jtbl_80244678
.L80244670:
/* 172F50 80244670 A2C20009 */   sb       $v0, 0x9($s6)
.L80244674:
/* 172F54 80244674 A2C00009 */  sb        $zero, 0x9($s6)
jtbl_80244678:
/* 172F58 80244678 3C04800E */  lui       $a0, %hi(gBattleStatus)
/* 172F5C 8024467C 2484C070 */  addiu     $a0, $a0, %lo(gBattleStatus)
D_80244680:
/* 172F60 80244680 8C820000 */  lw        $v0, 0x0($a0)
/* 172F64 80244684 3C030002 */  lui       $v1, (0x20000 >> 16)
D_80244688:
/* 172F68 80244688 00431024 */  and       $v0, $v0, $v1
D_8024468C:
/* 172F6C 8024468C 1040000E */  beqz      $v0, .L802446C8
/* 172F70 80244690 3C030200 */   lui      $v1, (0x2000000 >> 16)
/* 172F74 80244694 8C820004 */  lw        $v0, 0x4($a0)
D_80244698:
/* 172F78 80244698 00431024 */  and       $v0, $v0, $v1
/* 172F7C 8024469C 5440000B */  bnel      $v0, $zero, .L802446CC
.L802446A0:
/* 172F80 802446A0 24040020 */   addiu    $a0, $zero, 0x20
.L802446A4:
/* 172F84 802446A4 24020008 */  addiu     $v0, $zero, 0x8
/* 172F88 802446A8 AFA20010 */  sw        $v0, 0x10($sp)
D_802446AC:
/* 172F8C 802446AC 0000202D */  daddu     $a0, $zero, $zero
.L802446B0:
/* 172F90 802446B0 2405FFFF */  addiu     $a1, $zero, -0x1
/* 172F94 802446B4 0080302D */  daddu     $a2, $a0, $zero
/* 172F98 802446B8 0C052A46 */  jal       bgm_set_song
D_802446BC:
/* 172F9C 802446BC 240705DC */   addiu    $a3, $zero, 0x5DC
D_802446C0:
/* 172FA0 802446C0 080911B3 */  j         .L802446CC
/* 172FA4 802446C4 24040020 */   addiu    $a0, $zero, 0x20
.L802446C8:
/* 172FA8 802446C8 24040021 */  addiu     $a0, $zero, 0x21
.L802446CC:
/* 172FAC 802446CC 0C090464 */  jal       func_80241190
/* 172FB0 802446D0 00000000 */   nop
.L802446D4:
/* 172FB4 802446D4 8FBF0034 */  lw        $ra, 0x34($sp)
D_802446D8:
/* 172FB8 802446D8 8FB60030 */  lw        $s6, 0x30($sp)
/* 172FBC 802446DC 8FB5002C */  lw        $s5, 0x2C($sp)
glabel func_802446E0
/* 172FC0 802446E0 8FB40028 */  lw        $s4, 0x28($sp)
/* 172FC4 802446E4 8FB30024 */  lw        $s3, 0x24($sp)
/* 172FC8 802446E8 8FB20020 */  lw        $s2, 0x20($sp)
/* 172FCC 802446EC 8FB1001C */  lw        $s1, 0x1C($sp)
/* 172FD0 802446F0 8FB00018 */  lw        $s0, 0x18($sp)
/* 172FD4 802446F4 D7B80048 */  ldc1      $f24, 0x48($sp)
/* 172FD8 802446F8 D7B60040 */  ldc1      $f22, 0x40($sp)
/* 172FDC 802446FC D7B40038 */  ldc1      $f20, 0x38($sp)
jtbl_80244700:
/* 172FE0 80244700 03E00008 */  jr        $ra
D_80244704:
/* 172FE4 80244704 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

void btl_state_update_victory(void) {
    BattleStatus* battleStatus = &gBattleStatus;
    EncounterStatus* currentEncounter = &gCurrentEncounter;
    PlayerData* playerData = &gPlayerData;
    Actor* player = battleStatus->playerActor;
    Actor* partner = battleStatus->partnerActor;
    Evt* script;

    switch (gBattleSubState) {
        case BTL_SUBSTATE_VICTORY_CHECK_OUTTA_SIGHT:
            player->flags &= ~(ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000);
            if (partner != NULL) {
                partner->flags &= ~(ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000);
            }

            battleStatus->stateFreezeCount = 0;
            if (battleStatus->outtaSightActive == 0) {
                gBattleSubState = BTL_SUBSTATE_VICTORY_RECOVER_STATUS;
            } else {
                if (battleStatus->outtaSightActive > 0) {
                    D_8029F254 = 1;
                }
                battleStatus->battlePhase = PHASE_ENEMY_BEGIN;
                script = start_script(partner->handlePhaseSource, EVT_PRIORITY_A, 0);
                partner->handlePhaseScript = script;
                partner->handleBatttlePhaseScriptID = script->id;
                script->owner1.actorID = ACTOR_PARTNER;
                gBattleSubState = BTL_SUBSTATE_VICTORY_AWAIT_OUTTA_SIGHT;
            }

            break;
        case BTL_SUBSTATE_VICTORY_AWAIT_OUTTA_SIGHT:
            if (!does_script_exist(partner->handleBatttlePhaseScriptID)) {
                battleStatus->outtaSightActive = 0;
                gBattleSubState = BTL_SUBSTATE_VICTORY_RECOVER_STATUS;
            }
            break;
    }

    switch (gBattleSubState) {
        case BTL_SUBSTATE_VICTORY_RECOVER_STATUS:
            player->flags &= ~(ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000);
            if (partner != NULL) {
                partner->flags &= ~(ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000);
            }
            gBattleSubState = BTL_SUBSTATE_VICTORY_CHECK_SWAP;
            gBattleStatus.flags2 &= ~BS_FLAGS2_2;
            gBattleStatus.flags2 &= ~BS_FLAGS2_4;
            gBattleStatus.flags2 &= ~BS_FLAGS2_8;
            gBattleStatus.flags2 &= ~BS_FLAGS2_10;

            gBattleStatus.flags1 &= ~BS_FLAGS1_SHOW_PLAYER_DECORATIONS;
            if (player->koStatus == STATUS_KEY_DAZE) {
                dispatch_event_player(EVENT_RECOVER_FROM_KO);
                gBattleSubState = BTL_SUBSTATE_VICTORY_AWAIT_RECOVER_KO;
            }
            player->debuff = 0;
            player->staticStatus = 0;
            player->stoneStatus = 0;
            player->transparentStatus = 0;
            player->koStatus = 0;
            player->koDuration = 0;
            player->disableEffect->data.disableX->koDuration = 0;

            if (partner != NULL) {
                if (partner->koStatus == STATUS_KEY_DAZE) {
                    dispatch_event_partner(EVENT_RECOVER_FROM_KO);
                    gBattleSubState = BTL_SUBSTATE_VICTORY_AWAIT_RECOVER_KO;
                }
                partner->debuff = 0;
                partner->staticStatus = 0;
                partner->stoneStatus = 0;
                partner->transparentStatus = 0;
                partner->koStatus = 0;
                partner->koDuration = 0;
                partner->disableEffect->data.disableX->koDuration = 0;
            }
            break;
        case BTL_SUBSTATE_VICTORY_AWAIT_RECOVER_KO:
            if (player->handleEventScript != NULL && does_script_exist(player->handleEventScriptID)) {
                break;
            }
            player->handleEventScript = NULL;

            if (partner != NULL) {
                if (partner->handleEventScript != NULL && does_script_exist(partner->handleEventScriptID)) {
                    break;
                }
                partner->handleEventScript = NULL;
            }
            gBattleSubState = BTL_SUBSTATE_VICTORY_CHECK_SWAP;
            break;
    }

    if (gBattleSubState == BTL_SUBSTATE_VICTORY_CHECK_SWAP) {
        if (partner == NULL || !(gBattleStatus.flags1 & BS_FLAGS1_PLAYER_IN_BACK)) {
            gBattleSubState = BTL_SUBSTATE_VICTORY_CHECK_MERLEE;
        } else {
            partner->state.currentPos.x = partner->currentPos.x;
            partner->state.currentPos.z = partner->currentPos.z;
            partner->state.goalPos.x = player->currentPos.x;
            partner->state.goalPos.z = player->currentPos.z;
            partner->state.moveTime = 4;
            partner->state.angle = 0.0f;
            gBattleSubState = BTL_SUBSTATE_VICTORY_AWAIT_SWAP;
        }
    }

    if (gBattleSubState == BTL_SUBSTATE_VICTORY_AWAIT_SWAP) {
        if (partner->state.moveTime != 0) {
            partner->currentPos.x += (partner->state.goalPos.x - partner->currentPos.x) / partner->state.moveTime;
            partner->currentPos.z += (partner->state.goalPos.z - partner->currentPos.z) / partner->state.moveTime;
            player->currentPos.x += (partner->state.currentPos.x - player->currentPos.x) / partner->state.moveTime;
            player->currentPos.z += (partner->state.currentPos.z - player->currentPos.z) / partner->state.moveTime;
        }
        partner->currentPos.z += sin_rad(DEG_TO_RAD(partner->state.angle)) * 16.0f;
        partner->yaw = clamp_angle(-partner->state.angle);
        player->currentPos.z -= sin_rad(DEG_TO_RAD(partner->state.angle)) * 16.0f;
        player->yaw = clamp_angle(-partner->state.angle);
        partner->state.angle += 90.0f;

        if (partner->state.moveTime != 0) {
            partner->state.moveTime--;
        } else {
            partner->currentPos.x = partner->state.goalPos.x;
            partner->currentPos.z = partner->state.goalPos.z;
            player->currentPos.x = partner->state.currentPos.x;
            player->currentPos.z = partner->state.currentPos.z;
            partner->homePos.x = partner->currentPos.x;
            partner->homePos.z = partner->currentPos.z;
            player->homePos.x = player->currentPos.x;
            player->homePos.z = player->currentPos.z;
            gBattleSubState = BTL_SUBSTATE_VICTORY_CHECK_MERLEE;
            gBattleStatus.flags1 &= ~BS_FLAGS1_PLAYER_IN_BACK;
        }
    }

    if (gBattleSubState == BTL_SUBSTATE_VICTORY_CHECK_MERLEE) {
        btl_cam_use_preset(BTL_CAM_DEFAULT);
        if (battleStatus->nextMerleeSpellType == MERLEE_SPELL_EXP_BOOST) {
            if (battleStatus->totalStarPoints == 0) {
                battleStatus->nextMerleeSpellType = MERLEE_SPELL_0;
                playerData->merleeTurnCount = 0;
                playerData->merleeCastsLeft++;
            } else {
                battleStatus->battlePhase = PHASE_MERLEE_EXP_BONUS;
                script = start_script(&EVS_Mario_HandlePhase, EVT_PRIORITY_A, 0);
                player->takeTurnScript = script;
                player->takeTurnScriptID = script->id;
                script->owner1.actorID = ACTOR_PLAYER;
            }
        }
        gBattleSubState = BTL_SUBSTATE_VICTORY_AWAIT_MERLEE;
        D_8029F248 = 0;
        gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN;
    }

    if (gBattleSubState == BTL_SUBSTATE_VICTORY_AWAIT_MERLEE) {
        if (D_8029F248 != 0) {
            D_8029F248--;
        } else {
            if (player->takeTurnScript == NULL || !does_script_exist(player->takeTurnScriptID)) {
                player->takeTurnScript = NULL;
                if (battleStatus->nextMerleeSpellType != MERLEE_SPELL_EXP_BOOST) {
                    gBattleSubState = BTL_SUBSTATE_VICTORY_DONE;
                } else {
                    battleStatus->incrementStarPointDelay = 20;
                    battleStatus->nextMerleeSpellType = MERLEE_SPELL_0;
                    gBattleSubState = BTL_SUBSTATE_VICTORY_DONE;
                    battleStatus->pendingStarPoints = battleStatus->totalStarPoints
                                            + battleStatus->pendingStarPoints + battleStatus->pendingStarPoints;
                }
            }
        }
    }

    if (gBattleSubState == BTL_SUBSTATE_VICTORY_DONE) {
        if (battleStatus->pendingStarPoints <= 0) {
            if (gBattleStatus.flags1 & BS_FLAGS1_STAR_POINTS_DROPPED) {
                gBattleStatus.flags1 &= ~BS_FLAGS1_BATTLE_FLED;
            }
            if (playerData->battlesWon < 9999) {
                playerData->battlesWon++;
            }
            if (gBattleStatus.flags1 & BS_FLAGS1_BATTLE_FLED) {
                currentEncounter->battleOutcome = OUTCOME_ENEMY_FLED;
            } else {
                currentEncounter->battleOutcome = OUTCOME_PLAYER_WON;
            }
            if (gBattleStatus.flags1 & BS_FLAGS1_DISABLE_CELEBRATION) {
                if (!(gBattleStatus.flags2 & BS_FLAGS2_DONT_STOP_MUSIC)) {
                    bgm_set_song(0, -1, 0, 1500, 8);
                }
                btl_set_state(BATTLE_STATE_END_BATTLE);
            } else {
                btl_set_state(BATTLE_STATE_CELEBRATION);
            }
        }
    }
}