### RAW ASSEMBLY INSTRUCTIONS:

glabel evt_set_variable
/* ECA48 802C8098 27BDFFE0 */  addiu     $sp, $sp, -0x20
/* ECA4C 802C809C 0080382D */  daddu     $a3, $a0, $zero
/* ECA50 802C80A0 AFB00010 */  sw        $s0, 0x10($sp)
/* ECA54 802C80A4 00A0802D */  daddu     $s0, $a1, $zero
/* ECA58 802C80A8 AFB20018 */  sw        $s2, 0x18($sp)
/* ECA5C 802C80AC 00C0902D */  daddu     $s2, $a2, $zero
/* ECA60 802C80B0 3C02EFE8 */  lui       $v0, (0xEFE82080 >> 16)
/* ECA64 802C80B4 34422080 */  ori       $v0, $v0, (0xEFE82080 & 0xFFFF)
/* ECA68 802C80B8 0050102A */  slt       $v0, $v0, $s0
/* ECA6C 802C80BC AFBF001C */  sw        $ra, 0x1C($sp)
/* ECA70 802C80C0 10400099 */  beqz      $v0, .L802C8328
/* ECA74 802C80C4 AFB10014 */   sw       $s1, 0x14($sp)
/* ECA78 802C80C8 3C02F2E3 */  lui       $v0, (0xF2E31100 >> 16)
/* ECA7C 802C80CC 34421100 */  ori       $v0, $v0, (0xF2E31100 & 0xFFFF)
/* ECA80 802C80D0 0050102A */  slt       $v0, $v0, $s0
/* ECA84 802C80D4 14400007 */  bnez      $v0, .L802C80F4
/* ECA88 802C80D8 3C02F414 */   lui      $v0, (0xF4143E00 >> 16)
/* ECA8C 802C80DC 0C0B1248 */  jal       evt_fixed_var_to_float
/* ECA90 802C80E0 0240202D */   daddu    $a0, $s2, $zero
/* ECA94 802C80E4 4600008D */  trunc.w.s $f2, $f0
/* ECA98 802C80E8 44021000 */  mfc1      $v0, $f2
/* ECA9C 802C80EC 080B2105 */  j         .L802C8414
/* ECAA0 802C80F0 00000000 */   nop
.L802C80F4:
/* ECAA4 802C80F4 34423E00 */  ori       $v0, $v0, (0xF4143E00 & 0xFFFF)
/* ECAA8 802C80F8 0050102A */  slt       $v0, $v0, $s0
/* ECAAC 802C80FC 54400017 */  bnel      $v0, $zero, .L802C815C
/* ECAB0 802C8100 3C02F545 */   lui      $v0, (0xF5456B00 >> 16)
/* ECAB4 802C8104 3C020C84 */  lui       $v0, (0xC845880 >> 16)
/* ECAB8 802C8108 34425880 */  ori       $v0, $v0, (0xC845880 & 0xFFFF)
/* ECABC 802C810C 02028021 */  addu      $s0, $s0, $v0
/* ECAC0 802C8110 06010002 */  bgez      $s0, .L802C811C
/* ECAC4 802C8114 0200102D */   daddu    $v0, $s0, $zero
/* ECAC8 802C8118 2602001F */  addiu     $v0, $s0, 0x1F
.L802C811C:
/* ECACC 802C811C 00022943 */  sra       $a1, $v0, 5
/* ECAD0 802C8120 00A0202D */  daddu     $a0, $a1, $zero
/* ECAD4 802C8124 00041140 */  sll       $v0, $a0, 5
/* ECAD8 802C8128 12400009 */  beqz      $s2, .L802C8150
/* ECADC 802C812C 02022823 */   subu     $a1, $s0, $v0
/* ECAE0 802C8130 8CE20140 */  lw        $v0, 0x140($a3)
/* ECAE4 802C8134 00042080 */  sll       $a0, $a0, 2
/* ECAE8 802C8138 00822021 */  addu      $a0, $a0, $v0
/* ECAEC 802C813C 24020001 */  addiu     $v0, $zero, 0x1
/* ECAF0 802C8140 8C830000 */  lw        $v1, 0x0($a0)
/* ECAF4 802C8144 00A21004 */  sllv      $v0, $v0, $a1
/* ECAF8 802C8148 080B20C9 */  j         .L802C8324
/* ECAFC 802C814C 00621825 */   or       $v1, $v1, $v0
.L802C8150:
/* ECB00 802C8150 8CE20140 */  lw        $v0, 0x140($a3)
/* ECB04 802C8154 080B20C3 */  j         .L802C830C
/* ECB08 802C8158 00042080 */   sll      $a0, $a0, 2
.L802C815C:
/* ECB0C 802C815C 34426B00 */  ori       $v0, $v0, (0xF5456B00 & 0xFFFF)
/* ECB10 802C8160 0050102A */  slt       $v0, $v0, $s0
/* ECB14 802C8164 1440000A */  bnez      $v0, .L802C8190
/* ECB18 802C8168 3C02F676 */   lui      $v0, (0xF6769800 >> 16)
/* ECB1C 802C816C 3C020B53 */  lui       $v0, (0xB532B80 >> 16)
/* ECB20 802C8170 34422B80 */  ori       $v0, $v0, (0xB532B80 & 0xFFFF)
/* ECB24 802C8174 02028021 */  addu      $s0, $s0, $v0
/* ECB28 802C8178 8CE3013C */  lw        $v1, 0x13C($a3)
/* ECB2C 802C817C 00101080 */  sll       $v0, $s0, 2
/* ECB30 802C8180 00431021 */  addu      $v0, $v0, $v1
/* ECB34 802C8184 8C510000 */  lw        $s1, 0x0($v0)
/* ECB38 802C8188 080B2104 */  j         .L802C8410
/* ECB3C 802C818C AC520000 */   sw       $s2, 0x0($v0)
.L802C8190:
/* ECB40 802C8190 34429800 */  ori       $v0, $v0, (0xF6769800 & 0xFFFF)
/* ECB44 802C8194 0050102A */  slt       $v0, $v0, $s0
/* ECB48 802C8198 1440000C */  bnez      $v0, .L802C81CC
/* ECB4C 802C819C 3C02F7A7 */   lui      $v0, (0xF7A7C500 >> 16)
/* ECB50 802C81A0 3C020A21 */  lui       $v0, (0xA21FE80 >> 16)
/* ECB54 802C81A4 3442FE80 */  ori       $v0, $v0, (0xA21FE80 & 0xFFFF)
/* ECB58 802C81A8 02028021 */  addu      $s0, $s0, $v0
/* ECB5C 802C81AC 0C05154E */  jal       get_global_byte
/* ECB60 802C81B0 0200202D */   daddu    $a0, $s0, $zero
/* ECB64 802C81B4 0040882D */  daddu     $s1, $v0, $zero
/* ECB68 802C81B8 0200202D */  daddu     $a0, $s0, $zero
/* ECB6C 802C81BC 0C051548 */  jal       set_global_byte
/* ECB70 802C81C0 0240282D */   daddu    $a1, $s2, $zero
/* ECB74 802C81C4 080B2105 */  j         .L802C8414
/* ECB78 802C81C8 0220102D */   daddu    $v0, $s1, $zero
.L802C81CC:
/* ECB7C 802C81CC 3442C500 */  ori       $v0, $v0, (0xF7A7C500 & 0xFFFF)
/* ECB80 802C81D0 0050102A */  slt       $v0, $v0, $s0
/* ECB84 802C81D4 1440000C */  bnez      $v0, .L802C8208
/* ECB88 802C81D8 3C02F8D8 */   lui      $v0, (0xF8D8F200 >> 16)
/* ECB8C 802C81DC 3C0208F0 */  lui       $v0, (0x8F0D180 >> 16)
/* ECB90 802C81E0 3442D180 */  ori       $v0, $v0, (0x8F0D180 & 0xFFFF)
/* ECB94 802C81E4 02028021 */  addu      $s0, $s0, $v0
/* ECB98 802C81E8 0C051594 */  jal       get_area_byte
/* ECB9C 802C81EC 0200202D */   daddu    $a0, $s0, $zero
/* ECBA0 802C81F0 0040882D */  daddu     $s1, $v0, $zero
/* ECBA4 802C81F4 0200202D */  daddu     $a0, $s0, $zero
/* ECBA8 802C81F8 0C05158E */  jal       set_area_byte
/* ECBAC 802C81FC 0240282D */   daddu    $a1, $s2, $zero
/* ECBB0 802C8200 080B2105 */  j         .L802C8414
/* ECBB4 802C8204 0220102D */   daddu    $v0, $s1, $zero
.L802C8208:
/* ECBB8 802C8208 3442F200 */  ori       $v0, $v0, (0xF8D8F200 & 0xFFFF)
/* ECBBC 802C820C 0050102A */  slt       $v0, $v0, $s0
/* ECBC0 802C8210 14400010 */  bnez      $v0, .L802C8254
/* ECBC4 802C8214 3C02FA0A */   lui      $v0, (0xFA0A1F00 >> 16)
/* ECBC8 802C8218 3C0207BF */  lui       $v0, (0x7BFA480 >> 16)
/* ECBCC 802C821C 3442A480 */  ori       $v0, $v0, (0x7BFA480 & 0xFFFF)
/* ECBD0 802C8220 02028021 */  addu      $s0, $s0, $v0
/* ECBD4 802C8224 0C05152F */  jal       get_global_flag
/* ECBD8 802C8228 0200202D */   daddu    $a0, $s0, $zero
/* ECBDC 802C822C 12400005 */  beqz      $s2, .L802C8244
/* ECBE0 802C8230 0040882D */   daddu    $s1, $v0, $zero
/* ECBE4 802C8234 0C051514 */  jal       set_global_flag
/* ECBE8 802C8238 0200202D */   daddu    $a0, $s0, $zero
/* ECBEC 802C823C 080B2105 */  j         .L802C8414
/* ECBF0 802C8240 0220102D */   daddu    $v0, $s1, $zero
.L802C8244:
/* ECBF4 802C8244 0C0514F8 */  jal       clear_global_flag
/* ECBF8 802C8248 0200202D */   daddu    $a0, $s0, $zero
/* ECBFC 802C824C 080B2105 */  j         .L802C8414
/* ECC00 802C8250 0220102D */   daddu    $v0, $s1, $zero
.L802C8254:
/* ECC04 802C8254 34421F00 */  ori       $v0, $v0, (0xFA0A1F00 & 0xFFFF)
/* ECC08 802C8258 0050102A */  slt       $v0, $v0, $s0
/* ECC0C 802C825C 14400010 */  bnez      $v0, .L802C82A0
/* ECC10 802C8260 3C02FB3B */   lui      $v0, (0xFB3B4C00 >> 16)
/* ECC14 802C8264 3C02068E */  lui       $v0, (0x68E7780 >> 16)
/* ECC18 802C8268 34427780 */  ori       $v0, $v0, (0x68E7780 & 0xFFFF)
/* ECC1C 802C826C 02028021 */  addu      $s0, $s0, $v0
/* ECC20 802C8270 0C05157C */  jal       get_area_flag
/* ECC24 802C8274 0200202D */   daddu    $a0, $s0, $zero
/* ECC28 802C8278 12400005 */  beqz      $s2, .L802C8290
/* ECC2C 802C827C 0040882D */   daddu    $s1, $v0, $zero
/* ECC30 802C8280 0C051568 */  jal       set_area_flag
/* ECC34 802C8284 0200202D */   daddu    $a0, $s0, $zero
/* ECC38 802C8288 080B2105 */  j         .L802C8414
/* ECC3C 802C828C 0220102D */   daddu    $v0, $s1, $zero
.L802C8290:
/* ECC40 802C8290 0C051553 */  jal       clear_area_flag
/* ECC44 802C8294 0200202D */   daddu    $a0, $s0, $zero
/* ECC48 802C8298 080B2105 */  j         .L802C8414
/* ECC4C 802C829C 0220102D */   daddu    $v0, $s1, $zero
.L802C82A0:
/* ECC50 802C82A0 34424C00 */  ori       $v0, $v0, (0xFB3B4C00 & 0xFFFF)
/* ECC54 802C82A4 0050102A */  slt       $v0, $v0, $s0
/* ECC58 802C82A8 54400021 */  bnel      $v0, $zero, .L802C8330
/* ECC5C 802C82AC 3C02FC6C */   lui      $v0, (0xFC6C7900 >> 16)
/* ECC60 802C82B0 3C02055D */  lui       $v0, (0x55D4A80 >> 16)
/* ECC64 802C82B4 34424A80 */  ori       $v0, $v0, (0x55D4A80 & 0xFFFF)
/* ECC68 802C82B8 02028021 */  addu      $s0, $s0, $v0
/* ECC6C 802C82BC 06010002 */  bgez      $s0, .L802C82C8
/* ECC70 802C82C0 0200102D */   daddu    $v0, $s0, $zero
/* ECC74 802C82C4 2602001F */  addiu     $v0, $s0, 0x1F
.L802C82C8:
/* ECC78 802C82C8 00022943 */  sra       $a1, $v0, 5
/* ECC7C 802C82CC 00A0202D */  daddu     $a0, $a1, $zero
/* ECC80 802C82D0 00041140 */  sll       $v0, $a0, 5
/* ECC84 802C82D4 1240000A */  beqz      $s2, .L802C8300
/* ECC88 802C82D8 02022823 */   subu     $a1, $s0, $v0
/* ECC8C 802C82DC 3C02802E */  lui       $v0, %hi(gMapFlags)
/* ECC90 802C82E0 8C42A480 */  lw        $v0, %lo(gMapFlags)($v0)
/* ECC94 802C82E4 00042080 */  sll       $a0, $a0, 2
/* ECC98 802C82E8 00822021 */  addu      $a0, $a0, $v0
/* ECC9C 802C82EC 24020001 */  addiu     $v0, $zero, 0x1
/* ECCA0 802C82F0 8C830000 */  lw        $v1, 0x0($a0)
/* ECCA4 802C82F4 00A21004 */  sllv      $v0, $v0, $a1
/* ECCA8 802C82F8 080B20C9 */  j         .L802C8324
/* ECCAC 802C82FC 00621825 */   or       $v1, $v1, $v0
.L802C8300:
/* ECCB0 802C8300 3C02802E */  lui       $v0, %hi(gMapFlags)
/* ECCB4 802C8304 8C42A480 */  lw        $v0, %lo(gMapFlags)($v0)
/* ECCB8 802C8308 00042080 */  sll       $a0, $a0, 2
.L802C830C:
/* ECCBC 802C830C 00822021 */  addu      $a0, $a0, $v0
/* ECCC0 802C8310 24020001 */  addiu     $v0, $zero, 0x1
/* ECCC4 802C8314 00A21004 */  sllv      $v0, $v0, $a1
/* ECCC8 802C8318 8C830000 */  lw        $v1, 0x0($a0)
/* ECCCC 802C831C 00021027 */  nor       $v0, $zero, $v0
/* ECCD0 802C8320 00621824 */  and       $v1, $v1, $v0
.L802C8324:
/* ECCD4 802C8324 AC830000 */  sw        $v1, 0x0($a0)
.L802C8328:
/* ECCD8 802C8328 080B2105 */  j         .L802C8414
/* ECCDC 802C832C 0240102D */   daddu    $v0, $s2, $zero
.L802C8330:
/* ECCE0 802C8330 34427900 */  ori       $v0, $v0, (0xFC6C7900 & 0xFFFF)
/* ECCE4 802C8334 0050102A */  slt       $v0, $v0, $s0
/* ECCE8 802C8338 5440001C */  bnel      $v0, $zero, .L802C83AC
/* ECCEC 802C833C 3C02FD9D */   lui      $v0, (0xFD9DA600 >> 16)
/* ECCF0 802C8340 3C02042C */  lui       $v0, (0x42C1D80 >> 16)
/* ECCF4 802C8344 34421D80 */  ori       $v0, $v0, (0x42C1D80 & 0xFFFF)
/* ECCF8 802C8348 02028021 */  addu      $s0, $s0, $v0
/* ECCFC 802C834C 06010002 */  bgez      $s0, .L802C8358
/* ECD00 802C8350 0200102D */   daddu    $v0, $s0, $zero
/* ECD04 802C8354 2602001F */  addiu     $v0, $s0, 0x1F
.L802C8358:
/* ECD08 802C8358 00022943 */  sra       $a1, $v0, 5
/* ECD0C 802C835C 00A0182D */  daddu     $v1, $a1, $zero
/* ECD10 802C8360 00031140 */  sll       $v0, $v1, 5
/* ECD14 802C8364 12400008 */  beqz      $s2, .L802C8388
/* ECD18 802C8368 02022823 */   subu     $a1, $s0, $v0
/* ECD1C 802C836C 00031080 */  sll       $v0, $v1, 2
/* ECD20 802C8370 00E21021 */  addu      $v0, $a3, $v0
/* ECD24 802C8374 24030001 */  addiu     $v1, $zero, 0x1
/* ECD28 802C8378 8C4400C4 */  lw        $a0, 0xC4($v0)
/* ECD2C 802C837C 00A31804 */  sllv      $v1, $v1, $a1
/* ECD30 802C8380 080B20E9 */  j         .L802C83A4
/* ECD34 802C8384 00832025 */   or       $a0, $a0, $v1
.L802C8388:
/* ECD38 802C8388 00031080 */  sll       $v0, $v1, 2
/* ECD3C 802C838C 00E21021 */  addu      $v0, $a3, $v0
/* ECD40 802C8390 24030001 */  addiu     $v1, $zero, 0x1
/* ECD44 802C8394 00A31804 */  sllv      $v1, $v1, $a1
/* ECD48 802C8398 8C4400C4 */  lw        $a0, 0xC4($v0)
/* ECD4C 802C839C 00031827 */  nor       $v1, $zero, $v1
/* ECD50 802C83A0 00832024 */  and       $a0, $a0, $v1
.L802C83A4:
/* ECD54 802C83A4 080B20CA */  j         .L802C8328
/* ECD58 802C83A8 AC4400C4 */   sw       $a0, 0xC4($v0)
.L802C83AC:
/* ECD5C 802C83AC 3442A600 */  ori       $v0, $v0, (0xFD9DA600 & 0xFFFF)
/* ECD60 802C83B0 0050102A */  slt       $v0, $v0, $s0
/* ECD64 802C83B4 1440000B */  bnez      $v0, .L802C83E4
/* ECD68 802C83B8 3C02FECE */   lui      $v0, (0xFECED300 >> 16)
/* ECD6C 802C83BC 3C0202FA */  lui       $v0, (0x2FAF080 >> 16)
/* ECD70 802C83C0 3442F080 */  ori       $v0, $v0, (0x2FAF080 & 0xFFFF)
/* ECD74 802C83C4 02028021 */  addu      $s0, $s0, $v0
/* ECD78 802C83C8 3C03802E */  lui       $v1, %hi(gMapVars)
/* ECD7C 802C83CC 8C63A484 */  lw        $v1, %lo(gMapVars)($v1)
/* ECD80 802C83D0 00101080 */  sll       $v0, $s0, 2
/* ECD84 802C83D4 00431021 */  addu      $v0, $v0, $v1
/* ECD88 802C83D8 8C510000 */  lw        $s1, 0x0($v0)
/* ECD8C 802C83DC 080B2104 */  j         .L802C8410
/* ECD90 802C83E0 AC520000 */   sw       $s2, 0x0($v0)
.L802C83E4:
/* ECD94 802C83E4 3442D300 */  ori       $v0, $v0, (0xFECED300 & 0xFFFF)
/* ECD98 802C83E8 0050102A */  slt       $v0, $v0, $s0
/* ECD9C 802C83EC 14400009 */  bnez      $v0, .L802C8414
/* ECDA0 802C83F0 0240102D */   daddu    $v0, $s2, $zero
/* ECDA4 802C83F4 3C0201C9 */  lui       $v0, (0x1C9C380 >> 16)
/* ECDA8 802C83F8 3442C380 */  ori       $v0, $v0, (0x1C9C380 & 0xFFFF)
/* ECDAC 802C83FC 02028021 */  addu      $s0, $s0, $v0
/* ECDB0 802C8400 00101080 */  sll       $v0, $s0, 2
/* ECDB4 802C8404 00E21021 */  addu      $v0, $a3, $v0
/* ECDB8 802C8408 8C510084 */  lw        $s1, 0x84($v0)
/* ECDBC 802C840C AC520084 */  sw        $s2, 0x84($v0)
.L802C8410:
/* ECDC0 802C8410 0220102D */  daddu     $v0, $s1, $zero
.L802C8414:
/* ECDC4 802C8414 8FBF001C */  lw        $ra, 0x1C($sp)
/* ECDC8 802C8418 8FB20018 */  lw        $s2, 0x18($sp)
/* ECDCC 802C841C 8FB10014 */  lw        $s1, 0x14($sp)
/* ECDD0 802C8420 8FB00010 */  lw        $s0, 0x10($sp)
/* ECDD4 802C8424 03E00008 */  jr        $ra
/* ECDD8 802C8428 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

s32 evt_set_variable(Evt* script, Bytecode var, s32 value) {
    s32 flagBitPos;
    s32 oldValue;

    if (var <= EVT_LIMIT) {
        return value;
    } else if (var <= EVT_FIXED_CUTOFF) {
        return evt_fixed_var_to_float(value);
    } else if (var <= EVT_ARRAY_FLAG_CUTOFF) {
        var = EVT_INDEX_OF_ARRAY_FLAG(var);
        flagBitPos = var % 32;
        if (value) {
            script->flagArray[var / 32] |= 1 << flagBitPos;
        } else {
            script->flagArray[var / 32] &= ~(1 << flagBitPos);
        }
        return value;
    } else if (var <= EVT_ARRAY_VAR_CUTOFF) {
        var = EVT_INDEX_OF_ARRAY_VAR(var);
        oldValue = script->array[var];
        script->array[var] = value;
        return oldValue;
    } else if (var <= EVT_GAME_BYTE_CUTOFF) {
        var = EVT_INDEX_OF_GAME_BYTE(var);
        oldValue = get_global_byte(var);
        set_global_byte(var, value);
        return oldValue;
    } else if (var <= EVT_AREA_BYTE_CUTOFF) {
        var = EVT_INDEX_OF_AREA_BYTE(var);
        oldValue = get_area_byte(var);
        set_area_byte(var, value);
        return oldValue;
    } else if (var <= EVT_GAME_FLAG_CUTOFF) {
        var = EVT_INDEX_OF_GAME_FLAG(var);
        oldValue = get_global_flag(var);
        if (value) {
            set_global_flag(var);
        } else {
            clear_global_flag(var);
        }
        return oldValue;
    } else if (var <= EVT_AREA_FLAG_CUTOFF) {
        var = EVT_INDEX_OF_AREA_FLAG(var);
        oldValue = get_area_flag(var);
        if (value) {
            set_area_flag(var);
        } else {
            clear_area_flag(var);
        }
        return oldValue;
    } else if (var <= EVT_MAP_FLAG_CUTOFF) {
        var = EVT_INDEX_OF_MAP_FLAG(var);
        flagBitPos = var % 32;
        if (value) {
            gMapFlags[var / 32] |= 1 << flagBitPos;
        } else {
            gMapFlags[var / 32] &= ~(1 << flagBitPos);
        }
        return value;
    } else if (var <= EVT_LOCAL_FLAG_CUTOFF) {
        var = EVT_INDEX_OF_LOCAL_FLAG(var);
        flagBitPos = var % 32;
        if (value) {
            script->varFlags[var / 32] |= 1 << flagBitPos;
        } else {
            script->varFlags[var / 32] &= ~(1 << flagBitPos);
        }
        return value;
    } else if (var <= EVT_MAP_VAR_CUTOFF) {
        var = EVT_INDEX_OF_MAP_VAR(var);
        oldValue = gMapVars[var];
        gMapVars[var] = value;
        return oldValue;
    } else if (var <= EVT_LOCAL_VAR_CUTOFF) {
        var = EVT_INDEX_OF_LOCAL_VAR(var);
        oldValue = script->varTable[var];
        script->varTable[var] = value;
        return oldValue;
    } else {
        return value;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel update_exit_map_screen_overlay
/* CE9AC 801382AC 3C038015 */  lui       $v1, %hi(CurrentScreenTransition)
/* CE9B0 801382B0 8C63C6F0 */  lw        $v1, %lo(CurrentScreenTransition)($v1)
/* CE9B4 801382B4 27BDFFD0 */  addiu     $sp, $sp, -0x30
/* CE9B8 801382B8 AFB60028 */  sw        $s6, 0x28($sp)
/* CE9BC 801382BC 0080B02D */  daddu     $s6, $a0, $zero
/* CE9C0 801382C0 AFB10014 */  sw        $s1, 0x14($sp)
/* CE9C4 801382C4 0000882D */  daddu     $s1, $zero, $zero
/* CE9C8 801382C8 AFB3001C */  sw        $s3, 0x1C($sp)
/* CE9CC 801382CC 0220982D */  daddu     $s3, $s1, $zero
/* CE9D0 801382D0 AFB40020 */  sw        $s4, 0x20($sp)
/* CE9D4 801382D4 0220A02D */  daddu     $s4, $s1, $zero
/* CE9D8 801382D8 AFB50024 */  sw        $s5, 0x24($sp)
/* CE9DC 801382DC 0220A82D */  daddu     $s5, $s1, $zero
/* CE9E0 801382E0 AFB20018 */  sw        $s2, 0x18($sp)
/* CE9E4 801382E4 24120014 */  addiu     $s2, $zero, 0x14
/* CE9E8 801382E8 AFBF002C */  sw        $ra, 0x2C($sp)
/* CE9EC 801382EC 2C620011 */  sltiu     $v0, $v1, 0x11
/* CE9F0 801382F0 1040005E */  beqz      $v0, .L8013846C
/* CE9F4 801382F4 AFB00010 */   sw       $s0, 0x10($sp)
/* CE9F8 801382F8 00031080 */  sll       $v0, $v1, 2
/* CE9FC 801382FC 3C018015 */  lui       $at, %hi(jtbl_80150EF0)
/* CEA00 80138300 00220821 */  addu      $at, $at, $v0
/* CEA04 80138304 8C220EF0 */  lw        $v0, %lo(jtbl_80150EF0)($at)
/* CEA08 80138308 00400008 */  jr        $v0
/* CEA0C 8013830C 00000000 */   nop
glabel .L80138310
/* CEA10 80138310 0804E11B */  j         .L8013846C
/* CEA14 80138314 0000882D */   daddu    $s1, $zero, $zero
glabel .L80138318
/* CEA18 80138318 241500D0 */  addiu     $s5, $zero, 0xD0
/* CEA1C 8013831C 02A0A02D */  daddu     $s4, $s5, $zero
/* CEA20 80138320 02A0982D */  daddu     $s3, $s5, $zero
/* CEA24 80138324 24110001 */  addiu     $s1, $zero, 0x1
/* CEA28 80138328 3C048007 */  lui       $a0, %hi(gGameStatusPtr)
/* CEA2C 8013832C 8C84419C */  lw        $a0, %lo(gGameStatusPtr)($a0)
/* CEA30 80138330 80830071 */  lb        $v1, 0x71($a0)
/* CEA34 80138334 24020002 */  addiu     $v0, $zero, 0x2
/* CEA38 80138338 1462004C */  bne       $v1, $v0, .L8013846C
/* CEA3C 8013833C 2412000A */   addiu    $s2, $zero, 0xA
/* CEA40 80138340 24020012 */  addiu     $v0, $zero, 0x12
/* CEA44 80138344 0804E11B */  j         .L8013846C
/* CEA48 80138348 A0820072 */   sb       $v0, 0x72($a0)
glabel .L8013834C
/* CEA4C 8013834C 241500D0 */  addiu     $s5, $zero, 0xD0
/* CEA50 80138350 02A0A02D */  daddu     $s4, $s5, $zero
/* CEA54 80138354 02A0982D */  daddu     $s3, $s5, $zero
glabel .L80138358
/* CEA58 80138358 0804E11B */  j         .L8013846C
/* CEA5C 8013835C 24110001 */   addiu    $s1, $zero, 0x1
glabel .L80138360
/* CEA60 80138360 3C048007 */  lui       $a0, %hi(gGameStatusPtr)
/* CEA64 80138364 8C84419C */  lw        $a0, %lo(gGameStatusPtr)($a0)
/* CEA68 80138368 80830071 */  lb        $v1, 0x71($a0)
/* CEA6C 8013836C 24020002 */  addiu     $v0, $zero, 0x2
/* CEA70 80138370 14620004 */  bne       $v1, $v0, .L80138384
/* CEA74 80138374 241500D0 */   addiu    $s5, $zero, 0xD0
/* CEA78 80138378 24020012 */  addiu     $v0, $zero, 0x12
/* CEA7C 8013837C A0820072 */  sb        $v0, 0x72($a0)
glabel .L80138380
/* CEA80 80138380 241500D0 */  addiu     $s5, $zero, 0xD0
.L80138384:
/* CEA84 80138384 02A0A02D */  daddu     $s4, $s5, $zero
/* CEA88 80138388 02A0982D */  daddu     $s3, $s5, $zero
glabel .L8013838C
/* CEA8C 8013838C 24110001 */  addiu     $s1, $zero, 0x1
/* CEA90 80138390 0804E11B */  j         .L8013846C
/* CEA94 80138394 24120007 */   addiu    $s2, $zero, 0x7
glabel .L80138398
/* CEA98 80138398 241500D0 */  addiu     $s5, $zero, 0xD0
/* CEA9C 8013839C 02A0A02D */  daddu     $s4, $s5, $zero
/* CEAA0 801383A0 02A0982D */  daddu     $s3, $s5, $zero
glabel .L801383A4
/* CEAA4 801383A4 24110001 */  addiu     $s1, $zero, 0x1
/* CEAA8 801383A8 0804E11B */  j         .L8013846C
/* CEAAC 801383AC 24120032 */   addiu    $s2, $zero, 0x32
glabel .L801383B0
/* CEAB0 801383B0 0000202D */  daddu     $a0, $zero, $zero
/* CEAB4 801383B4 0C04E035 */  jal       set_screen_overlay_alpha
/* CEAB8 801383B8 0000282D */   daddu    $a1, $zero, $zero
/* CEABC 801383BC 0804E11B */  j         .L8013846C
/* CEAC0 801383C0 24110004 */   addiu    $s1, $zero, 0x4
glabel .L801383C4
/* CEAC4 801383C4 241500D0 */  addiu     $s5, $zero, 0xD0
/* CEAC8 801383C8 02A0A02D */  daddu     $s4, $s5, $zero
/* CEACC 801383CC 02A0982D */  daddu     $s3, $s5, $zero
glabel .L801383D0
/* CEAD0 801383D0 0000202D */  daddu     $a0, $zero, $zero
/* CEAD4 801383D4 0C04E035 */  jal       set_screen_overlay_alpha
/* CEAD8 801383D8 0000282D */   daddu    $a1, $zero, $zero
/* CEADC 801383DC 24110004 */  addiu     $s1, $zero, 0x4
/* CEAE0 801383E0 0804E11B */  j         .L8013846C
/* CEAE4 801383E4 24120007 */   addiu    $s2, $zero, 0x7
glabel .L801383E8
/* CEAE8 801383E8 0000202D */  daddu     $a0, $zero, $zero
/* CEAEC 801383EC 3C054320 */  lui       $a1, (0x43200000 >> 16)
/* CEAF0 801383F0 241500D0 */  addiu     $s5, $zero, 0xD0
/* CEAF4 801383F4 02A0A02D */  daddu     $s4, $s5, $zero
/* CEAF8 801383F8 02A0982D */  daddu     $s3, $s5, $zero
/* CEAFC 801383FC 24110005 */  addiu     $s1, $zero, 0x5
/* CEB00 80138400 0C04E035 */  jal       set_screen_overlay_alpha
/* CEB04 80138404 24120007 */   addiu    $s2, $zero, 0x7
/* CEB08 80138408 0804E11B */  j         .L8013846C
/* CEB0C 8013840C 00000000 */   nop
glabel .L80138410
/* CEB10 80138410 0000202D */  daddu     $a0, $zero, $zero
/* CEB14 80138414 0C04E035 */  jal       set_screen_overlay_alpha
/* CEB18 80138418 0000282D */   daddu    $a1, $zero, $zero
/* CEB1C 8013841C 24110005 */  addiu     $s1, $zero, 0x5
/* CEB20 80138420 0804E11B */  j         .L8013846C
/* CEB24 80138424 24120007 */   addiu    $s2, $zero, 0x7
glabel .L80138428
/* CEB28 80138428 0000202D */  daddu     $a0, $zero, $zero
/* CEB2C 8013842C 0080282D */  daddu     $a1, $a0, $zero
/* CEB30 80138430 2406000F */  addiu     $a2, $zero, 0xF
/* CEB34 80138434 0C04DF93 */  jal       set_screen_overlay_center
/* CEB38 80138438 2407001C */   addiu    $a3, $zero, 0x1C
/* CEB3C 8013843C 0000202D */  daddu     $a0, $zero, $zero
/* CEB40 80138440 24050001 */  addiu     $a1, $zero, 0x1
/* CEB44 80138444 24060131 */  addiu     $a2, $zero, 0x131
/* CEB48 80138448 0C04DF93 */  jal       set_screen_overlay_center
/* CEB4C 8013844C 2407009C */   addiu    $a3, $zero, 0x9C
/* CEB50 80138450 3C05437F */  lui       $a1, (0x437F0000 >> 16)
/* CEB54 80138454 0C04DF62 */  jal       set_screen_overlay_params_front
/* CEB58 80138458 2404000C */   addiu    $a0, $zero, 0xC
/* CEB5C 8013845C 24020001 */  addiu     $v0, $zero, 0x1
/* CEB60 80138460 240300FF */  addiu     $v1, $zero, 0xFF
/* CEB64 80138464 0804E16B */  j         .L801385AC
/* CEB68 80138468 A6C30000 */   sh       $v1, 0x0($s6)
.L8013846C:
/* CEB6C 8013846C 3C038015 */  lui       $v1, %hi(CurrentScreenTransition)
/* CEB70 80138470 8C63C6F0 */  lw        $v1, %lo(CurrentScreenTransition)($v1)
/* CEB74 80138474 24020005 */  addiu     $v0, $zero, 0x5
/* CEB78 80138478 14620025 */  bne       $v1, $v0, .L80138510
/* CEB7C 8013847C 0000802D */   daddu    $s0, $zero, $zero
/* CEB80 80138480 3C048080 */  lui       $a0, (0x80808081 >> 16)
/* CEB84 80138484 34848081 */  ori       $a0, $a0, (0x80808081 & 0xFFFF)
/* CEB88 80138488 86C30000 */  lh        $v1, 0x0($s6)
/* CEB8C 8013848C 241000FF */  addiu     $s0, $zero, 0xFF
/* CEB90 80138490 02031823 */  subu      $v1, $s0, $v1
/* CEB94 80138494 00031040 */  sll       $v0, $v1, 1
/* CEB98 80138498 00431021 */  addu      $v0, $v0, $v1
/* CEB9C 8013849C 00021080 */  sll       $v0, $v0, 2
/* CEBA0 801384A0 00431021 */  addu      $v0, $v0, $v1
/* CEBA4 801384A4 00021100 */  sll       $v0, $v0, 4
/* CEBA8 801384A8 00440018 */  mult      $v0, $a0
/* CEBAC 801384AC 0000202D */  daddu     $a0, $zero, $zero
/* CEBB0 801384B0 00004010 */  mfhi      $t0
/* CEBB4 801384B4 01022821 */  addu      $a1, $t0, $v0
/* CEBB8 801384B8 000529C3 */  sra       $a1, $a1, 7
/* CEBBC 801384BC 000217C3 */  sra       $v0, $v0, 31
/* CEBC0 801384C0 00A22823 */  subu      $a1, $a1, $v0
/* CEBC4 801384C4 30A500FF */  andi      $a1, $a1, 0xFF
/* CEBC8 801384C8 00A0302D */  daddu     $a2, $a1, $zero
/* CEBCC 801384CC 0C04DF84 */  jal       set_screen_overlay_color
/* CEBD0 801384D0 00A0382D */   daddu    $a3, $a1, $zero
/* CEBD4 801384D4 3C05437F */  lui       $a1, (0x437F0000 >> 16)
/* CEBD8 801384D8 0C04DF62 */  jal       set_screen_overlay_params_front
/* CEBDC 801384DC 0220202D */   daddu    $a0, $s1, $zero
/* CEBE0 801384E0 86C20000 */  lh        $v0, 0x0($s6)
/* CEBE4 801384E4 96C30000 */  lhu       $v1, 0x0($s6)
/* CEBE8 801384E8 10500027 */  beq       $v0, $s0, .L80138588
/* CEBEC 801384EC 00721021 */   addu     $v0, $v1, $s2
/* CEBF0 801384F0 A6C20000 */  sh        $v0, 0x0($s6)
/* CEBF4 801384F4 00021400 */  sll       $v0, $v0, 16
/* CEBF8 801384F8 00021403 */  sra       $v0, $v0, 16
/* CEBFC 801384FC 28420100 */  slti      $v0, $v0, 0x100
/* CEC00 80138500 50400029 */  beql      $v0, $zero, .L801385A8
/* CEC04 80138504 A6D00000 */   sh       $s0, 0x0($s6)
/* CEC08 80138508 0804E16B */  j         .L801385AC
/* CEC0C 8013850C 0000102D */   daddu    $v0, $zero, $zero
.L80138510:
/* CEC10 80138510 00108400 */  sll       $s0, $s0, 16
/* CEC14 80138514 00108403 */  sra       $s0, $s0, 16
/* CEC18 80138518 0200202D */  daddu     $a0, $s0, $zero
/* CEC1C 8013851C 0260282D */  daddu     $a1, $s3, $zero
/* CEC20 80138520 0280302D */  daddu     $a2, $s4, $zero
/* CEC24 80138524 0C04DF84 */  jal       set_screen_overlay_color
/* CEC28 80138528 02A0382D */   daddu    $a3, $s5, $zero
/* CEC2C 8013852C 1600000A */  bnez      $s0, .L80138558
/* CEC30 80138530 00000000 */   nop
/* CEC34 80138534 86C20000 */  lh        $v0, 0x0($s6)
/* CEC38 80138538 44820000 */  mtc1      $v0, $f0
/* CEC3C 8013853C 00000000 */  nop
/* CEC40 80138540 46800020 */  cvt.s.w   $f0, $f0
/* CEC44 80138544 44050000 */  mfc1      $a1, $f0
/* CEC48 80138548 0C04DF62 */  jal       set_screen_overlay_params_front
/* CEC4C 8013854C 0220202D */   daddu    $a0, $s1, $zero
/* CEC50 80138550 0804E15E */  j         .L80138578
/* CEC54 80138554 240400FF */   addiu    $a0, $zero, 0xFF
.L80138558:
/* CEC58 80138558 86C20000 */  lh        $v0, 0x0($s6)
/* CEC5C 8013855C 44820000 */  mtc1      $v0, $f0
/* CEC60 80138560 00000000 */  nop
/* CEC64 80138564 46800020 */  cvt.s.w   $f0, $f0
/* CEC68 80138568 44050000 */  mfc1      $a1, $f0
/* CEC6C 8013856C 0C04DF69 */  jal       set_screen_overlay_params_back
/* CEC70 80138570 0220202D */   daddu    $a0, $s1, $zero
/* CEC74 80138574 240400FF */  addiu     $a0, $zero, 0xFF
.L80138578:
/* CEC78 80138578 86C20000 */  lh        $v0, 0x0($s6)
/* CEC7C 8013857C 96C30000 */  lhu       $v1, 0x0($s6)
/* CEC80 80138580 14440003 */  bne       $v0, $a0, .L80138590
/* CEC84 80138584 00721021 */   addu     $v0, $v1, $s2
.L80138588:
/* CEC88 80138588 0804E16B */  j         .L801385AC
/* CEC8C 8013858C 24020001 */   addiu    $v0, $zero, 0x1
.L80138590:
/* CEC90 80138590 A6C20000 */  sh        $v0, 0x0($s6)
/* CEC94 80138594 00021400 */  sll       $v0, $v0, 16
/* CEC98 80138598 00021403 */  sra       $v0, $v0, 16
/* CEC9C 8013859C 28420100 */  slti      $v0, $v0, 0x100
/* CECA0 801385A0 50400001 */  beql      $v0, $zero, .L801385A8
/* CECA4 801385A4 A6C40000 */   sh       $a0, 0x0($s6)
.L801385A8:
/* CECA8 801385A8 0000102D */  daddu     $v0, $zero, $zero
.L801385AC:
/* CECAC 801385AC 8FBF002C */  lw        $ra, 0x2C($sp)
/* CECB0 801385B0 8FB60028 */  lw        $s6, 0x28($sp)
/* CECB4 801385B4 8FB50024 */  lw        $s5, 0x24($sp)
/* CECB8 801385B8 8FB40020 */  lw        $s4, 0x20($sp)
/* CECBC 801385BC 8FB3001C */  lw        $s3, 0x1C($sp)
/* CECC0 801385C0 8FB20018 */  lw        $s2, 0x18($sp)
/* CECC4 801385C4 8FB10014 */  lw        $s1, 0x14($sp)
/* CECC8 801385C8 8FB00010 */  lw        $s0, 0x10($sp)
/* CECCC 801385CC 03E00008 */  jr        $ra
/* CECD0 801385D0 27BD0030 */   addiu    $sp, $sp, 0x30

### DECOMPILED C INSTRUCTIONS:

s16 update_exit_map_screen_overlay(s16* progress) {
    u8 overlayColor;
    u8 fadeOutType = OVERLAY_SCREEN_COLOR;
    u8 r = 0;
    u8 g = 0;
    u8 b = 0;
    s16 t = 0;
    s32 fadeRate = STANDARD_FADE_RATE;

    switch (CurrentScreenTransition) {
        case TRANSITION_STANDARD:
            fadeOutType = OVERLAY_VIEWPORT_COLOR;
            break;
        case TRANSITION_TOY_TRAIN:
            fadeOutType = OVERLAY_SCREEN_COLOR;
            break;
        case TRANSITION_END_DEMO_SCENE_BLACK:
            fadeOutType = OVERLAY_VIEWPORT_COLOR;
            fadeRate = FAST_FADE_RATE;
            break;
        case TRANSITION_END_DEMO_SCENE_WHITE:
            r = g = b = 208;
            fadeOutType = OVERLAY_VIEWPORT_COLOR;
            fadeRate = SLOWER_FADE_RATE;
            if (gGameStatusPtr->demoState == DEMO_STATE_CHANGE_MAP) {
                gGameStatusPtr->nextDemoScene = LAST_DEMO_SCENE_IDX;
            }
            break;
        case TRANSITION_BEGIN_OR_END_GAME:
        case TRANSITION_OUTRO_END_SCENE:
            fadeOutType = OVERLAY_VIEWPORT_COLOR;
            fadeRate = SLOW_FADE_RATE;
            break;
        case TRANSITION_BEGIN_OR_END_CHAPTER:
            r = g = b = 208;
            fadeOutType = OVERLAY_VIEWPORT_COLOR;
            break;
        case TRANSITION_SLOW_FADE_TO_WHITE:
            if (gGameStatusPtr->demoState == DEMO_STATE_CHANGE_MAP) {
                gGameStatusPtr->nextDemoScene = LAST_DEMO_SCENE_IDX;
            }
            r = g = b = 208;
            fadeOutType = OVERLAY_VIEWPORT_COLOR;
            fadeRate = SLOW_FADE_RATE;
            break;
        case TRANSITION_AFTER_SAVE_PROMPT:
        case TRANSITION_END_CHAPTER_INTERRUPTED:
            r = g = b = 208;
            fadeOutType = OVERLAY_VIEWPORT_COLOR;
            fadeRate = SLOW_FADE_RATE;
            break;
        case TRANSITION_GET_STAR_CARD:
            r = g = b = 208;
            fadeOutType = OVERLAY_VIEWPORT_COLOR;
            fadeRate = FAST_FADE_RATE;
            break;
        case TRANSITION_ENTER_WORLD:
            set_screen_overlay_alpha(SCREEN_LAYER_FRONT, 0.0f);
            fadeOutType = OVERLAY_VIEWPORT_MARIO;
            break;
        case TRANSITION_MARIO_WHITE:
            r = g = b = 208;
            set_screen_overlay_alpha(SCREEN_LAYER_FRONT, 0.0f);
            fadeOutType = OVERLAY_VIEWPORT_MARIO;
            fadeRate = SLOW_FADE_RATE;
            break;
        case TRANSITION_MARIO_BLACK:
            set_screen_overlay_alpha(SCREEN_LAYER_FRONT, 0.0f);
            fadeOutType = OVERLAY_VIEWPORT_MARIO;
            fadeRate = SLOW_FADE_RATE;
            break;
        case TRANSITION_END_PEACH_INTERLUDE:
            set_screen_overlay_alpha(SCREEN_LAYER_FRONT, 160.0f);
            r = g = b = 208;
            fadeOutType = OVERLAY_VIEWPORT_STAR;
            fadeRate = SLOW_FADE_RATE;
            break;
        case TRANSITION_PEACH_CAPTURED:
            set_screen_overlay_alpha(SCREEN_LAYER_FRONT, 0.0f);
            fadeOutType = OVERLAY_VIEWPORT_STAR;
            fadeRate = SLOW_FADE_RATE;
            break;
        case TRANSITION_SLOW_BLUR_MOTION:
            set_screen_overlay_center(SCREEN_LAYER_FRONT, 0, 15, 28);
            set_screen_overlay_center(SCREEN_LAYER_FRONT, 1, 305, 156);
            set_screen_overlay_params_front(OVERLAY_BLUR, 255.0f);
            *progress = 255;
            return 1;
    }

    if (CurrentScreenTransition == TRANSITION_OUTRO_END_SCENE) {
        overlayColor = ((255 - *progress) * 208) / 255;
        set_screen_overlay_color(SCREEN_LAYER_FRONT, overlayColor, overlayColor, overlayColor);
        set_screen_overlay_params_front(fadeOutType, 255.0f);
        if (*progress == 255) {
            return 1;
        }

        *progress += fadeRate;
        if (*progress > 255) {
            *progress = 255;
        }
    } else {
        set_screen_overlay_color(t, r, g, b);

        if (t == 0) {
            set_screen_overlay_params_front(fadeOutType, *progress);
        } else {
            set_screen_overlay_params_back(fadeOutType, *progress);
        }

        if (*progress == 255) {
            return 1;
        }

        *progress += fadeRate;
        if (*progress > 255) {
            *progress = 255;
        }
    }
    return 0;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel func_8024B5FC
/* 179EDC 8024B5FC 27BDFFB0 */  addiu     $sp, $sp, -0x50
D_8024B600:
/* 179EE0 8024B600 F7BA0038 */  sdc1      $f26, 0x38($sp)
/* 179EE4 8024B604 3C01802A */  lui       $at, %hi(BattleCam_PosX)
/* 179EE8 8024B608 C43AF270 */  lwc1      $f26, %lo(BattleCam_PosX)($at)
/* 179EEC 8024B60C F7BC0040 */  sdc1      $f28, 0x40($sp)
/* 179EF0 8024B610 3C01802A */  lui       $at, %hi(BattleCam_PosY)
D_8024B614:
/* 179EF4 8024B614 C43CF274 */  lwc1      $f28, %lo(BattleCam_PosY)($at)
/* 179EF8 8024B618 F7BE0048 */  sdc1      $f30, 0x48($sp)
/* 179EFC 8024B61C 3C01802A */  lui       $at, %hi(BattleCam_PosZ)
/* 179F00 8024B620 C43EF278 */  lwc1      $f30, %lo(BattleCam_PosZ)($at)
/* 179F04 8024B624 AFB00018 */  sw        $s0, 0x18($sp)
/* 179F08 8024B628 3C10800B */  lui       $s0, %hi(gCameras + 0x558)
/* 179F0C 8024B62C 261022D8 */  addiu     $s0, $s0, %lo(gCameras + 0x558)
/* 179F10 8024B630 AFBF001C */  sw        $ra, 0x1C($sp)
/* 179F14 8024B634 F7B80030 */  sdc1      $f24, 0x30($sp)
/* 179F18 8024B638 F7B60028 */  sdc1      $f22, 0x28($sp)
/* 179F1C 8024B63C F7B40020 */  sdc1      $f20, 0x20($sp)
/* 179F20 8024B640 10A00029 */  beqz      $a1, .L8024B6E8
/* 179F24 8024B644 E7BC0010 */   swc1     $f28, 0x10($sp)
/* 179F28 8024B648 8602001E */  lh        $v0, 0x1E($s0)
/* 179F2C 8024B64C 86040026 */  lh        $a0, 0x26($s0)
/* 179F30 8024B650 86030024 */  lh        $v1, 0x24($s0)
/* 179F34 8024B654 44820000 */  mtc1      $v0, $f0
/* 179F38 8024B658 00000000 */  nop
/* 179F3C 8024B65C 46800020 */  cvt.s.w   $f0, $f0
/* 179F40 8024B660 86020022 */  lh        $v0, 0x22($s0)
D_8024B664:
/* 179F44 8024B664 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomLength)
/* 179F48 8024B668 E420F28C */  swc1      $f0, %lo(BattleCam_InitialBoomLength)($at)
/* 179F4C 8024B66C 44820000 */  mtc1      $v0, $f0
/* 179F50 8024B670 00000000 */  nop
/* 179F54 8024B674 46800020 */  cvt.s.w   $f0, $f0
/* 179F58 8024B678 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomPitch)
/* 179F5C 8024B67C E420F294 */  swc1      $f0, %lo(BattleCam_InitialBoomPitch)($at)
/* 179F60 8024B680 44830000 */  mtc1      $v1, $f0
/* 179F64 8024B684 00000000 */  nop
/* 179F68 8024B688 46800020 */  cvt.s.w   $f0, $f0
/* 179F6C 8024B68C 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomYaw)
/* 179F70 8024B690 E420F290 */  swc1      $f0, %lo(BattleCam_InitialBoomYaw)($at)
/* 179F74 8024B694 04820001 */  bltzl     $a0, .L8024B69C
/* 179F78 8024B698 248400FF */   addiu    $a0, $a0, 0xFF
.L8024B69C:
/* 179F7C 8024B69C 00041203 */  sra       $v0, $a0, 8
/* 179F80 8024B6A0 C6020054 */  lwc1      $f2, 0x54($s0)
/* 179F84 8024B6A4 C6040058 */  lwc1      $f4, 0x58($s0)
/* 179F88 8024B6A8 C606005C */  lwc1      $f6, 0x5C($s0)
/* 179F8C 8024B6AC 3C03802A */  lui       $v1, %hi(BattleCam_MoveTimeLeft)
D_8024B6B0:
/* 179F90 8024B6B0 9463F29E */  lhu       $v1, %lo(BattleCam_MoveTimeLeft)($v1)
D_8024B6B4:
/* 179F94 8024B6B4 44820000 */  mtc1      $v0, $f0
/* 179F98 8024B6B8 00000000 */  nop
/* 179F9C 8024B6BC 46800020 */  cvt.s.w   $f0, $f0
/* 179FA0 8024B6C0 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomZOffset)
/* 179FA4 8024B6C4 E420F298 */  swc1      $f0, %lo(BattleCam_InitialBoomZOffset)($at)
/* 179FA8 8024B6C8 3C01802A */  lui       $at, %hi(BattleCam_InitialPosX)
/* 179FAC 8024B6CC E422F2A8 */  swc1      $f2, %lo(BattleCam_InitialPosX)($at)
D_8024B6D0:
/* 179FB0 8024B6D0 3C01802A */  lui       $at, %hi(BattleCam_InitialPosY)
/* 179FB4 8024B6D4 E424F2AC */  swc1      $f4, %lo(BattleCam_InitialPosY)($at)
/* 179FB8 8024B6D8 3C01802A */  lui       $at, %hi(BattleCam_InitialPosZ)
/* 179FBC 8024B6DC E426F2B0 */  swc1      $f6, %lo(BattleCam_InitialPosZ)($at)
/* 179FC0 8024B6E0 3C01802A */  lui       $at, %hi(BattleCam_MoveTimeTotal)
/* 179FC4 8024B6E4 A423F2A0 */  sh        $v1, %lo(BattleCam_MoveTimeTotal)($at)
.L8024B6E8:
/* 179FC8 8024B6E8 3C02802A */  lui       $v0, %hi(BattleCam_UseLinearInterp)
/* 179FCC 8024B6EC 8042F2A5 */  lb        $v0, %lo(BattleCam_UseLinearInterp)($v0)
dgb_01_img7_gfx:
/* 179FD0 8024B6F0 14400027 */  bnez      $v0, .L8024B790
/* 179FD4 8024B6F4 00000000 */   nop
/* 179FD8 8024B6F8 3C02802A */  lui       $v0, %hi(BattleCam_MoveTimeLeft)
/* 179FDC 8024B6FC 8442F29E */  lh        $v0, %lo(BattleCam_MoveTimeLeft)($v0)
/* 179FE0 8024B700 3C03802A */  lui       $v1, %hi(BattleCam_MoveTimeTotal)
/* 179FE4 8024B704 8463F2A0 */  lh        $v1, %lo(BattleCam_MoveTimeTotal)($v1)
D_8024B708:
/* 179FE8 8024B708 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 179FEC 8024B70C 4481C000 */  mtc1      $at, $f24
/* 179FF0 8024B710 44822000 */  mtc1      $v0, $f4
/* 179FF4 8024B714 00000000 */  nop
/* 179FF8 8024B718 46802120 */  cvt.s.w   $f4, $f4
/* 179FFC 8024B71C 44830000 */  mtc1      $v1, $f0
/* 17A000 8024B720 00000000 */  nop
/* 17A004 8024B724 46800020 */  cvt.s.w   $f0, $f0
.L8024B728:
/* 17A008 8024B728 46002103 */  div.s     $f4, $f4, $f0
/* 17A00C 8024B72C 4604C301 */  sub.s     $f12, $f24, $f4
D_8024B730:
/* 17A010 8024B730 3C014049 */  lui       $at, (0x40490FD0 >> 16)
/* 17A014 8024B734 34210FD0 */  ori       $at, $at, (0x40490FD0 & 0xFFFF)
D_8024B738:
/* 17A018 8024B738 4481B000 */  mtc1      $at, $f22
D_8024B73C:
/* 17A01C 8024B73C 00000000 */  nop
D_8024B740:
/* 17A020 8024B740 46166302 */  mul.s     $f12, $f12, $f22
/* 17A024 8024B744 00000000 */  nop
D_8024B748:
/* 17A028 8024B748 3C013F00 */  lui       $at, (0x3F000000 >> 16)
D_8024B74C:
/* 17A02C 8024B74C 4481A000 */  mtc1      $at, $f20
/* 17A030 8024B750 00000000 */  nop
/* 17A034 8024B754 46146302 */  mul.s     $f12, $f12, $f20
/* 17A038 8024B758 0C00A85B */  jal       sin_rad
/* 17A03C 8024B75C 00000000 */   nop
D_8024B760:
/* 17A040 8024B760 46160002 */  mul.s     $f0, $f0, $f22
/* 17A044 8024B764 00000000 */  nop
/* 17A048 8024B768 46140302 */  mul.s     $f12, $f0, $f20
/* 17A04C 8024B76C 0C00A85B */  jal       sin_rad
D_8024B770_C08FF0:
/* 17A050 8024B770 00000000 */   nop
/* 17A054 8024B774 46160002 */  mul.s     $f0, $f0, $f22
/* 17A058 8024B778 00000000 */  nop
/* 17A05C 8024B77C 46140302 */  mul.s     $f12, $f0, $f20
/* 17A060 8024B780 0C00A85B */  jal       sin_rad
/* 17A064 8024B784 00000000 */   nop
/* 17A068 8024B788 08092DEF */  j         .L8024B7BC
/* 17A06C 8024B78C 4600C101 */   sub.s    $f4, $f24, $f0
.L8024B790:
/* 17A070 8024B790 3C02802A */  lui       $v0, %hi(BattleCam_MoveTimeLeft)
/* 17A074 8024B794 8442F29E */  lh        $v0, %lo(BattleCam_MoveTimeLeft)($v0)
/* 17A078 8024B798 3C03802A */  lui       $v1, %hi(BattleCam_MoveTimeTotal)
/* 17A07C 8024B79C 8463F2A0 */  lh        $v1, %lo(BattleCam_MoveTimeTotal)($v1)
/* 17A080 8024B7A0 44822000 */  mtc1      $v0, $f4
/* 17A084 8024B7A4 00000000 */  nop
/* 17A088 8024B7A8 46802120 */  cvt.s.w   $f4, $f4
/* 17A08C 8024B7AC 44830000 */  mtc1      $v1, $f0
D_8024B7B0:
/* 17A090 8024B7B0 00000000 */  nop
/* 17A094 8024B7B4 46800020 */  cvt.s.w   $f0, $f0
/* 17A098 8024B7B8 46002103 */  div.s     $f4, $f4, $f0
.L8024B7BC:
/* 17A09C 8024B7BC 3C01802A */  lui       $at, %hi(BattleCam_InitialPosX)
/* 17A0A0 8024B7C0 C434F2A8 */  lwc1      $f20, %lo(BattleCam_InitialPosX)($at)
/* 17A0A4 8024B7C4 4604A502 */  mul.s     $f20, $f20, $f4
D_8024B7C8:
/* 17A0A8 8024B7C8 00000000 */  nop
D_8024B7CC:
/* 17A0AC 8024B7CC 3C01802A */  lui       $at, %hi(BattleCam_InitialPosY)
D_8024B7D0:
/* 17A0B0 8024B7D0 C432F2AC */  lwc1      $f18, %lo(BattleCam_InitialPosY)($at)
D_8024B7D4:
/* 17A0B4 8024B7D4 46049482 */  mul.s     $f18, $f18, $f4
D_8024B7D8:
/* 17A0B8 8024B7D8 00000000 */  nop
/* 17A0BC 8024B7DC 3C01802A */  lui       $at, %hi(BattleCam_InitialPosZ)
/* 17A0C0 8024B7E0 C430F2B0 */  lwc1      $f16, %lo(BattleCam_InitialPosZ)($at)
/* 17A0C4 8024B7E4 46048402 */  mul.s     $f16, $f16, $f4
D_8024B7E8:
/* 17A0C8 8024B7E8 00000000 */  nop
/* 17A0CC 8024B7EC 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomZOffset)
D_8024B7F0:
/* 17A0D0 8024B7F0 C426F298 */  lwc1      $f6, %lo(BattleCam_InitialBoomZOffset)($at)
/* 17A0D4 8024B7F4 46043182 */  mul.s     $f6, $f6, $f4
/* 17A0D8 8024B7F8 00000000 */  nop
/* 17A0DC 8024B7FC 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomLength)
/* 17A0E0 8024B800 C42CF28C */  lwc1      $f12, %lo(BattleCam_InitialBoomLength)($at)
/* 17A0E4 8024B804 46046302 */  mul.s     $f12, $f12, $f4
D_8024B808:
/* 17A0E8 8024B808 00000000 */  nop
/* 17A0EC 8024B80C 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomYaw)
/* 17A0F0 8024B810 C428F290 */  lwc1      $f8, %lo(BattleCam_InitialBoomYaw)($at)
.L8024B814:
/* 17A0F4 8024B814 46044202 */  mul.s     $f8, $f8, $f4
/* 17A0F8 8024B818 00000000 */  nop
D_8024B81C:
/* 17A0FC 8024B81C 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 17A100 8024B820 44811000 */  mtc1      $at, $f2
/* 17A104 8024B824 00000000 */  nop
.L8024B828:
/* 17A108 8024B828 46041081 */  sub.s     $f2, $f2, $f4
/* 17A10C 8024B82C 4602D682 */  mul.s     $f26, $f26, $f2
D_8024B830:
/* 17A110 8024B830 00000000 */  nop
/* 17A114 8024B834 C7BC0010 */  lwc1      $f28, 0x10($sp)
/* 17A118 8024B838 4602E602 */  mul.s     $f24, $f28, $f2
/* 17A11C 8024B83C 00000000 */  nop
/* 17A120 8024B840 3C02802A */  lui       $v0, %hi(BattleCam_BoomZOffset)
D_8024B844:
/* 17A124 8024B844 8442F286 */  lh        $v0, %lo(BattleCam_BoomZOffset)($v0)
D_8024B848:
/* 17A128 8024B848 44820000 */  mtc1      $v0, $f0
/* 17A12C 8024B84C 00000000 */  nop
D_8024B850:
/* 17A130 8024B850 46800020 */  cvt.s.w   $f0, $f0
/* 17A134 8024B854 46020002 */  mul.s     $f0, $f0, $f2
/* 17A138 8024B858 00000000 */  nop
D_8024B85C:
/* 17A13C 8024B85C 4602F582 */  mul.s     $f22, $f30, $f2
/* 17A140 8024B860 00000000 */  nop
/* 17A144 8024B864 3C02802A */  lui       $v0, %hi(BattleCam_BoomLength)
D_8024B868:
/* 17A148 8024B868 8442F280 */  lh        $v0, %lo(BattleCam_BoomLength)($v0)
/* 17A14C 8024B86C 44827000 */  mtc1      $v0, $f14
D_8024B870:
/* 17A150 8024B870 00000000 */  nop
/* 17A154 8024B874 468073A0 */  cvt.s.w   $f14, $f14
/* 17A158 8024B878 46027382 */  mul.s     $f14, $f14, $f2
D_8024B87C:
/* 17A15C 8024B87C 00000000 */  nop
/* 17A160 8024B880 3C02802A */  lui       $v0, %hi(BattleCam_BoomYaw)
/* 17A164 8024B884 8442F282 */  lh        $v0, %lo(BattleCam_BoomYaw)($v0)
D_8024B888:
/* 17A168 8024B888 44825000 */  mtc1      $v0, $f10
D_8024B88C:
/* 17A16C 8024B88C 00000000 */  nop
D_8024B890:
/* 17A170 8024B890 468052A0 */  cvt.s.w   $f10, $f10
D_8024B894:
/* 17A174 8024B894 46025282 */  mul.s     $f10, $f10, $f2
D_8024B898:
/* 17A178 8024B898 00000000 */  nop
D_8024B89C:
/* 17A17C 8024B89C 46003180 */  add.s     $f6, $f6, $f0
D_8024B8A0:
/* 17A180 8024B8A0 3C014380 */  lui       $at, (0x43800000 >> 16)
/* 17A184 8024B8A4 44810000 */  mtc1      $at, $f0
/* 17A188 8024B8A8 00000000 */  nop
/* 17A18C 8024B8AC 46003182 */  mul.s     $f6, $f6, $f0
D_8024B8B0:
/* 17A190 8024B8B0 00000000 */  nop
D_8024B8B4:
/* 17A194 8024B8B4 3C01802A */  lui       $at, %hi(BattleCam_InitialBoomPitch)
/* 17A198 8024B8B8 C420F294 */  lwc1      $f0, %lo(BattleCam_InitialBoomPitch)($at)
/* 17A19C 8024B8BC 46040002 */  mul.s     $f0, $f0, $f4
D_8024B8C0:
/* 17A1A0 8024B8C0 00000000 */  nop
/* 17A1A4 8024B8C4 461AA500 */  add.s     $f20, $f20, $f26
/* 17A1A8 8024B8C8 46189480 */  add.s     $f18, $f18, $f24
/* 17A1AC 8024B8CC 46168400 */  add.s     $f16, $f16, $f22
D_8024B8D0:
/* 17A1B0 8024B8D0 460E6300 */  add.s     $f12, $f12, $f14
D_8024B8D4:
/* 17A1B4 8024B8D4 3C04802A */  lui       $a0, %hi(BattleCam_MoveTimeLeft)
D_8024B8D8:
/* 17A1B8 8024B8D8 2484F29E */  addiu     $a0, $a0, %lo(BattleCam_MoveTimeLeft)
/* 17A1BC 8024B8DC 3C02802A */  lui       $v0, %hi(BattleCam_BoomPitch)
D_8024B8E0:
/* 17A1C0 8024B8E0 8442F284 */  lh        $v0, %lo(BattleCam_BoomPitch)($v0)
/* 17A1C4 8024B8E4 460A4200 */  add.s     $f8, $f8, $f10
/* 17A1C8 8024B8E8 E6140054 */  swc1      $f20, 0x54($s0)
/* 17A1CC 8024B8EC 44822000 */  mtc1      $v0, $f4
D_8024B8F0:
/* 17A1D0 8024B8F0 00000000 */  nop
D_8024B8F4:
/* 17A1D4 8024B8F4 46802120 */  cvt.s.w   $f4, $f4
D_8024B8F8_C09178:
/* 17A1D8 8024B8F8 46022102 */  mul.s     $f4, $f4, $f2
/* 17A1DC 8024B8FC 00000000 */  nop
/* 17A1E0 8024B900 E6120058 */  swc1      $f18, 0x58($s0)
/* 17A1E4 8024B904 E610005C */  swc1      $f16, 0x5C($s0)
/* 17A1E8 8024B908 4600670D */  trunc.w.s $f28, $f12
/* 17A1EC 8024B90C 4402E000 */  mfc1      $v0, $f28
D_8024B910:
/* 17A1F0 8024B910 00000000 */  nop
/* 17A1F4 8024B914 A602001E */  sh        $v0, 0x1E($s0)
/* 17A1F8 8024B918 46040000 */  add.s     $f0, $f0, $f4
/* 17A1FC 8024B91C 4600470D */  trunc.w.s $f28, $f8
D_8024B920:
/* 17A200 8024B920 4402E000 */  mfc1      $v0, $f28
/* 17A204 8024B924 00000000 */  nop
D_8024B928:
/* 17A208 8024B928 A6020024 */  sh        $v0, 0x24($s0)
/* 17A20C 8024B92C 4600070D */  trunc.w.s $f28, $f0
/* 17A210 8024B930 4402E000 */  mfc1      $v0, $f28
/* 17A214 8024B934 00000000 */  nop
/* 17A218 8024B938 A6020022 */  sh        $v0, 0x22($s0)
D_8024B93C:
/* 17A21C 8024B93C 4600370D */  trunc.w.s $f28, $f6
D_8024B940:
/* 17A220 8024B940 4402E000 */  mfc1      $v0, $f28
/* 17A224 8024B944 00000000 */  nop
/* 17A228 8024B948 A6020026 */  sh        $v0, 0x26($s0)
D_8024B94C:
/* 17A22C 8024B94C 84820000 */  lh        $v0, 0x0($a0)
D_8024B950:
/* 17A230 8024B950 94830000 */  lhu       $v1, 0x0($a0)
/* 17A234 8024B954 14400006 */  bnez      $v0, .L8024B970
/* 17A238 8024B958 2462FFFF */   addiu    $v0, $v1, -0x1
/* 17A23C 8024B95C 24020001 */  addiu     $v0, $zero, 0x1
/* 17A240 8024B960 3C01802A */  lui       $at, %hi(BattleCam_DoneMoving)
D_8024B964:
/* 17A244 8024B964 A022F29C */  sb        $v0, %lo(BattleCam_DoneMoving)($at)
/* 17A248 8024B968 08092E5D */  j         .L8024B974
/* 17A24C 8024B96C 00000000 */   nop
.L8024B970:
/* 17A250 8024B970 A4820000 */  sh        $v0, 0x0($a0)
.L8024B974:
/* 17A254 8024B974 8FBF001C */  lw        $ra, 0x1C($sp)
D_8024B978:
/* 17A258 8024B978 8FB00018 */  lw        $s0, 0x18($sp)
/* 17A25C 8024B97C D7BE0048 */  ldc1      $f30, 0x48($sp)
/* 17A260 8024B980 D7BC0040 */  ldc1      $f28, 0x40($sp)
/* 17A264 8024B984 D7BA0038 */  ldc1      $f26, 0x38($sp)
/* 17A268 8024B988 D7B80030 */  ldc1      $f24, 0x30($sp)
/* 17A26C 8024B98C D7B60028 */  ldc1      $f22, 0x28($sp)
sam_02_Quizmo_Worker:
/* 17A270 8024B990 D7B40020 */  ldc1      $f20, 0x20($sp)
/* 17A274 8024B994 0000102D */  daddu     $v0, $zero, $zero
.L8024B998:
/* 17A278 8024B998 03E00008 */  jr        $ra
/* 17A27C 8024B99C 27BD0050 */   addiu    $sp, $sp, 0x50

### DECOMPILED C INSTRUCTIONS:

ApiStatus CamPresetUpdate_N(Evt* script, s32 isInitialCall) {
    Camera* camera = &gCameras[CAM_BATTLE];
    f32 alpha;
    f32 x, y, z;

    x = BattleCam_PosX;
    y = BattleCam_PosY;
    z = BattleCam_PosZ;

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

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

    camera->lookAt_obj_target.x = LERP(BattleCam_InitialPosX, x, alpha);
    camera->lookAt_obj_target.y = LERP(BattleCam_InitialPosY, y, alpha);
    camera->lookAt_obj_target.z = LERP(BattleCam_InitialPosZ, z, alpha);
    camera->auxBoomZOffset = LERP(BattleCam_InitialBoomZOffset, BattleCam_BoomZOffset, alpha) * 256.0f;
    camera->auxBoomLength = LERP(BattleCam_InitialBoomLength, BattleCam_BoomLength, alpha);
    camera->auxBoomYaw = LERP(BattleCam_InitialBoomYaw, BattleCam_BoomYaw, alpha);
    camera->auxBoomPitch = LERP(BattleCam_InitialBoomPitch, BattleCam_BoomPitch, alpha);

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

    return ApiStatus_BLOCK;
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel debuff_appendGfx
/* 3647EC E00624EC 27BDFEE0 */  addiu     $sp, $sp, -0x120
/* 3647F0 E00624F0 AFBE0100 */  sw        $fp, 0x100($sp)
/* 3647F4 E00624F4 0080F02D */  daddu     $fp, $a0, $zero
/* 3647F8 E00624F8 3C07DB06 */  lui       $a3, (0xDB060024 >> 16)
/* 3647FC E00624FC 34E70024 */  ori       $a3, $a3, (0xDB060024 & 0xFFFF)
/* 364800 E0062500 27A40018 */  addiu     $a0, $sp, 0x18
/* 364804 E0062504 AFB100E4 */  sw        $s1, 0xE4($sp)
/* 364808 E0062508 3C110001 */  lui       $s1, (0x11630 >> 16)
/* 36480C E006250C 36311630 */  ori       $s1, $s1, (0x11630 & 0xFFFF)
/* 364810 E0062510 AFB300EC */  sw        $s3, 0xEC($sp)
/* 364814 E0062514 3C13800A */  lui       $s3, %hi(gMainGfxPos)
/* 364818 E0062518 2673A66C */  addiu     $s3, $s3, %lo(gMainGfxPos)
/* 36481C E006251C AFBF0104 */  sw        $ra, 0x104($sp)
/* 364820 E0062520 AFB700FC */  sw        $s7, 0xFC($sp)
/* 364824 E0062524 AFB600F8 */  sw        $s6, 0xF8($sp)
/* 364828 E0062528 AFB500F4 */  sw        $s5, 0xF4($sp)
/* 36482C E006252C AFB400F0 */  sw        $s4, 0xF0($sp)
/* 364830 E0062530 AFB200E8 */  sw        $s2, 0xE8($sp)
/* 364834 E0062534 AFB000E0 */  sw        $s0, 0xE0($sp)
/* 364838 E0062538 F7B80118 */  sdc1      $f24, 0x118($sp)
/* 36483C E006253C F7B60110 */  sdc1      $f22, 0x110($sp)
/* 364840 E0062540 F7B40108 */  sdc1      $f20, 0x108($sp)
/* 364844 E0062544 8E630000 */  lw        $v1, 0x0($s3)
/* 364848 E0062548 8FD2000C */  lw        $s2, 0xC($fp)
/* 36484C E006254C 0060282D */  daddu     $a1, $v1, $zero
/* 364850 E0062550 24630008 */  addiu     $v1, $v1, 0x8
/* 364854 E0062554 AE630000 */  sw        $v1, 0x0($s3)
/* 364858 E0062558 3C08E006 */  lui       $t0, (0xE00628C0 >> 16)
/* 36485C E006255C 8D0828C0 */  lw        $t0, (0xE00628C0 & 0xFFFF)($t0)
/* 364860 E0062560 3C06E006 */  lui       $a2, (0xE00628C4 >> 16)
/* 364864 E0062564 8CC628C4 */  lw        $a2, (0xE00628C4 & 0xFFFF)($a2)
/* 364868 E0062568 3C02E700 */  lui       $v0, (0xE7000000 >> 16)
/* 36486C E006256C AFA800D8 */  sw        $t0, 0xD8($sp)
/* 364870 E0062570 ACA20000 */  sw        $v0, 0x0($a1)
/* 364874 E0062574 ACA00004 */  sw        $zero, 0x4($a1)
/* 364878 E0062578 AC670000 */  sw        $a3, 0x0($v1)
/* 36487C E006257C 8FC50010 */  lw        $a1, 0x10($fp)
/* 364880 E0062580 24620008 */  addiu     $v0, $v1, 0x8
/* 364884 E0062584 AE620000 */  sw        $v0, 0x0($s3)
/* 364888 E0062588 8CA5001C */  lw        $a1, 0x1C($a1)
/* 36488C E006258C 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 364890 E0062590 AC620008 */  sw        $v0, 0x8($v1)
/* 364894 E0062594 3C028000 */  lui       $v0, (0x80000000 >> 16)
/* 364898 E0062598 AC66000C */  sw        $a2, 0xC($v1)
/* 36489C E006259C 00A22821 */  addu      $a1, $a1, $v0
/* 3648A0 E00625A0 AC650004 */  sw        $a1, 0x4($v1)
/* 3648A4 E00625A4 8E450004 */  lw        $a1, 0x4($s2)
/* 3648A8 E00625A8 8E460008 */  lw        $a2, 0x8($s2)
/* 3648AC E00625AC 8E47000C */  lw        $a3, 0xC($s2)
/* 3648B0 E00625B0 24630010 */  addiu     $v1, $v1, 0x10
/* 3648B4 E00625B4 0C080108 */  jal       shim_guTranslateF
/* 3648B8 E00625B8 AE630000 */   sw       $v1, 0x0($s3)
/* 3648BC E00625BC 27B50058 */  addiu     $s5, $sp, 0x58
/* 3648C0 E00625C0 4480A000 */  mtc1      $zero, $f20
/* 3648C4 E00625C4 3C038007 */  lui       $v1, %hi(gCurrentCameraID)
/* 3648C8 E00625C8 8C637410 */  lw        $v1, %lo(gCurrentCameraID)($v1)
/* 3648CC E00625CC 3C013F80 */  lui       $at, (0x3F800000 >> 16)
/* 3648D0 E00625D0 4481C000 */  mtc1      $at, $f24
/* 3648D4 E00625D4 00031080 */  sll       $v0, $v1, 2
/* 3648D8 E00625D8 00431021 */  addu      $v0, $v0, $v1
/* 3648DC E00625DC 00021080 */  sll       $v0, $v0, 2
/* 3648E0 E00625E0 00431023 */  subu      $v0, $v0, $v1
/* 3648E4 E00625E4 000218C0 */  sll       $v1, $v0, 3
/* 3648E8 E00625E8 00431021 */  addu      $v0, $v0, $v1
/* 3648EC E00625EC 000210C0 */  sll       $v0, $v0, 3
/* 3648F0 E00625F0 4406A000 */  mfc1      $a2, $f20
/* 3648F4 E00625F4 3C01800B */  lui       $at, %hi(gCameras + 0x6C)
/* 3648F8 E00625F8 00220821 */  addu      $at, $at, $v0
/* 3648FC E00625FC C4201DEC */  lwc1      $f0, %lo(gCameras + 0x6C)($at)
/* 364900 E0062600 4407C000 */  mfc1      $a3, $f24
/* 364904 E0062604 46000007 */  neg.s     $f0, $f0
/* 364908 E0062608 44050000 */  mfc1      $a1, $f0
/* 36490C E006260C 02A0202D */  daddu     $a0, $s5, $zero
/* 364910 E0062610 0C080104 */  jal       shim_guRotateF
/* 364914 E0062614 E7B40010 */   swc1     $f20, 0x10($sp)
/* 364918 E0062618 02A0202D */  daddu     $a0, $s5, $zero
/* 36491C E006261C 27A50018 */  addiu     $a1, $sp, 0x18
/* 364920 E0062620 27B00098 */  addiu     $s0, $sp, 0x98
/* 364924 E0062624 0C080114 */  jal       shim_guMtxCatF
/* 364928 E0062628 0200302D */   daddu    $a2, $s0, $zero
/* 36492C E006262C 0200202D */  daddu     $a0, $s0, $zero
/* 364930 E0062630 3C108007 */  lui       $s0, %hi(gMatrixListPos)
/* 364934 E0062634 261041F0 */  addiu     $s0, $s0, %lo(gMatrixListPos)
/* 364938 E0062638 3C16800A */  lui       $s6, %hi(gDisplayContext)
/* 36493C E006263C 26D6A674 */  addiu     $s6, $s6, %lo(gDisplayContext)
/* 364940 E0062640 96050000 */  lhu       $a1, 0x0($s0)
/* 364944 E0062644 8EC20000 */  lw        $v0, 0x0($s6)
/* 364948 E0062648 00052980 */  sll       $a1, $a1, 6
/* 36494C E006264C 00B12821 */  addu      $a1, $a1, $s1
/* 364950 E0062650 0C080118 */  jal       shim_guMtxF2L
/* 364954 E0062654 00452821 */   addu     $a1, $v0, $a1
/* 364958 E0062658 8E660000 */  lw        $a2, 0x0($s3)
/* 36495C E006265C 24140001 */  addiu     $s4, $zero, 0x1
/* 364960 E0062660 00C0202D */  daddu     $a0, $a2, $zero
/* 364964 E0062664 24C60008 */  addiu     $a2, $a2, 0x8
/* 364968 E0062668 AE660000 */  sw        $a2, 0x0($s3)
/* 36496C E006266C 96020000 */  lhu       $v0, 0x0($s0)
/* 364970 E0062670 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 364974 E0062674 AC830000 */  sw        $v1, 0x0($a0)
/* 364978 E0062678 00541821 */  addu      $v1, $v0, $s4
/* 36497C E006267C 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 364980 E0062680 00021180 */  sll       $v0, $v0, 6
/* 364984 E0062684 A6030000 */  sh        $v1, 0x0($s0)
/* 364988 E0062688 8EC30000 */  lw        $v1, 0x0($s6)
/* 36498C E006268C 00511021 */  addu      $v0, $v0, $s1
/* 364990 E0062690 00621821 */  addu      $v1, $v1, $v0
/* 364994 E0062694 24C20008 */  addiu     $v0, $a2, 0x8
/* 364998 E0062698 AC830004 */  sw        $v1, 0x4($a0)
/* 36499C E006269C AE620000 */  sw        $v0, 0x0($s3)
/* 3649A0 E00626A0 3C02FA00 */  lui       $v0, (0xFA000000 >> 16)
/* 3649A4 E00626A4 ACC20000 */  sw        $v0, 0x0($a2)
/* 3649A8 E00626A8 92420038 */  lbu       $v0, 0x38($s2)
/* 3649AC E00626AC 92440039 */  lbu       $a0, 0x39($s2)
/* 3649B0 E00626B0 9245003A */  lbu       $a1, 0x3A($s2)
/* 3649B4 E00626B4 92470037 */  lbu       $a3, 0x37($s2)
/* 3649B8 E00626B8 24C30010 */  addiu     $v1, $a2, 0x10
/* 3649BC E00626BC AE630000 */  sw        $v1, 0x0($s3)
/* 3649C0 E00626C0 3C03FB00 */  lui       $v1, (0xFB000000 >> 16)
/* 3649C4 E00626C4 ACC30008 */  sw        $v1, 0x8($a2)
/* 3649C8 E00626C8 00021600 */  sll       $v0, $v0, 24
/* 3649CC E00626CC 00042400 */  sll       $a0, $a0, 16
/* 3649D0 E00626D0 00441025 */  or        $v0, $v0, $a0
/* 3649D4 E00626D4 00052A00 */  sll       $a1, $a1, 8
/* 3649D8 E00626D8 00451025 */  or        $v0, $v0, $a1
/* 3649DC E00626DC 00471025 */  or        $v0, $v0, $a3
/* 3649E0 E00626E0 ACC20004 */  sw        $v0, 0x4($a2)
/* 3649E4 E00626E4 9242003B */  lbu       $v0, 0x3B($s2)
/* 3649E8 E00626E8 9244003C */  lbu       $a0, 0x3C($s2)
/* 3649EC E00626EC 9243003D */  lbu       $v1, 0x3D($s2)
/* 3649F0 E00626F0 00021600 */  sll       $v0, $v0, 24
/* 3649F4 E00626F4 00042400 */  sll       $a0, $a0, 16
/* 3649F8 E00626F8 00441025 */  or        $v0, $v0, $a0
/* 3649FC E00626FC 00031A00 */  sll       $v1, $v1, 8
/* 364A00 E0062700 00431025 */  or        $v0, $v0, $v1
/* 364A04 E0062704 ACC2000C */  sw        $v0, 0xC($a2)
/* 364A08 E0062708 8FC20008 */  lw        $v0, 0x8($fp)
/* 364A0C E006270C 0282102A */  slt       $v0, $s4, $v0
/* 364A10 E0062710 10400049 */  beqz      $v0, .LE0062838
/* 364A14 E0062714 26520040 */   addiu    $s2, $s2, 0x40
/* 364A18 E0062718 02A0882D */  daddu     $s1, $s5, $zero
/* 364A1C E006271C 4600A586 */  mov.s     $f22, $f20
/* 364A20 E0062720 4600C506 */  mov.s     $f20, $f24
/* 364A24 E0062724 02C0B82D */  daddu     $s7, $s6, $zero
/* 364A28 E0062728 0200B02D */  daddu     $s6, $s0, $zero
/* 364A2C E006272C 3C150001 */  lui       $s5, (0x11630 >> 16)
/* 364A30 E0062730 36B51630 */  ori       $s5, $s5, (0x11630 & 0xFFFF)
/* 364A34 E0062734 2650001C */  addiu     $s0, $s2, 0x1C
.LE0062738:
/* 364A38 E0062738 27A40018 */  addiu     $a0, $sp, 0x18
/* 364A3C E006273C 8E05FFE8 */  lw        $a1, -0x18($s0)
/* 364A40 E0062740 8E06FFEC */  lw        $a2, -0x14($s0)
/* 364A44 E0062744 8E07FFF0 */  lw        $a3, -0x10($s0)
/* 364A48 E0062748 0C080108 */  jal       shim_guTranslateF
/* 364A4C E006274C 26940001 */   addiu    $s4, $s4, 0x1
/* 364A50 E0062750 E7B40010 */  swc1      $f20, 0x10($sp)
/* 364A54 E0062754 8E050010 */  lw        $a1, 0x10($s0)
/* 364A58 E0062758 4406B000 */  mfc1      $a2, $f22
/* 364A5C E006275C 4407B000 */  mfc1      $a3, $f22
/* 364A60 E0062760 0C080104 */  jal       shim_guRotateF
/* 364A64 E0062764 0220202D */   daddu    $a0, $s1, $zero
/* 364A68 E0062768 0220202D */  daddu     $a0, $s1, $zero
/* 364A6C E006276C 27A50018 */  addiu     $a1, $sp, 0x18
/* 364A70 E0062770 0C080114 */  jal       shim_guMtxCatF
/* 364A74 E0062774 00A0302D */   daddu    $a2, $a1, $zero
/* 364A78 E0062778 0220202D */  daddu     $a0, $s1, $zero
/* 364A7C E006277C 8E050004 */  lw        $a1, 0x4($s0)
/* 364A80 E0062780 8E060000 */  lw        $a2, 0x0($s0)
/* 364A84 E0062784 4407A000 */  mfc1      $a3, $f20
/* 364A88 E0062788 0C080110 */  jal       shim_guScaleF
/* 364A8C E006278C 26100040 */   addiu    $s0, $s0, 0x40
/* 364A90 E0062790 0220202D */  daddu     $a0, $s1, $zero
/* 364A94 E0062794 27A50018 */  addiu     $a1, $sp, 0x18
/* 364A98 E0062798 0C080114 */  jal       shim_guMtxCatF
/* 364A9C E006279C 00A0302D */   daddu    $a2, $a1, $zero
/* 364AA0 E00627A0 27A40018 */  addiu     $a0, $sp, 0x18
/* 364AA4 E00627A4 96C50000 */  lhu       $a1, 0x0($s6)
/* 364AA8 E00627A8 8EE20000 */  lw        $v0, 0x0($s7)
/* 364AAC E00627AC 00052980 */  sll       $a1, $a1, 6
/* 364AB0 E00627B0 00B52821 */  addu      $a1, $a1, $s5
/* 364AB4 E00627B4 0C080118 */  jal       shim_guMtxF2L
/* 364AB8 E00627B8 00452821 */   addu     $a1, $v0, $a1
/* 364ABC E00627BC 3C06D838 */  lui       $a2, (0xD8380002 >> 16)
/* 364AC0 E00627C0 8E640000 */  lw        $a0, 0x0($s3)
/* 364AC4 E00627C4 34C60002 */  ori       $a2, $a2, (0xD8380002 & 0xFFFF)
/* 364AC8 E00627C8 0080282D */  daddu     $a1, $a0, $zero
/* 364ACC E00627CC 24840008 */  addiu     $a0, $a0, 0x8
/* 364AD0 E00627D0 AE640000 */  sw        $a0, 0x0($s3)
/* 364AD4 E00627D4 96C20000 */  lhu       $v0, 0x0($s6)
/* 364AD8 E00627D8 3C03DA38 */  lui       $v1, (0xDA380000 >> 16)
/* 364ADC E00627DC ACA30000 */  sw        $v1, 0x0($a1)
/* 364AE0 E00627E0 24430001 */  addiu     $v1, $v0, 0x1
/* 364AE4 E00627E4 3042FFFF */  andi      $v0, $v0, 0xFFFF
/* 364AE8 E00627E8 00021180 */  sll       $v0, $v0, 6
/* 364AEC E00627EC A6C30000 */  sh        $v1, 0x0($s6)
/* 364AF0 E00627F0 8EE30000 */  lw        $v1, 0x0($s7)
/* 364AF4 E00627F4 00551021 */  addu      $v0, $v0, $s5
/* 364AF8 E00627F8 00621821 */  addu      $v1, $v1, $v0
/* 364AFC E00627FC 24820008 */  addiu     $v0, $a0, 0x8
/* 364B00 E0062800 ACA30004 */  sw        $v1, 0x4($a1)
/* 364B04 E0062804 AE620000 */  sw        $v0, 0x0($s3)
/* 364B08 E0062808 3C02DE00 */  lui       $v0, (0xDE000000 >> 16)
/* 364B0C E006280C AC820000 */  sw        $v0, 0x0($a0)
/* 364B10 E0062810 8FA800D8 */  lw        $t0, 0xD8($sp)
/* 364B14 E0062814 24020040 */  addiu     $v0, $zero, 0x40
/* 364B18 E0062818 AC860008 */  sw        $a2, 0x8($a0)
/* 364B1C E006281C AC82000C */  sw        $v0, 0xC($a0)
/* 364B20 E0062820 AC880004 */  sw        $t0, 0x4($a0)
/* 364B24 E0062824 8FC20008 */  lw        $v0, 0x8($fp)
/* 364B28 E0062828 24840010 */  addiu     $a0, $a0, 0x10
/* 364B2C E006282C 0282102A */  slt       $v0, $s4, $v0
/* 364B30 E0062830 1440FFC1 */  bnez      $v0, .LE0062738
/* 364B34 E0062834 AE640000 */   sw       $a0, 0x0($s3)
.LE0062838:
/* 364B38 E0062838 3C03D838 */  lui       $v1, (0xD8380002 >> 16)
/* 364B3C E006283C 3C04800A */  lui       $a0, %hi(gMainGfxPos)
/* 364B40 E0062840 2484A66C */  addiu     $a0, $a0, %lo(gMainGfxPos)
/* 364B44 E0062844 8C820000 */  lw        $v0, 0x0($a0)
/* 364B48 E0062848 34630002 */  ori       $v1, $v1, (0xD8380002 & 0xFFFF)
/* 364B4C E006284C 0040282D */  daddu     $a1, $v0, $zero
/* 364B50 E0062850 24420008 */  addiu     $v0, $v0, 0x8
/* 364B54 E0062854 AC820000 */  sw        $v0, 0x0($a0)
/* 364B58 E0062858 ACA30000 */  sw        $v1, 0x0($a1)
/* 364B5C E006285C 24030040 */  addiu     $v1, $zero, 0x40
/* 364B60 E0062860 ACA30004 */  sw        $v1, 0x4($a1)
/* 364B64 E0062864 24430008 */  addiu     $v1, $v0, 0x8
/* 364B68 E0062868 AC830000 */  sw        $v1, 0x0($a0)
/* 364B6C E006286C 3C03E700 */  lui       $v1, (0xE7000000 >> 16)
/* 364B70 E0062870 AC430000 */  sw        $v1, 0x0($v0)
/* 364B74 E0062874 AC400004 */  sw        $zero, 0x4($v0)
/* 364B78 E0062878 8FBF0104 */  lw        $ra, 0x104($sp)
/* 364B7C E006287C 8FBE0100 */  lw        $fp, 0x100($sp)
/* 364B80 E0062880 8FB700FC */  lw        $s7, 0xFC($sp)
/* 364B84 E0062884 8FB600F8 */  lw        $s6, 0xF8($sp)
/* 364B88 E0062888 8FB500F4 */  lw        $s5, 0xF4($sp)
/* 364B8C E006288C 8FB400F0 */  lw        $s4, 0xF0($sp)
/* 364B90 E0062890 8FB300EC */  lw        $s3, 0xEC($sp)
/* 364B94 E0062894 8FB200E8 */  lw        $s2, 0xE8($sp)
/* 364B98 E0062898 8FB100E4 */  lw        $s1, 0xE4($sp)
/* 364B9C E006289C 8FB000E0 */  lw        $s0, 0xE0($sp)
/* 364BA0 E00628A0 D7B80118 */  ldc1      $f24, 0x118($sp)
/* 364BA4 E00628A4 D7B60110 */  ldc1      $f22, 0x110($sp)
/* 364BA8 E00628A8 D7B40108 */  ldc1      $f20, 0x108($sp)
/* 364BAC E00628AC 03E00008 */  jr        $ra
/* 364BB0 E00628B0 27BD0120 */   addiu    $sp, $sp, 0x120
/* 364BB4 E00628B4 00000000 */  nop
/* 364BB8 E00628B8 00000000 */  nop
/* 364BBC E00628BC 00000000 */  nop

### DECOMPILED C INSTRUCTIONS:

void debuff_appendGfx(void* effect) {
    EffectInstance* eff = (EffectInstance*)effect;
    DebuffFXData* data = eff->data.debuff;
    Gfx* dlist = D_E00628C0[0];
    Gfx* dlist2 = D_E00628C4[0];
    Matrix4f mtxTranslate;
    Matrix4f mtxRotate;
    Matrix4f mtxTransform;
    s32 i;

    gDPPipeSync(gMainGfxPos++);
    gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(eff->graphics->data));
    gSPDisplayList(gMainGfxPos++, dlist2);

    shim_guTranslateF(mtxTranslate, data->pos.x, data->pos.y, data->pos.z);
    shim_guRotateF(mtxRotate, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f);
    shim_guMtxCatF(mtxRotate, mtxTranslate, mtxTransform);
    shim_guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]);

    gSPMatrix(gMainGfxPos++,
              &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
    gDPSetPrimColor(gMainGfxPos++, 0, 0, data->primCol.r, data->primCol.g, data->primCol.b, data->alpha);
    gDPSetEnvColor(gMainGfxPos++, data->envCol.r, data->envCol.g, data->envCol.b, 0);

    data++;
    for (i = 1; i < eff->numParts; i++, data++) {
        shim_guTranslateF(mtxTranslate, data->pos.x, data->pos.y, data->pos.z);
        shim_guRotateF(mtxRotate, data->rotZ, 0.0f, 0.0f, 1.0f);
        shim_guMtxCatF(mtxRotate, mtxTranslate, mtxTranslate);
        shim_guScaleF(mtxRotate, data->scaleX, data->scaleY, 1.0f);
        shim_guMtxCatF(mtxRotate, mtxTranslate, mtxTranslate);
        shim_guMtxF2L(mtxTranslate, &gDisplayContext->matrixStack[gMatrixListPos]);

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

    gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
    gDPPipeSync(gMainGfxPos++);
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel D_802472AC
/* 175B8C 802472AC 27BDFFE0 */  addiu     $sp, $sp, -0x20
glabel func_802472B0
/* 175B90 802472B0 AFB10014 */  sw        $s1, 0x14($sp)
/* 175B94 802472B4 3C11800E */  lui       $s1, %hi(gBattleStatus)
/* 175B98 802472B8 2631C070 */  addiu     $s1, $s1, %lo(gBattleStatus)
/* 175B9C 802472BC AFBF0018 */  sw        $ra, 0x18($sp)
/* 175BA0 802472C0 AFB00010 */  sw        $s0, 0x10($sp)
D_802472C4:
/* 175BA4 802472C4 8E2A00D8 */  lw        $t2, 0xD8($s1)
/* 175BA8 802472C8 3C03800E */  lui       $v1, %hi(gBattleSubState)
/* 175BAC 802472CC 8C63C4DC */  lw        $v1, %lo(gBattleSubState)($v1)
/* 175BB0 802472D0 8E2700DC */  lw        $a3, 0xDC($s1)
/* 175BB4 802472D4 0460009F */  bltz      $v1, .L80247554
.L802472D8:
/* 175BB8 802472D8 28620002 */   slti     $v0, $v1, 0x2
.L802472DC:
/* 175BBC 802472DC 14400005 */  bnez      $v0, .L802472F4
.L802472E0:
/* 175BC0 802472E0 24020002 */   addiu    $v0, $zero, 0x2
.L802472E4:
/* 175BC4 802472E4 10620080 */  beq       $v1, $v0, jtbl_802474E8
/* 175BC8 802472E8 00000000 */   nop
/* 175BCC 802472EC 08091D55 */  j         .L80247554
/* 175BD0 802472F0 00000000 */   nop
.L802472F4:
/* 175BD4 802472F4 82240170 */  lb        $a0, 0x170($s1)
/* 175BD8 802472F8 82220171 */  lb        $v0, 0x171($s1)
/* 175BDC 802472FC 0082102A */  slt       $v0, $a0, $v0
/* 175BE0 80247300 14400004 */  bnez      $v0, .L80247314
/* 175BE4 80247304 3C050020 */   lui      $a1, (0x204000 >> 16)
.L80247308:
/* 175BE8 80247308 A2200170 */  sb        $zero, 0x170($s1)
/* 175BEC 8024730C 08091D53 */  j         .L8024754C
D_80247310:
/* 175BF0 80247310 24040006 */   addiu    $a0, $zero, 0x6
.L80247314:
/* 175BF4 80247314 34A54000 */  ori       $a1, $a1, (0x204000 & 0xFFFF)
.L80247318:
/* 175BF8 80247318 00041040 */  sll       $v0, $a0, 1
.L8024731C:
/* 175BFC 8024731C 02221021 */  addu      $v0, $s1, $v0
/* 175C00 80247320 84430140 */  lh        $v1, 0x140($v0)
/* 175C04 80247324 94420140 */  lhu       $v0, 0x140($v0)
/* 175C08 80247328 0460000A */  bltz      $v1, .L80247354
/* 175C0C 8024732C 304200FF */   andi     $v0, $v0, 0xFF
.L80247330:
/* 175C10 80247330 00021080 */  sll       $v0, $v0, 2
/* 175C14 80247334 02221021 */  addu      $v0, $s1, $v0
glabel func_80247338
/* 175C18 80247338 8C5000E0 */  lw        $s0, 0xE0($v0)
D_8024733C:
/* 175C1C 8024733C 12000005 */  beqz      $s0, .L80247354
/* 175C20 80247340 00000000 */   nop
D_80247344:
/* 175C24 80247344 8E020000 */  lw        $v0, 0x0($s0)
/* 175C28 80247348 00451024 */  and       $v0, $v0, $a1
.L8024734C:
/* 175C2C 8024734C 1040000B */  beqz      $v0, .L8024737C
/* 175C30 80247350 00041040 */   sll      $v0, $a0, 1
.L80247354:
/* 175C34 80247354 82220171 */  lb        $v0, 0x171($s1)
/* 175C38 80247358 24840001 */  addiu     $a0, $a0, 0x1
/* 175C3C 8024735C 0082102A */  slt       $v0, $a0, $v0
D_80247360:
/* 175C40 80247360 50400001 */  beql      $v0, $zero, .L80247368
/* 175C44 80247364 0000202D */   daddu    $a0, $zero, $zero
.L80247368:
/* 175C48 80247368 1480FFEC */  bnez      $a0, .L8024731C
.L8024736C:
/* 175C4C 8024736C 00041040 */   sll      $v0, $a0, 1
glabel .L80247370
/* 175C50 80247370 A2200170 */  sb        $zero, 0x170($s1)
/* 175C54 80247374 08091D53 */  j         .L8024754C
/* 175C58 80247378 24040006 */   addiu    $a0, $zero, 0x6
.L8024737C:
/* 175C5C 8024737C 02221021 */  addu      $v0, $s1, $v0
.L80247380:
/* 175C60 80247380 94420140 */  lhu       $v0, 0x140($v0)
/* 175C64 80247384 24840001 */  addiu     $a0, $a0, 0x1
/* 175C68 80247388 AE300174 */  sw        $s0, 0x174($s1)
/* 175C6C 8024738C A2240170 */  sb        $a0, 0x170($s1)
D_80247390:
/* 175C70 80247390 A6220172 */  sh        $v0, 0x172($s1)
.L80247394:
/* 175C74 80247394 82040210 */  lb        $a0, 0x210($s0)
/* 175C78 80247398 38820006 */  xori      $v0, $a0, 0x6
/* 175C7C 8024739C 2C430001 */  sltiu     $v1, $v0, 0x1
/* 175C80 802473A0 24020003 */  addiu     $v0, $zero, 0x3
/* 175C84 802473A4 50820001 */  beql      $a0, $v0, .L802473AC
/* 175C88 802473A8 24030001 */   addiu    $v1, $zero, 0x1
.L802473AC:
/* 175C8C 802473AC 24020004 */  addiu     $v0, $zero, 0x4
D_802473B0:
/* 175C90 802473B0 50820001 */  beql      $a0, $v0, .L802473B8
D_802473B4:
/* 175C94 802473B4 24030001 */   addiu    $v1, $zero, 0x1
.L802473B8:
/* 175C98 802473B8 24020005 */  addiu     $v0, $zero, 0x5
/* 175C9C 802473BC 50820001 */  beql      $a0, $v0, .L802473C4
D_802473C0:
/* 175CA0 802473C0 24030001 */   addiu    $v1, $zero, 0x1
.L802473C4:
/* 175CA4 802473C4 24020007 */  addiu     $v0, $zero, 0x7
D_802473C8:
/* 175CA8 802473C8 50820001 */  beql      $a0, $v0, .L802473D0
/* 175CAC 802473CC 24030001 */   addiu    $v1, $zero, 0x1
.L802473D0:
/* 175CB0 802473D0 24020008 */  addiu     $v0, $zero, 0x8
/* 175CB4 802473D4 50820001 */  beql      $a0, $v0, D_802473DC
D_802473D8:
/* 175CB8 802473D8 24030001 */   addiu    $v1, $zero, 0x1
D_802473DC:
/* 175CBC 802473DC 82020214 */  lb        $v0, 0x214($s0)
D_802473E0:
/* 175CC0 802473E0 240B000C */  addiu     $t3, $zero, 0xC
.L802473E4:
/* 175CC4 802473E4 504B0001 */  beql      $v0, $t3, .L802473EC
D_802473E8:
/* 175CC8 802473E8 24030001 */   addiu    $v1, $zero, 0x1
.L802473EC:
/* 175CCC 802473EC 8E020000 */  lw        $v0, 0x0($s0)
D_802473F0:
/* 175CD0 802473F0 3C090001 */  lui       $t1, (0x10000 >> 16)
/* 175CD4 802473F4 00491024 */  and       $v0, $v0, $t1
D_802473F8:
/* 175CD8 802473F8 54400001 */  bnel      $v0, $zero, D_80247400
/* 175CDC 802473FC 24030001 */   addiu    $v1, $zero, 0x1
D_80247400:
/* 175CE0 80247400 10600005 */  beqz      $v1, D_80247418
/* 175CE4 80247404 3C03FFFB */   lui      $v1, (0xFFFBFFFF >> 16)
D_80247408:
/* 175CE8 80247408 3C01800E */  lui       $at, %hi(gBattleSubState)
/* 175CEC 8024740C AC20C4DC */  sw        $zero, %lo(gBattleSubState)($at)
D_80247410:
/* 175CF0 80247410 08091D55 */  j         .L80247554
.L80247414:
/* 175CF4 80247414 00000000 */   nop
D_80247418:
/* 175CF8 80247418 3463FFFF */  ori       $v1, $v1, (0xFFFBFFFF & 0xFFFF)
/* 175CFC 8024741C 3C04FFF7 */  lui       $a0, (0xFFF7FFFF >> 16)
D_80247420:
/* 175D00 80247420 3484FFFF */  ori       $a0, $a0, (0xFFF7FFFF & 0xFFFF)
/* 175D04 80247424 3C06F7FF */  lui       $a2, (0xF7FFFFFF >> 16)
D_80247428:
/* 175D08 80247428 3C05800E */  lui       $a1, %hi(gBattleStatus)
/* 175D0C 8024742C 24A5C070 */  addiu     $a1, $a1, %lo(gBattleStatus)
D_80247430:
/* 175D10 80247430 2408FFFD */  addiu     $t0, $zero, -0x3
.L80247434:
/* 175D14 80247434 A220008C */  sb        $zero, 0x8C($s1)
D_80247438:
/* 175D18 80247438 8CA20000 */  lw        $v0, 0x0($a1)
/* 175D1C 8024743C 34C6FFFF */  ori       $a2, $a2, (0xF7FFFFFF & 0xFFFF)
jtbl_80247440:
/* 175D20 80247440 00481024 */  and       $v0, $v0, $t0
D_80247444:
/* 175D24 80247444 00431024 */  and       $v0, $v0, $v1
D_80247448:
/* 175D28 80247448 2403EFFF */  addiu     $v1, $zero, -0x1001
/* 175D2C 8024744C 00431024 */  and       $v0, $v0, $v1
/* 175D30 80247450 00441024 */  and       $v0, $v0, $a0
/* 175D34 80247454 ACA20000 */  sw        $v0, 0x0($a1)
D_80247458:
/* 175D38 80247458 8D420000 */  lw        $v0, 0x0($t2)
/* 175D3C 8024745C 3C030400 */  lui       $v1, (0x4000000 >> 16)
/* 175D40 80247460 00461024 */  and       $v0, $v0, $a2
/* 175D44 80247464 00431025 */  or        $v0, $v0, $v1
/* 175D48 80247468 10E00005 */  beqz      $a3, .L80247480
/* 175D4C 8024746C AD420000 */   sw       $v0, 0x0($t2)
D_80247470:
/* 175D50 80247470 8CE20000 */  lw        $v0, 0x0($a3)
/* 175D54 80247474 00461024 */  and       $v0, $v0, $a2
/* 175D58 80247478 00431025 */  or        $v0, $v0, $v1
/* 175D5C 8024747C ACE20000 */  sw        $v0, 0x0($a3)
.L80247480:
/* 175D60 80247480 8CA20004 */  lw        $v0, 0x4($a1)
D_80247484:
/* 175D64 80247484 2403FFFB */  addiu     $v1, $zero, -0x5
D_80247488:
/* 175D68 80247488 00481024 */  and       $v0, $v0, $t0
.L8024748C:
/* 175D6C 8024748C 00431024 */  and       $v0, $v0, $v1
/* 175D70 80247490 00491025 */  or        $v0, $v0, $t1
/* 175D74 80247494 ACA20004 */  sw        $v0, 0x4($a1)
/* 175D78 80247498 92020134 */  lbu       $v0, 0x134($s0)
D_8024749C:
/* 175D7C 8024749C 8E0301CC */  lw        $v1, 0x1CC($s0)
D_802474A0:
/* 175D80 802474A0 3C01802A */  lui       $at, %hi(D_8029F244)
.L802474A4:
/* 175D84 802474A4 A022F244 */  sb        $v0, %lo(D_8029F244)($at)
/* 175D88 802474A8 1060000A */  beqz      $v1, .L802474D4
/* 175D8C 802474AC 2405000A */   addiu    $a1, $zero, 0xA
D_802474B0:
/* 175D90 802474B0 A22B01A7 */  sb        $t3, 0x1A7($s1)
/* 175D94 802474B4 8E0401CC */  lw        $a0, 0x1CC($s0)
/* 175D98 802474B8 0C0B0CF8 */  jal       start_script
/* 175D9C 802474BC 0000302D */   daddu    $a2, $zero, $zero
jtbl_802474C0:
/* 175DA0 802474C0 AE0201DC */  sw        $v0, 0x1DC($s0)
/* 175DA4 802474C4 8C430144 */  lw        $v1, 0x144($v0)
D_802474C8:
/* 175DA8 802474C8 AE0301EC */  sw        $v1, 0x1EC($s0)
.L802474CC:
/* 175DAC 802474CC 86230172 */  lh        $v1, 0x172($s1)
glabel func_802474D0
/* 175DB0 802474D0 AC430148 */  sw        $v1, 0x148($v0)
.L802474D4:
/* 175DB4 802474D4 24020002 */  addiu     $v0, $zero, 0x2
D_802474D8:
/* 175DB8 802474D8 3C01800E */  lui       $at, %hi(gBattleSubState)
D_802474DC:
/* 175DBC 802474DC AC22C4DC */  sw        $v0, %lo(gBattleSubState)($at)
D_802474E0:
/* 175DC0 802474E0 08091D55 */  j         .L80247554
glabel .L802474E4
/* 175DC4 802474E4 00000000 */   nop
jtbl_802474E8:
/* 175DC8 802474E8 8222008C */  lb        $v0, 0x8C($s1)
/* 175DCC 802474EC 14400019 */  bnez      $v0, .L80247554
.L802474F0:
/* 175DD0 802474F0 00000000 */   nop
D_802474F4:
/* 175DD4 802474F4 0C09A75B */  jal       get_actor
/* 175DD8 802474F8 86240172 */   lh       $a0, 0x172($s1)
/* 175DDC 802474FC 0040802D */  daddu     $s0, $v0, $zero
D_80247500:
/* 175DE0 80247500 12000012 */  beqz      $s0, .L8024754C
/* 175DE4 80247504 24040014 */   addiu    $a0, $zero, 0x14
glabel func_80247508
/* 175DE8 80247508 92030134 */  lbu       $v1, 0x134($s0)
/* 175DEC 8024750C 3C02802A */  lui       $v0, %hi(D_8029F244)
/* 175DF0 80247510 9042F244 */  lbu       $v0, %lo(D_8029F244)($v0)
/* 175DF4 80247514 1462000D */  bne       $v1, $v0, .L8024754C
/* 175DF8 80247518 00000000 */   nop
/* 175DFC 8024751C 8E0201CC */  lw        $v0, 0x1CC($s0)
/* 175E00 80247520 10400005 */  beqz      $v0, .L80247538
/* 175E04 80247524 00000000 */   nop
/* 175E08 80247528 0C0B1059 */  jal       does_script_exist
D_8024752C:
/* 175E0C 8024752C 8E0401EC */   lw       $a0, 0x1EC($s0)
/* 175E10 80247530 14400008 */  bnez      $v0, .L80247554
/* 175E14 80247534 00000000 */   nop
.L80247538:
/* 175E18 80247538 82220094 */  lb        $v0, 0x94($s1)
/* 175E1C 8024753C 04410003 */  bgez      $v0, .L8024754C
/* 175E20 80247540 24040015 */   addiu    $a0, $zero, 0x15
/* 175E24 80247544 A2200094 */  sb        $zero, 0x94($s1)
D_80247548:
/* 175E28 80247548 24040006 */  addiu     $a0, $zero, 0x6
.L8024754C:
/* 175E2C 8024754C 0C090464 */  jal       func_80241190
.L80247550:
/* 175E30 80247550 00000000 */   nop
.L80247554:
/* 175E34 80247554 8FBF0018 */  lw        $ra, 0x18($sp)
D_80247558:
/* 175E38 80247558 8FB10014 */  lw        $s1, 0x14($sp)
.L8024755C:
/* 175E3C 8024755C 8FB00010 */  lw        $s0, 0x10($sp)
/* 175E40 80247560 03E00008 */  jr        $ra
/* 175E44 80247564 27BD0020 */   addiu    $sp, $sp, 0x20

### DECOMPILED C INSTRUCTIONS:

void btl_state_update_next_enemy(void) {
    BattleStatus* battleStatus = &gBattleStatus;
    Actor* player = gBattleStatus.playerActor;
    Actor* partner = gBattleStatus.partnerActor;
    Actor* enemy;
    s32 skipEnemy;
    s32 i;

    switch (gBattleSubState) {
        case BTL_SUBSTATE_NEXT_ENEMY_INIT:
        case BTL_SUBSTATE_NEXT_ENEMY_UNUSED_1:
            i = battleStatus->nextEnemyIndex;
            if (i >= battleStatus->numEnemyActors) {
                // all enemies have been exhausted
                battleStatus->nextEnemyIndex = 0;
                btl_set_state(BATTLE_STATE_END_TURN);
                return;
            }

            // find the next eligible enemy
            while (TRUE) {
                if (battleStatus->enemyIDs[i] >= 0) {
                    u16 enemyID = battleStatus->enemyIDs[i];

                    enemy = battleStatus->enemyActors[enemyID & 0xFF];
                    if (enemy != NULL) {
                        if (!(enemy->flags & (ACTOR_FLAG_NO_ATTACK | ACTOR_FLAG_TARGET_ONLY))) {
                            break;
                        }
                    }
                }
                i++;
                if (i >= battleStatus->numEnemyActors) {
                    i = 0;
                }
                if (i == 0) {
                    battleStatus->nextEnemyIndex = 0;
                    btl_set_state(BATTLE_STATE_END_TURN);
                    return;
                }
            }

            battleStatus->activeEnemyActorID = battleStatus->enemyIDs[i++];
            battleStatus->currentTurnEnemy = enemy;
            battleStatus->nextEnemyIndex = i;

            skipEnemy = FALSE;

            if (enemy->debuff == STATUS_KEY_SLEEP) {
                skipEnemy = TRUE;
            }
            if (enemy->debuff == STATUS_KEY_FEAR) {
                skipEnemy = TRUE;
            }
            if (enemy->debuff == STATUS_KEY_DIZZY) {
                skipEnemy = TRUE;
            }
            if (enemy->debuff == STATUS_KEY_PARALYZE) {
                skipEnemy = TRUE;
            }
            if (enemy->debuff == STATUS_KEY_FROZEN) {
                skipEnemy = TRUE;
            }
            if (enemy->debuff == STATUS_KEY_STOP) {
                skipEnemy = TRUE;
            }
            if (enemy->stoneStatus == STATUS_KEY_STONE) {
                skipEnemy = TRUE;
            }
            if (enemy->flags & ACTOR_FLAG_10000) {
                skipEnemy = TRUE;
            }

            if (skipEnemy) {
                // reset state to fetch next enemy
                gBattleSubState = BTL_SUBSTATE_NEXT_ENEMY_INIT;
                return;
            }

            battleStatus->stateFreezeCount = 0;
            gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN;
            gBattleStatus.flags1 &= ~BS_FLAGS1_BATTLE_FLED;
            gBattleStatus.flags1 &= ~BS_FLAGS1_AUTO_SUCCEED_ACTION;
            gBattleStatus.flags1 &= ~BS_FLAGS1_PARTNER_ACTING;

            player->flags &= ~ACTOR_FLAG_8000000;
            player->flags |= ACTOR_FLAG_4000000;

            if (partner != NULL) {
                partner->flags &= ~ACTOR_FLAG_8000000;
                partner->flags |= ACTOR_FLAG_4000000;
            }

            gBattleStatus.flags2 &= ~BS_FLAGS2_2;
            gBattleStatus.flags2 &= ~BS_FLAGS2_4;
            gBattleStatus.flags2 |= BS_FLAGS2_10000;

            D_8029F244 = enemy->unk_134;
            if (enemy->handlePhaseSource != NULL) {
                Evt* onTurnChanceScript;

                battleStatus->battlePhase = PHASE_ENEMY_BEGIN;
                onTurnChanceScript = start_script(enemy->handlePhaseSource, EVT_PRIORITY_A, 0);
                enemy->handlePhaseScript = onTurnChanceScript;
                enemy->handleBatttlePhaseScriptID = onTurnChanceScript->id;
                onTurnChanceScript->owner1.actorID = battleStatus->activeEnemyActorID;
            }
            gBattleSubState = BTL_SUBSTATE_NEXT_ENEMY_DONE;
            break;
        case BTL_SUBSTATE_NEXT_ENEMY_DONE:
            if (battleStatus->stateFreezeCount == 0) {
                enemy = get_actor(battleStatus->activeEnemyActorID);

                if (enemy == NULL || enemy->unk_134 != D_8029F244) {
                    btl_set_state(BATTLE_STATE_NEXT_ENEMY);
                } else {
                    if (enemy->handlePhaseSource == NULL || !does_script_exist(enemy->handleBatttlePhaseScriptID)) {
                        if (battleStatus->unk_94 < 0) {
                            battleStatus->unk_94 = 0;
                            btl_set_state(BATTLE_STATE_END_TURN);
                        } else {
                            btl_set_state(BATTLE_STATE_ENEMY_MOVE);
                        }
                    }
                }
            }
            break;
    }
}


### RAW ASSEMBLY INSTRUCTIONS:

glabel btl_render_actors
/* 16D63C 8023ED5C 3C02800E */  lui       $v0, %hi(gBattleState)
/* 16D640 8023ED60 8C42C068 */  lw        $v0, %lo(gBattleState)($v0)
/* 16D644 8023ED64 27BDFFB8 */  addiu     $sp, $sp, -0x48
/* 16D648 8023ED68 AFB40030 */  sw        $s4, 0x30($sp)
/* 16D64C 8023ED6C 3C14800E */  lui       $s4, %hi(gBattleStatus)
/* 16D650 8023ED70 2694C070 */  addiu     $s4, $s4, %lo(gBattleStatus)
/* 16D654 8023ED74 AFB00020 */  sw        $s0, 0x20($sp)
/* 16D658 8023ED78 27B00010 */  addiu     $s0, $sp, 0x10
/* 16D65C 8023ED7C AFBF0040 */  sw        $ra, 0x40($sp)
/* 16D660 8023ED80 AFB7003C */  sw        $s7, 0x3C($sp)
/* 16D664 8023ED84 AFB60038 */  sw        $s6, 0x38($sp)
/* 16D668 8023ED88 AFB50034 */  sw        $s5, 0x34($sp)
/* 16D66C 8023ED8C AFB3002C */  sw        $s3, 0x2C($sp)
/* 16D670 8023ED90 AFB20028 */  sw        $s2, 0x28($sp)
/* 16D674 8023ED94 104000A7 */  beqz      $v0, .L8023F034
/* 16D678 8023ED98 AFB10024 */   sw       $s1, 0x24($sp)
/* 16D67C 8023ED9C 0C093BAA */  jal       func_8024EEA8
/* 16D680 8023EDA0 00000000 */   nop
/* 16D684 8023EDA4 8E8200B8 */  lw        $v0, 0xB8($s4)
/* 16D688 8023EDA8 10400003 */  beqz      $v0, .L8023EDB8
/* 16D68C 8023EDAC 00000000 */   nop
/* 16D690 8023EDB0 0040F809 */  jalr      $v0
/* 16D694 8023EDB4 00000000 */   nop
.L8023EDB8:
/* 16D698 8023EDB8 8E820000 */  lw        $v0, 0x0($s4)
/* 16D69C 8023EDBC 30420001 */  andi      $v0, $v0, 0x1
/* 16D6A0 8023EDC0 1040009C */  beqz      $v0, .L8023F034
/* 16D6A4 8023EDC4 00000000 */   nop
/* 16D6A8 8023EDC8 0C0957F6 */  jal       func_80255FD8
/* 16D6AC 8023EDCC 00000000 */   nop
/* 16D6B0 8023EDD0 3C02800A */  lui       $v0, %hi(gCurrentCamID)
/* 16D6B4 8023EDD4 9442A634 */  lhu       $v0, %lo(gCurrentCamID)($v0)
/* 16D6B8 8023EDD8 2442FFFF */  addiu     $v0, $v0, -0x1
/* 16D6BC 8023EDDC 2C420002 */  sltiu     $v0, $v0, 0x2
/* 16D6C0 8023EDE0 10400094 */  beqz      $v0, .L8023F034
/* 16D6C4 8023EDE4 0000902D */   daddu    $s2, $zero, $zero
/* 16D6C8 8023EDE8 3C178025 */  lui       $s7, %hi(D_80257B28)
/* 16D6CC 8023EDEC 26F77B28 */  addiu     $s7, $s7, %lo(D_80257B28)
/* 16D6D0 8023EDF0 3C161000 */  lui       $s6, (0x10000000 >> 16)
/* 16D6D4 8023EDF4 3C158025 */  lui       $s5, %hi(D_8025595C)
/* 16D6D8 8023EDF8 26B5595C */  addiu     $s5, $s5, %lo(D_8025595C)
/* 16D6DC 8023EDFC 0280982D */  daddu     $s3, $s4, $zero
.L8023EE00:
/* 16D6E0 8023EE00 8E7100E0 */  lw        $s1, 0xE0($s3)
/* 16D6E4 8023EE04 5220002A */  beql      $s1, $zero, .L8023EEB0
/* 16D6E8 8023EE08 26520001 */   addiu    $s2, $s2, 0x1
/* 16D6EC 8023EE0C 8E220000 */  lw        $v0, 0x0($s1)
/* 16D6F0 8023EE10 30420001 */  andi      $v0, $v0, 0x1
/* 16D6F4 8023EE14 54400026 */  bnel      $v0, $zero, .L8023EEB0
/* 16D6F8 8023EE18 26520001 */   addiu    $s2, $s2, 0x1
/* 16D6FC 8023EE1C AE120008 */  sw        $s2, 0x8($s0)
/* 16D700 8023EE20 AE17000C */  sw        $s7, 0xC($s0)
/* 16D704 8023EE24 C620014C */  lwc1      $f0, 0x14C($s1)
/* 16D708 8023EE28 4600008D */  trunc.w.s $f2, $f0
/* 16D70C 8023EE2C E6020004 */  swc1      $f2, 0x4($s0)
/* 16D710 8023EE30 86220434 */  lh        $v0, 0x434($s1)
/* 16D714 8023EE34 0200202D */  daddu     $a0, $s0, $zero
/* 16D718 8023EE38 0C047644 */  jal       queue_render_task
/* 16D71C 8023EE3C AE020000 */   sw       $v0, 0x0($s0)
/* 16D720 8023EE40 8E220000 */  lw        $v0, 0x0($s1)
/* 16D724 8023EE44 00561024 */  and       $v0, $v0, $s6
/* 16D728 8023EE48 10400009 */  beqz      $v0, .L8023EE70
/* 16D72C 8023EE4C 24020022 */   addiu    $v0, $zero, 0x22
/* 16D730 8023EE50 AE110008 */  sw        $s1, 0x8($s0)
/* 16D734 8023EE54 AE15000C */  sw        $s5, 0xC($s0)
/* 16D738 8023EE58 C620014C */  lwc1      $f0, 0x14C($s1)
/* 16D73C 8023EE5C AE020000 */  sw        $v0, 0x0($s0)
/* 16D740 8023EE60 4600008D */  trunc.w.s $f2, $f0
/* 16D744 8023EE64 E6020004 */  swc1      $f2, 0x4($s0)
/* 16D748 8023EE68 0C047644 */  jal       queue_render_task
/* 16D74C 8023EE6C 0200202D */   daddu    $a0, $s0, $zero
.L8023EE70:
/* 16D750 8023EE70 92820092 */  lbu       $v0, 0x92($s4)
/* 16D754 8023EE74 30420001 */  andi      $v0, $v0, 0x1
/* 16D758 8023EE78 5040000D */  beql      $v0, $zero, .L8023EEB0
/* 16D75C 8023EE7C 26520001 */   addiu    $s2, $s2, 0x1
/* 16D760 8023EE80 3C028025 */  lui       $v0, %hi(D_80257B68)
/* 16D764 8023EE84 24427B68 */  addiu     $v0, $v0, %lo(D_80257B68)
/* 16D768 8023EE88 AE110008 */  sw        $s1, 0x8($s0)
/* 16D76C 8023EE8C AE02000C */  sw        $v0, 0xC($s0)
/* 16D770 8023EE90 C620014C */  lwc1      $f0, 0x14C($s1)
/* 16D774 8023EE94 4600008D */  trunc.w.s $f2, $f0
/* 16D778 8023EE98 E6020004 */  swc1      $f2, 0x4($s0)
/* 16D77C 8023EE9C 86220434 */  lh        $v0, 0x434($s1)
/* 16D780 8023EEA0 0200202D */  daddu     $a0, $s0, $zero
/* 16D784 8023EEA4 0C047644 */  jal       queue_render_task
/* 16D788 8023EEA8 AE020000 */   sw       $v0, 0x0($s0)
/* 16D78C 8023EEAC 26520001 */  addiu     $s2, $s2, 0x1
.L8023EEB0:
/* 16D790 8023EEB0 2A420018 */  slti      $v0, $s2, 0x18
/* 16D794 8023EEB4 1440FFD2 */  bnez      $v0, .L8023EE00
/* 16D798 8023EEB8 26730004 */   addiu    $s3, $s3, 0x4
/* 16D79C 8023EEBC 8E9100DC */  lw        $s1, 0xDC($s4)
/* 16D7A0 8023EEC0 1220002D */  beqz      $s1, .L8023EF78
/* 16D7A4 8023EEC4 00000000 */   nop
/* 16D7A8 8023EEC8 8E220000 */  lw        $v0, 0x0($s1)
/* 16D7AC 8023EECC 30420001 */  andi      $v0, $v0, 0x1
/* 16D7B0 8023EED0 14400029 */  bnez      $v0, .L8023EF78
/* 16D7B4 8023EED4 0200202D */   daddu    $a0, $s0, $zero
/* 16D7B8 8023EED8 3C028025 */  lui       $v0, %hi(D_80257B48)
/* 16D7BC 8023EEDC 24427B48 */  addiu     $v0, $v0, %lo(D_80257B48)
/* 16D7C0 8023EEE0 AE000008 */  sw        $zero, 0x8($s0)
/* 16D7C4 8023EEE4 AE02000C */  sw        $v0, 0xC($s0)
/* 16D7C8 8023EEE8 C620014C */  lwc1      $f0, 0x14C($s1)
/* 16D7CC 8023EEEC 4600008D */  trunc.w.s $f2, $f0
/* 16D7D0 8023EEF0 E6020004 */  swc1      $f2, 0x4($s0)
/* 16D7D4 8023EEF4 86220434 */  lh        $v0, 0x434($s1)
/* 16D7D8 8023EEF8 0C047644 */  jal       queue_render_task
/* 16D7DC 8023EEFC AE020000 */   sw       $v0, 0x0($s0)
/* 16D7E0 8023EF00 8E220000 */  lw        $v0, 0x0($s1)
/* 16D7E4 8023EF04 3C031000 */  lui       $v1, (0x10000000 >> 16)
/* 16D7E8 8023EF08 00431024 */  and       $v0, $v0, $v1
/* 16D7EC 8023EF0C 1040000C */  beqz      $v0, .L8023EF40
/* 16D7F0 8023EF10 00000000 */   nop
/* 16D7F4 8023EF14 3C028025 */  lui       $v0, %hi(D_8025599C)
/* 16D7F8 8023EF18 2442599C */  addiu     $v0, $v0, %lo(D_8025599C)
/* 16D7FC 8023EF1C AE110008 */  sw        $s1, 0x8($s0)
/* 16D800 8023EF20 AE02000C */  sw        $v0, 0xC($s0)
/* 16D804 8023EF24 C620014C */  lwc1      $f0, 0x14C($s1)
/* 16D808 8023EF28 24020022 */  addiu     $v0, $zero, 0x22
/* 16D80C 8023EF2C AE020000 */  sw        $v0, 0x0($s0)
/* 16D810 8023EF30 4600008D */  trunc.w.s $f2, $f0
/* 16D814 8023EF34 E6020004 */  swc1      $f2, 0x4($s0)
/* 16D818 8023EF38 0C047644 */  jal       queue_render_task
/* 16D81C 8023EF3C 0200202D */   daddu    $a0, $s0, $zero
.L8023EF40:
/* 16D820 8023EF40 92820092 */  lbu       $v0, 0x92($s4)
/* 16D824 8023EF44 30420001 */  andi      $v0, $v0, 0x1
/* 16D828 8023EF48 1040000B */  beqz      $v0, .L8023EF78
/* 16D82C 8023EF4C 0200202D */   daddu    $a0, $s0, $zero
/* 16D830 8023EF50 3C028025 */  lui       $v0, %hi(D_80257B88)
/* 16D834 8023EF54 24427B88 */  addiu     $v0, $v0, %lo(D_80257B88)
/* 16D838 8023EF58 AE000008 */  sw        $zero, 0x8($s0)
/* 16D83C 8023EF5C AE02000C */  sw        $v0, 0xC($s0)
/* 16D840 8023EF60 C620014C */  lwc1      $f0, 0x14C($s1)
/* 16D844 8023EF64 4600008D */  trunc.w.s $f2, $f0
/* 16D848 8023EF68 E6020004 */  swc1      $f2, 0x4($s0)
/* 16D84C 8023EF6C 86220434 */  lh        $v0, 0x434($s1)
/* 16D850 8023EF70 0C047644 */  jal       queue_render_task
/* 16D854 8023EF74 AE020000 */   sw       $v0, 0x0($s0)
.L8023EF78:
/* 16D858 8023EF78 8E9100D8 */  lw        $s1, 0xD8($s4)
/* 16D85C 8023EF7C 1220002D */  beqz      $s1, .L8023F034
/* 16D860 8023EF80 00000000 */   nop
/* 16D864 8023EF84 8E220000 */  lw        $v0, 0x0($s1)
/* 16D868 8023EF88 30420001 */  andi      $v0, $v0, 0x1
/* 16D86C 8023EF8C 14400029 */  bnez      $v0, .L8023F034
/* 16D870 8023EF90 0200202D */   daddu    $a0, $s0, $zero
/* 16D874 8023EF94 3C028025 */  lui       $v0, %hi(D_80257DA4)
/* 16D878 8023EF98 24427DA4 */  addiu     $v0, $v0, %lo(D_80257DA4)
/* 16D87C 8023EF9C AE000008 */  sw        $zero, 0x8($s0)
/* 16D880 8023EFA0 AE02000C */  sw        $v0, 0xC($s0)
/* 16D884 8023EFA4 C620014C */  lwc1      $f0, 0x14C($s1)
/* 16D888 8023EFA8 4600008D */  trunc.w.s $f2, $f0
/* 16D88C 8023EFAC E6020004 */  swc1      $f2, 0x4($s0)
/* 16D890 8023EFB0 86220434 */  lh        $v0, 0x434($s1)
/* 16D894 8023EFB4 0C047644 */  jal       queue_render_task
/* 16D898 8023EFB8 AE020000 */   sw       $v0, 0x0($s0)
/* 16D89C 8023EFBC 8E220000 */  lw        $v0, 0x0($s1)
/* 16D8A0 8023EFC0 3C031000 */  lui       $v1, (0x10000000 >> 16)
/* 16D8A4 8023EFC4 00431024 */  and       $v0, $v0, $v1
/* 16D8A8 8023EFC8 1040000C */  beqz      $v0, .L8023EFFC
/* 16D8AC 8023EFCC 00000000 */   nop
/* 16D8B0 8023EFD0 3C028025 */  lui       $v0, %hi(D_80254C50)
/* 16D8B4 8023EFD4 24424C50 */  addiu     $v0, $v0, %lo(D_80254C50)
/* 16D8B8 8023EFD8 AE110008 */  sw        $s1, 0x8($s0)
/* 16D8BC 8023EFDC AE02000C */  sw        $v0, 0xC($s0)
/* 16D8C0 8023EFE0 C620014C */  lwc1      $f0, 0x14C($s1)
/* 16D8C4 8023EFE4 24020022 */  addiu     $v0, $zero, 0x22
/* 16D8C8 8023EFE8 AE020000 */  sw        $v0, 0x0($s0)
/* 16D8CC 8023EFEC 4600008D */  trunc.w.s $f2, $f0
/* 16D8D0 8023EFF0 E6020004 */  swc1      $f2, 0x4($s0)
/* 16D8D4 8023EFF4 0C047644 */  jal       queue_render_task
/* 16D8D8 8023EFF8 0200202D */   daddu    $a0, $s0, $zero
.L8023EFFC:
/* 16D8DC 8023EFFC 92820092 */  lbu       $v0, 0x92($s4)
/* 16D8E0 8023F000 30420001 */  andi      $v0, $v0, 0x1
/* 16D8E4 8023F004 1040000B */  beqz      $v0, .L8023F034
/* 16D8E8 8023F008 0200202D */   daddu    $a0, $s0, $zero
/* 16D8EC 8023F00C 3C028026 */  lui       $v0, %hi(D_80258E14)
/* 16D8F0 8023F010 24428E14 */  addiu     $v0, $v0, %lo(D_80258E14)
/* 16D8F4 8023F014 AE000008 */  sw        $zero, 0x8($s0)
/* 16D8F8 8023F018 AE02000C */  sw        $v0, 0xC($s0)
/* 16D8FC 8023F01C C620014C */  lwc1      $f0, 0x14C($s1)
/* 16D900 8023F020 4600008D */  trunc.w.s $f2, $f0
/* 16D904 8023F024 E6020004 */  swc1      $f2, 0x4($s0)
/* 16D908 8023F028 86220434 */  lh        $v0, 0x434($s1)
/* 16D90C 8023F02C 0C047644 */  jal       queue_render_task
/* 16D910 8023F030 AC820000 */   sw       $v0, 0x0($a0)
.L8023F034:
/* 16D914 8023F034 8FBF0040 */  lw        $ra, 0x40($sp)
/* 16D918 8023F038 8FB7003C */  lw        $s7, 0x3C($sp)
/* 16D91C 8023F03C 8FB60038 */  lw        $s6, 0x38($sp)
/* 16D920 8023F040 8FB50034 */  lw        $s5, 0x34($sp)
/* 16D924 8023F044 8FB40030 */  lw        $s4, 0x30($sp)
/* 16D928 8023F048 8FB3002C */  lw        $s3, 0x2C($sp)
/* 16D92C 8023F04C 8FB20028 */  lw        $s2, 0x28($sp)
/* 16D930 8023F050 8FB10024 */  lw        $s1, 0x24($sp)
/* 16D934 8023F054 8FB00020 */  lw        $s0, 0x20($sp)
/* 16D938 8023F058 03E00008 */  jr        $ra
/* 16D93C 8023F05C 27BD0048 */   addiu    $sp, $sp, 0x48

### DECOMPILED C INSTRUCTIONS:

void btl_render_actors(void) {
    BattleStatus* battleStatus = &gBattleStatus;
    RenderTask renderTask;
    RenderTask* renderTaskPtr = &renderTask;
    Actor* actor;
    s32 i;

    if (gBattleState != BATTLE_STATE_0) {
        btl_popup_messages_draw_world_geometry();
        if (battleStatus->initBattleCallback != NULL) {
            battleStatus->initBattleCallback();
        }
        if (battleStatus->flags1 & BS_FLAGS1_ACTORS_VISIBLE) {
            func_80255FD8();

            if (gCurrentCamID == CAM_BATTLE || gCurrentCamID == CAM_TATTLE) {
                for (i = 0; i < ARRAY_COUNT(battleStatus->enemyActors); i++) {
                    actor = battleStatus->enemyActors[i];

                    if (actor != NULL && !(actor->flags & ACTOR_FLAG_DISABLED)) {
                        renderTaskPtr->appendGfxArg = (void*)i;
                        renderTaskPtr->appendGfx = appendGfx_enemy_actor;
                        renderTaskPtr->distance = actor->currentPos.z;
                        renderTaskPtr->renderMode = actor->renderMode;
                        queue_render_task(renderTaskPtr);

                        if (actor->flags & ACTOR_FLAG_BLUR_ENABLED) {
                            renderTaskPtr->appendGfxArg = actor;
                            renderTaskPtr->appendGfx = appendGfx_enemy_actor_blur;
                            renderTaskPtr->distance = actor->currentPos.z;
                            renderTaskPtr->renderMode = RENDER_MODE_SURFACE_XLU_LAYER3;
                            queue_render_task(renderTaskPtr);
                        }

                        if (battleStatus->reflectFlags & BS_REFLECT_FLOOR) {
                            renderTaskPtr->appendGfxArg = actor;
                            renderTaskPtr->appendGfx = appendGfx_enemy_actor_reflection;
                            renderTaskPtr->distance = actor->currentPos.z;
                            renderTaskPtr->renderMode = actor->renderMode;
                            queue_render_task(renderTaskPtr);
                        }
                    }
                }

                actor = battleStatus->partnerActor;
                if (actor != NULL && !(actor->flags & ACTOR_FLAG_DISABLED)) {
                    renderTaskPtr->appendGfxArg = NULL;
                    renderTaskPtr->appendGfx = appendGfx_partner_actor;
                    renderTaskPtr->distance = actor->currentPos.z;
                    renderTaskPtr->renderMode = actor->renderMode;
                    queue_render_task(renderTaskPtr);

                    if (actor->flags & ACTOR_FLAG_BLUR_ENABLED) {
                        renderTaskPtr->appendGfxArg = actor;
                        renderTaskPtr->appendGfx = appendGfx_partner_actor_blur;
                        renderTaskPtr->distance = actor->currentPos.z;
                        renderTaskPtr->renderMode = RENDER_MODE_SURFACE_XLU_LAYER3;
                        queue_render_task(renderTaskPtr);
                    }

                    if (battleStatus->reflectFlags & BS_REFLECT_FLOOR) {
                        renderTaskPtr->appendGfxArg = NULL;
                        renderTaskPtr->appendGfx = appendGfx_partner_actor_reflection;
                        renderTaskPtr->distance = actor->currentPos.z;
                        renderTaskPtr->renderMode = actor->renderMode;
                        queue_render_task(renderTaskPtr);
                    }
                }

                actor = battleStatus->playerActor;
                if (actor != NULL && !(actor->flags & ACTOR_FLAG_DISABLED)) {
                    renderTaskPtr->appendGfxArg = NULL;
                    renderTaskPtr->appendGfx = appendGfx_player_actor;
                    renderTaskPtr->distance = actor->currentPos.z;
                    renderTaskPtr->renderMode = actor->renderMode;
                    queue_render_task(renderTaskPtr);

                    if (actor->flags & ACTOR_FLAG_BLUR_ENABLED) {
                        renderTaskPtr->appendGfxArg = actor;
                        renderTaskPtr->appendGfx = (void (*) (void*)) appendGfx_player_actor_blur;
                        renderTaskPtr->distance = actor->currentPos.z;
                        renderTaskPtr->renderMode = RENDER_MODE_SURFACE_XLU_LAYER3;
                        queue_render_task(renderTaskPtr);
                    }

                    if (battleStatus->reflectFlags & BS_REFLECT_FLOOR) {
                        renderTaskPtr->appendGfxArg = NULL;
                        renderTaskPtr->appendGfx = appendGfx_player_actor_reflection;
                        renderTaskPtr->distance = actor->currentPos.z;
                        renderTaskPtr->renderMode = actor->renderMode;
                        queue_render_task(renderTaskPtr);
                    }
                }
            }
        }
    }
}