### RAW ASSEMBLY INSTRUCTIONS:

dlabel func_8025A50C
/* 188DEC 8025A50C 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 188DF0 8025A510 AFB20018 */  sw        $s2, 0x18($sp)
/* 188DF4 8025A514 0080902D */  daddu     $s2, $a0, $zero
/* 188DF8 8025A518 AFB10014 */  sw        $s1, 0x14($sp)
/* 188DFC 8025A51C 00A0882D */  daddu     $s1, $a1, $zero
/* 188E00 8025A520 AFBF0024 */  sw        $ra, 0x24($sp)
/* 188E04 8025A524 AFB40020 */  sw        $s4, 0x20($sp)
/* 188E08 8025A528 AFB3001C */  sw        $s3, 0x1C($sp)
/* 188E0C 8025A52C AFB00010 */  sw        $s0, 0x10($sp)
/* 188E10 8025A530 8E3000C0 */  lw        $s0, 0xC0($s1)
/* 188E14 8025A534 00C0982D */  daddu     $s3, $a2, $zero
/* 188E18 8025A538 820206C1 */  lb        $v0, 0x6C1($s0)
/* 188E1C 8025A53C 10400032 */  beqz      $v0, .L8025A608
/* 188E20 8025A540 00E0A02D */   daddu    $s4, $a3, $zero
/* 188E24 8025A544 16400016 */  bnez      $s2, .L8025A5A0
/* 188E28 8025A548 00000000 */   nop
/* 188E2C 8025A54C 0C0B7830 */  jal       spr_get_player_palettes
/* 188E30 8025A550 96240088 */   lhu      $a0, 0x88($s1)
/* 188E34 8025A554 AE0206D0 */  sw        $v0, 0x6D0($s0)
/* 188E38 8025A558 0040202D */  daddu     $a0, $v0, $zero
/* 188E3C 8025A55C A20006CD */  sb        $zero, 0x6CD($s0)
/* 188E40 8025A560 8C830000 */  lw        $v1, 0x0($a0)
/* 188E44 8025A564 2402FFFF */  addiu     $v0, $zero, -0x1
/* 188E48 8025A568 1062000B */  beq       $v1, $v0, .L8025A598
/* 188E4C 8025A56C 0080182D */   daddu    $v1, $a0, $zero
/* 188E50 8025A570 0040202D */  daddu     $a0, $v0, $zero
.L8025A574:
/* 188E54 8025A574 920206CD */  lbu       $v0, 0x6CD($s0)
/* 188E58 8025A578 24420001 */  addiu     $v0, $v0, 0x1
/* 188E5C 8025A57C A20206CD */  sb        $v0, 0x6CD($s0)
/* 188E60 8025A580 00021600 */  sll       $v0, $v0, 24
/* 188E64 8025A584 00021583 */  sra       $v0, $v0, 22
/* 188E68 8025A588 00431021 */  addu      $v0, $v0, $v1
/* 188E6C 8025A58C 8C420000 */  lw        $v0, 0x0($v0)
/* 188E70 8025A590 1444FFF8 */  bne       $v0, $a0, .L8025A574
/* 188E74 8025A594 00000000 */   nop
.L8025A598:
/* 188E78 8025A598 0809697E */  j         .L8025A5F8
/* 188E7C 8025A59C 24020006 */   addiu    $v0, $zero, 0x6
.L8025A5A0:
/* 188E80 8025A5A0 96240088 */  lhu       $a0, 0x88($s1)
/* 188E84 8025A5A4 0C0B7A90 */  jal       spr_get_npc_palettes
/* 188E88 8025A5A8 00000000 */   nop
/* 188E8C 8025A5AC AE0206D0 */  sw        $v0, 0x6D0($s0)
/* 188E90 8025A5B0 0040202D */  daddu     $a0, $v0, $zero
/* 188E94 8025A5B4 A20006CD */  sb        $zero, 0x6CD($s0)
/* 188E98 8025A5B8 8C830000 */  lw        $v1, 0x0($a0)
/* 188E9C 8025A5BC 2402FFFF */  addiu     $v0, $zero, -0x1
/* 188EA0 8025A5C0 1062000B */  beq       $v1, $v0, .L8025A5F0
/* 188EA4 8025A5C4 0080182D */   daddu    $v1, $a0, $zero
/* 188EA8 8025A5C8 0040202D */  daddu     $a0, $v0, $zero
.L8025A5CC:
/* 188EAC 8025A5CC 920206CD */  lbu       $v0, 0x6CD($s0)
/* 188EB0 8025A5D0 24420001 */  addiu     $v0, $v0, 0x1
/* 188EB4 8025A5D4 A20206CD */  sb        $v0, 0x6CD($s0)
/* 188EB8 8025A5D8 00021600 */  sll       $v0, $v0, 24
/* 188EBC 8025A5DC 00021583 */  sra       $v0, $v0, 22
/* 188EC0 8025A5E0 00431021 */  addu      $v0, $v0, $v1
/* 188EC4 8025A5E4 8C420000 */  lw        $v0, 0x0($v0)
/* 188EC8 8025A5E8 1444FFF8 */  bne       $v0, $a0, .L8025A5CC
/* 188ECC 8025A5EC 00000000 */   nop
.L8025A5F0:
/* 188ED0 8025A5F0 0C0B7A9B */  jal       spr_get_npc_color_variations
/* 188ED4 8025A5F4 96240088 */   lhu      $a0, 0x88($s1)
.L8025A5F8:
/* 188ED8 8025A5F8 A20206CC */  sb        $v0, 0x6CC($s0)
/* 188EDC 8025A5FC A20006C2 */  sb        $zero, 0x6C2($s0)
/* 188EE0 8025A600 A60006CA */  sh        $zero, 0x6CA($s0)
/* 188EE4 8025A604 A20006C1 */  sb        $zero, 0x6C1($s0)
.L8025A608:
/* 188EE8 8025A608 820206CD */  lb        $v0, 0x6CD($s0)
/* 188EEC 8025A60C 18400015 */  blez      $v0, .L8025A664
/* 188EF0 8025A610 0000302D */   daddu    $a2, $zero, $zero
.L8025A614:
/* 188EF4 8025A614 8E0206D0 */  lw        $v0, 0x6D0($s0)
/* 188EF8 8025A618 00061880 */  sll       $v1, $a2, 2
/* 188EFC 8025A61C 00621821 */  addu      $v1, $v1, $v0
/* 188F00 8025A620 00061140 */  sll       $v0, $a2, 5
/* 188F04 8025A624 8C630000 */  lw        $v1, 0x0($v1)
/* 188F08 8025A628 10600009 */  beqz      $v1, .L8025A650
/* 188F0C 8025A62C 02022821 */   addu     $a1, $s0, $v0
/* 188F10 8025A630 0000202D */  daddu     $a0, $zero, $zero
.L8025A634:
/* 188F14 8025A634 94620000 */  lhu       $v0, 0x0($v1)
/* 188F18 8025A638 24630002 */  addiu     $v1, $v1, 0x2
/* 188F1C 8025A63C 24840001 */  addiu     $a0, $a0, 0x1
/* 188F20 8025A640 A4A20000 */  sh        $v0, 0x0($a1)
/* 188F24 8025A644 28820010 */  slti      $v0, $a0, 0x10
/* 188F28 8025A648 1440FFFA */  bnez      $v0, .L8025A634
/* 188F2C 8025A64C 24A50002 */   addiu    $a1, $a1, 0x2
.L8025A650:
/* 188F30 8025A650 820206CD */  lb        $v0, 0x6CD($s0)
/* 188F34 8025A654 24C60001 */  addiu     $a2, $a2, 0x1
/* 188F38 8025A658 00C2102A */  slt       $v0, $a2, $v0
/* 188F3C 8025A65C 1440FFED */  bnez      $v0, .L8025A614
/* 188F40 8025A660 00000000 */   nop
.L8025A664:
/* 188F44 8025A664 820206CC */  lb        $v0, 0x6CC($s0)
/* 188F48 8025A668 920306CC */  lbu       $v1, 0x6CC($s0)
/* 188F4C 8025A66C 18400019 */  blez      $v0, .L8025A6D4
/* 188F50 8025A670 0000302D */   daddu    $a2, $zero, $zero
/* 188F54 8025A674 00031600 */  sll       $v0, $v1, 24
.L8025A678:
/* 188F58 8025A678 00021603 */  sra       $v0, $v0, 24
/* 188F5C 8025A67C 00461021 */  addu      $v0, $v0, $a2
/* 188F60 8025A680 8E0306D0 */  lw        $v1, 0x6D0($s0)
/* 188F64 8025A684 00021080 */  sll       $v0, $v0, 2
/* 188F68 8025A688 00431021 */  addu      $v0, $v0, $v1
/* 188F6C 8025A68C 8C430000 */  lw        $v1, 0x0($v0)
/* 188F70 8025A690 00061140 */  sll       $v0, $a2, 5
/* 188F74 8025A694 10600009 */  beqz      $v1, .L8025A6BC
/* 188F78 8025A698 02022821 */   addu     $a1, $s0, $v0
/* 188F7C 8025A69C 0000202D */  daddu     $a0, $zero, $zero
.L8025A6A0:
/* 188F80 8025A6A0 94620000 */  lhu       $v0, 0x0($v1)
/* 188F84 8025A6A4 24630002 */  addiu     $v1, $v1, 0x2
/* 188F88 8025A6A8 24840001 */  addiu     $a0, $a0, 0x1
/* 188F8C 8025A6AC A4A20000 */  sh        $v0, 0x0($a1)
/* 188F90 8025A6B0 28820010 */  slti      $v0, $a0, 0x10
/* 188F94 8025A6B4 1440FFFA */  bnez      $v0, .L8025A6A0
/* 188F98 8025A6B8 24A50002 */   addiu    $a1, $a1, 0x2
.L8025A6BC:
/* 188F9C 8025A6BC 24C60001 */  addiu     $a2, $a2, 0x1
/* 188FA0 8025A6C0 820206CC */  lb        $v0, 0x6CC($s0)
/* 188FA4 8025A6C4 920306CC */  lbu       $v1, 0x6CC($s0)
/* 188FA8 8025A6C8 00C2102A */  slt       $v0, $a2, $v0
/* 188FAC 8025A6CC 1440FFEA */  bnez      $v0, .L8025A678
/* 188FB0 8025A6D0 00031600 */   sll      $v0, $v1, 24
.L8025A6D4:
/* 188FB4 8025A6D4 820206CD */  lb        $v0, 0x6CD($s0)
/* 188FB8 8025A6D8 1840000A */  blez      $v0, .L8025A704
/* 188FBC 8025A6DC 0000302D */   daddu    $a2, $zero, $zero
/* 188FC0 8025A6E0 0200202D */  daddu     $a0, $s0, $zero
/* 188FC4 8025A6E4 0200182D */  daddu     $v1, $s0, $zero
.L8025A6E8:
/* 188FC8 8025A6E8 AC6406D4 */  sw        $a0, 0x6D4($v1)
/* 188FCC 8025A6EC 24840020 */  addiu     $a0, $a0, 0x20
/* 188FD0 8025A6F0 820206CD */  lb        $v0, 0x6CD($s0)
/* 188FD4 8025A6F4 24C60001 */  addiu     $a2, $a2, 0x1
/* 188FD8 8025A6F8 00C2102A */  slt       $v0, $a2, $v0
/* 188FDC 8025A6FC 1440FFFA */  bnez      $v0, .L8025A6E8
/* 188FE0 8025A700 24630004 */   addiu    $v1, $v1, 0x4
.L8025A704:
/* 188FE4 8025A704 16400006 */  bnez      $s2, .L8025A720
/* 188FE8 8025A708 0220202D */   daddu    $a0, $s1, $zero
/* 188FEC 8025A70C 0260282D */  daddu     $a1, $s3, $zero
/* 188FF0 8025A710 0C096657 */  jal       func_8025995C
/* 188FF4 8025A714 0280302D */   daddu    $a2, $s4, $zero
/* 188FF8 8025A718 080969CB */  j         .L8025A72C
/* 188FFC 8025A71C 00000000 */   nop
.L8025A720:
/* 189000 8025A720 0260282D */  daddu     $a1, $s3, $zero
/* 189004 8025A724 0C0965B0 */  jal       func_802596C0
/* 189008 8025A728 0280302D */   daddu    $a2, $s4, $zero
.L8025A72C:
/* 18900C 8025A72C 8FBF0024 */  lw        $ra, 0x24($sp)
/* 189010 8025A730 8FB40020 */  lw        $s4, 0x20($sp)
/* 189014 8025A734 8FB3001C */  lw        $s3, 0x1C($sp)
/* 189018 8025A738 8FB20018 */  lw        $s2, 0x18($sp)
/* 18901C 8025A73C 8FB10014 */  lw        $s1, 0x14($sp)
/* 189020 8025A740 8FB00010 */  lw        $s0, 0x10($sp)
/* 189024 8025A744 03E00008 */  jr        $ra
/* 189028 8025A748 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void render_with_poison_palettes(b32 isNpcSprite, ActorPart* part, s32 yaw, Matrix4f mtx, b32 skipAnimation) {
    DecorationTable* decorationTable = part->decorationTable;
    PAL_PTR palIn;
    PAL_PTR palOut;
    s32 i, j;

    if (decorationTable->resetPalAdjust) {
        if (isNpcSprite == SPRITE_MODE_PLAYER) {
            decorationTable->originalPalettesList = spr_get_player_palettes(part->currentAnimation >> 16);
            decorationTable->originalPalettesCount = 0;
            while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) {
                decorationTable->originalPalettesCount++;
            }
            decorationTable->spriteColorVariations = SPR_PLAYER_COLOR_VARIATIONS;
        } else {
            decorationTable->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 16);
            decorationTable->originalPalettesCount = 0;
            while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) {
                decorationTable->originalPalettesCount++;
            }
            decorationTable->spriteColorVariations = spr_get_npc_color_variations(part->currentAnimation >> 16);
        }

        decorationTable->palAnimState = 0;
        decorationTable->palBlendAlpha = 0;
        decorationTable->resetPalAdjust = FALSE;
    }

    for (i = 0; i < decorationTable->originalPalettesCount; i++) {
        palIn = decorationTable->originalPalettesList[i];
        palOut = decorationTable->copiedPalettes[0][i];
        if (palIn != NULL) {
            for (j = 0; j < SPR_PAL_SIZE; j++) {
                *palOut++ = *palIn++;
            }
        }
    }
    for (i = 0; i < decorationTable->spriteColorVariations; i++) {
        palIn = decorationTable->originalPalettesList[decorationTable->spriteColorVariations + i];
        palOut = decorationTable->copiedPalettes[0][i];
        if (palIn != NULL) {
            for (j = 0; j < SPR_PAL_SIZE; j++) {
                *palOut++ = *palIn++;
            }
        }
    }

    for (i = 0; i < decorationTable->originalPalettesCount; i++) {
        decorationTable->adjustedPalettes[i] = decorationTable->copiedPalettes[0][i];
    }

    if (isNpcSprite == SPRITE_MODE_PLAYER) {
        func_8025995C(part, yaw, mtx);
    } else {
        func_802596C0(part, yaw, mtx);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel title_screen_draw_copyright
/* 13214 80037E14 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 13218 80037E18 3C07800A */  lui       $a3, %hi(gMainGfxPos)
/* 1321C 80037E1C 24E7A66C */  addiu     $a3, $a3, %lo(gMainGfxPos)
/* 13220 80037E20 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 13224 80037E24 AFB7001C */  sw        $s7, 0x1C($sp)
/* 13228 80037E28 AFB60018 */  sw        $s6, 0x18($sp)
/* 1322C 80037E2C AFB50014 */  sw        $s5, 0x14($sp)
/* 13230 80037E30 AFB40010 */  sw        $s4, 0x10($sp)
/* 13234 80037E34 AFB3000C */  sw        $s3, 0xC($sp)
/* 13238 80037E38 AFB20008 */  sw        $s2, 0x8($sp)
/* 1323C 80037E3C AFB10004 */  sw        $s1, 0x4($sp)
/* 13240 80037E40 AFB00000 */  sw        $s0, 0x0($sp)
/* 13244 80037E44 8CE50000 */  lw        $a1, 0x0($a3)
/* 13248 80037E48 3C01437F */  lui       $at, (0x437F0000 >> 16)
/* 1324C 80037E4C 44810000 */  mtc1      $at, $f0
/* 13250 80037E50 00A0182D */  daddu     $v1, $a1, $zero
/* 13254 80037E54 24A50008 */  addiu     $a1, $a1, 0x8
/* 13258 80037E58 ACE50000 */  sw        $a1, 0x0($a3)
/* 1325C 80037E5C AC620000 */  sw        $v0, 0x0($v1)
/* 13260 80037E60 3C028007 */  lui       $v0, %hi(D_80077A50)
/* 13264 80037E64 24427A50 */  addiu     $v0, $v0, %lo(D_80077A50)
/* 13268 80037E68 46006302 */  mul.s     $f12, $f12, $f0
/* 1326C 80037E6C 00000000 */  nop
/* 13270 80037E70 AC620004 */  sw        $v0, 0x4($v1)
/* 13274 80037E74 24A20008 */  addiu     $v0, $a1, 0x8
/* 13278 80037E78 ACE20000 */  sw        $v0, 0x0($a3)
/* 1327C 80037E7C 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 13280 80037E80 460C0001 */  sub.s     $f0, $f0, $f12
/* 13284 80037E84 ACA20000 */  sw        $v0, 0x0($a1)
/* 13288 80037E88 4600008D */  trunc.w.s $f2, $f0
/* 1328C 80037E8C 44061000 */  mfc1      $a2, $f2
/* 13290 80037E90 00000000 */  nop
/* 13294 80037E94 28C200FF */  slti      $v0, $a2, 0xFF
/* 13298 80037E98 10400011 */  beqz      $v0, .L80037EE0
/* 1329C 80037E9C ACA00004 */   sw       $zero, 0x4($a1)
/* 132A0 80037EA0 04C20001 */  bltzl     $a2, .L80037EA8
/* 132A4 80037EA4 0000302D */   daddu    $a2, $zero, $zero
.L80037EA8:
/* 132A8 80037EA8 3C04FCFF */  lui       $a0, (0xFCFF97FF >> 16)
/* 132AC 80037EAC 348497FF */  ori       $a0, $a0, (0xFCFF97FF & 0xFFFF)
/* 132B0 80037EB0 3C03FF2C */  lui       $v1, (0xFF2CFE7F >> 16)
/* 132B4 80037EB4 3463FE7F */  ori       $v1, $v1, (0xFF2CFE7F & 0xFFFF)
/* 132B8 80037EB8 24A20010 */  addiu     $v0, $a1, 0x10
/* 132BC 80037EBC ACE20000 */  sw        $v0, 0x0($a3)
/* 132C0 80037EC0 24A20018 */  addiu     $v0, $a1, 0x18
/* 132C4 80037EC4 ACA40008 */  sw        $a0, 0x8($a1)
/* 132C8 80037EC8 ACA3000C */  sw        $v1, 0xC($a1)
/* 132CC 80037ECC ACE20000 */  sw        $v0, 0x0($a3)
/* 132D0 80037ED0 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 132D4 80037ED4 ACA20010 */  sw        $v0, 0x10($a1)
/* 132D8 80037ED8 30C200FF */  andi      $v0, $a2, 0xFF
/* 132DC 80037EDC ACA20014 */  sw        $v0, 0x14($a1)
.L80037EE0:
/* 132E0 80037EE0 0000602D */  daddu     $t4, $zero, $zero
/* 132E4 80037EE4 3C08800A */  lui       $t0, %hi(gMainGfxPos)
/* 132E8 80037EE8 2508A66C */  addiu     $t0, $t0, %lo(gMainGfxPos)
/* 132EC 80037EEC 3C10FD68 */  lui       $s0, (0xFD68008F >> 16)
/* 132F0 80037EF0 3610008F */  ori       $s0, $s0, (0xFD68008F & 0xFFFF)
/* 132F4 80037EF4 3C16800A */  lui       $s6, %hi(TitleScreen_ImgList_Copyright)
/* 132F8 80037EF8 26D6097C */  addiu     $s6, $s6, %lo(TitleScreen_ImgList_Copyright)
/* 132FC 80037EFC 3C0DF568 */  lui       $t5, (0xF5682400 >> 16)
/* 13300 80037F00 35AD2400 */  ori       $t5, $t5, (0xF5682400 & 0xFFFF)
/* 13304 80037F04 3C150700 */  lui       $s5, (0x7000000 >> 16)
/* 13308 80037F08 3C14E600 */  lui       $s4, (0xE6000000 >> 16)
/* 1330C 80037F0C 3C13F400 */  lui       $s3, (0xF4000000 >> 16)
/* 13310 80037F10 3C190723 */  lui       $t9, (0x723C03C >> 16)
/* 13314 80037F14 3739C03C */  ori       $t9, $t9, (0x723C03C & 0xFFFF)
/* 13318 80037F18 3C12E700 */  lui       $s2, (0xE7000000 >> 16)
/* 1331C 80037F1C 3C11F200 */  lui       $s1, (0xF2000000 >> 16)
/* 13320 80037F20 3C180023 */  lui       $t8, (0x23C03C >> 16)
/* 13324 80037F24 3718C03C */  ori       $t8, $t8, (0x23C03C & 0xFFFF)
/* 13328 80037F28 3C0FE43A */  lui       $t7, (0xE43A4000 >> 16)
/* 1332C 80037F2C 35EF4000 */  ori       $t7, $t7, (0xE43A4000 & 0xFFFF)
/* 13330 80037F30 3C0E0016 */  lui       $t6, (0x164000 >> 16)
/* 13334 80037F34 35CE4000 */  ori       $t6, $t6, (0x164000 & 0xFFFF)
/* 13338 80037F38 240B02FC */  addiu     $t3, $zero, 0x2FC
/* 1333C 80037F3C 240A033C */  addiu     $t2, $zero, 0x33C
/* 13340 80037F40 0180482D */  daddu     $t1, $t4, $zero
.L80037F44:
/* 13344 80037F44 3C070400 */  lui       $a3, (0x4000400 >> 16)
/* 13348 80037F48 34E70400 */  ori       $a3, $a3, (0x4000400 & 0xFFFF)
/* 1334C 80037F4C 31660FFF */  andi      $a2, $t3, 0xFFF
/* 13350 80037F50 256B0040 */  addiu     $t3, $t3, 0x40
/* 13354 80037F54 31450FFF */  andi      $a1, $t2, 0xFFF
/* 13358 80037F58 254A0040 */  addiu     $t2, $t2, 0x40
/* 1335C 80037F5C 258C0001 */  addiu     $t4, $t4, 0x1
/* 13360 80037F60 00AF2825 */  or        $a1, $a1, $t7
/* 13364 80037F64 00CE3025 */  or        $a2, $a2, $t6
/* 13368 80037F68 8D030000 */  lw        $v1, 0x0($t0)
/* 1336C 80037F6C 8EC20000 */  lw        $v0, 0x0($s6)
/* 13370 80037F70 0060202D */  daddu     $a0, $v1, $zero
/* 13374 80037F74 24630008 */  addiu     $v1, $v1, 0x8
/* 13378 80037F78 00491021 */  addu      $v0, $v0, $t1
/* 1337C 80037F7C 25290900 */  addiu     $t1, $t1, 0x900
/* 13380 80037F80 AD030000 */  sw        $v1, 0x0($t0)
/* 13384 80037F84 AC820004 */  sw        $v0, 0x4($a0)
/* 13388 80037F88 24620008 */  addiu     $v0, $v1, 0x8
/* 1338C 80037F8C AC900000 */  sw        $s0, 0x0($a0)
/* 13390 80037F90 AD020000 */  sw        $v0, 0x0($t0)
/* 13394 80037F94 24620010 */  addiu     $v0, $v1, 0x10
/* 13398 80037F98 AC6D0000 */  sw        $t5, 0x0($v1)
/* 1339C 80037F9C AC750004 */  sw        $s5, 0x4($v1)
/* 133A0 80037FA0 AD020000 */  sw        $v0, 0x0($t0)
/* 133A4 80037FA4 24620018 */  addiu     $v0, $v1, 0x18
/* 133A8 80037FA8 AC740008 */  sw        $s4, 0x8($v1)
/* 133AC 80037FAC AC60000C */  sw        $zero, 0xC($v1)
/* 133B0 80037FB0 AD020000 */  sw        $v0, 0x0($t0)
/* 133B4 80037FB4 24620020 */  addiu     $v0, $v1, 0x20
/* 133B8 80037FB8 AC730010 */  sw        $s3, 0x10($v1)
/* 133BC 80037FBC AC790014 */  sw        $t9, 0x14($v1)
/* 133C0 80037FC0 AD020000 */  sw        $v0, 0x0($t0)
/* 133C4 80037FC4 24620028 */  addiu     $v0, $v1, 0x28
/* 133C8 80037FC8 AC720018 */  sw        $s2, 0x18($v1)
/* 133CC 80037FCC AC60001C */  sw        $zero, 0x1C($v1)
/* 133D0 80037FD0 AD020000 */  sw        $v0, 0x0($t0)
/* 133D4 80037FD4 24620030 */  addiu     $v0, $v1, 0x30
/* 133D8 80037FD8 AC6D0020 */  sw        $t5, 0x20($v1)
/* 133DC 80037FDC AC600024 */  sw        $zero, 0x24($v1)
/* 133E0 80037FE0 AD020000 */  sw        $v0, 0x0($t0)
/* 133E4 80037FE4 24620038 */  addiu     $v0, $v1, 0x38
/* 133E8 80037FE8 AC710028 */  sw        $s1, 0x28($v1)
/* 133EC 80037FEC AC78002C */  sw        $t8, 0x2C($v1)
/* 133F0 80037FF0 AD020000 */  sw        $v0, 0x0($t0)
/* 133F4 80037FF4 24620040 */  addiu     $v0, $v1, 0x40
/* 133F8 80037FF8 AC650030 */  sw        $a1, 0x30($v1)
/* 133FC 80037FFC AC660034 */  sw        $a2, 0x34($v1)
/* 13400 80038000 AD020000 */  sw        $v0, 0x0($t0)
/* 13404 80038004 3C02E100 */  lui       $v0, (0xE1000000 >> 16)
/* 13408 80038008 AC620038 */  sw        $v0, 0x38($v1)
/* 1340C 8003800C 24620048 */  addiu     $v0, $v1, 0x48
/* 13410 80038010 AC60003C */  sw        $zero, 0x3C($v1)
/* 13414 80038014 AD020000 */  sw        $v0, 0x0($t0)
/* 13418 80038018 3C02F100 */  lui       $v0, (0xF1000000 >> 16)
/* 1341C 8003801C AC620040 */  sw        $v0, 0x40($v1)
/* 13420 80038020 29820002 */  slti      $v0, $t4, 0x2
/* 13424 80038024 1440FFC7 */  bnez      $v0, .L80037F44
/* 13428 80038028 AC670044 */   sw       $a3, 0x44($v1)
/* 1342C 8003802C 3C03800A */  lui       $v1, %hi(gMainGfxPos)
/* 13430 80038030 2463A66C */  addiu     $v1, $v1, %lo(gMainGfxPos)
/* 13434 80038034 8C620000 */  lw        $v0, 0x0($v1)
/* 13438 80038038 0040202D */  daddu     $a0, $v0, $zero
/* 1343C 8003803C 24420008 */  addiu     $v0, $v0, 0x8
/* 13440 80038040 AC620000 */  sw        $v0, 0x0($v1)
/* 13444 80038044 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 13448 80038048 AC820000 */  sw        $v0, 0x0($a0)
/* 1344C 8003804C AC800004 */  sw        $zero, 0x4($a0)
/* 13450 80038050 8FB7001C */  lw        $s7, 0x1C($sp)
/* 13454 80038054 8FB60018 */  lw        $s6, 0x18($sp)
/* 13458 80038058 8FB50014 */  lw        $s5, 0x14($sp)
/* 1345C 8003805C 8FB40010 */  lw        $s4, 0x10($sp)
/* 13460 80038060 8FB3000C */  lw        $s3, 0xC($sp)
/* 13464 80038064 8FB20008 */  lw        $s2, 0x8($sp)
/* 13468 80038068 8FB10004 */  lw        $s1, 0x4($sp)
/* 1346C 8003806C 8FB00000 */  lw        $s0, 0x0($sp)
/* 13470 80038070 03E00008 */  jr        $ra
/* 13474 80038074 27BD0020 */   addiu    $sp, $sp, 0x20
/* 13478 80038078 00000000 */  nop
/* 1347C 8003807C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void title_screen_draw_copyright(f32 arg0) {
    s32 alpha;
    s32 i;

    gSPDisplayList(gMainGfxPos++, &D_80077A50);
#if VERSION_JP
    gDPSetTextureLUT(gMainGfxPos++, G_TT_RGBA16);
#endif
    gDPPipeSync(gMainGfxPos++);

    alpha = 255.0f - (arg0 * 255.0f);
    if (alpha < 255) {
        if (alpha < 0) {
            alpha = 0;
        }
        gDPSetCombineMode(gMainGfxPos++, PM_CC_02, PM_CC_02);
        gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha);
    }

#if VERSION_JP
    gDPLoadTLUT_pal16(gMainGfxPos++, 0, TitleScreen_ImgList_CopyrightPalette);
    gDPLoadTextureTile_4b(gMainGfxPos++, TitleScreen_ImgList_Copyright, G_IM_FMT_CI,
                          COPYRIGHT_WIDTH, 0, 0, 0, 127, 31, 0,
                          G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
                          G_TX_NOLOD);
    gSPTextureRectangle(gMainGfxPos++, 388, YL_BASE, 900, 892, G_TX_RENDERTILE,
                        0, 0, 0x0400, 0x0400);
#else
    for (i = 0; i < COPYRIGHT_TEX_CHUNKS; i++) {
        s32 k = 10 * i;
        alpha = 0; // TODO figure out why this is needed

        gDPLoadTextureTile(gMainGfxPos++, COPYRIGHT_IMG(k, i), G_IM_FMT_IA, G_IM_SIZ_8b,
                           COPYRIGHT_WIDTH, 32, 0, 0, 143, LTT_LRT, 0,
                           G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
                           G_TX_NOLOD);
        gSPTextureRectangle(gMainGfxPos++, 356, YL_BASE + (RECT_SIZE * i), 932, YH_BASE + (RECT_SIZE * i),
                            G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400);
    }
#endif
    gDPPipeSync(gMainGfxPos++);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel ShowKeyChoicePopup
/* FADD0 802D6420 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* FADD4 802D6424 AFB00010 */  sw        $s0, 0x10($sp)
/* FADD8 802D6428 0080802D */  daddu     $s0, $a0, $zero
/* FADDC 802D642C AFB3001C */  sw        $s3, 0x1C($sp)
/* FADE0 802D6430 3C138011 */  lui       $s3, %hi(gPlayerData)
/* FADE4 802D6434 2673F290 */  addiu     $s3, $s3, %lo(gPlayerData)
/* FADE8 802D6438 AFB10014 */  sw        $s1, 0x14($sp)
/* FADEC 802D643C 3C11802E */  lui       $s1, %hi(D_802DB830)
/* FADF0 802D6440 2631B830 */  addiu     $s1, $s1, %lo(D_802DB830)
/* FADF4 802D6444 AFBF0020 */  sw        $ra, 0x20($sp)
/* FADF8 802D6448 AFB20018 */  sw        $s2, 0x18($sp)
/* FADFC 802D644C 8E12014C */  lw        $s2, 0x14C($s0)
/* FAE00 802D6450 54A00001 */  bnel      $a1, $zero, .L802D6458
/* FAE04 802D6454 AE000070 */   sw       $zero, 0x70($s0)
.L802D6458:
/* FAE08 802D6458 8E030070 */  lw        $v1, 0x70($s0)
/* FAE0C 802D645C 10600005 */  beqz      $v1, .L802D6474
/* FAE10 802D6460 24020001 */   addiu    $v0, $zero, 0x1
/* FAE14 802D6464 1062004B */  beq       $v1, $v0, .L802D6594
/* FAE18 802D6468 0000102D */   daddu    $v0, $zero, $zero
/* FAE1C 802D646C 080B5988 */  j         .L802D6620
/* FAE20 802D6470 00000000 */   nop
.L802D6474:
/* FAE24 802D6474 0C03805E */  jal       disable_player_input
/* FAE28 802D6478 00000000 */   nop
/* FAE2C 802D647C 0C038045 */  jal       disable_player_static_collisions
/* FAE30 802D6480 00000000 */   nop
/* FAE34 802D6484 0C03BD8A */  jal       partner_disable_input
/* FAE38 802D6488 00000000 */   nop
/* FAE3C 802D648C 0C03A5EE */  jal       close_status_bar
/* FAE40 802D6490 00000000 */   nop
/* FAE44 802D6494 0000482D */  daddu     $t1, $zero, $zero
/* FAE48 802D6498 0120402D */  daddu     $t0, $t1, $zero
/* FAE4C 802D649C 3C0C8008 */  lui       $t4, %hi(gItemTable)
/* FAE50 802D64A0 258C78E0 */  addiu     $t4, $t4, %lo(gItemTable)
/* FAE54 802D64A4 3C0B8009 */  lui       $t3, %hi(gItemHudScripts)
/* FAE58 802D64A8 256BA680 */  addiu     $t3, $t3, %lo(gItemHudScripts)
/* FAE5C 802D64AC 240A0001 */  addiu     $t2, $zero, 0x1
/* FAE60 802D64B0 0260382D */  daddu     $a3, $s3, $zero
/* FAE64 802D64B4 3C03800A */  lui       $v1, %hi(gOverrideFlags)
/* FAE68 802D64B8 2463A650 */  addiu     $v1, $v1, %lo(gOverrideFlags)
/* FAE6C 802D64BC 8C620000 */  lw        $v0, 0x0($v1)
/* FAE70 802D64C0 0220302D */  daddu     $a2, $s1, $zero
/* FAE74 802D64C4 34420040 */  ori       $v0, $v0, 0x40
/* FAE78 802D64C8 AC620000 */  sw        $v0, 0x0($v1)
.L802D64CC:
/* FAE7C 802D64CC 84E40074 */  lh        $a0, 0x74($a3)
/* FAE80 802D64D0 5080001F */  beql      $a0, $zero, .L802D6550
/* FAE84 802D64D4 25080001 */   addiu    $t0, $t0, 0x1
/* FAE88 802D64D8 8E430028 */  lw        $v1, 0x28($s2)
/* FAE8C 802D64DC 8C620000 */  lw        $v0, 0x0($v1)
/* FAE90 802D64E0 18400008 */  blez      $v0, .L802D6504
/* FAE94 802D64E4 0000282D */   daddu    $a1, $zero, $zero
.L802D64E8:
/* FAE98 802D64E8 54820003 */  bnel      $a0, $v0, .L802D64F8
/* FAE9C 802D64EC 24630004 */   addiu    $v1, $v1, 0x4
/* FAEA0 802D64F0 080B5941 */  j         .L802D6504
/* FAEA4 802D64F4 24050001 */   addiu    $a1, $zero, 0x1
.L802D64F8:
/* FAEA8 802D64F8 8C620000 */  lw        $v0, 0x0($v1)
/* FAEAC 802D64FC 1C40FFFA */  bgtz      $v0, .L802D64E8
/* FAEB0 802D6500 00000000 */   nop
.L802D6504:
/* FAEB4 802D6504 50A00012 */  beql      $a1, $zero, .L802D6550
/* FAEB8 802D6508 25080001 */   addiu    $t0, $t0, 0x1
/* FAEBC 802D650C 84E30074 */  lh        $v1, 0x74($a3)
/* FAEC0 802D6510 00031940 */  sll       $v1, $v1, 5
/* FAEC4 802D6514 006C1821 */  addu      $v1, $v1, $t4
/* FAEC8 802D6518 84620004 */  lh        $v0, 0x4($v1)
/* FAECC 802D651C 000210C0 */  sll       $v0, $v0, 3
/* FAED0 802D6520 004B1021 */  addu      $v0, $v0, $t3
/* FAED4 802D6524 8C420000 */  lw        $v0, 0x0($v0)
/* FAED8 802D6528 ACC80108 */  sw        $t0, 0x108($a2)
/* FAEDC 802D652C ACCA018C */  sw        $t2, 0x18C($a2)
/* FAEE0 802D6530 ACC20000 */  sw        $v0, 0x0($a2)
/* FAEE4 802D6534 8C620000 */  lw        $v0, 0x0($v1)
/* FAEE8 802D6538 ACC20084 */  sw        $v0, 0x84($a2)
/* FAEEC 802D653C 8C620014 */  lw        $v0, 0x14($v1)
/* FAEF0 802D6540 25290001 */  addiu     $t1, $t1, 0x1
/* FAEF4 802D6544 ACC20294 */  sw        $v0, 0x294($a2)
/* FAEF8 802D6548 24C60004 */  addiu     $a2, $a2, 0x4
/* FAEFC 802D654C 25080001 */  addiu     $t0, $t0, 0x1
.L802D6550:
/* FAF00 802D6550 29020020 */  slti      $v0, $t0, 0x20
/* FAF04 802D6554 1440FFDD */  bnez      $v0, .L802D64CC
/* FAF08 802D6558 24E70002 */   addiu    $a3, $a3, 0x2
/* FAF0C 802D655C 15200004 */  bnez      $t1, .L802D6570
/* FAF10 802D6560 2402000C */   addiu    $v0, $zero, 0xC
/* FAF14 802D6564 AE000084 */  sw        $zero, 0x84($s0)
/* FAF18 802D6568 080B5988 */  j         .L802D6620
/* FAF1C 802D656C 24020001 */   addiu    $v0, $zero, 0x1
.L802D6570:
/* FAF20 802D6570 0220202D */  daddu     $a0, $s1, $zero
/* FAF24 802D6574 AE220318 */  sw        $v0, 0x318($s1)
/* FAF28 802D6578 AE290324 */  sw        $t1, 0x324($s1)
/* FAF2C 802D657C 0C03D390 */  jal       create_standard_popup_menu
/* FAF30 802D6580 AE200328 */   sw       $zero, 0x328($s1)
/* FAF34 802D6584 24020001 */  addiu     $v0, $zero, 0x1
/* FAF38 802D6588 AE000074 */  sw        $zero, 0x74($s0)
/* FAF3C 802D658C 080B5987 */  j         .L802D661C
/* FAF40 802D6590 AE020070 */   sw       $v0, 0x70($s0)
.L802D6594:
/* FAF44 802D6594 8E020074 */  lw        $v0, 0x74($s0)
/* FAF48 802D6598 14400008 */  bnez      $v0, .L802D65BC
/* FAF4C 802D659C 24420001 */   addiu    $v0, $v0, 0x1
/* FAF50 802D65A0 8622032C */  lh        $v0, 0x32C($s1)
/* FAF54 802D65A4 1040001D */  beqz      $v0, .L802D661C
/* FAF58 802D65A8 AE020078 */   sw       $v0, 0x78($s0)
/* FAF5C 802D65AC 0C03C4EC */  jal       hide_popup_menu
/* FAF60 802D65B0 00000000 */   nop
/* FAF64 802D65B4 8E020074 */  lw        $v0, 0x74($s0)
/* FAF68 802D65B8 24420001 */  addiu     $v0, $v0, 0x1
.L802D65BC:
/* FAF6C 802D65BC AE020074 */  sw        $v0, 0x74($s0)
/* FAF70 802D65C0 2842000F */  slti      $v0, $v0, 0xF
/* FAF74 802D65C4 14400016 */  bnez      $v0, .L802D6620
/* FAF78 802D65C8 0000102D */   daddu    $v0, $zero, $zero
/* FAF7C 802D65CC 0C03C54E */  jal       destroy_popup_menu
/* FAF80 802D65D0 00000000 */   nop
/* FAF84 802D65D4 8E030078 */  lw        $v1, 0x78($s0)
/* FAF88 802D65D8 240200FF */  addiu     $v0, $zero, 0xFF
/* FAF8C 802D65DC 54620005 */  bnel      $v1, $v0, .L802D65F4
/* FAF90 802D65E0 2462FFFF */   addiu    $v0, $v1, -0x1
/* FAF94 802D65E4 2402FFFF */  addiu     $v0, $zero, -0x1
/* FAF98 802D65E8 AE020084 */  sw        $v0, 0x84($s0)
/* FAF9C 802D65EC 080B5988 */  j         .L802D6620
/* FAFA0 802D65F0 24020001 */   addiu    $v0, $zero, 0x1
.L802D65F4:
/* FAFA4 802D65F4 00021080 */  sll       $v0, $v0, 2
/* FAFA8 802D65F8 00511021 */  addu      $v0, $v0, $s1
/* FAFAC 802D65FC 8C430108 */  lw        $v1, 0x108($v0)
/* FAFB0 802D6600 00031040 */  sll       $v0, $v1, 1
/* FAFB4 802D6604 00531021 */  addu      $v0, $v0, $s3
/* FAFB8 802D6608 AE030088 */  sw        $v1, 0x88($s0)
/* FAFBC 802D660C 84430074 */  lh        $v1, 0x74($v0)
/* FAFC0 802D6610 24020001 */  addiu     $v0, $zero, 0x1
/* FAFC4 802D6614 080B5988 */  j         .L802D6620
/* FAFC8 802D6618 AE030084 */   sw       $v1, 0x84($s0)
.L802D661C:
/* FAFCC 802D661C 0000102D */  daddu     $v0, $zero, $zero
.L802D6620:
/* FAFD0 802D6620 8FBF0020 */  lw        $ra, 0x20($sp)
/* FAFD4 802D6624 8FB3001C */  lw        $s3, 0x1C($sp)
/* FAFD8 802D6628 8FB20018 */  lw        $s2, 0x18($sp)
/* FAFDC 802D662C 8FB10014 */  lw        $s1, 0x14($sp)
/* FAFE0 802D6630 8FB00010 */  lw        $s0, 0x10($sp)
/* FAFE4 802D6634 03E00008 */  jr        $ra
/* FAFE8 802D6638 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

ApiStatus ShowKeyChoicePopup(Evt* script, s32 isInitialCall) {
    PlayerData* playerData = &gPlayerData;
    PopupMenu* menu = &D_802DB830;
    Trigger* trigger = script->owner2.trigger;
    s32 numEntries;
    s32 t; // TODO required in both places to match
    s32 i;

    if (isInitialCall) {
        script->functionTemp[0] = 0;
    }

    t = script->functionTemp[0];
    switch (t) {
        case 0:
            disable_player_input();
            disable_player_static_collisions();
            partner_disable_input();
            close_status_bar();
            numEntries = 0;

            gOverrideFlags |= GLOBAL_OVERRIDES_40;

            for (i = 0; i < ARRAY_COUNT(playerData->keyItems); i++) {
                s16 invItem = playerData->keyItems[i];

                if (invItem != ITEM_NONE) {
                    s32 found = FALSE;
                    s32* itemIt = trigger->itemList;

                    while (*itemIt > 0) {
                        if (invItem == *itemIt) {
                            found = TRUE;
                            break;
                        }
                        itemIt++;
                    }

                    if (found) {
                        ItemData* item = &gItemTable[playerData->keyItems[i]];

                        menu->ptrIcon[numEntries] = gItemHudScripts[item->hudElemID].enabled;
                        menu->userIndex[numEntries] = i;
                        menu->enabled[numEntries] = TRUE;
                        menu->nameMsg[numEntries] = item->nameMsg;
                        menu->descMsg[numEntries] = item->shortDescMsg;
                        numEntries++;
                    }
                }
            }

            if (numEntries == 0) {
                script->varTable[0] = 0;
                return ApiStatus_DONE1;
            }
            menu->popupType = POPUP_MENU_USEKEY;
            menu->numEntries = numEntries;
            menu->initialPos = 0;
            create_standard_popup_menu(menu);
            script->functionTemp[1] = 0;
            script->functionTemp[0] = 1;
            break;
        case 1:
            if (script->functionTemp[1] == 0) {
                script->functionTemp[2] = menu->result;
                if (script->functionTemp[2] == 0) {
                    break;
                }
                hide_popup_menu();
            }

            script->functionTemp[1]++;
            if (script->functionTemp[1] >= 15) {
                destroy_popup_menu();

                if (script->functionTemp[2] == 0xFF) {
                    script->varTable[0] = -1;
                    return ApiStatus_DONE1;
                } else {
                    t = menu->userIndex[script->functionTemp[2] - 1];

                    script->varTable[1] = t;
                    script->varTable[0] = playerData->keyItems[t];
                    return ApiStatus_DONE1;
                }
            }
            break;
    }
    return ApiStatus_BLOCK;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel PlayerTestEnemy
/* 1A2FD0 802746F0 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 1A2FD4 802746F4 AFB20018 */  sw        $s2, 0x18($sp)
/* 1A2FD8 802746F8 0080902D */  daddu     $s2, $a0, $zero
/* 1A2FDC 802746FC AFBF0020 */  sw        $ra, 0x20($sp)
/* 1A2FE0 80274700 AFB3001C */  sw        $s3, 0x1C($sp)
/* 1A2FE4 80274704 AFB10014 */  sw        $s1, 0x14($sp)
/* 1A2FE8 80274708 AFB00010 */  sw        $s0, 0x10($sp)
/* 1A2FEC 8027470C 8E50000C */  lw        $s0, 0xC($s2)
/* 1A2FF0 80274710 3C11800E */  lui       $s1, %hi(gBattleStatus)
/* 1A2FF4 80274714 2631C070 */  addiu     $s1, $s1, %lo(gBattleStatus)
/* 1A2FF8 80274718 8E130000 */  lw        $s3, 0x0($s0)
/* 1A2FFC 8027471C 26100004 */  addiu     $s0, $s0, 0x4
/* 1A3000 80274720 8E020000 */  lw        $v0, 0x0($s0)
/* 1A3004 80274724 26100004 */  addiu     $s0, $s0, 0x4
/* 1A3008 80274728 AE220188 */  sw        $v0, 0x188($s1)
/* 1A300C 8027472C 8E020000 */  lw        $v0, 0x0($s0)
/* 1A3010 80274730 26100004 */  addiu     $s0, $s0, 0x4
/* 1A3014 80274734 AE22018C */  sw        $v0, 0x18C($s1)
/* 1A3018 80274738 8E020000 */  lw        $v0, 0x0($s0)
/* 1A301C 8027473C 26100004 */  addiu     $s0, $s0, 0x4
/* 1A3020 80274740 AE220190 */  sw        $v0, 0x190($s1)
/* 1A3024 80274744 8E050000 */  lw        $a1, 0x0($s0)
/* 1A3028 80274748 0C0B1EAF */  jal       evt_get_variable
/* 1A302C 8027474C 26100004 */   addiu    $s0, $s0, 0x4
/* 1A3030 80274750 A622017E */  sh        $v0, 0x17E($s1)
/* 1A3034 80274754 A2200198 */  sb        $zero, 0x198($s1)
/* 1A3038 80274758 8E100000 */  lw        $s0, 0x0($s0)
/* 1A303C 8027475C 24020030 */  addiu     $v0, $zero, 0x30
/* 1A3040 80274760 32030030 */  andi      $v1, $s0, 0x30
/* 1A3044 80274764 54620004 */  bnel      $v1, $v0, .L80274778
/* 1A3048 80274768 32020010 */   andi     $v0, $s0, 0x10
/* 1A304C 8027476C 8E220000 */  lw        $v0, 0x0($s1)
/* 1A3050 80274770 0809D1EE */  j         .L802747B8
/* 1A3054 80274774 34420030 */   ori      $v0, $v0, 0x30
.L80274778:
/* 1A3058 80274778 10400004 */  beqz      $v0, .L8027478C
/* 1A305C 8027477C 2403FFDF */   addiu    $v1, $zero, -0x21
/* 1A3060 80274780 8E220000 */  lw        $v0, 0x0($s1)
/* 1A3064 80274784 0809D1ED */  j         .L802747B4
/* 1A3068 80274788 34420010 */   ori      $v0, $v0, 0x10
.L8027478C:
/* 1A306C 8027478C 32020020 */  andi      $v0, $s0, 0x20
/* 1A3070 80274790 10400005 */  beqz      $v0, .L802747A8
/* 1A3074 80274794 2403FFEF */   addiu    $v1, $zero, -0x11
/* 1A3078 80274798 8E220000 */  lw        $v0, 0x0($s1)
/* 1A307C 8027479C 00431024 */  and       $v0, $v0, $v1
/* 1A3080 802747A0 0809D1EE */  j         .L802747B8
/* 1A3084 802747A4 34420020 */   ori      $v0, $v0, 0x20
.L802747A8:
/* 1A3088 802747A8 8E220000 */  lw        $v0, 0x0($s1)
/* 1A308C 802747AC 00431024 */  and       $v0, $v0, $v1
/* 1A3090 802747B0 2403FFDF */  addiu     $v1, $zero, -0x21
.L802747B4:
/* 1A3094 802747B4 00431024 */  and       $v0, $v0, $v1
.L802747B8:
/* 1A3098 802747B8 AE220000 */  sw        $v0, 0x0($s1)
/* 1A309C 802747BC 32020040 */  andi      $v0, $s0, 0x40
/* 1A30A0 802747C0 10400007 */  beqz      $v0, .L802747E0
/* 1A30A4 802747C4 2404FFBF */   addiu    $a0, $zero, -0x41
/* 1A30A8 802747C8 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 1A30AC 802747CC 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 1A30B0 802747D0 8C620000 */  lw        $v0, 0x0($v1)
/* 1A30B4 802747D4 34420040 */  ori       $v0, $v0, 0x40
/* 1A30B8 802747D8 0809D1FD */  j         .L802747F4
/* 1A30BC 802747DC AC620000 */   sw       $v0, 0x0($v1)
.L802747E0:
/* 1A30C0 802747E0 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 1A30C4 802747E4 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
/* 1A30C8 802747E8 8C430000 */  lw        $v1, 0x0($v0)
/* 1A30CC 802747EC 00641824 */  and       $v1, $v1, $a0
/* 1A30D0 802747F0 AC430000 */  sw        $v1, 0x0($v0)
.L802747F4:
/* 1A30D4 802747F4 32020200 */  andi      $v0, $s0, 0x200
/* 1A30D8 802747F8 10400007 */  beqz      $v0, .L80274818
/* 1A30DC 802747FC 2404FDFF */   addiu    $a0, $zero, -0x201
/* 1A30E0 80274800 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 1A30E4 80274804 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 1A30E8 80274808 8C620000 */  lw        $v0, 0x0($v1)
/* 1A30EC 8027480C 34420200 */  ori       $v0, $v0, 0x200
/* 1A30F0 80274810 0809D20B */  j         .L8027482C
/* 1A30F4 80274814 AC620000 */   sw       $v0, 0x0($v1)
.L80274818:
/* 1A30F8 80274818 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 1A30FC 8027481C 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
/* 1A3100 80274820 8C430000 */  lw        $v1, 0x0($v0)
/* 1A3104 80274824 00641824 */  and       $v1, $v1, $a0
/* 1A3108 80274828 AC430000 */  sw        $v1, 0x0($v0)
.L8027482C:
/* 1A310C 8027482C 32020080 */  andi      $v0, $s0, 0x80
/* 1A3110 80274830 10400007 */  beqz      $v0, .L80274850
/* 1A3114 80274834 2404FF7F */   addiu    $a0, $zero, -0x81
/* 1A3118 80274838 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 1A311C 8027483C 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 1A3120 80274840 8C620000 */  lw        $v0, 0x0($v1)
/* 1A3124 80274844 34420080 */  ori       $v0, $v0, 0x80
/* 1A3128 80274848 0809D219 */  j         .L80274864
/* 1A312C 8027484C AC620000 */   sw       $v0, 0x0($v1)
.L80274850:
/* 1A3130 80274850 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 1A3134 80274854 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
/* 1A3138 80274858 8C430000 */  lw        $v1, 0x0($v0)
/* 1A313C 8027485C 00641824 */  and       $v1, $v1, $a0
/* 1A3140 80274860 AC430000 */  sw        $v1, 0x0($v0)
.L80274864:
/* 1A3144 80274864 32020800 */  andi      $v0, $s0, 0x800
/* 1A3148 80274868 10400007 */  beqz      $v0, .L80274888
/* 1A314C 8027486C 2404F7FF */   addiu    $a0, $zero, -0x801
/* 1A3150 80274870 3C03800E */  lui       $v1, %hi(gBattleStatus)
/* 1A3154 80274874 2463C070 */  addiu     $v1, $v1, %lo(gBattleStatus)
/* 1A3158 80274878 8C620000 */  lw        $v0, 0x0($v1)
/* 1A315C 8027487C 34420800 */  ori       $v0, $v0, 0x800
/* 1A3160 80274880 0809D227 */  j         .L8027489C
/* 1A3164 80274884 AC620000 */   sw       $v0, 0x0($v1)
.L80274888:
/* 1A3168 80274888 3C02800E */  lui       $v0, %hi(gBattleStatus)
/* 1A316C 8027488C 2442C070 */  addiu     $v0, $v0, %lo(gBattleStatus)
/* 1A3170 80274890 8C430000 */  lw        $v1, 0x0($v0)
/* 1A3174 80274894 00641824 */  and       $v1, $v1, $a0
/* 1A3178 80274898 AC430000 */  sw        $v1, 0x0($v0)
.L8027489C:
/* 1A317C 8027489C 0C09A75B */  jal       get_actor
/* 1A3180 802748A0 8E440148 */   lw       $a0, 0x148($s2)
/* 1A3184 802748A4 94430428 */  lhu       $v1, 0x428($v0)
/* 1A3188 802748A8 A62301A0 */  sh        $v1, 0x1A0($s1)
/* 1A318C 802748AC 92230193 */  lbu       $v1, 0x193($s1)
/* 1A3190 802748B0 90420426 */  lbu       $v0, 0x426($v0)
/* 1A3194 802748B4 A2230194 */  sb        $v1, 0x194($s1)
gPauseBufferImg2:
/* 1A3198 802748B8 306300FF */  andi      $v1, $v1, 0xFF
/* 1A319C 802748BC A22201A2 */  sb        $v0, 0x1A2($s1)
/* 1A31A0 802748C0 240200FF */  addiu     $v0, $zero, 0xFF
/* 1A31A4 802748C4 50620001 */  beql      $v1, $v0, .L802748CC
/* 1A31A8 802748C8 A2200194 */   sb       $zero, 0x194($s1)
.L802748CC:
/* 1A31AC 802748CC 8E220190 */  lw        $v0, 0x190($s1)
/* 1A31B0 802748D0 30420F00 */  andi      $v0, $v0, 0xF00
/* 1A31B4 802748D4 00021203 */  sra       $v0, $v0, 8
/* 1A31B8 802748D8 0C09C5D5 */  jal       calc_player_test_enemy
/* 1A31BC 802748DC A2220195 */   sb       $v0, 0x195($s1)
/* 1A31C0 802748E0 04400006 */  bltz      $v0, .L802748FC
/* 1A31C4 802748E4 0240202D */   daddu    $a0, $s2, $zero
/* 1A31C8 802748E8 0260282D */  daddu     $a1, $s3, $zero
/* 1A31CC 802748EC 0C0B2026 */  jal       evt_set_variable
/* 1A31D0 802748F0 0040302D */   daddu    $a2, $v0, $zero
/* 1A31D4 802748F4 0809D240 */  j         .L80274900
/* 1A31D8 802748F8 24020002 */   addiu    $v0, $zero, 0x2
.L802748FC:
/* 1A31DC 802748FC 240200FF */  addiu     $v0, $zero, 0xFF
.L80274900:
/* 1A31E0 80274900 8FBF0020 */  lw        $ra, 0x20($sp)
/* 1A31E4 80274904 8FB3001C */  lw        $s3, 0x1C($sp)
/* 1A31E8 80274908 8FB20018 */  lw        $s2, 0x18($sp)
/* 1A31EC 8027490C 8FB10014 */  lw        $s1, 0x14($sp)
/* 1A31F0 80274910 8FB00010 */  lw        $s0, 0x10($sp)
/* 1A31F4 80274914 03E00008 */  jr        $ra
/* 1A31F8 80274918 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

ApiStatus PlayerTestEnemy(Evt* script, s32 isInitialCall) {
    BattleStatus* battleStatus = &gBattleStatus;
    Bytecode* args = script->ptrReadPos;
    s32 hitResultOutVar = *args++;
    s32 flags;
    Actor* target;
    HitResult hitResult;

    battleStatus->currentAttackElement = *args++;
    battleStatus->currentAttackEventSuppression = *args++;
    battleStatus->currentAttackStatus = *args++;
    battleStatus->currentAttackDamage = evt_get_variable(script, *args++);
    battleStatus->powerBounceCounter = 0;
    flags = *args++;

    if ((flags & (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) == (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) {
        gBattleStatus.flags1 |= BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE;
    } else if (flags & BS_FLAGS1_10) {
        gBattleStatus.flags1 |= BS_FLAGS1_10;
        gBattleStatus.flags1 &= ~BS_FLAGS1_SP_EVT_ACTIVE;
    } else if (flags & BS_FLAGS1_SP_EVT_ACTIVE) {
        gBattleStatus.flags1 &= ~BS_FLAGS1_10;
        gBattleStatus.flags1 |= BS_FLAGS1_SP_EVT_ACTIVE;
    } else {
        gBattleStatus.flags1 &= ~BS_FLAGS1_10;
        gBattleStatus.flags1 &= ~BS_FLAGS1_SP_EVT_ACTIVE;
    }

    if (flags & BS_FLAGS1_40) {
        gBattleStatus.flags1 |= BS_FLAGS1_40;
    } else {
        gBattleStatus.flags1 &= ~BS_FLAGS1_40;
    }
    if (flags & BS_FLAGS1_200) {
        gBattleStatus.flags1 |= BS_FLAGS1_200;
    } else {
        gBattleStatus.flags1 &= ~BS_FLAGS1_200;
    }
    if (flags & BS_FLAGS1_80) {
        gBattleStatus.flags1 |= BS_FLAGS1_80;
    } else {
        gBattleStatus.flags1 &= ~BS_FLAGS1_80;
    }
    if (flags & BS_FLAGS1_FORCE_HIT_IMMUNE) {
        gBattleStatus.flags1 |= BS_FLAGS1_FORCE_HIT_IMMUNE;
    } else {
        gBattleStatus.flags1 &= ~BS_FLAGS1_FORCE_HIT_IMMUNE;
    }

    target = get_actor(script->owner1.actorID);
    battleStatus->currentTargetID = target->targetActorID;
    battleStatus->currentTargetPart = target->targetPartIndex;
    battleStatus->statusChance = battleStatus->currentAttackStatus;
    if (battleStatus->statusChance == STATUS_KEY_NEVER) {
        battleStatus->statusChance = 0;
    }
    battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8;

    hitResult = calc_player_test_enemy();
    if (hitResult < 0) {
        return ApiStatus_FINISH;
    }
    evt_set_variable(script, hitResultOutVar, hitResult);
    return ApiStatus_DONE2;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_E008A290
/* 38C880 E008A290 0080402D */  daddu     $t0, $a0, $zero
/* 38C884 E008A294 3C04800B */  lui       $a0, %hi(gCameras)
/* 38C888 E008A298 24841D80 */  addiu     $a0, $a0, %lo(gCameras)
/* 38C88C E008A29C 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 38C890 E008A2A0 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 38C894 E008A2A4 C5000008 */  lwc1      $f0, 0x8($t0)
/* 38C898 E008A2A8 C508000C */  lwc1      $f8, 0xC($t0)
/* 38C89C E008A2AC 00031080 */  sll       $v0, $v1, 2
/* 38C8A0 E008A2B0 00431021 */  addu      $v0, $v0, $v1
/* 38C8A4 E008A2B4 00021080 */  sll       $v0, $v0, 2
/* 38C8A8 E008A2B8 00431023 */  subu      $v0, $v0, $v1
/* 38C8AC E008A2BC 000218C0 */  sll       $v1, $v0, 3
/* 38C8B0 E008A2C0 00431021 */  addu      $v0, $v0, $v1
/* 38C8B4 E008A2C4 000210C0 */  sll       $v0, $v0, 3
/* 38C8B8 E008A2C8 00441021 */  addu      $v0, $v0, $a0
/* 38C8BC E008A2CC C4420048 */  lwc1      $f2, 0x48($v0)
/* 38C8C0 E008A2D0 C50A0010 */  lwc1      $f10, 0x10($t0)
/* 38C8C4 E008A2D4 46020001 */  sub.s     $f0, $f0, $f2
/* 38C8C8 E008A2D8 C444004C */  lwc1      $f4, 0x4C($v0)
/* 38C8CC E008A2DC C4460050 */  lwc1      $f6, 0x50($v0)
/* 38C8D0 E008A2E0 4600030D */  trunc.w.s $f12, $f0
/* 38C8D4 E008A2E4 44046000 */  mfc1      $a0, $f12
/* 38C8D8 E008A2E8 00000000 */  nop
/* 38C8DC E008A2EC 00A4182A */  slt       $v1, $a1, $a0
/* 38C8E0 E008A2F0 10600014 */  beqz      $v1, .LE008A344
/* 38C8E4 E008A2F4 00051023 */   negu     $v0, $a1
/* 38C8E8 E008A2F8 14A00002 */  bnez      $a1, .LE008A304
/* 38C8EC E008A2FC 0085001A */   div      $zero, $a0, $a1
/* 38C8F0 E008A300 0007000D */  break     7
.LE008A304:
/* 38C8F4 E008A304 2401FFFF */  addiu     $at, $zero, -0x1
/* 38C8F8 E008A308 14A10004 */  bne       $a1, $at, .LE008A31C
/* 38C8FC E008A30C 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 38C900 E008A310 14810002 */  bne       $a0, $at, .LE008A31C
/* 38C904 E008A314 00000000 */   nop
/* 38C908 E008A318 0006000D */  break     6
.LE008A31C:
/* 38C90C E008A31C 00002010 */  mfhi      $a0
/* 38C910 E008A320 44850000 */  mtc1      $a1, $f0
/* 38C914 E008A324 00000000 */  nop
/* 38C918 E008A328 46800020 */  cvt.s.w   $f0, $f0
/* 38C91C E008A32C 46001001 */  sub.s     $f0, $f2, $f0
/* 38C920 E008A330 44841000 */  mtc1      $a0, $f2
/* 38C924 E008A334 00000000 */  nop
/* 38C928 E008A338 468010A0 */  cvt.s.w   $f2, $f2
/* 38C92C E008A33C 080228E6 */  j         .LE008A398
/* 38C930 E008A340 46020000 */   add.s    $f0, $f0, $f2
.LE008A344:
/* 38C934 E008A344 0082102A */  slt       $v0, $a0, $v0
/* 38C938 E008A348 10400014 */  beqz      $v0, .LE008A39C
/* 38C93C E008A34C 00042023 */   negu     $a0, $a0
/* 38C940 E008A350 14A00002 */  bnez      $a1, .LE008A35C
/* 38C944 E008A354 0085001A */   div      $zero, $a0, $a1
/* 38C948 E008A358 0007000D */  break     7
.LE008A35C:
/* 38C94C E008A35C 2401FFFF */  addiu     $at, $zero, -0x1
/* 38C950 E008A360 14A10004 */  bne       $a1, $at, .LE008A374
/* 38C954 E008A364 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 38C958 E008A368 14810002 */  bne       $a0, $at, .LE008A374
/* 38C95C E008A36C 00000000 */   nop
/* 38C960 E008A370 0006000D */  break     6
.LE008A374:
/* 38C964 E008A374 00002010 */  mfhi      $a0
/* 38C968 E008A378 44850000 */  mtc1      $a1, $f0
/* 38C96C E008A37C 00000000 */  nop
/* 38C970 E008A380 46800020 */  cvt.s.w   $f0, $f0
/* 38C974 E008A384 46001000 */  add.s     $f0, $f2, $f0
/* 38C978 E008A388 44841000 */  mtc1      $a0, $f2
/* 38C97C E008A38C 00000000 */  nop
/* 38C980 E008A390 468010A0 */  cvt.s.w   $f2, $f2
/* 38C984 E008A394 46020001 */  sub.s     $f0, $f0, $f2
.LE008A398:
/* 38C988 E008A398 E5000008 */  swc1      $f0, 0x8($t0)
.LE008A39C:
/* 38C98C E008A39C 46044001 */  sub.s     $f0, $f8, $f4
/* 38C990 E008A3A0 4600030D */  trunc.w.s $f12, $f0
/* 38C994 E008A3A4 44036000 */  mfc1      $v1, $f12
/* 38C998 E008A3A8 00000000 */  nop
/* 38C99C E008A3AC 00C3102A */  slt       $v0, $a2, $v1
/* 38C9A0 E008A3B0 10400014 */  beqz      $v0, .LE008A404
/* 38C9A4 E008A3B4 00061023 */   negu     $v0, $a2
/* 38C9A8 E008A3B8 14C00002 */  bnez      $a2, .LE008A3C4
/* 38C9AC E008A3BC 0066001A */   div      $zero, $v1, $a2
/* 38C9B0 E008A3C0 0007000D */  break     7
.LE008A3C4:
/* 38C9B4 E008A3C4 2401FFFF */  addiu     $at, $zero, -0x1
/* 38C9B8 E008A3C8 14C10004 */  bne       $a2, $at, .LE008A3DC
/* 38C9BC E008A3CC 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 38C9C0 E008A3D0 14610002 */  bne       $v1, $at, .LE008A3DC
/* 38C9C4 E008A3D4 00000000 */   nop
/* 38C9C8 E008A3D8 0006000D */  break     6
.LE008A3DC:
/* 38C9CC E008A3DC 00001810 */  mfhi      $v1
/* 38C9D0 E008A3E0 44860000 */  mtc1      $a2, $f0
/* 38C9D4 E008A3E4 00000000 */  nop
/* 38C9D8 E008A3E8 46800020 */  cvt.s.w   $f0, $f0
/* 38C9DC E008A3EC 46002001 */  sub.s     $f0, $f4, $f0
/* 38C9E0 E008A3F0 44831000 */  mtc1      $v1, $f2
/* 38C9E4 E008A3F4 00000000 */  nop
/* 38C9E8 E008A3F8 468010A0 */  cvt.s.w   $f2, $f2
/* 38C9EC E008A3FC 0802291B */  j         .LE008A46C
/* 38C9F0 E008A400 46020000 */   add.s    $f0, $f0, $f2
.LE008A404:
/* 38C9F4 E008A404 0062102A */  slt       $v0, $v1, $v0
/* 38C9F8 E008A408 10400019 */  beqz      $v0, .LE008A470
/* 38C9FC E008A40C 28E20064 */   slti     $v0, $a3, 0x64
/* 38CA00 E008A410 10400004 */  beqz      $v0, .LE008A424
/* 38CA04 E008A414 00031823 */   negu     $v1, $v1
/* 38CA08 E008A418 AD000018 */  sw        $zero, 0x18($t0)
/* 38CA0C E008A41C 0802291C */  j         .LE008A470
/* 38CA10 E008A420 AD000028 */   sw       $zero, 0x28($t0)
.LE008A424:
/* 38CA14 E008A424 14C00002 */  bnez      $a2, .LE008A430
/* 38CA18 E008A428 0066001A */   div      $zero, $v1, $a2
/* 38CA1C E008A42C 0007000D */  break     7
.LE008A430:
/* 38CA20 E008A430 2401FFFF */  addiu     $at, $zero, -0x1
/* 38CA24 E008A434 14C10004 */  bne       $a2, $at, .LE008A448
/* 38CA28 E008A438 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 38CA2C E008A43C 14610002 */  bne       $v1, $at, .LE008A448
/* 38CA30 E008A440 00000000 */   nop
/* 38CA34 E008A444 0006000D */  break     6
.LE008A448:
/* 38CA38 E008A448 00001810 */  mfhi      $v1
/* 38CA3C E008A44C 44860000 */  mtc1      $a2, $f0
/* 38CA40 E008A450 00000000 */  nop
/* 38CA44 E008A454 46800020 */  cvt.s.w   $f0, $f0
/* 38CA48 E008A458 46002000 */  add.s     $f0, $f4, $f0
/* 38CA4C E008A45C 44831000 */  mtc1      $v1, $f2
/* 38CA50 E008A460 00000000 */  nop
/* 38CA54 E008A464 468010A0 */  cvt.s.w   $f2, $f2
/* 38CA58 E008A468 46020001 */  sub.s     $f0, $f0, $f2
.LE008A46C:
/* 38CA5C E008A46C E500000C */  swc1      $f0, 0xC($t0)
.LE008A470:
/* 38CA60 E008A470 46065001 */  sub.s     $f0, $f10, $f6
/* 38CA64 E008A474 4600030D */  trunc.w.s $f12, $f0
/* 38CA68 E008A478 44036000 */  mfc1      $v1, $f12
/* 38CA6C E008A47C 00000000 */  nop
/* 38CA70 E008A480 00A3102A */  slt       $v0, $a1, $v1
/* 38CA74 E008A484 10400015 */  beqz      $v0, .LE008A4DC
/* 38CA78 E008A488 00051023 */   negu     $v0, $a1
/* 38CA7C E008A48C 14A00002 */  bnez      $a1, .LE008A498
/* 38CA80 E008A490 0065001A */   div      $zero, $v1, $a1
/* 38CA84 E008A494 0007000D */  break     7
.LE008A498:
/* 38CA88 E008A498 2401FFFF */  addiu     $at, $zero, -0x1
/* 38CA8C E008A49C 14A10004 */  bne       $a1, $at, .LE008A4B0
/* 38CA90 E008A4A0 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 38CA94 E008A4A4 14610002 */  bne       $v1, $at, .LE008A4B0
/* 38CA98 E008A4A8 00000000 */   nop
/* 38CA9C E008A4AC 0006000D */  break     6
.LE008A4B0:
/* 38CAA0 E008A4B0 00001810 */  mfhi      $v1
/* 38CAA4 E008A4B4 44850000 */  mtc1      $a1, $f0
/* 38CAA8 E008A4B8 00000000 */  nop
/* 38CAAC E008A4BC 46800020 */  cvt.s.w   $f0, $f0
/* 38CAB0 E008A4C0 46003001 */  sub.s     $f0, $f6, $f0
/* 38CAB4 E008A4C4 44831000 */  mtc1      $v1, $f2
/* 38CAB8 E008A4C8 00000000 */  nop
/* 38CABC E008A4CC 468010A0 */  cvt.s.w   $f2, $f2
/* 38CAC0 E008A4D0 46020000 */  add.s     $f0, $f0, $f2
/* 38CAC4 E008A4D4 03E00008 */  jr        $ra
/* 38CAC8 E008A4D8 E5000010 */   swc1     $f0, 0x10($t0)
.LE008A4DC:
/* 38CACC E008A4DC 0062102A */  slt       $v0, $v1, $v0
/* 38CAD0 E008A4E0 10400014 */  beqz      $v0, .LE008A534
/* 38CAD4 E008A4E4 00031823 */   negu     $v1, $v1
/* 38CAD8 E008A4E8 14A00002 */  bnez      $a1, .LE008A4F4
/* 38CADC E008A4EC 0065001A */   div      $zero, $v1, $a1
/* 38CAE0 E008A4F0 0007000D */  break     7
.LE008A4F4:
/* 38CAE4 E008A4F4 2401FFFF */  addiu     $at, $zero, -0x1
/* 38CAE8 E008A4F8 14A10004 */  bne       $a1, $at, .LE008A50C
/* 38CAEC E008A4FC 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 38CAF0 E008A500 14610002 */  bne       $v1, $at, .LE008A50C
/* 38CAF4 E008A504 00000000 */   nop
/* 38CAF8 E008A508 0006000D */  break     6
.LE008A50C:
/* 38CAFC E008A50C 00001810 */  mfhi      $v1
/* 38CB00 E008A510 44850000 */  mtc1      $a1, $f0
/* 38CB04 E008A514 00000000 */  nop
/* 38CB08 E008A518 46800020 */  cvt.s.w   $f0, $f0
/* 38CB0C E008A51C 46003000 */  add.s     $f0, $f6, $f0
/* 38CB10 E008A520 44831000 */  mtc1      $v1, $f2
/* 38CB14 E008A524 00000000 */  nop
/* 38CB18 E008A528 468010A0 */  cvt.s.w   $f2, $f2
/* 38CB1C E008A52C 46020001 */  sub.s     $f0, $f0, $f2
/* 38CB20 E008A530 E5000010 */  swc1      $f0, 0x10($t0)
.LE008A534:
/* 38CB24 E008A534 03E00008 */  jr        $ra
/* 38CB28 E008A538 00000000 */   nop

### DECOMPILED C INSTRUCTIONS:

void func_E008A290(SnowfallFXData* data, s32 arg1, s32 arg2, s32 arg3) {
    Camera* camera = &gCameras[gCurrentCameraID];
    f32 unk_08 = data->unk_08;
    f32 unk_0C = data->unk_0C;
    f32 unk_10 = data->unk_10;
    f32 lookX = camera->lookAt_obj.x;
    f32 lookY = camera->lookAt_obj.y;
    f32 lookZ = camera->lookAt_obj.z;
    s32 temp_f12;
    s32 temp_f12_2;
    s32 temp_f12_3;

    temp_f12 = unk_08 - lookX;
    if (arg1 < temp_f12) {
        temp_f12 = temp_f12 % arg1;
        data->unk_08 = (lookX - arg1) + temp_f12;
    } else if (-arg1 > temp_f12) {
        temp_f12 = -temp_f12;
        temp_f12 = temp_f12 % arg1;
        data->unk_08 = (lookX + arg1) - temp_f12;
    }

    temp_f12_2 = unk_0C - lookY;
    if (arg2 < temp_f12_2) {
        temp_f12_2 = temp_f12_2 % arg2;
        data->unk_0C = (lookY - arg2) + temp_f12_2;
    } else if (temp_f12_2 < -arg2) {
        if (arg3 < 100) {
            data->unk_18 = 0;
            data->unk_28 = 0;
        } else {
            temp_f12_2 = -temp_f12_2;
            temp_f12_2 = temp_f12_2 % arg2;
            data->unk_0C = (lookY + arg2) - temp_f12_2;
        }
    }

    temp_f12_3 = unk_10 - lookZ;
    if (arg1 < temp_f12_3) {
        temp_f12_3 = temp_f12_3 % arg1;
        data->unk_10 = (lookZ - arg1) + temp_f12_3;
    } else if (temp_f12_3 < -arg1) {
        temp_f12_3 = -temp_f12_3;
        temp_f12_3 = temp_f12_3 % arg1;
        data->unk_10 = (lookZ + arg1) - temp_f12_3;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel make_transform_group
/* B1A7C 8011B37C 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* B1A80 8011B380 3C038015 */  lui       $v1, %hi(gCurrentModelTreeRoot)
/* B1A84 8011B384 8C6312FC */  lw        $v1, %lo(gCurrentModelTreeRoot)($v1)
/* B1A88 8011B388 0080102D */  daddu     $v0, $a0, $zero
/* B1A8C 8011B38C AFB00030 */  sw        $s0, 0x30($sp)
/* B1A90 8011B390 3C108015 */  lui       $s0, %hi(D_80153370)
/* B1A94 8011B394 26103370 */  addiu     $s0, $s0, %lo(D_80153370)
/* B1A98 8011B398 AFBF003C */  sw        $ra, 0x3C($sp)
/* B1A9C 8011B39C AFB20038 */  sw        $s2, 0x38($sp)
/* B1AA0 8011B3A0 AFB10034 */  sw        $s1, 0x34($sp)
/* B1AA4 8011B3A4 3C018015 */  lui       $at, %hi(mdl_treeIterPos)
/* B1AA8 8011B3A8 AC203224 */  sw        $zero, %lo(mdl_treeIterPos)($at)
/* B1AAC 8011B3AC AE000000 */  sw        $zero, 0x0($s0)
/* B1AB0 8011B3B0 3C018015 */  lui       $at, %hi(D_8015336E)
/* B1AB4 8011B3B4 A422336E */  sh        $v0, %lo(D_8015336E)($at)
/* B1AB8 8011B3B8 3C018015 */  lui       $at, %hi(D_80153376)
/* B1ABC 8011B3BC A4203376 */  sh        $zero, %lo(D_80153376)($at)
/* B1AC0 8011B3C0 3C018015 */  lui       $at, %hi(D_80153374)
/* B1AC4 8011B3C4 A4203374 */  sh        $zero, %lo(D_80153374)($at)
/* B1AC8 8011B3C8 8C640000 */  lw        $a0, 0x0($v1)
/* B1ACC 8011B3CC 0C046C76 */  jal       func_8011B1D8
/* B1AD0 8011B3D0 0040902D */   daddu    $s2, $v0, $zero
/* B1AD4 8011B3D4 8E020000 */  lw        $v0, 0x0($s0)
/* B1AD8 8011B3D8 10400077 */  beqz      $v0, .L8011B5B8
/* B1ADC 8011B3DC 0000802D */   daddu    $s0, $zero, $zero
/* B1AE0 8011B3E0 3C118015 */  lui       $s1, %hi(gCurrentTransformGroups)
/* B1AE4 8011B3E4 263112E0 */  addiu     $s1, $s1, %lo(gCurrentTransformGroups)
/* B1AE8 8011B3E8 8E230000 */  lw        $v1, 0x0($s1)
.L8011B3EC:
/* B1AEC 8011B3EC 8C620000 */  lw        $v0, 0x0($v1)
/* B1AF0 8011B3F0 10400005 */  beqz      $v0, .L8011B408
/* B1AF4 8011B3F4 00000000 */   nop
/* B1AF8 8011B3F8 26100001 */  addiu     $s0, $s0, 0x1
/* B1AFC 8011B3FC 2A020004 */  slti      $v0, $s0, 0x4
/* B1B00 8011B400 1440FFFA */  bnez      $v0, .L8011B3EC
/* B1B04 8011B404 24630004 */   addiu    $v1, $v1, 0x4
.L8011B408:
/* B1B08 8011B408 0C00AB39 */  jal       heap_malloc
/* B1B0C 8011B40C 240400A0 */   addiu    $a0, $zero, 0xA0
/* B1B10 8011B410 00101880 */  sll       $v1, $s0, 2
/* B1B14 8011B414 0040802D */  daddu     $s0, $v0, $zero
/* B1B18 8011B418 24020001 */  addiu     $v0, $zero, 0x1
/* B1B1C 8011B41C 8E250000 */  lw        $a1, 0x0($s1)
/* B1B20 8011B420 3C048015 */  lui       $a0, %hi(D_80153374)
/* B1B24 8011B424 94843374 */  lhu       $a0, %lo(D_80153374)($a0)
/* B1B28 8011B428 00651821 */  addu      $v1, $v1, $a1
/* B1B2C 8011B42C AC700000 */  sw        $s0, 0x0($v1)
/* B1B30 8011B430 A6020000 */  sh        $v0, 0x0($s0)
/* B1B34 8011B434 0C046C04 */  jal       get_model_list_index_from_tree_index
/* B1B38 8011B438 A6120002 */   sh       $s2, 0x2($s0)
/* B1B3C 8011B43C A202009C */  sb        $v0, 0x9C($s0)
/* B1B40 8011B440 3C048015 */  lui       $a0, %hi(D_80153376)
/* B1B44 8011B444 94843376 */  lhu       $a0, %lo(D_80153376)($a0)
/* B1B48 8011B448 0C046C04 */  jal       get_model_list_index_from_tree_index
/* B1B4C 8011B44C 00000000 */   nop
/* B1B50 8011B450 A202009D */  sb        $v0, 0x9D($s0)
/* B1B54 8011B454 A200009F */  sb        $zero, 0x9F($s0)
/* B1B58 8011B458 3C028015 */  lui       $v0, %hi(D_80153370)
/* B1B5C 8011B45C 8C423370 */  lw        $v0, %lo(D_80153370)($v0)
/* B1B60 8011B460 26040010 */  addiu     $a0, $s0, 0x10
/* B1B64 8011B464 AE000004 */  sw        $zero, 0x4($s0)
/* B1B68 8011B468 0C019D10 */  jal       guMtxIdent
/* B1B6C 8011B46C AE020008 */   sw       $v0, 0x8($s0)
/* B1B70 8011B470 96020000 */  lhu       $v0, 0x0($s0)
/* B1B74 8011B474 26040050 */  addiu     $a0, $s0, 0x50
/* B1B78 8011B478 34422000 */  ori       $v0, $v0, 0x2000
/* B1B7C 8011B47C 0C019D28 */  jal       guMtxIdentF
/* B1B80 8011B480 A6020000 */   sh       $v0, 0x0($s0)
/* B1B84 8011B484 8E110008 */  lw        $s1, 0x8($s0)
/* B1B88 8011B488 8E230000 */  lw        $v1, 0x0($s1)
/* B1B8C 8011B48C 24020005 */  addiu     $v0, $zero, 0x5
/* B1B90 8011B490 10620005 */  beq       $v1, $v0, .L8011B4A8
/* B1B94 8011B494 0220202D */   daddu    $a0, $s1, $zero
/* B1B98 8011B498 0C0456C3 */  jal       get_model_property
/* B1B9C 8011B49C 2405005C */   addiu    $a1, $zero, 0x5C
/* B1BA0 8011B4A0 08046D2E */  j         .L8011B4B8
/* B1BA4 8011B4A4 00000000 */   nop
.L8011B4A8:
/* B1BA8 8011B4A8 0C0456C3 */  jal       get_model_property
/* B1BAC 8011B4AC 24050060 */   addiu    $a1, $zero, 0x60
/* B1BB0 8011B4B0 10400006 */  beqz      $v0, .L8011B4CC
/* B1BB4 8011B4B4 2442000C */   addiu    $v0, $v0, 0xC
.L8011B4B8:
/* B1BB8 8011B4B8 50400005 */  beql      $v0, $zero, .L8011B4D0
/* B1BBC 8011B4BC 24020001 */   addiu    $v0, $zero, 0x1
/* B1BC0 8011B4C0 9042000B */  lbu       $v0, 0xB($v0)
/* B1BC4 8011B4C4 08046D35 */  j         .L8011B4D4
/* B1BC8 8011B4C8 A202009E */   sb       $v0, 0x9E($s0)
.L8011B4CC:
/* B1BCC 8011B4CC 24020001 */  addiu     $v0, $zero, 0x1
.L8011B4D0:
/* B1BD0 8011B4D0 A202009E */  sb        $v0, 0x9E($s0)
.L8011B4D4:
/* B1BD4 8011B4D4 0220202D */  daddu     $a0, $s1, $zero
/* B1BD8 8011B4D8 0C0456C3 */  jal       get_model_property
/* B1BDC 8011B4DC 24050061 */   addiu    $a1, $zero, 0x61
/* B1BE0 8011B4E0 10400017 */  beqz      $v0, .L8011B540
/* B1BE4 8011B4E4 00000000 */   nop
/* B1BE8 8011B4E8 C4460008 */  lwc1      $f6, 0x8($v0)
/* B1BEC 8011B4EC C440002C */  lwc1      $f0, 0x2C($v0)
/* B1BF0 8011B4F0 46003180 */  add.s     $f6, $f6, $f0
/* B1BF4 8011B4F4 3C013F00 */  lui       $at, (0x3F000000 >> 16)
/* B1BF8 8011B4F8 44814000 */  mtc1      $at, $f8
/* B1BFC 8011B4FC 00000000 */  nop
/* B1C00 8011B500 46083182 */  mul.s     $f6, $f6, $f8
/* B1C04 8011B504 00000000 */  nop
/* B1C08 8011B508 C4440014 */  lwc1      $f4, 0x14($v0)
/* B1C0C 8011B50C C4400038 */  lwc1      $f0, 0x38($v0)
/* B1C10 8011B510 46002100 */  add.s     $f4, $f4, $f0
/* B1C14 8011B514 46082102 */  mul.s     $f4, $f4, $f8
/* B1C18 8011B518 00000000 */  nop
/* B1C1C 8011B51C C4420044 */  lwc1      $f2, 0x44($v0)
/* B1C20 8011B520 C4400020 */  lwc1      $f0, 0x20($v0)
/* B1C24 8011B524 46020000 */  add.s     $f0, $f0, $f2
/* B1C28 8011B528 46080002 */  mul.s     $f0, $f0, $f8
/* B1C2C 8011B52C 00000000 */  nop
/* B1C30 8011B530 E7A60020 */  swc1      $f6, 0x20($sp)
/* B1C34 8011B534 E7A40024 */  swc1      $f4, 0x24($sp)
/* B1C38 8011B538 08046D55 */  j         .L8011B554
/* B1C3C 8011B53C E7A00028 */   swc1     $f0, 0x28($sp)
.L8011B540:
/* B1C40 8011B540 44800000 */  mtc1      $zero, $f0
/* B1C44 8011B544 00000000 */  nop
/* B1C48 8011B548 E7A00028 */  swc1      $f0, 0x28($sp)
/* B1C4C 8011B54C E7A00024 */  swc1      $f0, 0x24($sp)
/* B1C50 8011B550 E7A00020 */  swc1      $f0, 0x20($sp)
.L8011B554:
/* B1C54 8011B554 8E020004 */  lw        $v0, 0x4($s0)
/* B1C58 8011B558 1040000F */  beqz      $v0, .L8011B598
/* B1C5C 8011B55C 27A20020 */   addiu    $v0, $sp, 0x20
/* B1C60 8011B560 C7A00020 */  lwc1      $f0, 0x20($sp)
/* B1C64 8011B564 C7A20024 */  lwc1      $f2, 0x24($sp)
/* B1C68 8011B568 C7A40028 */  lwc1      $f4, 0x28($sp)
/* B1C6C 8011B56C AFA20010 */  sw        $v0, 0x10($sp)
/* B1C70 8011B570 27A20024 */  addiu     $v0, $sp, 0x24
/* B1C74 8011B574 AFA20014 */  sw        $v0, 0x14($sp)
/* B1C78 8011B578 27A20028 */  addiu     $v0, $sp, 0x28
/* B1C7C 8011B57C AFA20018 */  sw        $v0, 0x18($sp)
/* B1C80 8011B580 8E040004 */  lw        $a0, 0x4($s0)
/* B1C84 8011B584 44050000 */  mfc1      $a1, $f0
/* B1C88 8011B588 44061000 */  mfc1      $a2, $f2
/* B1C8C 8011B58C 44072000 */  mfc1      $a3, $f4
/* B1C90 8011B590 0C019E78 */  jal       guMtxXFML
/* B1C94 8011B594 00000000 */   nop
.L8011B598:
/* B1C98 8011B598 C7A00020 */  lwc1      $f0, 0x20($sp)
/* B1C9C 8011B59C C7A20024 */  lwc1      $f2, 0x24($sp)
/* B1CA0 8011B5A0 C7A40028 */  lwc1      $f4, 0x28($sp)
/* B1CA4 8011B5A4 3244FFFF */  andi      $a0, $s2, 0xFFFF
/* B1CA8 8011B5A8 E6000090 */  swc1      $f0, 0x90($s0)
/* B1CAC 8011B5AC E6020094 */  swc1      $f2, 0x94($s0)
/* B1CB0 8011B5B0 0C046D74 */  jal       enable_transform_group
/* B1CB4 8011B5B4 E6040098 */   swc1     $f4, 0x98($s0)
.L8011B5B8:
/* B1CB8 8011B5B8 8FBF003C */  lw        $ra, 0x3C($sp)
/* B1CBC 8011B5BC 8FB20038 */  lw        $s2, 0x38($sp)
/* B1CC0 8011B5C0 8FB10034 */  lw        $s1, 0x34($sp)
/* B1CC4 8011B5C4 8FB00030 */  lw        $s0, 0x30($sp)
/* B1CC8 8011B5C8 03E00008 */  jr        $ra
/* B1CCC 8011B5CC 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

void make_transform_group(u16 modelID) {
    mdl_treeIterPos = 0;
    D_80153370 = NULL;
    D_8015336E = modelID;
    D_80153376 = 0;
    D_80153374 = 0;
    func_8011B1D8(*gCurrentModelTreeRoot);

    if (D_80153370 != 0) {
        ModelTransformGroup* newMtg;
        ModelNode* node;
        ModelNodeProperty* prop;
        ModelBoundingBox* bb;
        f32 x, y, z;
        s32 i;

        for (i = 0; i < ARRAY_COUNT(*gCurrentTransformGroups); i++) {
            if ((*gCurrentTransformGroups)[i] == NULL) {
                break;
            }
        }

        (*gCurrentTransformGroups)[i] = newMtg = heap_malloc(sizeof(*newMtg));
        newMtg->flags = MODEL_TRANSFORM_GROUP_FLAG_1;
        newMtg->groupModelID = modelID;
        newMtg->minChildModelIndex = get_model_list_index_from_tree_index(D_80153374);
        newMtg->maxChildModelIndex = get_model_list_index_from_tree_index(D_80153376);
        newMtg->matrixMode = 0;
        newMtg->matrixRDP_N = NULL;
        newMtg->modelNode = D_80153370;
        guMtxIdent(&newMtg->matrixA);
        newMtg->flags |= 0x2000;
        guMtxIdentF(newMtg->matrixB);

        node = newMtg->modelNode;

        if (node->type != SHAPE_TYPE_GROUP) {
            prop = get_model_property(node, MODEL_PROP_KEY_RENDER_MODE);
        } else {
            prop = get_model_property(node, MODEL_PROP_KEY_GROUP_TYPE);

            if (prop != NULL) {
                prop = &prop[1];
            }
        }

        if (prop != NULL) {
            newMtg->renderMode = prop->data.s;
        } else {
            newMtg->renderMode = 1;
        }

        bb = (ModelBoundingBox*)get_model_property(node, MODEL_PROP_KEY_BOUNDING_BOX);
        if (bb != NULL) {
            x = (bb->minX + bb->maxX) * 0.5f;
            y = (bb->minY + bb->maxY) * 0.5f;
            z = (bb->minZ + bb->maxZ) * 0.5f;
        } else {
            x = y = z = 0.0f;
        }

        if (newMtg->matrixRDP_N != NULL) {
            guMtxXFML(newMtg->matrixRDP_N, x, y, z, &x, &y, &z);
        }

        newMtg->center.x = x;
        newMtg->center.y = y;
        newMtg->center.z = z;
        enable_transform_group(modelID);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel calculate_line_segment_intersection
/* D9E4 800325E4 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* D9E8 800325E8 F7BC0030 */  sdc1      $f28, 0x30($sp)
/* D9EC 800325EC 4486E000 */  mtc1      $a2, $f28
/* D9F0 800325F0 F7B60018 */  sdc1      $f22, 0x18($sp)
/* D9F4 800325F4 C7B60050 */  lwc1      $f22, 0x50($sp)
/* D9F8 800325F8 F7B40010 */  sdc1      $f20, 0x10($sp)
/* D9FC 800325FC 46006506 */  mov.s     $f20, $f12
/* DA00 80032600 F7BA0028 */  sdc1      $f26, 0x28($sp)
/* DA04 80032604 46007686 */  mov.s     $f26, $f14
/* DA08 80032608 F7B80020 */  sdc1      $f24, 0x20($sp)
/* DA0C 8003260C 4614E481 */  sub.s     $f18, $f28, $f20
/* DA10 80032610 C7B80054 */  lwc1      $f24, 0x54($sp)
/* DA14 80032614 C7A0005C */  lwc1      $f0, 0x5C($sp)
/* DA18 80032618 461AC181 */  sub.s     $f6, $f24, $f26
/* DA1C 8003261C F7BE0038 */  sdc1      $f30, 0x38($sp)
/* DA20 80032620 461A0781 */  sub.s     $f30, $f0, $f26
/* DA24 80032624 C7A20058 */  lwc1      $f2, 0x58($sp)
/* DA28 80032628 46161401 */  sub.s     $f16, $f2, $f22
/* DA2C 8003262C 4487E000 */  mtc1      $a3, $f28
/* DA30 80032630 00000000 */  nop
/* DA34 80032634 461AE301 */  sub.s     $f12, $f28, $f26
/* DA38 80032638 4614B701 */  sub.s     $f28, $f22, $f20
/* DA3C 8003263C 46180381 */  sub.s     $f14, $f0, $f24
/* DA40 80032640 E7BC0008 */  swc1      $f28, 0x8($sp)
/* DA44 80032644 46141701 */  sub.s     $f28, $f2, $f20
/* DA48 80032648 44802000 */  mtc1      $zero, $f4
/* DA4C 8003264C 46009286 */  mov.s     $f10, $f18
/* DA50 80032650 46049032 */  c.eq.s    $f18, $f4
/* DA54 80032654 46006207 */  neg.s     $f8, $f12
/* DA58 80032658 45000005 */  bc1f      .L80032670
/* DA5C 8003265C E7BC0000 */   swc1     $f28, 0x0($sp)
/* DA60 80032660 46046032 */  c.eq.s    $f12, $f4
/* DA64 80032664 00000000 */  nop
/* DA68 80032668 45010086 */  bc1t      .L80032884
/* DA6C 8003266C 0000102D */   daddu    $v0, $zero, $zero
.L80032670:
/* DA70 80032670 44800000 */  mtc1      $zero, $f0
/* DA74 80032674 00000000 */  nop
/* DA78 80032678 46008032 */  c.eq.s    $f16, $f0
/* DA7C 8003267C 00000000 */  nop
/* DA80 80032680 45000005 */  bc1f      .L80032698
/* DA84 80032684 00000000 */   nop
/* DA88 80032688 46007032 */  c.eq.s    $f14, $f0
/* DA8C 8003268C 00000000 */  nop
/* DA90 80032690 4501007C */  bc1t      .L80032884
/* DA94 80032694 0000102D */   daddu    $v0, $zero, $zero
.L80032698:
/* DA98 80032698 46065002 */  mul.s     $f0, $f10, $f6
/* DA9C 8003269C 00000000 */  nop
/* DAA0 800326A0 C7BC0008 */  lwc1      $f28, 0x8($sp)
/* DAA4 800326A4 461C4082 */  mul.s     $f2, $f8, $f28
/* DAA8 800326A8 00000000 */  nop
/* DAAC 800326AC 46001180 */  add.s     $f6, $f2, $f0
/* DAB0 800326B0 44800000 */  mtc1      $zero, $f0
/* DAB4 800326B4 00000000 */  nop
/* DAB8 800326B8 4600303C */  c.lt.s    $f6, $f0
/* DABC 800326BC 3C01BF80 */  lui       $at, (0xBF800000 >> 16)
/* DAC0 800326C0 44812000 */  mtc1      $at, $f4
/* DAC4 800326C4 45010007 */  bc1t      .L800326E4
/* DAC8 800326C8 00000000 */   nop
/* DACC 800326CC 4606003C */  c.lt.s    $f0, $f6
/* DAD0 800326D0 00000000 */  nop
/* DAD4 800326D4 45000003 */  bc1f      .L800326E4
/* DAD8 800326D8 46000106 */   mov.s    $f4, $f0
/* DADC 800326DC 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* DAE0 800326E0 44812000 */  mtc1      $at, $f4
.L800326E4:
/* DAE4 800326E4 461E5002 */  mul.s     $f0, $f10, $f30
/* DAE8 800326E8 00000000 */  nop
/* DAEC 800326EC C7BC0000 */  lwc1      $f28, 0x0($sp)
/* DAF0 800326F0 461C4082 */  mul.s     $f2, $f8, $f28
/* DAF4 800326F4 00000000 */  nop
/* DAF8 800326F8 46001080 */  add.s     $f2, $f2, $f0
/* DAFC 800326FC 44800000 */  mtc1      $zero, $f0
/* DB00 80032700 00000000 */  nop
/* DB04 80032704 4600103C */  c.lt.s    $f2, $f0
/* DB08 80032708 00000000 */  nop
/* DB0C 8003270C 45000005 */  bc1f      .L80032724
/* DB10 80032710 46002186 */   mov.s    $f6, $f4
/* DB14 80032714 3C01BF80 */  lui       $at, (0xBF800000 >> 16)
/* DB18 80032718 44810000 */  mtc1      $at, $f0
/* DB1C 8003271C 0800C9D0 */  j         .L80032740
/* DB20 80032720 00000000 */   nop
.L80032724:
/* DB24 80032724 4602003C */  c.lt.s    $f0, $f2
/* DB28 80032728 00000000 */  nop
/* DB2C 8003272C 45000004 */  bc1f      .L80032740
/* DB30 80032730 00000000 */   nop
/* DB34 80032734 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* DB38 80032738 44810000 */  mtc1      $at, $f0
/* DB3C 8003273C 00000000 */  nop
.L80032740:
/* DB40 80032740 46003032 */  c.eq.s    $f6, $f0
/* DB44 80032744 00000000 */  nop
/* DB48 80032748 4501004E */  bc1t      .L80032884
/* DB4C 8003274C 0000102D */   daddu    $v0, $zero, $zero
/* DB50 80032750 46009085 */  abs.s     $f2, $f18
/* DB54 80032754 46008005 */  abs.s     $f0, $f16
/* DB58 80032758 4602003C */  c.lt.s    $f0, $f2
/* DB5C 8003275C 00000000 */  nop
/* DB60 80032760 4500001E */  bc1f      .L800327DC
/* DB64 80032764 00000000 */   nop
/* DB68 80032768 460CA002 */  mul.s     $f0, $f20, $f12
/* DB6C 8003276C 00000000 */  nop
/* DB70 80032770 4612D182 */  mul.s     $f6, $f26, $f18
/* DB74 80032774 00000000 */  nop
/* DB78 80032778 46189202 */  mul.s     $f8, $f18, $f24
/* DB7C 8003277C 00000000 */  nop
/* DB80 80032780 46166282 */  mul.s     $f10, $f12, $f22
/* DB84 80032784 00000000 */  nop
/* DB88 80032788 46106082 */  mul.s     $f2, $f12, $f16
/* DB8C 8003278C 00000000 */  nop
/* DB90 80032790 460E9102 */  mul.s     $f4, $f18, $f14
/* DB94 80032794 00000000 */  nop
/* DB98 80032798 46060001 */  sub.s     $f0, $f0, $f6
/* DB9C 8003279C 46041081 */  sub.s     $f2, $f2, $f4
/* DBA0 800327A0 46080000 */  add.s     $f0, $f0, $f8
/* DBA4 800327A4 460A0181 */  sub.s     $f6, $f0, $f10
/* DBA8 800327A8 46023183 */  div.s     $f6, $f6, $f2
/* DBAC 800327AC 46068002 */  mul.s     $f0, $f16, $f6
/* DBB0 800327B0 00000000 */  nop
/* DBB4 800327B4 4600B000 */  add.s     $f0, $f22, $f0
/* DBB8 800327B8 46140001 */  sub.s     $f0, $f0, $f20
/* DBBC 800327BC 46120183 */  div.s     $f6, $f0, $f18
/* DBC0 800327C0 46069002 */  mul.s     $f0, $f18, $f6
/* DBC4 800327C4 00000000 */  nop
/* DBC8 800327C8 46066082 */  mul.s     $f2, $f12, $f6
/* DBCC 800327CC 00000000 */  nop
/* DBD0 800327D0 4600A300 */  add.s     $f12, $f20, $f0
/* DBD4 800327D4 0800CA13 */  j         .L8003284C
/* DBD8 800327D8 4602D180 */   add.s    $f6, $f26, $f2
.L800327DC:
/* DBDC 800327DC 4610C002 */  mul.s     $f0, $f24, $f16
/* DBE0 800327E0 00000000 */  nop
/* DBE4 800327E4 460EA182 */  mul.s     $f6, $f20, $f14
/* DBE8 800327E8 00000000 */  nop
/* DBEC 800327EC 460EC202 */  mul.s     $f8, $f24, $f14
/* DBF0 800327F0 00000000 */  nop
/* DBF4 800327F4 4610D282 */  mul.s     $f10, $f26, $f16
/* DBF8 800327F8 00000000 */  nop
/* DBFC 800327FC 46106082 */  mul.s     $f2, $f12, $f16
/* DC00 80032800 00000000 */  nop
/* DC04 80032804 460E9102 */  mul.s     $f4, $f18, $f14
/* DC08 80032808 00000000 */  nop
/* DC0C 8003280C 46060000 */  add.s     $f0, $f0, $f6
/* DC10 80032810 46041081 */  sub.s     $f2, $f2, $f4
/* DC14 80032814 46080001 */  sub.s     $f0, $f0, $f8
/* DC18 80032818 460A0181 */  sub.s     $f6, $f0, $f10
/* DC1C 8003281C 46023183 */  div.s     $f6, $f6, $f2
/* DC20 80032820 46069002 */  mul.s     $f0, $f18, $f6
/* DC24 80032824 00000000 */  nop
/* DC28 80032828 4600A000 */  add.s     $f0, $f20, $f0
/* DC2C 8003282C 46160001 */  sub.s     $f0, $f0, $f22
/* DC30 80032830 46100183 */  div.s     $f6, $f0, $f16
/* DC34 80032834 46068002 */  mul.s     $f0, $f16, $f6
/* DC38 80032838 00000000 */  nop
/* DC3C 8003283C 46067082 */  mul.s     $f2, $f14, $f6
/* DC40 80032840 00000000 */  nop
/* DC44 80032844 4600B300 */  add.s     $f12, $f22, $f0
/* DC48 80032848 4602C180 */  add.s     $f6, $f24, $f2
.L8003284C:
/* DC4C 8003284C 46166081 */  sub.s     $f2, $f12, $f22
/* DC50 80032850 46021082 */  mul.s     $f2, $f2, $f2
/* DC54 80032854 00000000 */  nop
/* DC58 80032858 46183001 */  sub.s     $f0, $f6, $f24
/* DC5C 8003285C 8FA30060 */  lw        $v1, 0x60($sp)
/* DC60 80032860 46000002 */  mul.s     $f0, $f0, $f0
/* DC64 80032864 00000000 */  nop
/* DC68 80032868 E46C0000 */  swc1      $f12, 0x0($v1)
/* DC6C 8003286C 8FA30064 */  lw        $v1, 0x64($sp)
/* DC70 80032870 E4660000 */  swc1      $f6, 0x0($v1)
/* DC74 80032874 46001080 */  add.s     $f2, $f2, $f0
/* DC78 80032878 8FA30068 */  lw        $v1, 0x68($sp)
/* DC7C 8003287C 24020001 */  addiu     $v0, $zero, 0x1
/* DC80 80032880 E4620000 */  swc1      $f2, 0x0($v1)
.L80032884:
/* DC84 80032884 D7BE0038 */  ldc1      $f30, 0x38($sp)
/* DC88 80032888 D7BC0030 */  ldc1      $f28, 0x30($sp)
/* DC8C 8003288C D7BA0028 */  ldc1      $f26, 0x28($sp)
/* DC90 80032890 D7B80020 */  ldc1      $f24, 0x20($sp)
/* DC94 80032894 D7B60018 */  ldc1      $f22, 0x18($sp)
/* DC98 80032898 D7B40010 */  ldc1      $f20, 0x10($sp)
/* DC9C 8003289C 03E00008 */  jr        $ra
/* DCA0 800328A0 27BD0040 */   addiu    $sp, $sp, 0x40

### DECOMPILED C INSTRUCTIONS:

s32 calculate_line_segment_intersection(f32 A1x, f32 A1z, f32 A2x, f32 A2z, f32 B1x, f32 B1z, f32 B2x, f32 B2z, f32* interX, f32* interZ, f32* squared_dist) {
    f32 dx14;
    f32 dx13;
    f32 dz;
    f32 dz12;
    f32 dx34;
    f32 dx12;
    f32 dx;
    f32 alpha;
    f32 minus_dz12;
    f32 B2_side;
    f32 x;
    f32 B1_side;
    f32 z;
    f32 dx12_copy;
    f32 dz13;
    f32 dz14;
    f32 dz34;
    f32 B1_side_;

    dx12_copy = A2x - A1x;
    dx12 = dx12_copy;
    dz12 = A2z - A1z;
    dx13 = B1x - A1x;
    dz13 = B1z - A1z;
    dx14 = B2x - A1x;
    dz14 = B2z - A1z;
    minus_dz12 = -dz12;
    dx34 = B2x - B1x;
    dz34 = B2z - B1z;

    if (dx12_copy == 0.0f && dz12 == 0.0f) {
        return FALSE;
    }
    if (dx34 == 0.0f && dz34 == 0.0f) {
        return FALSE;
    }

    B1_side_ = minus_dz12 * dx13 + dx12_copy * dz13;
    if (B1_side_ < 0.0f) {
        B1_side = -1.0f;
    } else if (B1_side_ > 0.0f) {
        B1_side = 1.0f;
    } else {
        B1_side = 0.0f;
    }
    B1_side_ = B1_side;

    dx = minus_dz12 * dx14 + dx12_copy * dz14;
    if (dx < 0.0f) {
        B2_side = -1.0f;
    } else if (dx > 0.0f) {
        B2_side = 1.0f;
    } else {
        B2_side = 0.0f;
    }

    if (B1_side_ == B2_side) {
        return FALSE;
    }

    if (fabsf(dx12) > fabsf(dx34)) {
        alpha = A1x * dz12 - A1z * dx12 + dx12 * B1z - dz12 * B1x;
        alpha /= dz12 * dx34 - dx12 * dz34;
        alpha = (B1x + dx34 * alpha - A1x) / dx12;
        x = A1x + dx12 * alpha;
        z = A1z + dz12 * alpha;
    } else {
        alpha = B1z * dx34 + A1x * dz34 - B1z * dz34 - A1z * dx34;
        alpha /= dz12 * dx34 - dx12 * dz34;
        alpha = (A1x + dx12 * alpha - B1x) / dx34;
        x = B1x + dx34 * alpha;
        z = B1z + dz34 * alpha;
    }

    dx = x - B1x;
    dz = z - B1z;
    *interX = x;
    *interZ = z;
    *squared_dist = SQ(dx) + SQ(dz);
    return TRUE;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel FetchPushedBlockProperties
/* 7E3CB0 80282E30 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 7E3CB4 80282E34 AFB00010 */  sw        $s0, 0x10($sp)
/* 7E3CB8 80282E38 0080802D */  daddu     $s0, $a0, $zero
/* 7E3CBC 80282E3C AFBF0018 */  sw        $ra, 0x18($sp)
/* 7E3CC0 80282E40 AFB10014 */  sw        $s1, 0x14($sp)
/* 7E3CC4 80282E44 8E0400B0 */  lw        $a0, 0xB0($s0)
/* 7E3CC8 80282E48 0C04417A */  jal       get_entity_by_index
/* 7E3CCC 80282E4C 8E1100AC */   lw       $s1, 0xAC($s0)
/* 7E3CD0 80282E50 3C038011 */  lui       $v1, %hi(gPlayerStatus)
/* 7E3CD4 80282E54 2463EFC8 */  addiu     $v1, $v1, %lo(gPlayerStatus)
/* 7E3CD8 80282E58 0040502D */  daddu     $t2, $v0, $zero
/* 7E3CDC 80282E5C C4600028 */  lwc1      $f0, 0x28($v1)
/* 7E3CE0 80282E60 C462002C */  lwc1      $f2, 0x2C($v1)
/* 7E3CE4 80282E64 8E2D0008 */  lw        $t5, 0x8($s1)
/* 7E3CE8 80282E68 8E2B000C */  lw        $t3, 0xC($s1)
/* 7E3CEC 80282E6C 8E2C0010 */  lw        $t4, 0x10($s1)
/* 7E3CF0 80282E70 4600010D */  trunc.w.s $f4, $f0
/* 7E3CF4 80282E74 44042000 */  mfc1      $a0, $f4
/* 7E3CF8 80282E78 4600110D */  trunc.w.s $f4, $f2
/* 7E3CFC 80282E7C 44092000 */  mfc1      $t1, $f4
/* 7E3D00 80282E80 008D2023 */  subu      $a0, $a0, $t5
/* 7E3D04 80282E84 C4600030 */  lwc1      $f0, 0x30($v1)
/* 7E3D08 80282E88 012B4823 */  subu      $t1, $t1, $t3
/* 7E3D0C 80282E8C 4600010D */  trunc.w.s $f4, $f0
/* 7E3D10 80282E90 44082000 */  mfc1      $t0, $f4
/* 7E3D14 80282E94 04810002 */  bgez      $a0, .L80282EA0
/* 7E3D18 80282E98 010C4023 */   subu     $t0, $t0, $t4
/* 7E3D1C 80282E9C 2484FFE7 */  addiu     $a0, $a0, -0x19
.L80282EA0:
/* 7E3D20 80282EA0 05020001 */  bltzl     $t0, .L80282EA8
/* 7E3D24 80282EA4 2508FFE7 */   addiu    $t0, $t0, -0x19
.L80282EA8:
/* 7E3D28 80282EA8 3C0551EB */  lui       $a1, (0x51EB851F >> 16)
/* 7E3D2C 80282EAC 34A5851F */  ori       $a1, $a1, (0x51EB851F & 0xFFFF)
/* 7E3D30 80282EB0 00850018 */  mult      $a0, $a1
/* 7E3D34 80282EB4 00001810 */  mfhi      $v1
/* 7E3D38 80282EB8 00000000 */  nop
/* 7E3D3C 80282EBC 00000000 */  nop
/* 7E3D40 80282EC0 01250018 */  mult      $t1, $a1
/* 7E3D44 80282EC4 000417C3 */  sra       $v0, $a0, 31
/* 7E3D48 80282EC8 00003010 */  mfhi      $a2
/* 7E3D4C 80282ECC 000318C3 */  sra       $v1, $v1, 3
/* 7E3D50 80282ED0 00622023 */  subu      $a0, $v1, $v0
/* 7E3D54 80282ED4 01050018 */  mult      $t0, $a1
/* 7E3D58 80282ED8 000917C3 */  sra       $v0, $t1, 31
/* 7E3D5C 80282EDC 000618C3 */  sra       $v1, $a2, 3
/* 7E3D60 80282EE0 00624823 */  subu      $t1, $v1, $v0
/* 7E3D64 80282EE4 000817C3 */  sra       $v0, $t0, 31
bActorOffsets:
/* 7E3D68 80282EE8 00003810 */  mfhi      $a3
/* 7E3D6C 80282EEC 000718C3 */  sra       $v1, $a3, 3
/* 7E3D70 80282EF0 00624023 */  subu      $t0, $v1, $v0
/* 7E3D74 80282EF4 0080382D */  daddu     $a3, $a0, $zero
/* 7E3D78 80282EF8 00041040 */  sll       $v0, $a0, 1
/* 7E3D7C 80282EFC 00441021 */  addu      $v0, $v0, $a0
/* 7E3D80 80282F00 000210C0 */  sll       $v0, $v0, 3
/* 7E3D84 80282F04 00822021 */  addu      $a0, $a0, $v0
/* 7E3D88 80282F08 00091040 */  sll       $v0, $t1, 1
/* 7E3D8C 80282F0C 00491021 */  addu      $v0, $v0, $t1
/* 7E3D90 80282F10 000210C0 */  sll       $v0, $v0, 3
/* 7E3D94 80282F14 01224821 */  addu      $t1, $t1, $v0
/* 7E3D98 80282F18 0100302D */  daddu     $a2, $t0, $zero
/* 7E3D9C 80282F1C 00081040 */  sll       $v0, $t0, 1
/* 7E3DA0 80282F20 00481021 */  addu      $v0, $v0, $t0
/* 7E3DA4 80282F24 000210C0 */  sll       $v0, $v0, 3
/* 7E3DA8 80282F28 01024021 */  addu      $t0, $t0, $v0
/* 7E3DAC 80282F2C 2482000C */  addiu     $v0, $a0, 0xC
/* 7E3DB0 80282F30 004D2021 */  addu      $a0, $v0, $t5
/* 7E3DB4 80282F34 012B4821 */  addu      $t1, $t1, $t3
/* 7E3DB8 80282F38 2502000C */  addiu     $v0, $t0, 0xC
/* 7E3DBC 80282F3C 004C4021 */  addu      $t0, $v0, $t4
/* 7E3DC0 80282F40 AE040084 */  sw        $a0, 0x84($s0)
/* 7E3DC4 80282F44 AE090088 */  sw        $t1, 0x88($s0)
/* 7E3DC8 80282F48 AE08008C */  sw        $t0, 0x8C($s0)
/* 7E3DCC 80282F4C C5400048 */  lwc1      $f0, 0x48($t2)
/* 7E3DD0 80282F50 4600010D */  trunc.w.s $f4, $f0
/* 7E3DD4 80282F54 44042000 */  mfc1      $a0, $f4
/* 7E3DD8 80282F58 00000000 */  nop
/* 7E3DDC 80282F5C AE040090 */  sw        $a0, 0x90($s0)
/* 7E3DE0 80282F60 C540004C */  lwc1      $f0, 0x4C($t2)
/* 7E3DE4 80282F64 4600010D */  trunc.w.s $f4, $f0
/* 7E3DE8 80282F68 E6040094 */  swc1      $f4, 0x94($s0)
/* 7E3DEC 80282F6C C5400050 */  lwc1      $f0, 0x50($t2)
/* 7E3DF0 80282F70 4600010D */  trunc.w.s $f4, $f0
/* 7E3DF4 80282F74 44032000 */  mfc1      $v1, $f4
/* 7E3DF8 80282F78 00000000 */  nop
/* 7E3DFC 80282F7C AE030098 */  sw        $v1, 0x98($s0)
/* 7E3E00 80282F80 8E220008 */  lw        $v0, 0x8($s1)
/* 7E3E04 80282F84 00822023 */  subu      $a0, $a0, $v0
/* 7E3E08 80282F88 00850018 */  mult      $a0, $a1
/* 7E3E0C 80282F8C 8E220010 */  lw        $v0, 0x10($s1)
/* 7E3E10 80282F90 00005010 */  mfhi      $t2
/* 7E3E14 80282F94 00624023 */  subu      $t0, $v1, $v0
/* 7E3E18 80282F98 000417C3 */  sra       $v0, $a0, 31
/* 7E3E1C 80282F9C 01050018 */  mult      $t0, $a1
/* 7E3E20 80282FA0 000A18C3 */  sra       $v1, $t2, 3
/* 7E3E24 80282FA4 00625023 */  subu      $t2, $v1, $v0
/* 7E3E28 80282FA8 01472823 */  subu      $a1, $t2, $a3
/* 7E3E2C 80282FAC 000817C3 */  sra       $v0, $t0, 31
/* 7E3E30 80282FB0 00004810 */  mfhi      $t1
/* 7E3E34 80282FB4 000918C3 */  sra       $v1, $t1, 3
/* 7E3E38 80282FB8 00621023 */  subu      $v0, $v1, $v0
/* 7E3E3C 80282FBC 10A00005 */  beqz      $a1, .L80282FD4
/* 7E3E40 80282FC0 00462023 */   subu     $a0, $v0, $a2
/* 7E3E44 80282FC4 10800004 */  beqz      $a0, .L80282FD8
/* 7E3E48 80282FC8 01453021 */   addu     $a2, $t2, $a1
/* 7E3E4C 80282FCC 0000202D */  daddu     $a0, $zero, $zero
/* 7E3E50 80282FD0 0080282D */  daddu     $a1, $a0, $zero
.L80282FD4:
/* 7E3E54 80282FD4 01453021 */  addu      $a2, $t2, $a1
.L80282FD8:
/* 7E3E58 80282FD8 00441821 */  addu      $v1, $v0, $a0
/* 7E3E5C 80282FDC AE05009C */  sw        $a1, 0x9C($s0)
/* 7E3E60 80282FE0 AE0000A0 */  sw        $zero, 0xA0($s0)
/* 7E3E64 80282FE4 14A00005 */  bnez      $a1, .L80282FFC
/* 7E3E68 80282FE8 AE0400A4 */   sw       $a0, 0xA4($s0)
/* 7E3E6C 80282FEC 14800003 */  bnez      $a0, .L80282FFC
/* 7E3E70 80282FF0 24020002 */   addiu    $v0, $zero, 0x2
/* 7E3E74 80282FF4 080A0C1B */  j         .L8028306C
/* 7E3E78 80282FF8 AE0200A8 */   sw       $v0, 0xA8($s0)
.L80282FFC:
/* 7E3E7C 80282FFC 92240004 */  lbu       $a0, 0x4($s1)
/* 7E3E80 80283000 00C4102A */  slt       $v0, $a2, $a0
/* 7E3E84 80283004 10400017 */  beqz      $v0, .L80283064
/* 7E3E88 80283008 24020001 */   addiu    $v0, $zero, 0x1
/* 7E3E8C 8028300C 04C20016 */  bltzl     $a2, .L80283068
/* 7E3E90 80283010 AE0200A8 */   sw       $v0, 0xA8($s0)
/* 7E3E94 80283014 92220005 */  lbu       $v0, 0x5($s1)
/* 7E3E98 80283018 0062102A */  slt       $v0, $v1, $v0
/* 7E3E9C 8028301C 10400011 */  beqz      $v0, .L80283064
/* 7E3EA0 80283020 24020001 */   addiu    $v0, $zero, 0x1
/* 7E3EA4 80283024 0460000F */  bltz      $v1, .L80283064
/* 7E3EA8 80283028 00640018 */   mult     $v1, $a0
/* 7E3EAC 8028302C 8E220000 */  lw        $v0, 0x0($s1)
/* 7E3EB0 80283030 00007012 */  mflo      $t6
/* 7E3EB4 80283034 00CE1821 */  addu      $v1, $a2, $t6
/* 7E3EB8 80283038 00431021 */  addu      $v0, $v0, $v1
/* 7E3EBC 8028303C 90420000 */  lbu       $v0, 0x0($v0)
/* 7E3EC0 80283040 14400008 */  bnez      $v0, .L80283064
/* 7E3EC4 80283044 24020001 */   addiu    $v0, $zero, 0x1
/* 7E3EC8 80283048 3C038016 */  lui       $v1, %hi(gCollisionStatus)
/* 7E3ECC 8028304C 8463A550 */  lh        $v1, %lo(gCollisionStatus)($v1)
/* 7E3ED0 80283050 2402FFFF */  addiu     $v0, $zero, -0x1
/* 7E3ED4 80283054 10620003 */  beq       $v1, $v0, .L80283064
/* 7E3ED8 80283058 24020001 */   addiu    $v0, $zero, 0x1
/* 7E3EDC 8028305C 080A0C1A */  j         .L80283068
/* 7E3EE0 80283060 AE0000A8 */   sw       $zero, 0xA8($s0)
.L80283064:
/* 7E3EE4 80283064 AE0200A8 */  sw        $v0, 0xA8($s0)
.L80283068:
/* 7E3EE8 80283068 24020002 */  addiu     $v0, $zero, 0x2
.L8028306C:
/* 7E3EEC 8028306C 8FBF0018 */  lw        $ra, 0x18($sp)
/* 7E3EF0 80283070 8FB10014 */  lw        $s1, 0x14($sp)
/* 7E3EF4 80283074 8FB00010 */  lw        $s0, 0x10($sp)
/* 7E3EF8 80283078 03E00008 */  jr        $ra
/* 7E3EFC 8028307C 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

API_CALLABLE(FetchPushedBlockProperties) {
    PushBlockGrid* grid = (PushBlockGrid*) script->varTable[10];
    Entity* entity = get_entity_by_index(script->varTable[11]);
    s32 gridCenterX, gridCenterY, gridCenterZ;
    s32 xThing, yThing, zThing;
    s32 entityX, entityY, entityZ;
    s32 varX, varZ;
    s32 deltaX, deltaZ;
    s32 cellX, cellZ;
    s32 x2, z2;

    gridCenterX = grid->centerPos.x;
    gridCenterY = grid->centerPos.y;
    gridCenterZ = grid->centerPos.z;

    xThing = gPlayerStatus.position.x;
    yThing = gPlayerStatus.position.y;
    zThing = gPlayerStatus.position.z;

    xThing -= gridCenterX;
    yThing -= gridCenterY;
    zThing -= gridCenterZ;

    if (xThing < 0) {
        xThing -= BLOCK_GRID_SIZE;
    }
    if (zThing < 0) {
        zThing -= BLOCK_GRID_SIZE;
    }

    xThing /= BLOCK_GRID_SIZE;
    yThing /= BLOCK_GRID_SIZE;
    zThing /= BLOCK_GRID_SIZE;

    varX = xThing;
    varZ = zThing;

    xThing *= BLOCK_GRID_SIZE;
    yThing *= BLOCK_GRID_SIZE;
    zThing *= BLOCK_GRID_SIZE;

    xThing += (BLOCK_GRID_SIZE / 2) + gridCenterX;
    yThing += gridCenterY;
    zThing += (BLOCK_GRID_SIZE / 2) + gridCenterZ;

    script->varTable[0] = xThing;
    script->varTable[1] = yThing;
    script->varTable[2] = zThing;

    script->varTable[3] = entityX = entity->position.x;
    script->varTable[4] = entityY = entity->position.y;
    script->varTable[5] = entityZ = entity->position.z;

    xThing = entityX - grid->centerPos.x;
    zThing = entityZ - grid->centerPos.z;
    x2 = xThing / BLOCK_GRID_SIZE;
    z2 = zThing / BLOCK_GRID_SIZE;

    deltaX = x2 - varX;
    deltaZ = z2 - varZ;

    if (deltaX != 0 && deltaZ != 0) {
        deltaX = deltaZ = 0;
    }

    script->varTable[6] = deltaX;
    script->varTable[7] = 0;
    script->varTable[8] = deltaZ;

    cellX = x2 + deltaX;
    cellZ = z2 + deltaZ;

    if (deltaX == 0 && deltaZ == 0) {
        do {
            script->varTable[9] = 2;
        } while (0);
        return ApiStatus_DONE2;
    }

    if (cellX < grid->numCellsX && cellX >= 0
        && cellZ < grid->numCellsZ && cellZ >= 0
        && grid->cells[cellX + (cellZ * grid->numCellsX)] == PUSH_GRID_EMPTY
        && gCollisionStatus.pushingAgainstWall != NO_COLLIDER)
    {
        script->varTable[9] = 0;
    } else {
        script->varTable[9] = 1;
    }
    return ApiStatus_DONE2;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel title_screen_draw_press_start
/* 12FC8 80037BC8 3C048007 */  lui       $a0, %hi(TitleScreen_PressStart_isVisibile)
/* 12FCC 80037BCC 24847A2C */  addiu     $a0, $a0, %lo(TitleScreen_PressStart_isVisibile)
/* 12FD0 80037BD0 8C830000 */  lw        $v1, 0x0($a0)
/* 12FD4 80037BD4 10600005 */  beqz      $v1, .L80037BEC
/* 12FD8 80037BD8 24020001 */   addiu    $v0, $zero, 0x1
/* 12FDC 80037BDC 10620016 */  beq       $v1, $v0, .L80037C38
/* 12FE0 80037BE0 3C07FC11 */   lui      $a3, (0xFC119623 >> 16)
/* 12FE4 80037BE4 0800DF22 */  j         .L80037C88
/* 12FE8 80037BE8 34E79623 */   ori      $a3, $a3, (0xFC119623 & 0xFFFF)
.L80037BEC:
/* 12FEC 80037BEC 3C038007 */  lui       $v1, %hi(TitleScreen_PressStart_Alpha)
/* 12FF0 80037BF0 24637A28 */  addiu     $v1, $v1, %lo(TitleScreen_PressStart_Alpha)
/* 12FF4 80037BF4 8C620000 */  lw        $v0, 0x0($v1)
/* 12FF8 80037BF8 2442FF80 */  addiu     $v0, $v0, -0x80
/* 12FFC 80037BFC 04410002 */  bgez      $v0, .L80037C08
/* 13000 80037C00 AC620000 */   sw       $v0, 0x0($v1)
/* 13004 80037C04 AC600000 */  sw        $zero, 0x0($v1)
.L80037C08:
/* 13008 80037C08 3C038007 */  lui       $v1, %hi(TitleScreen_PressStart_BlinkCounter)
/* 1300C 80037C0C 24637A30 */  addiu     $v1, $v1, %lo(TitleScreen_PressStart_BlinkCounter)
/* 13010 80037C10 8C620000 */  lw        $v0, 0x0($v1)
/* 13014 80037C14 24420001 */  addiu     $v0, $v0, 0x1
/* 13018 80037C18 AC620000 */  sw        $v0, 0x0($v1)
/* 1301C 80037C1C 28420010 */  slti      $v0, $v0, 0x10
/* 13020 80037C20 14400018 */  bnez      $v0, .L80037C84
/* 13024 80037C24 3C07FC11 */   lui      $a3, (0xFC119623 >> 16)
/* 13028 80037C28 24020001 */  addiu     $v0, $zero, 0x1
/* 1302C 80037C2C AC600000 */  sw        $zero, 0x0($v1)
/* 13030 80037C30 0800DF21 */  j         .L80037C84
/* 13034 80037C34 AC820000 */   sw       $v0, 0x0($a0)
.L80037C38:
/* 13038 80037C38 3C038007 */  lui       $v1, %hi(TitleScreen_PressStart_Alpha)
/* 1303C 80037C3C 24637A28 */  addiu     $v1, $v1, %lo(TitleScreen_PressStart_Alpha)
/* 13040 80037C40 8C620000 */  lw        $v0, 0x0($v1)
/* 13044 80037C44 24420080 */  addiu     $v0, $v0, 0x80
/* 13048 80037C48 AC620000 */  sw        $v0, 0x0($v1)
/* 1304C 80037C4C 28420100 */  slti      $v0, $v0, 0x100
/* 13050 80037C50 14400002 */  bnez      $v0, .L80037C5C
/* 13054 80037C54 240200FF */   addiu    $v0, $zero, 0xFF
/* 13058 80037C58 AC620000 */  sw        $v0, 0x0($v1)
.L80037C5C:
/* 1305C 80037C5C 3C038007 */  lui       $v1, %hi(TitleScreen_PressStart_BlinkCounter)
/* 13060 80037C60 24637A30 */  addiu     $v1, $v1, %lo(TitleScreen_PressStart_BlinkCounter)
/* 13064 80037C64 8C620000 */  lw        $v0, 0x0($v1)
/* 13068 80037C68 24420001 */  addiu     $v0, $v0, 0x1
/* 1306C 80037C6C AC620000 */  sw        $v0, 0x0($v1)
/* 13070 80037C70 28420010 */  slti      $v0, $v0, 0x10
/* 13074 80037C74 14400003 */  bnez      $v0, .L80037C84
/* 13078 80037C78 3C07FC11 */   lui      $a3, (0xFC119623 >> 16)
/* 1307C 80037C7C AC600000 */  sw        $zero, 0x0($v1)
/* 13080 80037C80 AC800000 */  sw        $zero, 0x0($a0)
.L80037C84:
/* 13084 80037C84 34E79623 */  ori       $a3, $a3, (0xFC119623 & 0xFFFF)
.L80037C88:
/* 13088 80037C88 3C06FF2F */  lui       $a2, (0xFF2FFFFF >> 16)
/* 1308C 80037C8C 34C6FFFF */  ori       $a2, $a2, (0xFF2FFFFF & 0xFFFF)
/* 13090 80037C90 3C08F8F0 */  lui       $t0, (0xF8F09800 >> 16)
/* 13094 80037C94 35089800 */  ori       $t0, $t0, (0xF8F09800 & 0xFFFF)
/* 13098 80037C98 3C09077F */  lui       $t1, (0x77FF080 >> 16)
/* 1309C 80037C9C 3529F080 */  ori       $t1, $t1, (0x77FF080 & 0xFFFF)
/* 130A0 80037CA0 3C0AF568 */  lui       $t2, (0xF5682000 >> 16)
/* 130A4 80037CA4 354A2000 */  ori       $t2, $t2, (0xF5682000 & 0xFFFF)
/* 130A8 80037CA8 3C0B001F */  lui       $t3, (0x1FC07C >> 16)
/* 130AC 80037CAC 356BC07C */  ori       $t3, $t3, (0x1FC07C & 0xFFFF)
/* 130B0 80037CB0 3C0DE438 */  lui       $t5, (0xE43802A4 >> 16)
/* 130B4 80037CB4 35AD02A4 */  ori       $t5, $t5, (0xE43802A4 & 0xFFFF)
/* 130B8 80037CB8 3C0C0018 */  lui       $t4, (0x180224 >> 16)
/* 130BC 80037CBC 358C0224 */  ori       $t4, $t4, (0x180224 & 0xFFFF)
/* 130C0 80037CC0 3C0E0400 */  lui       $t6, (0x4000400 >> 16)
/* 130C4 80037CC4 3C05800A */  lui       $a1, %hi(gMainGfxPos)
/* 130C8 80037CC8 24A5A66C */  addiu     $a1, $a1, %lo(gMainGfxPos)
/* 130CC 80037CCC 35CE0400 */  ori       $t6, $t6, (0x4000400 & 0xFFFF)
/* 130D0 80037CD0 8CA20000 */  lw        $v0, 0x0($a1)
/* 130D4 80037CD4 3C03DE00 */  lui       $v1, (0xDE000000 >> 16)
/* 130D8 80037CD8 0040202D */  daddu     $a0, $v0, $zero
/* 130DC 80037CDC 24420008 */  addiu     $v0, $v0, 0x8
/* 130E0 80037CE0 ACA20000 */  sw        $v0, 0x0($a1)
/* 130E4 80037CE4 AC830000 */  sw        $v1, 0x0($a0)
/* 130E8 80037CE8 3C038007 */  lui       $v1, %hi(D_80077A50)
/* 130EC 80037CEC 24637A50 */  addiu     $v1, $v1, %lo(D_80077A50)
/* 130F0 80037CF0 AC830004 */  sw        $v1, 0x4($a0)
/* 130F4 80037CF4 24430008 */  addiu     $v1, $v0, 0x8
/* 130F8 80037CF8 ACA30000 */  sw        $v1, 0x0($a1)
/* 130FC 80037CFC 24430010 */  addiu     $v1, $v0, 0x10
/* 13100 80037D00 3C04FA00 */  lui       $a0, (0xFA000000 >> 16)
/* 13104 80037D04 AC470000 */  sw        $a3, 0x0($v0)
/* 13108 80037D08 AC460004 */  sw        $a2, 0x4($v0)
/* 1310C 80037D0C ACA30000 */  sw        $v1, 0x0($a1)
/* 13110 80037D10 3C038007 */  lui       $v1, %hi(D_80077A2B)
/* 13114 80037D14 90637A2B */  lbu       $v1, %lo(D_80077A2B)($v1)
/* 13118 80037D18 3C06E700 */  lui       $a2, (0xE7000000 >> 16)
/* 1311C 80037D1C AC440008 */  sw        $a0, 0x8($v0)
/* 13120 80037D20 00681825 */  or        $v1, $v1, $t0
/* 13124 80037D24 AC43000C */  sw        $v1, 0xC($v0)
/* 13128 80037D28 24430018 */  addiu     $v1, $v0, 0x18
/* 1312C 80037D2C ACA30000 */  sw        $v1, 0x0($a1)
/* 13130 80037D30 24430020 */  addiu     $v1, $v0, 0x20
/* 13134 80037D34 AC460010 */  sw        $a2, 0x10($v0)
/* 13138 80037D38 AC400014 */  sw        $zero, 0x14($v0)
/* 1313C 80037D3C ACA30000 */  sw        $v1, 0x0($a1)
/* 13140 80037D40 3C04800A */  lui       $a0, %hi(TitleScreen_ImgList_PressStart)
/* 13144 80037D44 8C840980 */  lw        $a0, %lo(TitleScreen_ImgList_PressStart)($a0)
/* 13148 80037D48 3C03FD70 */  lui       $v1, (0xFD700000 >> 16)
/* 1314C 80037D4C AC430018 */  sw        $v1, 0x18($v0)
/* 13150 80037D50 24430028 */  addiu     $v1, $v0, 0x28
/* 13154 80037D54 AC44001C */  sw        $a0, 0x1C($v0)
/* 13158 80037D58 ACA30000 */  sw        $v1, 0x0($a1)
/* 1315C 80037D5C 3C03F570 */  lui       $v1, (0xF5700000 >> 16)
/* 13160 80037D60 AC430020 */  sw        $v1, 0x20($v0)
/* 13164 80037D64 3C030700 */  lui       $v1, (0x7000000 >> 16)
/* 13168 80037D68 AC430024 */  sw        $v1, 0x24($v0)
/* 1316C 80037D6C 24430030 */  addiu     $v1, $v0, 0x30
/* 13170 80037D70 ACA30000 */  sw        $v1, 0x0($a1)
/* 13174 80037D74 3C03E600 */  lui       $v1, (0xE6000000 >> 16)
/* 13178 80037D78 AC430028 */  sw        $v1, 0x28($v0)
/* 1317C 80037D7C 24430038 */  addiu     $v1, $v0, 0x38
/* 13180 80037D80 AC40002C */  sw        $zero, 0x2C($v0)
/* 13184 80037D84 ACA30000 */  sw        $v1, 0x0($a1)
/* 13188 80037D88 3C03F300 */  lui       $v1, (0xF3000000 >> 16)
/* 1318C 80037D8C AC430030 */  sw        $v1, 0x30($v0)
/* 13190 80037D90 24430040 */  addiu     $v1, $v0, 0x40
/* 13194 80037D94 AC490034 */  sw        $t1, 0x34($v0)
/* 13198 80037D98 ACA30000 */  sw        $v1, 0x0($a1)
/* 1319C 80037D9C 24430048 */  addiu     $v1, $v0, 0x48
/* 131A0 80037DA0 AC460038 */  sw        $a2, 0x38($v0)
/* 131A4 80037DA4 AC40003C */  sw        $zero, 0x3C($v0)
/* 131A8 80037DA8 ACA30000 */  sw        $v1, 0x0($a1)
/* 131AC 80037DAC 24430050 */  addiu     $v1, $v0, 0x50
/* 131B0 80037DB0 AC4A0040 */  sw        $t2, 0x40($v0)
/* 131B4 80037DB4 AC400044 */  sw        $zero, 0x44($v0)
/* 131B8 80037DB8 ACA30000 */  sw        $v1, 0x0($a1)
/* 131BC 80037DBC 3C03F200 */  lui       $v1, (0xF2000000 >> 16)
/* 131C0 80037DC0 AC430048 */  sw        $v1, 0x48($v0)
/* 131C4 80037DC4 24430058 */  addiu     $v1, $v0, 0x58
/* 131C8 80037DC8 AC4B004C */  sw        $t3, 0x4C($v0)
/* 131CC 80037DCC ACA30000 */  sw        $v1, 0x0($a1)
/* 131D0 80037DD0 24430060 */  addiu     $v1, $v0, 0x60
/* 131D4 80037DD4 AC4D0050 */  sw        $t5, 0x50($v0)
/* 131D8 80037DD8 AC4C0054 */  sw        $t4, 0x54($v0)
/* 131DC 80037DDC ACA30000 */  sw        $v1, 0x0($a1)
/* 131E0 80037DE0 3C03E100 */  lui       $v1, (0xE1000000 >> 16)
/* 131E4 80037DE4 AC430058 */  sw        $v1, 0x58($v0)
/* 131E8 80037DE8 24430068 */  addiu     $v1, $v0, 0x68
/* 131EC 80037DEC AC40005C */  sw        $zero, 0x5C($v0)
/* 131F0 80037DF0 ACA30000 */  sw        $v1, 0x0($a1)
/* 131F4 80037DF4 3C03F100 */  lui       $v1, (0xF1000000 >> 16)
/* 131F8 80037DF8 AC430060 */  sw        $v1, 0x60($v0)
/* 131FC 80037DFC 24430070 */  addiu     $v1, $v0, 0x70
/* 13200 80037E00 AC4E0064 */  sw        $t6, 0x64($v0)
/* 13204 80037E04 ACA30000 */  sw        $v1, 0x0($a1)
/* 13208 80037E08 AC460068 */  sw        $a2, 0x68($v0)
/* 1320C 80037E0C 03E00008 */  jr        $ra
/* 13210 80037E10 AC40006C */   sw       $zero, 0x6C($v0)

### DECOMPILED C INSTRUCTIONS:

void title_screen_draw_press_start(void) {
    switch (TitleScreen_PressStart_IsVisible) {
        case FALSE:
            TitleScreen_PressStart_Alpha -= 128;
            if (TitleScreen_PressStart_Alpha < 0) {
                TitleScreen_PressStart_Alpha = 0;
            }

            TitleScreen_PressStart_BlinkCounter++;
            if (TitleScreen_PressStart_BlinkCounter >= 16) {
                TitleScreen_PressStart_BlinkCounter = 0;
                TitleScreen_PressStart_IsVisible = TRUE;
            }
            break;
        case TRUE:
            TitleScreen_PressStart_Alpha += 128;
            if (TitleScreen_PressStart_Alpha > 255) {
                TitleScreen_PressStart_Alpha = 255;
            }

            TitleScreen_PressStart_BlinkCounter++;
            if (TitleScreen_PressStart_BlinkCounter >= 16) {
                TitleScreen_PressStart_BlinkCounter = 0;
                TitleScreen_PressStart_IsVisible = FALSE;
            }
    }

    gSPDisplayList(gMainGfxPos++, D_80077A50);
    gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
    gDPSetPrimColor(gMainGfxPos++, 0, 0, 248, 240, 152, TitleScreen_PressStart_Alpha);
    gDPPipeSync(gMainGfxPos++);
    gDPLoadTextureBlock(gMainGfxPos++, TitleScreen_ImgList_PressStart, G_IM_FMT_IA, G_IM_SIZ_8b, 128, VAR_1, 0,
                        G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
                        G_TX_NOLOD);
    gSPTextureRectangle(gMainGfxPos++, 384, 548, 896, VAR_2, G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400);
    gDPPipeSync(gMainGfxPos++);
}