### RAW ASSEMBLY INSTRUCTIONS:

glabel state_init_intro
/* 11A50 80036650 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 11A54 80036654 AFB10014 */  sw        $s1, 0x14($sp)
/* 11A58 80036658 3C118007 */  lui       $s1, %hi(gGameStatusPtr)
/* 11A5C 8003665C 2631419C */  addiu     $s1, $s1, %lo(gGameStatusPtr)
/* 11A60 80036660 AFBF0018 */  sw        $ra, 0x18($sp)
/* 11A64 80036664 AFB00010 */  sw        $s0, 0x10($sp)
/* 11A68 80036668 8E220000 */  lw        $v0, 0x0($s1)
/* 11A6C 8003666C 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 11A70 80036670 44816000 */  mtc1      $at, $f12
/* 11A74 80036674 0C00AFB7 */  jal       set_curtain_scale_goal
/* 11A78 80036678 A04000AC */   sb       $zero, 0xAC($v0)
/* 11A7C 8003667C 3C013E99 */  lui       $at, (0x3E99999A >> 16)
/* 11A80 80036680 3421999A */  ori       $at, $at, (0x3E99999A & 0xFFFF)
/* 11A84 80036684 44816000 */  mtc1      $at, $f12
/* 11A88 80036688 0C00AFC5 */  jal       set_curtain_fade_goal
/* 11A8C 8003668C 00000000 */   nop
/* 11A90 80036690 8E220000 */  lw        $v0, 0x0($s1)
/* 11A94 80036694 805000A8 */  lb        $s0, 0xA8($v0)
/* 11A98 80036698 12000005 */  beqz      $s0, .L800366B0
/* 11A9C 8003669C 24020001 */   addiu    $v0, $zero, 0x1
/* 11AA0 800366A0 12020020 */  beq       $s0, $v0, .L80036724
/* 11AA4 800366A4 00000000 */   nop
/* 11AA8 800366A8 0800D9E3 */  j         .L8003678C
/* 11AAC 800366AC 00000000 */   nop
.L800366B0:
/* 11AB0 800366B0 0C00CDF4 */  jal       intro_logos_set_fade_alpha
/* 11AB4 800366B4 0000202D */   daddu    $a0, $zero, $zero
/* 11AB8 800366B8 240200FF */  addiu     $v0, $zero, 0xFF
/* 11ABC 800366BC 3C01800A */  lui       $at, %hi(D_800A0954)
/* 11AC0 800366C0 A4220954 */  sh        $v0, %lo(D_800A0954)($at)
/* 11AC4 800366C4 24020010 */  addiu     $v0, $zero, 0x10
/* 11AC8 800366C8 3C01800A */  lui       $at, %hi(D_800A0956)
/* 11ACC 800366CC A4220956 */  sh        $v0, %lo(D_800A0956)($at)
/* 11AD0 800366D0 24020004 */  addiu     $v0, $zero, 0x4
/* 11AD4 800366D4 3C01800A */  lui       $at, %hi(D_800A0958)
/* 11AD8 800366D8 A4220958 */  sh        $v0, %lo(D_800A0958)($at)
/* 11ADC 800366DC 240200D0 */  addiu     $v0, $zero, 0xD0
/* 11AE0 800366E0 3C01800A */  lui       $at, %hi(D_800A0960)
/* 11AE4 800366E4 AC200960 */  sw        $zero, %lo(D_800A0960)($at)
/* 11AE8 800366E8 3C01800A */  lui       $at, %hi(D_800A095A)
/* 11AEC 800366EC A422095A */  sh        $v0, %lo(D_800A095A)($at)
/* 11AF0 800366F0 3C01800A */  lui       $at, %hi(D_800A095C)
/* 11AF4 800366F4 A422095C */  sh        $v0, %lo(D_800A095C)($at)
/* 11AF8 800366F8 3C01800A */  lui       $at, %hi(D_800A095E)
/* 11AFC 800366FC A422095E */  sh        $v0, %lo(D_800A095E)($at)
/* 11B00 80036700 3C01800A */  lui       $at, %hi(D_800A0964)
/* 11B04 80036704 AC200964 */  sw        $zero, %lo(D_800A0964)($at)
/* 11B08 80036708 8E230000 */  lw        $v1, 0x0($s1)
/* 11B0C 8003670C 24020005 */  addiu     $v0, $zero, 0x5
/* 11B10 80036710 A4620086 */  sh        $v0, 0x86($v1)
/* 11B14 80036714 A462008C */  sh        $v0, 0x8C($v1)
/* 11B18 80036718 24020003 */  addiu     $v0, $zero, 0x3
/* 11B1C 8003671C 0800D9FC */  j         .L800367F0
/* 11B20 80036720 A462008E */   sh       $v0, 0x8E($v1)
.L80036724:
/* 11B24 80036724 0C00CDF4 */  jal       intro_logos_set_fade_alpha
/* 11B28 80036728 0000202D */   daddu    $a0, $zero, $zero
/* 11B2C 8003672C 2402000C */  addiu     $v0, $zero, 0xC
/* 11B30 80036730 24040004 */  addiu     $a0, $zero, 0x4
/* 11B34 80036734 3C01800A */  lui       $at, %hi(D_800A0954)
/* 11B38 80036738 A4200954 */  sh        $zero, %lo(D_800A0954)($at)
/* 11B3C 8003673C 3C01800A */  lui       $at, %hi(D_800A0956)
/* 11B40 80036740 A4220956 */  sh        $v0, %lo(D_800A0956)($at)
/* 11B44 80036744 3C01800A */  lui       $at, %hi(D_800A0958)
/* 11B48 80036748 A4240958 */  sh        $a0, %lo(D_800A0958)($at)
/* 11B4C 8003674C 3C01800A */  lui       $at, %hi(D_800A0960)
/* 11B50 80036750 AC300960 */  sw        $s0, %lo(D_800A0960)($at)
/* 11B54 80036754 3C01800A */  lui       $at, %hi(D_800A095A)
/* 11B58 80036758 A420095A */  sh        $zero, %lo(D_800A095A)($at)
/* 11B5C 8003675C 3C01800A */  lui       $at, %hi(D_800A095C)
/* 11B60 80036760 A420095C */  sh        $zero, %lo(D_800A095C)($at)
/* 11B64 80036764 3C01800A */  lui       $at, %hi(D_800A095E)
/* 11B68 80036768 A420095E */  sh        $zero, %lo(D_800A095E)($at)
/* 11B6C 8003676C 3C01800A */  lui       $at, %hi(D_800A0964)
/* 11B70 80036770 AC200964 */  sw        $zero, %lo(D_800A0964)($at)
/* 11B74 80036774 8E220000 */  lw        $v0, 0x0($s1)
/* 11B78 80036778 24030005 */  addiu     $v1, $zero, 0x5
/* 11B7C 8003677C A4430086 */  sh        $v1, 0x86($v0)
/* 11B80 80036780 A444008C */  sh        $a0, 0x8C($v0)
/* 11B84 80036784 0800D9FC */  j         .L800367F0
/* 11B88 80036788 A444008E */   sh       $a0, 0x8E($v0)
.L8003678C:
/* 11B8C 8003678C 0C00CDF4 */  jal       intro_logos_set_fade_alpha
/* 11B90 80036790 0000202D */   daddu    $a0, $zero, $zero
/* 11B94 80036794 0C00CDF8 */  jal       intro_logos_set_fade_color
/* 11B98 80036798 240400D0 */   addiu    $a0, $zero, 0xD0
/* 11B9C 8003679C 2402FFFF */  addiu     $v0, $zero, -0x1
/* 11BA0 800367A0 3C038007 */  lui       $v1, %hi(gGameStatusPtr)
/* 11BA4 800367A4 8C63419C */  lw        $v1, %lo(gGameStatusPtr)($v1)
/* 11BA8 800367A8 3C048007 */  lui       $a0, %hi(D_800779B0)
/* 11BAC 800367AC 248479B0 */  addiu     $a0, $a0, %lo(D_800779B0)
/* 11BB0 800367B0 A06200A8 */  sb        $v0, 0xA8($v1)
/* 11BB4 800367B4 90820000 */  lbu       $v0, 0x0($a0)
/* 11BB8 800367B8 24030006 */  addiu     $v1, $zero, 0x6
/* 11BBC 800367BC 3C01800A */  lui       $at, %hi(D_800A0956)
/* 11BC0 800367C0 A4230956 */  sh        $v1, %lo(D_800A0956)($at)
/* 11BC4 800367C4 3C01800A */  lui       $at, %hi(D_800A0958)
/* 11BC8 800367C8 A4230958 */  sh        $v1, %lo(D_800A0958)($at)
/* 11BCC 800367CC 24420001 */  addiu     $v0, $v0, 0x1
/* 11BD0 800367D0 A0820000 */  sb        $v0, 0x0($a0)
/* 11BD4 800367D4 304200FF */  andi      $v0, $v0, 0xFF
/* 11BD8 800367D8 2C420004 */  sltiu     $v0, $v0, 0x4
/* 11BDC 800367DC 50400001 */  beql      $v0, $zero, .L800367E4
/* 11BE0 800367E0 A0800000 */   sb       $zero, 0x0($a0)
.L800367E4:
/* 11BE4 800367E4 24020003 */  addiu     $v0, $zero, 0x3
/* 11BE8 800367E8 3C01800A */  lui       $at, %hi(D_800A0964)
/* 11BEC 800367EC AC220964 */  sw        $v0, %lo(D_800A0964)($at)
.L800367F0:
/* 11BF0 800367F0 3C02800A */  lui       $v0, %hi(D_800A0954)
/* 11BF4 800367F4 84420954 */  lh        $v0, %lo(D_800A0954)($v0)
/* 11BF8 800367F8 3C04800A */  lui       $a0, %hi(D_800A0963)
/* 11BFC 800367FC 90840963 */  lbu       $a0, %lo(D_800A0963)($a0)
/* 11C00 80036800 44820000 */  mtc1      $v0, $f0
/* 11C04 80036804 00000000 */  nop
/* 11C08 80036808 46800020 */  cvt.s.w   $f0, $f0
/* 11C0C 8003680C 44050000 */  mfc1      $a1, $f0
/* 11C10 80036810 0C04DF69 */  jal       set_screen_overlay_params_back
/* 11C14 80036814 00000000 */   nop
/* 11C18 80036818 3C05800A */  lui       $a1, %hi(D_800A095B)
/* 11C1C 8003681C 90A5095B */  lbu       $a1, %lo(D_800A095B)($a1)
/* 11C20 80036820 3C06800A */  lui       $a2, %hi(D_800A095D)
/* 11C24 80036824 90C6095D */  lbu       $a2, %lo(D_800A095D)($a2)
/* 11C28 80036828 3C07800A */  lui       $a3, %hi(D_800A095F)
/* 11C2C 8003682C 90E7095F */  lbu       $a3, %lo(D_800A095F)($a3)
/* 11C30 80036830 0C04DF84 */  jal       set_screen_overlay_color
/* 11C34 80036834 24040001 */   addiu    $a0, $zero, 0x1
/* 11C38 80036838 0C00CE1D */  jal       intro_logos_update_fade
/* 11C3C 8003683C 00000000 */   nop
/* 11C40 80036840 8FBF0018 */  lw        $ra, 0x18($sp)
/* 11C44 80036844 8FB10014 */  lw        $s1, 0x14($sp)
/* 11C48 80036848 8FB00010 */  lw        $s0, 0x10($sp)
/* 11C4C 8003684C 03E00008 */  jr        $ra
/* 11C50 80036850 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void state_init_intro(void) {
    s8 unk_A8;

    gGameStatusPtr->introState = INTRO_STATE_0;

    set_curtain_scale_goal(1.0f);
    set_curtain_fade_goal(0.3f);

    unk_A8 = gGameStatusPtr->creditsViewportMode;
    switch (unk_A8) {
        case 0:
            intro_logos_set_fade_alpha(0);

            D_800A0954 = 0xFF;
            D_800A0956 = 0x10;
            D_800A0958 = 4;
            D_800A0960 = 0;
            D_800A095A = 208;
            D_800A095C = 208;
            D_800A095E = 208;
            D_800A0964 = 0;

            // hos_05 (Star Sanctuary)
            gGameStatusPtr->areaID = AREA_HOS;
            gGameStatusPtr->mapID = 5;
            gGameStatusPtr->entryID = 3;
            break;
        case 1:
            intro_logos_set_fade_alpha(0);

            D_800A0954 = 0;
            D_800A0956 = 0xC;
            D_800A0958 = 4;
            D_800A0960 = unk_A8;
            D_800A095A = 0;
            D_800A095C = 0;
            D_800A095E = 0;
            D_800A0964 = 0;

            // hos_04 (Outside the Sanctuary)
            gGameStatusPtr->areaID = AREA_HOS;
            gGameStatusPtr->mapID = 4;
            gGameStatusPtr->entryID = 4;
            break;
        default:
            intro_logos_set_fade_alpha(0);
            intro_logos_set_fade_color(208);

            gGameStatusPtr->creditsViewportMode = -1;

            D_800A0956 = 6;
            D_800A0958 = 6;

            D_800779B0++;
            if (D_800779B0 >= 4) {
                D_800779B0 = 0;
            }

            D_800A0964 = 3;
            break;
    }

    set_screen_overlay_params_back(D_800A0963, D_800A0954);
    set_screen_overlay_color(SCREEN_LAYER_BACK, D_800A095B, D_800A095D, D_800A095F);

    intro_logos_update_fade();
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel shattering_stones_main
/* 33FE80 E002C000 27BDFF98 */  addiu     $sp, $sp, -0x68
/* 33FE84 E002C004 F7B40050 */  sdc1      $f20, 0x50($sp)
/* 33FE88 E002C008 4485A000 */  mtc1      $a1, $f20
/* 33FE8C E002C00C F7B60058 */  sdc1      $f22, 0x58($sp)
/* 33FE90 E002C010 4486B000 */  mtc1      $a2, $f22
/* 33FE94 E002C014 27A40010 */  addiu     $a0, $sp, 0x10
/* 33FE98 E002C018 F7B80060 */  sdc1      $f24, 0x60($sp)
/* 33FE9C E002C01C 4487C000 */  mtc1      $a3, $f24
/* 33FEA0 E002C020 3C02E003 */  lui       $v0, %hi(shattering_stones_init)
/* 33FEA4 E002C024 2442C234 */  addiu     $v0, $v0, %lo(shattering_stones_init)
/* 33FEA8 E002C028 AFA20018 */  sw        $v0, 0x18($sp)
/* 33FEAC E002C02C 3C02E003 */  lui       $v0, %hi(shattering_stones_update)
/* 33FEB0 E002C030 2442C23C */  addiu     $v0, $v0, %lo(shattering_stones_update)
/* 33FEB4 E002C034 AFA2001C */  sw        $v0, 0x1C($sp)
/* 33FEB8 E002C038 3C02E003 */  lui       $v0, %hi(shattering_stones_render)
/* 33FEBC E002C03C 2442C3D0 */  addiu     $v0, $v0, %lo(shattering_stones_render)
/* 33FEC0 E002C040 AFA20020 */  sw        $v0, 0x20($sp)
/* 33FEC4 E002C044 24020016 */  addiu     $v0, $zero, 0x16
/* 33FEC8 E002C048 AFBF0048 */  sw        $ra, 0x48($sp)
/* 33FECC E002C04C AFB70044 */  sw        $s7, 0x44($sp)
/* 33FED0 E002C050 AFB60040 */  sw        $s6, 0x40($sp)
/* 33FED4 E002C054 AFB5003C */  sw        $s5, 0x3C($sp)
/* 33FED8 E002C058 AFB40038 */  sw        $s4, 0x38($sp)
/* 33FEDC E002C05C AFB30034 */  sw        $s3, 0x34($sp)
/* 33FEE0 E002C060 AFB20030 */  sw        $s2, 0x30($sp)
/* 33FEE4 E002C064 AFB1002C */  sw        $s1, 0x2C($sp)
/* 33FEE8 E002C068 AFB00028 */  sw        $s0, 0x28($sp)
/* 33FEEC E002C06C AFA00010 */  sw        $zero, 0x10($sp)
/* 33FEF0 E002C070 AFA00024 */  sw        $zero, 0x24($sp)
/* 33FEF4 E002C074 0C080124 */  jal       shim_create_effect_instance
/* 33FEF8 E002C078 AFA20014 */   sw       $v0, 0x14($sp)
/* 33FEFC E002C07C 24040240 */  addiu     $a0, $zero, 0x240
/* 33FF00 E002C080 24150009 */  addiu     $s5, $zero, 0x9
/* 33FF04 E002C084 0040802D */  daddu     $s0, $v0, $zero
/* 33FF08 E002C088 0C08012C */  jal       shim_general_heap_malloc
/* 33FF0C E002C08C AE150008 */   sw       $s5, 0x8($s0)
/* 33FF10 E002C090 0040882D */  daddu     $s1, $v0, $zero
/* 33FF14 E002C094 16200003 */  bnez      $s1, .LE002C0A4
/* 33FF18 E002C098 AE11000C */   sw       $s1, 0xC($s0)
.LE002C09C:
/* 33FF1C E002C09C 0800B027 */  j         .LE002C09C
/* 33FF20 E002C0A0 00000000 */   nop
.LE002C0A4:
/* 33FF24 E002C0A4 3C01C000 */  lui       $at, (0xC0000000 >> 16)
/* 33FF28 E002C0A8 44811000 */  mtc1      $at, $f2
/* 33FF2C E002C0AC AE200024 */  sw        $zero, 0x24($s1)
/* 33FF30 E002C0B0 E6340000 */  swc1      $f20, 0x0($s1)
/* 33FF34 E002C0B4 E6360004 */  swc1      $f22, 0x4($s1)
/* 33FF38 E002C0B8 C7A00078 */  lwc1      $f0, 0x78($sp)
/* 33FF3C E002C0BC 2404003C */  addiu     $a0, $zero, 0x3C
/* 33FF40 E002C0C0 E6380008 */  swc1      $f24, 0x8($s1)
/* 33FF44 E002C0C4 AE20002C */  sw        $zero, 0x2C($s1)
/* 33FF48 E002C0C8 AE200030 */  sw        $zero, 0x30($s1)
/* 33FF4C E002C0CC E620000C */  swc1      $f0, 0xC($s1)
/* 33FF50 E002C0D0 0C080138 */  jal       shim_rand_int
/* 33FF54 E002C0D4 E6220014 */   swc1     $f2, 0x14($s1)
/* 33FF58 E002C0D8 2404003C */  addiu     $a0, $zero, 0x3C
/* 33FF5C E002C0DC 2442FFE2 */  addiu     $v0, $v0, -0x1E
/* 33FF60 E002C0E0 44820000 */  mtc1      $v0, $f0
/* 33FF64 E002C0E4 00000000 */  nop
/* 33FF68 E002C0E8 46800020 */  cvt.s.w   $f0, $f0
/* 33FF6C E002C0EC 240200FF */  addiu     $v0, $zero, 0xFF
/* 33FF70 E002C0F0 E6200034 */  swc1      $f0, 0x34($s1)
/* 33FF74 E002C0F4 0C080138 */  jal       shim_rand_int
/* 33FF78 E002C0F8 AE220028 */   sw       $v0, 0x28($s1)
/* 33FF7C E002C0FC 2442FFE2 */  addiu     $v0, $v0, -0x1E
/* 33FF80 E002C100 44822000 */  mtc1      $v0, $f4
/* 33FF84 E002C104 00000000 */  nop
/* 33FF88 E002C108 46802120 */  cvt.s.w   $f4, $f4
/* 33FF8C E002C10C 3C013FD0 */  lui       $at, (0x3FD00000 >> 16)
/* 33FF90 E002C110 44811800 */  mtc1      $at, $f3
/* 33FF94 E002C114 44801000 */  mtc1      $zero, $f2
/* 33FF98 E002C118 46002021 */  cvt.d.s   $f0, $f4
/* 33FF9C E002C11C 46220002 */  mul.d     $f0, $f0, $f2
/* 33FFA0 E002C120 00000000 */  nop
/* 33FFA4 E002C124 24120001 */  addiu     $s2, $zero, 0x1
/* 33FFA8 E002C128 24020014 */  addiu     $v0, $zero, 0x14
/* 33FFAC E002C12C AE220020 */  sw        $v0, 0x20($s1)
/* 33FFB0 E002C130 0255102A */  slt       $v0, $s2, $s5
/* 33FFB4 E002C134 E6240038 */  swc1      $f4, 0x38($s1)
/* 33FFB8 E002C138 46200020 */  cvt.s.d   $f0, $f0
/* 33FFBC E002C13C E620003C */  swc1      $f0, 0x3C($s1)
/* 33FFC0 E002C140 1040002E */  beqz      $v0, .LE002C1FC
/* 33FFC4 E002C144 26310040 */   addiu    $s1, $s1, 0x40
/* 33FFC8 E002C148 3C17E003 */  lui       $s7, %hi(D_E002C984)
/* 33FFCC E002C14C 26F7C984 */  addiu     $s7, $s7, %lo(D_E002C984)
/* 33FFD0 E002C150 3C16E003 */  lui       $s6, %hi(D_E002C964)
/* 33FFD4 E002C154 26D6C964 */  addiu     $s6, $s6, %lo(D_E002C964)
/* 33FFD8 E002C158 26300034 */  addiu     $s0, $s1, 0x34
/* 33FFDC E002C15C 0000A02D */  daddu     $s4, $zero, $zero
/* 33FFE0 E002C160 0280982D */  daddu     $s3, $s4, $zero
/* 33FFE4 E002C164 3C01E003 */  lui       $at, (0xE0030000 >> 16)
/* 33FFE8 E002C168 D436C9D0 */  ldc1      $f22, -0x3630($at)
/* 33FFEC E002C16C 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
/* 33FFF0 E002C170 4481A800 */  mtc1      $at, $f21
/* 33FFF4 E002C174 4480A000 */  mtc1      $zero, $f20
.LE002C178:
/* 33FFF8 E002C178 02771021 */  addu      $v0, $s3, $s7
/* 33FFFC E002C17C C4400000 */  lwc1      $f0, 0x0($v0)
/* 340000 E002C180 E600FFE4 */  swc1      $f0, -0x1C($s0)
/* 340004 E002C184 C4400004 */  lwc1      $f0, 0x4($v0)
/* 340008 E002C188 02961021 */  addu      $v0, $s4, $s6
/* 34000C E002C18C E600FFE8 */  swc1      $f0, -0x18($s0)
/* 340010 E002C190 AE200000 */  sw        $zero, 0x0($s1)
/* 340014 E002C194 AE00FFD0 */  sw        $zero, -0x30($s0)
/* 340018 E002C198 AE00FFD4 */  sw        $zero, -0x2C($s0)
/* 34001C E002C19C C4400000 */  lwc1      $f0, 0x0($v0)
/* 340020 E002C1A0 46000000 */  add.s     $f0, $f0, $f0
/* 340024 E002C1A4 2404000A */  addiu     $a0, $zero, 0xA
/* 340028 E002C1A8 0C080138 */  jal       shim_rand_int
/* 34002C E002C1AC E600FFDC */   swc1     $f0, -0x24($s0)
/* 340030 E002C1B0 44820000 */  mtc1      $v0, $f0
/* 340034 E002C1B4 00000000 */  nop
/* 340038 E002C1B8 46800020 */  cvt.s.w   $f0, $f0
/* 34003C E002C1BC 46000021 */  cvt.d.s   $f0, $f0
/* 340040 E002C1C0 46360002 */  mul.d     $f0, $f0, $f22
/* 340044 E002C1C4 00000000 */  nop
/* 340048 E002C1C8 26940004 */  addiu     $s4, $s4, 0x4
/* 34004C E002C1CC 26730008 */  addiu     $s3, $s3, 0x8
/* 340050 E002C1D0 26520001 */  addiu     $s2, $s2, 0x1
/* 340054 E002C1D4 46200000 */  add.d     $f0, $f0, $f0
/* 340058 E002C1D8 26310040 */  addiu     $s1, $s1, 0x40
/* 34005C E002C1DC 0255102A */  slt       $v0, $s2, $s5
/* 340060 E002C1E0 46340000 */  add.d     $f0, $f0, $f20
/* 340064 E002C1E4 AE00FFF8 */  sw        $zero, -0x8($s0)
/* 340068 E002C1E8 AE000000 */  sw        $zero, 0x0($s0)
/* 34006C E002C1EC 46200020 */  cvt.s.d   $f0, $f0
/* 340070 E002C1F0 E600FFE0 */  swc1      $f0, -0x20($s0)
/* 340074 E002C1F4 1440FFE0 */  bnez      $v0, .LE002C178
/* 340078 E002C1F8 26100040 */   addiu    $s0, $s0, 0x40
.LE002C1FC:
/* 34007C E002C1FC 8FBF0048 */  lw        $ra, 0x48($sp)
/* 340080 E002C200 8FB70044 */  lw        $s7, 0x44($sp)
/* 340084 E002C204 8FB60040 */  lw        $s6, 0x40($sp)
/* 340088 E002C208 8FB5003C */  lw        $s5, 0x3C($sp)
/* 34008C E002C20C 8FB40038 */  lw        $s4, 0x38($sp)
/* 340090 E002C210 8FB30034 */  lw        $s3, 0x34($sp)
/* 340094 E002C214 8FB20030 */  lw        $s2, 0x30($sp)
/* 340098 E002C218 8FB1002C */  lw        $s1, 0x2C($sp)
/* 34009C E002C21C 8FB00028 */  lw        $s0, 0x28($sp)
/* 3400A0 E002C220 D7B80060 */  ldc1      $f24, 0x60($sp)
/* 3400A4 E002C224 D7B60058 */  ldc1      $f22, 0x58($sp)
/* 3400A8 E002C228 D7B40050 */  ldc1      $f20, 0x50($sp)
/* 3400AC E002C22C 03E00008 */  jr        $ra
/* 3400B0 E002C230 27BD0068 */   addiu    $sp, $sp, 0x68

### DECOMPILED C INSTRUCTIONS:

void shattering_stones_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
    EffectBlueprint bp;
    EffectInstance* effect;
    ShatteringStonesFXData* part;
    s32 numParts = 9;
    s32 i;

    bp.init = shattering_stones_init;
    bp.update = shattering_stones_update;
    bp.renderWorld = shattering_stones_render;
    bp.unk_00 = 0;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_SHATTERING_STONES;

    effect = shim_create_effect_instance(&bp);
    effect->numParts = numParts;
    part = effect->data.shatteringStones = shim_general_heap_malloc(numParts * sizeof(*part));
    ASSERT(effect->data.shatteringStones != NULL);

    part->unk_24 = 0;
    part->unk_00 = arg1;
    part->unk_04 = arg2;
    part->unk_0C = arg4;
    part->unk_08 = arg3;
    part->unk_2C = 0;
    part->unk_30 = 0;
    part->unk_14 = -2.0f;
    part->unk_34 = shim_rand_int(60) - 30;
    part->unk_28 = 255;
    part->unk_38 = shim_rand_int(60) - 30;
    part->unk_3C = part->unk_38 * 0.25;
    part->unk_20 = 20;

    part++;
    for (i = 1; i < numParts; i++, part++) {
        part->unk_18 = D_E002C984[i - 1][0];
        part->unk_1C = D_E002C984[i - 1][1];
        part->unk_00 = 0;
        part->unk_04 = 0;
        part->unk_08 = 0;
        part->unk_10 = D_E002C964[i - 1] * 2.0f;
        part->unk_14 = (f32) shim_rand_int(10) * 0.1 * 2.0 + 1.0;
        part->unk_2C = 0;
        part->unk_34 = 0;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel parasol_get_npc
/* E24920 802B6000 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* E24924 802B6004 AFB1001C */  sw        $s1, 0x1C($sp)
/* E24928 802B6008 3C118016 */  lui       $s1, %hi(gCollisionStatus)
/* E2492C 802B600C 2631A550 */  addiu     $s1, $s1, %lo(gCollisionStatus)
/* E24930 802B6010 AFB00018 */  sw        $s0, 0x18($sp)
/* E24934 802B6014 3C108011 */  lui       $s0, %hi(gPlayerStatus)
.L802B6018:
/* E24938 802B6018 2610EFC8 */  addiu     $s0, $s0, %lo(gPlayerStatus)
/* E2493C 802B601C AFBF0024 */  sw        $ra, 0x24($sp)
/* E24940 802B6020 AFB20020 */  sw        $s2, 0x20($sp)
/* E24944 802B6024 8E050004 */  lw        $a1, 0x4($s0)
/* E24948 802B6028 3C12800B */  lui       $s2, %hi(gCameras)
/* E2494C 802B602C 26521D80 */  addiu     $s2, $s2, %lo(gCameras)
/* E24950 802B6030 30A21000 */  andi      $v0, $a1, 0x1000
/* E24954 802B6034 10400005 */  beqz      $v0, .L802B604C
/* E24958 802B6038 00000000 */   nop
/* E2495C 802B603C 0C0AD8B3 */  jal       action_update_peach_land
.L802B6040:
/* E24960 802B6040 00000000 */   nop
.L802B6044:
/* E24964 802B6044 080AD86A */  j         .L802B61A8
glabel action_hammer_play_hit_fx
/* E24968 802B6048 00000000 */   nop
.L802B604C:
/* E2496C 802B604C 8E030000 */  lw        $v1, 0x0($s0)
.L802B6050:
/* E24970 802B6050 0461002E */  bgez      $v1, .L802B610C
/* E24974 802B6054 3C027F77 */   lui      $v0, (0x7F77FFF1 >> 16)
.L802B6058:
/* E24978 802B6058 3442FFF1 */  ori       $v0, $v0, (0x7F77FFF1 & 0xFFFF)
/* E2497C 802B605C C6000028 */  lwc1      $f0, 0x28($s0)
glabel action_update_sliding
/* E24980 802B6060 C6020030 */  lwc1      $f2, 0x30($s0)
/* E24984 802B6064 00621024 */  and       $v0, $v1, $v0
.L802B6068:
/* E24988 802B6068 AE020000 */  sw        $v0, 0x0($s0)
/* E2498C 802B606C 30A24000 */  andi      $v0, $a1, 0x4000
/* E24990 802B6070 A20000B6 */  sb        $zero, 0xB6($s0)
.L802B6074:
/* E24994 802B6074 A60000C0 */  sh        $zero, 0xC0($s0)
/* E24998 802B6078 A60000C2 */  sh        $zero, 0xC2($s0)
glabel .L802B607C
/* E2499C 802B607C E6000044 */  swc1      $f0, 0x44($s0)
.L802B6080:
/* E249A0 802B6080 10400004 */  beqz      $v0, .L802B6094
/* E249A4 802B6084 E6020048 */   swc1     $f2, 0x48($s0)
/* E249A8 802B6088 3C040009 */  lui       $a0, (0x90002 >> 16)
.L802B608C:
/* E249AC 802B608C 080AD82B */  j         .L802B60AC
.L802B6090:
/* E249B0 802B6090 34840002 */   ori      $a0, $a0, (0x90002 & 0xFFFF)
.L802B6094:
/* E249B4 802B6094 3C040006 */  lui       $a0, (0x6000B >> 16)
/* E249B8 802B6098 30A20001 */  andi      $v0, $a1, 0x1
glabel action_update_state_23
/* E249BC 802B609C 14400003 */  bnez      $v0, .L802B60AC
/* E249C0 802B60A0 3484000B */   ori      $a0, $a0, (0x6000B & 0xFFFF)
glabel action_update_use_spinning_flower
/* E249C4 802B60A4 3C040001 */  lui       $a0, (0x10009 >> 16)
.L802B60A8:
/* E249C8 802B60A8 34840009 */  ori       $a0, $a0, (0x10009 & 0xFFFF)
.L802B60AC:
/* E249CC 802B60AC 0C037FBF */  jal       suggest_player_anim_allow_backward
/* E249D0 802B60B0 00000000 */   nop
glabel action_update_jump
/* E249D4 802B60B4 34048161 */  ori       $a0, $zero, 0x8161
/* E249D8 802B60B8 0C052736 */  jal       sfx_play_sound_at_player
/* E249DC 802B60BC 0000282D */   daddu    $a1, $zero, $zero
/* E249E0 802B60C0 24040148 */  addiu     $a0, $zero, 0x148
/* E249E4 802B60C4 0C052736 */  jal       sfx_play_sound_at_player
.L802B60C8:
/* E249E8 802B60C8 0000282D */   daddu    $a1, $zero, $zero
/* E249EC 802B60CC 96220002 */  lhu       $v0, 0x2($s1)
glabel .L802B60D0
/* E249F0 802B60D0 30424000 */  andi      $v0, $v0, 0x4000
.L802B60D4:
/* E249F4 802B60D4 14400004 */  bnez      $v0, .L802B60E8
/* E249F8 802B60D8 3C04FFFB */   lui      $a0, (0xFFFBFFFF >> 16)
/* E249FC 802B60DC 0C03954C */  jal       phys_adjust_cam_on_landing
/* E24A00 802B60E0 00000000 */   nop
/* E24A04 802B60E4 3C04FFFB */  lui       $a0, (0xFFFBFFFF >> 16)
.L802B60E8:
/* E24A08 802B60E8 3484FFFF */  ori       $a0, $a0, (0xFFFBFFFF & 0xFFFF)
.L802B60EC:
/* E24A0C 802B60EC 2402FFFF */  addiu     $v0, $zero, -0x1
.L802B60F0:
/* E24A10 802B60F0 A6220004 */  sh        $v0, 0x4($s1)
glabel .L802B60F4
/* E24A14 802B60F4 8E020004 */  lw        $v0, 0x4($s0)
/* E24A18 802B60F8 96430002 */  lhu       $v1, 0x2($s2)
/* E24A1C 802B60FC 00441024 */  and       $v0, $v0, $a0
.L802B6100:
/* E24A20 802B6100 3063FFFB */  andi      $v1, $v1, 0xFFFB
.L802B6104:
/* E24A24 802B6104 AE020004 */  sw        $v0, 0x4($s0)
.L802B6108:
/* E24A28 802B6108 A6430002 */  sh        $v1, 0x2($s2)
glabel .L802B610C
/* E24A2C 802B610C C6000054 */  lwc1      $f0, 0x54($s0)
.L802B6110:
/* E24A30 802B6110 3C013F19 */  lui       $at, (0x3F19999A >> 16)
/* E24A34 802B6114 3421999A */  ori       $at, $at, (0x3F19999A & 0xFFFF)
.L802B6118:
/* E24A38 802B6118 44811000 */  mtc1      $at, $f2
/* E24A3C 802B611C 27A40010 */  addiu     $a0, $sp, 0x10
glabel action_update_parasol
/* E24A40 802B6120 46020002 */  mul.s     $f0, $f0, $f2
.L802B6124:
/* E24A44 802B6124 00000000 */  nop
.L802B6128:
/* E24A48 802B6128 920200B6 */  lbu       $v0, 0xB6($s0)
/* E24A4C 802B612C 27A50014 */  addiu     $a1, $sp, 0x14
/* E24A50 802B6130 24420001 */  addiu     $v0, $v0, 0x1
glabel .L802B6134
/* E24A54 802B6134 A20200B6 */  sb        $v0, 0xB6($s0)
/* E24A58 802B6138 0C0388C1 */  jal       player_input_to_move_vector
.L802B613C:
/* E24A5C 802B613C E6000054 */   swc1     $f0, 0x54($s0)
.L802B6140:
/* E24A60 802B6140 0C039858 */  jal       check_input_jump
.L802B6144:
/* E24A64 802B6144 00000000 */   nop
/* E24A68 802B6148 0040182D */  daddu     $v1, $v0, $zero
.L802B614C:
/* E24A6C 802B614C 14600005 */  bnez      $v1, .L802B6164
.L802B6150:
/* E24A70 802B6150 00000000 */   nop
.L802B6154:
/* E24A74 802B6154 820200B6 */  lb        $v0, 0xB6($s0)
.L802B6158:
/* E24A78 802B6158 0062102A */  slt       $v0, $v1, $v0
.L802B615C:
/* E24A7C 802B615C 10400012 */  beqz      $v0, .L802B61A8
/* E24A80 802B6160 00000000 */   nop
.L802B6164:
/* E24A84 802B6164 C7A00014 */  lwc1      $f0, 0x14($sp)
.L802B6168:
/* E24A88 802B6168 44801000 */  mtc1      $zero, $f2
/* E24A8C 802B616C 00000000 */  nop
glabel .L802B6170
/* E24A90 802B6170 46020032 */  c.eq.s    $f0, $f2
glabel .L802B6174
/* E24A94 802B6174 00000000 */  nop
/* E24A98 802B6178 45000005 */  bc1f      .L802B6190
.L802B617C:
/* E24A9C 802B617C 00000000 */   nop
.L802B6180:
/* E24AA0 802B6180 0C039769 */  jal       set_action_state
glabel .L802B6184
/* E24AA4 802B6184 0000202D */   daddu    $a0, $zero, $zero
.L802B6188:
/* E24AA8 802B6188 080AD86A */  j         .L802B61A8
.L802B618C:
/* E24AAC 802B618C 00000000 */   nop
.L802B6190:
/* E24AB0 802B6190 45010003 */  bc1t      .L802B61A0
.L802B6194:
/* E24AB4 802B6194 00000000 */   nop
glabel func_802B6198
/* E24AB8 802B6198 C7A00010 */  lwc1      $f0, 0x10($sp)
/* E24ABC 802B619C E6000080 */  swc1      $f0, 0x80($s0)
.L802B61A0:
/* E24AC0 802B61A0 0C0397DA */  jal       update_locomotion_state
.L802B61A4:
/* E24AC4 802B61A4 00000000 */   nop
.L802B61A8:
/* E24AC8 802B61A8 8FBF0024 */  lw        $ra, 0x24($sp)
.L802B61AC:
/* E24ACC 802B61AC 8FB20020 */  lw        $s2, 0x20($sp)
.L802B61B0:
/* E24AD0 802B61B0 8FB1001C */  lw        $s1, 0x1C($sp)
.L802B61B4:
/* E24AD4 802B61B4 8FB00018 */  lw        $s0, 0x18($sp)
/* E24AD8 802B61B8 03E00008 */  jr        $ra
/* E24ADC 802B61BC 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void action_update_land(void) {
    CollisionStatus* collisionStatus = &gCollisionStatus;
    PlayerStatus* playerStatus = &gPlayerStatus;
    Camera* camera = &gCameras[CAM_DEFAULT];
    f32 inputMoveMagnitude;
    f32 inputMoveAngle;
    s32 jumpInputCheck;
    AnimID anim;

    if (playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) {
        action_update_peach_land();
        return;
    }

    if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
        playerStatus->flags &= ~(
            PS_FLAG_ACTION_STATE_CHANGED |
            PS_FLAG_SCRIPTED_FALL |
            PS_FLAG_ARMS_RAISED |
            PS_FLAG_AIRBORNE
        );
        playerStatus->actionSubstate = SUBSTATE_INIT;
        playerStatus->timeInAir = 0;
        playerStatus->peakJumpTime = 0;
        playerStatus->landPos.x = playerStatus->position.x;
        playerStatus->landPos.z = playerStatus->position.z;

        if (playerStatus->animFlags & PA_FLAG_8BIT_MARIO) {
            anim = ANIM_MarioW3_8bit_Still;
        } else if (!(playerStatus->animFlags & PA_FLAG_USING_WATT)) {
            anim = ANIM_Mario1_Land;
        } else {
            anim = ANIM_MarioW1_LandWatt;
        }

        suggest_player_anim_allow_backward(anim);
        sfx_play_sound_at_player(SOUND_161 | SOUND_ID_STOP, SOUND_SPACE_MODE_0);
        sfx_play_sound_at_player(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0);

        if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) {
            phys_adjust_cam_on_landing();
        }

        collisionStatus->lastTouchedFloor = -1;
        playerStatus->animFlags &= ~PA_FLAG_INTERRUPT_SPIN;
        camera->moveFlags &= ~CAMERA_MOVE_FLAG_4;
    }
    playerStatus->actionSubstate++; // SUBSTATE_DONE
    playerStatus->currentSpeed *= 0.6f;

    player_input_to_move_vector(&inputMoveAngle, &inputMoveMagnitude);
    jumpInputCheck = check_input_jump();

    if (jumpInputCheck != 0 || jumpInputCheck < playerStatus->actionSubstate) {
        if (inputMoveMagnitude == 0.0f) {
            set_action_state(ACTION_STATE_IDLE);
            return;
        }
        if (inputMoveMagnitude != 0.0f) {
            playerStatus->targetYaw = inputMoveAngle;
        }
        update_locomotion_state();
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel evt_get_float_variable
/* ECDDC 802C842C 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* ECDE0 802C8430 3C02EFE8 */  lui       $v0, (0xEFE82080 >> 16)
/* ECDE4 802C8434 34422080 */  ori       $v0, $v0, (0xEFE82080 & 0xFFFF)
/* ECDE8 802C8438 0045102A */  slt       $v0, $v0, $a1
/* ECDEC 802C843C 10400006 */  beqz      $v0, .L802C8458
/* ECDF0 802C8440 AFBF0010 */   sw       $ra, 0x10($sp)
/* ECDF4 802C8444 3C02F119 */  lui       $v0, (0xF1194D80 >> 16)
/* ECDF8 802C8448 34424D80 */  ori       $v0, $v0, (0xF1194D80 & 0xFFFF)
/* ECDFC 802C844C 0045102A */  slt       $v0, $v0, $a1
/* ECE00 802C8450 14400005 */  bnez      $v0, .L802C8468
/* ECE04 802C8454 3C02F2E3 */   lui      $v0, (0xF2E31100 >> 16)
.L802C8458:
/* ECE08 802C8458 44850000 */  mtc1      $a1, $f0
/* ECE0C 802C845C 00000000 */  nop
/* ECE10 802C8460 080B218D */  j         .L802C8634
/* ECE14 802C8464 46800020 */   cvt.s.w  $f0, $f0
.L802C8468:
/* ECE18 802C8468 34421100 */  ori       $v0, $v0, (0xF2E31100 & 0xFFFF)
/* ECE1C 802C846C 0045102A */  slt       $v0, $v0, $a1
/* ECE20 802C8470 14400003 */  bnez      $v0, .L802C8480
/* ECE24 802C8474 3C02F545 */   lui      $v0, (0xF5456B00 >> 16)
/* ECE28 802C8478 080B218B */  j         .L802C862C
/* ECE2C 802C847C 00A0202D */   daddu    $a0, $a1, $zero
.L802C8480:
/* ECE30 802C8480 34426B00 */  ori       $v0, $v0, (0xF5456B00 & 0xFFFF)
/* ECE34 802C8484 0045102A */  slt       $v0, $v0, $a1
/* ECE38 802C8488 14400009 */  bnez      $v0, .L802C84B0
/* ECE3C 802C848C 3C02F676 */   lui      $v0, (0xF6769800 >> 16)
/* ECE40 802C8490 3C020B53 */  lui       $v0, (0xB532B80 >> 16)
/* ECE44 802C8494 34422B80 */  ori       $v0, $v0, (0xB532B80 & 0xFFFF)
/* ECE48 802C8498 00A22821 */  addu      $a1, $a1, $v0
/* ECE4C 802C849C 8C83013C */  lw        $v1, 0x13C($a0)
/* ECE50 802C84A0 00051080 */  sll       $v0, $a1, 2
/* ECE54 802C84A4 00431021 */  addu      $v0, $v0, $v1
/* ECE58 802C84A8 080B218B */  j         .L802C862C
/* ECE5C 802C84AC 8C440000 */   lw       $a0, 0x0($v0)
.L802C84B0:
/* ECE60 802C84B0 34429800 */  ori       $v0, $v0, (0xF6769800 & 0xFFFF)
/* ECE64 802C84B4 0045102A */  slt       $v0, $v0, $a1
/* ECE68 802C84B8 14400007 */  bnez      $v0, .L802C84D8
/* ECE6C 802C84BC 3C02F7A7 */   lui      $v0, (0xF7A7C500 >> 16)
/* ECE70 802C84C0 3C040A21 */  lui       $a0, (0xA21FE80 >> 16)
/* ECE74 802C84C4 3484FE80 */  ori       $a0, $a0, (0xA21FE80 & 0xFFFF)
/* ECE78 802C84C8 0C05154E */  jal       get_global_byte
/* ECE7C 802C84CC 00A42021 */   addu     $a0, $a1, $a0
/* ECE80 802C84D0 080B218B */  j         .L802C862C
/* ECE84 802C84D4 0040202D */   daddu    $a0, $v0, $zero
.L802C84D8:
/* ECE88 802C84D8 3442C500 */  ori       $v0, $v0, (0xF7A7C500 & 0xFFFF)
/* ECE8C 802C84DC 0045102A */  slt       $v0, $v0, $a1
/* ECE90 802C84E0 14400007 */  bnez      $v0, .L802C8500
/* ECE94 802C84E4 3C02FB3B */   lui      $v0, (0xFB3B4C00 >> 16)
/* ECE98 802C84E8 3C0408F0 */  lui       $a0, (0x8F0D180 >> 16)
/* ECE9C 802C84EC 3484D180 */  ori       $a0, $a0, (0x8F0D180 & 0xFFFF)
/* ECEA0 802C84F0 0C051594 */  jal       get_area_byte
/* ECEA4 802C84F4 00A42021 */   addu     $a0, $a1, $a0
/* ECEA8 802C84F8 080B218B */  j         .L802C862C
/* ECEAC 802C84FC 0040202D */   daddu    $a0, $v0, $zero
.L802C8500:
/* ECEB0 802C8500 34424C00 */  ori       $v0, $v0, (0xFB3B4C00 & 0xFFFF)
/* ECEB4 802C8504 0045102A */  slt       $v0, $v0, $a1
/* ECEB8 802C8508 14400015 */  bnez      $v0, .L802C8560
/* ECEBC 802C850C 3C02FC6C */   lui      $v0, (0xFC6C7900 >> 16)
/* ECEC0 802C8510 3C02055D */  lui       $v0, (0x55D4A80 >> 16)
/* ECEC4 802C8514 34424A80 */  ori       $v0, $v0, (0x55D4A80 & 0xFFFF)
/* ECEC8 802C8518 00A22821 */  addu      $a1, $a1, $v0
/* ECECC 802C851C 04A10002 */  bgez      $a1, .L802C8528
/* ECED0 802C8520 00A0182D */   daddu    $v1, $a1, $zero
/* ECED4 802C8524 24A3001F */  addiu     $v1, $a1, 0x1F
.L802C8528:
/* ECED8 802C8528 00033143 */  sra       $a2, $v1, 5
/* ECEDC 802C852C 00C0182D */  daddu     $v1, $a2, $zero
/* ECEE0 802C8530 00031140 */  sll       $v0, $v1, 5
/* ECEE4 802C8534 00A23023 */  subu      $a2, $a1, $v0
/* ECEE8 802C8538 00031880 */  sll       $v1, $v1, 2
/* ECEEC 802C853C 3C02802E */  lui       $v0, %hi(gMapFlags)
/* ECEF0 802C8540 8C42A480 */  lw        $v0, %lo(gMapFlags)($v0)
/* ECEF4 802C8544 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* ECEF8 802C8548 44810000 */  mtc1      $at, $f0
/* ECEFC 802C854C 00621821 */  addu      $v1, $v1, $v0
/* ECF00 802C8550 24020001 */  addiu     $v0, $zero, 0x1
/* ECF04 802C8554 8C630000 */  lw        $v1, 0x0($v1)
/* ECF08 802C8558 080B216D */  j         .L802C85B4
/* ECF0C 802C855C 00C21004 */   sllv     $v0, $v0, $a2
.L802C8560:
/* ECF10 802C8560 34427900 */  ori       $v0, $v0, (0xFC6C7900 & 0xFFFF)
/* ECF14 802C8564 0045102A */  slt       $v0, $v0, $a1
/* ECF18 802C8568 14400018 */  bnez      $v0, .L802C85CC
/* ECF1C 802C856C 3C02FD9D */   lui      $v0, (0xFD9DA600 >> 16)
/* ECF20 802C8570 3C02042C */  lui       $v0, (0x42C1D80 >> 16)
/* ECF24 802C8574 34421D80 */  ori       $v0, $v0, (0x42C1D80 & 0xFFFF)
/* ECF28 802C8578 00A22821 */  addu      $a1, $a1, $v0
/* ECF2C 802C857C 04A10002 */  bgez      $a1, .L802C8588
/* ECF30 802C8580 00A0182D */   daddu    $v1, $a1, $zero
/* ECF34 802C8584 24A3001F */  addiu     $v1, $a1, 0x1F
.L802C8588:
/* ECF38 802C8588 00033143 */  sra       $a2, $v1, 5
/* ECF3C 802C858C 00C0182D */  daddu     $v1, $a2, $zero
/* ECF40 802C8590 00031140 */  sll       $v0, $v1, 5
/* ECF44 802C8594 00A23023 */  subu      $a2, $a1, $v0
/* ECF48 802C8598 00031880 */  sll       $v1, $v1, 2
/* ECF4C 802C859C 00831821 */  addu      $v1, $a0, $v1
/* ECF50 802C85A0 24020001 */  addiu     $v0, $zero, 0x1
/* ECF54 802C85A4 00C21004 */  sllv      $v0, $v0, $a2
/* ECF58 802C85A8 8C6300C4 */  lw        $v1, 0xC4($v1)
/* ECF5C 802C85AC 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* ECF60 802C85B0 44810000 */  mtc1      $at, $f0
.L802C85B4:
/* ECF64 802C85B4 00622824 */  and       $a1, $v1, $v0
/* ECF68 802C85B8 14A0001E */  bnez      $a1, .L802C8634
/* ECF6C 802C85BC 00000000 */   nop
/* ECF70 802C85C0 44800000 */  mtc1      $zero, $f0
/* ECF74 802C85C4 080B218D */  j         .L802C8634
/* ECF78 802C85C8 00000000 */   nop
.L802C85CC:
/* ECF7C 802C85CC 3442A600 */  ori       $v0, $v0, (0xFD9DA600 & 0xFFFF)
/* ECF80 802C85D0 0045102A */  slt       $v0, $v0, $a1
/* ECF84 802C85D4 1440000A */  bnez      $v0, .L802C8600
/* ECF88 802C85D8 3C02FECE */   lui      $v0, (0xFECED300 >> 16)
/* ECF8C 802C85DC 3C0202FA */  lui       $v0, (0x2FAF080 >> 16)
/* ECF90 802C85E0 3442F080 */  ori       $v0, $v0, (0x2FAF080 & 0xFFFF)
/* ECF94 802C85E4 00A22821 */  addu      $a1, $a1, $v0
/* ECF98 802C85E8 3C03802E */  lui       $v1, %hi(gMapVars)
/* ECF9C 802C85EC 8C63A484 */  lw        $v1, %lo(gMapVars)($v1)
/* ECFA0 802C85F0 00051080 */  sll       $v0, $a1, 2
/* ECFA4 802C85F4 00431021 */  addu      $v0, $v0, $v1
/* ECFA8 802C85F8 080B218B */  j         .L802C862C
/* ECFAC 802C85FC 8C440000 */   lw       $a0, 0x0($v0)
.L802C8600:
/* ECFB0 802C8600 3442D300 */  ori       $v0, $v0, (0xFECED300 & 0xFFFF)
/* ECFB4 802C8604 0045102A */  slt       $v0, $v0, $a1
/* ECFB8 802C8608 10400003 */  beqz      $v0, .L802C8618
/* ECFBC 802C860C 3C0201C9 */   lui      $v0, (0x1C9C380 >> 16)
/* ECFC0 802C8610 080B218B */  j         .L802C862C
/* ECFC4 802C8614 00A0202D */   daddu    $a0, $a1, $zero
.L802C8618:
/* ECFC8 802C8618 3442C380 */  ori       $v0, $v0, (0x1C9C380 & 0xFFFF)
/* ECFCC 802C861C 00A22821 */  addu      $a1, $a1, $v0
/* ECFD0 802C8620 00051080 */  sll       $v0, $a1, 2
/* ECFD4 802C8624 00821021 */  addu      $v0, $a0, $v0
/* ECFD8 802C8628 8C440084 */  lw        $a0, 0x84($v0)
.L802C862C:
/* ECFDC 802C862C 0C0B1248 */  jal       evt_fixed_var_to_float
/* ECFE0 802C8630 00000000 */   nop
.L802C8634:
/* ECFE4 802C8634 8FBF0010 */  lw        $ra, 0x10($sp)
/* ECFE8 802C8638 03E00008 */  jr        $ra
/* ECFEC 802C863C 27BD0018 */   addiu    $sp, $sp, 0x18

### DECOMPILED C INSTRUCTIONS:

f32 evt_get_float_variable(Evt* script, Bytecode var) {
    s32 temp;

    if (var <= EVT_LIMIT) {
        return var;
    } else if (var <= EVT_IGNORE_ARG) {
        return var;
    } else if (var <= EVT_FIXED_CUTOFF) {
        return evt_fixed_var_to_float(var);
    } else if (var <= EVT_ARRAY_VAR_CUTOFF) {
        var = EVT_INDEX_OF_ARRAY_VAR(var);
        return evt_fixed_var_to_float(script->array[var]);
    } else if (var <= EVT_GAME_BYTE_CUTOFF) {
        var = EVT_INDEX_OF_GAME_BYTE(var);
        return evt_fixed_var_to_float(get_global_byte(var));
    } else if (var <= EVT_AREA_BYTE_CUTOFF) {
        var = EVT_INDEX_OF_AREA_BYTE(var);
        return evt_fixed_var_to_float(get_area_byte(var));
    } else if (var <= EVT_MAP_FLAG_CUTOFF) {
        var = EVT_INDEX_OF_MAP_FLAG(var);
        temp = var % 32;
        var = gMapFlags[var / 32] & (1 << temp);
        if (var) {
            return 1.0f;
        } else {
            return 0.0f;
        }
    } else if (var <= EVT_LOCAL_FLAG_CUTOFF) {
        var = EVT_INDEX_OF_LOCAL_FLAG(var);
        temp = var % 32;
        var = script->varFlags[var / 32] & (1 << temp);
        if (var) {
            return 1.0f;
        } else {
            return 0.0f;
        }
    } else if (var <= EVT_MAP_VAR_CUTOFF) {
        var = EVT_INDEX_OF_MAP_VAR(var);
        return evt_fixed_var_to_float(gMapVars[var]);
    } else if (var <= EVT_LOCAL_VAR_CUTOFF) {
        var = EVT_INDEX_OF_LOCAL_VAR(var);
        return evt_fixed_var_to_float(script->varTable[var]);
    } else {
        return evt_fixed_var_to_float(var);
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel sfx_compute_spatialized_sound_params_1
/* E08B4 8014A1B4 27BDFFC0 */  addiu     $sp, $sp, -0x40
/* E08B8 8014A1B8 AFB00030 */  sw        $s0, 0x30($sp)
/* E08BC 8014A1BC 00E0802D */  daddu     $s0, $a3, $zero
/* E08C0 8014A1C0 AFB20038 */  sw        $s2, 0x38($sp)
/* E08C4 8014A1C4 8FB20050 */  lw        $s2, 0x50($sp)
/* E08C8 8014A1C8 27A20020 */  addiu     $v0, $sp, 0x20
/* E08CC 8014A1CC AFA20010 */  sw        $v0, 0x10($sp)
/* E08D0 8014A1D0 27A20024 */  addiu     $v0, $sp, 0x24
/* E08D4 8014A1D4 AFA20014 */  sw        $v0, 0x14($sp)
/* E08D8 8014A1D8 27A20028 */  addiu     $v0, $sp, 0x28
/* E08DC 8014A1DC 44860000 */  mtc1      $a2, $f0
/* E08E0 8014A1E0 3C048007 */  lui       $a0, %hi(gCurrentCameraID)
/* E08E4 8014A1E4 8C847410 */  lw        $a0, %lo(gCurrentCameraID)($a0)
/* E08E8 8014A1E8 44067000 */  mfc1      $a2, $f14
/* E08EC 8014A1EC 3C05800B */  lui       $a1, %hi(gCameras)
/* E08F0 8014A1F0 24A51D80 */  addiu     $a1, $a1, %lo(gCameras)
/* E08F4 8014A1F4 AFB10034 */  sw        $s1, 0x34($sp)
/* E08F8 8014A1F8 AFA20018 */  sw        $v0, 0x18($sp)
/* E08FC 8014A1FC 00041080 */  sll       $v0, $a0, 2
/* E0900 8014A200 00441021 */  addu      $v0, $v0, $a0
/* E0904 8014A204 00021080 */  sll       $v0, $v0, 2
/* E0908 8014A208 00441023 */  subu      $v0, $v0, $a0
/* E090C 8014A20C 000218C0 */  sll       $v1, $v0, 3
/* E0910 8014A210 00431021 */  addu      $v0, $v0, $v1
/* E0914 8014A214 000210C0 */  sll       $v0, $v0, 3
/* E0918 8014A218 00458821 */  addu      $s1, $v0, $a1
/* E091C 8014A21C 44056000 */  mfc1      $a1, $f12
/* E0920 8014A220 44070000 */  mfc1      $a3, $f0
/* E0924 8014A224 AFBF003C */  sw        $ra, 0x3C($sp)
/* E0928 8014A228 0C00B94E */  jal       get_screen_coords
/* E092C 8014A22C 00000000 */   nop
/* E0930 8014A230 8FA20020 */  lw        $v0, 0x20($sp)
/* E0934 8014A234 24420BB8 */  addiu     $v0, $v0, 0xBB8
/* E0938 8014A238 2C421771 */  sltiu     $v0, $v0, 0x1771
/* E093C 8014A23C 10400008 */  beqz      $v0, .L8014A260
/* E0940 8014A240 24020001 */   addiu    $v0, $zero, 0x1
/* E0944 8014A244 8FA30024 */  lw        $v1, 0x24($sp)
/* E0948 8014A248 28620BB9 */  slti      $v0, $v1, 0xBB9
/* E094C 8014A24C 10400003 */  beqz      $v0, .L8014A25C
/* E0950 8014A250 2862F448 */   slti     $v0, $v1, -0xBB8
/* E0954 8014A254 10400005 */  beqz      $v0, .L8014A26C
/* E0958 8014A258 2405007F */   addiu    $a1, $zero, 0x7F
.L8014A25C:
/* E095C 8014A25C 24020001 */  addiu     $v0, $zero, 0x1
.L8014A260:
/* E0960 8014A260 A6020000 */  sh        $v0, 0x0($s0)
/* E0964 8014A264 08052903 */  j         .L8014A40C
/* E0968 8014A268 A6400000 */   sh       $zero, 0x0($s2)
.L8014A26C:
/* E096C 8014A26C A6050000 */  sh        $a1, 0x0($s0)
/* E0970 8014A270 8FA20020 */  lw        $v0, 0x20($sp)
/* E0974 8014A274 04410012 */  bgez      $v0, .L8014A2C0
/* E0978 8014A278 00000000 */   nop
/* E097C 8014A27C 3C013E99 */  lui       $at, (0x3E99999A >> 16)
/* E0980 8014A280 3421999A */  ori       $at, $at, (0x3E99999A & 0xFFFF)
/* E0984 8014A284 44811000 */  mtc1      $at, $f2
/* E0988 8014A288 44820000 */  mtc1      $v0, $f0
/* E098C 8014A28C 00000000 */  nop
/* E0990 8014A290 46800020 */  cvt.s.w   $f0, $f0
/* E0994 8014A294 46020002 */  mul.s     $f0, $f0, $f2
/* E0998 8014A298 00000000 */  nop
/* E099C 8014A29C 3C0142FE */  lui       $at, (0x42FE0000 >> 16)
/* E09A0 8014A2A0 44811000 */  mtc1      $at, $f2
/* E09A4 8014A2A4 00000000 */  nop
/* E09A8 8014A2A8 46020000 */  add.s     $f0, $f0, $f2
/* E09AC 8014A2AC 4600018D */  trunc.w.s $f6, $f0
/* E09B0 8014A2B0 44023000 */  mfc1      $v0, $f6
/* E09B4 8014A2B4 00000000 */  nop
/* E09B8 8014A2B8 A6020000 */  sh        $v0, 0x0($s0)
/* E09BC 8014A2BC AFA00020 */  sw        $zero, 0x20($sp)
.L8014A2C0:
/* E09C0 8014A2C0 8624000A */  lh        $a0, 0xA($s1)
/* E09C4 8014A2C4 8FA30020 */  lw        $v1, 0x20($sp)
/* E09C8 8014A2C8 0083102A */  slt       $v0, $a0, $v1
/* E09CC 8014A2CC 10400013 */  beqz      $v0, .L8014A31C
/* E09D0 8014A2D0 00641023 */   subu     $v0, $v1, $a0
/* E09D4 8014A2D4 3C013E99 */  lui       $at, (0x3E99999A >> 16)
/* E09D8 8014A2D8 3421999A */  ori       $at, $at, (0x3E99999A & 0xFFFF)
/* E09DC 8014A2DC 44810000 */  mtc1      $at, $f0
/* E09E0 8014A2E0 44821000 */  mtc1      $v0, $f2
/* E09E4 8014A2E4 00000000 */  nop
/* E09E8 8014A2E8 468010A0 */  cvt.s.w   $f2, $f2
/* E09EC 8014A2EC 46001082 */  mul.s     $f2, $f2, $f0
/* E09F0 8014A2F0 00000000 */  nop
/* E09F4 8014A2F4 3C0142FE */  lui       $at, (0x42FE0000 >> 16)
/* E09F8 8014A2F8 44810000 */  mtc1      $at, $f0
/* E09FC 8014A2FC 00000000 */  nop
/* E0A00 8014A300 46020001 */  sub.s     $f0, $f0, $f2
/* E0A04 8014A304 4600018D */  trunc.w.s $f6, $f0
/* E0A08 8014A308 44023000 */  mfc1      $v0, $f6
/* E0A0C 8014A30C 00000000 */  nop
/* E0A10 8014A310 A6020000 */  sh        $v0, 0x0($s0)
/* E0A14 8014A314 8622000A */  lh        $v0, 0xA($s1)
/* E0A18 8014A318 AFA20020 */  sw        $v0, 0x20($sp)
.L8014A31C:
/* E0A1C 8014A31C 24031388 */  addiu     $v1, $zero, 0x1388
/* E0A20 8014A320 8FA20028 */  lw        $v0, 0x28($sp)
/* E0A24 8014A324 3C01447A */  lui       $at, (0x447A0000 >> 16)
/* E0A28 8014A328 44811000 */  mtc1      $at, $f2
/* E0A2C 8014A32C 00621823 */  subu      $v1, $v1, $v0
/* E0A30 8014A330 44830000 */  mtc1      $v1, $f0
/* E0A34 8014A334 00000000 */  nop
/* E0A38 8014A338 46800020 */  cvt.s.w   $f0, $f0
/* E0A3C 8014A33C 46000005 */  abs.s     $f0, $f0
/* E0A40 8014A340 4600103C */  c.lt.s    $f2, $f0
/* E0A44 8014A344 00000000 */  nop
/* E0A48 8014A348 45030001 */  bc1tl     .L8014A350
/* E0A4C 8014A34C 46001006 */   mov.s    $f0, $f2
.L8014A350:
/* E0A50 8014A350 3C0144BB */  lui       $at, (0x44BB8000 >> 16)
/* E0A54 8014A354 34218000 */  ori       $at, $at, (0x44BB8000 & 0xFFFF)
/* E0A58 8014A358 44811000 */  mtc1      $at, $f2
/* E0A5C 8014A35C 86020000 */  lh        $v0, 0x0($s0)
/* E0A60 8014A360 46001081 */  sub.s     $f2, $f2, $f0
/* E0A64 8014A364 44820000 */  mtc1      $v0, $f0
/* E0A68 8014A368 00000000 */  nop
/* E0A6C 8014A36C 46800020 */  cvt.s.w   $f0, $f0
/* E0A70 8014A370 46020002 */  mul.s     $f0, $f0, $f2
/* E0A74 8014A374 00000000 */  nop
/* E0A78 8014A378 3C013A83 */  lui       $at, (0x3A83126F >> 16)
/* E0A7C 8014A37C 3421126F */  ori       $at, $at, (0x3A83126F & 0xFFFF)
/* E0A80 8014A380 44811000 */  mtc1      $at, $f2
/* E0A84 8014A384 00000000 */  nop
/* E0A88 8014A388 46020002 */  mul.s     $f0, $f0, $f2
/* E0A8C 8014A38C 00000000 */  nop
/* E0A90 8014A390 4600018D */  trunc.w.s $f6, $f0
/* E0A94 8014A394 44023000 */  mfc1      $v0, $f6
/* E0A98 8014A398 00000000 */  nop
/* E0A9C 8014A39C A6020000 */  sh        $v0, 0x0($s0)
/* E0AA0 8014A3A0 00021400 */  sll       $v0, $v0, 16
/* E0AA4 8014A3A4 00021403 */  sra       $v0, $v0, 16
/* E0AA8 8014A3A8 28420080 */  slti      $v0, $v0, 0x80
/* E0AAC 8014A3AC 50400001 */  beql      $v0, $zero, .L8014A3B4
/* E0AB0 8014A3B0 A6050000 */   sh       $a1, 0x0($s0)
.L8014A3B4:
/* E0AB4 8014A3B4 86020000 */  lh        $v0, 0x0($s0)
/* E0AB8 8014A3B8 1C400002 */  bgtz      $v0, .L8014A3C4
/* E0ABC 8014A3BC 24020001 */   addiu    $v0, $zero, 0x1
/* E0AC0 8014A3C0 A6020000 */  sh        $v0, 0x0($s0)
.L8014A3C4:
/* E0AC4 8014A3C4 3C014280 */  lui       $at, (0x42800000 >> 16)
/* E0AC8 8014A3C8 44811000 */  mtc1      $at, $f2
/* E0ACC 8014A3CC C7A00020 */  lwc1      $f0, 0x20($sp)
/* E0AD0 8014A3D0 46800020 */  cvt.s.w   $f0, $f0
/* E0AD4 8014A3D4 46020002 */  mul.s     $f0, $f0, $f2
/* E0AD8 8014A3D8 00000000 */  nop
/* E0ADC 8014A3DC 8622000A */  lh        $v0, 0xA($s1)
/* E0AE0 8014A3E0 3C014200 */  lui       $at, (0x42000000 >> 16)
/* E0AE4 8014A3E4 44812000 */  mtc1      $at, $f4
/* E0AE8 8014A3E8 44821000 */  mtc1      $v0, $f2
/* E0AEC 8014A3EC 00000000 */  nop
/* E0AF0 8014A3F0 468010A0 */  cvt.s.w   $f2, $f2
/* E0AF4 8014A3F4 46020003 */  div.s     $f0, $f0, $f2
/* E0AF8 8014A3F8 46040000 */  add.s     $f0, $f0, $f4
/* E0AFC 8014A3FC 4600018D */  trunc.w.s $f6, $f0
/* E0B00 8014A400 44023000 */  mfc1      $v0, $f6
/* E0B04 8014A404 00000000 */  nop
/* E0B08 8014A408 A6420000 */  sh        $v0, 0x0($s2)
.L8014A40C:
/* E0B0C 8014A40C 8FBF003C */  lw        $ra, 0x3C($sp)
/* E0B10 8014A410 8FB20038 */  lw        $s2, 0x38($sp)
/* E0B14 8014A414 8FB10034 */  lw        $s1, 0x34($sp)
/* E0B18 8014A418 8FB00030 */  lw        $s0, 0x30($sp)
/* E0B1C 8014A41C 03E00008 */  jr        $ra
/* E0B20 8014A420 27BD0040 */   addiu    $sp, $sp, 0x40
/* E0B24 8014A424 00000000 */  nop
/* E0B28 8014A428 00000000 */  nop
/* E0B2C 8014A42C 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void sfx_compute_spatialized_sound_params_1(f32 x, f32 y, f32 z, s16* volume, s16* pan) {
    Camera* camera = &gCameras[gCurrentCameraID];
    s32 screenX, screenY, screenZ;
    f32 depth;

    get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ);

    if (screenX > 3000 || screenX < -3000 || screenY > 3000 || screenY < -3000) {
        *volume = 1;
        *pan = 0;
        return;
    }

    *volume = 127;
    if (screenX < 0) {
        *volume = (screenX * 0.3f) + 127.0f;
        screenX = 0;
    }

    if (camera->viewportW < screenX) {
        *volume = 127.0f - ((screenX - camera->viewportW) * 0.3f);
        screenX = camera->viewportW;
    }

    depth = fabsf(5000 - screenZ);
    if (depth > 1000.0f) {
        depth = 1000.0f;
    }

    *volume = *volume * (1500.0f - depth) * 0.001f;
    if (*volume > 127) {
        *volume = 127;
    }
    if (*volume < 1) {
        *volume = 1;
    }

    *pan = ((screenX * 64.0f) / camera->viewportW) + 32.0f;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel explosion_update
/* 343858 E00321D8 27BDFFD8 */  addiu     $sp, $sp, -0x28
/* 34385C E00321DC AFBF0024 */  sw        $ra, 0x24($sp)
/* 343860 E00321E0 AFB20020 */  sw        $s2, 0x20($sp)
/* 343864 E00321E4 AFB1001C */  sw        $s1, 0x1C($sp)
/* 343868 E00321E8 AFB00018 */  sw        $s0, 0x18($sp)
/* 34386C E00321EC 8C90000C */  lw        $s0, 0xC($a0)
/* 343870 E00321F0 8E020030 */  lw        $v0, 0x30($s0)
/* 343874 E00321F4 2442FFFF */  addiu     $v0, $v0, -0x1
/* 343878 E00321F8 04410005 */  bgez      $v0, .LE0032210
/* 34387C E00321FC AE020030 */   sw       $v0, 0x30($s0)
/* 343880 E0032200 0C080128 */  jal       shim_remove_effect
/* 343884 E0032204 00000000 */   nop
/* 343888 E0032208 0800C902 */  j         .LE0032408
/* 34388C E003220C 00000000 */   nop
.LE0032210:
/* 343890 E0032210 8E020034 */  lw        $v0, 0x34($s0)
/* 343894 E0032214 8E110000 */  lw        $s1, 0x0($s0)
/* 343898 E0032218 24420001 */  addiu     $v0, $v0, 0x1
/* 34389C E003221C 0040902D */  daddu     $s2, $v0, $zero
/* 3438A0 E0032220 AE020034 */  sw        $v0, 0x34($s0)
/* 3438A4 E0032224 24020007 */  addiu     $v0, $zero, 0x7
/* 3438A8 E0032228 1642000A */  bne       $s2, $v0, .LE0032254
/* 3438AC E003222C 24020001 */   addiu    $v0, $zero, 0x1
/* 3438B0 E0032230 0C080150 */  jal       shim_load_effect
/* 3438B4 E0032234 24040017 */   addiu    $a0, $zero, 0x17
/* 3438B8 E0032238 8E050004 */  lw        $a1, 0x4($s0)
/* 3438BC E003223C 8E060008 */  lw        $a2, 0x8($s0)
/* 3438C0 E0032240 8E07000C */  lw        $a3, 0xC($s0)
/* 3438C4 E0032244 0C00B800 */  jal       smoke_ring_main
/* 3438C8 E0032248 0220202D */   daddu    $a0, $s1, $zero
/* 3438CC E003224C 0800C8A4 */  j         .LE0032290
/* 3438D0 E0032250 2610003C */   addiu    $s0, $s0, 0x3C
.LE0032254:
/* 3438D4 E0032254 5642000E */  bnel      $s2, $v0, .LE0032290
/* 3438D8 E0032258 2610003C */   addiu    $s0, $s0, 0x3C
/* 3438DC E003225C 0C080150 */  jal       shim_load_effect
/* 3438E0 E0032260 24040044 */   addiu    $a0, $zero, 0x44
/* 3438E4 E0032264 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3438E8 E0032268 44810000 */  mtc1      $at, $f0
/* 3438EC E003226C 24020032 */  addiu     $v0, $zero, 0x32
/* 3438F0 E0032270 AFA20014 */  sw        $v0, 0x14($sp)
/* 3438F4 E0032274 E7A00010 */  swc1      $f0, 0x10($sp)
/* 3438F8 E0032278 8E050004 */  lw        $a1, 0x4($s0)
/* 3438FC E003227C 8E060008 */  lw        $a2, 0x8($s0)
/* 343900 E0032280 8E07000C */  lw        $a3, 0xC($s0)
/* 343904 E0032284 0C02205F */  jal       confetti_main
/* 343908 E0032288 26240004 */   addiu    $a0, $s1, 0x4
/* 34390C E003228C 2610003C */  addiu     $s0, $s0, 0x3C
.LE0032290:
/* 343910 E0032290 C6000020 */  lwc1      $f0, 0x20($s0)
/* 343914 E0032294 C6020024 */  lwc1      $f2, 0x24($s0)
/* 343918 E0032298 46020000 */  add.s     $f0, $f0, $f2
/* 34391C E003229C 26030024 */  addiu     $v1, $s0, 0x24
/* 343920 E00322A0 2A420008 */  slti      $v0, $s2, 0x8
/* 343924 E00322A4 1040001D */  beqz      $v0, .LE003231C
/* 343928 E00322A8 E6000020 */   swc1     $f0, 0x20($s0)
/* 34392C E00322AC 46001006 */  mov.s     $f0, $f2
/* 343930 E00322B0 460000A1 */  cvt.d.s   $f2, $f0
/* 343934 E00322B4 24020002 */  addiu     $v0, $zero, 0x2
/* 343938 E00322B8 3C01E003 */  lui       $at, (0xE00328C0 >> 16)
/* 34393C E00322BC D42028C0 */  ldc1      $f0, (0xE00328C0 & 0xFFFF)($at)
/* 343940 E00322C0 56220006 */  bnel      $s1, $v0, .LE00322DC
/* 343944 E00322C4 46201000 */   add.d    $f0, $f2, $f0
/* 343948 E00322C8 3C013FF0 */  lui       $at, (0x3FF00000 >> 16)
/* 34394C E00322CC 44810800 */  mtc1      $at, $f1
/* 343950 E00322D0 44800000 */  mtc1      $zero, $f0
/* 343954 E00322D4 00000000 */  nop
/* 343958 E00322D8 46201000 */  add.d     $f0, $f2, $f0
.LE00322DC:
/* 34395C E00322DC 46200020 */  cvt.s.d   $f0, $f0
/* 343960 E00322E0 240200FF */  addiu     $v0, $zero, 0xFF
/* 343964 E00322E4 E4600000 */  swc1      $f0, 0x0($v1)
/* 343968 E00322E8 8E030038 */  lw        $v1, 0x38($s0)
/* 34396C E00322EC 3C01E003 */  lui       $at, (0xE00328C8 >> 16)
/* 343970 E00322F0 D42228C8 */  ldc1      $f2, (0xE00328C8 & 0xFFFF)($at)
/* 343974 E00322F4 00431023 */  subu      $v0, $v0, $v1
/* 343978 E00322F8 44820000 */  mtc1      $v0, $f0
/* 34397C E00322FC 00000000 */  nop
/* 343980 E0032300 46800021 */  cvt.d.w   $f0, $f0
/* 343984 E0032304 46220002 */  mul.d     $f0, $f0, $f2
/* 343988 E0032308 00000000 */  nop
/* 34398C E003230C 4620018D */  trunc.w.d $f6, $f0
/* 343990 E0032310 E6060038 */  swc1      $f6, 0x38($s0)
/* 343994 E0032314 0800C8D8 */  j         .LE0032360
/* 343998 E0032318 2610003C */   addiu    $s0, $s0, 0x3C
.LE003231C:
/* 34399C E003231C 3C01E003 */  lui       $at, (0xE00328D0 >> 16)
/* 3439A0 E0032320 D42028D0 */  ldc1      $f0, (0xE00328D0 & 0xFFFF)($at)
/* 3439A4 E0032324 C6020038 */  lwc1      $f2, 0x38($s0)
/* 3439A8 E0032328 468010A1 */  cvt.d.w   $f2, $f2
/* 3439AC E003232C 46201082 */  mul.d     $f2, $f2, $f0
/* 3439B0 E0032330 00000000 */  nop
/* 3439B4 E0032334 C6000024 */  lwc1      $f0, 0x24($s0)
/* 3439B8 E0032338 3C01E003 */  lui       $at, (0xE00328D8 >> 16)
/* 3439BC E003233C D42428D8 */  ldc1      $f4, (0xE00328D8 & 0xFFFF)($at)
/* 3439C0 E0032340 46000021 */  cvt.d.s   $f0, $f0
/* 3439C4 E0032344 46240002 */  mul.d     $f0, $f0, $f4
/* 3439C8 E0032348 00000000 */  nop
/* 3439CC E003234C 4620118D */  trunc.w.d $f6, $f2
/* 3439D0 E0032350 E6060038 */  swc1      $f6, 0x38($s0)
/* 3439D4 E0032354 46200020 */  cvt.s.d   $f0, $f0
/* 3439D8 E0032358 E6000024 */  swc1      $f0, 0x24($s0)
/* 3439DC E003235C 2610003C */  addiu     $s0, $s0, 0x3C
.LE0032360:
/* 3439E0 E0032360 2A420003 */  slti      $v0, $s2, 0x3
/* 3439E4 E0032364 14400024 */  bnez      $v0, .LE00323F8
/* 3439E8 E0032368 24020003 */   addiu    $v0, $zero, 0x3
/* 3439EC E003236C 16420005 */  bne       $s2, $v0, .LE0032384
/* 3439F0 E0032370 00000000 */   nop
/* 3439F4 E0032374 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3439F8 E0032378 44810000 */  mtc1      $at, $f0
/* 3439FC E003237C 00000000 */  nop
/* 343A00 E0032380 E6000020 */  swc1      $f0, 0x20($s0)
.LE0032384:
/* 343A04 E0032384 C6000020 */  lwc1      $f0, 0x20($s0)
/* 343A08 E0032388 C6020024 */  lwc1      $f2, 0x24($s0)
/* 343A0C E003238C 46020000 */  add.s     $f0, $f0, $f2
/* 343A10 E0032390 2A420006 */  slti      $v0, $s2, 0x6
/* 343A14 E0032394 10400007 */  beqz      $v0, .LE00323B4
/* 343A18 E0032398 E6000020 */   swc1     $f0, 0x20($s0)
/* 343A1C E003239C 46001006 */  mov.s     $f0, $f2
/* 343A20 E00323A0 3C01E003 */  lui       $at, (0xE00328E0 >> 16)
/* 343A24 E00323A4 D42228E0 */  ldc1      $f2, (0xE00328E0 & 0xFFFF)($at)
/* 343A28 E00323A8 46000021 */  cvt.d.s   $f0, $f0
/* 343A2C E00323AC 0800C8FC */  j         .LE00323F0
/* 343A30 E00323B0 46220000 */   add.d    $f0, $f0, $f2
.LE00323B4:
/* 343A34 E00323B4 3C01E003 */  lui       $at, (0xE00328E8 >> 16)
/* 343A38 E00323B8 D42028E8 */  ldc1      $f0, (0xE00328E8 & 0xFFFF)($at)
/* 343A3C E00323BC C6020038 */  lwc1      $f2, 0x38($s0)
/* 343A40 E00323C0 468010A1 */  cvt.d.w   $f2, $f2
/* 343A44 E00323C4 46201082 */  mul.d     $f2, $f2, $f0
/* 343A48 E00323C8 00000000 */  nop
/* 343A4C E00323CC C6000024 */  lwc1      $f0, 0x24($s0)
/* 343A50 E00323D0 3C013FE0 */  lui       $at, (0x3FE00000 >> 16)
/* 343A54 E00323D4 44812800 */  mtc1      $at, $f5
/* 343A58 E00323D8 44802000 */  mtc1      $zero, $f4
/* 343A5C E00323DC 46000021 */  cvt.d.s   $f0, $f0
/* 343A60 E00323E0 46240002 */  mul.d     $f0, $f0, $f4
/* 343A64 E00323E4 00000000 */  nop
/* 343A68 E00323E8 4620118D */  trunc.w.d $f6, $f2
/* 343A6C E00323EC E6060038 */  swc1      $f6, 0x38($s0)
.LE00323F0:
/* 343A70 E00323F0 46200020 */  cvt.s.d   $f0, $f0
/* 343A74 E00323F4 E6000024 */  swc1      $f0, 0x24($s0)
.LE00323F8:
/* 343A78 E00323F8 C6000028 */  lwc1      $f0, 0x28($s0)
/* 343A7C E00323FC C602002C */  lwc1      $f2, 0x2C($s0)
/* 343A80 E0032400 46020000 */  add.s     $f0, $f0, $f2
/* 343A84 E0032404 E6000028 */  swc1      $f0, 0x28($s0)
.LE0032408:
/* 343A88 E0032408 8FBF0024 */  lw        $ra, 0x24($sp)
/* 343A8C E003240C 8FB20020 */  lw        $s2, 0x20($sp)
/* 343A90 E0032410 8FB1001C */  lw        $s1, 0x1C($sp)
/* 343A94 E0032414 8FB00018 */  lw        $s0, 0x18($sp)
/* 343A98 E0032418 03E00008 */  jr        $ra
/* 343A9C E003241C 27BD0028 */   addiu    $sp, $sp, 0x28

### DECOMPILED C INSTRUCTIONS:

void explosion_update(EffectInstance* effect) {
    ExplosionFXData* part = effect->data.explosion;
    s32 unk_00;
    s32 unk_34;

    part->unk_30--;
    if (part->unk_30 < 0) {
        shim_remove_effect(effect);
        return;
    }

    part->unk_34++;

    unk_00 = part->unk_00;
    unk_34 = part->unk_34;

    if (unk_34 == 7) {
        shim_load_effect(EFFECT_SMOKE_RING);
        smoke_ring_main(unk_00, part->pos.x, part->pos.y, part->pos.z);
    } else if (unk_34 == 1) {
        shim_load_effect(EFFECT_CONFETTI);
        confetti_main(unk_00 + 4, part->pos.x, part->pos.y, part->pos.z, 1.0f, 50);
    }

    part++;

    part->unk_20 += part->unk_24;

    if (unk_34 < 8) {
        part->unk_24 += (unk_00 == 2) ? 1.0f : 0.4;
        part->unk_38 = (255 - part->unk_38) * 0.6;
    } else {
        part->unk_24 *= 0.6;
        part->unk_38 *= 0.9;
    }

    part++;

    if (unk_34 >= 3) {
        if (unk_34 == 3) {
            part->unk_20 = 1.0f;
        }
        part->unk_20 += part->unk_24;
        if (unk_34 < 6) {
            part->unk_24 += 0.1;
        } else {
            part->unk_24 *= 0.5;
            part->unk_38 *= 0.9;
        }
    }

    part->unk_28 += part->unk_2C;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel _Litob
/* 46D80 8006B980 27BDFFA0 */  addiu     $sp, $sp, -0x60
/* 46D84 8006B984 AFB10044 */  sw        $s1, 0x44($sp)
/* 46D88 8006B988 00808821 */  addu      $s1, $a0, $zero
/* 46D8C 8006B98C AFB60058 */  sw        $s6, 0x58($sp)
/* 46D90 8006B990 3C168009 */  lui       $s6, %hi(D_80095940)
/* 46D94 8006B994 26D65940 */  addiu     $s6, $s6, %lo(D_80095940)
/* 46D98 8006B998 00A02021 */  addu      $a0, $a1, $zero
/* 46D9C 8006B99C 00052E00 */  sll       $a1, $a1, 24
/* 46DA0 8006B9A0 00052E03 */  sra       $a1, $a1, 24
/* 46DA4 8006B9A4 24020058 */  addiu     $v0, $zero, 0x58
/* 46DA8 8006B9A8 AFBF005C */  sw        $ra, 0x5C($sp)
/* 46DAC 8006B9AC AFB50054 */  sw        $s5, 0x54($sp)
/* 46DB0 8006B9B0 AFB40050 */  sw        $s4, 0x50($sp)
/* 46DB4 8006B9B4 AFB3004C */  sw        $s3, 0x4C($sp)
/* 46DB8 8006B9B8 AFB20048 */  sw        $s2, 0x48($sp)
/* 46DBC 8006B9BC 14A20003 */  bne       $a1, $v0, .L8006B9CC
/* 46DC0 8006B9C0 AFB00040 */   sw       $s0, 0x40($sp)
/* 46DC4 8006B9C4 3C168009 */  lui       $s6, %hi(D_80095954)
/* 46DC8 8006B9C8 26D65954 */  addiu     $s6, $s6, %lo(D_80095954)
.L8006B9CC:
/* 46DCC 8006B9CC 2402006F */  addiu     $v0, $zero, 0x6F
/* 46DD0 8006B9D0 10A20009 */  beq       $a1, $v0, .L8006B9F8
/* 46DD4 8006B9D4 38A30078 */   xori     $v1, $a1, 0x78
/* 46DD8 8006B9D8 0003182B */  sltu      $v1, $zero, $v1
/* 46DDC 8006B9DC 38A20058 */  xori      $v0, $a1, 0x58
/* 46DE0 8006B9E0 0002102B */  sltu      $v0, $zero, $v0
/* 46DE4 8006B9E4 00621824 */  and       $v1, $v1, $v0
/* 46DE8 8006B9E8 10600004 */  beqz      $v1, .L8006B9FC
/* 46DEC 8006B9EC 24130010 */   addiu    $s3, $zero, 0x10
/* 46DF0 8006B9F0 0801AE7F */  j         .L8006B9FC
/* 46DF4 8006B9F4 2413000A */   addiu    $s3, $zero, 0xA
.L8006B9F8:
/* 46DF8 8006B9F8 24130008 */  addiu     $s3, $zero, 0x8
.L8006B9FC:
/* 46DFC 8006B9FC 8E340000 */  lw        $s4, 0x0($s1)
/* 46E00 8006BA00 8E350004 */  lw        $s5, 0x4($s1)
/* 46E04 8006BA04 00041600 */  sll       $v0, $a0, 24
/* 46E08 8006BA08 00021603 */  sra       $v0, $v0, 24
/* 46E0C 8006BA0C 38430064 */  xori      $v1, $v0, 0x64
/* 46E10 8006BA10 2C630001 */  sltiu     $v1, $v1, 0x1
/* 46E14 8006BA14 38420069 */  xori      $v0, $v0, 0x69
/* 46E18 8006BA18 2C420001 */  sltiu     $v0, $v0, 0x1
/* 46E1C 8006BA1C 00621825 */  or        $v1, $v1, $v0
/* 46E20 8006BA20 10600008 */  beqz      $v1, .L8006BA44
/* 46E24 8006BA24 24120018 */   addiu    $s2, $zero, 0x18
/* 46E28 8006BA28 8E220000 */  lw        $v0, 0x0($s1)
/* 46E2C 8006BA2C 04410005 */  bgez      $v0, .L8006BA44
/* 46E30 8006BA30 00000000 */   nop
/* 46E34 8006BA34 0015A823 */  negu      $s5, $s5
/* 46E38 8006BA38 0014A023 */  negu      $s4, $s4
/* 46E3C 8006BA3C 0015102B */  sltu      $v0, $zero, $s5
/* 46E40 8006BA40 0282A023 */  subu      $s4, $s4, $v0
.L8006BA44:
/* 46E44 8006BA44 56800007 */  bnel      $s4, $zero, .L8006BA64
/* 46E48 8006BA48 2652FFFF */   addiu    $s2, $s2, -0x1
/* 46E4C 8006BA4C 56A00005 */  bnel      $s5, $zero, .L8006BA64
/* 46E50 8006BA50 2652FFFF */   addiu    $s2, $s2, -0x1
/* 46E54 8006BA54 8E220024 */  lw        $v0, 0x24($s1)
/* 46E58 8006BA58 1040000D */  beqz      $v0, .L8006BA90
/* 46E5C 8006BA5C 02603821 */   addu     $a3, $s3, $zero
/* 46E60 8006BA60 2652FFFF */  addiu     $s2, $s2, -0x1
.L8006BA64:
/* 46E64 8006BA64 02603821 */  addu      $a3, $s3, $zero
/* 46E68 8006BA68 00003021 */  addu      $a2, $zero, $zero
/* 46E6C 8006BA6C 02802021 */  addu      $a0, $s4, $zero
/* 46E70 8006BA70 02A02821 */  addu      $a1, $s5, $zero
/* 46E74 8006BA74 27B00018 */  addiu     $s0, $sp, 0x18
/* 46E78 8006BA78 0C01BA1C */  jal       __umoddi3
/* 46E7C 8006BA7C 02128021 */   addu     $s0, $s0, $s2
/* 46E80 8006BA80 02C31021 */  addu      $v0, $s6, $v1
/* 46E84 8006BA84 90420000 */  lbu       $v0, 0x0($v0)
/* 46E88 8006BA88 A2020000 */  sb        $v0, 0x0($s0)
/* 46E8C 8006BA8C 02603821 */  addu      $a3, $s3, $zero
.L8006BA90:
/* 46E90 8006BA90 00003021 */  addu      $a2, $zero, $zero
/* 46E94 8006BA94 02802021 */  addu      $a0, $s4, $zero
/* 46E98 8006BA98 0C01B8C4 */  jal       __udivdi3
/* 46E9C 8006BA9C 02A02821 */   addu     $a1, $s5, $zero
/* 46EA0 8006BAA0 AE220000 */  sw        $v0, 0x0($s1)
/* 46EA4 8006BAA4 AE230004 */  sw        $v1, 0x4($s1)
/* 46EA8 8006BAA8 27A20018 */  addiu     $v0, $sp, 0x18
/* 46EAC 8006BAAC 02428021 */  addu      $s0, $s2, $v0
.L8006BAB0:
/* 46EB0 8006BAB0 8E220000 */  lw        $v0, 0x0($s1)
/* 46EB4 8006BAB4 1C400006 */  bgtz      $v0, .L8006BAD0
/* 46EB8 8006BAB8 00001821 */   addu     $v1, $zero, $zero
/* 46EBC 8006BABC 14400006 */  bnez      $v0, .L8006BAD8
/* 46EC0 8006BAC0 0012102A */   slt      $v0, $zero, $s2
/* 46EC4 8006BAC4 8E220004 */  lw        $v0, 0x4($s1)
/* 46EC8 8006BAC8 10400003 */  beqz      $v0, .L8006BAD8
/* 46ECC 8006BACC 0012102A */   slt      $v0, $zero, $s2
.L8006BAD0:
/* 46ED0 8006BAD0 24030001 */  addiu     $v1, $zero, 0x1
/* 46ED4 8006BAD4 0012102A */  slt       $v0, $zero, $s2
.L8006BAD8:
/* 46ED8 8006BAD8 00621024 */  and       $v0, $v1, $v0
/* 46EDC 8006BADC 10400014 */  beqz      $v0, .L8006BB30
/* 46EE0 8006BAE0 02601821 */   addu     $v1, $s3, $zero
/* 46EE4 8006BAE4 8E260000 */  lw        $a2, 0x0($s1)
/* 46EE8 8006BAE8 8E270004 */  lw        $a3, 0x4($s1)
/* 46EEC 8006BAEC 001317C3 */  sra       $v0, $s3, 31
/* 46EF0 8006BAF0 AFA20010 */  sw        $v0, 0x10($sp)
/* 46EF4 8006BAF4 AFA30014 */  sw        $v1, 0x14($sp)
/* 46EF8 8006BAF8 0C01B5A9 */  jal       lldiv
/* 46EFC 8006BAFC 27A40030 */   addiu    $a0, $sp, 0x30
/* 46F00 8006BB00 8FA20030 */  lw        $v0, 0x30($sp)
/* 46F04 8006BB04 8FA30034 */  lw        $v1, 0x34($sp)
/* 46F08 8006BB08 AE220000 */  sw        $v0, 0x0($s1)
/* 46F0C 8006BB0C AE230004 */  sw        $v1, 0x4($s1)
/* 46F10 8006BB10 8FA20038 */  lw        $v0, 0x38($sp)
/* 46F14 8006BB14 8FA3003C */  lw        $v1, 0x3C($sp)
/* 46F18 8006BB18 02C31021 */  addu      $v0, $s6, $v1
/* 46F1C 8006BB1C 90420000 */  lbu       $v0, 0x0($v0)
/* 46F20 8006BB20 2610FFFF */  addiu     $s0, $s0, -0x1
/* 46F24 8006BB24 2652FFFF */  addiu     $s2, $s2, -0x1
/* 46F28 8006BB28 0801AEAC */  j         .L8006BAB0
/* 46F2C 8006BB2C A2020000 */   sb       $v0, 0x0($s0)
.L8006BB30:
/* 46F30 8006BB30 8E240008 */  lw        $a0, 0x8($s1)
/* 46F34 8006BB34 27A50018 */  addiu     $a1, $sp, 0x18
/* 46F38 8006BB38 00B22821 */  addu      $a1, $a1, $s2
/* 46F3C 8006BB3C 24060018 */  addiu     $a2, $zero, 0x18
/* 46F40 8006BB40 00D23023 */  subu      $a2, $a2, $s2
/* 46F44 8006BB44 0C01929D */  jal       memcpy
/* 46F48 8006BB48 AE260014 */   sw       $a2, 0x14($s1)
/* 46F4C 8006BB4C 8E240014 */  lw        $a0, 0x14($s1)
/* 46F50 8006BB50 8E230024 */  lw        $v1, 0x24($s1)
/* 46F54 8006BB54 0083102A */  slt       $v0, $a0, $v1
/* 46F58 8006BB58 10400002 */  beqz      $v0, .L8006BB64
/* 46F5C 8006BB5C 00641023 */   subu     $v0, $v1, $a0
/* 46F60 8006BB60 AE220010 */  sw        $v0, 0x10($s1)
.L8006BB64:
/* 46F64 8006BB64 8E220024 */  lw        $v0, 0x24($s1)
/* 46F68 8006BB68 0441000F */  bgez      $v0, .L8006BBA8
/* 46F6C 8006BB6C 24030010 */   addiu    $v1, $zero, 0x10
/* 46F70 8006BB70 8E220030 */  lw        $v0, 0x30($s1)
/* 46F74 8006BB74 30420014 */  andi      $v0, $v0, 0x14
/* 46F78 8006BB78 1443000B */  bne       $v0, $v1, .L8006BBA8
/* 46F7C 8006BB7C 00000000 */   nop
/* 46F80 8006BB80 8E220028 */  lw        $v0, 0x28($s1)
/* 46F84 8006BB84 8E23000C */  lw        $v1, 0xC($s1)
/* 46F88 8006BB88 8E250010 */  lw        $a1, 0x10($s1)
/* 46F8C 8006BB8C 8E240014 */  lw        $a0, 0x14($s1)
/* 46F90 8006BB90 00431023 */  subu      $v0, $v0, $v1
/* 46F94 8006BB94 00451023 */  subu      $v0, $v0, $a1
/* 46F98 8006BB98 00449023 */  subu      $s2, $v0, $a0
/* 46F9C 8006BB9C 1A400002 */  blez      $s2, .L8006BBA8
/* 46FA0 8006BBA0 00B21021 */   addu     $v0, $a1, $s2
/* 46FA4 8006BBA4 AE220010 */  sw        $v0, 0x10($s1)
.L8006BBA8:
/* 46FA8 8006BBA8 8FBF005C */  lw        $ra, 0x5C($sp)
/* 46FAC 8006BBAC 8FB60058 */  lw        $s6, 0x58($sp)
/* 46FB0 8006BBB0 8FB50054 */  lw        $s5, 0x54($sp)
/* 46FB4 8006BBB4 8FB40050 */  lw        $s4, 0x50($sp)
/* 46FB8 8006BBB8 8FB3004C */  lw        $s3, 0x4C($sp)
/* 46FBC 8006BBBC 8FB20048 */  lw        $s2, 0x48($sp)
/* 46FC0 8006BBC0 8FB10044 */  lw        $s1, 0x44($sp)
/* 46FC4 8006BBC4 8FB00040 */  lw        $s0, 0x40($sp)
/* 46FC8 8006BBC8 03E00008 */  jr        $ra
/* 46FCC 8006BBCC 27BD0060 */   addiu    $sp, $sp, 0x60

### DECOMPILED C INSTRUCTIONS:

void _Litob(_Pft *args, char type) {
    char buff[BUFF_LEN];
    const char *digs;
    s32 base;
    s32 i;
    unsigned long long ullval;

    if (type == 'X') {
        digs = udigs;
    } else {
        digs = ldigs;
    }

    base = (type == 'o') ? 8 : ((type != 'x' && type != 'X') ? 10 : 16);
    i = BUFF_LEN;
    ullval = args->v.ll;

    if ((type == 'd' || type == 'i') && args->v.ll < 0) {
        ullval = -ullval;
    }

    if (ullval != 0 || args->prec != 0) {
        buff[--i] = digs[ullval % base];
    }

    args->v.ll = ullval / base;

    while (args->v.ll > 0 && i > 0) {
        lldiv_t qr = lldiv(args->v.ll, base);

        args->v.ll = qr.quot;
        buff[--i] = digs[qr.rem];
    }

    args->n1 = BUFF_LEN - i;

    memcpy(args->s, buff + i, args->n1);

    if (args->n1 < args->prec) {
        args->nz0 = args->prec - args->n1;
    }

    if (args->prec < 0 && (args->flags & (FLAGS_ZERO | FLAGS_MINUS)) == FLAGS_ZERO) {
        i = args->width - args->n0 - args->nz0 - args->n1;

        if (i > 0) {
            args->nz0 += i;
        }
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel au_update_clients_2
/* 2E7D0 800533D0 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* 2E7D4 800533D4 AFB20018 */  sw        $s2, 0x18($sp)
/* 2E7D8 800533D8 3C12800A */  lui       $s2, %hi(gSoundGlobals)
/* 2E7DC 800533DC 8E52A5C0 */  lw        $s2, %lo(gSoundGlobals)($s2)
/* 2E7E0 800533E0 AFB10014 */  sw        $s1, 0x14($sp)
/* 2E7E4 800533E4 3C11800A */  lui       $s1, %hi(gSoundManager)
/* 2E7E8 800533E8 8E31A640 */  lw        $s1, %lo(gSoundManager)($s1)
/* 2E7EC 800533EC AFB00010 */  sw        $s0, 0x10($sp)
/* 2E7F0 800533F0 3C10800A */  lui       $s0, %hi(gAuAmbienceManager)
/* 2E7F4 800533F4 8E10A628 */  lw        $s0, %lo(gAuAmbienceManager)($s0)
/* 2E7F8 800533F8 AFBF001C */  sw        $ra, 0x1C($sp)
/* 2E7FC 800533FC 0C014D95 */  jal       au_syn_update
/* 2E800 80053400 0240202D */   daddu    $a0, $s2, $zero
/* 2E804 80053404 8E03000C */  lw        $v1, 0xC($s0)
/* 2E808 80053408 8E020004 */  lw        $v0, 0x4($s0)
/* 2E80C 8005340C 00621823 */  subu      $v1, $v1, $v0
/* 2E810 80053410 1C600006 */  bgtz      $v1, .L8005342C
/* 2E814 80053414 AE03000C */   sw       $v1, 0xC($s0)
/* 2E818 80053418 8E020008 */  lw        $v0, 0x8($s0)
/* 2E81C 8005341C 0200202D */  daddu     $a0, $s0, $zero
/* 2E820 80053420 00621021 */  addu      $v0, $v1, $v0
/* 2E824 80053424 0C01446F */  jal       au_amb_manager_update
/* 2E828 80053428 AC82000C */   sw       $v0, 0xC($a0)
.L8005342C:
/* 2E82C 8005342C 8622004A */  lh        $v0, 0x4A($s1)
/* 2E830 80053430 10400007 */  beqz      $v0, .L80053450
/* 2E834 80053434 00000000 */   nop
/* 2E838 80053438 0C014E8A */  jal       au_fade_update
/* 2E83C 8005343C 26240040 */   addiu    $a0, $s1, 0x40
/* 2E840 80053440 922400BE */  lbu       $a0, 0xBE($s1)
/* 2E844 80053444 96250040 */  lhu       $a1, 0x40($s1)
/* 2E848 80053448 0C014EA6 */  jal       au_fade_set_volume
/* 2E84C 8005344C 8E26005C */   lw       $a2, 0x5C($s1)
.L80053450:
/* 2E850 80053450 8E23003C */  lw        $v1, 0x3C($s1)
/* 2E854 80053454 8E220034 */  lw        $v0, 0x34($s1)
/* 2E858 80053458 00621823 */  subu      $v1, $v1, $v0
/* 2E85C 8005345C 1C600007 */  bgtz      $v1, .L8005347C
/* 2E860 80053460 AE23003C */   sw       $v1, 0x3C($s1)
/* 2E864 80053464 8E220038 */  lw        $v0, 0x38($s1)
/* 2E868 80053468 0220202D */  daddu     $a0, $s1, $zero
/* 2E86C 8005346C 00621021 */  addu      $v0, $v1, $v0
/* 2E870 80053470 0C013111 */  jal       au_sfx_manager_update
/* 2E874 80053474 AE22003C */   sw       $v0, 0x3C($s1)
/* 2E878 80053478 A62200BA */  sh        $v0, 0xBA($s1)
.L8005347C:
/* 2E87C 8005347C 3C118008 */  lui       $s1, %hi(PreventBGMPlayerUpdate)
/* 2E880 80053480 26318DB0 */  addiu     $s1, $s1, %lo(PreventBGMPlayerUpdate)
/* 2E884 80053484 8E220000 */  lw        $v0, 0x0($s1)
/* 2E888 80053488 14400045 */  bnez      $v0, .L800535A0
/* 2E88C 8005348C 00000000 */   nop
/* 2E890 80053490 3C10800A */  lui       $s0, %hi(gBGMPlayerB)
/* 2E894 80053494 8E10A5FC */  lw        $s0, %lo(gBGMPlayerB)($s0)
/* 2E898 80053498 86020036 */  lh        $v0, 0x36($s0)
/* 2E89C 8005349C 10400003 */  beqz      $v0, .L800534AC
/* 2E8A0 800534A0 00000000 */   nop
/* 2E8A4 800534A4 0C0138E9 */  jal       au_bgm_update_fade
/* 2E8A8 800534A8 0200202D */   daddu    $a0, $s0, $zero
.L800534AC:
/* 2E8AC 800534AC 8E02001C */  lw        $v0, 0x1C($s0)
/* 2E8B0 800534B0 10400004 */  beqz      $v0, .L800534C4
/* 2E8B4 800534B4 00000000 */   nop
/* 2E8B8 800534B8 8E020018 */  lw        $v0, 0x18($s0)
/* 2E8BC 800534BC 24420001 */  addiu     $v0, $v0, 0x1
/* 2E8C0 800534C0 AE020018 */  sw        $v0, 0x18($s0)
.L800534C4:
/* 2E8C4 800534C4 8E030010 */  lw        $v1, 0x10($s0)
/* 2E8C8 800534C8 8E020008 */  lw        $v0, 0x8($s0)
/* 2E8CC 800534CC 00621823 */  subu      $v1, $v1, $v0
/* 2E8D0 800534D0 1C600007 */  bgtz      $v1, .L800534F0
/* 2E8D4 800534D4 AE030010 */   sw       $v1, 0x10($s0)
/* 2E8D8 800534D8 8E02000C */  lw        $v0, 0xC($s0)
/* 2E8DC 800534DC 0200202D */  daddu     $a0, $s0, $zero
/* 2E8E0 800534E0 00621021 */  addu      $v0, $v1, $v0
/* 2E8E4 800534E4 0C01392E */  jal       func_8004E4B8
/* 2E8E8 800534E8 AE020010 */   sw       $v0, 0x10($s0)
/* 2E8EC 800534EC A602005C */  sh        $v0, 0x5C($s0)
.L800534F0:
/* 2E8F0 800534F0 8E220000 */  lw        $v0, 0x0($s1)
/* 2E8F4 800534F4 1440002A */  bnez      $v0, .L800535A0
/* 2E8F8 800534F8 00000000 */   nop
/* 2E8FC 800534FC 8E420080 */  lw        $v0, 0x80($s2)
/* 2E900 80053500 10400003 */  beqz      $v0, .L80053510
/* 2E904 80053504 00000000 */   nop
/* 2E908 80053508 0C0137F5 */  jal       func_8004DFD4
/* 2E90C 8005350C 0240202D */   daddu    $a0, $s2, $zero
.L80053510:
/* 2E910 80053510 3C10800A */  lui       $s0, %hi(gBGMPlayerA)
/* 2E914 80053514 8E10A664 */  lw        $s0, %lo(gBGMPlayerA)($s0)
/* 2E918 80053518 86020046 */  lh        $v0, 0x46($s0)
/* 2E91C 8005351C 1040000A */  beqz      $v0, .L80053548
/* 2E920 80053520 00000000 */   nop
/* 2E924 80053524 0C014EEA */  jal       func_80053BA8
/* 2E928 80053528 2604002C */   addiu    $a0, $s0, 0x2C
/* 2E92C 8005352C 86020036 */  lh        $v0, 0x36($s0)
/* 2E930 80053530 14400008 */  bnez      $v0, .L80053554
/* 2E934 80053534 00000000 */   nop
/* 2E938 80053538 0C013911 */  jal       func_8004E444
/* 2E93C 8005353C 0200202D */   daddu    $a0, $s0, $zero
/* 2E940 80053540 08014D57 */  j         .L8005355C
/* 2E944 80053544 00000000 */   nop
.L80053548:
/* 2E948 80053548 86020036 */  lh        $v0, 0x36($s0)
/* 2E94C 8005354C 10400003 */  beqz      $v0, .L8005355C
/* 2E950 80053550 00000000 */   nop
.L80053554:
/* 2E954 80053554 0C0138E9 */  jal       au_bgm_update_fade
/* 2E958 80053558 0200202D */   daddu    $a0, $s0, $zero
.L8005355C:
/* 2E95C 8005355C 8E02001C */  lw        $v0, 0x1C($s0)
/* 2E960 80053560 10400004 */  beqz      $v0, .L80053574
/* 2E964 80053564 00000000 */   nop
/* 2E968 80053568 8E020018 */  lw        $v0, 0x18($s0)
/* 2E96C 8005356C 24420001 */  addiu     $v0, $v0, 0x1
/* 2E970 80053570 AE020018 */  sw        $v0, 0x18($s0)
.L80053574:
/* 2E974 80053574 8E030010 */  lw        $v1, 0x10($s0)
/* 2E978 80053578 8E020008 */  lw        $v0, 0x8($s0)
/* 2E97C 8005357C 00621823 */  subu      $v1, $v1, $v0
/* 2E980 80053580 1C600007 */  bgtz      $v1, .L800535A0
/* 2E984 80053584 AE030010 */   sw       $v1, 0x10($s0)
/* 2E988 80053588 8E02000C */  lw        $v0, 0xC($s0)
/* 2E98C 8005358C 0200202D */  daddu     $a0, $s0, $zero
/* 2E990 80053590 00621021 */  addu      $v0, $v1, $v0
/* 2E994 80053594 0C01392E */  jal       func_8004E4B8
/* 2E998 80053598 AE020010 */   sw       $v0, 0x10($s0)
/* 2E99C 8005359C A602005C */  sh        $v0, 0x5C($s0)
.L800535A0:
/* 2E9A0 800535A0 0C014998 */  jal       func_80052660
/* 2E9A4 800535A4 0240202D */   daddu    $a0, $s2, $zero
/* 2E9A8 800535A8 8FBF001C */  lw        $ra, 0x1C($sp)
/* 2E9AC 800535AC 8FB20018 */  lw        $s2, 0x18($sp)
/* 2E9B0 800535B0 8FB10014 */  lw        $s1, 0x14($sp)
/* 2E9B4 800535B4 8FB00010 */  lw        $s0, 0x10($sp)
/* 2E9B8 800535B8 03E00008 */  jr        $ra
/* 2E9BC 800535BC 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void au_update_clients_2(void) {
    AuGlobals* globals = gSoundGlobals;
    SoundManager* sfxManager = gSoundManager;
    AmbienceManager* ambManager = gAuAmbienceManager;
    BGMPlayer* bgmPlayer;

    au_syn_update(globals);

    ambManager->nextUpdateCounter -= ambManager->nextUpdateStep;
    if (ambManager->nextUpdateCounter <= 0) {
        ambManager->nextUpdateCounter += ambManager->nextUpdateInterval;
        au_amb_manager_update(ambManager);
    }

    if (sfxManager->fadeInfo.fadeTime != 0) {
        au_fade_update(&sfxManager->fadeInfo);
        au_fade_set_volume(sfxManager->busId, sfxManager->fadeInfo.currentVolume.u16, sfxManager->busVolume);
    }

    sfxManager->nextUpdateCounter -= sfxManager->nextUpdateStep;
    if (sfxManager->nextUpdateCounter <= 0) {
        sfxManager->nextUpdateCounter += sfxManager->nextUpdateInterval;
        sfxManager->unk_BA = au_sfx_manager_update(sfxManager);
    }

    // update gBGMPlayerB
    if (!PreventBGMPlayerUpdate) {
        bgmPlayer = gBGMPlayerB;
        if (bgmPlayer->fadeInfo.fadeTime != 0) {
            au_bgm_update_fade(bgmPlayer);
        }
        if (bgmPlayer->songName != 0) {
            bgmPlayer->songPlayingCounter++;
        }

        bgmPlayer->nextUpdateCounter -= bgmPlayer->nextUpdateStep;
        if (bgmPlayer->nextUpdateCounter <= 0) {
            bgmPlayer->nextUpdateCounter += bgmPlayer->nextUpdateInterval;
            bgmPlayer->unk_5C = au_bgm_player_update_main(bgmPlayer);
        }
    }

    if (!PreventBGMPlayerUpdate) {
        if (globals->unk_80 != 0) {
            func_8004DFD4(globals);
        }
        bgmPlayer = gBGMPlayerA;
        if (bgmPlayer->fadeInfo.volScaleTime != 0) {
            func_80053BA8(&bgmPlayer->fadeInfo);
            if (bgmPlayer->fadeInfo.fadeTime == 0) {
                func_8004E444(bgmPlayer);
            } else {
                au_bgm_update_fade(bgmPlayer);
            }
        } else if (bgmPlayer->fadeInfo.fadeTime != 0) {
            au_bgm_update_fade(bgmPlayer);
        }
        if (bgmPlayer->songName != 0) {
            bgmPlayer->songPlayingCounter++;
        }

        bgmPlayer->nextUpdateCounter -= bgmPlayer->nextUpdateStep;
        if (bgmPlayer->nextUpdateCounter <= 0) {
            bgmPlayer->nextUpdateCounter += bgmPlayer->nextUpdateInterval;
            bgmPlayer->unk_5C = au_bgm_player_update_main(bgmPlayer);
        }
    }
    au_update_voices(globals);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel state_step_enter_world
/* 112EC 80035EEC 27BDFFE8 */  addiu     $sp, $sp, -0x18
/* 112F0 80035EF0 AFB00010 */  sw        $s0, 0x10($sp)
/* 112F4 80035EF4 3C10800A */  lui       $s0, %hi(gMapTransitionState)
/* 112F8 80035EF8 26100944 */  addiu     $s0, $s0, %lo(gMapTransitionState)
/* 112FC 80035EFC AFBF0014 */  sw        $ra, 0x14($sp)
/* 11300 80035F00 86030000 */  lh        $v1, 0x0($s0)
/* 11304 80035F04 24020001 */  addiu     $v0, $zero, 0x1
/* 11308 80035F08 1062003D */  beq       $v1, $v0, .L80036000
/* 1130C 80035F0C 28620002 */   slti     $v0, $v1, 0x2
/* 11310 80035F10 50400005 */  beql      $v0, $zero, .L80035F28
/* 11314 80035F14 24020002 */   addiu    $v0, $zero, 0x2
/* 11318 80035F18 10600007 */  beqz      $v1, .L80035F38
/* 1131C 80035F1C 00000000 */   nop
/* 11320 80035F20 0800D83B */  j         .L800360EC
/* 11324 80035F24 00000000 */   nop
.L80035F28:
/* 11328 80035F28 10620055 */  beq       $v1, $v0, .L80036080
/* 1132C 80035F2C 00000000 */   nop
/* 11330 80035F30 0800D83B */  j         .L800360EC
/* 11334 80035F34 00000000 */   nop
.L80035F38:
/* 11338 80035F38 3C04800A */  lui       $a0, %hi(gMapTransitionStateTime)
/* 1133C 80035F3C 24840946 */  addiu     $a0, $a0, %lo(gMapTransitionStateTime)
/* 11340 80035F40 84820000 */  lh        $v0, 0x0($a0)
/* 11344 80035F44 94830000 */  lhu       $v1, 0x0($a0)
/* 11348 80035F48 1440003B */  bnez      $v0, .L80036038
/* 1134C 80035F4C 2462FFFF */   addiu    $v0, $v1, -0x1
/* 11350 80035F50 3C038007 */  lui       $v1, %hi(gGameStatusPtr)
/* 11354 80035F54 2463419C */  addiu     $v1, $v1, %lo(gGameStatusPtr)
/* 11358 80035F58 8C620000 */  lw        $v0, 0x0($v1)
/* 1135C 80035F5C A0400070 */  sb        $zero, 0x70($v0)
/* 11360 80035F60 8C620000 */  lw        $v0, 0x0($v1)
/* 11364 80035F64 A0400078 */  sb        $zero, 0x78($v0)
/* 11368 80035F68 3C02800A */  lui       $v0, %hi(D_800A0948)
/* 1136C 80035F6C 84420948 */  lh        $v0, %lo(D_800A0948)($v0)
/* 11370 80035F70 14400006 */  bnez      $v0, .L80035F8C
/* 11374 80035F74 24060001 */   addiu    $a2, $zero, 0x1
/* 11378 80035F78 8C620000 */  lw        $v0, 0x0($v1)
/* 1137C 80035F7C 84440086 */  lh        $a0, 0x86($v0)
/* 11380 80035F80 8445008C */  lh        $a1, 0x8C($v0)
/* 11384 80035F84 0800D7E6 */  j         .L80035F98
/* 11388 80035F88 0000302D */   daddu    $a2, $zero, $zero
.L80035F8C:
/* 1138C 80035F8C 8C620000 */  lw        $v0, 0x0($v1)
/* 11390 80035F90 84440086 */  lh        $a0, 0x86($v0)
/* 11394 80035F94 8445008C */  lh        $a1, 0x8C($v0)
.L80035F98:
/* 11398 80035F98 0C0169BD */  jal       load_map_by_IDs
/* 1139C 80035F9C 00000000 */   nop
/* 113A0 80035FA0 3C108007 */  lui       $s0, %hi(gGameStatusPtr)
/* 113A4 80035FA4 2610419C */  addiu     $s0, $s0, %lo(gGameStatusPtr)
/* 113A8 80035FA8 8E020000 */  lw        $v0, 0x0($s0)
/* 113AC 80035FAC 94430086 */  lhu       $v1, 0x86($v0)
/* 113B0 80035FB0 0000202D */  daddu     $a0, $zero, $zero
/* 113B4 80035FB4 0C009C22 */  jal       set_time_freeze_mode
/* 113B8 80035FB8 A4430088 */   sh       $v1, 0x88($v0)
/* 113BC 80035FBC 8E020000 */  lw        $v0, 0x0($s0)
/* 113C0 80035FC0 80420071 */  lb        $v0, 0x71($v0)
/* 113C4 80035FC4 14400003 */  bnez      $v0, .L80035FD4
/* 113C8 80035FC8 00000000 */   nop
/* 113CC 80035FCC 0C03805E */  jal       disable_player_input
/* 113D0 80035FD0 00000000 */   nop
.L80035FD4:
/* 113D4 80035FD4 0C00B500 */  jal       update_cameras
/* 113D8 80035FD8 00000000 */   nop
/* 113DC 80035FDC 3C02800A */  lui       $v0, %hi(gMapTransitionState)
/* 113E0 80035FE0 24420944 */  addiu     $v0, $v0, %lo(gMapTransitionState)
/* 113E4 80035FE4 94430000 */  lhu       $v1, 0x0($v0)
/* 113E8 80035FE8 24040002 */  addiu     $a0, $zero, 0x2
/* 113EC 80035FEC 3C01800A */  lui       $at, %hi(gMapTransitionStateTime)
/* 113F0 80035FF0 A4240946 */  sh        $a0, %lo(gMapTransitionStateTime)($at)
/* 113F4 80035FF4 24630001 */  addiu     $v1, $v1, 0x1
/* 113F8 80035FF8 0800D83B */  j         .L800360EC
/* 113FC 80035FFC A4430000 */   sh       $v1, 0x0($v0)
.L80036000:
/* 11400 80036000 0C00F949 */  jal       update_encounters
/* 11404 80036004 00000000 */   nop
/* 11408 80036008 0C00E64C */  jal       update_npcs
/* 1140C 8003600C 00000000 */   nop
/* 11410 80036010 0C037DD0 */  jal       update_player
/* 11414 80036014 00000000 */   nop
/* 11418 80036018 0C00B500 */  jal       update_cameras
/* 1141C 8003601C 00000000 */   nop
/* 11420 80036020 3C04800A */  lui       $a0, %hi(gMapTransitionStateTime)
/* 11424 80036024 24840946 */  addiu     $a0, $a0, %lo(gMapTransitionStateTime)
/* 11428 80036028 84820000 */  lh        $v0, 0x0($a0)
/* 1142C 8003602C 94830000 */  lhu       $v1, 0x0($a0)
/* 11430 80036030 10400003 */  beqz      $v0, .L80036040
/* 11434 80036034 2462FFFF */   addiu    $v0, $v1, -0x1
.L80036038:
/* 11438 80036038 0800D83B */  j         .L800360EC
/* 1143C 8003603C A4820000 */   sh       $v0, 0x0($a0)
.L80036040:
/* 11440 80036040 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* 11444 80036044 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* 11448 80036048 0C0B1059 */  jal       does_script_exist
/* 1144C 8003604C 8C44006C */   lw       $a0, 0x6C($v0)
/* 11450 80036050 14400026 */  bnez      $v0, .L800360EC
/* 11454 80036054 00000000 */   nop
/* 11458 80036058 3C05800A */  lui       $a1, %hi(gOverrideFlags)
/* 1145C 8003605C 24A5A650 */  addiu     $a1, $a1, %lo(gOverrideFlags)
/* 11460 80036060 2404FFF7 */  addiu     $a0, $zero, -0x9
/* 11464 80036064 8CA20000 */  lw        $v0, 0x0($a1)
/* 11468 80036068 96030000 */  lhu       $v1, 0x0($s0)
/* 1146C 8003606C 00441024 */  and       $v0, $v0, $a0
/* 11470 80036070 24630001 */  addiu     $v1, $v1, 0x1
/* 11474 80036074 ACA20000 */  sw        $v0, 0x0($a1)
/* 11478 80036078 0800D83B */  j         .L800360EC
/* 1147C 8003607C A6030000 */   sh       $v1, 0x0($s0)
.L80036080:
/* 11480 80036080 0C00E64C */  jal       update_npcs
/* 11484 80036084 00000000 */   nop
/* 11488 80036088 0C037DD0 */  jal       update_player
/* 1148C 8003608C 00000000 */   nop
/* 11490 80036090 0C016754 */  jal       update_effects
/* 11494 80036094 00000000 */   nop
/* 11498 80036098 0C00B500 */  jal       update_cameras
/* 1149C 8003609C 00000000 */   nop
/* 114A0 800360A0 3C04800A */  lui       $a0, %hi(gMapTransitionAlpha)
/* 114A4 800360A4 24840940 */  addiu     $a0, $a0, %lo(gMapTransitionAlpha)
/* 114A8 800360A8 0C04E175 */  jal       update_enter_map_screen_overlay
/* 114AC 800360AC 00000000 */   nop
/* 114B0 800360B0 00021400 */  sll       $v0, $v0, 16
/* 114B4 800360B4 1040000D */  beqz      $v0, .L800360EC
/* 114B8 800360B8 00000000 */   nop
/* 114BC 800360BC 3C028007 */  lui       $v0, %hi(gGameStatusPtr)
/* 114C0 800360C0 8C42419C */  lw        $v0, %lo(gGameStatusPtr)($v0)
/* 114C4 800360C4 80420071 */  lb        $v0, 0x71($v0)
/* 114C8 800360C8 14400003 */  bnez      $v0, .L800360D8
/* 114CC 800360CC 00000000 */   nop
/* 114D0 800360D0 0C038069 */  jal       enable_player_input
/* 114D4 800360D4 00000000 */   nop
.L800360D8:
/* 114D8 800360D8 3C05BF80 */  lui       $a1, (0xBF800000 >> 16)
/* 114DC 800360DC 0C04DF62 */  jal       set_screen_overlay_params_front
/* 114E0 800360E0 240400FF */   addiu    $a0, $zero, 0xFF
/* 114E4 800360E4 0C00CD3C */  jal       set_game_mode
/* 114E8 800360E8 24040004 */   addiu    $a0, $zero, 0x4
.L800360EC:
/* 114EC 800360EC 8FBF0014 */  lw        $ra, 0x14($sp)
/* 114F0 800360F0 8FB00010 */  lw        $s0, 0x10($sp)
/* 114F4 800360F4 03E00008 */  jr        $ra
/* 114F8 800360F8 27BD0018 */   addiu    $sp, $sp, 0x18

### DECOMPILED C INSTRUCTIONS:

void state_step_enter_world(void) {
    switch (gMapTransitionState) {
        case 0:
            if (gMapTransitionStateTime == 0) {
                gGameStatusPtr->isBattle = FALSE;
                gGameStatusPtr->disableScripts = FALSE;

                if (D_800A0948 == 0) {
                    load_map_by_IDs(gGameStatusPtr->areaID, gGameStatusPtr->mapID, LOAD_FROM_MAP);
                } else {
                    load_map_by_IDs(gGameStatusPtr->areaID, gGameStatusPtr->mapID, LOAD_FROM_FILE_SELECT);
                }

                gGameStatusPtr->prevArea = gGameStatusPtr->areaID;
                set_time_freeze_mode(TIME_FREEZE_NORMAL);
                if (gGameStatusPtr->demoState == DEMO_STATE_NONE) {
                    disable_player_input();
                }
                update_cameras();
                gMapTransitionStateTime = 2;
                gMapTransitionState++;
            } else {
                gMapTransitionStateTime--;
            }
            break;
        case 1:
            update_encounters();
            update_npcs();
            update_player();
            update_cameras();

            if (gMapTransitionStateTime != 0) {
                gMapTransitionStateTime--;
            } else if (!does_script_exist(gGameStatusPtr->mainScriptID)) {
                gOverrideFlags &= ~GLOBAL_OVERRIDES_8;
                gMapTransitionState++;
            }
            break;
        case 2:
            update_npcs();
            update_player();
            update_effects();
            update_cameras();

            if (update_enter_map_screen_overlay(&gMapTransitionAlpha) != 0) {
                if (gGameStatusPtr->demoState == DEMO_STATE_NONE) {
                    enable_player_input();
                }
                set_screen_overlay_params_front(OVERLAY_NONE, -1.0f);
                set_game_mode(GAME_MODE_CHANGE_MAP);
            }
            break;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel debuff_main
/* 364300 E0062000 27BDFF90 */  addiu     $sp, $sp, -0x70
/* 364304 E0062004 F7B40048 */  sdc1      $f20, 0x48($sp)
/* 364308 E0062008 4485A000 */  mtc1      $a1, $f20
/* 36430C E006200C AFB1002C */  sw        $s1, 0x2C($sp)
/* 364310 E0062010 0080882D */  daddu     $s1, $a0, $zero
/* 364314 E0062014 F7B60050 */  sdc1      $f22, 0x50($sp)
/* 364318 E0062018 4486B000 */  mtc1      $a2, $f22
/* 36431C E006201C 27A40010 */  addiu     $a0, $sp, 0x10
/* 364320 E0062020 F7B80058 */  sdc1      $f24, 0x58($sp)
/* 364324 E0062024 4487C000 */  mtc1      $a3, $f24
/* 364328 E0062028 3C02E006 */  lui       $v0, %hi(debuff_init)
/* 36432C E006202C 24422218 */  addiu     $v0, $v0, %lo(debuff_init)
/* 364330 E0062030 AFA20018 */  sw        $v0, 0x18($sp)
/* 364334 E0062034 3C02E006 */  lui       $v0, %hi(debuff_update)
/* 364338 E0062038 24422220 */  addiu     $v0, $v0, %lo(debuff_update)
/* 36433C E006203C AFA2001C */  sw        $v0, 0x1C($sp)
/* 364340 E0062040 3C02E006 */  lui       $v0, %hi(debuff_render)
/* 364344 E0062044 244224A8 */  addiu     $v0, $v0, %lo(debuff_render)
/* 364348 E0062048 AFA20020 */  sw        $v0, 0x20($sp)
/* 36434C E006204C 24020031 */  addiu     $v0, $zero, 0x31
/* 364350 E0062050 AFBF0040 */  sw        $ra, 0x40($sp)
/* 364354 E0062054 AFB5003C */  sw        $s5, 0x3C($sp)
/* 364358 E0062058 AFB40038 */  sw        $s4, 0x38($sp)
/* 36435C E006205C AFB30034 */  sw        $s3, 0x34($sp)
/* 364360 E0062060 AFB20030 */  sw        $s2, 0x30($sp)
/* 364364 E0062064 AFB00028 */  sw        $s0, 0x28($sp)
/* 364368 E0062068 F7BC0068 */  sdc1      $f28, 0x68($sp)
/* 36436C E006206C F7BA0060 */  sdc1      $f26, 0x60($sp)
/* 364370 E0062070 AFA00010 */  sw        $zero, 0x10($sp)
/* 364374 E0062074 AFA00024 */  sw        $zero, 0x24($sp)
/* 364378 E0062078 0C080124 */  jal       shim_create_effect_instance
/* 36437C E006207C AFA20014 */   sw       $v0, 0x14($sp)
/* 364380 E0062080 24040200 */  addiu     $a0, $zero, 0x200
/* 364384 E0062084 24150008 */  addiu     $s5, $zero, 0x8
/* 364388 E0062088 0040A02D */  daddu     $s4, $v0, $zero
/* 36438C E006208C 0C08012C */  jal       shim_general_heap_malloc
/* 364390 E0062090 AE950008 */   sw       $s5, 0x8($s4)
/* 364394 E0062094 0040802D */  daddu     $s0, $v0, $zero
/* 364398 E0062098 16000003 */  bnez      $s0, .LE00620A8
/* 36439C E006209C AE90000C */   sw       $s0, 0xC($s4)
.LE00620A0:
/* 3643A0 E00620A0 08018828 */  j         .LE00620A0
/* 3643A4 E00620A4 00000000 */   nop
.LE00620A8:
/* 3643A8 E00620A8 0200202D */  daddu     $a0, $s0, $zero
/* 3643AC E00620AC 0C080130 */  jal       shim_mem_clear
/* 3643B0 E00620B0 00152980 */   sll      $a1, $s5, 6
/* 3643B4 E00620B4 2402001E */  addiu     $v0, $zero, 0x1E
/* 3643B8 E00620B8 AE020024 */  sw        $v0, 0x24($s0)
/* 3643BC E00620BC 240200FF */  addiu     $v0, $zero, 0xFF
/* 3643C0 E00620C0 AE000028 */  sw        $zero, 0x28($s0)
/* 3643C4 E00620C4 A6110000 */  sh        $s1, 0x0($s0)
/* 3643C8 E00620C8 E6140004 */  swc1      $f20, 0x4($s0)
/* 3643CC E00620CC E6160008 */  swc1      $f22, 0x8($s0)
/* 3643D0 E00620D0 E618000C */  swc1      $f24, 0xC($s0)
/* 3643D4 E00620D4 16200009 */  bnez      $s1, .LE00620FC
/* 3643D8 E00620D8 AE020034 */   sw       $v0, 0x34($s0)
/* 3643DC E00620DC 24020014 */  addiu     $v0, $zero, 0x14
/* 3643E0 E00620E0 A202003B */  sb        $v0, 0x3B($s0)
/* 3643E4 E00620E4 A2020038 */  sb        $v0, 0x38($s0)
/* 3643E8 E00620E8 24020015 */  addiu     $v0, $zero, 0x15
/* 3643EC E00620EC A202003C */  sb        $v0, 0x3C($s0)
/* 3643F0 E00620F0 A2020039 */  sb        $v0, 0x39($s0)
/* 3643F4 E00620F4 08018846 */  j         .LE0062118
/* 3643F8 E00620F8 240200F2 */   addiu    $v0, $zero, 0xF2
.LE00620FC:
/* 3643FC E00620FC 240200C8 */  addiu     $v0, $zero, 0xC8
/* 364400 E0062100 A202003B */  sb        $v0, 0x3B($s0)
/* 364404 E0062104 A2020038 */  sb        $v0, 0x38($s0)
/* 364408 E0062108 24020015 */  addiu     $v0, $zero, 0x15
/* 36440C E006210C A202003C */  sb        $v0, 0x3C($s0)
/* 364410 E0062110 A2020039 */  sb        $v0, 0x39($s0)
/* 364414 E0062114 240200D4 */  addiu     $v0, $zero, 0xD4
.LE0062118:
/* 364418 E0062118 A202003D */  sb        $v0, 0x3D($s0)
/* 36441C E006211C A202003A */  sb        $v0, 0x3A($s0)
/* 364420 E0062120 24120001 */  addiu     $s2, $zero, 0x1
/* 364424 E0062124 0255102A */  slt       $v0, $s2, $s5
/* 364428 E0062128 1040002C */  beqz      $v0, .LE00621DC
/* 36442C E006212C 26100040 */   addiu    $s0, $s0, 0x40
/* 364430 E0062130 26B3FFFF */  addiu     $s3, $s5, -0x1
/* 364434 E0062134 2610002C */  addiu     $s0, $s0, 0x2C
/* 364438 E0062138 0000882D */  daddu     $s1, $zero, $zero
/* 36443C E006213C 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 364440 E0062140 4481E000 */  mtc1      $at, $f28
/* 364444 E0062144 3C0142B4 */  lui       $at, (0x42B40000 >> 16)
/* 364448 E0062148 4481D000 */  mtc1      $at, $f26
/* 36444C E006214C 3C013DCC */  lui       $at, (0x3DCCCCCD >> 16)
/* 364450 E0062150 3421CCCD */  ori       $at, $at, (0x3DCCCCCD & 0xFFFF)
/* 364454 E0062154 4481C000 */  mtc1      $at, $f24
.LE0062158:
/* 364458 E0062158 16600002 */  bnez      $s3, .LE0062164
/* 36445C E006215C 0233001A */   div      $zero, $s1, $s3
/* 364460 E0062160 0007000D */  break     7
.LE0062164:
/* 364464 E0062164 2401FFFF */  addiu     $at, $zero, -0x1
/* 364468 E0062168 16610004 */  bne       $s3, $at, .LE006217C
/* 36446C E006216C 3C018000 */   lui      $at, (0x80000000 >> 16)
/* 364470 E0062170 16210002 */  bne       $s1, $at, .LE006217C
/* 364474 E0062174 00000000 */   nop
/* 364478 E0062178 0006000D */  break     6
.LE006217C:
/* 36447C E006217C 00001012 */  mflo      $v0
/* 364480 E0062180 4482B000 */  mtc1      $v0, $f22
/* 364484 E0062184 00000000 */  nop
/* 364488 E0062188 4680B5A0 */  cvt.s.w   $f22, $f22
/* 36448C E006218C 461AB500 */  add.s     $f20, $f22, $f26
/* 364490 E0062190 26310168 */  addiu     $s1, $s1, 0x168
/* 364494 E0062194 26520001 */  addiu     $s2, $s2, 0x1
/* 364498 E0062198 0C080144 */  jal       shim_cos_deg
/* 36449C E006219C 4600A306 */   mov.s    $f12, $f20
/* 3644A0 E00621A0 4600A306 */  mov.s     $f12, $f20
/* 3644A4 E00621A4 0C080140 */  jal       shim_sin_deg
/* 3644A8 E00621A8 E600FFD8 */   swc1     $f0, -0x28($s0)
/* 3644AC E00621AC E600FFDC */  swc1      $f0, -0x24($s0)
/* 3644B0 E00621B0 AE00FFE0 */  sw        $zero, -0x20($s0)
/* 3644B4 E00621B4 AE00FFE4 */  sw        $zero, -0x1C($s0)
/* 3644B8 E00621B8 AE00FFE8 */  sw        $zero, -0x18($s0)
/* 3644BC E00621BC AE00FFEC */  sw        $zero, -0x14($s0)
/* 3644C0 E00621C0 E618FFF0 */  swc1      $f24, -0x10($s0)
/* 3644C4 E00621C4 E618FFF4 */  swc1      $f24, -0xC($s0)
/* 3644C8 E00621C8 E61C0004 */  swc1      $f28, 0x4($s0)
/* 3644CC E00621CC E6160000 */  swc1      $f22, 0x0($s0)
/* 3644D0 E00621D0 0255102A */  slt       $v0, $s2, $s5
/* 3644D4 E00621D4 1440FFE0 */  bnez      $v0, .LE0062158
/* 3644D8 E00621D8 26100040 */   addiu    $s0, $s0, 0x40
.LE00621DC:
/* 3644DC E00621DC 0280102D */  daddu     $v0, $s4, $zero
/* 3644E0 E00621E0 8FBF0040 */  lw        $ra, 0x40($sp)
/* 3644E4 E00621E4 8FB5003C */  lw        $s5, 0x3C($sp)
/* 3644E8 E00621E8 8FB40038 */  lw        $s4, 0x38($sp)
/* 3644EC E00621EC 8FB30034 */  lw        $s3, 0x34($sp)
/* 3644F0 E00621F0 8FB20030 */  lw        $s2, 0x30($sp)
/* 3644F4 E00621F4 8FB1002C */  lw        $s1, 0x2C($sp)
/* 3644F8 E00621F8 8FB00028 */  lw        $s0, 0x28($sp)
/* 3644FC E00621FC D7BC0068 */  ldc1      $f28, 0x68($sp)
/* 364500 E0062200 D7BA0060 */  ldc1      $f26, 0x60($sp)
/* 364504 E0062204 D7B80058 */  ldc1      $f24, 0x58($sp)
/* 364508 E0062208 D7B60050 */  ldc1      $f22, 0x50($sp)
/* 36450C E006220C D7B40048 */  ldc1      $f20, 0x48($sp)
/* 364510 E0062210 03E00008 */  jr        $ra
/* 364514 E0062214 27BD0070 */   addiu    $sp, $sp, 0x70

### DECOMPILED C INSTRUCTIONS:

EffectInstance* debuff_main(s32 type, f32 x, f32 y, f32 z) {
    EffectBlueprint bp;
    EffectInstance* effect;
    DebuffFXData* data;
    s32 numParts = 8;
    s32 i;

    bp.unk_00 = 0;
    bp.init = debuff_init;
    bp.update = debuff_update;
    bp.renderWorld = debuff_render;
    bp.renderUI = NULL;
    bp.effectID = EFFECT_DEBUFF;

    effect = shim_create_effect_instance(&bp);
    effect->numParts = numParts;

    effect->data.debuff = data = shim_general_heap_malloc(numParts * sizeof(*data));

    ASSERT(data != NULL);

    shim_mem_clear(data, numParts * sizeof(*data));

    data->timeLeft = 30;
    data->lifetime = 0;
    data->type = type;
    data->pos.x = x;
    data->pos.y = y;
    data->pos.z = z;
    data->alpha = 255;

    if (type == 0) {
        data->envCol.r  = 20;
        data->primCol.r = 20;
        data->envCol.g  = 21;
        data->primCol.g = 21;
        data->envCol.b  = 242;
        data->primCol.b = 242;
    } else {
        data->envCol.r  = 200;
        data->primCol.r = 200;
        data->envCol.g  = 21;
        data->primCol.g = 21;
        data->envCol.b  = 212;
        data->primCol.b = 212;
    }

    data++;
    for (i = 1; i < numParts; i++, data++) {
        s32 angle = ((i - 1) * 360) / (numParts - 1);
        f32 temp2 = 1.0f;

        data->pos.x = shim_cos_deg(angle + 90.0f);
        data->pos.y = shim_sin_deg(angle + 90.0f);
        data->pos.z = 0.0f;
        data->unk_10 = 0.0f;
        data->unk_14 = 0.0f;
        data->unk_18 = 0.0f;
        data->scaleY = 0.1f;
        data->scaleX = 0.1f;
        data->unk_30 = temp2;
        data->rotZ = angle;
    }

    return effect;
}