### RAW ASSEMBLY INSTRUCTIONS:

glabel func_80274A18
/* 1A32F8 80274A18 27BDFFB0 */  addiu     $sp, $sp, -0x50
/* 1A32FC 80274A1C AFB30024 */  sw        $s3, 0x24($sp)
/* 1A3300 80274A20 0080982D */  daddu     $s3, $a0, $zero
/* 1A3304 80274A24 AFB40028 */  sw        $s4, 0x28($sp)
/* 1A3308 80274A28 3C14800E */  lui       $s4, %hi(gBattleStatus)
/* 1A330C 80274A2C 2694C070 */  addiu     $s4, $s4, %lo(gBattleStatus)
/* 1A3310 80274A30 AFBF002C */  sw        $ra, 0x2C($sp)
/* 1A3314 80274A34 AFB20020 */  sw        $s2, 0x20($sp)
/* 1A3318 80274A38 AFB1001C */  sw        $s1, 0x1C($sp)
/* 1A331C 80274A3C AFB00018 */  sw        $s0, 0x18($sp)
/* 1A3320 80274A40 F7BA0048 */  sdc1      $f26, 0x48($sp)
/* 1A3324 80274A44 F7B80040 */  sdc1      $f24, 0x40($sp)
/* 1A3328 80274A48 F7B60038 */  sdc1      $f22, 0x38($sp)
/* 1A332C 80274A4C F7B40030 */  sdc1      $f20, 0x30($sp)
/* 1A3330 80274A50 8E9200D8 */  lw        $s2, 0xD8($s4)
/* 1A3334 80274A54 8E71000C */  lw        $s1, 0xC($s3)
/* 1A3338 80274A58 10A00010 */  beqz      $a1, .L80274A9C
/* 1A333C 80274A5C 2650000C */   addiu    $s0, $s2, 0xC
/* 1A3340 80274A60 8E250000 */  lw        $a1, 0x0($s1)
/* 1A3344 80274A64 0C0B1EAF */  jal       evt_get_variable
/* 1A3348 80274A68 26310004 */   addiu    $s1, $s1, 0x4
/* 1A334C 80274A6C A6420070 */  sh        $v0, 0x70($s2)
/* 1A3350 80274A70 8E250000 */  lw        $a1, 0x0($s1)
/* 1A3354 80274A74 0C0B1EAF */  jal       evt_get_variable
/* 1A3358 80274A78 0260202D */   daddu    $a0, $s3, $zero
/* 1A335C 80274A7C A6420072 */  sh        $v0, 0x72($s2)
/* 1A3360 80274A80 AE600074 */  sw        $zero, 0x74($s3)
/* 1A3364 80274A84 AE600070 */  sw        $zero, 0x70($s3)
/* 1A3368 80274A88 86430072 */  lh        $v1, 0x72($s2)
/* 1A336C 80274A8C 24020001 */  addiu     $v0, $zero, 0x1
/* 1A3370 80274A90 14620002 */  bne       $v1, $v0, .L80274A9C
/* 1A3374 80274A94 24020002 */   addiu    $v0, $zero, 0x2
/* 1A3378 80274A98 AE620070 */  sw        $v0, 0x70($s3)
.L80274A9C:
/* 1A337C 80274A9C 8E620070 */  lw        $v0, 0x70($s3)
/* 1A3380 80274AA0 144000FC */  bnez      $v0, .L80274E94
/* 1A3384 80274AA4 00000000 */   nop
/* 1A3388 80274AA8 C6400144 */  lwc1      $f0, 0x144($s2)
/* 1A338C 80274AAC C618000C */  lwc1      $f24, 0xC($s0)
/* 1A3390 80274AB0 C61A0014 */  lwc1      $f26, 0x14($s0)
/* 1A3394 80274AB4 E6000000 */  swc1      $f0, 0x0($s0)
/* 1A3398 80274AB8 C6400148 */  lwc1      $f0, 0x148($s2)
/* 1A339C 80274ABC 4406C000 */  mfc1      $a2, $f24
/* 1A33A0 80274AC0 4407D000 */  mfc1      $a3, $f26
/* 1A33A4 80274AC4 C6160000 */  lwc1      $f22, 0x0($s0)
/* 1A33A8 80274AC8 E6000004 */  swc1      $f0, 0x4($s0)
/* 1A33AC 80274ACC C654014C */  lwc1      $f20, 0x14C($s2)
/* 1A33B0 80274AD0 4600B306 */  mov.s     $f12, $f22
/* 1A33B4 80274AD4 4600A386 */  mov.s     $f14, $f20
/* 1A33B8 80274AD8 0C00A720 */  jal       atan2
/* 1A33BC 80274ADC E6140008 */   swc1     $f20, 0x8($s0)
/* 1A33C0 80274AE0 4600B306 */  mov.s     $f12, $f22
/* 1A33C4 80274AE4 4406C000 */  mfc1      $a2, $f24
/* 1A33C8 80274AE8 4407D000 */  mfc1      $a3, $f26
/* 1A33CC 80274AEC 4600A386 */  mov.s     $f14, $f20
/* 1A33D0 80274AF0 0C00A7B5 */  jal       dist2D
/* 1A33D4 80274AF4 E6000048 */   swc1     $f0, 0x48($s0)
/* 1A33D8 80274AF8 86020064 */  lh        $v0, 0x64($s0)
/* 1A33DC 80274AFC 46000106 */  mov.s     $f4, $f0
/* 1A33E0 80274B00 14400012 */  bnez      $v0, .L80274B4C
/* 1A33E4 80274B04 E604004C */   swc1     $f4, 0x4C($s0)
/* 1A33E8 80274B08 C6000040 */  lwc1      $f0, 0x40($s0)
/* 1A33EC 80274B0C C6020040 */  lwc1      $f2, 0x40($s0)
/* 1A33F0 80274B10 46002003 */  div.s     $f0, $f4, $f0
/* 1A33F4 80274B14 4600028D */  trunc.w.s $f10, $f0
/* 1A33F8 80274B18 44035000 */  mfc1      $v1, $f10
/* 1A33FC 80274B1C 00000000 */  nop
/* 1A3400 80274B20 00031400 */  sll       $v0, $v1, 16
/* 1A3404 80274B24 00021403 */  sra       $v0, $v0, 16
/* 1A3408 80274B28 44820000 */  mtc1      $v0, $f0
/* 1A340C 80274B2C 00000000 */  nop
/* 1A3410 80274B30 46800020 */  cvt.s.w   $f0, $f0
/* 1A3414 80274B34 46020002 */  mul.s     $f0, $f0, $f2
/* 1A3418 80274B38 00000000 */  nop
/* 1A341C 80274B3C 46002086 */  mov.s     $f2, $f4
/* 1A3420 80274B40 A6030064 */  sh        $v1, 0x64($s0)
/* 1A3424 80274B44 0809D2E0 */  j         .L80274B80
/* 1A3428 80274B48 46001201 */   sub.s    $f8, $f2, $f0
.L80274B4C:
/* 1A342C 80274B4C 44821000 */  mtc1      $v0, $f2
/* 1A3430 80274B50 00000000 */  nop
/* 1A3434 80274B54 468010A0 */  cvt.s.w   $f2, $f2
/* 1A3438 80274B58 86020064 */  lh        $v0, 0x64($s0)
/* 1A343C 80274B5C 46022083 */  div.s     $f2, $f4, $f2
/* 1A3440 80274B60 44820000 */  mtc1      $v0, $f0
/* 1A3444 80274B64 00000000 */  nop
/* 1A3448 80274B68 46800020 */  cvt.s.w   $f0, $f0
/* 1A344C 80274B6C 46020002 */  mul.s     $f0, $f0, $f2
/* 1A3450 80274B70 00000000 */  nop
/* 1A3454 80274B74 C604004C */  lwc1      $f4, 0x4C($s0)
/* 1A3458 80274B78 E6020040 */  swc1      $f2, 0x40($s0)
/* 1A345C 80274B7C 46002201 */  sub.s     $f8, $f4, $f0
.L80274B80:
/* 1A3460 80274B80 86030064 */  lh        $v1, 0x64($s0)
/* 1A3464 80274B84 106001BD */  beqz      $v1, .L8027527C
/* 1A3468 80274B88 24020002 */   addiu    $v0, $zero, 0x2
/* 1A346C 80274B8C 86020064 */  lh        $v0, 0x64($s0)
/* 1A3470 80274B90 C602000C */  lwc1      $f2, 0xC($s0)
/* 1A3474 80274B94 3C014049 */  lui       $at, (0x40490FD0 >> 16)
/* 1A3478 80274B98 34210FD0 */  ori       $at, $at, (0x40490FD0 & 0xFFFF)
/* 1A347C 80274B9C 44810000 */  mtc1      $at, $f0
/* 1A3480 80274BA0 C6040000 */  lwc1      $f4, 0x0($s0)
/* 1A3484 80274BA4 44823000 */  mtc1      $v0, $f6
/* 1A3488 80274BA8 00000000 */  nop
/* 1A348C 80274BAC 468031A0 */  cvt.s.w   $f6, $f6
/* 1A3490 80274BB0 46060003 */  div.s     $f0, $f0, $f6
/* 1A3494 80274BB4 46041081 */  sub.s     $f2, $f2, $f4
/* 1A3498 80274BB8 E600003C */  swc1      $f0, 0x3C($s0)
/* 1A349C 80274BBC 44830000 */  mtc1      $v1, $f0
/* 1A34A0 80274BC0 00000000 */  nop
/* 1A34A4 80274BC4 46800020 */  cvt.s.w   $f0, $f0
/* 1A34A8 80274BC8 46001083 */  div.s     $f2, $f2, $f0
/* 1A34AC 80274BCC C6000010 */  lwc1      $f0, 0x10($s0)
/* 1A34B0 80274BD0 E6020030 */  swc1      $f2, 0x30($s0)
/* 1A34B4 80274BD4 C6020004 */  lwc1      $f2, 0x4($s0)
/* 1A34B8 80274BD8 AE000044 */  sw        $zero, 0x44($s0)
/* 1A34BC 80274BDC 46020001 */  sub.s     $f0, $f0, $f2
/* 1A34C0 80274BE0 C6040014 */  lwc1      $f4, 0x14($s0)
/* 1A34C4 80274BE4 46003086 */  mov.s     $f2, $f6
/* 1A34C8 80274BE8 46020003 */  div.s     $f0, $f0, $f2
/* 1A34CC 80274BEC E6000034 */  swc1      $f0, 0x34($s0)
/* 1A34D0 80274BF0 46003006 */  mov.s     $f0, $f6
/* 1A34D4 80274BF4 46004003 */  div.s     $f0, $f8, $f0
/* 1A34D8 80274BF8 C6020008 */  lwc1      $f2, 0x8($s0)
/* 1A34DC 80274BFC 86020066 */  lh        $v0, 0x66($s0)
/* 1A34E0 80274C00 46022101 */  sub.s     $f4, $f4, $f2
/* 1A34E4 80274C04 C6020040 */  lwc1      $f2, 0x40($s0)
/* 1A34E8 80274C08 28420003 */  slti      $v0, $v0, 0x3
/* 1A34EC 80274C0C 46001080 */  add.s     $f2, $f2, $f0
/* 1A34F0 80274C10 46062103 */  div.s     $f4, $f4, $f6
/* 1A34F4 80274C14 E6040038 */  swc1      $f4, 0x38($s0)
/* 1A34F8 80274C18 10400045 */  beqz      $v0, .L80274D30
/* 1A34FC 80274C1C E6020040 */   swc1     $f2, 0x40($s0)
/* 1A3500 80274C20 86020064 */  lh        $v0, 0x64($s0)
/* 1A3504 80274C24 24030168 */  addiu     $v1, $zero, 0x168
/* 1A3508 80274C28 14400002 */  bnez      $v0, .L80274C34
/* 1A350C 80274C2C 0062001A */   div      $zero, $v1, $v0
/* 1A3510 80274C30 0007000D */  break     7
.L80274C34:
/* 1A3514 80274C34 2401FFFF */  addiu     $at, $zero, -0x1
/* 1A3518 80274C38 14410004 */  bne       $v0, $at, .L80274C4C
/* 1A351C 80274C3C 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 1A3520 80274C40 14610002 */  bne       $v1, $at, .L80274C4C
/* 1A3524 80274C44 00000000 */   nop
/* 1A3528 80274C48 0006000D */  break     6
.L80274C4C:
/* 1A352C 80274C4C 00001812 */  mflo      $v1
/* 1A3530 80274C50 C608004C */  lwc1      $f8, 0x4C($s0)
/* 1A3534 80274C54 3C014034 */  lui       $at, (0x40340000 >> 16)
/* 1A3538 80274C58 44811800 */  mtc1      $at, $f3
/* 1A353C 80274C5C 44801000 */  mtc1      $zero, $f2
/* 1A3540 80274C60 46004021 */  cvt.d.s   $f0, $f8
/* 1A3544 80274C64 46220001 */  sub.d     $f0, $f0, $f2
/* 1A3548 80274C68 3C014018 */  lui       $at, (0x40180000 >> 16)
/* 1A354C 80274C6C 44811800 */  mtc1      $at, $f3
/* 1A3550 80274C70 44801000 */  mtc1      $zero, $f2
/* 1A3554 80274C74 46200220 */  cvt.s.d   $f8, $f0
/* 1A3558 80274C78 46004021 */  cvt.d.s   $f0, $f8
/* 1A355C 80274C7C 46220003 */  div.d     $f0, $f0, $f2
/* 1A3560 80274C80 46200220 */  cvt.s.d   $f8, $f0
/* 1A3564 80274C84 3C01802A */  lui       $at, %hi(D_8029D8A0)
/* 1A3568 80274C88 D422D8A0 */  ldc1      $f2, %lo(D_8029D8A0)($at)
/* 1A356C 80274C8C 46004021 */  cvt.d.s   $f0, $f8
/* 1A3570 80274C90 46220000 */  add.d     $f0, $f0, $f2
/* 1A3574 80274C94 3C0142B4 */  lui       $at, (0x42B40000 >> 16)
/* 1A3578 80274C98 44811000 */  mtc1      $at, $f2
/* 1A357C 80274C9C 46200220 */  cvt.s.d   $f8, $f0
/* 1A3580 80274CA0 44830000 */  mtc1      $v1, $f0
/* 1A3584 80274CA4 00000000 */  nop
/* 1A3588 80274CA8 46800020 */  cvt.s.w   $f0, $f0
/* 1A358C 80274CAC 86030066 */  lh        $v1, 0x66($s0)
/* 1A3590 80274CB0 24020002 */  addiu     $v0, $zero, 0x2
/* 1A3594 80274CB4 E6020024 */  swc1      $f2, 0x24($s0)
/* 1A3598 80274CB8 E6080050 */  swc1      $f8, 0x50($s0)
/* 1A359C 80274CBC 14620008 */  bne       $v1, $v0, .L80274CE0
/* 1A35A0 80274CC0 E6000028 */   swc1     $f0, 0x28($s0)
/* 1A35A4 80274CC4 3C01802A */  lui       $at, %hi(D_8029D8A8)
/* 1A35A8 80274CC8 D422D8A8 */  ldc1      $f2, %lo(D_8029D8A8)($at)
/* 1A35AC 80274CCC 46004021 */  cvt.d.s   $f0, $f8
/* 1A35B0 80274CD0 46220002 */  mul.d     $f0, $f0, $f2
/* 1A35B4 80274CD4 00000000 */  nop
/* 1A35B8 80274CD8 46200020 */  cvt.s.d   $f0, $f0
/* 1A35BC 80274CDC E6000050 */  swc1      $f0, 0x50($s0)
.L80274CE0:
/* 1A35C0 80274CE0 C60C0024 */  lwc1      $f12, 0x24($s0)
/* 1A35C4 80274CE4 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 1A35C8 80274CE8 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 1A35CC 80274CEC 44810000 */  mtc1      $at, $f0
/* 1A35D0 80274CF0 C6140044 */  lwc1      $f20, 0x44($s0)
/* 1A35D4 80274CF4 C616003C */  lwc1      $f22, 0x3C($s0)
/* 1A35D8 80274CF8 AE000018 */  sw        $zero, 0x18($s0)
/* 1A35DC 80274CFC 46006302 */  mul.s     $f12, $f12, $f0
/* 1A35E0 80274D00 00000000 */  nop
/* 1A35E4 80274D04 AE00001C */  sw        $zero, 0x1C($s0)
/* 1A35E8 80274D08 4600A521 */  cvt.d.s   $f20, $f20
/* 1A35EC 80274D0C 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 1A35F0 80274D10 44810000 */  mtc1      $at, $f0
/* 1A35F4 80274D14 4600B5A1 */  cvt.d.s   $f22, $f22
/* 1A35F8 80274D18 0C00A85B */  jal       sin_rad
/* 1A35FC 80274D1C 46006303 */   div.s    $f12, $f12, $f0
/* 1A3600 80274D20 3C01802A */  lui       $at, %hi(D_8029D8B0)
/* 1A3604 80274D24 D422D8B0 */  ldc1      $f2, %lo(D_8029D8B0)($at)
/* 1A3608 80274D28 0809D390 */  j         .L80274E40
/* 1A360C 80274D2C 46000021 */   cvt.d.s  $f0, $f0
.L80274D30:
/* 1A3610 80274D30 86020064 */  lh        $v0, 0x64($s0)
/* 1A3614 80274D34 24030168 */  addiu     $v1, $zero, 0x168
/* 1A3618 80274D38 14400002 */  bnez      $v0, .L80274D44
/* 1A361C 80274D3C 0062001A */   div      $zero, $v1, $v0
/* 1A3620 80274D40 0007000D */  break     7
.L80274D44:
/* 1A3624 80274D44 2401FFFF */  addiu     $at, $zero, -0x1
/* 1A3628 80274D48 14410004 */  bne       $v0, $at, .L80274D5C
/* 1A362C 80274D4C 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 1A3630 80274D50 14610002 */  bne       $v1, $at, .L80274D5C
/* 1A3634 80274D54 00000000 */   nop
/* 1A3638 80274D58 0006000D */  break     6
.L80274D5C:
/* 1A363C 80274D5C 00001812 */  mflo      $v1
/* 1A3640 80274D60 C608004C */  lwc1      $f8, 0x4C($s0)
/* 1A3644 80274D64 3C014034 */  lui       $at, (0x40340000 >> 16)
/* 1A3648 80274D68 44811800 */  mtc1      $at, $f3
/* 1A364C 80274D6C 44801000 */  mtc1      $zero, $f2
/* 1A3650 80274D70 46004021 */  cvt.d.s   $f0, $f8
/* 1A3654 80274D74 46220001 */  sub.d     $f0, $f0, $f2
/* 1A3658 80274D78 3C014018 */  lui       $at, (0x40180000 >> 16)
/* 1A365C 80274D7C 44811800 */  mtc1      $at, $f3
/* 1A3660 80274D80 44801000 */  mtc1      $zero, $f2
/* 1A3664 80274D84 46200220 */  cvt.s.d   $f8, $f0
/* 1A3668 80274D88 46004021 */  cvt.d.s   $f0, $f8
/* 1A366C 80274D8C 46220003 */  div.d     $f0, $f0, $f2
/* 1A3670 80274D90 46200220 */  cvt.s.d   $f8, $f0
/* 1A3674 80274D94 3C01802A */  lui       $at, %hi(D_8029D8B8)
/* 1A3678 80274D98 D422D8B8 */  ldc1      $f2, %lo(D_8029D8B8)($at)
/* 1A367C 80274D9C 46004021 */  cvt.d.s   $f0, $f8
/* 1A3680 80274DA0 46220000 */  add.d     $f0, $f0, $f2
/* 1A3684 80274DA4 3C0142B4 */  lui       $at, (0x42B40000 >> 16)
/* 1A3688 80274DA8 44811000 */  mtc1      $at, $f2
/* 1A368C 80274DAC 46200220 */  cvt.s.d   $f8, $f0
/* 1A3690 80274DB0 44830000 */  mtc1      $v1, $f0
/* 1A3694 80274DB4 00000000 */  nop
/* 1A3698 80274DB8 46800020 */  cvt.s.w   $f0, $f0
/* 1A369C 80274DBC 86030066 */  lh        $v1, 0x66($s0)
/* 1A36A0 80274DC0 24020004 */  addiu     $v0, $zero, 0x4
/* 1A36A4 80274DC4 E6020024 */  swc1      $f2, 0x24($s0)
/* 1A36A8 80274DC8 E6080050 */  swc1      $f8, 0x50($s0)
/* 1A36AC 80274DCC 14620009 */  bne       $v1, $v0, .L80274DF4
/* 1A36B0 80274DD0 E6000028 */   swc1     $f0, 0x28($s0)
/* 1A36B4 80274DD4 3C013FF4 */  lui       $at, (0x3FF40000 >> 16)
/* 1A36B8 80274DD8 44811800 */  mtc1      $at, $f3
/* 1A36BC 80274DDC 44801000 */  mtc1      $zero, $f2
/* 1A36C0 80274DE0 46004021 */  cvt.d.s   $f0, $f8
/* 1A36C4 80274DE4 46220002 */  mul.d     $f0, $f0, $f2
/* 1A36C8 80274DE8 00000000 */  nop
/* 1A36CC 80274DEC 46200020 */  cvt.s.d   $f0, $f0
/* 1A36D0 80274DF0 E6000050 */  swc1      $f0, 0x50($s0)
.L80274DF4:
/* 1A36D4 80274DF4 C60C0024 */  lwc1      $f12, 0x24($s0)
/* 1A36D8 80274DF8 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 1A36DC 80274DFC 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 1A36E0 80274E00 44810000 */  mtc1      $at, $f0
/* 1A36E4 80274E04 C6140044 */  lwc1      $f20, 0x44($s0)
/* 1A36E8 80274E08 C616003C */  lwc1      $f22, 0x3C($s0)
/* 1A36EC 80274E0C AE000018 */  sw        $zero, 0x18($s0)
/* 1A36F0 80274E10 46006302 */  mul.s     $f12, $f12, $f0
/* 1A36F4 80274E14 00000000 */  nop
/* 1A36F8 80274E18 AE00001C */  sw        $zero, 0x1C($s0)
/* 1A36FC 80274E1C 4600A521 */  cvt.d.s   $f20, $f20
/* 1A3700 80274E20 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 1A3704 80274E24 44810000 */  mtc1      $at, $f0
/* 1A3708 80274E28 4600B5A1 */  cvt.d.s   $f22, $f22
/* 1A370C 80274E2C 0C00A85B */  jal       sin_rad
/* 1A3710 80274E30 46006303 */   div.s    $f12, $f12, $f0
/* 1A3714 80274E34 3C01802A */  lui       $at, %hi(D_8029D8C0)
/* 1A3718 80274E38 D422D8C0 */  ldc1      $f2, %lo(D_8029D8C0)($at)
/* 1A371C 80274E3C 46000021 */  cvt.d.s   $f0, $f0
.L80274E40:
/* 1A3720 80274E40 46220002 */  mul.d     $f0, $f0, $f2
/* 1A3724 80274E44 00000000 */  nop
/* 1A3728 80274E48 46360002 */  mul.d     $f0, $f0, $f22
/* 1A372C 80274E4C 00000000 */  nop
/* 1A3730 80274E50 46360000 */  add.d     $f0, $f0, $f22
/* 1A3734 80274E54 4620A500 */  add.d     $f20, $f20, $f0
/* 1A3738 80274E58 4620A520 */  cvt.s.d   $f20, $f20
/* 1A373C 80274E5C E6140044 */  swc1      $f20, 0x44($s0)
/* 1A3740 80274E60 0000202D */  daddu     $a0, $zero, $zero
/* 1A3744 80274E64 8E060058 */  lw        $a2, 0x58($s0)
/* 1A3748 80274E68 0C098F3F */  jal       set_animation
/* 1A374C 80274E6C 0080282D */   daddu    $a1, $a0, $zero
/* 1A3750 80274E70 C640014C */  lwc1      $f0, 0x14C($s2)
/* 1A3754 80274E74 24040160 */  addiu     $a0, $zero, 0x160
/* 1A3758 80274E78 E7A00010 */  swc1      $f0, 0x10($sp)
/* 1A375C 80274E7C 8E460144 */  lw        $a2, 0x144($s2)
/* 1A3760 80274E80 8E470148 */  lw        $a3, 0x148($s2)
/* 1A3764 80274E84 0C052757 */  jal       sfx_play_sound_at_position
/* 1A3768 80274E88 0000282D */   daddu    $a1, $zero, $zero
/* 1A376C 80274E8C 24020001 */  addiu     $v0, $zero, 0x1
/* 1A3770 80274E90 AE620070 */  sw        $v0, 0x70($s3)
.L80274E94:
/* 1A3774 80274E94 8E630070 */  lw        $v1, 0x70($s3)
/* 1A3778 80274E98 24020002 */  addiu     $v0, $zero, 0x2
/* 1A377C 80274E9C 10620089 */  beq       $v1, $v0, .L802750C4
/* 1A3780 80274EA0 28620003 */   slti     $v0, $v1, 0x3
/* 1A3784 80274EA4 10400005 */  beqz      $v0, .L80274EBC
/* 1A3788 80274EA8 24020001 */   addiu    $v0, $zero, 0x1
/* 1A378C 80274EAC 10620008 */  beq       $v1, $v0, .L80274ED0
/* 1A3790 80274EB0 0000102D */   daddu    $v0, $zero, $zero
/* 1A3794 80274EB4 0809D49F */  j         .L8027527C
/* 1A3798 80274EB8 00000000 */   nop
.L80274EBC:
/* 1A379C 80274EBC 24020003 */  addiu     $v0, $zero, 0x3
/* 1A37A0 80274EC0 106200B2 */  beq       $v1, $v0, .L8027518C
/* 1A37A4 80274EC4 0000102D */   daddu    $v0, $zero, $zero
/* 1A37A8 80274EC8 0809D49F */  j         .L8027527C
/* 1A37AC 80274ECC 00000000 */   nop
.L80274ED0:
/* 1A37B0 80274ED0 C6020044 */  lwc1      $f2, 0x44($s0)
/* 1A37B4 80274ED4 3C013FC9 */  lui       $at, (0x3FC90FD0 >> 16)
/* 1A37B8 80274ED8 34210FD0 */  ori       $at, $at, (0x3FC90FD0 & 0xFFFF)
/* 1A37BC 80274EDC 44810000 */  mtc1      $at, $f0
/* 1A37C0 80274EE0 00000000 */  nop
/* 1A37C4 80274EE4 4602003C */  c.lt.s    $f0, $f2
/* 1A37C8 80274EE8 00000000 */  nop
/* 1A37CC 80274EEC 45000004 */  bc1f      .L80274F00
/* 1A37D0 80274EF0 0000202D */   daddu    $a0, $zero, $zero
/* 1A37D4 80274EF4 8E06005C */  lw        $a2, 0x5C($s0)
/* 1A37D8 80274EF8 0C098F3F */  jal       set_animation
/* 1A37DC 80274EFC 0080282D */   daddu    $a1, $a0, $zero
.L80274F00:
/* 1A37E0 80274F00 C6060000 */  lwc1      $f6, 0x0($s0)
/* 1A37E4 80274F04 C6000030 */  lwc1      $f0, 0x30($s0)
/* 1A37E8 80274F08 C6040004 */  lwc1      $f4, 0x4($s0)
/* 1A37EC 80274F0C 46003180 */  add.s     $f6, $f6, $f0
/* 1A37F0 80274F10 C6000034 */  lwc1      $f0, 0x34($s0)
/* 1A37F4 80274F14 C6020008 */  lwc1      $f2, 0x8($s0)
/* 1A37F8 80274F18 46002100 */  add.s     $f4, $f4, $f0
/* 1A37FC 80274F1C C6000038 */  lwc1      $f0, 0x38($s0)
/* 1A3800 80274F20 46001080 */  add.s     $f2, $f2, $f0
/* 1A3804 80274F24 E6060000 */  swc1      $f6, 0x0($s0)
/* 1A3808 80274F28 E6040004 */  swc1      $f4, 0x4($s0)
/* 1A380C 80274F2C E6020008 */  swc1      $f2, 0x8($s0)
/* 1A3810 80274F30 C6400148 */  lwc1      $f0, 0x148($s2)
/* 1A3814 80274F34 46003086 */  mov.s     $f2, $f6
/* 1A3818 80274F38 E6000018 */  swc1      $f0, 0x18($s0)
/* 1A381C 80274F3C E6420144 */  swc1      $f2, 0x144($s2)
/* 1A3820 80274F40 0C00A85B */  jal       sin_rad
/* 1A3824 80274F44 C60C0044 */   lwc1     $f12, 0x44($s0)
/* 1A3828 80274F48 C6020050 */  lwc1      $f2, 0x50($s0)
/* 1A382C 80274F4C 46001082 */  mul.s     $f2, $f2, $f0
/* 1A3830 80274F50 00000000 */  nop
/* 1A3834 80274F54 C6000004 */  lwc1      $f0, 0x4($s0)
/* 1A3838 80274F58 46020000 */  add.s     $f0, $f0, $f2
/* 1A383C 80274F5C E6400148 */  swc1      $f0, 0x148($s2)
/* 1A3840 80274F60 C6000008 */  lwc1      $f0, 0x8($s0)
/* 1A3844 80274F64 E640014C */  swc1      $f0, 0x14C($s2)
/* 1A3848 80274F68 C6020010 */  lwc1      $f2, 0x10($s0)
/* 1A384C 80274F6C C6400148 */  lwc1      $f0, 0x148($s2)
/* 1A3850 80274F70 4602003C */  c.lt.s    $f0, $f2
/* 1A3854 80274F74 00000000 */  nop
/* 1A3858 80274F78 45000005 */  bc1f      .L80274F90
/* 1A385C 80274F7C 00000000 */   nop
/* 1A3860 80274F80 86020064 */  lh        $v0, 0x64($s0)
/* 1A3864 80274F84 28420003 */  slti      $v0, $v0, 0x3
/* 1A3868 80274F88 54400001 */  bnel      $v0, $zero, .L80274F90
/* 1A386C 80274F8C E6420148 */   swc1     $f2, 0x148($s2)
.L80274F90:
/* 1A3870 80274F90 86020066 */  lh        $v0, 0x66($s0)
/* 1A3874 80274F94 C6400148 */  lwc1      $f0, 0x148($s2)
/* 1A3878 80274F98 28420003 */  slti      $v0, $v0, 0x3
/* 1A387C 80274F9C 10400013 */  beqz      $v0, .L80274FEC
/* 1A3880 80274FA0 E600001C */   swc1     $f0, 0x1C($s0)
/* 1A3884 80274FA4 C60C0024 */  lwc1      $f12, 0x24($s0)
/* 1A3888 80274FA8 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 1A388C 80274FAC 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 1A3890 80274FB0 44810000 */  mtc1      $at, $f0
/* 1A3894 80274FB4 C6140044 */  lwc1      $f20, 0x44($s0)
/* 1A3898 80274FB8 46006302 */  mul.s     $f12, $f12, $f0
/* 1A389C 80274FBC 00000000 */  nop
/* 1A38A0 80274FC0 C616003C */  lwc1      $f22, 0x3C($s0)
/* 1A38A4 80274FC4 4600A521 */  cvt.d.s   $f20, $f20
/* 1A38A8 80274FC8 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 1A38AC 80274FCC 44810000 */  mtc1      $at, $f0
/* 1A38B0 80274FD0 4600B5A1 */  cvt.d.s   $f22, $f22
/* 1A38B4 80274FD4 0C00A85B */  jal       sin_rad
/* 1A38B8 80274FD8 46006303 */   div.s    $f12, $f12, $f0
/* 1A38BC 80274FDC 3C01802A */  lui       $at, %hi(D_8029D8C8)
/* 1A38C0 80274FE0 D422D8C8 */  ldc1      $f2, %lo(D_8029D8C8)($at)
/* 1A38C4 80274FE4 0809D40C */  j         .L80275030
/* 1A38C8 80274FE8 46000021 */   cvt.d.s  $f0, $f0
.L80274FEC:
/* 1A38CC 80274FEC C60C0024 */  lwc1      $f12, 0x24($s0)
/* 1A38D0 80274FF0 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 1A38D4 80274FF4 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 1A38D8 80274FF8 44810000 */  mtc1      $at, $f0
/* 1A38DC 80274FFC C6140044 */  lwc1      $f20, 0x44($s0)
/* 1A38E0 80275000 46006302 */  mul.s     $f12, $f12, $f0
/* 1A38E4 80275004 00000000 */  nop
/* 1A38E8 80275008 C616003C */  lwc1      $f22, 0x3C($s0)
/* 1A38EC 8027500C 4600A521 */  cvt.d.s   $f20, $f20
/* 1A38F0 80275010 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 1A38F4 80275014 44810000 */  mtc1      $at, $f0
/* 1A38F8 80275018 4600B5A1 */  cvt.d.s   $f22, $f22
/* 1A38FC 8027501C 0C00A85B */  jal       sin_rad
/* 1A3900 80275020 46006303 */   div.s    $f12, $f12, $f0
/* 1A3904 80275024 3C01802A */  lui       $at, %hi(D_8029D8D0)
/* 1A3908 80275028 D422D8D0 */  ldc1      $f2, %lo(D_8029D8D0)($at)
/* 1A390C 8027502C 46000021 */  cvt.d.s   $f0, $f0
.L80275030:
/* 1A3910 80275030 46220002 */  mul.d     $f0, $f0, $f2
/* 1A3914 80275034 00000000 */  nop
/* 1A3918 80275038 46360002 */  mul.d     $f0, $f0, $f22
/* 1A391C 8027503C 00000000 */  nop
/* 1A3920 80275040 46360000 */  add.d     $f0, $f0, $f22
/* 1A3924 80275044 4620A500 */  add.d     $f20, $f20, $f0
/* 1A3928 80275048 4620A520 */  cvt.s.d   $f20, $f20
/* 1A392C 8027504C E6140044 */  swc1      $f20, 0x44($s0)
/* 1A3930 80275050 C60C0024 */  lwc1      $f12, 0x24($s0)
/* 1A3934 80275054 C6000028 */  lwc1      $f0, 0x28($s0)
/* 1A3938 80275058 46006300 */  add.s     $f12, $f12, $f0
/* 1A393C 8027505C 0C00A6C9 */  jal       clamp_angle
/* 1A3940 80275060 E60C0024 */   swc1     $f12, 0x24($s0)
/* 1A3944 80275064 96020064 */  lhu       $v0, 0x64($s0)
/* 1A3948 80275068 E6000024 */  swc1      $f0, 0x24($s0)
/* 1A394C 8027506C 2442FFFF */  addiu     $v0, $v0, -0x1
/* 1A3950 80275070 A6020064 */  sh        $v0, 0x64($s0)
/* 1A3954 80275074 00021400 */  sll       $v0, $v0, 16
/* 1A3958 80275078 14400080 */  bnez      $v0, .L8027527C
/* 1A395C 8027507C 0000102D */   daddu    $v0, $zero, $zero
/* 1A3960 80275080 C6000010 */  lwc1      $f0, 0x10($s0)
/* 1A3964 80275084 0000202D */  daddu     $a0, $zero, $zero
/* 1A3968 80275088 E6400148 */  swc1      $f0, 0x148($s2)
/* 1A396C 8027508C C6000018 */  lwc1      $f0, 0x18($s0)
/* 1A3970 80275090 C602001C */  lwc1      $f2, 0x1C($s0)
/* 1A3974 80275094 8E060060 */  lw        $a2, 0x60($s0)
/* 1A3978 80275098 46020001 */  sub.s     $f0, $f0, $f2
/* 1A397C 8027509C 3C013FE6 */  lui       $at, (0x3FE66666 >> 16)
/* 1A3980 802750A0 34216666 */  ori       $at, $at, (0x3FE66666 & 0xFFFF)
/* 1A3984 802750A4 44811000 */  mtc1      $at, $f2
/* 1A3988 802750A8 0080282D */  daddu     $a1, $a0, $zero
/* 1A398C 802750AC E602003C */  swc1      $f2, 0x3C($s0)
/* 1A3990 802750B0 46000007 */  neg.s     $f0, $f0
/* 1A3994 802750B4 0C098F3F */  jal       set_animation
/* 1A3998 802750B8 E6000044 */   swc1     $f0, 0x44($s0)
/* 1A399C 802750BC 0809D49F */  j         .L8027527C
/* 1A39A0 802750C0 24020001 */   addiu    $v0, $zero, 0x1
.L802750C4:
/* 1A39A4 802750C4 82820083 */  lb        $v0, 0x83($s4)
/* 1A39A8 802750C8 10400063 */  beqz      $v0, .L80275258
/* 1A39AC 802750CC 24020001 */   addiu    $v0, $zero, 0x1
/* 1A39B0 802750D0 A6020064 */  sh        $v0, 0x64($s0)
/* 1A39B4 802750D4 86020064 */  lh        $v0, 0x64($s0)
/* 1A39B8 802750D8 24030168 */  addiu     $v1, $zero, 0x168
/* 1A39BC 802750DC 14400002 */  bnez      $v0, .L802750E8
/* 1A39C0 802750E0 0062001A */   div      $zero, $v1, $v0
/* 1A39C4 802750E4 0007000D */  break     7
.L802750E8:
/* 1A39C8 802750E8 2401FFFF */  addiu     $at, $zero, -0x1
/* 1A39CC 802750EC 14410004 */  bne       $v0, $at, .L80275100
/* 1A39D0 802750F0 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 1A39D4 802750F4 14610002 */  bne       $v1, $at, .L80275100
/* 1A39D8 802750F8 00000000 */   nop
/* 1A39DC 802750FC 0006000D */  break     6
.L80275100:
/* 1A39E0 80275100 00001812 */  mflo      $v1
/* 1A39E4 80275104 C6020018 */  lwc1      $f2, 0x18($s0)
/* 1A39E8 80275108 C600001C */  lwc1      $f0, 0x1C($s0)
/* 1A39EC 8027510C 3C013FE6 */  lui       $at, (0x3FE66666 >> 16)
/* 1A39F0 80275110 34216666 */  ori       $at, $at, (0x3FE66666 & 0xFFFF)
/* 1A39F4 80275114 44814000 */  mtc1      $at, $f8
/* 1A39F8 80275118 C604001C */  lwc1      $f4, 0x1C($s0)
/* 1A39FC 8027511C 46001081 */  sub.s     $f2, $f2, $f0
/* 1A3A00 80275120 C6000018 */  lwc1      $f0, 0x18($s0)
/* 1A3A04 80275124 3C0142B4 */  lui       $at, (0x42B40000 >> 16)
/* 1A3A08 80275128 44813000 */  mtc1      $at, $f6
/* 1A3A0C 8027512C 46040001 */  sub.s     $f0, $f0, $f4
/* 1A3A10 80275130 E608003C */  swc1      $f8, 0x3C($s0)
/* 1A3A14 80275134 E6060024 */  swc1      $f6, 0x24($s0)
/* 1A3A18 80275138 46001087 */  neg.s     $f2, $f2
/* 1A3A1C 8027513C E6020044 */  swc1      $f2, 0x44($s0)
/* 1A3A20 80275140 3C01802A */  lui       $at, %hi(D_8029D8D8)
/* 1A3A24 80275144 D422D8D8 */  ldc1      $f2, %lo(D_8029D8D8)($at)
/* 1A3A28 80275148 46000005 */  abs.s     $f0, $f0
/* 1A3A2C 8027514C 46000021 */  cvt.d.s   $f0, $f0
/* 1A3A30 80275150 46220003 */  div.d     $f0, $f0, $f2
/* 1A3A34 80275154 46200020 */  cvt.s.d   $f0, $f0
/* 1A3A38 80275158 E6000050 */  swc1      $f0, 0x50($s0)
/* 1A3A3C 8027515C 44830000 */  mtc1      $v1, $f0
/* 1A3A40 80275160 00000000 */  nop
/* 1A3A44 80275164 46800020 */  cvt.s.w   $f0, $f0
/* 1A3A48 80275168 E6000028 */  swc1      $f0, 0x28($s0)
/* 1A3A4C 8027516C C6400144 */  lwc1      $f0, 0x144($s2)
/* 1A3A50 80275170 E6000000 */  swc1      $f0, 0x0($s0)
/* 1A3A54 80275174 C6400148 */  lwc1      $f0, 0x148($s2)
/* 1A3A58 80275178 E6000004 */  swc1      $f0, 0x4($s0)
/* 1A3A5C 8027517C C640014C */  lwc1      $f0, 0x14C($s2)
/* 1A3A60 80275180 24020003 */  addiu     $v0, $zero, 0x3
/* 1A3A64 80275184 E6000008 */  swc1      $f0, 0x8($s0)
/* 1A3A68 80275188 AE620070 */  sw        $v0, 0x70($s3)
.L8027518C:
/* 1A3A6C 8027518C C60C0024 */  lwc1      $f12, 0x24($s0)
/* 1A3A70 80275190 3C0140C9 */  lui       $at, (0x40C90FD0 >> 16)
/* 1A3A74 80275194 34210FD0 */  ori       $at, $at, (0x40C90FD0 & 0xFFFF)
/* 1A3A78 80275198 4481B000 */  mtc1      $at, $f22
/* 1A3A7C 8027519C 00000000 */  nop
/* 1A3A80 802751A0 46166302 */  mul.s     $f12, $f12, $f22
/* 1A3A84 802751A4 00000000 */  nop
/* 1A3A88 802751A8 C6140000 */  lwc1      $f20, 0x0($s0)
/* 1A3A8C 802751AC 3C0143B4 */  lui       $at, (0x43B40000 >> 16)
/* 1A3A90 802751B0 4481C000 */  mtc1      $at, $f24
/* 1A3A94 802751B4 4600A521 */  cvt.d.s   $f20, $f20
/* 1A3A98 802751B8 0C00A85B */  jal       sin_rad
/* 1A3A9C 802751BC 46186303 */   div.s    $f12, $f12, $f24
/* 1A3AA0 802751C0 C6020050 */  lwc1      $f2, 0x50($s0)
/* 1A3AA4 802751C4 46001082 */  mul.s     $f2, $f2, $f0
/* 1A3AA8 802751C8 00000000 */  nop
/* 1A3AAC 802751CC C60C0024 */  lwc1      $f12, 0x24($s0)
/* 1A3AB0 802751D0 46166302 */  mul.s     $f12, $f12, $f22
/* 1A3AB4 802751D4 00000000 */  nop
/* 1A3AB8 802751D8 3C01802A */  lui       $at, %hi(D_8029D8E0)
/* 1A3ABC 802751DC D420D8E0 */  ldc1      $f0, %lo(D_8029D8E0)($at)
/* 1A3AC0 802751E0 460010A1 */  cvt.d.s   $f2, $f2
/* 1A3AC4 802751E4 46201083 */  div.d     $f2, $f2, $f0
/* 1A3AC8 802751E8 4622A500 */  add.d     $f20, $f20, $f2
/* 1A3ACC 802751EC 46186303 */  div.s     $f12, $f12, $f24
/* 1A3AD0 802751F0 4620A520 */  cvt.s.d   $f20, $f20
/* 1A3AD4 802751F4 0C00A85B */  jal       sin_rad
/* 1A3AD8 802751F8 E6140000 */   swc1     $f20, 0x0($s0)
/* 1A3ADC 802751FC C6020050 */  lwc1      $f2, 0x50($s0)
/* 1A3AE0 80275200 46001082 */  mul.s     $f2, $f2, $f0
/* 1A3AE4 80275204 00000000 */  nop
/* 1A3AE8 80275208 C60C0024 */  lwc1      $f12, 0x24($s0)
/* 1A3AEC 8027520C C6000028 */  lwc1      $f0, 0x28($s0)
/* 1A3AF0 80275210 46006300 */  add.s     $f12, $f12, $f0
/* 1A3AF4 80275214 C6000004 */  lwc1      $f0, 0x4($s0)
/* 1A3AF8 80275218 46020001 */  sub.s     $f0, $f0, $f2
/* 1A3AFC 8027521C E60C0024 */  swc1      $f12, 0x24($s0)
/* 1A3B00 80275220 0C00A6C9 */  jal       clamp_angle
/* 1A3B04 80275224 E6000004 */   swc1     $f0, 0x4($s0)
/* 1A3B08 80275228 C6020000 */  lwc1      $f2, 0x0($s0)
/* 1A3B0C 8027522C E6000024 */  swc1      $f0, 0x24($s0)
/* 1A3B10 80275230 E6420144 */  swc1      $f2, 0x144($s2)
/* 1A3B14 80275234 C6000004 */  lwc1      $f0, 0x4($s0)
/* 1A3B18 80275238 E6400148 */  swc1      $f0, 0x148($s2)
/* 1A3B1C 8027523C C6000008 */  lwc1      $f0, 0x8($s0)
/* 1A3B20 80275240 E640014C */  swc1      $f0, 0x14C($s2)
/* 1A3B24 80275244 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 1A3B28 80275248 8C42C070 */  lw        $v0, %lo(gBattleStatus)($v0)
/* 1A3B2C 8027524C 30422000 */  andi      $v0, $v0, 0x2000
/* 1A3B30 80275250 10400003 */  beqz      $v0, .L80275260
/* 1A3B34 80275254 00000000 */   nop
.L80275258:
/* 1A3B38 80275258 0809D49F */  j         .L8027527C
/* 1A3B3C 8027525C 24020002 */   addiu    $v0, $zero, 0x2
.L80275260:
/* 1A3B40 80275260 96030064 */  lhu       $v1, 0x64($s0)
/* 1A3B44 80275264 2463FFFF */  addiu     $v1, $v1, -0x1
/* 1A3B48 80275268 A6030064 */  sh        $v1, 0x64($s0)
/* 1A3B4C 8027526C 00031C00 */  sll       $v1, $v1, 16
/* 1A3B50 80275270 10600002 */  beqz      $v1, .L8027527C
/* 1A3B54 80275274 24020001 */   addiu    $v0, $zero, 0x1
/* 1A3B58 80275278 0000102D */  daddu     $v0, $zero, $zero
.L8027527C:
/* 1A3B5C 8027527C 8FBF002C */  lw        $ra, 0x2C($sp)
/* 1A3B60 80275280 8FB40028 */  lw        $s4, 0x28($sp)
/* 1A3B64 80275284 8FB30024 */  lw        $s3, 0x24($sp)
/* 1A3B68 80275288 8FB20020 */  lw        $s2, 0x20($sp)
/* 1A3B6C 8027528C 8FB1001C */  lw        $s1, 0x1C($sp)
/* 1A3B70 80275290 8FB00018 */  lw        $s0, 0x18($sp)
/* 1A3B74 80275294 D7BA0048 */  ldc1      $f26, 0x48($sp)
/* 1A3B78 80275298 D7B80040 */  ldc1      $f24, 0x40($sp)
/* 1A3B7C 8027529C D7B60038 */  ldc1      $f22, 0x38($sp)
/* 1A3B80 802752A0 D7B40030 */  ldc1      $f20, 0x30($sp)
/* 1A3B84 802752A4 03E00008 */  jr        $ra
/* 1A3B88 802752A8 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

ApiStatus func_80274A18(Evt* script, s32 isInitialCall) {
    BattleStatus* battleStatus = &gBattleStatus;
    Bytecode* args = script->ptrReadPos;
    Actor* player = battleStatus->playerActor;
    ActorState* playerState = &player->state;
    f32 posX, posY, posZ;
    f32 goalX, goalZ;
    f32 temp;
    f64 temp_f20_2;
    f64 vel1, vel2;
    f64 vel3, vel4;
    f64 acc1, acc2;
    f64 acc3, acc4;

    if (isInitialCall) {
        player->state.moveTime = evt_get_variable(script, *args++);
        player->state.moveArcAmplitude = evt_get_variable(script, *args++);
        script->functionTemp[1] = 0;
        script->functionTemp[0] = 0;
        if (player->state.moveArcAmplitude == 1) {
            script->functionTemp[0] = 2;
        }
    }

    if (script->functionTemp[0] == 0) {
        playerState->currentPos.x = player->currentPos.x;
        playerState->currentPos.y = player->currentPos.y;
        playerState->currentPos.z = player->currentPos.z;
        goalX = playerState->goalPos.x;
        goalZ = playerState->goalPos.z;
        posX = playerState->currentPos.x;
        posY = playerState->currentPos.y;
        posZ = playerState->currentPos.z;
        playerState->angle = atan2(posX, posZ, goalX, goalZ);
        playerState->distance = dist2D(posX, posZ, goalX, goalZ);
        if (playerState->moveTime == 0) {
            playerState->moveTime = playerState->distance / playerState->speed;
            temp = playerState->distance - (playerState->moveTime * playerState->speed);
        } else {
            playerState->speed = playerState->distance / playerState->moveTime;
            temp = playerState->distance - (playerState->moveTime * playerState->speed);
        }

        if (playerState->moveTime == 0) {
            return ApiStatus_DONE2;
        }

        playerState->unk_30.x = (playerState->goalPos.x - playerState->currentPos.x) / playerState->moveTime;
        playerState->unk_30.y = (playerState->goalPos.y - playerState->currentPos.y) / playerState->moveTime;
        playerState->unk_30.z = (playerState->goalPos.z - playerState->currentPos.z) / playerState->moveTime;
        playerState->acceleration = PI_S /  playerState->moveTime;
        playerState->velocity = 0.0f;
        playerState->speed += temp / playerState->moveTime;
        if (playerState->moveArcAmplitude < 3) {
            temp = playerState->distance;
            temp -= 20.0;
            temp /= 6.0;
            temp += 47.0;
            playerState->bounceDivisor = temp;
            playerState->unk_24 = 90.0f;
            playerState->unk_28 = 360 / playerState->moveTime;
            if (playerState->moveArcAmplitude == 2) {
                playerState->bounceDivisor = temp * 1.12;
            }
            playerState->unk_18.x = 0.0f;
            playerState->unk_18.y = 0.0f;
            vel1 = playerState->velocity;
            acc1 = playerState->acceleration;
            playerState->velocity = vel1 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * acc1) + acc1);
        } else {
            temp = playerState->distance;
            temp -= 20.0;
            temp /= 6.0;
            temp += 47.0;
            playerState->bounceDivisor = temp;
            playerState->unk_24 = 90.0f;
            playerState->unk_28 = 360 / playerState->moveTime;
            if (playerState->moveArcAmplitude == 4) {
                playerState->bounceDivisor = temp * 1.25;
            }
            playerState->unk_18.x = 0.0f;
            playerState->unk_18.y = 0.0f;
            vel2 = playerState->velocity;
            acc2 = playerState->acceleration;
            playerState->velocity = vel2 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.8 * acc2) + acc2);
        }
        set_animation(0, 0, playerState->animJumpRise);
        sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z);
        script->functionTemp[0] = 1;
    }

    switch (script->functionTemp[0]) {
        case 1:
            if (playerState->velocity > PI_S / 2) {
                set_animation(ACTOR_PLAYER, 0, playerState->animJumpFall);
            }
            playerState->currentPos.x += playerState->unk_30.x;
            playerState->currentPos.y += playerState->unk_30.y;
            playerState->currentPos.z += playerState->unk_30.z;
            playerState->unk_18.x = player->currentPos.y;
            player->currentPos.x = playerState->currentPos.x;
            player->currentPos.y = playerState->currentPos.y + (playerState->bounceDivisor * sin_rad(playerState->velocity));
            player->currentPos.z = playerState->currentPos.z;
            if (playerState->goalPos.y > player->currentPos.y && playerState->moveTime < 3) {
                player->currentPos.y = playerState->goalPos.y;
            }
            playerState->unk_18.y = player->currentPos.y;
            if (playerState->moveArcAmplitude < 3) {
                vel3 = playerState->velocity;
                acc3 = playerState->acceleration;
                playerState->velocity = vel3 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * acc3) + acc3);
            } else {
                vel4 = playerState->velocity;
                acc4 = playerState->acceleration;
                playerState->velocity = vel4 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.8 * acc4) + acc4);
            }
            playerState->unk_24 += playerState->unk_28;
            playerState->unk_24 = clamp_angle(playerState->unk_24);
            playerState->moveTime--;
            if (playerState->moveTime == 0) {
                player->currentPos.y = playerState->goalPos.y;
                playerState->acceleration = 1.8f;
                playerState->velocity = -(playerState->unk_18.x - playerState->unk_18.y);
                set_animation(ACTOR_PLAYER, 0, playerState->animJumpLand);
                return ApiStatus_DONE1;
            }
            break;
        case 2:
            if (battleStatus->actionCommandMode == ACTION_COMMAND_MODE_NOT_LEARNED) {
                return ApiStatus_DONE2;
            }
            playerState->moveTime = 1;
            playerState->acceleration = 1.8f;
            playerState->unk_24 = 90.0f;
            playerState->velocity = -(playerState->unk_18.x - playerState->unk_18.y);
            playerState->bounceDivisor = fabsf(playerState->unk_18.x - playerState->unk_18.y) / 16.5;
            playerState->unk_28 = 360 / playerState->moveTime;
            playerState->currentPos.x = player->currentPos.x;
            playerState->currentPos.y = player->currentPos.y;
            playerState->currentPos.z = player->currentPos.z;
            script->functionTemp[0] = 3;
            // fallthrough
        case 3:
            temp_f20_2 = playerState->currentPos.x;
            playerState->currentPos.x = temp_f20_2 + ((playerState->bounceDivisor * sin_rad(DEG_TO_RAD(playerState->unk_24))) / 33.0);
            playerState->currentPos.y -= (playerState->bounceDivisor * sin_rad(DEG_TO_RAD(playerState->unk_24)));
            playerState->unk_24 += playerState->unk_28;
            playerState->unk_24 = clamp_angle(playerState->unk_24);
            player->currentPos.x = playerState->currentPos.x;
            player->currentPos.y = playerState->currentPos.y;
            player->currentPos.z = playerState->currentPos.z;
            if (gBattleStatus.flags1 & BS_FLAGS1_2000) {
                return ApiStatus_DONE2;
            }
            playerState->moveTime--;
            if (playerState->moveTime == 0) {
                return ApiStatus_DONE1;
            }
            break;
    }

    return ApiStatus_BLOCK;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_80246B34
/* 175414 80246B34 3C03800E */  lui       $v1, %hi(gBattleSubState)
/* 175418 80246B38 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
/* 17541C 80246B3C 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* 175420 80246B40 AFB50024 */  sw        $s5, 0x24($sp)
/* 175424 80246B44 3C15800E */  lui       $s5, %hi(gBattleStatus)
/* 175428 80246B48 26B5C070 */  addiu     $s5, $s5, %lo(gBattleStatus)
/* 17542C 80246B4C AFBF0028 */  sw        $ra, 0x28($sp)
/* 175430 80246B50 AFB40020 */  sw        $s4, 0x20($sp)
/* 175434 80246B54 AFB3001C */  sw        $s3, 0x1C($sp)
/* 175438 80246B58 AFB20018 */  sw        $s2, 0x18($sp)
/* 17543C 80246B5C AFB10014 */  sw        $s1, 0x14($sp)
D_80246B60:
/* 175440 80246B60 AFB00010 */  sw        $s0, 0x10($sp)
/* 175444 80246B64 8EB200D8 */  lw        $s2, 0xD8($s5)
/* 175448 80246B68 8EB400DC */  lw        $s4, 0xDC($s5)
/* 17544C 80246B6C 2C62000D */  sltiu     $v0, $v1, 0xD
/* 175450 80246B70 10400122 */  beqz      $v0, .L80246FFC
glabel func_80246B74
/* 175454 80246B74 00031080 */   sll      $v0, $v1, 2
/* 175458 80246B78 3C01802A */  lui       $at, %hi(jtbl_8029CB30)
/* 17545C 80246B7C 00220821 */  addu      $at, $at, $v0
/* 175460 80246B80 8C22CB30 */  lw        $v0, %lo(jtbl_8029CB30)($at)
/* 175464 80246B84 00400008 */  jr        $v0
.L80246B88:
/* 175468 80246B88 00000000 */   nop
glabel .L80246B8C
/* 17546C 80246B8C 16800005 */  bnez      $s4, .L80246BA4
/* 175470 80246B90 2402007F */   addiu    $v0, $zero, 0x7F
/* 175474 80246B94 0C090464 */  jal       func_80241190
/* 175478 80246B98 24040009 */   addiu    $a0, $zero, 0x9
/* 17547C 80246B9C 08091BFF */  j         .L80246FFC
D_80246BA0:
/* 175480 80246BA0 00000000 */   nop
.L80246BA4:
/* 175484 80246BA4 3C10800E */  lui       $s0, %hi(gBattleStatus)
jtbl_80246BA8:
/* 175488 80246BA8 2610C070 */  addiu     $s0, $s0, %lo(gBattleStatus)
/* 17548C 80246BAC A2A0008C */  sb        $zero, 0x8C($s5)
.L80246BB0:
/* 175490 80246BB0 A2A20086 */  sb        $v0, 0x86($s5)
/* 175494 80246BB4 A2A20087 */  sb        $v0, 0x87($s5)
/* 175498 80246BB8 A2A0019A */  sb        $zero, 0x19A($s5)
/* 17549C 80246BBC 8E020000 */  lw        $v0, 0x0($s0)
/* 1754A0 80246BC0 2403EFFF */  addiu     $v1, $zero, -0x1001
D_80246BC4:
/* 1754A4 80246BC4 00431024 */  and       $v0, $v0, $v1
/* 1754A8 80246BC8 2403FFFD */  addiu     $v1, $zero, -0x3
/* 1754AC 80246BCC 00431024 */  and       $v0, $v0, $v1
D_80246BD0:
/* 1754B0 80246BD0 0C098F18 */  jal       reset_actor_turn_info
/* 1754B4 80246BD4 AE020000 */   sw       $v0, 0x0($s0)
D_80246BD8:
/* 1754B8 80246BD8 3C03F7FF */  lui       $v1, (0xF7FFFFFF >> 16)
/* 1754BC 80246BDC 8E820000 */  lw        $v0, 0x0($s4)
jtbl_80246BE0:
/* 1754C0 80246BE0 3463FFFF */  ori       $v1, $v1, (0xF7FFFFFF & 0xFFFF)
.L80246BE4:
/* 1754C4 80246BE4 A280021C */  sb        $zero, 0x21C($s4)
D_80246BE8:
/* 1754C8 80246BE8 00431024 */  and       $v0, $v0, $v1
/* 1754CC 80246BEC AE820000 */  sw        $v0, 0x0($s4)
/* 1754D0 80246BF0 8E420000 */  lw        $v0, 0x0($s2)
D_80246BF4:
/* 1754D4 80246BF4 0000882D */  daddu     $s1, $zero, $zero
/* 1754D8 80246BF8 00431024 */  and       $v0, $v0, $v1
/* 1754DC 80246BFC 0C098EF2 */  jal       deduct_current_move_fp
/* 1754E0 80246C00 AE420000 */   sw       $v0, 0x0($s2)
D_80246C04:
/* 1754E4 80246C04 0C09390F */  jal       func_8024E43C
/* 1754E8 80246C08 24040100 */   addiu    $a0, $zero, 0x100
/* 1754EC 80246C0C 3C04FFDF */  lui       $a0, (0xFFDFFFFF >> 16)
.L80246C10:
/* 1754F0 80246C10 3484FFFF */  ori       $a0, $a0, (0xFFDFFFFF & 0xFFFF)
/* 1754F4 80246C14 02A0282D */  daddu     $a1, $s5, $zero
/* 1754F8 80246C18 8E020004 */  lw        $v0, 0x4($s0)
.L80246C1C:
/* 1754FC 80246C1C 8E030000 */  lw        $v1, 0x0($s0)
/* 175500 80246C20 34420010 */  ori       $v0, $v0, 0x10
.L80246C24:
/* 175504 80246C24 00641824 */  and       $v1, $v1, $a0
/* 175508 80246C28 AE020004 */  sw        $v0, 0x4($s0)
/* 17550C 80246C2C AE030000 */  sw        $v1, 0x0($s0)
.L80246C30:
/* 175510 80246C30 8CB000E0 */  lw        $s0, 0xE0($a1)
/* 175514 80246C34 56000001 */  bnel      $s0, $zero, .L80246C3C
/* 175518 80246C38 A200021C */   sb       $zero, 0x21C($s0)
.L80246C3C:
/* 17551C 80246C3C 26310001 */  addiu     $s1, $s1, 0x1
/* 175520 80246C40 2A220018 */  slti      $v0, $s1, 0x18
/* 175524 80246C44 1440FFFA */  bnez      $v0, .L80246C30
/* 175528 80246C48 24A50004 */   addiu    $a1, $a1, 0x4
/* 17552C 80246C4C 0C093903 */  jal       func_8024E40C
/* 175530 80246C50 24040002 */   addiu    $a0, $zero, 0x2
/* 175534 80246C54 08091BFD */  j         .L80246FF4
/* 175538 80246C58 24020002 */   addiu    $v0, $zero, 0x2
glabel .L80246C5C
/* 17553C 80246C5C 0000882D */  daddu     $s1, $zero, $zero
D_80246C60:
/* 175540 80246C60 3C05FFF7 */  lui       $a1, (0xFFF7FFFF >> 16)
/* 175544 80246C64 34A5FFFF */  ori       $a1, $a1, (0xFFF7FFFF & 0xFFFF)
/* 175548 80246C68 3C04F7FF */  lui       $a0, (0xF7FFFFFF >> 16)
/* 17554C 80246C6C 3484FFFF */  ori       $a0, $a0, (0xF7FFFFFF & 0xFFFF)
/* 175550 80246C70 02A0182D */  daddu     $v1, $s5, $zero
.L80246C74:
/* 175554 80246C74 8C7000E0 */  lw        $s0, 0xE0($v1)
/* 175558 80246C78 12000005 */  beqz      $s0, .L80246C90
.L80246C7C:
/* 17555C 80246C7C 26310001 */   addiu    $s1, $s1, 0x1
/* 175560 80246C80 8E020000 */  lw        $v0, 0x0($s0)
/* 175564 80246C84 00451024 */  and       $v0, $v0, $a1
/* 175568 80246C88 00441024 */  and       $v0, $v0, $a0
D_80246C8C:
/* 17556C 80246C8C AE020000 */  sw        $v0, 0x0($s0)
.L80246C90:
/* 175570 80246C90 2A220018 */  slti      $v0, $s1, 0x18
D_80246C94:
/* 175574 80246C94 1440FFF7 */  bnez      $v0, .L80246C74
/* 175578 80246C98 24630004 */   addiu    $v1, $v1, 0x4
.L80246C9C:
/* 17557C 80246C9C 0C03A6D5 */  jal       increment_status_bar_disabled
/* 175580 80246CA0 00000000 */   nop
/* 175584 80246CA4 3C03800E */  lui       $v1, %hi(gBattleStatus)
D_80246CA8:
/* 175588 80246CA8 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 17558C 80246CAC 8C620000 */  lw        $v0, 0x0($v1)
D_80246CB0:
/* 175590 80246CB0 34420100 */  ori       $v0, $v0, 0x100
.L80246CB4:
/* 175594 80246CB4 0C098F18 */  jal       reset_actor_turn_info
jtbl_80246CB8:
/* 175598 80246CB8 AC620000 */   sw       $v0, 0x0($v1)
glabel func_80246CBC
/* 17559C 80246CBC 0C099EA7 */  jal       reset_all_actor_sounds
/* 1755A0 80246CC0 0280202D */   daddu    $a0, $s4, $zero
/* 1755A4 80246CC4 2405000A */  addiu     $a1, $zero, 0xA
/* 1755A8 80246CC8 A2A001A7 */  sb        $zero, 0x1A7($s5)
/* 1755AC 80246CCC 8E8401C4 */  lw        $a0, 0x1C4($s4)
/* 1755B0 80246CD0 0C0B0CF8 */  jal       start_script
/* 1755B4 80246CD4 0000302D */   daddu    $a2, $zero, $zero
.L80246CD8:
/* 1755B8 80246CD8 AE8201D4 */  sw        $v0, 0x1D4($s4)
D_80246CDC:
/* 1755BC 80246CDC 8C440144 */  lw        $a0, 0x144($v0)
/* 1755C0 80246CE0 24030003 */  addiu     $v1, $zero, 0x3
/* 1755C4 80246CE4 3C01800E */  lui       $at, %hi(gBattleSubState)
/* 1755C8 80246CE8 AC23C4DC */  sw        $v1, %lo(gBattleSubState)($at)
/* 1755CC 80246CEC 24030100 */  addiu     $v1, $zero, 0x100
/* 1755D0 80246CF0 AE8401E4 */  sw        $a0, 0x1E4($s4)
/* 1755D4 80246CF4 08091BFF */  j         .L80246FFC
jtbl_80246CF8:
/* 1755D8 80246CF8 AC430148 */   sw       $v1, 0x148($v0)
glabel .L80246CFC
/* 1755DC 80246CFC 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 1755E0 80246D00 8C42C070 */  lw        $v0, %lo(gBattleStatus)($v0)
/* 1755E4 80246D04 3C030020 */  lui       $v1, (0x200000 >> 16)
/* 1755E8 80246D08 00431024 */  and       $v0, $v0, $v1
/* 1755EC 80246D0C 1440000A */  bnez      $v0, D_80246D38
D_80246D10:
/* 1755F0 80246D10 00000000 */   nop
/* 1755F4 80246D14 8E8201D4 */  lw        $v0, 0x1D4($s4)
jtbl_80246D18:
/* 1755F8 80246D18 50400007 */  beql      $v0, $zero, D_80246D38
/* 1755FC 80246D1C AE8001D4 */   sw       $zero, 0x1D4($s4)
/* 175600 80246D20 8E8401E4 */  lw        $a0, 0x1E4($s4)
.L80246D24:
/* 175604 80246D24 0C0B1059 */  jal       does_script_exist
/* 175608 80246D28 00000000 */   nop
/* 17560C 80246D2C 144000B3 */  bnez      $v0, .L80246FFC
/* 175610 80246D30 00000000 */   nop
/* 175614 80246D34 AE8001D4 */  sw        $zero, 0x1D4($s4)
D_80246D38:
/* 175618 80246D38 3C04800E */  lui       $a0, %hi(gBattleStatus)
/* 17561C 80246D3C 2484C070 */  addiu     $a0, $a0, %lo(gBattleStatus)
D_80246D40:
/* 175620 80246D40 8C820000 */  lw        $v0, 0x0($a0)
.L80246D44:
/* 175624 80246D44 2403FEFF */  addiu     $v1, $zero, -0x101
D_80246D48:
/* 175628 80246D48 00431024 */  and       $v0, $v0, $v1
/* 17562C 80246D4C AC820000 */  sw        $v0, 0x0($a0)
jtbl_80246D50:
/* 175630 80246D50 8E8201D8 */  lw        $v0, 0x1D8($s4)
/* 175634 80246D54 50400007 */  beql      $v0, $zero, .L80246D74
/* 175638 80246D58 AE8001D8 */   sw       $zero, 0x1D8($s4)
/* 17563C 80246D5C 8E8401E8 */  lw        $a0, 0x1E8($s4)
/* 175640 80246D60 0C0B1059 */  jal       does_script_exist
glabel .L80246D64
/* 175644 80246D64 00000000 */   nop
/* 175648 80246D68 144000A4 */  bnez      $v0, .L80246FFC
/* 17564C 80246D6C 00000000 */   nop
D_80246D70:
/* 175650 80246D70 AE8001D8 */  sw        $zero, 0x1D8($s4)
.L80246D74:
/* 175654 80246D74 8E4201D8 */  lw        $v0, 0x1D8($s2)
D_80246D78:
/* 175658 80246D78 50400007 */  beql      $v0, $zero, D_80246D98
/* 17565C 80246D7C AE4001D8 */   sw       $zero, 0x1D8($s2)
jtbl_80246D80:
/* 175660 80246D80 8E4401E8 */  lw        $a0, 0x1E8($s2)
/* 175664 80246D84 0C0B1059 */  jal       does_script_exist
/* 175668 80246D88 00000000 */   nop
/* 17566C 80246D8C 1440009B */  bnez      $v0, .L80246FFC
D_80246D90:
/* 175670 80246D90 00000000 */   nop
/* 175674 80246D94 AE4001D8 */  sw        $zero, 0x1D8($s2)
D_80246D98:
/* 175678 80246D98 0000982D */  daddu     $s3, $zero, $zero
/* 17567C 80246D9C 0260882D */  daddu     $s1, $s3, $zero
jtbl_80246DA0:
/* 175680 80246DA0 02A0902D */  daddu     $s2, $s5, $zero
.L80246DA4:
/* 175684 80246DA4 8E5000E0 */  lw        $s0, 0xE0($s2)
/* 175688 80246DA8 5200000B */  beql      $s0, $zero, .L80246DD8
/* 17568C 80246DAC 26310001 */   addiu    $s1, $s1, 0x1
/* 175690 80246DB0 8E0201D4 */  lw        $v0, 0x1D4($s0)
/* 175694 80246DB4 50400008 */  beql      $v0, $zero, .L80246DD8
.L80246DB8:
/* 175698 80246DB8 26310001 */   addiu    $s1, $s1, 0x1
/* 17569C 80246DBC 8E0401E4 */  lw        $a0, 0x1E4($s0)
/* 1756A0 80246DC0 0C0B1059 */  jal       does_script_exist
/* 1756A4 80246DC4 00000000 */   nop
/* 1756A8 80246DC8 50400002 */  beql      $v0, $zero, .L80246DD4
/* 1756AC 80246DCC AE0001D4 */   sw       $zero, 0x1D4($s0)
/* 1756B0 80246DD0 24130001 */  addiu     $s3, $zero, 0x1
.L80246DD4:
/* 1756B4 80246DD4 26310001 */  addiu     $s1, $s1, 0x1
.L80246DD8:
/* 1756B8 80246DD8 2A220018 */  slti      $v0, $s1, 0x18
/* 1756BC 80246DDC 1440FFF1 */  bnez      $v0, .L80246DA4
/* 1756C0 80246DE0 26520004 */   addiu    $s2, $s2, 0x4
D_80246DE4:
/* 1756C4 80246DE4 16600085 */  bnez      $s3, .L80246FFC
.L80246DE8:
/* 1756C8 80246DE8 0000882D */   daddu    $s1, $zero, $zero
.L80246DEC:
/* 1756CC 80246DEC 02A0902D */  daddu     $s2, $s5, $zero
.L80246DF0:
/* 1756D0 80246DF0 8E5000E0 */  lw        $s0, 0xE0($s2)
/* 1756D4 80246DF4 5200000B */  beql      $s0, $zero, func_80246E24
/* 1756D8 80246DF8 26310001 */   addiu    $s1, $s1, 0x1
.L80246DFC:
/* 1756DC 80246DFC 8E0201D8 */  lw        $v0, 0x1D8($s0)
/* 1756E0 80246E00 50400008 */  beql      $v0, $zero, func_80246E24
/* 1756E4 80246E04 26310001 */   addiu    $s1, $s1, 0x1
/* 1756E8 80246E08 8E0401E8 */  lw        $a0, 0x1E8($s0)
/* 1756EC 80246E0C 0C0B1059 */  jal       does_script_exist
/* 1756F0 80246E10 00000000 */   nop
/* 1756F4 80246E14 50400002 */  beql      $v0, $zero, D_80246E20
.L80246E18:
/* 1756F8 80246E18 AE0001D8 */   sw       $zero, 0x1D8($s0)
/* 1756FC 80246E1C 24130001 */  addiu     $s3, $zero, 0x1
D_80246E20:
/* 175700 80246E20 26310001 */  addiu     $s1, $s1, 0x1
glabel func_80246E24
/* 175704 80246E24 2A220018 */  slti      $v0, $s1, 0x18
D_80246E28:
/* 175708 80246E28 1440FFF1 */  bnez      $v0, .L80246DF0
/* 17570C 80246E2C 26520004 */   addiu    $s2, $s2, 0x4
D_80246E30:
/* 175710 80246E30 16600072 */  bnez      $s3, .L80246FFC
/* 175714 80246E34 0000882D */   daddu    $s1, $zero, $zero
/* 175718 80246E38 3C04FFF7 */  lui       $a0, (0xFFF7FFFF >> 16)
/* 17571C 80246E3C 3484FFFF */  ori       $a0, $a0, (0xFFF7FFFF & 0xFFFF)
D_80246E40:
/* 175720 80246E40 02A0182D */  daddu     $v1, $s5, $zero
.L80246E44:
/* 175724 80246E44 8C7000E0 */  lw        $s0, 0xE0($v1)
/* 175728 80246E48 12000004 */  beqz      $s0, .L80246E5C
/* 17572C 80246E4C 26310001 */   addiu    $s1, $s1, 0x1
D_80246E50:
/* 175730 80246E50 8E020000 */  lw        $v0, 0x0($s0)
/* 175734 80246E54 00441024 */  and       $v0, $v0, $a0
/* 175738 80246E58 AE020000 */  sw        $v0, 0x0($s0)
.L80246E5C:
/* 17573C 80246E5C 2A220018 */  slti      $v0, $s1, 0x18
/* 175740 80246E60 1440FFF8 */  bnez      $v0, .L80246E44
.L80246E64:
/* 175744 80246E64 24630004 */   addiu    $v1, $v1, 0x4
/* 175748 80246E68 82A2008C */  lb        $v0, 0x8C($s5)
glabel .L80246E6C
/* 17574C 80246E6C 14400063 */  bnez      $v0, .L80246FFC
/* 175750 80246E70 00000000 */   nop
/* 175754 80246E74 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
.L80246E78:
/* 175758 80246E78 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
D_80246E7C:
/* 17575C 80246E7C 904200AA */  lbu       $v0, 0xAA($v0)
/* 175760 80246E80 30420001 */  andi      $v0, $v0, 0x1
/* 175764 80246E84 10400005 */  beqz      $v0, .L80246E9C
/* 175768 80246E88 00000000 */   nop
D_80246E8C:
/* 17576C 80246E8C 0C090464 */  jal       func_80241190
/* 175770 80246E90 24040023 */   addiu    $a0, $zero, 0x23
/* 175774 80246E94 08091BFF */  j         .L80246FFC
D_80246E98:
/* 175778 80246E98 00000000 */   nop
.L80246E9C:
/* 17577C 80246E9C 0C03A6CC */  jal       decrement_status_bar_disabled
/* 175780 80246EA0 00000000 */   nop
/* 175784 80246EA4 3C028011 */  lui       $v0, %hi(gPlayerData)
jtbl_80246EA8:
/* 175788 80246EA8 2442F290 */  addiu     $v0, $v0, %lo(gPlayerData)
/* 17578C 80246EAC 80430012 */  lb        $v1, 0x12($v0)
/* 175790 80246EB0 24020001 */  addiu     $v0, $zero, 0x1
/* 175794 80246EB4 1462000E */  bne       $v1, $v0, .L80246EF0
/* 175798 80246EB8 24020005 */   addiu    $v0, $zero, 0x5
/* 17579C 80246EBC 82A30178 */  lb        $v1, 0x178($s5)
/* 1757A0 80246EC0 1462000B */  bne       $v1, $v0, .L80246EF0
/* 1757A4 80246EC4 24020087 */   addiu    $v0, $zero, 0x87
jtbl_80246EC8:
/* 1757A8 80246EC8 86A3017C */  lh        $v1, 0x17C($s5)
.L80246ECC:
/* 1757AC 80246ECC 10620008 */  beq       $v1, $v0, .L80246EF0
/* 1757B0 80246ED0 3C04BFFF */   lui      $a0, (0xBFFFFFFF >> 16)
D_80246ED4:
/* 1757B4 80246ED4 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 1757B8 80246ED8 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
.L80246EDC:
/* 1757BC 80246EDC A2800220 */  sb        $zero, 0x220($s4)
/* 1757C0 80246EE0 8C620000 */  lw        $v0, 0x0($v1)
/* 1757C4 80246EE4 3484FFFF */  ori       $a0, $a0, (0xBFFFFFFF & 0xFFFF)
/* 1757C8 80246EE8 00441024 */  and       $v0, $v0, $a0
/* 1757CC 80246EEC AC620000 */  sw        $v0, 0x0($v1)
.L80246EF0:
/* 1757D0 80246EF0 0C098D19 */  jal       btl_check_player_defeated
/* 1757D4 80246EF4 00000000 */   nop
D_80246EF8:
/* 1757D8 80246EF8 144000BD */  bnez      $v0, .L802471F0
/* 1757DC 80246EFC 0000882D */   daddu    $s1, $zero, $zero
jtbl_80246F00:
/* 1757E0 80246F00 3C060040 */  lui       $a2, (0x400000 >> 16)
/* 1757E4 80246F04 3C050C00 */  lui       $a1, (0xC000000 >> 16)
.L80246F08:
/* 1757E8 80246F08 02A0202D */  daddu     $a0, $s5, $zero
.L80246F0C:
/* 1757EC 80246F0C 8C9000E0 */  lw        $s0, 0xE0($a0)
D_80246F10:
/* 1757F0 80246F10 12000007 */  beqz      $s0, .L80246F30
.L80246F14:
/* 1757F4 80246F14 26310001 */   addiu    $s1, $s1, 0x1
D_80246F18:
/* 1757F8 80246F18 8E030000 */  lw        $v1, 0x0($s0)
D_80246F1C:
/* 1757FC 80246F1C 00661024 */  and       $v0, $v1, $a2
jtbl_80246F20:
/* 175800 80246F20 14400003 */  bnez      $v0, .L80246F30
/* 175804 80246F24 00000000 */   nop
.L80246F28:
/* 175808 80246F28 00651025 */  or        $v0, $v1, $a1
/* 17580C 80246F2C AE020000 */  sw        $v0, 0x0($s0)
.L80246F30:
/* 175810 80246F30 2A220018 */  slti      $v0, $s1, 0x18
/* 175814 80246F34 1440FFF5 */  bnez      $v0, .L80246F0C
/* 175818 80246F38 24840004 */   addiu    $a0, $a0, 0x4
/* 17581C 80246F3C 0C099DDF */  jal       btl_update_ko_status
/* 175820 80246F40 00000000 */   nop
/* 175824 80246F44 8283021C */  lb        $v1, 0x21C($s4)
/* 175828 80246F48 2402000D */  addiu     $v0, $zero, 0xD
/* 17582C 80246F4C 14620029 */  bne       $v1, $v0, .L80246FF4
/* 175830 80246F50 24020014 */   addiu    $v0, $zero, 0x14
/* 175834 80246F54 0C098CFA */  jal       func_802633E8
/* 175838 80246F58 00000000 */   nop
/* 17583C 80246F5C 14400025 */  bnez      $v0, .L80246FF4
/* 175840 80246F60 24020014 */   addiu    $v0, $zero, 0x14
/* 175844 80246F64 0C093903 */  jal       func_8024E40C
/* 175848 80246F68 24040036 */   addiu    $a0, $zero, 0x36
/* 17584C 80246F6C 24040023 */  addiu     $a0, $zero, 0x23
D_80246F70:
/* 175850 80246F70 0C093E58 */  jal       func_8024F960
/* 175854 80246F74 2405003C */   addiu    $a1, $zero, 0x3C
/* 175858 80246F78 2402000B */  addiu     $v0, $zero, 0xB
/* 17585C 80246F7C A280021C */  sb        $zero, 0x21C($s4)
.L80246F80:
/* 175860 80246F80 A280021D */  sb        $zero, 0x21D($s4)
/* 175864 80246F84 3C01800E */  lui       $at, %hi(gBattleSubState)
/* 175868 80246F88 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
/* 17586C 80246F8C 8E820000 */  lw        $v0, 0x0($s4)
/* 175870 80246F90 3C030800 */  lui       $v1, (0x8000000 >> 16)
glabel func_80246F94
/* 175874 80246F94 00431025 */  or        $v0, $v0, $v1
/* 175878 80246F98 08091BFF */  j         .L80246FFC
glabel .L80246F9C
/* 17587C 80246F9C AE820000 */   sw       $v0, 0x0($s4)
D_80246FA0:
/* 175880 80246FA0 0C093EAD */  jal       func_8024FAB4
/* 175884 80246FA4 00000000 */   nop
/* 175888 80246FA8 14400014 */  bnez      $v0, .L80246FFC
/* 17588C 80246FAC 00000000 */   nop
.L80246FB0:
/* 175890 80246FB0 0C093903 */  jal       func_8024E40C
/* 175894 80246FB4 24040002 */   addiu    $a0, $zero, 0x2
/* 175898 80246FB8 0C093936 */  jal       D_8024E4D8_C0BD58
/* 17589C 80246FBC 2404000F */   addiu    $a0, $zero, 0xF
/* 1758A0 80246FC0 2402000A */  addiu     $v0, $zero, 0xA
/* 1758A4 80246FC4 3C01802A */  lui       $at, %hi(D_8029F248)
D_80246FC8:
/* 1758A8 80246FC8 AC22F248 */  sw        $v0, %lo(D_8029F248)($at)
/* 1758AC 80246FCC 08091BFD */  j         .L80246FF4
/* 1758B0 80246FD0 2402000C */   addiu    $v0, $zero, 0xC
D_80246FD4:
/* 1758B4 80246FD4 3C03802A */  lui       $v1, %hi(D_8029F248)
/* 1758B8 80246FD8 2463F248 */  addiu     $v1, $v1, %lo(D_8029F248)
glabel .L80246FDC
/* 1758BC 80246FDC 8C620000 */  lw        $v0, 0x0($v1)
glabel func_80246FE0
/* 1758C0 80246FE0 10400003 */  beqz      $v0, .L80246FF0
/* 1758C4 80246FE4 2442FFFF */   addiu    $v0, $v0, -0x1
/* 1758C8 80246FE8 08091BFF */  j         .L80246FFC
/* 1758CC 80246FEC AC620000 */   sw       $v0, 0x0($v1)
.L80246FF0:
/* 1758D0 80246FF0 24020014 */  addiu     $v0, $zero, 0x14
.L80246FF4:
/* 1758D4 80246FF4 3C01800E */  lui       $at, %hi(gBattleSubState)
/* 1758D8 80246FF8 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
glabel .L80246FFC
/* 1758DC 80246FFC 3C10800E */  lui       $s0, %hi(gBattleSubState)
.L80247000:
/* 1758E0 80247000 2610C4DC */  addiu     $s0, $s0, %lo(gBattleSubState)
/* 1758E4 80247004 8E030000 */  lw        $v1, 0x0($s0)
/* 1758E8 80247008 24020015 */  addiu     $v0, $zero, 0x15
/* 1758EC 8024700C 10620052 */  beq       $v1, $v0, .L80247158
D_80247010:
/* 1758F0 80247010 28620016 */   slti     $v0, $v1, 0x16
.L80247014:
/* 1758F4 80247014 10400005 */  beqz      $v0, .L8024702C
/* 1758F8 80247018 24020014 */   addiu    $v0, $zero, 0x14
/* 1758FC 8024701C 10620008 */  beq       $v1, $v0, .L80247040
.L80247020:
/* 175900 80247020 0000982D */   daddu    $s3, $zero, $zero
D_80247024:
/* 175904 80247024 08091C6C */  j         .L802471B0
/* 175908 80247028 00000000 */   nop
.L8024702C:
/* 17590C 8024702C 24020016 */  addiu     $v0, $zero, 0x16
.L80247030:
/* 175910 80247030 10620056 */  beq       $v1, $v0, .L8024718C
/* 175914 80247034 00000000 */   nop
/* 175918 80247038 08091C6C */  j         .L802471B0
/* 17591C 8024703C 00000000 */   nop
.L80247040:
/* 175920 80247040 0260882D */  daddu     $s1, $s3, $zero
/* 175924 80247044 02A0182D */  daddu     $v1, $s5, $zero
.L80247048:
/* 175928 80247048 8C7000E0 */  lw        $s0, 0xE0($v1)
.L8024704C:
/* 17592C 8024704C 12000004 */  beqz      $s0, .L80247060
D_80247050:
/* 175930 80247050 26310001 */   addiu    $s1, $s1, 0x1
glabel func_80247054
/* 175934 80247054 8202021C */  lb        $v0, 0x21C($s0)
/* 175938 80247058 54400004 */  bnel      $v0, $zero, D_8024706C
/* 17593C 8024705C 24130001 */   addiu    $s3, $zero, 0x1
.L80247060:
/* 175940 80247060 2A220018 */  slti      $v0, $s1, 0x18
/* 175944 80247064 1440FFF8 */  bnez      $v0, .L80247048
/* 175948 80247068 24630004 */   addiu    $v1, $v1, 0x4
D_8024706C:
/* 17594C 8024706C 16600005 */  bnez      $s3, .L80247084
/* 175950 80247070 2402001E */   addiu    $v0, $zero, 0x1E
/* 175954 80247074 3C01800E */  lui       $at, %hi(gBattleSubState)
/* 175958 80247078 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
/* 17595C 8024707C 08091C6C */  j         .L802471B0
.L80247080:
/* 175960 80247080 00000000 */   nop
.L80247084:
/* 175964 80247084 0C093903 */  jal       func_8024E40C
/* 175968 80247088 24040003 */   addiu    $a0, $zero, 0x3
/* 17596C 8024708C 9202021C */  lbu       $v0, 0x21C($s0)
/* 175970 80247090 2442FFFC */  addiu     $v0, $v0, -0x4
/* 175974 80247094 00021600 */  sll       $v0, $v0, 24
/* 175978 80247098 00021E03 */  sra       $v1, $v0, 24
.L8024709C:
/* 17597C 8024709C 2C620008 */  sltiu     $v0, $v1, 0x8
/* 175980 802470A0 10400016 */  beqz      $v0, .L802470FC
/* 175984 802470A4 00031080 */   sll      $v0, $v1, 2
/* 175988 802470A8 3C01802A */  lui       $at, %hi(jtbl_8029CB68)
/* 17598C 802470AC 00220821 */  addu      $at, $at, $v0
D_802470B0:
/* 175990 802470B0 8C22CB68 */  lw        $v0, %lo(jtbl_8029CB68)($at)
/* 175994 802470B4 00400008 */  jr        $v0
D_802470B8:
/* 175998 802470B8 00000000 */   nop
D_802470BC:
/* 17599C 802470BC 08091C43 */  j         func_8024710C
D_802470C0:
/* 1759A0 802470C0 24100012 */   addiu    $s0, $zero, 0x12
glabel .L802470C4
/* 1759A4 802470C4 08091C43 */  j         func_8024710C
D_802470C8:
/* 1759A8 802470C8 24100013 */   addiu    $s0, $zero, 0x13
glabel .L802470CC
/* 1759AC 802470CC 08091C43 */  j         func_8024710C
/* 1759B0 802470D0 24100014 */   addiu    $s0, $zero, 0x14
glabel .L802470D4
/* 1759B4 802470D4 08091C43 */  j         func_8024710C
/* 1759B8 802470D8 24100015 */   addiu    $s0, $zero, 0x15
glabel .L802470DC
/* 1759BC 802470DC 08091C43 */  j         func_8024710C
/* 1759C0 802470E0 24100016 */   addiu    $s0, $zero, 0x16
glabel .L802470E4
/* 1759C4 802470E4 08091C43 */  j         func_8024710C
/* 1759C8 802470E8 24100017 */   addiu    $s0, $zero, 0x17
glabel .L802470EC
/* 1759CC 802470EC 08091C43 */  j         func_8024710C
/* 1759D0 802470F0 24100018 */   addiu    $s0, $zero, 0x18
glabel .L802470F4
/* 1759D4 802470F4 08091C43 */  j         func_8024710C
.L802470F8:
/* 1759D8 802470F8 24100019 */   addiu    $s0, $zero, 0x19
.L802470FC:
/* 1759DC 802470FC 0000802D */  daddu     $s0, $zero, $zero
/* 1759E0 80247100 24020014 */  addiu     $v0, $zero, 0x14
/* 1759E4 80247104 3C01800E */  lui       $at, %hi(gBattleSubState)
/* 1759E8 80247108 AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
glabel func_8024710C
/* 1759EC 8024710C 0C05272D */  jal       sfx_play_sound
/* 1759F0 80247110 24042107 */   addiu    $a0, $zero, 0x2107
/* 1759F4 80247114 0200202D */  daddu     $a0, $s0, $zero
/* 1759F8 80247118 0C093E58 */  jal       func_8024F960
/* 1759FC 8024711C 2405003C */   addiu    $a1, $zero, 0x3C
D_80247120:
/* 175A00 80247120 0000882D */  daddu     $s1, $zero, $zero
/* 175A04 80247124 02A0182D */  daddu     $v1, $s5, $zero
.L80247128:
/* 175A08 80247128 8C7000E0 */  lw        $s0, 0xE0($v1)
D_8024712C:
/* 175A0C 8024712C 56000001 */  bnel      $s0, $zero, .L80247134
.L80247130:
/* 175A10 80247130 A200021C */   sb       $zero, 0x21C($s0)
.L80247134:
/* 175A14 80247134 26310001 */  addiu     $s1, $s1, 0x1
/* 175A18 80247138 2A220018 */  slti      $v0, $s1, 0x18
/* 175A1C 8024713C 1440FFFA */  bnez      $v0, .L80247128
/* 175A20 80247140 24630004 */   addiu    $v1, $v1, 0x4
/* 175A24 80247144 24020015 */  addiu     $v0, $zero, 0x15
.L80247148:
/* 175A28 80247148 3C01800E */  lui       $at, %hi(gBattleSubState)
/* 175A2C 8024714C AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
/* 175A30 80247150 08091C6C */  j         .L802471B0
D_80247154:
/* 175A34 80247154 00000000 */   nop
.L80247158:
/* 175A38 80247158 0C093EAD */  jal       func_8024FAB4
D_8024715C:
/* 175A3C 8024715C 00000000 */   nop
D_80247160:
/* 175A40 80247160 14400013 */  bnez      $v0, .L802471B0
.L80247164:
/* 175A44 80247164 00000000 */   nop
glabel func_80247168
/* 175A48 80247168 0C093903 */  jal       func_8024E40C
D_8024716C:
/* 175A4C 8024716C 24040002 */   addiu    $a0, $zero, 0x2
/* 175A50 80247170 0C093936 */  jal       D_8024E4D8_C0BD58
/* 175A54 80247174 2404000F */   addiu    $a0, $zero, 0xF
.L80247178:
/* 175A58 80247178 2402000A */  addiu     $v0, $zero, 0xA
D_8024717C:
/* 175A5C 8024717C 3C01802A */  lui       $at, %hi(D_8029F248)
/* 175A60 80247180 AC22F248 */  sw        $v0, %lo(D_8029F248)($at)
D_80247184:
/* 175A64 80247184 08091C6B */  j         .L802471AC
/* 175A68 80247188 24020016 */   addiu    $v0, $zero, 0x16
.L8024718C:
/* 175A6C 8024718C 3C03802A */  lui       $v1, %hi(D_8029F248)
.L80247190:
/* 175A70 80247190 2463F248 */  addiu     $v1, $v1, %lo(D_8029F248)
D_80247194:
/* 175A74 80247194 8C620000 */  lw        $v0, 0x0($v1)
glabel func_80247198
/* 175A78 80247198 10400003 */  beqz      $v0, .L802471A8
/* 175A7C 8024719C 2442FFFF */   addiu    $v0, $v0, -0x1
/* 175A80 802471A0 08091C6C */  j         .L802471B0
/* 175A84 802471A4 AC620000 */   sw       $v0, 0x0($v1)
.L802471A8:
/* 175A88 802471A8 2402001E */  addiu     $v0, $zero, 0x1E
.L802471AC:
/* 175A8C 802471AC AE020000 */  sw        $v0, 0x0($s0)
.L802471B0:
/* 175A90 802471B0 3C03800E */  lui       $v1, %hi(gBattleSubState)
.L802471B4:
/* 175A94 802471B4 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
/* 175A98 802471B8 2402001E */  addiu     $v0, $zero, 0x1E
D_802471BC:
/* 175A9C 802471BC 1462000C */  bne       $v1, $v0, .L802471F0
/* 175AA0 802471C0 00000000 */   nop
D_802471C4:
/* 175AA4 802471C4 8E8201D4 */  lw        $v0, 0x1D4($s4)
/* 175AA8 802471C8 50400007 */  beql      $v0, $zero, jtbl_802471E8
D_802471CC:
/* 175AAC 802471CC AE8001D4 */   sw       $zero, 0x1D4($s4)
/* 175AB0 802471D0 8E8401E4 */  lw        $a0, 0x1E4($s4)
D_802471D4:
/* 175AB4 802471D4 0C0B1059 */  jal       does_script_exist
glabel func_802471D8
/* 175AB8 802471D8 00000000 */   nop
/* 175ABC 802471DC 14400004 */  bnez      $v0, .L802471F0
D_802471E0:
/* 175AC0 802471E0 00000000 */   nop
D_802471E4:
/* 175AC4 802471E4 AE8001D4 */  sw        $zero, 0x1D4($s4)
jtbl_802471E8:
/* 175AC8 802471E8 0C090464 */  jal       func_80241190
glabel func_802471EC
/* 175ACC 802471EC 24040017 */   addiu    $a0, $zero, 0x17
.L802471F0:
/* 175AD0 802471F0 8FBF0028 */  lw        $ra, 0x28($sp)
D_802471F4:
/* 175AD4 802471F4 8FB50024 */  lw        $s5, 0x24($sp)
/* 175AD8 802471F8 8FB40020 */  lw        $s4, 0x20($sp)
.L802471FC:
/* 175ADC 802471FC 8FB3001C */  lw        $s3, 0x1C($sp)
/* 175AE0 80247200 8FB20018 */  lw        $s2, 0x18($sp)
/* 175AE4 80247204 8FB10014 */  lw        $s1, 0x14($sp)
/* 175AE8 80247208 8FB00010 */  lw        $s0, 0x10($sp)
D_8024720C:
/* 175AEC 8024720C 03E00008 */  jr        $ra
/* 175AF0 80247210 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

void btl_state_update_partner_move(void) {
    BattleStatus* battleStatus = &gBattleStatus;
    PlayerData* playerData = &gPlayerData;
    Actor* player = battleStatus->playerActor;
    Actor* partner = battleStatus->partnerActor;
    Actor* enemyActor;
    Evt* script;
    s8 switchCondition;
    s32 enemyFound;
    s32 messageIndex;
    s32 i;

    switch (gBattleSubState) {
        case BTL_SUBSTATE_PARTNER_MOVE_INIT:
            if (partner == NULL) {
                btl_set_state(BATTLE_STATE_9);
                break;
            }
            battleStatus->stateFreezeCount = 0;
            battleStatus->unk_86 = 127;
            battleStatus->blockResult = 127;
            battleStatus->currentDamageSource = DMG_SRC_DEFAULT;
            gBattleStatus.flags1 &= ~BS_FLAGS1_AUTO_SUCCEED_ACTION;
            gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN;
            reset_actor_turn_info();
            partner->statusAfflicted = 0;
            partner->flags &= ~ACTOR_FLAG_8000000;
            player->flags &= ~ACTOR_FLAG_8000000;
            deduct_current_move_fp();
            btl_cam_target_actor(ACTOR_PARTNER);
            gBattleStatus.flags2 |= BS_FLAGS2_10;
            gBattleStatus.flags1 &= ~BS_FLAGS1_YIELD_TURN;

            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                enemyActor = battleStatus->enemyActors[i];
                if (enemyActor != NULL) {
                    enemyActor->statusAfflicted = 0;
                }
            }
            btl_cam_use_preset(BTL_CAM_DEFAULT);
            gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_EXECUTE_MOVE;
            break;
        case BTL_SUBSTATE_PARTNER_MOVE_EXECUTE_MOVE:
            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                enemyActor = battleStatus->enemyActors[i];
                if (enemyActor != NULL) {
                    enemyActor->flags &= ~ACTOR_FLAG_HEALTH_BAR_HIDDEN;
                    enemyActor->flags &= ~ACTOR_FLAG_8000000;
                }
            }

            increment_status_bar_disabled();
            gBattleStatus.flags1 |= BS_FLAGS1_100;
            reset_actor_turn_info();
            reset_all_actor_sounds(partner);
            battleStatus->battlePhase = PHASE_EXECUTE_ACTION;
            script = start_script(partner->takeTurnSource, EVT_PRIORITY_A, 0);
            partner->takeTurnScript = script;
            partner->takeTurnScriptID = script->id;
            script->owner1.actorID = ACTOR_PARTNER;
            gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_HANDLE_RESULTS;
            break;
        case BTL_SUBSTATE_PARTNER_MOVE_HANDLE_RESULTS:
            if (!(gBattleStatus.flags1 & BS_FLAGS1_YIELD_TURN)) {
                if (partner->takeTurnScript != NULL && does_script_exist(partner->takeTurnScriptID)) {
                    break;
                }
                partner->takeTurnScript = NULL;
            }
            gBattleStatus.flags1 &= ~BS_FLAGS1_100;

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

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

            enemyFound = FALSE;
            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                enemyActor = battleStatus->enemyActors[i];
                if (enemyActor != NULL && enemyActor->takeTurnScript != NULL) {
                    if (does_script_exist(enemyActor->takeTurnScriptID)) {
                        enemyFound = TRUE;
                    } else {
                        enemyActor->takeTurnScript = NULL;
                    }
                }
            }
            if (enemyFound) {
                break;
            }

            enemyFound = FALSE;
            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                enemyActor = battleStatus->enemyActors[i];
                if (enemyActor != NULL && enemyActor->handleEventScript != NULL) {
                    if (does_script_exist(enemyActor->handleEventScriptID)) {
                        enemyFound = TRUE;
                    } else {
                        enemyActor->handleEventScript = NULL;
                    }
                }
            }
            if (enemyFound) {
                break;
            }

            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                enemyActor = battleStatus->enemyActors[i];
                if (enemyActor != NULL) {
                    enemyActor->flags &= ~ACTOR_FLAG_HEALTH_BAR_HIDDEN;
                }
            }

            if (battleStatus->stateFreezeCount != 0) {
                break;
            }

            if (gGameStatusPtr->demoFlags & 1) {
                btl_set_state(BATTLE_STATE_END_DEMO_BATTLE);
                break;
            }
            decrement_status_bar_disabled();
            if (playerData->currentPartner == PARTNER_GOOMBARIO
                    && battleStatus->moveCategory == BTL_MENU_TYPE_CHANGE_PARTNER
                    && battleStatus->selectedMoveID != MOVE_CHARGE) {
                partner->isGlowing = 0;
                gBattleStatus.flags1 &= ~BS_FLAGS1_GOOMBARIO_CHARGED;
            }
            if (btl_check_player_defeated()) {
                return;
            }

            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                enemyActor = battleStatus->enemyActors[i];
                if (enemyActor != NULL) {
                    if (!(enemyActor->flags & ACTOR_FLAG_NO_DMG_APPLY)) {
                        enemyActor->flags |= (ACTOR_FLAG_8000000 | ACTOR_FLAG_4000000);
                    }
                }
            }

            btl_update_ko_status();

            if (partner->statusAfflicted == STATUS_KEY_DAZE && !btl_are_all_enemies_defeated()) {
                btl_cam_use_preset(BTL_CAM_PARTNER_INJURED);
                btl_show_battle_message(BTL_MSG_PARTNER_INJURED, 60);
                partner->statusAfflicted = 0;
                partner->disableDismissTimer = 0;
                gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_AWAIT_PARTNER_STATUS_POPUP;
                partner->flags |= ACTOR_FLAG_8000000;
            } else {
                gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_CHECK_ENEMY_STATUS;
            }
            break;
        case BTL_SUBSTATE_PARTNER_MOVE_AWAIT_PARTNER_STATUS_POPUP:
            if (btl_is_popup_displayed()) {
                break;
            }
            btl_cam_use_preset(BTL_CAM_DEFAULT);
            btl_cam_move(15);
            D_8029F248 = 10;
            gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_POST_PARTNER_STATUS_POPUP;
            break;
        case BTL_SUBSTATE_PARTNER_MOVE_POST_PARTNER_STATUS_POPUP:
            if (D_8029F248 != 0) {
                D_8029F248--;
            } else {
                gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_CHECK_ENEMY_STATUS;
            }
            break;
    }

    switch (gBattleSubState) {
        case BTL_SUBSTATE_PARTNER_MOVE_CHECK_ENEMY_STATUS:
            enemyFound = FALSE;
            for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                enemyActor = battleStatus->enemyActors[i];
                if (enemyActor != NULL) {
                    if (enemyActor->statusAfflicted != 0) {
                        enemyFound = TRUE;
                        break;
                    }
                }
            }

            if (!enemyFound) {
                gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_DONE;
            } else {
                btl_cam_use_preset(BTL_CAM_PRESET_03);
                switchCondition = enemyActor->statusAfflicted - 4;
                switch (switchCondition) {
                    case 0:
                        messageIndex = BTL_MSG_ENEMY_DAZED;
                        break;
                    case 2:
                        messageIndex = BTL_MSG_ENEMY_ASLEEP;
                        break;
                    case 3:
                        messageIndex = BTL_MSG_ENEMY_FROZEN;
                        break;
                    case 5:
                        messageIndex = BTL_MSG_ENEMY_POISONED;
                        break;
                    case 6:
                        messageIndex = BTL_MSG_ENEMY_SHRUNK;
                        break;
                    case 1:
                        messageIndex = BTL_MSG_ENEMY_PARALYZED;
                        break;
                    case 7:
                        messageIndex = BTL_MSG_ENEMY_ELECTRIFIED;
                        break;
                    case 4:
                        messageIndex = BTL_MSG_ENEMY_CANT_MOVE;
                        break;
                    default:
                        messageIndex = 0;
                        gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_CHECK_ENEMY_STATUS;
                        break;
                }

                sfx_play_sound(SOUND_2107);
                btl_show_battle_message(messageIndex, 60);

                for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                    enemyActor = battleStatus->enemyActors[i];
                    if (enemyActor != NULL) {
                        enemyActor->statusAfflicted = 0;
                    }
                }
                gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_AWAIT_ENEMY_STATUS_POPUP;
            }
            break;
        case BTL_SUBSTATE_PARTNER_MOVE_AWAIT_ENEMY_STATUS_POPUP:
            if (btl_is_popup_displayed() == FALSE) {
                btl_cam_use_preset(BTL_CAM_DEFAULT);
                btl_cam_move(15);
                D_8029F248 = 10;
                gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_POST_ENEMY_STATUS_POPUP;
            }
            break;
        case BTL_SUBSTATE_PARTNER_MOVE_POST_ENEMY_STATUS_POPUP:
            if (D_8029F248 != 0) {
                D_8029F248--;
            } else {
                gBattleSubState = BTL_SUBSTATE_PARTNER_MOVE_DONE;
            }
            break;
    }

    if (gBattleSubState == BTL_SUBSTATE_PARTNER_MOVE_DONE) {
        if (partner->takeTurnScript != NULL && does_script_exist(partner->takeTurnScriptID)) {
            return;
        }
        partner->takeTurnScript = NULL;
        btl_set_state(BATTLE_STATE_END_PARTNER_TURN);
    }
}