### RAW ASSEMBLY INSTRUCTIONS:

glabel red_impact_appendGfx
/* 3D42AC E00D048C 27BDFED8 */  addiu     $sp, $sp, -0x128
/* 3D42B0 E00D0490 3C07DB06 */  lui       $a3, (0xDB060024 >> 16)
/* 3D42B4 E00D0494 34E70024 */  ori       $a3, $a3, (0xDB060024 & 0xFFFF)
/* 3D42B8 E00D0498 AFA40128 */  sw        $a0, 0x128($sp)
/* 3D42BC E00D049C 27A40020 */  addiu     $a0, $sp, 0x20
/* 3D42C0 E00D04A0 AFB000D8 */  sw        $s0, 0xD8($sp)
/* 3D42C4 E00D04A4 3C100001 */  lui       $s0, (0x11630 >> 16)
/* 3D42C8 E00D04A8 AFB300E4 */  sw        $s3, 0xE4($sp)
/* 3D42CC E00D04AC 3C13800A */  lui       $s3, %hi(gMainGfxPos)
/* 3D42D0 E00D04B0 2673A66C */  addiu     $s3, $s3, %lo(gMainGfxPos)
/* 3D42D4 E00D04B4 36101630 */  ori       $s0, $s0, (0x11630 & 0xFFFF)
/* 3D42D8 E00D04B8 AFBF00FC */  sw        $ra, 0xFC($sp)
/* 3D42DC E00D04BC AFBE00F8 */  sw        $fp, 0xF8($sp)
/* 3D42E0 E00D04C0 AFB700F4 */  sw        $s7, 0xF4($sp)
/* 3D42E4 E00D04C4 AFB600F0 */  sw        $s6, 0xF0($sp)
/* 3D42E8 E00D04C8 AFB500EC */  sw        $s5, 0xEC($sp)
/* 3D42EC E00D04CC AFB400E8 */  sw        $s4, 0xE8($sp)
/* 3D42F0 E00D04D0 AFB200E0 */  sw        $s2, 0xE0($sp)
/* 3D42F4 E00D04D4 AFB100DC */  sw        $s1, 0xDC($sp)
/* 3D42F8 E00D04D8 F7BC0120 */  sdc1      $f28, 0x120($sp)
/* 3D42FC E00D04DC F7BA0118 */  sdc1      $f26, 0x118($sp)
/* 3D4300 E00D04E0 F7B80110 */  sdc1      $f24, 0x110($sp)
/* 3D4304 E00D04E4 F7B60108 */  sdc1      $f22, 0x108($sp)
/* 3D4308 E00D04E8 F7B40100 */  sdc1      $f20, 0x100($sp)
/* 3D430C E00D04EC 8E660000 */  lw        $a2, 0x0($s3)
/* 3D4310 E00D04F0 8FAD0128 */  lw        $t5, 0x128($sp)
/* 3D4314 E00D04F4 4480A000 */  mtc1      $zero, $f20
/* 3D4318 E00D04F8 3C01E00D */  lui       $at, (0xE00D0B40 >> 16)
/* 3D431C E00D04FC D4200B40 */  ldc1      $f0, (0xE00D0B40 & 0xFFFF)($at)
/* 3D4320 E00D0500 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3D4324 E00D0504 4481B000 */  mtc1      $at, $f22
/* 3D4328 E00D0508 00C0182D */  daddu     $v1, $a2, $zero
/* 3D432C E00D050C 24C60008 */  addiu     $a2, $a2, 0x8
/* 3D4330 E00D0510 8DB1000C */  lw        $s1, 0xC($t5)
/* 3D4334 E00D0514 4405A000 */  mfc1      $a1, $f20
/* 3D4338 E00D0518 96220000 */  lhu       $v0, 0x0($s1)
/* 3D433C E00D051C C624001C */  lwc1      $f4, 0x1C($s1)
/* 3D4340 E00D0520 C6260020 */  lwc1      $f6, 0x20($s1)
/* 3D4344 E00D0524 C6280024 */  lwc1      $f8, 0x24($s1)
/* 3D4348 E00D0528 922D0050 */  lbu       $t5, 0x50($s1)
/* 3D434C E00D052C 00021080 */  sll       $v0, $v0, 2
/* 3D4350 E00D0530 3C08E00D */  lui       $t0, (0xE00D0B10 >> 16)
/* 3D4354 E00D0534 01024021 */  addu      $t0, $t0, $v0
/* 3D4358 E00D0538 8D080B10 */  lw        $t0, (0xE00D0B10 & 0xFFFF)($t0)
/* 3D435C E00D053C 46002121 */  cvt.d.s   $f4, $f4
/* 3D4360 E00D0540 AFAD00A4 */  sw        $t5, 0xA4($sp)
/* 3D4364 E00D0544 922D0051 */  lbu       $t5, 0x51($s1)
/* 3D4368 E00D0548 46202102 */  mul.d     $f4, $f4, $f0
/* 3D436C E00D054C 00000000 */  nop
/* 3D4370 E00D0550 AFAD00A8 */  sw        $t5, 0xA8($sp)
/* 3D4374 E00D0554 922D0052 */  lbu       $t5, 0x52($s1)
/* 3D4378 E00D0558 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 3D437C E00D055C AFAD00AC */  sw        $t5, 0xAC($sp)
/* 3D4380 E00D0560 922D0053 */  lbu       $t5, 0x53($s1)
/* 3D4384 E00D0564 460031A1 */  cvt.d.s   $f6, $f6
/* 3D4388 E00D0568 AFAD00B0 */  sw        $t5, 0xB0($sp)
/* 3D438C E00D056C 922D0054 */  lbu       $t5, 0x54($s1)
/* 3D4390 E00D0570 46203182 */  mul.d     $f6, $f6, $f0
/* 3D4394 E00D0574 00000000 */  nop
/* 3D4398 E00D0578 AFAD00B4 */  sw        $t5, 0xB4($sp)
/* 3D439C E00D057C 922D0055 */  lbu       $t5, 0x55($s1)
/* 3D43A0 E00D0580 46004221 */  cvt.d.s   $f8, $f8
/* 3D43A4 E00D0584 AFAD00B8 */  sw        $t5, 0xB8($sp)
/* 3D43A8 E00D0588 AC620000 */  sw        $v0, 0x0($v1)
/* 3D43AC E00D058C AC600004 */  sw        $zero, 0x4($v1)
/* 3D43B0 E00D0590 ACC70000 */  sw        $a3, 0x0($a2)
/* 3D43B4 E00D0594 8FAD0128 */  lw        $t5, 0x128($sp)
/* 3D43B8 E00D0598 46204202 */  mul.d     $f8, $f8, $f0
/* 3D43BC E00D059C 00000000 */  nop
/* 3D43C0 E00D05A0 8DA20010 */  lw        $v0, 0x10($t5)
/* 3D43C4 E00D05A4 4407A000 */  mfc1      $a3, $f20
/* 3D43C8 E00D05A8 8C43001C */  lw        $v1, 0x1C($v0)
/* 3D43CC E00D05AC 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 3D43D0 E00D05B0 ACC20008 */  sw        $v0, 0x8($a2)
/* 3D43D4 E00D05B4 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 3D43D8 E00D05B8 00621821 */  addu      $v1, $v1, $v0
/* 3D43DC E00D05BC ACC30004 */  sw        $v1, 0x4($a2)
/* 3D43E0 E00D05C0 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 3D43E4 E00D05C4 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 3D43E8 E00D05C8 46202720 */  cvt.s.d   $f28, $f4
/* 3D43EC E00D05CC ACC8000C */  sw        $t0, 0xC($a2)
/* 3D43F0 E00D05D0 00031080 */  sll       $v0, $v1, 2
/* 3D43F4 E00D05D4 00431021 */  addu      $v0, $v0, $v1
/* 3D43F8 E00D05D8 00021080 */  sll       $v0, $v0, 2
/* 3D43FC E00D05DC 00431023 */  subu      $v0, $v0, $v1
/* 3D4400 E00D05E0 000218C0 */  sll       $v1, $v0, 3
/* 3D4404 E00D05E4 00431021 */  addu      $v0, $v0, $v1
/* 3D4408 E00D05E8 000210C0 */  sll       $v0, $v0, 3
/* 3D440C E00D05EC 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 3D4410 E00D05F0 00220821 */  addu      $at, $at, $v0
/* 3D4414 E00D05F4 C42A1DEC */  lwc1      $f10, %lo(gCameras + 0x6C)($at)
/* 3D4418 E00D05F8 24C20008 */  addiu     $v0, $a2, 0x8
/* 3D441C E00D05FC AE660000 */  sw        $a2, 0x0($s3)
/* 3D4420 E00D0600 E7B60010 */  swc1      $f22, 0x10($sp)
/* 3D4424 E00D0604 C6220004 */  lwc1      $f2, 0x4($s1)
/* 3D4428 E00D0608 24C60010 */  addiu     $a2, $a2, 0x10
/* 3D442C E00D060C AE620000 */  sw        $v0, 0x0($s3)
/* 3D4430 E00D0610 E7A20014 */  swc1      $f2, 0x14($sp)
/* 3D4434 E00D0614 C6200008 */  lwc1      $f0, 0x8($s1)
/* 3D4438 E00D0618 46005287 */  neg.s     $f10, $f10
/* 3D443C E00D061C AE660000 */  sw        $a2, 0x0($s3)
/* 3D4440 E00D0620 44065000 */  mfc1      $a2, $f10
/* 3D4444 E00D0624 462036A0 */  cvt.s.d   $f26, $f6
/* 3D4448 E00D0628 E7A00018 */  swc1      $f0, 0x18($sp)
/* 3D444C E00D062C C620000C */  lwc1      $f0, 0xC($s1)
/* 3D4450 E00D0630 46204620 */  cvt.s.d   $f24, $f8
/* 3D4454 E00D0634 0C080180 */  jal       shim_guPositionF
/* 3D4458 E00D0638 E7A0001C */   swc1     $f0, 0x1C($sp)
/* 3D445C E00D063C 27A40020 */  addiu     $a0, $sp, 0x20
/* 3D4460 E00D0640 3C158007 */  lui       $s5, %hi(gMatrixListPos)
/* 3D4464 E00D0644 26B541F0 */  addiu     $s5, $s5, %lo(gMatrixListPos)
/* 3D4468 E00D0648 3C16800A */  lui       $s6, %hi(gDisplayContext)
/* 3D446C E00D064C 26D6A674 */  addiu     $s6, $s6, %lo(gDisplayContext)
/* 3D4470 E00D0650 96A50000 */  lhu       $a1, 0x0($s5)
/* 3D4474 E00D0654 8EC20000 */  lw        $v0, 0x0($s6)
/* 3D4478 E00D0658 00052980 */  sll       $a1, $a1, 6
/* 3D447C E00D065C 00B02821 */  addu      $a1, $a1, $s0
/* 3D4480 E00D0660 0C080118 */  jal       shim_guMtxF2L
/* 3D4484 E00D0664 00452821 */   addu     $a1, $v0, $a1
/* 3D4488 E00D0668 24140001 */  addiu     $s4, $zero, 0x1
/* 3D448C E00D066C 3C02DA38 */  lui       $v0, (0xDA380000 >> 16)
/* 3D4490 E00D0670 8E650000 */  lw        $a1, 0x0($s3)
/* 3D4494 E00D0674 96A40000 */  lhu       $a0, 0x0($s5)
/* 3D4498 E00D0678 00A0302D */  daddu     $a2, $a1, $zero
/* 3D449C E00D067C 24A50008 */  addiu     $a1, $a1, 0x8
/* 3D44A0 E00D0680 ACC20000 */  sw        $v0, 0x0($a2)
/* 3D44A4 E00D0684 3082FFFF */  andi      $v0, $a0, 0xFFFF
/* 3D44A8 E00D0688 00021180 */  sll       $v0, $v0, 6
/* 3D44AC E00D068C 00501021 */  addu      $v0, $v0, $s0
/* 3D44B0 E00D0690 00942021 */  addu      $a0, $a0, $s4
/* 3D44B4 E00D0694 8EC30000 */  lw        $v1, 0x0($s6)
/* 3D44B8 E00D0698 00A0B82D */  daddu     $s7, $a1, $zero
/* 3D44BC E00D069C 00621821 */  addu      $v1, $v1, $v0
/* 3D44C0 E00D06A0 ACC30004 */  sw        $v1, 0x4($a2)
/* 3D44C4 E00D06A4 8E2D0038 */  lw        $t5, 0x38($s1)
/* 3D44C8 E00D06A8 26E30008 */  addiu     $v1, $s7, 0x8
/* 3D44CC E00D06AC AFAD00A0 */  sw        $t5, 0xA0($sp)
/* 3D44D0 E00D06B0 AE650000 */  sw        $a1, 0x0($s3)
/* 3D44D4 E00D06B4 A6A40000 */  sh        $a0, 0x0($s5)
/* 3D44D8 E00D06B8 AE630000 */  sw        $v1, 0x0($s3)
/* 3D44DC E00D06BC 8FAD00A4 */  lw        $t5, 0xA4($sp)
/* 3D44E0 E00D06C0 AFAD00BC */  sw        $t5, 0xBC($sp)
/* 3D44E4 E00D06C4 8FAD00A8 */  lw        $t5, 0xA8($sp)
/* 3D44E8 E00D06C8 AFAD00C0 */  sw        $t5, 0xC0($sp)
/* 3D44EC E00D06CC 8FAD00AC */  lw        $t5, 0xAC($sp)
/* 3D44F0 E00D06D0 AFAD00C4 */  sw        $t5, 0xC4($sp)
/* 3D44F4 E00D06D4 8FAD00B0 */  lw        $t5, 0xB0($sp)
/* 3D44F8 E00D06D8 AFAD00C8 */  sw        $t5, 0xC8($sp)
/* 3D44FC E00D06DC 8FAD00B4 */  lw        $t5, 0xB4($sp)
/* 3D4500 E00D06E0 AFAD00CC */  sw        $t5, 0xCC($sp)
/* 3D4504 E00D06E4 8FAD00B8 */  lw        $t5, 0xB8($sp)
/* 3D4508 E00D06E8 AFAD00D0 */  sw        $t5, 0xD0($sp)
/* 3D450C E00D06EC 8FAD0128 */  lw        $t5, 0x128($sp)
/* 3D4510 E00D06F0 8DA20008 */  lw        $v0, 0x8($t5)
/* 3D4514 E00D06F4 26310058 */  addiu     $s1, $s1, 0x58
/* 3D4518 E00D06F8 0282102A */  slt       $v0, $s4, $v0
/* 3D451C E00D06FC 10400087 */  beqz      $v0, .LE00D091C
/* 3D4520 E00D0700 AFA300D4 */   sw       $v1, 0xD4($sp)
/* 3D4524 E00D0704 27B20060 */  addiu     $s2, $sp, 0x60
/* 3D4528 E00D0708 02A0B02D */  daddu     $s6, $s5, $zero
/* 3D452C E00D070C 3C150001 */  lui       $s5, (0x11630 >> 16)
/* 3D4530 E00D0710 36B51630 */  ori       $s5, $s5, (0x11630 & 0xFFFF)
/* 3D4534 E00D0714 3C1EF200 */  lui       $fp, (0xF2000000 >> 16)
/* 3D4538 E00D0718 26300044 */  addiu     $s0, $s1, 0x44
.LE00D071C:
/* 3D453C E00D071C 8E020008 */  lw        $v0, 0x8($s0)
/* 3D4540 E00D0720 04400078 */  bltz      $v0, .LE00D0904
/* 3D4544 E00D0724 00000000 */   nop
/* 3D4548 E00D0728 8E05FFC0 */  lw        $a1, -0x40($s0)
/* 3D454C E00D072C 8E06FFC4 */  lw        $a2, -0x3C($s0)
/* 3D4550 E00D0730 8E07FFC8 */  lw        $a3, -0x38($s0)
/* 3D4554 E00D0734 0C080108 */  jal       shim_guTranslateF
/* 3D4558 E00D0738 27A40020 */   addiu    $a0, $sp, 0x20
/* 3D455C E00D073C E7B60010 */  swc1      $f22, 0x10($sp)
/* 3D4560 E00D0740 8E05FFF0 */  lw        $a1, -0x10($s0)
/* 3D4564 E00D0744 4406A000 */  mfc1      $a2, $f20
/* 3D4568 E00D0748 4407A000 */  mfc1      $a3, $f20
/* 3D456C E00D074C 0C080104 */  jal       shim_guRotateF
/* 3D4570 E00D0750 0240202D */   daddu    $a0, $s2, $zero
/* 3D4574 E00D0754 0240202D */  daddu     $a0, $s2, $zero
/* 3D4578 E00D0758 27A50020 */  addiu     $a1, $sp, 0x20
/* 3D457C E00D075C 0C080114 */  jal       shim_guMtxCatF
/* 3D4580 E00D0760 00A0302D */   daddu    $a2, $a1, $zero
/* 3D4584 E00D0764 C600FFD8 */  lwc1      $f0, -0x28($s0)
/* 3D4588 E00D0768 461C0002 */  mul.s     $f0, $f0, $f28
/* 3D458C E00D076C 00000000 */  nop
/* 3D4590 E00D0770 44050000 */  mfc1      $a1, $f0
/* 3D4594 E00D0774 C600FFDC */  lwc1      $f0, -0x24($s0)
/* 3D4598 E00D0778 461A0002 */  mul.s     $f0, $f0, $f26
/* 3D459C E00D077C 00000000 */  nop
/* 3D45A0 E00D0780 44060000 */  mfc1      $a2, $f0
/* 3D45A4 E00D0784 C600FFE0 */  lwc1      $f0, -0x20($s0)
/* 3D45A8 E00D0788 46180002 */  mul.s     $f0, $f0, $f24
/* 3D45AC E00D078C 00000000 */  nop
/* 3D45B0 E00D0790 44070000 */  mfc1      $a3, $f0
/* 3D45B4 E00D0794 0C080110 */  jal       shim_guScaleF
/* 3D45B8 E00D0798 0240202D */   daddu    $a0, $s2, $zero
/* 3D45BC E00D079C 0240202D */  daddu     $a0, $s2, $zero
/* 3D45C0 E00D07A0 27A50020 */  addiu     $a1, $sp, 0x20
/* 3D45C4 E00D07A4 0C080114 */  jal       shim_guMtxCatF
/* 3D45C8 E00D07A8 00A0302D */   daddu    $a2, $a1, $zero
/* 3D45CC E00D07AC E7B40010 */  swc1      $f20, 0x10($sp)
/* 3D45D0 E00D07B0 8E05FFEC */  lw        $a1, -0x14($s0)
/* 3D45D4 E00D07B4 4406A000 */  mfc1      $a2, $f20
/* 3D45D8 E00D07B8 4407B000 */  mfc1      $a3, $f22
/* 3D45DC E00D07BC 0C080104 */  jal       shim_guRotateF
/* 3D45E0 E00D07C0 0240202D */   daddu    $a0, $s2, $zero
/* 3D45E4 E00D07C4 0240202D */  daddu     $a0, $s2, $zero
/* 3D45E8 E00D07C8 27A50020 */  addiu     $a1, $sp, 0x20
/* 3D45EC E00D07CC 0C080114 */  jal       shim_guMtxCatF
/* 3D45F0 E00D07D0 00A0302D */   daddu    $a2, $a1, $zero
/* 3D45F4 E00D07D4 27A40020 */  addiu     $a0, $sp, 0x20
/* 3D45F8 E00D07D8 96C50000 */  lhu       $a1, 0x0($s6)
/* 3D45FC E00D07DC 3C02800A */  lui       $v0, %hi(gDisplayContext)
/* 3D4600 E00D07E0 8C42A674 */  lw        $v0, %lo(gDisplayContext)($v0)
/* 3D4604 E00D07E4 00052980 */  sll       $a1, $a1, 6
/* 3D4608 E00D07E8 00B52821 */  addu      $a1, $a1, $s5
/* 3D460C E00D07EC 0C080118 */  jal       shim_guMtxF2L
/* 3D4610 E00D07F0 00452821 */   addu     $a1, $v0, $a1
/* 3D4614 E00D07F4 3C06000F */  lui       $a2, (0xFC000 >> 16)
/* 3D4618 E00D07F8 34C6C000 */  ori       $a2, $a2, (0xFC000 & 0xFFFF)
/* 3D461C E00D07FC 3C080107 */  lui       $t0, (0x107C000 >> 16)
/* 3D4620 E00D0800 3508C000 */  ori       $t0, $t0, (0x107C000 & 0xFFFF)
/* 3D4624 E00D0804 3C07D838 */  lui       $a3, (0xD8380002 >> 16)
/* 3D4628 E00D0808 34E70002 */  ori       $a3, $a3, (0xD8380002 & 0xFFFF)
/* 3D462C E00D080C 8E630000 */  lw        $v1, 0x0($s3)
/* 3D4630 E00D0810 C600FFF8 */  lwc1      $f0, -0x8($s0)
/* 3D4634 E00D0814 0060282D */  daddu     $a1, $v1, $zero
/* 3D4638 E00D0818 24630008 */  addiu     $v1, $v1, 0x8
/* 3D463C E00D081C 4600030D */  trunc.w.s $f12, $f0
/* 3D4640 E00D0820 44026000 */  mfc1      $v0, $f12
/* 3D4644 E00D0824 00000000 */  nop
/* 3D4648 E00D0828 30420FFF */  andi      $v0, $v0, 0xFFF
/* 3D464C E00D082C 005E1025 */  or        $v0, $v0, $fp
/* 3D4650 E00D0830 AE630000 */  sw        $v1, 0x0($s3)
/* 3D4654 E00D0834 ACA20000 */  sw        $v0, 0x0($a1)
/* 3D4658 E00D0838 24620008 */  addiu     $v0, $v1, 0x8
/* 3D465C E00D083C AE620000 */  sw        $v0, 0x0($s3)
/* 3D4660 E00D0840 96C40000 */  lhu       $a0, 0x0($s6)
/* 3D4664 E00D0844 24620010 */  addiu     $v0, $v1, 0x10
/* 3D4668 E00D0848 AE620000 */  sw        $v0, 0x0($s3)
/* 3D466C E00D084C 24820001 */  addiu     $v0, $a0, 0x1
/* 3D4670 E00D0850 A6C20000 */  sh        $v0, 0x0($s6)
/* 3D4674 E00D0854 24620018 */  addiu     $v0, $v1, 0x18
/* 3D4678 E00D0858 3084FFFF */  andi      $a0, $a0, 0xFFFF
/* 3D467C E00D085C 00042180 */  sll       $a0, $a0, 6
/* 3D4680 E00D0860 C600FFF8 */  lwc1      $f0, -0x8($s0)
/* 3D4684 E00D0864 00952021 */  addu      $a0, $a0, $s5
/* 3D4688 E00D0868 AE620000 */  sw        $v0, 0x0($s3)
/* 3D468C E00D086C 4600030D */  trunc.w.s $f12, $f0
/* 3D4690 E00D0870 44026000 */  mfc1      $v0, $f12
/* 3D4694 E00D0874 00000000 */  nop
/* 3D4698 E00D0878 2442007C */  addiu     $v0, $v0, 0x7C
/* 3D469C E00D087C 30420FFF */  andi      $v0, $v0, 0xFFF
/* 3D46A0 E00D0880 00461025 */  or        $v0, $v0, $a2
/* 3D46A4 E00D0884 ACA20004 */  sw        $v0, 0x4($a1)
/* 3D46A8 E00D0888 C6000000 */  lwc1      $f0, 0x0($s0)
/* 3D46AC E00D088C 24620020 */  addiu     $v0, $v1, 0x20
/* 3D46B0 E00D0890 AE620000 */  sw        $v0, 0x0($s3)
/* 3D46B4 E00D0894 4600030D */  trunc.w.s $f12, $f0
/* 3D46B8 E00D0898 44026000 */  mfc1      $v0, $f12
/* 3D46BC E00D089C 00000000 */  nop
/* 3D46C0 E00D08A0 30420FFF */  andi      $v0, $v0, 0xFFF
/* 3D46C4 E00D08A4 005E1025 */  or        $v0, $v0, $fp
/* 3D46C8 E00D08A8 AC620000 */  sw        $v0, 0x0($v1)
/* 3D46CC E00D08AC C6000000 */  lwc1      $f0, 0x0($s0)
/* 3D46D0 E00D08B0 3C02DA38 */  lui       $v0, (0xDA380000 >> 16)
/* 3D46D4 E00D08B4 AC620008 */  sw        $v0, 0x8($v1)
/* 3D46D8 E00D08B8 3C02800A */  lui       $v0, %hi(gDisplayContext)
/* 3D46DC E00D08BC 8C42A674 */  lw        $v0, %lo(gDisplayContext)($v0)
/* 3D46E0 E00D08C0 3C0D0900 */  lui       $t5, %hi(D_09000940_4159A0)
/* 3D46E4 E00D08C4 25AD0940 */  addiu     $t5, $t5, %lo(D_09000940_4159A0)
/* 3D46E8 E00D08C8 AC6D0014 */  sw        $t5, 0x14($v1)
/* 3D46EC E00D08CC AC670018 */  sw        $a3, 0x18($v1)
/* 3D46F0 E00D08D0 00441021 */  addu      $v0, $v0, $a0
/* 3D46F4 E00D08D4 AC62000C */  sw        $v0, 0xC($v1)
/* 3D46F8 E00D08D8 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 3D46FC E00D08DC AC620010 */  sw        $v0, 0x10($v1)
/* 3D4700 E00D08E0 24020040 */  addiu     $v0, $zero, 0x40
/* 3D4704 E00D08E4 AC62001C */  sw        $v0, 0x1C($v1)
/* 3D4708 E00D08E8 4600030D */  trunc.w.s $f12, $f0
/* 3D470C E00D08EC 44026000 */  mfc1      $v0, $f12
/* 3D4710 E00D08F0 00000000 */  nop
/* 3D4714 E00D08F4 2442007C */  addiu     $v0, $v0, 0x7C
/* 3D4718 E00D08F8 30420FFF */  andi      $v0, $v0, 0xFFF
/* 3D471C E00D08FC 00481025 */  or        $v0, $v0, $t0
/* 3D4720 E00D0900 AC620004 */  sw        $v0, 0x4($v1)
.LE00D0904:
/* 3D4724 E00D0904 8FAD0128 */  lw        $t5, 0x128($sp)
/* 3D4728 E00D0908 26940001 */  addiu     $s4, $s4, 0x1
/* 3D472C E00D090C 8DA20008 */  lw        $v0, 0x8($t5)
/* 3D4730 E00D0910 0282102A */  slt       $v0, $s4, $v0
/* 3D4734 E00D0914 1440FF81 */  bnez      $v0, .LE00D071C
/* 3D4738 E00D0918 26100058 */   addiu    $s0, $s0, 0x58
.LE00D091C:
/* 3D473C E00D091C 3C0AD9FF */  lui       $t2, (0xD9FFF9FF >> 16)
/* 3D4740 E00D0920 354AF9FF */  ori       $t2, $t2, (0xD9FFF9FF & 0xFFFF)
/* 3D4744 E00D0924 3C05800A */  lui       $a1, %hi(gMainGfxPos)
/* 3D4748 E00D0928 24A5A66C */  addiu     $a1, $a1, %lo(gMainGfxPos)
/* 3D474C E00D092C 3C02DF00 */  lui       $v0, (0xDF000000 >> 16)
/* 3D4750 E00D0930 8CA30000 */  lw        $v1, 0x0($a1)
/* 3D4754 E00D0934 3C09FA00 */  lui       $t1, (0xFA000000 >> 16)
/* 3D4758 E00D0938 0060202D */  daddu     $a0, $v1, $zero
/* 3D475C E00D093C 24630008 */  addiu     $v1, $v1, 0x8
/* 3D4760 E00D0940 ACA30000 */  sw        $v1, 0x0($a1)
/* 3D4764 E00D0944 AC820000 */  sw        $v0, 0x0($a0)
/* 3D4768 E00D0948 3C02DE01 */  lui       $v0, (0xDE010000 >> 16)
/* 3D476C E00D094C AC800004 */  sw        $zero, 0x4($a0)
/* 3D4770 E00D0950 AEE20000 */  sw        $v0, 0x0($s7)
/* 3D4774 E00D0954 24620008 */  addiu     $v0, $v1, 0x8
/* 3D4778 E00D0958 AEE30004 */  sw        $v1, 0x4($s7)
/* 3D477C E00D095C ACA20000 */  sw        $v0, 0x0($a1)
/* 3D4780 E00D0960 AC690000 */  sw        $t1, 0x0($v1)
/* 3D4784 E00D0964 8FAD00BC */  lw        $t5, 0xBC($sp)
/* 3D4788 E00D0968 3C0BD9FF */  lui       $t3, (0xD9FFFFFF >> 16)
/* 3D478C E00D096C 000D1600 */  sll       $v0, $t5, 24
/* 3D4790 E00D0970 8FAD00C0 */  lw        $t5, 0xC0($sp)
/* 3D4794 E00D0974 3C07FB00 */  lui       $a3, (0xFB000000 >> 16)
/* 3D4798 E00D0978 000D2400 */  sll       $a0, $t5, 16
/* 3D479C E00D097C 8FAD00C4 */  lw        $t5, 0xC4($sp)
/* 3D47A0 E00D0980 00441025 */  or        $v0, $v0, $a0
/* 3D47A4 E00D0984 000D2200 */  sll       $a0, $t5, 8
/* 3D47A8 E00D0988 8FAD00A0 */  lw        $t5, 0xA0($sp)
/* 3D47AC E00D098C 00441025 */  or        $v0, $v0, $a0
/* 3D47B0 E00D0990 31A800FF */  andi      $t0, $t5, 0xFF
/* 3D47B4 E00D0994 00481025 */  or        $v0, $v0, $t0
/* 3D47B8 E00D0998 AC620004 */  sw        $v0, 0x4($v1)
/* 3D47BC E00D099C 24620010 */  addiu     $v0, $v1, 0x10
/* 3D47C0 E00D09A0 ACA20000 */  sw        $v0, 0x0($a1)
/* 3D47C4 E00D09A4 AC670008 */  sw        $a3, 0x8($v1)
/* 3D47C8 E00D09A8 8FAD00C8 */  lw        $t5, 0xC8($sp)
/* 3D47CC E00D09AC 356BFFFF */  ori       $t3, $t3, (0xD9FFFFFF & 0xFFFF)
/* 3D47D0 E00D09B0 000D1600 */  sll       $v0, $t5, 24
/* 3D47D4 E00D09B4 8FAD00CC */  lw        $t5, 0xCC($sp)
/* 3D47D8 E00D09B8 3C06DE00 */  lui       $a2, (0xDE000000 >> 16)
/* 3D47DC E00D09BC 000D2400 */  sll       $a0, $t5, 16
/* 3D47E0 E00D09C0 8FAD00D0 */  lw        $t5, 0xD0($sp)
/* 3D47E4 E00D09C4 00441025 */  or        $v0, $v0, $a0
/* 3D47E8 E00D09C8 000D2200 */  sll       $a0, $t5, 8
/* 3D47EC E00D09CC 00441025 */  or        $v0, $v0, $a0
/* 3D47F0 E00D09D0 AC62000C */  sw        $v0, 0xC($v1)
/* 3D47F4 E00D09D4 24620018 */  addiu     $v0, $v1, 0x18
/* 3D47F8 E00D09D8 ACA20000 */  sw        $v0, 0x0($a1)
/* 3D47FC E00D09DC 24620020 */  addiu     $v0, $v1, 0x20
/* 3D4800 E00D09E0 AC6A0010 */  sw        $t2, 0x10($v1)
/* 3D4804 E00D09E4 AC600014 */  sw        $zero, 0x14($v1)
/* 3D4808 E00D09E8 ACA20000 */  sw        $v0, 0x0($a1)
/* 3D480C E00D09EC 24020200 */  addiu     $v0, $zero, 0x200
/* 3D4810 E00D09F0 AC62001C */  sw        $v0, 0x1C($v1)
/* 3D4814 E00D09F4 24620028 */  addiu     $v0, $v1, 0x28
/* 3D4818 E00D09F8 AC6B0018 */  sw        $t3, 0x18($v1)
/* 3D481C E00D09FC ACA20000 */  sw        $v0, 0x0($a1)
/* 3D4820 E00D0A00 AC660020 */  sw        $a2, 0x20($v1)
/* 3D4824 E00D0A04 8FAD00D4 */  lw        $t5, 0xD4($sp)
/* 3D4828 E00D0A08 24620030 */  addiu     $v0, $v1, 0x30
/* 3D482C E00D0A0C AC6D0024 */  sw        $t5, 0x24($v1)
/* 3D4830 E00D0A10 ACA20000 */  sw        $v0, 0x0($a1)
/* 3D4834 E00D0A14 AC690028 */  sw        $t1, 0x28($v1)
/* 3D4838 E00D0A18 8FAD00A4 */  lw        $t5, 0xA4($sp)
/* 3D483C E00D0A1C 000D1600 */  sll       $v0, $t5, 24
/* 3D4840 E00D0A20 8FAD00A8 */  lw        $t5, 0xA8($sp)
/* 3D4844 E00D0A24 000D2400 */  sll       $a0, $t5, 16
/* 3D4848 E00D0A28 8FAD00AC */  lw        $t5, 0xAC($sp)
/* 3D484C E00D0A2C 00441025 */  or        $v0, $v0, $a0
/* 3D4850 E00D0A30 000D2200 */  sll       $a0, $t5, 8
/* 3D4854 E00D0A34 00441025 */  or        $v0, $v0, $a0
/* 3D4858 E00D0A38 00481025 */  or        $v0, $v0, $t0
/* 3D485C E00D0A3C AC62002C */  sw        $v0, 0x2C($v1)
/* 3D4860 E00D0A40 24620038 */  addiu     $v0, $v1, 0x38
/* 3D4864 E00D0A44 ACA20000 */  sw        $v0, 0x0($a1)
/* 3D4868 E00D0A48 AC670030 */  sw        $a3, 0x30($v1)
/* 3D486C E00D0A4C 8FAD00B0 */  lw        $t5, 0xB0($sp)
/* 3D4870 E00D0A50 3C0CD838 */  lui       $t4, (0xD8380002 >> 16)
/* 3D4874 E00D0A54 000D1600 */  sll       $v0, $t5, 24
/* 3D4878 E00D0A58 8FAD00B4 */  lw        $t5, 0xB4($sp)
/* 3D487C E00D0A5C 358C0002 */  ori       $t4, $t4, (0xD8380002 & 0xFFFF)
/* 3D4880 E00D0A60 000D2400 */  sll       $a0, $t5, 16
/* 3D4884 E00D0A64 8FAD00B8 */  lw        $t5, 0xB8($sp)
/* 3D4888 E00D0A68 00441025 */  or        $v0, $v0, $a0
/* 3D488C E00D0A6C 000D2200 */  sll       $a0, $t5, 8
/* 3D4890 E00D0A70 00441025 */  or        $v0, $v0, $a0
/* 3D4894 E00D0A74 AC620034 */  sw        $v0, 0x34($v1)
/* 3D4898 E00D0A78 24620040 */  addiu     $v0, $v1, 0x40
/* 3D489C E00D0A7C ACA20000 */  sw        $v0, 0x0($a1)
/* 3D48A0 E00D0A80 24620048 */  addiu     $v0, $v1, 0x48
/* 3D48A4 E00D0A84 AC6A0038 */  sw        $t2, 0x38($v1)
/* 3D48A8 E00D0A88 AC60003C */  sw        $zero, 0x3C($v1)
/* 3D48AC E00D0A8C ACA20000 */  sw        $v0, 0x0($a1)
/* 3D48B0 E00D0A90 24020400 */  addiu     $v0, $zero, 0x400
/* 3D48B4 E00D0A94 AC620044 */  sw        $v0, 0x44($v1)
/* 3D48B8 E00D0A98 24620050 */  addiu     $v0, $v1, 0x50
/* 3D48BC E00D0A9C AC6B0040 */  sw        $t3, 0x40($v1)
/* 3D48C0 E00D0AA0 ACA20000 */  sw        $v0, 0x0($a1)
/* 3D48C4 E00D0AA4 AC660048 */  sw        $a2, 0x48($v1)
/* 3D48C8 E00D0AA8 8FAD00D4 */  lw        $t5, 0xD4($sp)
/* 3D48CC E00D0AAC 24620058 */  addiu     $v0, $v1, 0x58
/* 3D48D0 E00D0AB0 AC6D004C */  sw        $t5, 0x4C($v1)
/* 3D48D4 E00D0AB4 ACA20000 */  sw        $v0, 0x0($a1)
/* 3D48D8 E00D0AB8 24020040 */  addiu     $v0, $zero, 0x40
/* 3D48DC E00D0ABC AC6C0050 */  sw        $t4, 0x50($v1)
/* 3D48E0 E00D0AC0 AC620054 */  sw        $v0, 0x54($v1)
/* 3D48E4 E00D0AC4 8FBF00FC */  lw        $ra, 0xFC($sp)
/* 3D48E8 E00D0AC8 8FBE00F8 */  lw        $fp, 0xF8($sp)
/* 3D48EC E00D0ACC 8FB700F4 */  lw        $s7, 0xF4($sp)
/* 3D48F0 E00D0AD0 8FB600F0 */  lw        $s6, 0xF0($sp)
/* 3D48F4 E00D0AD4 8FB500EC */  lw        $s5, 0xEC($sp)
/* 3D48F8 E00D0AD8 8FB400E8 */  lw        $s4, 0xE8($sp)
/* 3D48FC E00D0ADC 8FB300E4 */  lw        $s3, 0xE4($sp)
/* 3D4900 E00D0AE0 8FB200E0 */  lw        $s2, 0xE0($sp)
/* 3D4904 E00D0AE4 8FB100DC */  lw        $s1, 0xDC($sp)
/* 3D4908 E00D0AE8 8FB000D8 */  lw        $s0, 0xD8($sp)
/* 3D490C E00D0AEC D7BC0120 */  ldc1      $f28, 0x120($sp)
/* 3D4910 E00D0AF0 D7BA0118 */  ldc1      $f26, 0x118($sp)
/* 3D4914 E00D0AF4 D7B80110 */  ldc1      $f24, 0x110($sp)
/* 3D4918 E00D0AF8 D7B60108 */  ldc1      $f22, 0x108($sp)
/* 3D491C E00D0AFC D7B40100 */  ldc1      $f20, 0x100($sp)
/* 3D4920 E00D0B00 03E00008 */  jr        $ra
/* 3D4924 E00D0B04 27BD0128 */   addiu    $sp, $sp, 0x128
/* 3D4928 E00D0B08 00000000 */  nop
/* 3D492C E00D0B0C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void red_impact_appendGfx(void* effect) {
    RedImpactFXData* part = ((EffectInstance*)effect)->data.redImpact;
    Gfx* dlist = D_E00D0B10[part->unk_00];
    Gfx* dlist2;
    f32 temp_1C = part->unk_1C * 0.3;
    f32 temp_20 = part->unk_20 * 0.3;
    f32 temp_24 = part->unk_24 * 0.3;
    s32 alpha;
    s32 primR = part->unk_50.r;
    s32 primG = part->unk_50.g;
    s32 primB = part->unk_50.b;
    s32 envR = part->unk_53.r;
    s32 envG = part->unk_53.g;
    s32 envB = part->unk_53.b;
    s32 primR2;
    s32 primG2;
    s32 primB2;
    s32 envR2;
    s32 envG2;
    s32 envB2;
    Gfx* savedGfxPos;
    Gfx* savedGfxPos2;
    Matrix4f sp20;
    Matrix4f sp60;
    s32 i;

    gDPPipeSync(gMainGfxPos++);
    gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
    gSPDisplayList(gMainGfxPos++, dlist);

    shim_guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, part->unk_04, part->unk_08, part->unk_0C);
    shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);

    gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);

    alpha = part->unk_38;
    primR2 = primR;
    primG2 = primG;
    primB2 = primB;
    envR2 = envR;
    envG2 = envG;
    envB2 = envB;

    savedGfxPos = gMainGfxPos;
    gMainGfxPos++;
    savedGfxPos2 = savedGfxPos + 1;

    part++;
    for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
        if (part->unk_4C >= 0) {
            shim_guTranslateF(sp20, part->unk_04, part->unk_08, part->unk_0C);
            shim_guRotateF(sp60, part->unk_34, 0.0f, 0.0f, 1.0f);
            shim_guMtxCatF(sp60, sp20, sp20);
            shim_guScaleF(sp60, part->unk_1C * temp_1C, part->unk_20 * temp_20, part->unk_24 * temp_24);
            shim_guMtxCatF(sp60, sp20, sp20);
            shim_guRotateF(sp60, part->unk_30, 0.0f, 1.0f, 0.0f);
            shim_guMtxCatF(sp60, sp20, sp20);
            shim_guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]);

            dlist2 = D_09000940_359CF0;

            gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, 0, (s32) part->unk_3C, 0x00FC, (s32) part->unk_3C + 0x7C);
            gDPSetTileSize(gMainGfxPos++, 1, 0, (s32) part->unk_44, 0x007C, (s32) part->unk_44 + 0x7C);
            gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
            gSPDisplayList(gMainGfxPos++, dlist2);
            gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
        }
    }

    gSPEndDisplayList(gMainGfxPos++);
    gSPBranchList(savedGfxPos, gMainGfxPos);

    gDPSetPrimColor(gMainGfxPos++, 0, 0, primR2, primG2, primB2, alpha);
    gDPSetEnvColor(gMainGfxPos++, envR2, envG2, envB2, 0);
    gSPClearGeometryMode(gMainGfxPos++, G_CULL_BOTH);
    gSPSetGeometryMode(gMainGfxPos++, G_CULL_FRONT);
    gSPDisplayList(gMainGfxPos++, savedGfxPos2);

    gDPSetPrimColor(gMainGfxPos++, 0, 0, primR, primG, primB, alpha);
    gDPSetEnvColor(gMainGfxPos++, envR, envG, envB, 0);
    gSPClearGeometryMode(gMainGfxPos++, G_CULL_BOTH);
    gSPSetGeometryMode(gMainGfxPos++, G_CULL_BACK);
    gSPDisplayList(gMainGfxPos++, savedGfxPos2);

    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_8024AFE4
/* 1798C4 8024AFE4 27BDFFA8 */  addiu     $sp, $sp, -0x58
/* 1798C8 8024AFE8 AFB00020 */  sw        $s0, 0x20($sp)
/* 1798CC 8024AFEC 3C10800B */  lui       $s0, %hi(gCameras + 0x558)
/* 1798D0 8024AFF0 261022D8 */  addiu     $s0, $s0, %lo(gCameras + 0x558)
/* 1798D4 8024AFF4 3C02802A */  lui       $v0, %hi(BattleCam_TargetActor)
/* 1798D8 8024AFF8 9442F27C */  lhu       $v0, %lo(BattleCam_TargetActor)($v0)
/* 1798DC 8024AFFC 3C04800E */  lui       $a0, %hi(gBattleStatus)
/* 1798E0 8024B000 2484C070 */  addiu     $a0, $a0, %lo(gBattleStatus)
/* 1798E4 8024B004 AFBF0024 */  sw        $ra, 0x24($sp)
/* 1798E8 8024B008 F7BE0050 */  sdc1      $f30, 0x50($sp)
/* 1798EC 8024B00C F7BC0048 */  sdc1      $f28, 0x48($sp)
/* 1798F0 8024B010 F7BA0040 */  sdc1      $f26, 0x40($sp)
/* 1798F4 8024B014 F7B80038 */  sdc1      $f24, 0x38($sp)
/* 1798F8 8024B018 F7B60030 */  sdc1      $f22, 0x30($sp)
/* 1798FC 8024B01C F7B40028 */  sdc1      $f20, 0x28($sp)
/* 179900 8024B020 30430700 */  andi      $v1, $v0, 0x700
/* 179904 8024B024 304600FF */  andi      $a2, $v0, 0xFF
/* 179908 8024B028 24020100 */  addiu     $v0, $zero, 0x100
/* 17990C 8024B02C 10620026 */  beq       $v1, $v0, .L8024B0C8
/* 179910 8024B030 28620101 */   slti     $v0, $v1, 0x101
/* 179914 8024B034 10400005 */  beqz      $v0, .L8024B04C
/* 179918 8024B038 24020200 */   addiu    $v0, $zero, 0x200
/* 17991C 8024B03C 10600007 */  beqz      $v1, .L8024B05C
/* 179920 8024B040 24020002 */   addiu    $v0, $zero, 0x2
/* 179924 8024B044 08092D75 */  j         .L8024B5D4
/* 179928 8024B048 00000000 */   nop
.L8024B04C:
/* 17992C 8024B04C 10620021 */  beq       $v1, $v0, .L8024B0D4
/* 179930 8024B050 24020002 */   addiu    $v0, $zero, 0x2
/* 179934 8024B054 08092D75 */  j         .L8024B5D4
/* 179938 8024B058 00000000 */   nop
.L8024B05C:
/* 17993C 8024B05C 8C8400D8 */  lw        $a0, 0xD8($a0)
/* 179940 8024B060 1080015C */  beqz      $a0, .L8024B5D4
/* 179944 8024B064 0000102D */   daddu    $v0, $zero, $zero
/* 179948 8024B068 C49E001C */  lwc1      $f30, 0x1C($a0)
/* 17994C 8024B06C C4860144 */  lwc1      $f6, 0x144($a0)
/* 179950 8024B070 C49A0018 */  lwc1      $f26, 0x18($a0)
/* 179954 8024B074 E7BE0018 */  swc1      $f30, 0x18($sp)
/* 179958 8024B078 90830191 */  lbu       $v1, 0x191($a0)
/* 17995C 8024B07C 90820190 */  lbu       $v0, 0x190($a0)
/* 179960 8024B080 C49E0020 */  lwc1      $f30, 0x20($a0)
/* 179964 8024B084 00621821 */  addu      $v1, $v1, $v0
/* 179968 8024B088 00031843 */  sra       $v1, $v1, 1
/* 17996C 8024B08C 3C028011 */  lui       $v0, %hi(gPlayerStatus)
/* 179970 8024B090 2442EFC8 */  addiu     $v0, $v0, %lo(gPlayerStatus)
/* 179974 8024B094 E7BE0010 */  swc1      $f30, 0x10($sp)
/* 179978 8024B098 944200B0 */  lhu       $v0, 0xB0($v0)
/* 17997C 8024B09C 4483F000 */  mtc1      $v1, $f30
D_8024B0A0:
/* 179980 8024B0A0 00000000 */  nop
/* 179984 8024B0A4 4680F7A0 */  cvt.s.w   $f30, $f30
/* 179988 8024B0A8 E7BE0014 */  swc1      $f30, 0x14($sp)
/* 17998C 8024B0AC C4820148 */  lwc1      $f2, 0x148($a0)
/* 179990 8024B0B0 00021400 */  sll       $v0, $v0, 16
/* 179994 8024B0B4 00021C03 */  sra       $v1, $v0, 16
/* 179998 8024B0B8 000217C2 */  srl       $v0, $v0, 31
.L8024B0BC:
/* 17999C 8024B0BC 00621821 */  addu      $v1, $v1, $v0
/* 1799A0 8024B0C0 08092C4A */  j         .L8024B128
/* 1799A4 8024B0C4 00031843 */   sra      $v1, $v1, 1
.L8024B0C8:
/* 1799A8 8024B0C8 8C8400DC */  lw        $a0, 0xDC($a0)
.L8024B0CC:
/* 1799AC 8024B0CC 08092C38 */  j         .L8024B0E0
/* 1799B0 8024B0D0 00000000 */   nop
.L8024B0D4:
/* 1799B4 8024B0D4 00061080 */  sll       $v0, $a2, 2
/* 1799B8 8024B0D8 00441021 */  addu      $v0, $v0, $a0
/* 1799BC 8024B0DC 8C4400E0 */  lw        $a0, 0xE0($v0)
.L8024B0E0:
/* 1799C0 8024B0E0 1080013C */  beqz      $a0, .L8024B5D4
.L8024B0E4:
/* 1799C4 8024B0E4 0000102D */   daddu    $v0, $zero, $zero
/* 1799C8 8024B0E8 C49E001C */  lwc1      $f30, 0x1C($a0)
/* 1799CC 8024B0EC C4860144 */  lwc1      $f6, 0x144($a0)
/* 1799D0 8024B0F0 C49A0018 */  lwc1      $f26, 0x18($a0)
/* 1799D4 8024B0F4 E7BE0018 */  swc1      $f30, 0x18($sp)
/* 1799D8 8024B0F8 90830191 */  lbu       $v1, 0x191($a0)
/* 1799DC 8024B0FC 90820190 */  lbu       $v0, 0x190($a0)
/* 1799E0 8024B100 C49E0020 */  lwc1      $f30, 0x20($a0)
/* 1799E4 8024B104 00621021 */  addu      $v0, $v1, $v0
/* 1799E8 8024B108 00021043 */  sra       $v0, $v0, 1
/* 1799EC 8024B10C E7BE0010 */  swc1      $f30, 0x10($sp)
/* 1799F0 8024B110 4482F000 */  mtc1      $v0, $f30
D_8024B114:
/* 1799F4 8024B114 00000000 */  nop
/* 1799F8 8024B118 4680F7A0 */  cvt.s.w   $f30, $f30
.L8024B11C:
/* 1799FC 8024B11C 00031842 */  srl       $v1, $v1, 1
/* 179A00 8024B120 E7BE0014 */  swc1      $f30, 0x14($sp)
/* 179A04 8024B124 C4820148 */  lwc1      $f2, 0x148($a0)
.L8024B128:
/* 179A08 8024B128 44830000 */  mtc1      $v1, $f0
/* 179A0C 8024B12C 00000000 */  nop
/* 179A10 8024B130 46800020 */  cvt.s.w   $f0, $f0
/* 179A14 8024B134 3C02802A */  lui       $v0, %hi(BattleCam_ModeY)
/* 179A18 8024B138 8042F2A2 */  lb        $v0, %lo(BattleCam_ModeY)($v0)
/* 179A1C 8024B13C 1040000F */  beqz      $v0, .L8024B17C
.L8024B140:
/* 179A20 8024B140 46001000 */   add.s    $f0, $f2, $f0
/* 179A24 8024B144 C7BE0018 */  lwc1      $f30, 0x18($sp)
/* 179A28 8024B148 461E0001 */  sub.s     $f0, $f0, $f30
/* 179A2C 8024B14C 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 179A30 8024B150 44811000 */  mtc1      $at, $f2
/* 179A34 8024B154 00000000 */  nop
.L8024B158:
/* 179A38 8024B158 46020082 */  mul.s     $f2, $f0, $f2
/* 179A3C 8024B15C 00000000 */  nop
/* 179A40 8024B160 3C0140C0 */  lui       $at, (0x40C00000 >> 16)
/* 179A44 8024B164 44812000 */  mtc1      $at, $f4
/* 179A48 8024B168 00000000 */  nop
/* 179A4C 8024B16C 46040003 */  div.s     $f0, $f0, $f4
/* 179A50 8024B170 46001080 */  add.s     $f2, $f2, $f0
/* 179A54 8024B174 4602F780 */  add.s     $f30, $f30, $f2
/* 179A58 8024B178 E7BE0018 */  swc1      $f30, 0x18($sp)
.L8024B17C:
/* 179A5C 8024B17C 3C02802A */  lui       $v0, %hi(BattleCam_ModeX)
/* 179A60 8024B180 8042F2A3 */  lb        $v0, %lo(BattleCam_ModeX)($v0)
.L8024B184:
/* 179A64 8024B184 10400012 */  beqz      $v0, .L8024B1D0
/* 179A68 8024B188 00000000 */   nop
D_8024B18C:
/* 179A6C 8024B18C 461A3001 */  sub.s     $f0, $f6, $f26
/* 179A70 8024B190 3C013F00 */  lui       $at, (0x3F000000 >> 16)
D_8024B194:
/* 179A74 8024B194 44811000 */  mtc1      $at, $f2
/* 179A78 8024B198 00000000 */  nop
/* 179A7C 8024B19C 46020002 */  mul.s     $f0, $f0, $f2
/* 179A80 8024B1A0 00000000 */  nop
/* 179A84 8024B1A4 4600D680 */  add.s     $f26, $f26, $f0
/* 179A88 8024B1A8 3C014296 */  lui       $at, (0x42960000 >> 16)
/* 179A8C 8024B1AC 44810000 */  mtc1      $at, $f0
.L8024B1B0:
/* 179A90 8024B1B0 00000000 */  nop
/* 179A94 8024B1B4 461A003C */  c.lt.s    $f0, $f26
/* 179A98 8024B1B8 00000000 */  nop
/* 179A9C 8024B1BC 45000004 */  bc1f      .L8024B1D0
/* 179AA0 8024B1C0 00000000 */   nop
/* 179AA4 8024B1C4 461A0001 */  sub.s     $f0, $f0, $f26
/* 179AA8 8024B1C8 46000005 */  abs.s     $f0, $f0
/* 179AAC 8024B1CC 4600D681 */  sub.s     $f26, $f26, $f0
.L8024B1D0:
/* 179AB0 8024B1D0 3C02802A */  lui       $v0, %hi(D_8029F2A6)
/* 179AB4 8024B1D4 8042F2A6 */  lb        $v0, %lo(D_8029F2A6)($v0)
/* 179AB8 8024B1D8 10400029 */  beqz      $v0, .L8024B280
/* 179ABC 8024B1DC 00000000 */   nop
.L8024B1E0:
/* 179AC0 8024B1E0 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomLength)
/* 179AC4 8024B1E4 C422F28C */  lwc1      $f2, %lo(BattleCam_InitialBoomLength)($at)
/* 179AC8 8024B1E8 3C0143FA */  lui       $at, (0x43FA0000 >> 16)
/* 179ACC 8024B1EC 44810000 */  mtc1      $at, $f0
/* 179AD0 8024B1F0 00000000 */  nop
/* 179AD4 8024B1F4 46020001 */  sub.s     $f0, $f0, $f2
/* 179AD8 8024B1F8 3C01802A */  lui       $at, %hi(D_8029CC20)
/* 179ADC 8024B1FC D422CC20 */  ldc1      $f2, %lo(D_8029CC20)($at)
D_8024B200:
/* 179AE0 8024B200 46000021 */  cvt.d.s   $f0, $f0
/* 179AE4 8024B204 46220002 */  mul.d     $f0, $f0, $f2
/* 179AE8 8024B208 00000000 */  nop
D_8024B20C:
/* 179AEC 8024B20C 3C01403E */  lui       $at, (0x403E0000 >> 16)
.L8024B210:
/* 179AF0 8024B210 44811800 */  mtc1      $at, $f3
/* 179AF4 8024B214 44801000 */  mtc1      $zero, $f2
/* 179AF8 8024B218 00000000 */  nop
/* 179AFC 8024B21C 46220000 */  add.d     $f0, $f0, $f2
/* 179B00 8024B220 46200120 */  cvt.s.d   $f4, $f0
/* 179B04 8024B224 46002007 */  neg.s     $f0, $f4
.L8024B228:
/* 179B08 8024B228 4600D03C */  c.lt.s    $f26, $f0
/* 179B0C 8024B22C 00000000 */  nop
/* 179B10 8024B230 45000008 */  bc1f      .L8024B254
/* 179B14 8024B234 00000000 */   nop
/* 179B18 8024B238 461A0001 */  sub.s     $f0, $f0, $f26
/* 179B1C 8024B23C 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 179B20 8024B240 44811000 */  mtc1      $at, $f2
/* 179B24 8024B244 00000000 */  nop
/* 179B28 8024B248 46020002 */  mul.s     $f0, $f0, $f2
/* 179B2C 8024B24C 00000000 */  nop
/* 179B30 8024B250 4600D680 */  add.s     $f26, $f26, $f0
.L8024B254:
/* 179B34 8024B254 461A203C */  c.lt.s    $f4, $f26
D_8024B258:
/* 179B38 8024B258 00000000 */  nop
/* 179B3C 8024B25C 45000008 */  bc1f      .L8024B280
/* 179B40 8024B260 00000000 */   nop
/* 179B44 8024B264 461A2001 */  sub.s     $f0, $f4, $f26
/* 179B48 8024B268 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* 179B4C 8024B26C 44811000 */  mtc1      $at, $f2
/* 179B50 8024B270 00000000 */  nop
/* 179B54 8024B274 46020002 */  mul.s     $f0, $f0, $f2
/* 179B58 8024B278 00000000 */  nop
/* 179B5C 8024B27C 4600D680 */  add.s     $f26, $f26, $f0
.L8024B280:
/* 179B60 8024B280 10A00029 */  beqz      $a1, .L8024B328
D_8024B284:
/* 179B64 8024B284 00000000 */   nop
/* 179B68 8024B288 8602001E */  lh        $v0, 0x1E($s0)
/* 179B6C 8024B28C 86040026 */  lh        $a0, 0x26($s0)
/* 179B70 8024B290 86030024 */  lh        $v1, 0x24($s0)
/* 179B74 8024B294 44820000 */  mtc1      $v0, $f0
/* 179B78 8024B298 00000000 */  nop
/* 179B7C 8024B29C 46800020 */  cvt.s.w   $f0, $f0
/* 179B80 8024B2A0 86020022 */  lh        $v0, 0x22($s0)
/* 179B84 8024B2A4 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomLength)
/* 179B88 8024B2A8 E420F28C */  swc1      $f0, %lo(BattleCam_InitialBoomLength)($at)
/* 179B8C 8024B2AC 44820000 */  mtc1      $v0, $f0
D_8024B2B0:
/* 179B90 8024B2B0 00000000 */  nop
/* 179B94 8024B2B4 46800020 */  cvt.s.w   $f0, $f0
/* 179B98 8024B2B8 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomPitch)
/* 179B9C 8024B2BC E420F294 */  swc1      $f0, %lo(BattleCam_InitialBoomPitch)($at)
/* 179BA0 8024B2C0 44830000 */  mtc1      $v1, $f0
/* 179BA4 8024B2C4 00000000 */  nop
/* 179BA8 8024B2C8 46800020 */  cvt.s.w   $f0, $f0
/* 179BAC 8024B2CC 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomYaw)
/* 179BB0 8024B2D0 E420F290 */  swc1      $f0, %lo(BattleCam_InitialBoomYaw)($at)
/* 179BB4 8024B2D4 04820001 */  bltzl     $a0, .L8024B2DC
/* 179BB8 8024B2D8 248400FF */   addiu    $a0, $a0, 0xFF
.L8024B2DC:
/* 179BBC 8024B2DC 00041203 */  sra       $v0, $a0, 8
/* 179BC0 8024B2E0 C6020054 */  lwc1      $f2, 0x54($s0)
/* 179BC4 8024B2E4 C6040058 */  lwc1      $f4, 0x58($s0)
/* 179BC8 8024B2E8 C606005C */  lwc1      $f6, 0x5C($s0)
/* 179BCC 8024B2EC 3C03802A */  lui       $v1, %hi(BattleCam_MoveTimeLeft)
/* 179BD0 8024B2F0 9463F29E */  lhu       $v1, %lo(BattleCam_MoveTimeLeft)($v1)
/* 179BD4 8024B2F4 44820000 */  mtc1      $v0, $f0
/* 179BD8 8024B2F8 00000000 */  nop
/* 179BDC 8024B2FC 46800020 */  cvt.s.w   $f0, $f0
/* 179BE0 8024B300 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomZOffset)
/* 179BE4 8024B304 E420F298 */  swc1      $f0, %lo(BattleCam_InitialBoomZOffset)($at)
D_8024B308:
/* 179BE8 8024B308 3C01802A */  lui       $at, %hi(BattleCam_InitialPosX)
/* 179BEC 8024B30C E422F2A8 */  swc1      $f2, %lo(BattleCam_InitialPosX)($at)
/* 179BF0 8024B310 3C01802A */  lui       $at, %hi(BattleCam_InitialPosY)
/* 179BF4 8024B314 E424F2AC */  swc1      $f4, %lo(BattleCam_InitialPosY)($at)
/* 179BF8 8024B318 3C01802A */  lui       $at, %hi(BattleCam_InitialPosZ)
/* 179BFC 8024B31C E426F2B0 */  swc1      $f6, %lo(BattleCam_InitialPosZ)($at)
/* 179C00 8024B320 3C01802A */  lui       $at, %hi(BattleCam_MoveTimeTotal)
/* 179C04 8024B324 A423F2A0 */  sh        $v1, %lo(BattleCam_MoveTimeTotal)($at)
.L8024B328:
/* 179C08 8024B328 3C02802A */  lui       $v0, %hi(BattleCam_UseLinearInterp)
/* 179C0C 8024B32C 8042F2A5 */  lb        $v0, %lo(BattleCam_UseLinearInterp)($v0)
/* 179C10 8024B330 14400027 */  bnez      $v0, .L8024B3D0
D_8024B334:
/* 179C14 8024B334 00000000 */   nop
/* 179C18 8024B338 3C02802A */  lui       $v0, %hi(BattleCam_MoveTimeLeft)
/* 179C1C 8024B33C 8442F29E */  lh        $v0, %lo(BattleCam_MoveTimeLeft)($v0)
/* 179C20 8024B340 3C03802A */  lui       $v1, %hi(BattleCam_MoveTimeTotal)
/* 179C24 8024B344 8463F2A0 */  lh        $v1, %lo(BattleCam_MoveTimeTotal)($v1)
/* 179C28 8024B348 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 179C2C 8024B34C 4481C000 */  mtc1      $at, $f24
/* 179C30 8024B350 4482E000 */  mtc1      $v0, $f28
/* 179C34 8024B354 00000000 */  nop
/* 179C38 8024B358 4680E720 */  cvt.s.w   $f28, $f28
/* 179C3C 8024B35C 44830000 */  mtc1      $v1, $f0
D_8024B360:
/* 179C40 8024B360 00000000 */  nop
/* 179C44 8024B364 46800020 */  cvt.s.w   $f0, $f0
/* 179C48 8024B368 4600E703 */  div.s     $f28, $f28, $f0
/* 179C4C 8024B36C 461CC301 */  sub.s     $f12, $f24, $f28
/* 179C50 8024B370 3C014049 */  lui       $at, (0x40490FD0 >> 16)
/* 179C54 8024B374 34210FD0 */  ori       $at, $at, (0x40490FD0 & 0xFFFF)
/* 179C58 8024B378 4481B000 */  mtc1      $at, $f22
/* 179C5C 8024B37C 00000000 */  nop
/* 179C60 8024B380 46166302 */  mul.s     $f12, $f12, $f22
/* 179C64 8024B384 00000000 */  nop
D_8024B388:
/* 179C68 8024B388 3C013F00 */  lui       $at, (0x3F000000 >> 16)
D_8024B38C:
/* 179C6C 8024B38C 4481A000 */  mtc1      $at, $f20
/* 179C70 8024B390 00000000 */  nop
/* 179C74 8024B394 46146302 */  mul.s     $f12, $f12, $f20
D_8024B398:
/* 179C78 8024B398 0C00A85B */  jal       sin_rad
/* 179C7C 8024B39C 00000000 */   nop
/* 179C80 8024B3A0 46160002 */  mul.s     $f0, $f0, $f22
/* 179C84 8024B3A4 00000000 */  nop
/* 179C88 8024B3A8 46140302 */  mul.s     $f12, $f0, $f20
/* 179C8C 8024B3AC 0C00A85B */  jal       sin_rad
/* 179C90 8024B3B0 00000000 */   nop
/* 179C94 8024B3B4 46160002 */  mul.s     $f0, $f0, $f22
D_8024B3B8:
/* 179C98 8024B3B8 00000000 */  nop
/* 179C9C 8024B3BC 46140302 */  mul.s     $f12, $f0, $f20
/* 179CA0 8024B3C0 0C00A85B */  jal       sin_rad
/* 179CA4 8024B3C4 00000000 */   nop
/* 179CA8 8024B3C8 08092CFF */  j         .L8024B3FC
/* 179CAC 8024B3CC 4600C701 */   sub.s    $f28, $f24, $f0
.L8024B3D0:
/* 179CB0 8024B3D0 3C02802A */  lui       $v0, %hi(BattleCam_MoveTimeLeft)
/* 179CB4 8024B3D4 8442F29E */  lh        $v0, %lo(BattleCam_MoveTimeLeft)($v0)
/* 179CB8 8024B3D8 3C03802A */  lui       $v1, %hi(BattleCam_MoveTimeTotal)
.L8024B3DC:
/* 179CBC 8024B3DC 8463F2A0 */  lh        $v1, %lo(BattleCam_MoveTimeTotal)($v1)
/* 179CC0 8024B3E0 4482E000 */  mtc1      $v0, $f28
D_8024B3E4:
/* 179CC4 8024B3E4 00000000 */  nop
/* 179CC8 8024B3E8 4680E720 */  cvt.s.w   $f28, $f28
/* 179CCC 8024B3EC 44830000 */  mtc1      $v1, $f0
/* 179CD0 8024B3F0 00000000 */  nop
/* 179CD4 8024B3F4 46800020 */  cvt.s.w   $f0, $f0
/* 179CD8 8024B3F8 4600E703 */  div.s     $f28, $f28, $f0
.L8024B3FC:
/* 179CDC 8024B3FC 3C01802A */  lui       $at, %hi(BattleCam_InitialPosX)
D_8024B400:
/* 179CE0 8024B400 C434F2A8 */  lwc1      $f20, %lo(BattleCam_InitialPosX)($at)
/* 179CE4 8024B404 461CA502 */  mul.s     $f20, $f20, $f28
/* 179CE8 8024B408 00000000 */  nop
/* 179CEC 8024B40C 3C01802A */  lui       $at, %hi(BattleCam_InitialPosY)
D_8024B410:
/* 179CF0 8024B410 C432F2AC */  lwc1      $f18, %lo(BattleCam_InitialPosY)($at)
/* 179CF4 8024B414 461C9482 */  mul.s     $f18, $f18, $f28
/* 179CF8 8024B418 00000000 */  nop
/* 179CFC 8024B41C 3C01802A */  lui       $at, %hi(BattleCam_InitialPosZ)
/* 179D00 8024B420 C430F2B0 */  lwc1      $f16, %lo(BattleCam_InitialPosZ)($at)
/* 179D04 8024B424 461C8402 */  mul.s     $f16, $f16, $f28
/* 179D08 8024B428 00000000 */  nop
/* 179D0C 8024B42C 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomZOffset)
/* 179D10 8024B430 C42AF298 */  lwc1      $f10, %lo(BattleCam_InitialBoomZOffset)($at)
/* 179D14 8024B434 461C5282 */  mul.s     $f10, $f10, $f28
/* 179D18 8024B438 00000000 */  nop
D_8024B43C:
/* 179D1C 8024B43C 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomLength)
/* 179D20 8024B440 C42EF28C */  lwc1      $f14, %lo(BattleCam_InitialBoomLength)($at)
/* 179D24 8024B444 461C7382 */  mul.s     $f14, $f14, $f28
/* 179D28 8024B448 00000000 */  nop
/* 179D2C 8024B44C 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomYaw)
/* 179D30 8024B450 C428F290 */  lwc1      $f8, %lo(BattleCam_InitialBoomYaw)($at)
/* 179D34 8024B454 461C4202 */  mul.s     $f8, $f8, $f28
/* 179D38 8024B458 00000000 */  nop
/* 179D3C 8024B45C 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomPitch)
.L8024B460:
/* 179D40 8024B460 C424F294 */  lwc1      $f4, %lo(BattleCam_InitialBoomPitch)($at)
D_8024B464:
/* 179D44 8024B464 461C2102 */  mul.s     $f4, $f4, $f28
D_8024B468:
/* 179D48 8024B468 00000000 */  nop
/* 179D4C 8024B46C 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 179D50 8024B470 44811000 */  mtc1      $at, $f2
/* 179D54 8024B474 00000000 */  nop
/* 179D58 8024B478 461C1081 */  sub.s     $f2, $f2, $f28
D_8024B47C:
/* 179D5C 8024B47C 4602D682 */  mul.s     $f26, $f26, $f2
/* 179D60 8024B480 00000000 */  nop
/* 179D64 8024B484 C7BE0018 */  lwc1      $f30, 0x18($sp)
/* 179D68 8024B488 4602F602 */  mul.s     $f24, $f30, $f2
/* 179D6C 8024B48C 00000000 */  nop
/* 179D70 8024B490 3C02802A */  lui       $v0, %hi(BattleCam_BoomZOffset)
D_8024B494:
/* 179D74 8024B494 8442F286 */  lh        $v0, %lo(BattleCam_BoomZOffset)($v0)
/* 179D78 8024B498 44820000 */  mtc1      $v0, $f0
/* 179D7C 8024B49C 00000000 */  nop
D_8024B4A0:
/* 179D80 8024B4A0 46800020 */  cvt.s.w   $f0, $f0
/* 179D84 8024B4A4 3C02802A */  lui       $v0, %hi(BattleCam_BoomLength)
/* 179D88 8024B4A8 8442F280 */  lh        $v0, %lo(BattleCam_BoomLength)($v0)
/* 179D8C 8024B4AC 46020002 */  mul.s     $f0, $f0, $f2
/* 179D90 8024B4B0 00000000 */  nop
/* 179D94 8024B4B4 44826000 */  mtc1      $v0, $f12
/* 179D98 8024B4B8 00000000 */  nop
/* 179D9C 8024B4BC 46806320 */  cvt.s.w   $f12, $f12
D_8024B4C0:
/* 179DA0 8024B4C0 3C02802A */  lui       $v0, %hi(BattleCam_BoomYaw)
/* 179DA4 8024B4C4 8442F282 */  lh        $v0, %lo(BattleCam_BoomYaw)($v0)
/* 179DA8 8024B4C8 44823000 */  mtc1      $v0, $f6
.L8024B4CC:
/* 179DAC 8024B4CC 00000000 */  nop
/* 179DB0 8024B4D0 468031A0 */  cvt.s.w   $f6, $f6
/* 179DB4 8024B4D4 46023182 */  mul.s     $f6, $f6, $f2
/* 179DB8 8024B4D8 00000000 */  nop
/* 179DBC 8024B4DC C7BE0010 */  lwc1      $f30, 0x10($sp)
/* 179DC0 8024B4E0 4602F582 */  mul.s     $f22, $f30, $f2
/* 179DC4 8024B4E4 00000000 */  nop
/* 179DC8 8024B4E8 46005280 */  add.s     $f10, $f10, $f0
D_8024B4EC:
/* 179DCC 8024B4EC 3C014380 */  lui       $at, (0x43800000 >> 16)
.L8024B4F0:
/* 179DD0 8024B4F0 44810000 */  mtc1      $at, $f0
/* 179DD4 8024B4F4 00000000 */  nop
/* 179DD8 8024B4F8 46005282 */  mul.s     $f10, $f10, $f0
D_8024B4FC:
/* 179DDC 8024B4FC 00000000 */  nop
/* 179DE0 8024B500 C7BE0014 */  lwc1      $f30, 0x14($sp)
/* 179DE4 8024B504 3C014200 */  lui       $at, (0x42000000 >> 16)
/* 179DE8 8024B508 44810000 */  mtc1      $at, $f0
/* 179DEC 8024B50C 00000000 */  nop
.L8024B510:
/* 179DF0 8024B510 4600F001 */  sub.s     $f0, $f30, $f0
/* 179DF4 8024B514 3C02802A */  lui       $v0, %hi(BattleCam_BoomPitch)
.L8024B518:
/* 179DF8 8024B518 8442F284 */  lh        $v0, %lo(BattleCam_BoomPitch)($v0)
/* 179DFC 8024B51C 46006300 */  add.s     $f12, $f12, $f0
/* 179E00 8024B520 44820000 */  mtc1      $v0, $f0
/* 179E04 8024B524 00000000 */  nop
/* 179E08 8024B528 46800020 */  cvt.s.w   $f0, $f0
/* 179E0C 8024B52C 46020002 */  mul.s     $f0, $f0, $f2
D_8024B530:
/* 179E10 8024B530 00000000 */  nop
/* 179E14 8024B534 46026302 */  mul.s     $f12, $f12, $f2
/* 179E18 8024B538 00000000 */  nop
/* 179E1C 8024B53C 461AA500 */  add.s     $f20, $f20, $f26
.L8024B540:
/* 179E20 8024B540 46189480 */  add.s     $f18, $f18, $f24
/* 179E24 8024B544 46064200 */  add.s     $f8, $f8, $f6
/* 179E28 8024B548 3C04802A */  lui       $a0, %hi(BattleCam_MoveTimeLeft)
.L8024B54C:
/* 179E2C 8024B54C 2484F29E */  addiu     $a0, $a0, %lo(BattleCam_MoveTimeLeft)
D_8024B550:
/* 179E30 8024B550 46168400 */  add.s     $f16, $f16, $f22
/* 179E34 8024B554 E6140054 */  swc1      $f20, 0x54($s0)
/* 179E38 8024B558 E6120058 */  swc1      $f18, 0x58($s0)
/* 179E3C 8024B55C E610005C */  swc1      $f16, 0x5C($s0)
/* 179E40 8024B560 46002100 */  add.s     $f4, $f4, $f0
/* 179E44 8024B564 4600478D */  trunc.w.s $f30, $f8
/* 179E48 8024B568 4402F000 */  mfc1      $v0, $f30
/* 179E4C 8024B56C 00000000 */  nop
/* 179E50 8024B570 A6020024 */  sh        $v0, 0x24($s0)
/* 179E54 8024B574 460C7380 */  add.s     $f14, $f14, $f12
/* 179E58 8024B578 4600278D */  trunc.w.s $f30, $f4
/* 179E5C 8024B57C 4402F000 */  mfc1      $v0, $f30
/* 179E60 8024B580 00000000 */  nop
/* 179E64 8024B584 A6020022 */  sh        $v0, 0x22($s0)
/* 179E68 8024B588 4600778D */  trunc.w.s $f30, $f14
/* 179E6C 8024B58C 4402F000 */  mfc1      $v0, $f30
D_8024B590:
/* 179E70 8024B590 00000000 */  nop
/* 179E74 8024B594 A602001E */  sh        $v0, 0x1E($s0)
/* 179E78 8024B598 4600578D */  trunc.w.s $f30, $f10
/* 179E7C 8024B59C 4402F000 */  mfc1      $v0, $f30
D_8024B5A0:
/* 179E80 8024B5A0 00000000 */  nop
/* 179E84 8024B5A4 A6020026 */  sh        $v0, 0x26($s0)
/* 179E88 8024B5A8 84820000 */  lh        $v0, 0x0($a0)
/* 179E8C 8024B5AC 94830000 */  lhu       $v1, 0x0($a0)
D_8024B5B0:
/* 179E90 8024B5B0 14400006 */  bnez      $v0, .L8024B5CC
D_8024B5B4:
/* 179E94 8024B5B4 2462FFFF */   addiu    $v0, $v1, -0x1
/* 179E98 8024B5B8 24020001 */  addiu     $v0, $zero, 0x1
/* 179E9C 8024B5BC 3C01802A */  lui       $at, %hi(BattleCam_DoneMoving)
/* 179EA0 8024B5C0 A022F29C */  sb        $v0, %lo(BattleCam_DoneMoving)($at)
/* 179EA4 8024B5C4 08092D75 */  j         .L8024B5D4
/* 179EA8 8024B5C8 0000102D */   daddu    $v0, $zero, $zero
.L8024B5CC:
/* 179EAC 8024B5CC A4820000 */  sh        $v0, 0x0($a0)
.L8024B5D0:
/* 179EB0 8024B5D0 0000102D */  daddu     $v0, $zero, $zero
.L8024B5D4:
/* 179EB4 8024B5D4 8FBF0024 */  lw        $ra, 0x24($sp)
/* 179EB8 8024B5D8 8FB00020 */  lw        $s0, 0x20($sp)
/* 179EBC 8024B5DC D7BE0050 */  ldc1      $f30, 0x50($sp)
/* 179EC0 8024B5E0 D7BC0048 */  ldc1      $f28, 0x48($sp)
D_8024B5E4:
/* 179EC4 8024B5E4 D7BA0040 */  ldc1      $f26, 0x40($sp)
.L8024B5E8:
/* 179EC8 8024B5E8 D7B80038 */  ldc1      $f24, 0x38($sp)
/* 179ECC 8024B5EC D7B60030 */  ldc1      $f22, 0x30($sp)
/* 179ED0 8024B5F0 D7B40028 */  ldc1      $f20, 0x28($sp)
/* 179ED4 8024B5F4 03E00008 */  jr        $ra
/* 179ED8 8024B5F8 27BD0058 */   addiu    $sp, $sp, 0x58

### DECOMPILED C INSTRUCTIONS:

s32 CamPresetUpdate_H(Evt* script, s32 isInitialCall) {
    Actor* actor;
    Camera* camera = &gCameras[CAM_BATTLE];
    BattleStatus* battleStatus = &gBattleStatus;
    PlayerStatus* playerStatus = &gPlayerStatus;
    f32 x, y, z;
    f32 currentX, currentY;
    f32 averageSize;
    f32 alpha;
    f32 extraLength;
    s32 actorClass = BattleCam_TargetActor & ACTOR_CLASS_MASK;
    s32 actorID = BattleCam_TargetActor & 0xFF;

    switch (actorClass) {
        case ACTOR_CLASS_PLAYER:
            actor = battleStatus->playerActor;
            if (actor == NULL) {
                return ApiStatus_BLOCK;
            }
            currentX = actor->currentPos.x;
            x = actor->state.goalPos.x;
            y = actor->state.goalPos.y;
            z = actor->state.goalPos.z;
            averageSize = (actor->size.y + actor->size.x) / 2;
            currentY = actor->currentPos.y + playerStatus->colliderHeight / 2;
            break;
        case ACTOR_CLASS_PARTNER:
            actor = battleStatus->partnerActor;
            if (actor == NULL) {
                return ApiStatus_BLOCK;
            }
            currentX = actor->currentPos.x;
            x = actor->state.goalPos.x;
            y = actor->state.goalPos.y;
            z = actor->state.goalPos.z;
            averageSize = (actor->size.y + actor->size.x) / 2;
            currentY = actor->currentPos.y + actor->size.y / 2;
            break;
        case ACTOR_CLASS_ENEMY:
            actor = battleStatus->enemyActors[actorID];
            if (actor == NULL) {
                return ApiStatus_BLOCK;
            }
            currentX = actor->currentPos.x;
            x = actor->state.goalPos.x;
            y = actor->state.goalPos.y;
            z = actor->state.goalPos.z;
            averageSize = (actor->size.y + actor->size.x) / 2;
            currentY = actor->currentPos.y + actor->size.y / 2;
            break;
        default:
            return ApiStatus_DONE2;
    }

    if (BattleCam_ModeY != BTL_CAM_MODEY_0) {
        f32 delta = currentY - y;
        y += delta / 2 + delta / 6.0f;
    }

    if (BattleCam_ModeX != BTL_CAM_MODEX_0) {
        x += (currentX - x) / 2;
        if (x > 75.0f) {
            x -= fabsf(75.0f - x);
        }
    }

    if (D_8029F2A6) {
        f32 upperBound = (500.0f - BattleCam_InitialBoomLength) * 0.4 + 30.0;
        f32 lowerBound = -upperBound;

        if (x < lowerBound) {
            x += (lowerBound - x) / 2;
        }
        if (x > upperBound) {
            x += (upperBound - x) / 2;
        }
    }
    if (isInitialCall) {
        BattleCam_InitialBoomLength = camera->auxBoomLength;
        BattleCam_InitialBoomPitch = camera->auxBoomPitch;
        BattleCam_InitialBoomYaw = camera->auxBoomYaw;
        BattleCam_InitialBoomZOffset = camera->auxBoomZOffset / 256;
        BattleCam_InitialPosX = camera->lookAt_obj_target.x;
        BattleCam_InitialPosY = camera->lookAt_obj_target.y;
        BattleCam_InitialPosZ = camera->lookAt_obj_target.z;
        BattleCam_MoveTimeTotal = BattleCam_MoveTimeLeft;
    }

    if (!BattleCam_UseLinearInterp) {
        alpha = BattleCam_MoveTimeLeft;
        alpha /= BattleCam_MoveTimeTotal;
        alpha = 1.0f - sin_rad(sin_rad(sin_rad((1.0f - alpha) * PI_S / 2) * PI_S / 2) * PI_S / 2);
    } else {
        alpha = BattleCam_MoveTimeLeft;
        alpha /= BattleCam_MoveTimeTotal;
    }

    camera->lookAt_obj_target.x = LERP(BattleCam_InitialPosX, x, alpha);
    camera->lookAt_obj_target.y = LERP(BattleCam_InitialPosY, y, alpha);
    camera->lookAt_obj_target.z = LERP(BattleCam_InitialPosZ, z, alpha);

    camera->auxBoomZOffset = LERP(BattleCam_InitialBoomZOffset, BattleCam_BoomZOffset, alpha) * 256.0f;
    extraLength = averageSize - 32.0f;
    camera->auxBoomLength = LERP(BattleCam_InitialBoomLength, BattleCam_BoomLength + extraLength, alpha);
    camera->auxBoomYaw = LERP(BattleCam_InitialBoomYaw, BattleCam_BoomYaw, alpha);
    camera->auxBoomPitch = LERP(BattleCam_InitialBoomPitch, BattleCam_BoomPitch, alpha);

    if (BattleCam_MoveTimeLeft == 0) {
        BattleCam_DoneMoving = TRUE;
    } else {
        BattleCam_MoveTimeLeft--;
    }

    return ApiStatus_BLOCK;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel render_hud_elements_world
/* D9DB4 801436B4 27BDFAE0 */  addiu     $sp, $sp, -0x520
/* D9DB8 801436B8 AFBF051C */  sw        $ra, 0x51C($sp)
/* D9DBC 801436BC AFB20518 */  sw        $s2, 0x518($sp)
/* D9DC0 801436C0 AFB10514 */  sw        $s1, 0x514($sp)
/* D9DC4 801436C4 AFB00510 */  sw        $s0, 0x510($sp)
/* D9DC8 801436C8 3C03800A */  lui       $v1, %hi(gCurrentCamID)
/* D9DCC 801436CC 8463A634 */  lh        $v1, %lo(gCurrentCamID)($v1)
/* D9DD0 801436D0 24020003 */  addiu     $v0, $zero, 0x3
/* D9DD4 801436D4 146200AB */  bne       $v1, $v0, .L80143984
/* D9DD8 801436D8 0000902D */   daddu    $s2, $zero, $zero
/* D9DDC 801436DC 0240882D */  daddu     $s1, $s2, $zero
/* D9DE0 801436E0 3C091020 */  lui       $t1, (0x10200000 >> 16)
/* D9DE4 801436E4 3C080001 */  lui       $t0, (0x10000 >> 16)
/* D9DE8 801436E8 3C074000 */  lui       $a3, (0x40000000 >> 16)
/* D9DEC 801436EC 3C068015 */  lui       $a2, %hi(gHudElements)
/* D9DF0 801436F0 8CC67960 */  lw        $a2, %lo(gHudElements)($a2)
/* D9DF4 801436F4 27A50010 */  addiu     $a1, $sp, 0x10
.L801436F8:
/* D9DF8 801436F8 8CC40000 */  lw        $a0, 0x0($a2)
/* D9DFC 801436FC 5080001D */  beql      $a0, $zero, .L80143774
/* D9E00 80143700 26310001 */   addiu    $s1, $s1, 0x1
/* D9E04 80143704 8C830000 */  lw        $v1, 0x0($a0)
/* D9E08 80143708 5060001A */  beql      $v1, $zero, .L80143774
/* D9E0C 8014370C 26310001 */   addiu    $s1, $s1, 0x1
/* D9E10 80143710 30620002 */  andi      $v0, $v1, 0x2
/* D9E14 80143714 54400017 */  bnel      $v0, $zero, .L80143774
/* D9E18 80143718 26310001 */   addiu    $s1, $s1, 0x1
/* D9E1C 8014371C 00691024 */  and       $v0, $v1, $t1
/* D9E20 80143720 54400014 */  bnel      $v0, $zero, .L80143774
/* D9E24 80143724 26310001 */   addiu    $s1, $s1, 0x1
/* D9E28 80143728 00681024 */  and       $v0, $v1, $t0
/* D9E2C 8014372C 50400011 */  beql      $v0, $zero, .L80143774
/* D9E30 80143730 26310001 */   addiu    $s1, $s1, 0x1
/* D9E34 80143734 00671024 */  and       $v0, $v1, $a3
/* D9E38 80143738 5440000E */  bnel      $v0, $zero, .L80143774
/* D9E3C 8014373C 26310001 */   addiu    $s1, $s1, 0x1
/* D9E40 80143740 30620040 */  andi      $v0, $v1, 0x40
/* D9E44 80143744 5440000B */  bnel      $v0, $zero, .L80143774
/* D9E48 80143748 26310001 */   addiu    $s1, $s1, 0x1
/* D9E4C 8014374C 80820045 */  lb        $v0, 0x45($a0)
/* D9E50 80143750 04420008 */  bltzl     $v0, .L80143774
/* D9E54 80143754 26310001 */   addiu    $s1, $s1, 0x1
/* D9E58 80143758 30620080 */  andi      $v0, $v1, 0x80
/* D9E5C 8014375C 54400005 */  bnel      $v0, $zero, .L80143774
/* D9E60 80143760 26310001 */   addiu    $s1, $s1, 0x1
/* D9E64 80143764 ACB10000 */  sw        $s1, 0x0($a1)
/* D9E68 80143768 24A50004 */  addiu     $a1, $a1, 0x4
/* D9E6C 8014376C 26520001 */  addiu     $s2, $s2, 0x1
/* D9E70 80143770 26310001 */  addiu     $s1, $s1, 0x1
.L80143774:
/* D9E74 80143774 2A220140 */  slti      $v0, $s1, 0x140
/* D9E78 80143778 1440FFDF */  bnez      $v0, .L801436F8
/* D9E7C 8014377C 24C60004 */   addiu    $a2, $a2, 0x4
/* D9E80 80143780 1240007E */  beqz      $s2, .L8014397C
/* D9E84 80143784 2642FFFF */   addiu    $v0, $s2, -0x1
/* D9E88 80143788 18400024 */  blez      $v0, .L8014381C
/* D9E8C 8014378C 0000882D */   daddu    $s1, $zero, $zero
/* D9E90 80143790 3C0C8015 */  lui       $t4, %hi(gHudElements)
/* D9E94 80143794 258C7960 */  addiu     $t4, $t4, %lo(gHudElements)
/* D9E98 80143798 27AB0010 */  addiu     $t3, $sp, 0x10
/* D9E9C 8014379C 0160502D */  daddu     $t2, $t3, $zero
.L801437A0:
/* D9EA0 801437A0 26240001 */  addiu     $a0, $s1, 0x1
/* D9EA4 801437A4 0092102A */  slt       $v0, $a0, $s2
/* D9EA8 801437A8 50400018 */  beql      $v0, $zero, .L8014380C
/* D9EAC 801437AC 26310001 */   addiu    $s1, $s1, 0x1
/* D9EB0 801437B0 0140482D */  daddu     $t1, $t2, $zero
/* D9EB4 801437B4 8D880000 */  lw        $t0, 0x0($t4)
/* D9EB8 801437B8 00041080 */  sll       $v0, $a0, 2
/* D9EBC 801437BC 004B2821 */  addu      $a1, $v0, $t3
.L801437C0:
/* D9EC0 801437C0 8D270000 */  lw        $a3, 0x0($t1)
/* D9EC4 801437C4 8CA60000 */  lw        $a2, 0x0($a1)
/* D9EC8 801437C8 00071080 */  sll       $v0, $a3, 2
/* D9ECC 801437CC 00481021 */  addu      $v0, $v0, $t0
/* D9ED0 801437D0 8C430000 */  lw        $v1, 0x0($v0)
/* D9ED4 801437D4 00061080 */  sll       $v0, $a2, 2
/* D9ED8 801437D8 00481021 */  addu      $v0, $v0, $t0
/* D9EDC 801437DC 8C420000 */  lw        $v0, 0x0($v0)
/* D9EE0 801437E0 80630044 */  lb        $v1, 0x44($v1)
/* D9EE4 801437E4 80420044 */  lb        $v0, 0x44($v0)
/* D9EE8 801437E8 0062182A */  slt       $v1, $v1, $v0
/* D9EEC 801437EC 10600003 */  beqz      $v1, .L801437FC
/* D9EF0 801437F0 24840001 */   addiu    $a0, $a0, 0x1
/* D9EF4 801437F4 AD260000 */  sw        $a2, 0x0($t1)
/* D9EF8 801437F8 ACA70000 */  sw        $a3, 0x0($a1)
.L801437FC:
/* D9EFC 801437FC 0092102A */  slt       $v0, $a0, $s2
/* D9F00 80143800 1440FFEF */  bnez      $v0, .L801437C0
/* D9F04 80143804 24A50004 */   addiu    $a1, $a1, 0x4
/* D9F08 80143808 26310001 */  addiu     $s1, $s1, 0x1
.L8014380C:
/* D9F0C 8014380C 2642FFFF */  addiu     $v0, $s2, -0x1
/* D9F10 80143810 0222102A */  slt       $v0, $s1, $v0
/* D9F14 80143814 1440FFE2 */  bnez      $v0, .L801437A0
/* D9F18 80143818 254A0004 */   addiu    $t2, $t2, 0x4
.L8014381C:
/* D9F1C 8014381C 3C06ED03 */  lui       $a2, (0xED030050 >> 16)
/* D9F20 80143820 34C60050 */  ori       $a2, $a2, (0xED030050 & 0xFFFF)
/* D9F24 80143824 3C04004D */  lui       $a0, (0x4D0370 >> 16)
/* D9F28 80143828 34840370 */  ori       $a0, $a0, (0x4D0370 & 0xFFFF)
/* D9F2C 8014382C 3C07D9C0 */  lui       $a3, (0xD9C0F9FA >> 16)
/* D9F30 80143830 34E7F9FA */  ori       $a3, $a3, (0xD9C0F9FA & 0xFFFF)
/* D9F34 80143834 3C09D9FF */  lui       $t1, (0xD9FFFFFF >> 16)
/* D9F38 80143838 3529FFFF */  ori       $t1, $t1, (0xD9FFFFFF & 0xFFFF)
/* D9F3C 8014383C 3C080022 */  lui       $t0, (0x220005 >> 16)
/* D9F40 80143840 35080005 */  ori       $t0, $t0, (0x220005 & 0xFFFF)
/* D9F44 80143844 3C0ADC08 */  lui       $t2, (0xDC08060A >> 16)
/* D9F48 80143848 354A060A */  ori       $t2, $t2, (0xDC08060A & 0xFFFF)
/* D9F4C 8014384C 3C0BDC08 */  lui       $t3, (0xDC08090A >> 16)
/* D9F50 80143850 356B090A */  ori       $t3, $t3, (0xDC08090A & 0xFFFF)
/* D9F54 80143854 3C0CD700 */  lui       $t4, (0xD7000002 >> 16)
/* D9F58 80143858 358C0002 */  ori       $t4, $t4, (0xD7000002 & 0xFFFF)
/* D9F5C 8014385C 3C0DE200 */  lui       $t5, (0xE2001E01 >> 16)
/* D9F60 80143860 35AD1E01 */  ori       $t5, $t5, (0xE2001E01 & 0xFFFF)
/* D9F64 80143864 3C0FE300 */  lui       $t7, (0xE3000A11 >> 16)
/* D9F68 80143868 35EF0A11 */  ori       $t7, $t7, (0xE3000A11 & 0xFFFF)
/* D9F6C 8014386C 3C0E0008 */  lui       $t6, (0x82CF0 >> 16)
/* D9F70 80143870 35CE2CF0 */  ori       $t6, $t6, (0x82CF0 & 0xFFFF)
/* D9F74 80143874 3C05800A */  lui       $a1, %hi(gMainGfxPos)
/* D9F78 80143878 24A5A66C */  addiu     $a1, $a1, %lo(gMainGfxPos)
/* D9F7C 8014387C 8CA20000 */  lw        $v0, 0x0($a1)
/* D9F80 80143880 0000882D */  daddu     $s1, $zero, $zero
/* D9F84 80143884 0040182D */  daddu     $v1, $v0, $zero
/* D9F88 80143888 24420008 */  addiu     $v0, $v0, 0x8
/* D9F8C 8014388C ACA20000 */  sw        $v0, 0x0($a1)
/* D9F90 80143890 AC660000 */  sw        $a2, 0x0($v1)
/* D9F94 80143894 AC640004 */  sw        $a0, 0x4($v1)
/* D9F98 80143898 24430008 */  addiu     $v1, $v0, 0x8
/* D9F9C 8014389C ACA30000 */  sw        $v1, 0x0($a1)
/* D9FA0 801438A0 3C03E700 */  lui       $v1, (0xE7000000 >> 16)
/* D9FA4 801438A4 AC430000 */  sw        $v1, 0x0($v0)
/* D9FA8 801438A8 24430010 */  addiu     $v1, $v0, 0x10
/* D9FAC 801438AC AC400004 */  sw        $zero, 0x4($v0)
/* D9FB0 801438B0 ACA30000 */  sw        $v1, 0x0($a1)
/* D9FB4 801438B4 24430018 */  addiu     $v1, $v0, 0x18
/* D9FB8 801438B8 AC470008 */  sw        $a3, 0x8($v0)
/* D9FBC 801438BC AC40000C */  sw        $zero, 0xC($v0)
/* D9FC0 801438C0 ACA30000 */  sw        $v1, 0x0($a1)
/* D9FC4 801438C4 24430020 */  addiu     $v1, $v0, 0x20
/* D9FC8 801438C8 AC490010 */  sw        $t1, 0x10($v0)
/* D9FCC 801438CC AC480014 */  sw        $t0, 0x14($v0)
/* D9FD0 801438D0 ACA30000 */  sw        $v1, 0x0($a1)
/* D9FD4 801438D4 3C03DB02 */  lui       $v1, (0xDB020000 >> 16)
/* D9FD8 801438D8 AC430018 */  sw        $v1, 0x18($v0)
/* D9FDC 801438DC 24030018 */  addiu     $v1, $zero, 0x18
/* D9FE0 801438E0 AC43001C */  sw        $v1, 0x1C($v0)
/* D9FE4 801438E4 24430028 */  addiu     $v1, $v0, 0x28
/* D9FE8 801438E8 3C048015 */  lui       $a0, %hi(D_8014F110)
/* D9FEC 801438EC 2484F110 */  addiu     $a0, $a0, %lo(D_8014F110)
/* D9FF0 801438F0 ACA30000 */  sw        $v1, 0x0($a1)
/* D9FF4 801438F4 24430030 */  addiu     $v1, $v0, 0x30
/* D9FF8 801438F8 AC440024 */  sw        $a0, 0x24($v0)
/* D9FFC 801438FC 2484FFF8 */  addiu     $a0, $a0, -0x8
/* DA000 80143900 AC4A0020 */  sw        $t2, 0x20($v0)
/* DA004 80143904 ACA30000 */  sw        $v1, 0x0($a1)
/* DA008 80143908 24430038 */  addiu     $v1, $v0, 0x38
/* DA00C 8014390C AC4B0028 */  sw        $t3, 0x28($v0)
/* DA010 80143910 AC44002C */  sw        $a0, 0x2C($v0)
/* DA014 80143914 ACA30000 */  sw        $v1, 0x0($a1)
/* DA018 80143918 2403FFFF */  addiu     $v1, $zero, -0x1
/* DA01C 8014391C AC430034 */  sw        $v1, 0x34($v0)
/* DA020 80143920 24430040 */  addiu     $v1, $v0, 0x40
/* DA024 80143924 AC4C0030 */  sw        $t4, 0x30($v0)
/* DA028 80143928 ACA30000 */  sw        $v1, 0x0($a1)
/* DA02C 8014392C 24430048 */  addiu     $v1, $v0, 0x48
/* DA030 80143930 AC4D0038 */  sw        $t5, 0x38($v0)
/* DA034 80143934 AC40003C */  sw        $zero, 0x3C($v0)
/* DA038 80143938 ACA30000 */  sw        $v1, 0x0($a1)
/* DA03C 8014393C AC4F0040 */  sw        $t7, 0x40($v0)
/* DA040 80143940 1A40000E */  blez      $s2, .L8014397C
/* DA044 80143944 AC4E0044 */   sw       $t6, 0x44($v0)
/* DA048 80143948 27B00010 */  addiu     $s0, $sp, 0x10
.L8014394C:
/* DA04C 8014394C 8E020000 */  lw        $v0, 0x0($s0)
/* DA050 80143950 26100004 */  addiu     $s0, $s0, 0x4
/* DA054 80143954 3C038015 */  lui       $v1, %hi(gHudElements)
/* DA058 80143958 8C637960 */  lw        $v1, %lo(gHudElements)($v1)
/* DA05C 8014395C 00021080 */  sll       $v0, $v0, 2
/* DA060 80143960 00431021 */  addu      $v0, $v0, $v1
/* DA064 80143964 8C440000 */  lw        $a0, 0x0($v0)
/* DA068 80143968 0C050AFF */  jal       render_hud_element
/* DA06C 8014396C 26310001 */   addiu    $s1, $s1, 0x1
/* DA070 80143970 0232102A */  slt       $v0, $s1, $s2
/* DA074 80143974 1440FFF5 */  bnez      $v0, .L8014394C
/* DA078 80143978 00000000 */   nop
.L8014397C:
/* DA07C 8014397C 3C03800A */  lui       $v1, %hi(gCurrentCamID)
/* DA080 80143980 8463A634 */  lh        $v1, %lo(gCurrentCamID)($v1)
.L80143984:
/* DA084 80143984 24020001 */  addiu     $v0, $zero, 0x1
/* DA088 80143988 146200A9 */  bne       $v1, $v0, .L80143C30
/* DA08C 8014398C 0000902D */   daddu    $s2, $zero, $zero
/* DA090 80143990 0240882D */  daddu     $s1, $s2, $zero
/* DA094 80143994 3C091020 */  lui       $t1, (0x10200000 >> 16)
/* DA098 80143998 3C080001 */  lui       $t0, (0x10000 >> 16)
/* DA09C 8014399C 3C074000 */  lui       $a3, (0x40000000 >> 16)
/* DA0A0 801439A0 3C068015 */  lui       $a2, %hi(gHudElements)
/* DA0A4 801439A4 8CC67960 */  lw        $a2, %lo(gHudElements)($a2)
/* DA0A8 801439A8 27A50010 */  addiu     $a1, $sp, 0x10
.L801439AC:
/* DA0AC 801439AC 8CC40000 */  lw        $a0, 0x0($a2)
/* DA0B0 801439B0 5080001D */  beql      $a0, $zero, .L80143A28
/* DA0B4 801439B4 26310001 */   addiu    $s1, $s1, 0x1
/* DA0B8 801439B8 8C830000 */  lw        $v1, 0x0($a0)
/* DA0BC 801439BC 5060001A */  beql      $v1, $zero, .L80143A28
/* DA0C0 801439C0 26310001 */   addiu    $s1, $s1, 0x1
/* DA0C4 801439C4 30620002 */  andi      $v0, $v1, 0x2
/* DA0C8 801439C8 54400017 */  bnel      $v0, $zero, .L80143A28
/* DA0CC 801439CC 26310001 */   addiu    $s1, $s1, 0x1
/* DA0D0 801439D0 00691024 */  and       $v0, $v1, $t1
/* DA0D4 801439D4 54400014 */  bnel      $v0, $zero, .L80143A28
/* DA0D8 801439D8 26310001 */   addiu    $s1, $s1, 0x1
/* DA0DC 801439DC 00681024 */  and       $v0, $v1, $t0
/* DA0E0 801439E0 50400011 */  beql      $v0, $zero, .L80143A28
/* DA0E4 801439E4 26310001 */   addiu    $s1, $s1, 0x1
/* DA0E8 801439E8 00671024 */  and       $v0, $v1, $a3
/* DA0EC 801439EC 5040000E */  beql      $v0, $zero, .L80143A28
/* DA0F0 801439F0 26310001 */   addiu    $s1, $s1, 0x1
/* DA0F4 801439F4 30620040 */  andi      $v0, $v1, 0x40
/* DA0F8 801439F8 5440000B */  bnel      $v0, $zero, .L80143A28
/* DA0FC 801439FC 26310001 */   addiu    $s1, $s1, 0x1
/* DA100 80143A00 80820045 */  lb        $v0, 0x45($a0)
/* DA104 80143A04 04420008 */  bltzl     $v0, .L80143A28
/* DA108 80143A08 26310001 */   addiu    $s1, $s1, 0x1
/* DA10C 80143A0C 30620080 */  andi      $v0, $v1, 0x80
/* DA110 80143A10 54400005 */  bnel      $v0, $zero, .L80143A28
/* DA114 80143A14 26310001 */   addiu    $s1, $s1, 0x1
/* DA118 80143A18 ACB10000 */  sw        $s1, 0x0($a1)
/* DA11C 80143A1C 24A50004 */  addiu     $a1, $a1, 0x4
/* DA120 80143A20 26520001 */  addiu     $s2, $s2, 0x1
/* DA124 80143A24 26310001 */  addiu     $s1, $s1, 0x1
.L80143A28:
/* DA128 80143A28 2A220140 */  slti      $v0, $s1, 0x140
/* DA12C 80143A2C 1440FFDF */  bnez      $v0, .L801439AC
/* DA130 80143A30 24C60004 */   addiu    $a2, $a2, 0x4
/* DA134 80143A34 1240007E */  beqz      $s2, .L80143C30
/* DA138 80143A38 2642FFFF */   addiu    $v0, $s2, -0x1
/* DA13C 80143A3C 18400024 */  blez      $v0, .L80143AD0
/* DA140 80143A40 0000882D */   daddu    $s1, $zero, $zero
/* DA144 80143A44 3C0C8015 */  lui       $t4, %hi(gHudElements)
/* DA148 80143A48 258C7960 */  addiu     $t4, $t4, %lo(gHudElements)
/* DA14C 80143A4C 27AB0010 */  addiu     $t3, $sp, 0x10
/* DA150 80143A50 0160502D */  daddu     $t2, $t3, $zero
.L80143A54:
/* DA154 80143A54 26240001 */  addiu     $a0, $s1, 0x1
/* DA158 80143A58 0092102A */  slt       $v0, $a0, $s2
/* DA15C 80143A5C 50400018 */  beql      $v0, $zero, .L80143AC0
/* DA160 80143A60 26310001 */   addiu    $s1, $s1, 0x1
/* DA164 80143A64 0140482D */  daddu     $t1, $t2, $zero
/* DA168 80143A68 8D880000 */  lw        $t0, 0x0($t4)
/* DA16C 80143A6C 00041080 */  sll       $v0, $a0, 2
/* DA170 80143A70 004B2821 */  addu      $a1, $v0, $t3
.L80143A74:
/* DA174 80143A74 8D270000 */  lw        $a3, 0x0($t1)
/* DA178 80143A78 8CA60000 */  lw        $a2, 0x0($a1)
/* DA17C 80143A7C 00071080 */  sll       $v0, $a3, 2
/* DA180 80143A80 00481021 */  addu      $v0, $v0, $t0
/* DA184 80143A84 8C430000 */  lw        $v1, 0x0($v0)
/* DA188 80143A88 00061080 */  sll       $v0, $a2, 2
/* DA18C 80143A8C 00481021 */  addu      $v0, $v0, $t0
/* DA190 80143A90 8C420000 */  lw        $v0, 0x0($v0)
/* DA194 80143A94 80630044 */  lb        $v1, 0x44($v1)
/* DA198 80143A98 80420044 */  lb        $v0, 0x44($v0)
/* DA19C 80143A9C 0062182A */  slt       $v1, $v1, $v0
/* DA1A0 80143AA0 10600003 */  beqz      $v1, .L80143AB0
/* DA1A4 80143AA4 24840001 */   addiu    $a0, $a0, 0x1
/* DA1A8 80143AA8 AD260000 */  sw        $a2, 0x0($t1)
/* DA1AC 80143AAC ACA70000 */  sw        $a3, 0x0($a1)
.L80143AB0:
/* DA1B0 80143AB0 0092102A */  slt       $v0, $a0, $s2
/* DA1B4 80143AB4 1440FFEF */  bnez      $v0, .L80143A74
/* DA1B8 80143AB8 24A50004 */   addiu    $a1, $a1, 0x4
/* DA1BC 80143ABC 26310001 */  addiu     $s1, $s1, 0x1
.L80143AC0:
/* DA1C0 80143AC0 2642FFFF */  addiu     $v0, $s2, -0x1
/* DA1C4 80143AC4 0222102A */  slt       $v0, $s1, $v0
/* DA1C8 80143AC8 1440FFE2 */  bnez      $v0, .L80143A54
/* DA1CC 80143ACC 254A0004 */   addiu    $t2, $t2, 0x4
.L80143AD0:
/* DA1D0 80143AD0 3C06ED03 */  lui       $a2, (0xED030050 >> 16)
/* DA1D4 80143AD4 34C60050 */  ori       $a2, $a2, (0xED030050 & 0xFFFF)
/* DA1D8 80143AD8 3C04004D */  lui       $a0, (0x4D0370 >> 16)
/* DA1DC 80143ADC 34840370 */  ori       $a0, $a0, (0x4D0370 & 0xFFFF)
/* DA1E0 80143AE0 3C07D9C0 */  lui       $a3, (0xD9C0F9FA >> 16)
/* DA1E4 80143AE4 34E7F9FA */  ori       $a3, $a3, (0xD9C0F9FA & 0xFFFF)
/* DA1E8 80143AE8 3C09D9FF */  lui       $t1, (0xD9FFFFFF >> 16)
/* DA1EC 80143AEC 3529FFFF */  ori       $t1, $t1, (0xD9FFFFFF & 0xFFFF)
/* DA1F0 80143AF0 3C080022 */  lui       $t0, (0x220005 >> 16)
/* DA1F4 80143AF4 35080005 */  ori       $t0, $t0, (0x220005 & 0xFFFF)
/* DA1F8 80143AF8 3C0ADC08 */  lui       $t2, (0xDC08060A >> 16)
/* DA1FC 80143AFC 354A060A */  ori       $t2, $t2, (0xDC08060A & 0xFFFF)
/* DA200 80143B00 3C0BDC08 */  lui       $t3, (0xDC08090A >> 16)
/* DA204 80143B04 356B090A */  ori       $t3, $t3, (0xDC08090A & 0xFFFF)
/* DA208 80143B08 3C0CD700 */  lui       $t4, (0xD7000002 >> 16)
/* DA20C 80143B0C 358C0002 */  ori       $t4, $t4, (0xD7000002 & 0xFFFF)
/* DA210 80143B10 3C0DE200 */  lui       $t5, (0xE2001E01 >> 16)
/* DA214 80143B14 35AD1E01 */  ori       $t5, $t5, (0xE2001E01 & 0xFFFF)
/* DA218 80143B18 3C0FE300 */  lui       $t7, (0xE3000A11 >> 16)
/* DA21C 80143B1C 35EF0A11 */  ori       $t7, $t7, (0xE3000A11 & 0xFFFF)
/* DA220 80143B20 3C0E0008 */  lui       $t6, (0x82CF0 >> 16)
/* DA224 80143B24 35CE2CF0 */  ori       $t6, $t6, (0x82CF0 & 0xFFFF)
/* DA228 80143B28 3C05800A */  lui       $a1, %hi(gMainGfxPos)
/* DA22C 80143B2C 24A5A66C */  addiu     $a1, $a1, %lo(gMainGfxPos)
/* DA230 80143B30 8CA20000 */  lw        $v0, 0x0($a1)
/* DA234 80143B34 0000882D */  daddu     $s1, $zero, $zero
/* DA238 80143B38 0040182D */  daddu     $v1, $v0, $zero
/* DA23C 80143B3C 24420008 */  addiu     $v0, $v0, 0x8
/* DA240 80143B40 ACA20000 */  sw        $v0, 0x0($a1)
/* DA244 80143B44 AC660000 */  sw        $a2, 0x0($v1)
/* DA248 80143B48 AC640004 */  sw        $a0, 0x4($v1)
/* DA24C 80143B4C 24430008 */  addiu     $v1, $v0, 0x8
/* DA250 80143B50 ACA30000 */  sw        $v1, 0x0($a1)
/* DA254 80143B54 3C03E700 */  lui       $v1, (0xE7000000 >> 16)
/* DA258 80143B58 AC430000 */  sw        $v1, 0x0($v0)
/* DA25C 80143B5C 24430010 */  addiu     $v1, $v0, 0x10
/* DA260 80143B60 AC400004 */  sw        $zero, 0x4($v0)
/* DA264 80143B64 ACA30000 */  sw        $v1, 0x0($a1)
/* DA268 80143B68 24430018 */  addiu     $v1, $v0, 0x18
/* DA26C 80143B6C AC470008 */  sw        $a3, 0x8($v0)
/* DA270 80143B70 AC40000C */  sw        $zero, 0xC($v0)
/* DA274 80143B74 ACA30000 */  sw        $v1, 0x0($a1)
/* DA278 80143B78 24430020 */  addiu     $v1, $v0, 0x20
/* DA27C 80143B7C AC490010 */  sw        $t1, 0x10($v0)
/* DA280 80143B80 AC480014 */  sw        $t0, 0x14($v0)
/* DA284 80143B84 ACA30000 */  sw        $v1, 0x0($a1)
/* DA288 80143B88 3C03DB02 */  lui       $v1, (0xDB020000 >> 16)
/* DA28C 80143B8C AC430018 */  sw        $v1, 0x18($v0)
/* DA290 80143B90 24030018 */  addiu     $v1, $zero, 0x18
/* DA294 80143B94 AC43001C */  sw        $v1, 0x1C($v0)
/* DA298 80143B98 24430028 */  addiu     $v1, $v0, 0x28
/* DA29C 80143B9C 3C048015 */  lui       $a0, %hi(D_8014F110)
/* DA2A0 80143BA0 2484F110 */  addiu     $a0, $a0, %lo(D_8014F110)
/* DA2A4 80143BA4 ACA30000 */  sw        $v1, 0x0($a1)
/* DA2A8 80143BA8 24430030 */  addiu     $v1, $v0, 0x30
/* DA2AC 80143BAC AC440024 */  sw        $a0, 0x24($v0)
/* DA2B0 80143BB0 2484FFF8 */  addiu     $a0, $a0, -0x8
/* DA2B4 80143BB4 AC4A0020 */  sw        $t2, 0x20($v0)
/* DA2B8 80143BB8 ACA30000 */  sw        $v1, 0x0($a1)
/* DA2BC 80143BBC 24430038 */  addiu     $v1, $v0, 0x38
/* DA2C0 80143BC0 AC4B0028 */  sw        $t3, 0x28($v0)
/* DA2C4 80143BC4 AC44002C */  sw        $a0, 0x2C($v0)
/* DA2C8 80143BC8 ACA30000 */  sw        $v1, 0x0($a1)
/* DA2CC 80143BCC 2403FFFF */  addiu     $v1, $zero, -0x1
/* DA2D0 80143BD0 AC430034 */  sw        $v1, 0x34($v0)
/* DA2D4 80143BD4 24430040 */  addiu     $v1, $v0, 0x40
/* DA2D8 80143BD8 AC4C0030 */  sw        $t4, 0x30($v0)
/* DA2DC 80143BDC ACA30000 */  sw        $v1, 0x0($a1)
/* DA2E0 80143BE0 24430048 */  addiu     $v1, $v0, 0x48
/* DA2E4 80143BE4 AC4D0038 */  sw        $t5, 0x38($v0)
/* DA2E8 80143BE8 AC40003C */  sw        $zero, 0x3C($v0)
/* DA2EC 80143BEC ACA30000 */  sw        $v1, 0x0($a1)
/* DA2F0 80143BF0 AC4F0040 */  sw        $t7, 0x40($v0)
/* DA2F4 80143BF4 1A40000E */  blez      $s2, .L80143C30
/* DA2F8 80143BF8 AC4E0044 */   sw       $t6, 0x44($v0)
/* DA2FC 80143BFC 27B00010 */  addiu     $s0, $sp, 0x10
.L80143C00:
/* DA300 80143C00 8E020000 */  lw        $v0, 0x0($s0)
/* DA304 80143C04 26100004 */  addiu     $s0, $s0, 0x4
/* DA308 80143C08 3C038015 */  lui       $v1, %hi(gHudElements)
/* DA30C 80143C0C 8C637960 */  lw        $v1, %lo(gHudElements)($v1)
/* DA310 80143C10 00021080 */  sll       $v0, $v0, 2
/* DA314 80143C14 00431021 */  addu      $v0, $v0, $v1
/* DA318 80143C18 8C440000 */  lw        $a0, 0x0($v0)
/* DA31C 80143C1C 0C050AFF */  jal       render_hud_element
/* DA320 80143C20 26310001 */   addiu    $s1, $s1, 0x1
/* DA324 80143C24 0232102A */  slt       $v0, $s1, $s2
/* DA328 80143C28 1440FFF5 */  bnez      $v0, .L80143C00
/* DA32C 80143C2C 00000000 */   nop
.L80143C30:
/* DA330 80143C30 8FBF051C */  lw        $ra, 0x51C($sp)
/* DA334 80143C34 8FB20518 */  lw        $s2, 0x518($sp)
/* DA338 80143C38 8FB10514 */  lw        $s1, 0x514($sp)
/* DA33C 80143C3C 8FB00510 */  lw        $s0, 0x510($sp)
/* DA340 80143C40 03E00008 */  jr        $ra
/* DA344 80143C44 27BD0520 */   addiu    $sp, $sp, 0x520

### DECOMPILED C INSTRUCTIONS:

void render_hud_elements_world(void) {
    s32 i, count, j;
    s32 sortedElements[ARRAY_COUNT(*gHudElements)];
    s32 el1, el2;
    HudElement* hudElement;
    s16 tempOffsetZ;

    // TODO fix this terrible match
    do {
        do {
            count = 0;
            if (gCurrentCamID == CAM_3) {
                for (i = 0; i < ARRAY_COUNT(*gHudElements); i++) {
                    hudElement = (*gHudElements)[i];
                    if (hudElement != NULL) {
                        s32 flags = hudElement->flags;
                        if (flags && !(flags & HUD_ELEMENT_FLAG_DISABLED)) {
                            if (!(flags & (HUD_ELEMENT_FLAG_200000 | HUD_ELEMENT_FLAG_10000000))) {
                                if (flags & HUD_ELEMENT_FLAG_TRANSFORM) {
                                    if (!(flags & HUD_ELEMENT_FLAG_40000000)) {
                                        if (!(flags & HUD_ELEMENT_FLAG_FRONTUI) && hudElement->drawSizePreset >= 0 && !(flags & HUD_ELEMENT_FLAG_80)) {
                                            sortedElements[count++] = i;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                if (count != 0) {
                    for (i = 0; i < count - 1; i++) {
                        for (j = i + 1; j < count; j++) {
                            el1 = sortedElements[i];
                            el2 = sortedElements[j];
                            tempOffsetZ = (*gHudElements)[el1]->worldPosOffset.z;
                            do {} while (0);
                            if (tempOffsetZ < (*gHudElements)[el2]->worldPosOffset.z) {
                                sortedElements[i] = el2;
                                sortedElements[j] = el1;
                            }
                        }
                    }

                    gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 12, 20, 308, 220);
                    gDPPipeSync(gMainGfxPos++);
                    gSPClearGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH);
                    gSPSetGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH);
                    gSPSetLights1(gMainGfxPos++, D_8014F108);
                    gSPTexture(gMainGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON);
                    gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE);
                    gSPSetOtherMode(gMainGfxPos++, G_SETOTHERMODE_H, G_MDSFT_ALPHADITHER, 18, G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE);

                    for (i = 0; i < count; i++) {
                        render_hud_element((*gHudElements)[sortedElements[i]]);
                    }
                }
            }
            count = 0;
            if (gCurrentCamID == CAM_BATTLE) {
                for (i = 0; i < ARRAY_COUNT(*gHudElements); i++) {
                    hudElement = (*gHudElements)[i];
                    if (hudElement != NULL) {
                        s32 flags = hudElement->flags;
                        if (flags && !(flags & HUD_ELEMENT_FLAG_DISABLED)) {
                            if (!(flags & (HUD_ELEMENT_FLAG_200000 | HUD_ELEMENT_FLAG_10000000))) {
                                if (flags & HUD_ELEMENT_FLAG_TRANSFORM) {
                                    if (flags & HUD_ELEMENT_FLAG_40000000) {
                                        if (!(flags & HUD_ELEMENT_FLAG_FRONTUI) && hudElement->drawSizePreset >= 0 && !(flags & HUD_ELEMENT_FLAG_80)) {
                                            sortedElements[count++] = i;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                if (count != 0) {
                    for (i = 0; i < count - 1; i++) {
                        for (j = i + 1; j < count; j++) {
                            el1 = sortedElements[i];
                            el2 = sortedElements[j];
                            tempOffsetZ = (*gHudElements)[el1]->worldPosOffset.z;
                            do {} while (0);
                            if ((*gHudElements)[el1]->worldPosOffset.z < (*gHudElements)[el2]->worldPosOffset.z) {
                                sortedElements[i] = el2;
                                sortedElements[j] = el1;
                            }
                        }
                    }

                    gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 12, 20, 308, 220);
                    gDPPipeSync(gMainGfxPos++);
                    gSPClearGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH);
                    gSPSetGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH);
                    gSPSetLights1(gMainGfxPos++, D_8014F108);
                    gSPTexture(gMainGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON);
                    gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE);
                    gSPSetOtherMode(gMainGfxPos++, G_SETOTHERMODE_H, G_MDSFT_ALPHADITHER, 18, G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE);

                    for (i = 0; i < count; i++) {
                        render_hud_element((*gHudElements)[sortedElements[i]]);
                    }
                }
            }
        } while (0);
    } while (0);
}