[*] Binary protection state of sadf

  
  	Full RELRO     Canary found      NX disabled  PIE enabled  No RPATH     No RUNPATH   No Symbols


[*] Function fprintf tear down of sadf

    ; assembly                               | /* r2dec pseudo code output */
                                             | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0x511e4 */
                                             | #include <stdint.h>
                                             |  
    ; (fcn) sym.check_file_actlst ()         | void check_file_actlst () {
    0x000511e4 lui gp, 3                     |     
    0x000511e8 addiu gp, gp, -0x2224         |     
    0x000511ec addu gp, gp, t9               |     gp += t9;
    0x000511f0 addiu sp, sp, -0x60           |     
    0x000511f4 addiu v0, zero, 1             |     v0 = 1;
    0x000511f8 sw s6, 0x50(sp)               |     *(var_50h) = s6;
    0x000511fc lw s6, 0x84(sp)               |     s6 = *(arg_84h);
    0x00051200 sw s0, 0x38(sp)               |     *(var_38h) = s0;
    0x00051204 sw a3, 0x6c(sp)               |     *(arg_6ch) = a3;
    0x00051208 lw t9, -0x7e9c(gp)            |     t9 = sym.sa_open_read_magic;
    0x0005120c move s0, a2                   |     s0 = a2;
    0x00051210 lw a3, 0x80(sp)               |     a3 = *(arg_80h);
    0x00051214 lw a2, 0x70(sp)               |     a2 = *(arg_70h);
    0x00051218 sw gp, 0x18(sp)               |     *(var_18h) = gp;
    0x0005121c sw s7, 0x54(sp)               |     *(var_54h) = s7;
    0x00051220 sw s2, 0x40(sp)               |     *(var_40h) = s2;
    0x00051224 sw ra, 0x5c(sp)               |     *(var_5ch) = ra;
    0x00051228 sw fp, 0x58(sp)               |     *(var_58h) = fp;
    0x0005122c sw s5, 0x4c(sp)               |     *(var_4ch) = s5;
    0x00051230 sw s4, 0x48(sp)               |     *(var_48h) = s4;
    0x00051234 sw s3, 0x44(sp)               |     *(var_44h) = s3;
    0x00051238 sw s1, 0x3c(sp)               |     *(var_3ch) = s1;
    0x0005123c sw v0, 0x14(sp)               |     *(var_14h) = v0;
    0x00051240 sw s6, 0x10(sp)               |     *(var_10h) = s6;
    0x00051244 sw a1, 0x64(sp)               |     *(arg_64h) = a1;
    0x00051248 move s7, a0                   |     s7 = a0;
    0x0005124c lw s2, 0x74(sp)               |     s2 = *(arg_74h);
    0x00051250 bal 0x50ef4                   |     sym_sa_open_read_magic ();
    0x00051254 lw gp, 0x18(sp)               |     gp = *(var_18h);
                                             |     if (v0 < 0) {
    0x00051258 bltz v0, 0x51790              |         goto label_9;
                                             |     }
    0x0005125c lw v0, 0x70(sp)               |     v0 = *(arg_70h);
    0x00051260 lw s1, 8(v0)                  |     s1 = *((v0 + 2));
    0x00051264 addiu v0, s1, -1              |     v0 = s1 + -1;
    0x00051268 sltiu v0, v0, 0x2000          |     v0 = (v0 < 0x2000) ? 1 : 0;
    0x0005126c lw t9, -0x7c70(gp)            |     t9 = sym.imp.calloc;
                                             |     if (v0 == 0) {
    0x00051270 beqz v0, 0x5182c              |         goto label_10;
                                             |     }
    0x00051274 addiu a1, zero, 1             |     a1 = 1;
    0x00051278 move a0, s1                   |     a0 = s1;
    0x0005127c jalr t9                       |     t9 ();
    0x00051280 move s3, v0                   |     s3 = v0;
    0x00051284 lw gp, 0x18(sp)               |     gp = *(var_18h);
                                             |     if (v0 == 0) {
    0x00051288 beqz v0, 0x51870              |         goto label_11;
                                             |     }
    0x0005128c lw t9, -0x7e80(gp)            |     t9 = sym.sa_fread;
    0x00051290 lw a0, (s7)                   |     a0 = *(s7);
    0x00051294 sw t9, 0x28(sp)               |     *(var_28h) = t9;
    0x00051298 addiu a3, zero, 1             |     a3 = 1;
    0x0005129c move a2, s1                   |     a2 = s1;
    0x000512a0 move a1, v0                   |     a1 = v0;
    0x000512a4 sw zero, 0x10(sp)             |     *(var_10h) = 0;
    0x000512a8 bal 0x505d4                   |     sym_sa_fread ();
    0x000512ac lw v0, 0x70(sp)               |     v0 = *(arg_70h);
    0x000512b0 lw gp, 0x18(sp)               |     gp = *(var_18h);
    0x000512b4 move a2, s3                   |     a2 = s3;
    0x000512b8 lw a3, 8(v0)                  |     a3 = *((v0 + 2));
    0x000512bc addiu v0, zero, 0x148         |     v0 = aav.0x00000148;
    0x000512c0 lw t9, -0x7d24(gp)            |     t9 = sym.remap_struct;
    0x000512c4 sw v0, 0x10(sp)               |     *(var_10h) = v0;
    0x000512c8 lw v0, 0x70(sp)               |     v0 = *(arg_70h);
    0x000512cc lw a0, -0x7e74(gp)            |     a0 = *(gp);
    0x000512d0 sw t9, 0x24(sp)               |     *(var_24h) = t9;
    0x000512d4 sw a3, 0x14(sp)               |     *(var_14h) = a3;
    0x000512d8 addiu a1, v0, 0x10            |     a1 = v0 + 0x10;
    0x000512dc bal 0x502b8                   |     sym_remap_struct ();
    0x000512e0 lw gp, 0x18(sp)               |     gp = *(var_18h);
                                             |     if (v0 < 0) {
    0x000512e4 bltz v0, 0x5181c              |         goto label_12;
                                             |     }
    0x000512e8 move v1, s3                   |     v1 = s3;
    0x000512ec move v0, s2                   |     v0 = s2;
    0x000512f0 addiu t0, s3, 0x140           |     t0 = s3 + aav.0x00000140;
                                             |     do {
    0x000512f4 lw a3, (v1)                   |         a3 = *(v1);
    0x000512f8 lw a2, 4(v1)                  |         a2 = *((v1 + 1));
    0x000512fc lw a1, 8(v1)                  |         a1 = *((v1 + 2));
    0x00051300 lw a0, 0xc(v1)                |         a0 = *((v1 + 3));
    0x00051304 swl a3, 3(v0)                 |         __asm ("swl a3, 3(v0)");
    0x00051308 swr a3, (v0)                  |         __asm ("swr a3, (v0)");
    0x0005130c swl a2, 7(v0)                 |         __asm ("swl a2, 7(v0)");
    0x00051310 swr a2, 4(v0)                 |         __asm ("swr a2, 4(v0)");
    0x00051314 swl a1, 0xb(v0)               |         __asm ("swl a1, 0xb(v0)");
    0x00051318 swr a1, 8(v0)                 |         __asm ("swr a1, 8(v0)");
    0x0005131c swl a0, 0xf(v0)               |         __asm ("swl a0, 0xf(v0)");
    0x00051320 addiu v1, v1, 0x10            |         v1 += 0x10;
    0x00051324 swr a0, 0xc(v0)               |         __asm ("swr a0, 0xc(v0)");
    0x00051328 addiu v0, v0, 0x10            |         v0 += 0x10;
    0x0005132c bne v1, t0, 0x512f4           |         
                                             |     } while (v1 != t0);
    0x00051330 lw a0, (v1)                   |     a0 = *(v1);
    0x00051334 lw v1, 4(v1)                  |     v1 = *((v1 + 1));
    0x00051338 swl a0, 3(v0)                 |     __asm ("swl a0, 3(v0)");
    0x0005133c swr a0, (v0)                  |     __asm ("swr a0, (v0)");
    0x00051340 swl v1, 7(v0)                 |     __asm ("swl v1, 7(v0)");
    0x00051344 lw t9, -0x7b74(gp)            |     t9 = sym.imp.free;
    0x00051348 swr v1, 4(v0)                 |     __asm ("swr v1, 4(v0)");
    0x0005134c move a0, s3                   |     a0 = s3;
    0x00051350 jalr t9                       |     t9 ();
    0x00051354 lb a2, 0x3e(s2)               |     a2 = *((s2 + 62));
    0x00051358 lw v0, 0x88(sp)               |     v0 = *(arg_88h);
    0x0005135c xori a2, a2, 8                |     a2 ^= 8;
    0x00051360 sltiu a2, a2, 1               |     a2 = (a2 < 1) ? 1 : 0;
    0x00051364 lw gp, 0x18(sp)               |     gp = *(var_18h);
    0x00051368 sw a2, (v0)                   |     *(v0) = a2;
    0x0005136c lw v0, (s6)                   |     v0 = *(s6);
    0x00051370 lw a0, -0x7e74(gp)            |     a0 = *(gp);
                                             |     if (v0 == 0) {
    0x00051374 bnel v0, zero, 0x51808        |         goto label_13;
                                             |     }
                                             | label_7:
    0x00051378 lw s1, 0x14(s2)               |     s1 = *((s2 + 5));
    0x0005137c sltiu v0, s1, 0x101           |     v0 = (s1 < 0x101) ? 1 : 0;
                                             |     if (v0 == 0) {
    0x00051380 beql v0, zero, 0x51830        |         goto label_14;
                                             |     }
    0x00051384 lw a0, (s7)                   |     a0 = *(s7);
    0x00051388 lw a0, 0x34(s2)               |     a0 = *((s2 + 13));
    0x0005138c sltiu v0, a0, 0x401           |     v0 = (a0 < 0x401) ? 1 : 0;
                                             |     if (v0 == 0) {
    0x00051390 beql v0, zero, 0x51830        |         goto label_14;
                                             |     }
    0x00051394 lw a0, (s7)                   |     a0 = *(s7);
    0x00051398 lw v1, 0x38(s2)               |     v1 = *((s2 + 14));
    0x0005139c sltiu v0, v1, 0x201           |     v0 = (v1 < 0x201) ? 1 : 0;
                                             |     if (v0 == 0) {
    0x000513a0 beql v0, zero, 0x51830        |         goto label_14;
                                             |     }
    0x000513a4 lw a0, (s7)                   |     a0 = *(s7);
    0x000513a8 lw v0, 0x1c(s2)               |     v0 = *((s2 + 7));
    0x000513ac lw a2, 0x20(s2)               |     a2 = *((s2 + 8));
    0x000513b0 lw a1, 0x24(s2)               |     a1 = *((s2 + 9));
    0x000513b4 addu v0, v0, a2               |     v0 += a2;
    0x000513b8 sll v0, v0, 1                 |     v0 <<= 1;
    0x000513bc addu v0, v0, a1               |     v0 += a1;
    0x000513c0 sll v0, v0, 2                 |     v0 <<= 2;
    0x000513c4 sltu v0, a0, v0               |     v0 = (a0 < v0) ? 1 : 0;
    0x000513c8 lw a0, (s7)                   |     a0 = *(s7);
                                             |     if (v0 == 0) {
    0x000513cc bnel v0, zero, 0x51830        |         goto label_14;
                                             |     }
    0x000513d0 lw v0, 0x28(s2)               |     v0 = *((s2 + 10));
    0x000513d4 lw a2, 0x2c(s2)               |     a2 = *((s2 + 11));
    0x000513d8 lw a1, 0x30(s2)               |     a1 = *((s2 + 12));
    0x000513dc addu v0, v0, a2               |     v0 += a2;
    0x000513e0 sll v0, v0, 1                 |     v0 <<= 1;
    0x000513e4 addu v0, v0, a1               |     v0 += a1;
    0x000513e8 sll v0, v0, 2                 |     v0 <<= 2;
    0x000513ec sltu v0, v1, v0               |     v0 = (v1 < v0) ? 1 : 0;
    0x000513f0 lw a0, (s7)                   |     a0 = *(s7);
                                             |     if (v0 == 0) {
    0x000513f4 bnel v0, zero, 0x51830        |         goto label_14;
                                             |     }
    0x000513f8 lw t9, -0x7c70(gp)            |     t9 = sym.imp.calloc;
                                             |     if (a0 == 0) {
    0x000513fc beqz a0, 0x51890              |         goto label_15;
                                             |     }
    0x00051400 addiu a1, zero, 1             |     a1 = 1;
    0x00051404 jalr t9                       |     t9 ();
    0x00051408 move s3, v0                   |     s3 = v0;
    0x0005140c lw gp, 0x18(sp)               |     gp = *(var_18h);
                                             |     if (v0 == 0) {
    0x00051410 beqz v0, 0x51870              |         goto label_11;
                                             |     }
    0x00051414 sll a1, s1, 3                 |     a1 = s1 << 3;
    0x00051418 lw v0, 0x78(sp)               |     v0 = *(arg_78h);
    0x0005141c addu a1, a1, s1               |     a1 += s1;
    0x00051420 sll a1, a1, 2                 |     a1 <<= 2;
    0x00051424 lw fp, (v0)                   |     fp = *(v0);
                                             |     if (a1 != 0) {
    0x00051428 bnez a1, 0x517dc              |         goto label_16;
                                             |     }
                                             |     if (fp == 0) {
                                             | label_8:
    0x0005142c beql fp, zero, 0x51894        |         goto label_17;
                                             |     }
    0x00051430 lw v0, -0x7b6c(gp)            |     v0 = *((gp - 7899));
    0x00051434 lw v1, 0x14(s2)               |     v1 = *((s2 + 5));
                                             | label_6:
    0x00051438 move s5, zero                 |     s5 = 0;
                                             |     if (v1 == 0) {
    0x0005143c beqz v1, 0x516a8              |         goto label_18;
                                             |     }
    0x00051440 lw v0, -0x7e90(gp)            |     v0 = sym.swap_struct;
    0x00051444 move s5, zero                 |     s5 = 0;
    0x00051448 sw v0, 0x34(sp)               |     *(var_34h) = v0;
    0x0005144c lw v0, -0x7f80(gp)            |     v0 = sym.get_activity_position;
    0x00051450 move s4, zero                 |     s4 = 0;
    0x00051454 sw v0, 0x30(sp)               |     *(var_30h) = v0;
    0x00051458 addiu v0, s2, 0x1c            |     v0 = s2 + 0x1c;
    0x0005145c sw v0, 0x20(sp)               |     *(var_20h) = v0;
    0x00051460 lui v0, 0x1000                |     v0 = 0x10000001;
    0x00051464 addiu v0, v0, 1               |     
    0x00051468 addiu s1, s3, 0x20            |     s1 = s3 + 0x20;
    0x0005146c sw v0, 0x2c(sp)               |     *(var_2ch) = v0;
                                             | label_0:
    0x00051470 lw a2, 0x34(s2)               |     a2 = *((s2 + 13));
    0x00051474 lw a0, (s7)                   |     a0 = *(s7);
    0x00051478 lw t9, 0x28(sp)               |     t9 = *(var_28h);
    0x0005147c addiu a3, zero, 1             |     a3 = 1;
    0x00051480 move a1, s3                   |     a1 = s3;
    0x00051484 sw zero, 0x10(sp)             |     *(var_10h) = 0;
    0x00051488 jalr t9                       |     t9 ();
    0x0005148c lw gp, 0x18(sp)               |     gp = *(var_18h);
    0x00051490 lw a3, 0x34(s2)               |     a3 = *((s2 + 13));
    0x00051494 addiu v0, zero, 0x24          |     v0 = 0x24;
    0x00051498 lw a0, -0x7e88(gp)            |     a0 = *(gp);
    0x0005149c lw a1, 0x20(sp)               |     a1 = *(var_20h);
    0x000514a0 lw t9, 0x24(sp)               |     t9 = *(var_24h);
    0x000514a4 sw a3, 0x14(sp)               |     *(var_14h) = a3;
    0x000514a8 sw v0, 0x10(sp)               |     *(var_10h) = v0;
    0x000514ac move a2, s3                   |     a2 = s3;
    0x000514b0 jalr t9                       |     t9 ();
    0x000514b4 lw gp, 0x18(sp)               |     gp = *(var_18h);
                                             |     if (v0 < 0) {
    0x000514b8 bltz v0, 0x5181c              |         goto label_12;
                                             |     }
    0x000514bc move v1, s3                   |     v1 = s3;
    0x000514c0 move v0, fp                   |     v0 = fp;
                                             |     do {
    0x000514c4 lw a3, (v1)                   |         a3 = *(v1);
    0x000514c8 lw a2, 4(v1)                  |         a2 = *((v1 + 1));
    0x000514cc lw a1, 8(v1)                  |         a1 = *((v1 + 2));
    0x000514d0 lw a0, 0xc(v1)                |         a0 = *((v1 + 3));
    0x000514d4 swl a3, 3(v0)                 |         __asm ("swl a3, 3(v0)");
    0x000514d8 swr a3, (v0)                  |         __asm ("swr a3, (v0)");
    0x000514dc swl a2, 7(v0)                 |         __asm ("swl a2, 7(v0)");
    0x000514e0 swr a2, 4(v0)                 |         __asm ("swr a2, 4(v0)");
    0x000514e4 swl a1, 0xb(v0)               |         __asm ("swl a1, 0xb(v0)");
    0x000514e8 swr a1, 8(v0)                 |         __asm ("swr a1, 8(v0)");
    0x000514ec swl a0, 0xf(v0)               |         __asm ("swl a0, 0xf(v0)");
    0x000514f0 addiu v1, v1, 0x10            |         v1 += 0x10;
    0x000514f4 swr a0, 0xc(v0)               |         __asm ("swr a0, 0xc(v0)");
    0x000514f8 addiu v0, v0, 0x10            |         v0 += 0x10;
    0x000514fc bne v1, s1, 0x514c4           |         
                                             |     } while (v1 != s1);
    0x00051500 lw v1, (s1)                   |     v1 = *(s1);
    0x00051504 swl v1, 3(v0)                 |     __asm ("swl v1, 3(v0)");
    0x00051508 swr v1, (v0)                  |     __asm ("swr v1, (v0)");
    0x0005150c lw v0, (s6)                   |     v0 = *(s6);
    0x00051510 lw v0, 0x88(sp)               |     v0 = *(arg_88h);
                                             |     if (v0 != 0) {
    0x00051514 bnez v0, 0x517c0              |         goto label_19;
                                             |     }
                                             | label_5:
    0x00051518 lw v1, 8(fp)                  |     v1 = *(arg_8h);
    0x0005151c lw t9, -0x7b74(gp)            |     t9 = sym.imp.free;
                                             |     if (v1 <= 0) {
    0x00051520 blez v1, 0x51820              |         goto label_20;
                                             |     }
    0x00051524 lw v0, 0xc(fp)                |     v0 = *(arg_6ch);
    0x00051528 addiu v0, v0, -1              |     v0 += -1;
    0x0005152c sltiu v0, v0, 0x400           |     v0 = (v0 < 0x400) ? 1 : 0;
                                             |     if (v0 == 0) {
    0x00051530 beqz v0, 0x51820              |         goto label_20;
                                             |     }
    0x00051534 nop                           |     
    0x00051538 lw v0, 0x2c(sp)               |     v0 = *(var_2ch);
    0x0005153c slt v1, v1, v0                |     v1 = (v1 < v0) ? 1 : 0;
                                             |     if (v1 == 0) {
    0x00051540 beqz v1, 0x51820              |         goto label_20;
                                             |     }
    0x00051544 nop                           |     
    0x00051548 lw v0, 0x14(fp)               |     v0 = *(arg_74h);
    0x0005154c lw t9, 0x30(sp)               |     t9 = *(var_30h);
                                             |     if (v0 <= 0) {
    0x00051550 blez v0, 0x5181c              |         goto label_12;
                                             |     }
    0x00051554 lw a1, (fp)                   |     a1 = *(fp);
    0x00051558 move a2, zero                 |     a2 = 0;
    0x0005155c move a0, s0                   |     a0 = s0;
    0x00051560 jalr t9                       |     t9 ();
    0x00051564 lw gp, 0x18(sp)               |     gp = *(var_18h);
                                             |     if (v0 >= 0) {
    0x00051568 bltz v0, 0x51688              |         
    0x0005156c sll v0, v0, 2                 |         v0 <<= 2;
    0x00051570 lw v1, 4(fp)                  |         v1 = *(arg_64h);
    0x00051574 lwx v0, v0(s0)                |         __asm ("lwx v0, v0(s0)");
    0x00051578 lw a0, 8(v0)                  |         a0 = *((v0 + 2));
    0x0005157c lw v1, 0x80(sp)               |         v1 = *(arg_80h);
                                             |         if (a0 != v1) {
    0x00051580 beq a0, v1, 0x51590           |             
    0x00051584 addiu v1, zero, 0x89          |             v1 = 0x89;
                                             |             if (v1 == 0) {
    0x00051588 beqz v1, 0x51688              |                 goto label_21;
                                             |             }
    0x0005158c sw v1, 8(v0)                  |             *((v0 + 2)) = v1;
                                             |         }
    0x00051590 lw t1, 8(fp)                  |         t1 = *(arg_8h);
    0x00051594 lw v1, 0x78(v0)               |         v1 = *((v0 + 30));
    0x00051598 slt v1, v1, t1                |         v1 = (v1 < t1) ? 1 : 0;
    0x0005159c lw t9, -0x7b74(gp)            |         t9 = sym.imp.free;
                                             |         if (v1 != 0) {
    0x000515a0 bnez v1, 0x51820              |             goto label_20;
                                             |         }
    0x000515a4 lw a1, 0x18(fp)               |         a1 = *(arg_78h);
    0x000515a8 lw v1, 0x54(v0)               |         v1 = *((v0 + 21));
    0x000515ac sltu a0, a1, v1               |         a0 = (a1 < v1) ? 1 : 0;
    0x000515b0 sltu v1, v1, a1               |         v1 = (v1 < a1) ? 1 : 0;
                                             |         if (a0 == 0) {
    0x000515b4 bnez a0, 0x515e0              |             
    0x000515b8 lw a0, 0x1c(fp)               |             a0 = *(arg_7ch);
    0x000515bc lw a2, 0x58(v0)               |             a2 = *((v0 + 22));
    0x000515c0 sltu a2, a0, a2               |             a2 = (a0 < a2) ? 1 : 0;
                                             |             if (a2 != 0) {
    0x000515c4 bnez a2, 0x515e0              |                 goto label_22;
                                             |             }
    0x000515c8 nop                           |             
    0x000515cc lw a3, 0x20(fp)               |             a3 = *(arg_80h);
    0x000515d0 lw a2, 0x5c(v0)               |             a2 = *((v0 + 23));
    0x000515d4 sltu a2, a3, a2               |             a2 = (a3 < a2) ? 1 : 0;
                                             |             if (a2 == 0) {
    0x000515d8 beql a2, zero, 0x51628        |                 goto label_23;
                                             |             }
    0x000515dc addu v1, a1, a0               |             v1 = a1 + a0;
                                             |         }
                                             | label_22:
    0x000515e0 lw v1, 0x80(sp)               |         v1 = *(arg_80h);
                                             |         if (v1 == 0) {
    0x000515e4 bnez v1, 0x51614              |             
    0x000515e8 lw a0, 0x1c(fp)               |             a0 = *(arg_7ch);
    0x000515ec lw v1, 0x58(v0)               |             v1 = *((v0 + 22));
    0x000515f0 sltu v1, v1, a0               |             v1 = (v1 < a0) ? 1 : 0;
    0x000515f4 lw v1, 0x80(sp)               |             v1 = *(arg_80h);
                                             |             if (v1 != 0) {
    0x000515f8 bnez v1, 0x51614              |                 goto label_24;
                                             |             }
    0x000515fc lw a3, 0x20(fp)               |             a3 = *(arg_80h);
    0x00051600 lw v1, 0x5c(v0)               |             v1 = *((v0 + 23));
    0x00051604 sltu v1, v1, a3               |             v1 = (v1 < a3) ? 1 : 0;
    0x00051608 addu v1, a1, a0               |             v1 = a1 + a0;
                                             |             if (v1 == 0) {
    0x0005160c beqz v1, 0x51628              |                 goto label_23;
                                             |             }
    0x00051610 lw v1, 0x80(sp)               |             v1 = *(arg_80h);
                                             |         }
                                             | label_24:
    0x00051614 lw t9, -0x7b74(gp)            |         t9 = sym.imp.free;
                                             |         if (v1 == 0) {
    0x00051618 beqz v1, 0x51820              |             goto label_20;
                                             |         }
    0x0005161c lw a0, 0x1c(fp)               |         a0 = *(arg_7ch);
    0x00051620 lw a3, 0x20(fp)               |         a3 = *(arg_80h);
    0x00051624 addu v1, a1, a0               |         v1 = a1 + a0;
                                             | label_23:
    0x00051628 sll v1, v1, 1                 |         v1 <<= 1;
    0x0005162c lw a2, 0x14(fp)               |         a2 = *(arg_74h);
    0x00051630 addu v1, v1, a3               |         v1 += a3;
    0x00051634 sll v1, v1, 2                 |         v1 <<= 2;
    0x00051638 sltu v1, a2, v1               |         v1 = (a2 < v1) ? 1 : 0;
    0x0005163c lw t9, -0x7b74(gp)            |         t9 = sym.imp.free;
                                             |         if (v1 != 0) {
    0x00051640 bnez v1, 0x51820              |             goto label_20;
                                             |         }
    0x00051644 lw v1, 0x90(v0)               |         v1 = *((v0 + 36));
    0x00051648 sw a1, 0x60(v0)               |         *((v0 + 24)) = a1;
    0x0005164c slt v1, v1, a2                |         v1 = (v1 < a2) ? 1 : 0;
    0x00051650 sw a0, 0x64(v0)               |         *((v0 + 25)) = a0;
    0x00051654 sw a3, 0x68(v0)               |         *((v0 + 26)) = a3;
                                             |         if (v1 != 0) {
    0x00051658 beqz v1, 0x51660              |             
    0x0005165c sw a2, 0x90(v0)               |             *((v0 + 36)) = a2;
                                             |         }
    0x00051660 sw t1, 0x70(v0)               |         *((v0 + 28)) = t1;
    0x00051664 lw a0, 0xc(fp)                |         a0 = *(arg_6ch);
    0x00051668 sw a2, 0x8c(v0)               |         *((v0 + 35)) = a2;
    0x0005166c sw a0, 0x74(v0)               |         *((v0 + 29)) = a0;
    0x00051670 lw v0, 0x7c(sp)               |         v0 = *(arg_7ch);
    0x00051674 sll v1, s5, 2                 |         v1 = s5 << 2;
    0x00051678 lw a0, (fp)                   |         a0 = *(fp);
    0x0005167c addu v0, v0, v1               |         v0 += v1;
    0x00051680 addiu s5, s5, 1               |         s5++;
    0x00051684 sw a0, (v0)                   |         *(v0) = a0;
                                             |     }
                                             | label_21:
    0x00051688 lw v0, 0x14(s2)               |     v0 = *((s2 + 5));
    0x0005168c addiu s4, s4, 1               |     s4++;
    0x00051690 sltu v0, s4, v0               |     v0 = (s4 < v0) ? 1 : 0;
    0x00051694 addiu fp, fp, 0x24            |     fp += 0x24;
                                             |     if (v0 != 0) {
    0x00051698 bnez v0, 0x51470              |         goto label_0;
                                             |     }
    0x0005169c slti v0, s5, 0x27             |     v0 = (s5 < 0x27) ? 1 : 0;
    0x000516a0 lw t9, -0x7b74(gp)            |     t9 = sym.imp.free;
                                             |     if (v0 == 0) {
    0x000516a4 beqz v0, 0x516cc              |         goto label_25;
                                             |     }
                                             | label_18:
    0x000516a8 lw v1, 0x7c(sp)               |     v1 = *(arg_7ch);
    0x000516ac sll v0, s5, 2                 |     v0 = s5 << 2;
    0x000516b0 addu v0, v1, v0               |     v0 = v1 + v0;
    0x000516b4 addiu v1, zero, 0x27          |     v1 = 0x27;
                                             |     do {
    0x000516b8 addiu s5, s5, 1               |         s5++;
    0x000516bc sw zero, (v0)                 |         *(v0) = 0;
    0x000516c0 addiu v0, v0, 4               |         v0 += 4;
    0x000516c4 bne s5, v1, 0x516b8           |         
                                             |     } while (s5 != v1);
    0x000516c8 lw t9, -0x7b74(gp)            |     t9 = sym.imp.free;
                                             | label_25:
    0x000516cc move a0, s3                   |     a0 = s3;
    0x000516d0 jalr t9                       |     t9 ();
    0x000516d4 lw gp, 0x18(sp)               |     gp = *(var_18h);
    0x000516d8 addiu t2, s0, 0x9c            |     t2 = s0 + 0x9c;
    0x000516dc move a3, s0                   |     a3 = s0;
    0x000516e0 addiu t3, zero, -3            |     t3 = -3;
    0x000516e4 lw t4, 0x78(sp)               |     t4 = *(arg_78h);
    0x000516e8 b 0x516f8                     |     goto label_4;
                                             | label_1:
    0x000516ec addiu a3, a3, 4               |     a3 += 4;
                                             |     do {
                                             | label_2:
    0x000516f0 move v1, zero                 |         v1 = 0;
                                             |         if (t2 == a3) {
    0x000516f4 beq t2, a3, 0x5175c           |             goto label_26;
                                             |         }
                                             | label_4:
    0x000516f8 lw t0, (a3)                   |         t0 = *(a3);
    0x000516fc lw t1, 4(t0)                  |         t1 = *((t0 + 1));
    0x00051700 andi v0, t1, 2                |         v0 = t1 & 2;
    0x00051704 beql v0, zero, 0x516f0        |         
                                             |     } while (v0 == 0);
    0x00051708 addiu a3, a3, 4               |     a3 += 4;
    0x0005170c lw a1, 0x14(s2)               |     a1 = *((s2 + 5));
    0x00051710 lw v0, (t4)                   |     v0 = *(t4);
                                             |     if (a1 == 0) {
    0x00051714 beqz a1, 0x51748              |         goto label_27;
                                             |     }
    0x00051718 lw a2, (t0)                   |     a2 = *(t0);
    0x0005171c lw v1, (v0)                   |     v1 = *(v0);
    0x00051720 move v1, zero                 |     v1 = 0;
                                             |     if (v1 == a2) {
    0x00051724 beq v1, a2, 0x516ec           |         goto label_1;
                                             |     }
    0x00051728 addiu v1, v1, 1               |     v1++;
    0x0005172c b 0x51740                     |     goto label_28;
                                             | label_3:
    0x00051730 lw a0, (v0)                   |     a0 = *(v0);
                                             |     if (a0 == a2) {
    0x00051734 beql a0, a2, 0x516f0          |         goto label_2;
                                             |     }
    0x00051738 addiu a3, a3, 4               |     a3 += 4;
    0x0005173c addiu v1, v1, 1               |     v1++;
                                             | label_28:
    0x00051740 addiu v0, v0, 0x24            |     v0 += 0x24;
                                             |     if (v1 != a1) {
    0x00051744 bne v1, a1, 0x51730           |         goto label_3;
                                             |     }
                                             | label_27:
    0x00051748 and t1, t1, t3                |     t1 &= t3;
    0x0005174c addiu a3, a3, 4               |     a3 += 4;
    0x00051750 sw t1, 4(t0)                  |     *((t0 + 1)) = t1;
                                             |     if (t2 != a3) {
    0x00051754 bne t2, a3, 0x516f8           |         goto label_4;
                                             |     }
    0x00051758 move v1, zero                 |     v1 = 0;
                                             | label_26:
    0x0005175c lw v0, (s0)                   |     v0 = *(s0);
                                             |     do {
    0x00051760 lw v0, 4(v0)                  |         v0 = *((v0 + 1));
    0x00051764 andi v0, v0, 2                |         v0 &= 2;
    0x00051768 addiu v1, v1, 1               |         v1++;
                                             |         if (v0 != 0) {
    0x0005176c bnel v0, zero, 0x51770        |             
                                             |         }
    0x00051770 addiu s0, s0, 4               |         s0 += 4;
    0x00051774 lw v0, (s0)                   |         v0 = *(s0);
    0x00051778 bnel t2, s0, 0x51760          |         
                                             |     } while (t2 == s0);
    0x0005177c lw v0, 0x6c(sp)               |     v0 = *(arg_6ch);
    0x00051780 andi v0, v0, 0x100            |     v0 &= aav.0x00000100;
    0x00051784 or v1, v0, v1                 |     v1 = v0 | v1;
    0x00051788 lw v0, -0x7b6c(gp)            |     v0 = *((gp - 7899));
                                             |     if (v1 != 0) {
    0x0005178c beqz v1, 0x518c0              |         
                                             | label_9:
    0x00051790 lw ra, 0x5c(sp)               |         ra = *(var_5ch);
    0x00051794 lw fp, 0x58(sp)               |         fp = *(var_58h);
    0x00051798 lw s7, 0x54(sp)               |         s7 = *(var_54h);
    0x0005179c lw s6, 0x50(sp)               |         s6 = *(var_50h);
    0x000517a0 lw s5, 0x4c(sp)               |         s5 = *(var_4ch);
    0x000517a4 lw s4, 0x48(sp)               |         s4 = *(var_48h);
    0x000517a8 lw s3, 0x44(sp)               |         s3 = *(var_44h);
    0x000517ac lw s2, 0x40(sp)               |         s2 = *(var_40h);
    0x000517b0 lw s1, 0x3c(sp)               |         s1 = *(var_3ch);
    0x000517b4 lw s0, 0x38(sp)               |         s0 = *(var_38h);
    0x000517b8 addiu sp, sp, 0x60            |         
    0x000517bc jr ra                         |         return v0;
                                             | label_19:
    0x000517c0 lw a0, -0x7e88(gp)            |         a0 = *(gp);
    0x000517c4 lw t9, 0x34(sp)               |         t9 = *(var_34h);
    0x000517c8 lw a2, (v0)                   |         a2 = *(v0);
    0x000517cc move a1, fp                   |         a1 = fp;
    0x000517d0 jalr t9                       |         t9 ();
    0x000517d4 lw gp, 0x18(sp)               |         gp = *(var_18h);
    0x000517d8 b 0x51518                     |         goto label_5;
                                             | label_16:
    0x000517dc lw t9, -0x7bbc(gp)            |         t9 = sym.imp.realloc;
    0x000517e0 move a0, fp                   |         a0 = fp;
    0x000517e4 jalr t9                       |         t9 ();
    0x000517e8 lw v1, 0x78(sp)               |         v1 = *(arg_78h);
    0x000517ec lw gp, 0x18(sp)               |         gp = *(var_18h);
    0x000517f0 sw v0, (v1)                   |         *(v1) = v0;
                                             |         if (v0 != 0) {
    0x000517f4 beqz v0, 0x51870              |             
    0x000517f8 lw v1, 0x14(s2)               |             v1 = *((s2 + 5));
                                             |             if (fp != 0) {
    0x000517fc beqz fp, 0x51844              |                 
    0x00051800 move fp, v0                   |                 fp = v0;
    0x00051804 b 0x51438                     |                 goto label_6;
                                             | label_13:
    0x00051808 lw t9, -0x7e90(gp)            |                 t9 = sym.swap_struct;
    0x0005180c move a1, s2                   |                 a1 = s2;
    0x00051810 bal 0x501c8                   |                 sym_swap_struct ();
    0x00051814 lw gp, 0x18(sp)               |                 gp = *(var_18h);
    0x00051818 b 0x51378                     |                 goto label_7;
                                             | label_12:
    0x0005181c lw t9, -0x7b74(gp)            |                 t9 = sym.imp.free;
                                             | label_20:
    0x00051820 move a0, s3                   |                 a0 = s3;
    0x00051824 jalr t9                       |                 t9 ();
    0x00051828 lw gp, 0x18(sp)               |                 gp = *(var_18h);
                                             | label_10:
    0x0005182c lw a0, (s7)                   |                 a0 = *(s7);
                                             | label_14:
    0x00051830 lw a2, 0x64(sp)               |                 a2 = *(arg_64h);
    0x00051834 lw a1, 0x70(sp)               |                 a1 = *(arg_70h);
    0x00051838 lw t9, -0x7d20(gp)            |                 t9 = sym.handle_invalid_sa_file;
    0x0005183c move a3, zero                 |                 a3 = 0;
    0x00051840 bal 0x4e780                   |                 sym_handle_invalid_sa_file ();
                                             |             }
    0x00051844 sll a0, v1, 3                 |             a0 = v1 << 3;
    0x00051848 addu v1, a0, v1               |             v1 = a0 + v1;
    0x0005184c lw t9, -0x7bf4(gp)            |             t9 = sym.imp.memset;
    0x00051850 sll a2, v1, 2                 |             a2 = v1 << 2;
    0x00051854 move a1, zero                 |             a1 = 0;
    0x00051858 move a0, v0                   |             a0 = v0;
    0x0005185c jalr t9                       |             t9 ();
    0x00051860 lw v0, 0x78(sp)               |             v0 = *(arg_78h);
    0x00051864 lw gp, 0x18(sp)               |             gp = *(var_18h);
    0x00051868 lw fp, (v0)                   |             fp = *(v0);
    0x0005186c b 0x5142c                     |             goto label_8;
                                             |         }
                                             | label_11:
    0x00051870 lw a0, -0x7fdc(gp)            |         a0 = *(gp);
    0x00051874 lw t9, -0x7bac(gp)            |         t9 = sym.imp.perror;
                                             |         /* str.realloc */
    0x00051878 addiu a0, a0, -0x2160         |         a0 += -0x2160;
    0x0005187c jalr t9                       |         t9 ();
    0x00051880 lw gp, 0x18(sp)               |         gp = *(var_18h);
    0x00051884 lw t9, -0x7bd0(gp)            |         t9 = sym.imp.exit;
    0x00051888 addiu a0, zero, 4             |         a0 = 4;
    0x0005188c jalr t9                       |         t9 ();
                                             | label_15:
    0x00051890 lw v0, -0x7b6c(gp)            |         v0 = *((gp - 7899));
                                             | label_17:
    0x00051894 lw a0, -0x7fdc(gp)            |         a0 = *(gp);
    0x00051898 lw t9, -0x7bb0(gp)            |         t9 = sym.imp.fwrite;
    0x0005189c lw a3, (v0)                   |         a3 = *(v0);
                                             |         /* str.srealloc_n */
    0x000518a0 addiu a0, a0, -0x216c         |         a0 += -0x216c;
    0x000518a4 addiu a2, zero, 9             |         a2 = 9;
    0x000518a8 addiu a1, zero, 1             |         a1 = 1;
    0x000518ac jalr t9                       |         t9 ();
    0x000518b0 lw gp, 0x18(sp)               |         gp = *(var_18h);
    0x000518b4 lw t9, -0x7bd0(gp)            |         t9 = sym.imp.exit;
    0x000518b8 addiu a0, zero, 4             |         a0 = 4;
    0x000518bc jalr t9                       |         t9 ();
                                             |     }
    0x000518c0 lw a2, -0x7fdc(gp)            |     a2 = *(gp);
    0x000518c4 lw t9, -0x7c44(gp)            |     t9 = sym.imp.__fprintf_chk
    0x000518c8 lw a0, (v0)                   |     a0 = *(v0);
    0x000518cc lw a3, 0x64(sp)               |     a3 = *(arg_64h);
                                             |     /* str.Requested_activities_not_available_in_file__s_n */
    0x000518d0 addiu a2, a2, 0x3e80          |     a2 += 0x3e80;
    0x000518d4 addiu a1, zero, 1             |     a1 = 1;
    0x000518d8 jalr t9                       |     t9 ();
    0x000518dc lw gp, 0x18(sp)               |     gp = *(var_18h);
    0x000518e0 lw t9, -0x7c58(gp)            |     t9 = sym.imp.close;
    0x000518e4 lw a0, (s7)                   |     a0 = *(s7);
    0x000518e8 jalr t9                       |     t9 ();
    0x000518ec lw gp, 0x18(sp)               |     gp = *(var_18h);
    0x000518f0 lw t9, -0x7bd0(gp)            |     t9 = sym.imp.exit;
    0x000518f4 addiu a0, zero, 1             |     a0 = 1;
    0x000518f8 jalr t9                       |     return t9 ();
                                             | }
    ; assembly                               | /* r2dec pseudo code output */
                                             | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0xe7e4 */
                                             | #include <stdint.h>
                                             |  
    ; (fcn) sym.convert_file ()              | void convert_file () {
    0x0000e7e4 lui gp, 7                     |     
    0x0000e7e8 addiu gp, gp, 0x7dc           |     
    0x0000e7ec addu gp, gp, t9               |     gp += t9;
    0x0000e7f0 addiu sp, sp, -0x218          |     
    0x0000e7f4 lw t9, -0x7b68(gp)            |     t9 = sym.imp.dup;
    0x0000e7f8 sw s4, 0x200(sp)              |     *(var_200h) = s4;
    0x0000e7fc lw s4, -0x7b7c(gp)            |     s4 = *((gp - 7903));
    0x0000e800 sw gp, 0x30(sp)               |     *(var_30h_2) = gp;
    0x0000e804 sw s6, 0x208(sp)              |     *(var_208h) = s6;
    0x0000e808 lw v0, (s4)                   |     v0 = *(s4);
    0x0000e80c sw s1, 0x1f4(sp)              |     *(var_1f4h) = s1;
    0x0000e810 sw v0, 0x1ec(sp)              |     *(var_1ech) = v0;
    0x0000e814 addiu v0, zero, 1             |     v0 = 1;
    0x0000e818 sw ra, 0x214(sp)              |     *(var_214h) = ra;
    0x0000e81c sw fp, 0x210(sp)              |     *(var_210h) = fp;
    0x0000e820 sw s7, 0x20c(sp)              |     *(var_20ch) = s7;
    0x0000e824 sw s5, 0x204(sp)              |     *(var_204h) = s5;
    0x0000e828 sw s3, 0x1fc(sp)              |     *(var_1fch) = s3;
    0x0000e82c sw s2, 0x1f8(sp)              |     *(var_1f8h) = s2;
    0x0000e830 sw s0, 0x1f0(sp)              |     *(var_1f0h) = s0;
    0x0000e834 move s6, a0                   |     s6 = a0;
    0x0000e838 sw zero, 0x38(sp)             |     *(var_38h_2) = 0;
    0x0000e83c addiu a0, zero, 1             |     a0 = 1;
    0x0000e840 sw zero, 0x3c(sp)             |     *(var_3ch_2) = 0;
    0x0000e844 sw v0, 0x40(sp)               |     *(var_40h_2) = v0;
    0x0000e848 sw zero, 0x44(sp)             |     *(var_44h_2) = 0;
    0x0000e84c sw zero, 0x4c(sp)             |     *(var_4ch_2) = 0;
    0x0000e850 sw zero, 0x50(sp)             |     *(var_50h) = 0;
    0x0000e854 move s1, a1                   |     s1 = a1;
    0x0000e858 jalr t9                       |     t9 ();
    0x0000e85c lw gp, 0x30(sp)               |     gp = *(var_30h_2);
                                             |     if (v0 < 0) {
    0x0000e860 bltz v0, 0xeb24               |         goto label_4;
                                             |     }
    0x0000e864 lw s2, -0x7fc0(gp)            |     s2 = *(gp);
    0x0000e868 move s0, v0                   |     s0 = v0;
    0x0000e86c addiu v0, sp, 0x3c            |     v0 = sp + 0x3c;
    0x0000e870 sw v0, 0x14(sp)               |     *(var_14h_3) = v0;
    0x0000e874 lw t9, -0x7e18(gp)            |     t9 = sym.upgrade_magic_section;
    0x0000e878 addiu v0, sp, 0x48            |     v0 = sp + 0x48;
    0x0000e87c addiu s7, sp, 0x54            |     s7 = sp + 0x54;
    0x0000e880 sw s2, 0x18(sp)               |     *(var_18h_6) = s2;
    0x0000e884 sw v0, 0x10(sp)               |     *(var_10h_7) = v0;
    0x0000e888 move a3, s7                   |     a3 = s7;
    0x0000e88c move a2, s0                   |     a2 = s0;
    0x0000e890 addiu a1, sp, 0x38            |     a1 = sp + 0x38;
    0x0000e894 move a0, s6                   |     a0 = s6;
    0x0000e898 bal 0xa9f0                    |     sym_upgrade_magic_section ();
    0x0000e89c lw gp, 0x30(sp)               |     gp = *(var_30h_2);
                                             |     if (v0 < 0) {
    0x0000e8a0 bltz v0, 0xea80               |         goto label_5;
                                             |     }
    0x0000e8a4 lw v1, 0x3c(sp)               |     v1 = *(var_3ch_2);
    0x0000e8a8 addiu v0, zero, 0x2175        |     v0 = 0x2175;
    0x0000e8ac lw s5, -0x7e14(gp)            |     s5 = sym.upgrade_exit;
                                             |     if (v1 == v0) {
    0x0000e8b0 beq v1, v0, 0xeaa8            |         goto label_6;
                                             |     }
                                             |     do {
    0x0000e8b4 lw t9, -0x7e10(gp)            |         t9 = sym.get_HZ;
    0x0000e8b8 lw fp, -0x7b6c(gp)            |         fp = *((gp - 7899));
    0x0000e8bc addiu s3, sp, 0xa0            |         s3 = sp + 0xa0;
    0x0000e8c0 jalr t9                       |         t9 ();
    0x0000e8c4 lw gp, 0x30(sp)               |         gp = *(var_30h_2);
    0x0000e8c8 lw a0, (fp)                   |         a0 = *(fp);
    0x0000e8cc addiu a1, zero, 1             |         a1 = 1;
    0x0000e8d0 lw v0, -0x7e8c(gp)            |         v0 = *(gp);
    0x0000e8d4 lw a2, -0x7fdc(gp)            |         a2 = *(gp);
    0x0000e8d8 lw t9, -0x7c44(gp)            |         t9 = sym.imp.__fprintf_chk
    0x0000e8dc lw a3, (v0)                   |         a3 = *(v0);
                                             |         /* str.HZ:_Using_current_value:__lu_n */
    0x0000e8e0 addiu a2, a2, -0x20bc         |         a2 += -0x20bc;
    0x0000e8e4 jalr t9                       |         t9 ();
    0x0000e8e8 lw v0, (s2)                   |         v0 = *(s2);
    0x0000e8ec lw gp, 0x30(sp)               |         gp = *(var_30h_2);
    0x0000e8f0 sw v0, 0x24(sp)               |         *(var_24h_6) = v0;
    0x0000e8f4 addiu v0, sp, 0x40            |         v0 = sp + 0x40;
    0x0000e8f8 sw v0, 0x20(sp)               |         *(var_20h_4) = v0;
    0x0000e8fc lw v0, 0x3c(sp)               |         v0 = *(var_3ch_2);
    0x0000e900 addiu v1, sp, 0x50            |         v1 = sp + 0x50;
    0x0000e904 sw v0, 0x1c(sp)               |         *(var_1ch_5) = v0;
    0x0000e908 lw v0, 0x48(sp)               |         v0 = *(var_48h_5);
    0x0000e90c sw v1, 0x2c(sp)               |         *(var_2ch_4) = v1;
    0x0000e910 lw t9, -0x7e0c(gp)            |         t9 = sym.upgrade_header_section;
    0x0000e914 addiu v1, sp, 0x44            |         v1 = sp + 0x44;
    0x0000e918 lw a1, 0x38(sp)               |         a1 = *(var_38h_2);
    0x0000e91c sw v1, 0x28(sp)               |         *(var_28h_4) = v1;
    0x0000e920 sw v0, 0x18(sp)               |         *(var_18h_6) = v0;
    0x0000e924 sw s3, 0x14(sp)               |         *(var_14h_3) = s3;
    0x0000e928 sw s7, 0x10(sp)               |         *(var_10h_7) = s7;
    0x0000e92c move a3, s1                   |         a3 = s1;
    0x0000e930 move a2, s0                   |         a2 = s0;
    0x0000e934 move a0, s6                   |         a0 = s6;
    0x0000e938 bal 0xb05c                    |         sym_upgrade_header_section ();
    0x0000e93c lw gp, 0x30(sp)               |         gp = *(var_30h_2);
                                             |         if (v0 < 0) {
    0x0000e940 bltz v0, 0xead0               |             goto label_7;
                                             |         }
                                             | label_1:
    0x0000e944 lw v0, (s2)                   |         v0 = *(s2);
    0x0000e948 lw v1, 0x40(sp)               |         v1 = *(var_40h_2);
    0x0000e94c sw v0, 0x14(sp)               |         *(var_14h_3) = v0;
    0x0000e950 lw t9, -0x7e08(gp)            |         t9 = sym.upgrade_activity_section;
    0x0000e954 addiu v0, sp, 0x4c            |         v0 = sp + 0x4c;
    0x0000e958 lw a3, 0x50(sp)               |         a3 = *(var_50h);
    0x0000e95c sw v1, 0x18(sp)               |         *(var_18h_6) = v1;
    0x0000e960 sw v0, 0x10(sp)               |         *(var_10h_7) = v0;
    0x0000e964 move a2, s3                   |         a2 = s3;
    0x0000e968 move a1, s1                   |         a1 = s1;
    0x0000e96c move a0, s0                   |         a0 = s0;
    0x0000e970 bal 0xd43c                    |         sym_upgrade_activity_section ();
    0x0000e974 lw gp, 0x30(sp)               |         gp = *(var_30h_2);
                                             |         if (v0 < 0) {
    0x0000e978 bltz v0, 0xeb08               |             goto label_8;
                                             |         }
                                             | label_3:
    0x0000e97c lw t9, -0x7f38(gp)            |         t9 = sym.allocate_structures;
    0x0000e980 move a0, s1                   |         a0 = s1;
    0x0000e984 jalr t9                       |         t9 ();
    0x0000e988 lw v0, (s2)                   |         v0 = *(s2);
    0x0000e98c lw gp, 0x30(sp)               |         gp = *(var_30h_2);
    0x0000e990 sw v0, 0x1c(sp)               |         *(var_1ch_5) = v0;
    0x0000e994 lw v0, 0x3c(sp)               |         v0 = *(var_3ch_2);
    0x0000e998 lw v1, 0x44(sp)               |         v1 = *(var_44h_2);
    0x0000e99c sw v0, 0x18(sp)               |         *(var_18h_6) = v0;
    0x0000e9a0 lw v0, 0x4c(sp)               |         v0 = *(var_4ch_2);
    0x0000e9a4 sw v1, 0x24(sp)               |         *(var_24h_6) = v1;
    0x0000e9a8 sw v0, 0x14(sp)               |         *(var_14h_3) = v0;
    0x0000e9ac lw v1, 0x40(sp)               |         v1 = *(var_40h_2);
    0x0000e9b0 lw v0, 0x50(sp)               |         v0 = *(var_50h);
    0x0000e9b4 lw t9, -0x7e04(gp)            |         t9 = sym.upgrade_stat_records;
    0x0000e9b8 lw a0, 0x38(sp)               |         a0 = *(var_38h_2);
    0x0000e9bc sw v1, 0x20(sp)               |         *(var_20h_4) = v1;
    0x0000e9c0 sw v0, 0x10(sp)               |         *(var_10h_7) = v0;
    0x0000e9c4 move a3, s3                   |         a3 = s3;
    0x0000e9c8 move a2, s1                   |         a2 = s1;
    0x0000e9cc move a1, s0                   |         a1 = s0;
    0x0000e9d0 bal 0xe4fc                    |         sym_upgrade_stat_records ();
    0x0000e9d4 lw gp, 0x30(sp)               |         gp = *(var_30h_2);
                                             |         if (v0 < 0) {
    0x0000e9d8 bltz v0, 0xeaec               |             goto label_9;
                                             |         }
                                             | label_2:
    0x0000e9dc lw t9, -0x7b74(gp)            |         t9 = sym.imp.free;
    0x0000e9e0 lw a0, 0x4c(sp)               |         a0 = *(var_4ch_2);
    0x0000e9e4 jalr t9                       |         t9 ();
    0x0000e9e8 lw gp, 0x30(sp)               |         gp = *(var_30h_2);
    0x0000e9ec lw t9, -0x7b74(gp)            |         t9 = sym.imp.free;
    0x0000e9f0 lw a0, 0x50(sp)               |         a0 = *(var_50h);
    0x0000e9f4 jalr t9                       |         t9 ();
    0x0000e9f8 lw gp, 0x30(sp)               |         gp = *(var_30h_2);
    0x0000e9fc lw t9, -0x7f34(gp)            |         t9 = sym.free_structures;
    0x0000ea00 move a0, s1                   |         a0 = s1;
    0x0000ea04 jalr t9                       |         t9 ();
    0x0000ea08 lw gp, 0x30(sp)               |         gp = *(var_30h_2);
    0x0000ea0c lw a0, (fp)                   |         a0 = *(fp);
    0x0000ea10 addiu a1, zero, 1             |         a1 = 1;
    0x0000ea14 lw a3, -0x7fdc(gp)            |         a3 = *(gp);
    0x0000ea18 lw a2, -0x7fdc(gp)            |         a2 = *(gp);
    0x0000ea1c lw t9, -0x7c44(gp)            |         t9 = sym.imp.__fprintf_chk
                                             |         /* str.12.1.6 */
    0x0000ea20 addiu a3, a3, -0x209c         |         a3 += -0x209c;
                                             |         /* str.File_successfully_converted_to_sysstat_format_version__s_n */
    0x0000ea24 addiu a2, a2, -0x2094         |         a2 += -0x2094;
    0x0000ea28 jalr t9                       |         t9 ();
    0x0000ea2c lw a0, 0x38(sp)               |         a0 = *(var_38h_2);
                                             | label_0:
    0x0000ea30 move a2, zero                 |         a2 = 0;
    0x0000ea34 move t9, s5                   |         t9 = s5;
    0x0000ea38 move a1, s0                   |         a1 = s0;
    0x0000ea3c bal 0xe76c                    |         sym_upgrade_exit ();
    0x0000ea40 lw v1, 0x1ec(sp)              |         v1 = *(var_1ech);
    0x0000ea44 lw v0, (s4)                   |         v0 = *(s4);
    0x0000ea48 lw gp, 0x30(sp)               |         gp = *(var_30h_2);
                                             |         if (v1 != v0) {
    0x0000ea4c bne v1, v0, 0xeb44            |             goto label_10;
                                             |         }
    0x0000ea50 lw ra, 0x214(sp)              |         ra = *(var_214h);
    0x0000ea54 lw fp, 0x210(sp)              |         fp = *(var_210h);
    0x0000ea58 lw s7, 0x20c(sp)              |         s7 = *(var_20ch);
    0x0000ea5c lw s6, 0x208(sp)              |         s6 = *(var_208h);
    0x0000ea60 lw s5, 0x204(sp)              |         s5 = *(var_204h);
    0x0000ea64 lw s4, 0x200(sp)              |         s4 = *(var_200h);
    0x0000ea68 lw s3, 0x1fc(sp)              |         s3 = *(var_1fch);
    0x0000ea6c lw s2, 0x1f8(sp)              |         s2 = *(var_1f8h);
    0x0000ea70 lw s1, 0x1f4(sp)              |         s1 = *(var_1f4h);
    0x0000ea74 lw s0, 0x1f0(sp)              |         s0 = *(var_1f0h);
    0x0000ea78 addiu sp, sp, 0x218           |         
    0x0000ea7c jr ra                         |         return v0;
                                             | label_5:
    0x0000ea80 lw s5, -0x7e14(gp)            |         s5 = sym.upgrade_exit;
    0x0000ea84 lw a0, 0x38(sp)               |         a0 = *(var_38h_2);
    0x0000ea88 addiu a2, zero, 2             |         a2 = 2;
    0x0000ea8c move t9, s5                   |         t9 = s5;
    0x0000ea90 move a1, s0                   |         a1 = s0;
    0x0000ea94 bal 0xe76c                    |         sym_upgrade_exit ();
    0x0000ea98 lw v1, 0x3c(sp)               |         v1 = *(var_3ch_2);
    0x0000ea9c addiu v0, zero, 0x2175        |         v0 = 0x2175;
    0x0000eaa0 lw gp, 0x30(sp)               |         gp = *(var_30h_2);
    0x0000eaa4 bne v1, v0, 0xe8b4            |         
                                             |     } while (v1 != v0);
                                             | label_6:
    0x0000eaa8 lw v0, -0x7b6c(gp)            |     v0 = *((gp - 7899));
    0x0000eaac lw a0, -0x7fdc(gp)            |     a0 = *(gp);
    0x0000eab0 lw t9, -0x7bb0(gp)            |     t9 = sym.imp.fwrite;
    0x0000eab4 lw a3, (v0)                   |     a3 = *(v0);
    0x0000eab8 addiu a2, zero, 0x20          |     a2 = 0x20;
    0x0000eabc addiu a1, zero, 1             |     a1 = 1;
                                             |     /* str._nFile_format_already_up_to_date_n */
    0x0000eac0 addiu a0, a0, -0x20e0         |     a0 += -0x20e0;
    0x0000eac4 jalr t9                       |     t9 ();
    0x0000eac8 lw a0, 0x38(sp)               |     a0 = *(var_38h_2);
    0x0000eacc b 0xea30                      |     goto label_0;
                                             | label_7:
    0x0000ead0 lw a0, 0x38(sp)               |     a0 = *(var_38h_2);
    0x0000ead4 addiu a2, zero, 2             |     a2 = 2;
    0x0000ead8 move t9, s5                   |     t9 = s5;
    0x0000eadc move a1, s0                   |     a1 = s0;
    0x0000eae0 bal 0xe76c                    |     sym_upgrade_exit ();
    0x0000eae4 lw gp, 0x30(sp)               |     gp = *(var_30h_2);
    0x0000eae8 b 0xe944                      |     goto label_1;
                                             | label_9:
    0x0000eaec lw a0, 0x38(sp)               |     a0 = *(var_38h_2);
    0x0000eaf0 addiu a2, zero, 2             |     a2 = 2;
    0x0000eaf4 move t9, s5                   |     t9 = s5;
    0x0000eaf8 move a1, s0                   |     a1 = s0;
    0x0000eafc bal 0xe76c                    |     sym_upgrade_exit ();
    0x0000eb00 lw gp, 0x30(sp)               |     gp = *(var_30h_2);
    0x0000eb04 b 0xe9dc                      |     goto label_2;
                                             | label_8:
    0x0000eb08 lw a0, 0x38(sp)               |     a0 = *(var_38h_2);
    0x0000eb0c addiu a2, zero, 2             |     a2 = 2;
    0x0000eb10 move t9, s5                   |     t9 = s5;
    0x0000eb14 move a1, s0                   |     a1 = s0;
    0x0000eb18 bal 0xe76c                    |     sym_upgrade_exit ();
    0x0000eb1c lw gp, 0x30(sp)               |     gp = *(var_30h_2);
    0x0000eb20 b 0xe97c                      |     goto label_3;
                                             | label_4:
    0x0000eb24 lw a0, -0x7fdc(gp)            |     a0 = *(gp);
    0x0000eb28 lw t9, -0x7bac(gp)            |     t9 = sym.imp.perror;
                                             |     /* esilref: 'dup' */
    0x0000eb2c addiu a0, a0, -0x20e4         |     a0 += -0x20e4;
    0x0000eb30 jalr t9                       |     t9 ();
    0x0000eb34 lw gp, 0x30(sp)               |     gp = *(var_30h_2);
    0x0000eb38 lw t9, -0x7bd0(gp)            |     t9 = sym.imp.exit;
    0x0000eb3c addiu a0, zero, 2             |     a0 = 2;
    0x0000eb40 jalr t9                       |     t9 ();
                                             | label_10:
    0x0000eb44 lw t9, -0x7b90(gp)            |     t9 = sym.imp.__stack_chk_fail;
    0x0000eb48 jalr t9                       |     t9 ();
    0x0000eb4c nop                           |     
                                             | }
    ; assembly                                   | /* r2dec pseudo code output */
                                                 | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0x4e6c8 */
                                                 | #include <stdint.h>
                                                 |  
    ; (fcn) sym.display_sa_file_version ()       | void display_sa_file_version () {
    0x0004e6c8 lui gp, 3                         |     
    0x0004e6cc addiu gp, gp, 0x8f8               |     
    0x0004e6d0 addu gp, gp, t9                   |     gp += t9;
    0x0004e6d4 addiu sp, sp, -0x30               |     
    0x0004e6d8 lw a2, -0x7fdc(gp)                |     a2 = *(gp);
    0x0004e6dc sw gp, 0x18(sp)                   |     *(var_18h_3) = gp;
    0x0004e6e0 sw s1, 0x28(sp)                   |     *(var_28h_3) = s1;
    0x0004e6e4 sw s0, 0x24(sp)                   |     *(var_24h) = s0;
    0x0004e6e8 sw ra, 0x2c(sp)                   |     *(var_2ch) = ra;
    0x0004e6ec lbu v1, 6(a1)                     |     v1 = *((a1 + 6));
    0x0004e6f0 lbu v0, 5(a1)                     |     v0 = *((a1 + 5));
    0x0004e6f4 lbu a3, 4(a1)                     |     a3 = *((a1 + 4));
    0x0004e6f8 lw t9, -0x7c44(gp)                |     t9 = sym.imp.__fprintf_chk
    0x0004e6fc move s0, a1                       |     s0 = a1;
    0x0004e700 sw v1, 0x14(sp)                   |     *(var_14h_3) = v1;
    0x0004e704 sw v0, 0x10(sp)                   |     *(var_10h_4) = v0;
                                                 |     /* str.File_created_by_sar_sadc_from_sysstat_version__d._d._d */
    0x0004e708 addiu a2, a2, 0x3ce8              |     a2 += 0x3ce8;
    0x0004e70c addiu a1, zero, 1                 |     a1 = 1;
    0x0004e710 move s1, a0                       |     s1 = a0;
    0x0004e714 jalr t9                           |     t9 ();
    0x0004e718 lbu a3, 7(s0)                     |     a3 = *((s0 + 7));
    0x0004e71c lw gp, 0x18(sp)                   |     gp = *(var_18h_3);
                                                 |     if (a3 == 0) {
    0x0004e720 bnez a3, 0x4e744                  |         
    0x0004e724 lw ra, 0x2c(sp)                   |         ra = *(var_2ch);
    0x0004e728 lw s0, 0x24(sp)                   |         s0 = *(var_24h);
    0x0004e72c move a1, s1                       |         a1 = s1;
    0x0004e730 lw t9, -0x7c34(gp)                |         t9 = sym.imp.fputc;
    0x0004e734 lw s1, 0x28(sp)                   |         s1 = *(var_28h_3);
    0x0004e738 addiu a0, zero, 0xa               |         a0 = 0xa;
    0x0004e73c addiu sp, sp, 0x30                |         
    0x0004e740 jr t9                             |         t9 ();
                                                 |     }
    0x0004e744 lw a2, -0x7fdc(gp)                |     a2 = *(gp);
    0x0004e748 lw t9, -0x7c44(gp)                |     t9 = sym.imp.__fprintf_chk
    0x0004e74c move a0, s1                       |     a0 = s1;
    0x0004e750 addiu a1, zero, 1                 |     a1 = 1;
                                                 |     /* esilref: '.&d' */
    0x0004e754 addiu a2, a2, 0x3d20              |     a2 += 0x3d20;
    0x0004e758 jalr t9                           |     t9 ();
    0x0004e75c lw gp, 0x18(sp)                   |     gp = *(var_18h_3);
    0x0004e760 lw ra, 0x2c(sp)                   |     ra = *(var_2ch);
    0x0004e764 lw s0, 0x24(sp)                   |     s0 = *(var_24h);
    0x0004e768 move a1, s1                       |     a1 = s1;
    0x0004e76c lw t9, -0x7c34(gp)                |     t9 = sym.imp.fputc;
    0x0004e770 lw s1, 0x28(sp)                   |     s1 = *(var_28h_3);
    0x0004e774 addiu a0, zero, 0xa               |     a0 = 0xa;
    0x0004e778 addiu sp, sp, 0x30                |     
    0x0004e77c jr t9                             |     return t9 ();
                                                 | }
    ; assembly                                   | /* r2dec pseudo code output */
                                                 | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0x4e780 */
                                                 | #include <stdint.h>
                                                 |  
    ; (fcn) sym.handle_invalid_sa_file ()        | void handle_invalid_sa_file () {
    0x0004e780 lui gp, 3                         |     
    0x0004e784 addiu gp, gp, 0x840               |     
    0x0004e788 addu gp, gp, t9                   |     gp += t9;
    0x0004e78c addiu sp, sp, -0x30               |     
    0x0004e790 lw t9, -0x7c44(gp)                |     t9 = sym.imp.__fprintf_chk
    0x0004e794 sw s0, 0x1c(sp)                   |     *(var_1ch) = s0;
    0x0004e798 lw s0, -0x7b6c(gp)                |     s0 = *((gp - 7899));
    0x0004e79c sw s2, 0x24(sp)                   |     *(var_24h) = s2;
    0x0004e7a0 move s2, a3                       |     s2 = a3;
    0x0004e7a4 move a3, a2                       |     a3 = a2;
    0x0004e7a8 lw a2, -0x7fdc(gp)                |     a2 = *(gp);
    0x0004e7ac sw s1, 0x20(sp)                   |     *(var_20h) = s1;
    0x0004e7b0 move s1, a0                       |     s1 = a0;
    0x0004e7b4 lw a0, (s0)                       |     a0 = *(s0);
    0x0004e7b8 sw gp, 0x10(sp)                   |     *(var_10h) = gp;
    0x0004e7bc sw s3, 0x28(sp)                   |     *(var_28h) = s3;
    0x0004e7c0 sw ra, 0x2c(sp)                   |     *(var_2ch) = ra;
    0x0004e7c4 move s3, a1                       |     s3 = a1;
                                                 |     /* str.Invalid_system_activity_file:__s_n */
    0x0004e7c8 addiu a2, a2, 0x3d24              |     a2 += 0x3d24;
    0x0004e7cc addiu a1, zero, 1                 |     a1 = 1;
    0x0004e7d0 jalr t9                           |     t9 ();
    0x0004e7d4 addiu v0, zero, 0x4c              |     v0 = 0x4c;
    0x0004e7d8 lw gp, 0x10(sp)                   |     gp = *(var_10h);
                                                 |     if (s2 == v0) {
    0x0004e7dc beq s2, v0, 0x4e7fc               |         goto label_1;
                                                 |     }
                                                 | label_0:
    0x0004e7e0 lw t9, -0x7c58(gp)                |     t9 = sym.imp.close;
                                                 |     do {
    0x0004e7e4 move a0, s1                       |         a0 = s1;
    0x0004e7e8 jalr t9                           |         t9 ();
    0x0004e7ec lw gp, 0x10(sp)                   |         gp = *(var_10h);
    0x0004e7f0 lw t9, -0x7bd0(gp)                |         t9 = sym.imp.exit;
    0x0004e7f4 addiu a0, zero, 3                 |         a0 = 3;
    0x0004e7f8 jalr t9                           |         t9 ();
                                                 | label_1:
    0x0004e7fc lhu v0, (s3)                      |         v0 = *(s3);
    0x0004e800 ori v1, zero, 0xd596              |         v1 = 0xd596;
    0x0004e804 ori v1, zero, 0x96d5              |         v1 = 0x96d5;
                                                 |         if (v0 == v1) {
    0x0004e808 beq v0, v1, 0x4e814               |             goto label_2;
                                                 |         }
    0x0004e80c lw t9, -0x7c58(gp)                |         t9 = sym.imp.close;
    0x0004e810 bne v0, v1, 0x4e7e4               |         
                                                 |     } while (v0 != v1);
                                                 | label_2:
    0x0004e814 lw a0, (s0)                       |     a0 = *(s0);
    0x0004e818 lw t9, -0x7eb0(gp)                |     t9 = sym.display_sa_file_version;
    0x0004e81c move a1, s3                       |     a1 = s3;
    0x0004e820 bal 0x4e6c8                       |     sym_display_sa_file_version ();
    0x0004e824 lhu v1, (s3)                      |     v1 = *(s3);
    0x0004e828 ori v0, zero, 0xd596              |     v0 = 0xd596;
    0x0004e82c lw gp, 0x10(sp)                   |     gp = *(var_10h);
    0x0004e830 lw a0, (s0)                       |     a0 = *(s0);
    0x0004e834 lhu a3, 2(s3)                     |     a3 = *((s3 + 1));
                                                 |     if (v1 != v0) {
    0x0004e838 beq v1, v0, 0x4e844               |         
    0x0004e83c wsbh a3, a3                       |         __asm ("wsbh a3, a3");
    0x0004e840 andi a3, a3, 0xffff               |         a3 &= 0xffff;
                                                 |     }
    0x0004e844 lw a2, -0x7fdc(gp)                |     a2 = *(gp);
    0x0004e848 lw t9, -0x7c44(gp)                |     t9 = sym.imp.__fprintf_chk
                                                 |     /* str.Current_sysstat_version_cannot_read_the_format_of_this_file___x__n */
    0x0004e84c addiu a2, a2, 0x3d48              |     a2 += 0x3d48;
    0x0004e850 addiu a1, zero, 1                 |     a1 = 1;
    0x0004e854 jalr t9                           |     t9 ();
    0x0004e858 lw gp, 0x10(sp)                   |     gp = *(var_10h);
    0x0004e85c b 0x4e7e0                         |     goto label_0;
                                                 | }
    ; assembly                               | /* r2dec pseudo code output */
                                             | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0x57dbc */
                                             | #include <stdint.h>
                                             |  
    ; (fcn) sym.ioc_init ()                  | void ioc_init () {
    0x00057dbc lui gp, 2                     |     
    0x00057dc0 addiu gp, gp, 0x7204          |     
    0x00057dc4 addu gp, gp, t9               |     gp += t9;
    0x00057dc8 lw v0, -0x7b7c(gp)            |     v0 = *((gp - 7903));
    0x00057dcc addiu sp, sp, -0x248          |     
    0x00057dd0 lw t9, -0x7b64(gp)            |     t9 = sym.imp.fopen;
    0x00057dd4 sw s1, 0x224(sp)              |     *(var_224h) = s1;
    0x00057dd8 sw s0, 0x220(sp)              |     *(var_220h) = s0;
    0x00057ddc lw s1, -0x7fdc(gp)            |     s1 = *(gp);
    0x00057de0 lw s0, -0x7fdc(gp)            |     s0 = *(gp);
    0x00057de4 sw v0, 0x50(sp)               |     *(var_50h) = v0;
    0x00057de8 lw v0, (v0)                   |     v0 = *(v0);
    0x00057dec sw gp, 0x30(sp)               |     *(var_30h) = gp;
    0x00057df0 sw ra, 0x244(sp)              |     *(var_244h) = ra;
    0x00057df4 sw fp, 0x240(sp)              |     *(var_240h) = fp;
    0x00057df8 sw s7, 0x23c(sp)              |     *(var_23ch) = s7;
    0x00057dfc sw s6, 0x238(sp)              |     *(var_238h) = s6;
    0x00057e00 sw s5, 0x234(sp)              |     *(var_234h) = s5;
    0x00057e04 sw s4, 0x230(sp)              |     *(var_230h) = s4;
    0x00057e08 sw s3, 0x22c(sp)              |     *(var_22ch) = s3;
    0x00057e0c sw s2, 0x228(sp)              |     *(var_228h) = s2;
    0x00057e10 addiu a1, s1, 0x4314          |     a1 = s1 + 0x4314;
                                             |     /* str._etc_sysconfig_sysstat.ioconf */
    0x00057e14 addiu a0, s0, 0x4484          |     a0 = s0 + 0x4484;
    0x00057e18 sw v0, 0x21c(sp)              |     *(var_21ch) = v0;
    0x00057e1c jalr t9                       |     t9 ();
    0x00057e20 nop                           |     
    0x00057e24 lw gp, 0x30(sp)               |     gp = *(var_30h);
                                             |     if (v0 == 0) {
    0x00057e28 beqz v0, 0x5858c              |         goto label_13;
                                             |     }
    0x00057e2c lw t9, -0x7c00(gp)            |     t9 = sym.imp.strncpy;
    0x00057e30 addiu s7, sp, 0xdc            |     s7 = sp + 0xdc;
    0x00057e34 addiu a2, zero, 0x40          |     a2 = 0x40;
                                             |     /* str._etc_sysconfig_sysstat.ioconf */
    0x00057e38 addiu a1, s0, 0x4484          |     a1 = s0 + 0x4484;
    0x00057e3c move a0, s7                   |     a0 = s7;
    0x00057e40 move s6, v0                   |     s6 = v0;
    0x00057e44 jalr t9                       |     t9 ();
    0x00057e48 lw gp, 0x30(sp)               |     gp = *(var_30h);
                                             | label_12:
    0x00057e4c lw v0, -0x7d40(gp)            |     v0 = *((gp - 8016));
    0x00057e50 lw t9, -0x7bf4(gp)            |     t9 = sym.imp.memset;
    0x00057e54 addiu v0, v0, -0x384c         |     v0 += -0x384c;
    0x00057e58 sw v0, 0x4c(sp)               |     *(var_4ch) = v0;
    0x00057e5c addiu a2, zero, 0x800         |     a2 = 0x800;
    0x00057e60 move a1, zero                 |     a1 = 0;
    0x00057e64 move a0, v0                   |     a0 = v0;
    0x00057e68 sb zero, 0x11b(sp)            |     *(var_11bh) = 0;
    0x00057e6c jalr t9                       |     t9 ();
    0x00057e70 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x00057e74 move s2, zero                 |     s2 = 0;
    0x00057e78 move s0, zero                 |     s0 = 0;
    0x00057e7c lw v0, -0x7fdc(gp)            |     v0 = *(gp);
    0x00057e80 sw zero, 0x48(sp)             |     *(var_48h) = 0;
    0x00057e84 sw v0, 0x3c(sp)               |     *(var_3ch) = v0;
    0x00057e88 lw v0, -0x7d40(gp)            |     v0 = *((gp - 8016));
    0x00057e8c addiu fp, sp, 0x11c           |     fp = sp + aav.0x0000011c;
    0x00057e90 addiu v0, v0, -0x304c         |     v0 += -0x304c;
    0x00057e94 sw v0, 0x40(sp)               |     *(var_40h) = v0;
    0x00057e98 lw v0, -0x7fdc(gp)            |     v0 = *(gp);
                                             |     /* str._s:_Indirect_record__u:_u:_u:..._references_not_yet_seen_major__u_n */
    0x00057e9c addiu v0, v0, 0x4514          |     v0 += 0x4514;
    0x00057ea0 sw v0, 0x5c(sp)               |     *(var_5ch) = v0;
    0x00057ea4 lw v0, -0x7fdc(gp)            |     v0 = *(gp);
    0x00057ea8 sw v0, 0x54(sp)               |     *(var_54h) = v0;
    0x00057eac lw v0, -0x7fdc(gp)            |     v0 = *(gp);
    0x00057eb0 addiu v0, v0, -0x2890         |     v0 += -0x2890;
    0x00057eb4 sw v0, 0x58(sp)               |     *(var_58h) = v0;
                                             |     do {
                                             | label_2:
    0x00057eb8 lw t9, -0x7b80(gp)            |         t9 = sym.imp.fgets;
                                             | label_0:
    0x00057ebc move a2, s6                   |         a2 = s6;
    0x00057ec0 addiu a1, zero, 0xff          |         a1 = 0xff;
    0x00057ec4 move a0, fp                   |         a0 = fp;
    0x00057ec8 jalr t9                       |         t9 ();
    0x00057ecc lw gp, 0x30(sp)               |         gp = *(var_30h);
                                             |         if (v0 == 0) {
    0x00057ed0 beqz v0, 0x58138              |             goto label_14;
                                             |         }
                                             | label_1:
    0x00057ed4 lb v0, 0x11c(sp)              |         v0 = *(var_11ch);
    0x00057ed8 addiu a0, zero, 0x23          |         a0 = 0x23;
    0x00057edc addiu a0, zero, 0xa           |         a0 = 0xa;
    0x00057ee0 beq v0, a0, 0x57eb8           |         
                                             |     } while (v0 == a0);
    0x00057ee4 lw t9, -0x7b80(gp)            |     t9 = sym.imp.fgets;
                                             |     if (v0 == a0) {
    0x00057ee8 beq v0, a0, 0x57ebc           |         goto label_0;
                                             |     }
    0x00057eec lw t9, -0x7bc0(gp)            |     t9 = sym.imp.malloc;
                                             |     if (s2 == 0) {
    0x00057ef0 beqz s2, 0x582ec              |         goto label_15;
                                             |     }
                                             | label_5:
    0x00057ef4 lw t9, -0x7bc0(gp)            |     t9 = sym.imp.malloc;
                                             |     if (s0 == 0) {
    0x00057ef8 beqz s0, 0x58288              |         goto label_16;
                                             |     }
                                             | label_3:
    0x00057efc lw t9, -0x7bf4(gp)            |     t9 = sym.imp.memset;
    0x00057f00 addiu a2, zero, 0xf0          |     a2 = 0xf0;
    0x00057f04 move a1, zero                 |     a1 = 0;
    0x00057f08 move a0, s2                   |     a0 = s2;
    0x00057f0c jalr t9                       |     t9 ();
    0x00057f10 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x00057f14 lw v0, 0x3c(sp)               |     v0 = *(var_3ch);
    0x00057f18 addiu s4, s0, 4               |     s4 = s0 + 4;
    0x00057f1c lw t9, -0x7bf0(gp)            |     t9 = sym.imp.__isoc99_sscanf;
    0x00057f20 addiu s5, sp, 0x68            |     s5 = sp + 0x68;
    0x00057f24 addiu s3, sp, 0x64            |     s3 = sp + 0x64;
    0x00057f28 addiu s1, sp, 0x9c            |     s1 = sp + 0x9c;
    0x00057f2c sw zero, (s0)                 |     *(s0) = 0;
    0x00057f30 sw zero, 4(s0)                |     *((s0 + 1)) = 0;
    0x00057f34 sw zero, 8(s0)                |     *((s0 + 2)) = 0;
    0x00057f38 sw zero, 0xc(s0)              |     *((s0 + 3)) = 0;
    0x00057f3c sw zero, 0x10(s0)             |     *((s0 + 4)) = 0;
    0x00057f40 move a0, fp                   |     a0 = fp;
    0x00057f44 move a3, s5                   |     a3 = s5;
    0x00057f48 sw s1, 0x14(sp)               |     *(var_14h) = s1;
    0x00057f4c sw s4, 0x10(sp)               |     *(var_10h) = s4;
    0x00057f50 move a2, s3                   |     a2 = s3;
    0x00057f54 addiu a1, v0, 0x44b8          |     a1 = v0 + 0x44b8;
    0x00057f58 jalr t9                       |     t9 ();
    0x00057f5c addiu a0, zero, 4             |     a0 = 4;
    0x00057f60 lw gp, 0x30(sp)               |     gp = *(var_30h);
                                             |     if (v0 == a0) {
    0x00057f64 beq v0, a0, 0x581b8           |         goto label_17;
                                             |     }
    0x00057f68 lw a1, -0x7fdc(gp)            |     a1 = *(gp);
    0x00057f6c lw t9, -0x7bf0(gp)            |     t9 = sym.imp.__isoc99_sscanf;
    0x00057f70 move a0, fp                   |     a0 = fp;
    0x00057f74 sw s4, 0x10(sp)               |     *(var_10h) = s4;
    0x00057f78 move a3, s5                   |     a3 = s5;
    0x00057f7c move a2, s3                   |     a2 = s3;
                                             |     /* str._u:_u:_u */
    0x00057f80 addiu a1, a1, 0x44c4          |     a1 += 0x44c4;
    0x00057f84 jalr t9                       |     t9 ();
    0x00057f88 addiu a0, v0, -3              |     a0 = v0 + -3;
    0x00057f8c sltiu a0, a0, 2               |     a0 = (a0 < 2) ? 1 : 0;
    0x00057f90 lw gp, 0x30(sp)               |     gp = *(var_30h);
                                             |     if (a0 != 0) {
    0x00057f94 bnez a0, 0x581bc              |         goto label_18;
                                             |     }
    0x00057f98 addiu v0, sp, 0x8c            |     v0 = sp + 0x8c;
    0x00057f9c move v1, v0                   |     v1 = v0;
    0x00057fa0 lw a1, -0x7fdc(gp)            |     a1 = *(gp);
    0x00057fa4 sw v0, 0x44(sp)               |     *(var_44h) = v0;
    0x00057fa8 addiu v0, s2, 0x7c            |     v0 = s2 + 0x7c;
    0x00057fac lw t9, -0x7bf0(gp)            |     t9 = sym.imp.__isoc99_sscanf;
    0x00057fb0 addiu a0, s2, 0x80            |     a0 = s2 + 0x80;
    0x00057fb4 sw v0, 0x1c(sp)               |     *(var_1ch) = v0;
    0x00057fb8 addiu s5, sp, 0x6c            |     s5 = sp + 0x6c;
    0x00057fbc addiu v0, sp, 0x7c            |     v0 = sp + 0x7c;
    0x00057fc0 sw a0, 0x24(sp)               |     *(var_24h) = a0;
    0x00057fc4 sw s1, 0x28(sp)               |     *(var_28h) = s1;
    0x00057fc8 move a0, fp                   |     a0 = fp;
    0x00057fcc sw v1, 0x20(sp)               |     *(var_20h) = v1;
    0x00057fd0 sw v0, 0x18(sp)               |     *(var_18h) = v0;
    0x00057fd4 sw s4, 0x14(sp)               |     *(var_14h) = s4;
    0x00057fd8 sw s5, 0x10(sp)               |     *(var_10h) = s5;
    0x00057fdc move a3, s2                   |     a3 = s2;
    0x00057fe0 move a2, s3                   |     a2 = s3;
                                             |     /* str._u:__:_:__:_:_u:__:_:_u:__:_:_u:_s */
    0x00057fe4 addiu a1, a1, 0x455c          |     a1 += 0x455c;
    0x00057fe8 jalr t9                       |     t9 ();
    0x00057fec addiu a0, zero, 9             |     a0 = 9;
    0x00057ff0 lw gp, 0x30(sp)               |     gp = *(var_30h);
                                             |     if (v0 != a0) {
    0x00057ff4 bne v0, a0, 0x58344           |         goto label_19;
                                             |     }
    0x00057ff8 lw a1, 0x64(sp)               |     a1 = *(var_64h);
    0x00057ffc addiu v0, a1, -1              |     v0 = a1 + -1;
    0x00058000 sltiu v0, v0, 0x1fe           |     v0 = (v0 < 0x1fe) ? 1 : 0;
    0x00058004 lb v0, 0x6c(sp)               |     v0 = *(var_6ch);
                                             |     if (v0 == 0) {
    0x00058008 beqz v0, 0x58490              |         goto label_20;
                                             |     }
    0x0005800c addiu a0, zero, 0x78          |     a0 = 0x78;
    0x00058010 lw v1, 0x40(sp)               |     v1 = *(var_40h);
                                             |     if (v0 == a0) {
    0x00058014 beq v0, a0, 0x583e8           |         goto label_21;
                                             |     }
    0x00058018 addiu a1, zero, 0x2a          |     a1 = 0x2a;
    0x0005801c addiu a0, s2, 0x20            |     a0 = s2 + 0x20;
                                             |     if (v0 == a1) {
    0x00058020 beq v0, a1, 0x584c8           |         goto label_22;
                                             |     }
    0x00058024 lw a3, -0x7fdc(gp)            |     a3 = *(gp);
    0x00058028 lw t9, -0x7c74(gp)            |     t9 = sym.imp.__sprintf_chk;
    0x0005802c sw s5, 0x14(sp)               |     *(var_14h) = s5;
    0x00058030 sw s2, 0x10(sp)               |     *(var_10h) = s2;
                                             |     /* str._s_s__d */
    0x00058034 addiu a3, a3, 0x4654          |     a3 += 0x4654;
    0x00058038 addiu a2, zero, 0x33          |     a2 = 0x33;
    0x0005803c addiu a1, zero, 1             |     a1 = 1;
    0x00058040 jalr t9                       |     t9 ();
    0x00058044 lw v0, 0x78(s2)               |     v0 = *((s2 + 30));
    0x00058048 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x0005804c addiu v0, v0, 1               |     v0++;
    0x00058050 sw v0, 0x78(s2)               |     *((s2 + 30)) = v0;
    0x00058054 lb v0, 0x7c(sp)               |     v0 = *(var_7ch);
    0x00058058 addiu a0, zero, 0x61          |     a0 = 0x61;
    0x0005805c sb zero, 0x53(s2)             |     *((s2 + 83)) = 0;
                                             |     if (v0 == a0) {
    0x00058060 beq v0, a0, 0x584f0           |         goto label_23;
                                             |     }
                                             | label_8:
    0x00058064 addiu a0, zero, 0x64          |     a0 = 0x64;
    0x00058068 addiu a3, s2, 0x53            |     a3 = s2 + 0x53;
                                             |     if (v0 == a0) {
    0x0005806c beq v0, a0, 0x58564           |         goto label_24;
                                             |     }
    0x00058070 addiu a0, zero, 0x25          |     a0 = 0x25;
    0x00058074 lw t9, -0x7c00(gp)            |     t9 = sym.imp.strncpy;
                                             |     if (v0 == a0) {
    0x00058078 beq v0, a0, 0x58548           |         goto label_25;
                                             |     }
                                             | label_9:
    0x0005807c lb a1, 0x8c(sp)               |     a1 = *(var_8ch);
    0x00058080 addiu v0, zero, 0x2a          |     v0 = 0x2a;
    0x00058084 addiu a0, s2, 0x63            |     a0 = s2 + 0x63;
                                             |     if (a1 == v0) {
    0x00058088 beq a1, v0, 0x584c0           |         goto label_26;
                                             |     }
    0x0005808c lw v0, 0x44(sp)               |     v0 = *(var_44h);
                                             | label_7:
    0x00058090 lw a3, -0x7fdc(gp)            |     a3 = *(gp);
    0x00058094 lw t9, -0x7c74(gp)            |     t9 = sym.imp.__sprintf_chk;
    0x00058098 addiu a1, zero, 1             |     a1 = 1;
    0x0005809c sw v0, 0x10(sp)               |     *(var_10h) = v0;
                                             |     /* str._s__d */
    0x000580a0 addiu a3, a3, 0x465c          |     a3 += 0x465c;
    0x000580a4 addiu a2, zero, 0x12          |     a2 = 0x12;
    0x000580a8 jalr t9                       |     t9 ();
    0x000580ac lw a0, 0x64(sp)               |     a0 = *(var_64h);
    0x000580b0 lw v1, 0x40(sp)               |     v1 = *(var_40h);
    0x000580b4 sll v0, a0, 2                 |     v0 = a0 << 2;
    0x000580b8 addu v0, v0, v1               |     v0 += v1;
    0x000580bc addiu a1, zero, 1             |     a1 = 1;
    0x000580c0 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x000580c4 sw s2, 0x10(s0)               |     *((s0 + 4)) = s2;
    0x000580c8 sw a1, (s0)                   |     *(s0) = a1;
    0x000580cc sw zero, 0xc(s0)              |     *((s0 + 3)) = 0;
    0x000580d0 sw a0, 8(s0)                  |     *((s0 + 2)) = a0;
    0x000580d4 sw s0, (v0)                   |     *(v0) = s0;
    0x000580d8 addiu s2, s2, 0x84            |     s2 += 0x84;
                                             |     do {
    0x000580dc lw a2, (s1)                   |         a2 = *(s1);
    0x000580e0 lw a1, 4(s1)                  |         a1 = *(var_4h);
    0x000580e4 lw a0, 8(s1)                  |         a0 = *(var_8h);
    0x000580e8 lw v0, 0xc(s1)                |         v0 = *(var_ch);
    0x000580ec addiu s1, s1, 0x10            |         s1 += 0x10;
    0x000580f0 sw a2, (s2)                   |         *(s2) = a2;
    0x000580f4 sw a1, 4(s2)                  |         *((s2 + 1)) = a1;
    0x000580f8 sw a0, 8(s2)                  |         *((s2 + 2)) = a0;
    0x000580fc sw v0, 0xc(s2)                |         *((s2 + 3)) = v0;
    0x00058100 addiu s2, s2, 0x10            |         s2 += 0x10;
    0x00058104 bne s1, s7, 0x580dc           |         
                                             |     } while (s1 != s7);
    0x00058108 lw v0, 0x48(sp)               |     v0 = *(var_48h);
    0x0005810c lw t9, -0x7b80(gp)            |     t9 = sym.imp.fgets;
    0x00058110 addiu v0, v0, 1               |     v0++;
    0x00058114 sw v0, 0x48(sp)               |     *(var_48h) = v0;
    0x00058118 move a2, s6                   |     a2 = s6;
    0x0005811c addiu a1, zero, 0xff          |     a1 = 0xff;
    0x00058120 move a0, fp                   |     a0 = fp;
    0x00058124 jalr t9                       |     t9 ();
    0x00058128 move s2, zero                 |     s2 = 0;
    0x0005812c move s0, zero                 |     s0 = 0;
    0x00058130 lw gp, 0x30(sp)               |     gp = *(var_30h);
                                             |     if (v0 != 0) {
    0x00058134 bnez v0, 0x57ed4              |         goto label_1;
                                             |     }
                                             | label_14:
    0x00058138 lw t9, -0x7c3c(gp)            |     t9 = sym.imp.fclose;
    0x0005813c move a0, s6                   |     a0 = s6;
    0x00058140 jalr t9                       |     t9 ();
    0x00058144 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x00058148 lw t9, -0x7b74(gp)            |     t9 = sym.imp.free;
    0x0005814c move a0, s2                   |     a0 = s2;
    0x00058150 jalr t9                       |     t9 ();
    0x00058154 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x00058158 lw t9, -0x7b74(gp)            |     t9 = sym.imp.free;
    0x0005815c move a0, s0                   |     a0 = s0;
    0x00058160 jalr t9                       |     t9 ();
    0x00058164 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x00058168 addiu a0, zero, 1             |     a0 = 1;
    0x0005816c lw v0, 0x48(sp)               |     v0 = *(var_48h);
    0x00058170 lw v1, -0x7d40(gp)            |     v1 = *((gp - 8016));
    0x00058174 sw a0, -0x284c(v1)            |     *((v1 - 2579)) = a0;
                                             | label_4:
    0x00058178 lw v1, 0x50(sp)               |     v1 = *(var_50h);
    0x0005817c lw a0, 0x21c(sp)              |     a0 = *(var_21ch);
    0x00058180 lw v1, (v1)                   |     v1 = *(v1);
    0x00058184 lw ra, 0x244(sp)              |     ra = *(var_244h);
                                             |     if (a0 != v1) {
    0x00058188 bne a0, v1, 0x5862c           |         goto label_27;
                                             |     }
    0x0005818c lw fp, 0x240(sp)              |     fp = *(var_240h);
    0x00058190 lw s7, 0x23c(sp)              |     s7 = *(var_23ch);
    0x00058194 lw s6, 0x238(sp)              |     s6 = *(var_238h);
    0x00058198 lw s5, 0x234(sp)              |     s5 = *(var_234h);
    0x0005819c lw s4, 0x230(sp)              |     s4 = *(var_230h);
    0x000581a0 lw s3, 0x22c(sp)              |     s3 = *(var_22ch);
    0x000581a4 lw s2, 0x228(sp)              |     s2 = *(var_228h);
    0x000581a8 lw s1, 0x224(sp)              |     s1 = *(var_224h);
    0x000581ac lw s0, 0x220(sp)              |     s0 = *(var_220h);
    0x000581b0 addiu sp, sp, 0x248           |     
    0x000581b4 jr ra                         |     return v0;
                                             | label_17:
    0x000581b8 addiu v0, zero, 4             |     v0 = 4;
                                             | label_18:
    0x000581bc lw a1, 0x68(sp)               |     a1 = *(var_68h);
    0x000581c0 sltiu a0, a1, 0x200           |     a0 = (a1 < aav.0x00000200) ? 1 : 0;
                                             |     if (a1 == 0) {
    0x000581c4 beqz a1, 0x57eb8              |         goto label_2;
                                             |     }
    0x000581c8 lw a2, 0x64(sp)               |     a2 = *(var_64h);
                                             |     if (a0 == 0) {
    0x000581cc beqz a0, 0x58438              |         goto label_28;
                                             |     }
    0x000581d0 sltiu a0, a2, 0x200           |     a0 = (a2 < aav.0x00000200) ? 1 : 0;
    0x000581d4 lw v1, 0x40(sp)               |     v1 = *(var_40h);
                                             |     if (a0 == 0) {
    0x000581d8 beqz a0, 0x58464              |         goto label_29;
                                             |     }
    0x000581dc sll a0, a1, 2                 |     a0 = a1 << 2;
    0x000581e0 lwx a3, a0(v1)                |     __asm ("lwx a3, a0(v1)");
    0x000581e4 addiu t0, zero, 3             |     t0 = 3;
                                             |     if (a3 == 0) {
    0x000581e8 beqz a3, 0x585cc              |         goto label_30;
                                             |     }
                                             |     if (v0 == t0) {
    0x000581ec beql v0, t0, 0x58510          |         goto label_31;
                                             |     }
    0x000581f0 lw v0, 0x10(a3)               |     v0 = *((a3 + 4));
    0x000581f4 lw v0, 0xc(s0)                |     v0 = *((s0 + 3));
    0x000581f8 lw t9, -0x7bc0(gp)            |     t9 = sym.imp.malloc;
                                             |     if (v0 == 0) {
    0x000581fc beqz v0, 0x58374              |         goto label_32;
                                             |     }
                                             |     do {
                                             | label_6:
    0x00058200 lw a3, (s1)                   |         a3 = *(s1);
    0x00058204 lw a2, 4(s1)                  |         a2 = *(var_4h);
    0x00058208 lw a1, 8(s1)                  |         a1 = *(var_8h);
    0x0005820c lw a0, 0xc(s1)                |         a0 = *(var_ch);
    0x00058210 swl a3, 3(v0)                 |         __asm ("swl a3, 3(v0)");
    0x00058214 swr a3, (v0)                  |         __asm ("swr a3, (v0)");
    0x00058218 swl a2, 7(v0)                 |         __asm ("swl a2, 7(v0)");
    0x0005821c swr a2, 4(v0)                 |         __asm ("swr a2, 4(v0)");
    0x00058220 swl a1, 0xb(v0)               |         __asm ("swl a1, 0xb(v0)");
    0x00058224 swr a1, 8(v0)                 |         __asm ("swr a1, 8(v0)");
    0x00058228 swl a0, 0xf(v0)               |         __asm ("swl a0, 0xf(v0)");
    0x0005822c addiu s1, s1, 0x10            |         s1 += 0x10;
    0x00058230 swr a0, 0xc(v0)               |         __asm ("swr a0, 0xc(v0)");
    0x00058234 addiu v0, v0, 0x10            |         v0 += 0x10;
    0x00058238 bne s1, s7, 0x58200           |         
                                             |     } while (s1 != s7);
    0x0005823c lw a1, 0x68(sp)               |     a1 = *(var_68h);
    0x00058240 lw a2, 0x64(sp)               |     a2 = *(var_64h);
    0x00058244 sll a0, a1, 2                 |     a0 = a1 << 2;
                                             | label_10:
    0x00058248 lw v0, 0x40(sp)               |     v0 = *(var_40h);
    0x0005824c sll a2, a2, 2                 |     a2 <<= 2;
    0x00058250 addu a2, v0, a2               |     a2 = v0 + a2;
    0x00058254 lw v1, 0x4c(sp)               |     v1 = *(var_4ch);
    0x00058258 sw s0, (a2)                   |     *(a2) = s0;
    0x0005825c addu a3, v1, a0               |     a3 = v1 + a0;
    0x00058260 lwx a0, a0(v0)                |     __asm ("lwx a0, a0(v0)");
    0x00058264 lw v0, (a3)                   |     v0 = *(a3);
    0x00058268 sw a1, 8(s0)                  |     *((s0 + 2)) = a1;
    0x0005826c lw a0, 0x10(a0)               |     a0 = *((a0 + 4));
    0x00058270 addiu v0, v0, 1               |     v0++;
    0x00058274 sw a0, 0x10(s0)               |     *((s0 + 4)) = a0;
    0x00058278 sw zero, (s0)                 |     *(s0) = 0;
    0x0005827c sw v0, (a3)                   |     *(a3) = v0;
    0x00058280 move s0, zero                 |     s0 = 0;
    0x00058284 b 0x57eb8                     |     goto label_2;
                                             | label_16:
    0x00058288 addiu a0, zero, 0x14          |     a0 = 0x14;
    0x0005828c jalr t9                       |     t9 ();
    0x00058290 move s0, v0                   |     s0 = v0;
    0x00058294 lw gp, 0x30(sp)               |     gp = *(var_30h);
                                             |     if (v0 != 0) {
    0x00058298 bnez v0, 0x57efc              |         goto label_3;
                                             |     }
    0x0005829c lw a0, -0x7fdc(gp)            |     a0 = *(gp);
    0x000582a0 lw t9, -0x7bac(gp)            |     t9 = sym.imp.perror;
                                             |     /* str.malloc */
    0x000582a4 addiu a0, a0, 0x1bc4          |     a0 += 0x1bc4;
    0x000582a8 jalr t9                       |     t9 ();
    0x000582ac lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x000582b0 lw t9, -0x7cac(gp)            |     t9 = *(gp);
                                             |     /* fcn.00057cd8 */
    0x000582b4 addiu t9, t9, 0x7cd8          |     t9 += 0x7cd8;
    0x000582b8 bal 0x57cd8                   |     fcn_00057cd8 ();
    0x000582bc nop                           |     
    0x000582c0 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x000582c4 lw t9, -0x7c3c(gp)            |     t9 = sym.imp.fclose;
    0x000582c8 move a0, s6                   |     a0 = s6;
    0x000582cc jalr t9                       |     t9 ();
    0x000582d0 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x000582d4 lw t9, -0x7b74(gp)            |     t9 = sym.imp.free;
    0x000582d8 move a0, s2                   |     a0 = s2;
    0x000582dc jalr t9                       |     t9 ();
    0x000582e0 lw gp, 0x30(sp)               |     gp = *(var_30h);
                                             | label_11:
    0x000582e4 move v0, zero                 |     v0 = 0;
    0x000582e8 b 0x58178                     |     goto label_4;
                                             | label_15:
    0x000582ec addiu a0, zero, 0xf0          |     a0 = 0xf0;
    0x000582f0 jalr t9                       |     t9 ();
    0x000582f4 move s2, v0                   |     s2 = v0;
    0x000582f8 lw gp, 0x30(sp)               |     gp = *(var_30h);
                                             |     if (v0 != 0) {
    0x000582fc bnez v0, 0x57ef4              |         goto label_5;
                                             |     }
    0x00058300 lw a0, -0x7fdc(gp)            |     a0 = *(gp);
    0x00058304 lw t9, -0x7bac(gp)            |     t9 = sym.imp.perror;
                                             |     /* str.malloc */
    0x00058308 addiu a0, a0, 0x1bc4          |     a0 += 0x1bc4;
    0x0005830c jalr t9                       |     t9 ();
    0x00058310 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x00058314 lw t9, -0x7cac(gp)            |     t9 = *(gp);
                                             |     /* fcn.00057cd8 */
    0x00058318 addiu t9, t9, 0x7cd8          |     t9 += 0x7cd8;
    0x0005831c bal 0x57cd8                   |     fcn_00057cd8 ();
    0x00058320 nop                           |     
    0x00058324 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x00058328 lw t9, -0x7c3c(gp)            |     t9 = sym.imp.fclose;
    0x0005832c move a0, s6                   |     a0 = s6;
    0x00058330 jalr t9                       |     t9 ();
    0x00058334 lw gp, 0x30(sp)               |     gp = *(var_30h);
                                             |     if (s0 != 0) {
    0x00058338 bnez s0, 0x583d0              |         goto label_33;
                                             |     }
    0x0005833c move v0, zero                 |     v0 = 0;
    0x00058340 b 0x58178                     |     goto label_4;
                                             | label_19:
    0x00058344 lw a0, -0x7b6c(gp)            |     a0 = *((gp - 7899));
    0x00058348 lw a2, -0x7fdc(gp)            |     a2 = *(gp);
    0x0005834c lw t9, -0x7c44(gp)            |     t9 = sym.imp.__fprintf_chk
    0x00058350 lw a0, (a0)                   |     a0 = *(a0);
    0x00058354 move a3, s7                   |     a3 = s7;
    0x00058358 sw fp, 0x14(sp)               |     *(var_14h) = fp;
    0x0005835c sw v0, 0x10(sp)               |     *(var_10h) = v0;
                                             |     /* str._s:_Malformed__u_field_record:__s_n */
    0x00058360 addiu a2, a2, 0x4584          |     a2 += 0x4584;
    0x00058364 addiu a1, zero, 1             |     a1 = 1;
    0x00058368 jalr t9                       |     t9 ();
    0x0005836c lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x00058370 b 0x57eb8                     |     goto label_2;
                                             | label_32:
    0x00058374 addiu a0, zero, 0x40          |     a0 = 0x40;
    0x00058378 jalr t9                       |     t9 ();
    0x0005837c lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x00058380 sw v0, 0xc(s0)                |     *((s0 + 3)) = v0;
                                             |     if (v0 != 0) {
    0x00058384 bnez v0, 0x58200              |         goto label_6;
                                             |     }
    0x00058388 lw a0, -0x7fdc(gp)            |     a0 = *(gp);
    0x0005838c lw t9, -0x7bac(gp)            |     t9 = sym.imp.perror;
                                             |     /* str.malloc */
    0x00058390 addiu a0, a0, 0x1bc4          |     a0 += 0x1bc4;
    0x00058394 jalr t9                       |     t9 ();
    0x00058398 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x0005839c lw t9, -0x7cac(gp)            |     t9 = *(gp);
                                             |     /* fcn.00057cd8 */
    0x000583a0 addiu t9, t9, 0x7cd8          |     t9 += 0x7cd8;
    0x000583a4 bal 0x57cd8                   |     fcn_00057cd8 ();
    0x000583a8 nop                           |     
    0x000583ac lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x000583b0 lw t9, -0x7c3c(gp)            |     t9 = sym.imp.fclose;
    0x000583b4 move a0, s6                   |     a0 = s6;
    0x000583b8 jalr t9                       |     t9 ();
    0x000583bc lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x000583c0 lw t9, -0x7b74(gp)            |     t9 = sym.imp.free;
    0x000583c4 move a0, s2                   |     a0 = s2;
    0x000583c8 jalr t9                       |     t9 ();
    0x000583cc lw gp, 0x30(sp)               |     gp = *(var_30h);
                                             | label_33:
    0x000583d0 lw t9, -0x7b74(gp)            |     t9 = sym.imp.free;
    0x000583d4 move a0, s0                   |     a0 = s0;
    0x000583d8 jalr t9                       |     t9 ();
    0x000583dc lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x000583e0 move v0, zero                 |     v0 = 0;
    0x000583e4 b 0x58178                     |     goto label_4;
                                             | label_21:
    0x000583e8 sll v0, a1, 2                 |     v0 = a1 << 2;
    0x000583ec lwx v0, v0(v1)                |     __asm ("lwx v0, v0(v1)");
                                             |     if (v0 == 0) {
    0x000583f0 beql v0, zero, 0x58604        |         goto label_34;
                                             |     }
    0x000583f4 lw v0, -0x7b6c(gp)            |     v0 = *((gp - 7899));
    0x000583f8 lw s1, 0x10(v0)               |     s1 = *((v0 + 4));
    0x000583fc lw v0, 0xe8(s1)               |     v0 = *((s1 + 58));
                                             |     if (v0 == 0) {
    0x00058400 beql v0, zero, 0x5851c        |         goto label_35;
                                             |     }
    0x00058404 lw v0, 4(s0)                  |     v0 = *((s0 + 1));
    0x00058408 lw v0, -0x7b6c(gp)            |     v0 = *((gp - 7899));
    0x0005840c lw a2, -0x7fdc(gp)            |     a2 = *(gp);
    0x00058410 lw t9, -0x7c44(gp)            |     t9 = sym.imp.__fprintf_chk
    0x00058414 lw a0, (v0)                   |     a0 = *(v0);
    0x00058418 move a3, s7                   |     a3 = s7;
    0x0005841c sw a1, 0x10(sp)               |     *(var_10h) = a1;
    0x00058420 sw fp, 0x14(sp)               |     *(var_14h) = fp;
                                             |     /* str._s:_duplicate_x_record_for_major__u___ignored_ninput_line:__s_n */
    0x00058424 addiu a2, a2, 0x4610          |     a2 += 0x4610;
    0x00058428 addiu a1, zero, 1             |     a1 = 1;
    0x0005842c jalr t9                       |     t9 ();
    0x00058430 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x00058434 b 0x57eb8                     |     goto label_2;
                                             | label_28:
    0x00058438 lw v0, -0x7b6c(gp)            |     v0 = *((gp - 7899));
    0x0005843c lw a2, -0x7fdc(gp)            |     a2 = *(gp);
    0x00058440 lw t9, -0x7c44(gp)            |     t9 = sym.imp.__fprintf_chk
    0x00058444 lw a0, (v0)                   |     a0 = *(v0);
    0x00058448 move a3, s7                   |     a3 = s7;
    0x0005844c sw a1, 0x10(sp)               |     *(var_10h) = a1;
                                             |     /* str._s:_Indirect_major__u_out_of_range_n */
    0x00058450 addiu a2, a2, 0x44d0          |     a2 += 0x44d0;
    0x00058454 addiu a1, zero, 1             |     a1 = 1;
    0x00058458 jalr t9                       |     t9 ();
    0x0005845c lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x00058460 b 0x57eb8                     |     goto label_2;
                                             | label_29:
    0x00058464 lw v0, -0x7b6c(gp)            |     v0 = *((gp - 7899));
    0x00058468 sw a2, 0x10(sp)               |     *(var_10h) = a2;
    0x0005846c lw t9, -0x7c44(gp)            |     t9 = sym.imp.__fprintf_chk
    0x00058470 lw a0, (v0)                   |     a0 = *(v0);
    0x00058474 lw v0, 0x54(sp)               |     v0 = *(var_54h);
    0x00058478 move a3, s7                   |     a3 = s7;
    0x0005847c addiu a2, v0, 0x44f8          |     a2 = v0 + 0x44f8;
    0x00058480 addiu a1, zero, 1             |     a1 = 1;
    0x00058484 jalr t9                       |     t9 ();
    0x00058488 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x0005848c b 0x57eb8                     |     goto label_2;
                                             | label_20:
    0x00058490 lw v0, -0x7b6c(gp)            |     v0 = *((gp - 7899));
    0x00058494 lw a3, -0x7fdc(gp)            |     a3 = *(gp);
    0x00058498 lw a2, -0x7fdc(gp)            |     a2 = *(gp);
    0x0005849c lw t9, -0x7c44(gp)            |     t9 = sym.imp.__fprintf_chk
    0x000584a0 lw a0, (v0)                   |     a0 = *(v0);
                                             |     /* str.ioc_init */
    0x000584a4 addiu a3, a3, 0x4670          |     a3 += 0x4670;
    0x000584a8 sw a1, 0x10(sp)               |     *(var_10h) = a1;
                                             |     /* str._s:_major__u_out_of_range_n */
    0x000584ac addiu a2, a2, 0x45a8          |     a2 += 0x45a8;
    0x000584b0 addiu a1, zero, 1             |     a1 = 1;
    0x000584b4 jalr t9                       |     t9 ();
    0x000584b8 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x000584bc b 0x57eb8                     |     goto label_2;
                                             | label_26:
    0x000584c0 lw v0, 0x58(sp)               |     v0 = *(var_58h);
    0x000584c4 b 0x58090                     |     goto label_7;
                                             | label_22:
    0x000584c8 lw t9, -0x7c00(gp)            |     t9 = sym.imp.strncpy;
    0x000584cc addiu a2, zero, 0x32          |     a2 = 0x32;
    0x000584d0 move a1, s2                   |     a1 = s2;
    0x000584d4 jalr t9                       |     t9 ();
    0x000584d8 lb v0, 0x7c(sp)               |     v0 = *(var_7ch);
    0x000584dc addiu a0, zero, 0x61          |     a0 = 0x61;
    0x000584e0 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x000584e4 sb zero, 0x52(s2)             |     *((s2 + 82)) = 0;
    0x000584e8 sb zero, 0x53(s2)             |     *((s2 + 83)) = 0;
                                             |     if (v0 != a0) {
    0x000584ec bne v0, a0, 0x58064           |         goto label_8;
                                             |     }
                                             | label_23:
    0x000584f0 lw a0, -0x7ca8(gp)            |     a0 = sym.ioc_ito26;
    0x000584f4 sb zero, 0x55(s2)             |     *((s2 + 85)) = 0;
    0x000584f8 sw a0, 0xc4(s2)               |     *((s2 + 49)) = a0;
    0x000584fc addiu a0, zero, 0x25          |     a0 = 0x25;
    0x00058500 sb a0, 0x53(s2)               |     *((s2 + 83)) = a0;
    0x00058504 addiu a0, zero, 0x73          |     a0 = 0x73;
    0x00058508 sb a0, 0x54(s2)               |     *((s2 + 84)) = a0;
    0x0005850c b 0x5807c                     |     goto label_9;
                                             | label_31:
    0x00058510 addiu v0, v0, 0x84            |     v0 += 0x84;
    0x00058514 sw v0, 0xc(s0)                |     *((s0 + 3)) = v0;
    0x00058518 b 0x58248                     |     goto label_10;
                                             | label_35:
    0x0005851c lw t9, -0x7c00(gp)            |     t9 = sym.imp.strncpy;
    0x00058520 sw v0, 0xec(s1)               |     *((s1 + 59)) = v0;
    0x00058524 addiu a2, zero, 0x20          |     a2 = 0x20;
    0x00058528 move a1, s2                   |     a1 = s2;
    0x0005852c addiu a0, s1, 0xc8            |     a0 = s1 + 0xc8;
    0x00058530 jalr t9                       |     t9 ();
    0x00058534 addiu v0, zero, 1             |     v0 = 1;
    0x00058538 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x0005853c sb zero, 0xe7(s1)             |     *((s1 + 231)) = 0;
    0x00058540 sw v0, 0xe8(s1)               |     *((s1 + 58)) = v0;
    0x00058544 b 0x57eb8                     |     goto label_2;
                                             | label_25:
    0x00058548 addiu a3, s2, 0x53            |     a3 = s2 + 0x53;
    0x0005854c move a0, a3                   |     a0 = a3;
    0x00058550 addiu a2, zero, 0xf           |     a2 = 0xf;
    0x00058554 addiu a1, sp, 0x7d            |     a1 = sp + 0x7d;
    0x00058558 jalr t9                       |     t9 ();
    0x0005855c lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x00058560 move a3, v0                   |     a3 = v0;
                                             | label_24:
    0x00058564 lw v0, -0x7ca4(gp)            |     v0 = sym.ioc_ito10;
    0x00058568 lw a1, -0x7fdc(gp)            |     a1 = *(gp);
    0x0005856c lw t9, -0x7b44(gp)            |     t9 = sym.imp.__strcat_chk;
    0x00058570 sw v0, 0xc4(s2)               |     *((s2 + 49)) = v0;
    0x00058574 addiu a2, zero, 0x10          |     a2 = 0x10;
                                             |     /* esilref: '&s' */
    0x00058578 addiu a1, a1, 0x35fc          |     a1 += 0x35fc;
    0x0005857c move a0, a3                   |     a0 = a3;
    0x00058580 jalr t9                       |     t9 ();
    0x00058584 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x00058588 b 0x5807c                     |     goto label_9;
                                             | label_13:
    0x0005858c lw s0, -0x7fdc(gp)            |     s0 = *(gp);
    0x00058590 lw t9, -0x7b64(gp)            |     t9 = sym.imp.fopen;
    0x00058594 addiu a1, s1, 0x4314          |     a1 = s1 + 0x4314;
                                             |     /* str.._sysstat.ioconf */
    0x00058598 addiu a0, s0, 0x44a4          |     a0 = s0 + 0x44a4;
    0x0005859c jalr t9                       |     t9 ();
    0x000585a0 move s6, v0                   |     s6 = v0;
    0x000585a4 lw gp, 0x30(sp)               |     gp = *(var_30h);
                                             |     if (v0 == 0) {
    0x000585a8 beqz v0, 0x582e4              |         goto label_11;
                                             |     }
    0x000585ac lw t9, -0x7c00(gp)            |     t9 = sym.imp.strncpy;
    0x000585b0 addiu s7, sp, 0xdc            |     s7 = sp + 0xdc;
    0x000585b4 addiu a2, zero, 0x40          |     a2 = 0x40;
                                             |     /* str.._sysstat.ioconf */
    0x000585b8 addiu a1, s0, 0x44a4          |     a1 = s0 + 0x44a4;
    0x000585bc move a0, s7                   |     a0 = s7;
    0x000585c0 jalr t9                       |     t9 ();
    0x000585c4 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x000585c8 b 0x57e4c                     |     goto label_12;
                                             | label_30:
    0x000585cc lw a0, -0x7b6c(gp)            |     a0 = *((gp - 7899));
    0x000585d0 sw a2, 0x1c(sp)               |     *(var_1ch) = a2;
    0x000585d4 lw v0, 4(s0)                  |     v0 = *((s0 + 1));
    0x000585d8 lw a0, (a0)                   |     a0 = *(a0);
    0x000585dc lw t9, -0x7c44(gp)            |     t9 = sym.imp.__fprintf_chk
    0x000585e0 sw a2, 0x10(sp)               |     *(var_10h) = a2;
    0x000585e4 lw a2, 0x5c(sp)               |     a2 = *(var_5ch);
    0x000585e8 sw a1, 0x14(sp)               |     *(var_14h) = a1;
    0x000585ec sw v0, 0x18(sp)               |     *(var_18h) = v0;
    0x000585f0 move a3, s7                   |     a3 = s7;
    0x000585f4 addiu a1, zero, 1             |     a1 = 1;
    0x000585f8 jalr t9                       |     t9 ();
    0x000585fc lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x00058600 b 0x57eb8                     |     goto label_2;
                                             | label_34:
    0x00058604 lw a2, -0x7fdc(gp)            |     a2 = *(gp);
    0x00058608 lw t9, -0x7c44(gp)            |     t9 = sym.imp.__fprintf_chk
    0x0005860c lw a0, (v0)                   |     a0 = *(v0);
    0x00058610 move a3, s7                   |     a3 = s7;
    0x00058614 sw a1, 0x10(sp)               |     *(var_10h) = a1;
                                             |     /* str._s:_type_x_record_for_major__u_must_follow_the_base_record___ignored_n */
    0x00058618 addiu a2, a2, 0x45c4          |     a2 += 0x45c4;
    0x0005861c addiu a1, zero, 1             |     a1 = 1;
    0x00058620 jalr t9                       |     t9 ();
    0x00058624 lw gp, 0x30(sp)               |     gp = *(var_30h);
    0x00058628 b 0x57eb8                     |     goto label_2;
                                             | label_27:
    0x0005862c lw t9, -0x7b90(gp)            |     t9 = sym.imp.__stack_chk_fail;
    0x00058630 jalr t9                       |     t9 ();
    0x00058634 nop                           |     
                                             | }
    ; assembly                           | /* r2dec pseudo code output */
                                         | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0x505d4 */
                                         | #include <stdint.h>
                                         |  
    ; (fcn) sym.sa_fread ()              | void sa_fread () {
    0x000505d4 lui gp, 3                 |     
    0x000505d8 addiu gp, gp, -0x1614     |     
    0x000505dc addu gp, gp, t9           |     gp += t9;
    0x000505e0 addiu sp, sp, -0x28       |     
    0x000505e4 lw t9, -0x7b58(gp)        |     t9 = sym.imp.read;
    0x000505e8 sw gp, 0x10(sp)           |     *(var_10h) = gp;
    0x000505ec sw s2, 0x20(sp)           |     *(var_20h) = s2;
    0x000505f0 sw s1, 0x1c(sp)           |     *(var_1ch) = s1;
    0x000505f4 sw s0, 0x18(sp)           |     *(var_18h) = s0;
    0x000505f8 sw ra, 0x24(sp)           |     *(var_24h) = ra;
    0x000505fc move s2, a0               |     s2 = a0;
    0x00050600 move s1, a2               |     s1 = a2;
    0x00050604 move s0, a3               |     s0 = a3;
    0x00050608 jalr t9                   |     t9 ();
    0x0005060c lw gp, 0x10(sp)           |     gp = *(var_10h);
                                         |     if (v0 < 0) {
    0x00050610 bltz v0, 0x506ac          |         goto label_0;
                                         |     }
    0x00050614 or s0, s0, v0             |     s0 |= v0;
    0x00050618 lw ra, 0x24(sp)           |     ra = *(var_24h);
                                         |     if (s0 == 0) {
    0x0005061c beqz s0, 0x50648          |         goto label_1;
                                         |     }
    0x00050620 sltu v0, v0, s1           |     v0 = (v0 < s1) ? 1 : 0;
    0x00050624 lw v0, -0x7b6c(gp)        |     v0 = *((gp - 7899));
                                         |     if (v0 != 0) {
    0x00050628 bnez v0, 0x50660          |         goto label_2;
                                         |     }
    0x0005062c move v0, zero             |     v0 = 0;
                                         |     do {
    0x00050630 lw ra, 0x24(sp)           |         ra = *(var_24h);
    0x00050634 lw s2, 0x20(sp)           |         s2 = *(var_20h);
    0x00050638 lw s1, 0x1c(sp)           |         s1 = *(var_1ch);
    0x0005063c lw s0, 0x18(sp)           |         s0 = *(var_18h);
    0x00050640 addiu sp, sp, 0x28        |         
    0x00050644 jr ra                     |         return v0;
                                         | label_1:
    0x00050648 lw s2, 0x20(sp)           |         s2 = *(var_20h);
    0x0005064c lw s1, 0x1c(sp)           |         s1 = *(var_1ch);
    0x00050650 lw s0, 0x18(sp)           |         s0 = *(var_18h);
    0x00050654 addiu v0, zero, 1         |         v0 = 1;
    0x00050658 addiu sp, sp, 0x28        |         
    0x0005065c jr ra                     |         return v0;
                                         | label_2:
    0x00050660 lw a0, -0x7fdc(gp)        |         a0 = *(gp);
    0x00050664 lw t9, -0x7bb0(gp)        |         t9 = sym.imp.fwrite;
    0x00050668 lw a3, (v0)               |         a3 = *(v0);
                                         |         /* str.End_of_system_activity_file_unexpected_n */
    0x0005066c addiu a0, a0, 0x3e18      |         a0 += 0x3e18;
    0x00050670 addiu a2, zero, 0x27      |         a2 = 0x27;
    0x00050674 addiu a1, zero, 1         |         a1 = 1;
    0x00050678 jalr t9                   |         t9 ();
    0x0005067c lw a0, 0x38(sp)           |         a0 = *(arg_38h);
    0x00050680 addiu v1, zero, 1         |         v1 = 1;
    0x00050684 lw gp, 0x10(sp)           |         gp = *(var_10h);
    0x00050688 addiu v0, zero, 2         |         v0 = 2;
    0x0005068c beq a0, v1, 0x50630       |         
                                         |     } while (a0 == v1);
                                         |     do {
    0x00050690 lw t9, -0x7c58(gp)        |         t9 = sym.imp.close;
    0x00050694 move a0, s2               |         a0 = s2;
    0x00050698 jalr t9                   |         t9 ();
    0x0005069c lw gp, 0x10(sp)           |         gp = *(var_10h);
    0x000506a0 lw t9, -0x7bd0(gp)        |         t9 = sym.imp.exit;
    0x000506a4 addiu a0, zero, 2         |         a0 = 2;
    0x000506a8 jalr t9                   |         t9 ();
                                         | label_0:
    0x000506ac lw v0, -0x7b6c(gp)        |         v0 = *((gp - 7899));
    0x000506b0 lw t9, -0x7bfc(gp)        |         t9 = sym.imp.__errno_location;
    0x000506b4 lw s0, (v0)               |         s0 = *(v0);
    0x000506b8 jalr t9                   |         t9 ();
    0x000506bc lw gp, 0x10(sp)           |         gp = *(var_10h);
    0x000506c0 lw t9, -0x7bc8(gp)        |         t9 = sym.imp.strerror;
    0x000506c4 lw a0, (v0)               |         a0 = *(v0);
    0x000506c8 jalr t9                   |         t9 ();
    0x000506cc lw gp, 0x10(sp)           |         gp = *(var_10h);
    0x000506d0 move a3, v0               |         a3 = v0;
    0x000506d4 addiu a1, zero, 1         |         a1 = 1;
    0x000506d8 lw a2, -0x7fdc(gp)        |         a2 = *(gp);
    0x000506dc lw t9, -0x7c44(gp)        |         t9 = sym.imp.__fprintf_chk
                                         |         /* str.Error_while_reading_system_activity_file:__s_n */
    0x000506e0 addiu a2, a2, 0x3de8      |         a2 += 0x3de8;
    0x000506e4 move a0, s0               |         a0 = s0;
    0x000506e8 jalr t9                   |         t9 ();
    0x000506ec lw gp, 0x10(sp)           |         gp = *(var_10h);
    0x000506f0 b 0x50690                 |         
                                         |     } while (1);
                                         | }
    ; assembly                               | /* r2dec pseudo code output */
                                             | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0x50ef4 */
                                             | #include <stdint.h>
                                             |  
    ; (fcn) sym.sa_open_read_magic ()        | void sa_open_read_magic () {
    0x00050ef4 lui gp, 3                     |     
    0x00050ef8 addiu gp, gp, -0x1f34         |     
    0x00050efc addu gp, gp, t9               |     gp += t9;
    0x00050f00 addiu sp, sp, -0x50           |     
    0x00050f04 lw t9, -0x7bd8(gp)            |     t9 = sym.imp.open;
    0x00050f08 sw s1, 0x38(sp)               |     *(var_38h) = s1;
    0x00050f0c lw s1, -0x7b7c(gp)            |     s1 = *((gp - 7903));
    0x00050f10 sw s2, 0x3c(sp)               |     *(var_3ch) = s2;
    0x00050f14 move s2, a1                   |     s2 = a1;
    0x00050f18 lw v0, (s1)                   |     v0 = *(s1);
    0x00050f1c sw gp, 0x18(sp)               |     *(var_18h) = gp;
    0x00050f20 sw v0, 0x2c(sp)               |     *(var_2ch) = v0;
    0x00050f24 addiu v0, zero, 5             |     v0 = 5;
    0x00050f28 sw s5, 0x48(sp)               |     *(var_48h) = s5;
    0x00050f2c sw s4, 0x44(sp)               |     *(var_44h) = s4;
    0x00050f30 sw s3, 0x40(sp)               |     *(var_40h) = s3;
    0x00050f34 sw s0, 0x34(sp)               |     *(var_34h) = s0;
    0x00050f38 move s3, a0                   |     s3 = a0;
    0x00050f3c sw ra, 0x4c(sp)               |     *(var_4ch) = ra;
    0x00050f40 move a1, zero                 |     a1 = 0;
    0x00050f44 move a0, s2                   |     a0 = s2;
    0x00050f48 sw zero, 0x20(sp)             |     *(var_20h) = 0;
    0x00050f4c sw zero, 0x24(sp)             |     *(var_24h) = 0;
    0x00050f50 sw v0, 0x28(sp)               |     *(var_28h) = v0;
    0x00050f54 move s0, a2                   |     s0 = a2;
    0x00050f58 move s4, a3                   |     s4 = a3;
    0x00050f5c lw s5, 0x60(sp)               |     s5 = *(arg_60h);
    0x00050f60 jalr t9                       |     t9 ();
    0x00050f64 lw gp, 0x18(sp)               |     gp = *(var_18h);
    0x00050f68 sw v0, (s3)                   |     *(s3) = v0;
                                             |     if (v0 < 0) {
    0x00050f6c bltz v0, 0x51140              |         goto label_5;
                                             |     }
    0x00050f70 lw t9, -0x7b58(gp)            |     t9 = sym.imp.read;
    0x00050f74 addiu a2, zero, 0x4c          |     a2 = 0x4c;
    0x00050f78 move a1, s0                   |     a1 = s0;
    0x00050f7c move a0, v0                   |     a0 = v0;
    0x00050f80 jalr t9                       |     t9 ();
    0x00050f84 addiu v1, zero, 0x4c          |     v1 = 0x4c;
    0x00050f88 lw gp, 0x18(sp)               |     gp = *(var_18h);
                                             |     if (v0 == v1) {
    0x00050f8c bne v0, v1, 0x50fc4           |         
    0x00050f90 lhu v1, (s0)                  |         v1 = *(s0);
    0x00050f94 ori a0, zero, 0xd596          |         a0 = 0xd596;
    0x00050f98 ori a0, zero, 0x96d5          |         a0 = 0x96d5;
                                             |         if (v1 == a0) {
    0x00050f9c beq v1, a0, 0x510f4           |             goto label_6;
                                             |         }
    0x00050fa0 addiu a0, zero, 0x2175        |         a0 = 0x2175;
                                             |         if (v1 != a0) {
    0x00050fa4 bne v1, a0, 0x50fc4           |             goto label_7;
                                             |         }
    0x00050fa8 lhu v1, 2(s0)                 |         v1 = *((s0 + 1));
    0x00050fac addiu a0, zero, 0x7521        |         a0 = 0x7521;
                                             |         if (v1 == a0) {
    0x00050fb0 beq v1, a0, 0x50fdc           |             goto label_8;
                                             |         }
                                             |         if (v1 == a0) {
    0x00050fb4 beql v1, a0, 0x50fe0          |             goto label_9;
                                             |         }
    0x00050fb8 addiu v0, zero, 1             |         v0 = 1;
    0x00050fbc addiu v0, zero, 1             |         v0 = 1;
                                             |         if (s4 == 0) {
    0x00050fc0 bnel s4, zero, 0x50fe0        |             goto label_9;
                                             |         }
                                             |     }
                                             | label_7:
    0x00050fc4 lw a0, (s3)                   |     a0 = *(s3);
                                             | label_2:
    0x00050fc8 lw t9, -0x7d20(gp)            |     t9 = sym.handle_invalid_sa_file;
    0x00050fcc move a3, v0                   |     a3 = v0;
    0x00050fd0 move a2, s2                   |     a2 = s2;
    0x00050fd4 move a1, s0                   |     a1 = s0;
    0x00050fd8 bal 0x4e780                   |     sym_handle_invalid_sa_file ();
                                             | label_8:
    0x00050fdc addiu v0, zero, 1             |     v0 = 1;
                                             | label_9:
    0x00050fe0 sw v0, (s5)                   |     *(s5) = v0;
    0x00050fe4 lw v0, 0x64(sp)               |     v0 = *(arg_64h);
    0x00050fe8 lw t9, -0x7e90(gp)            |     t9 = sym.swap_struct;
                                             |     if (v0 != 0) {
    0x00050fec beqz v0, 0x51000              |         
    0x00050ff0 wsbh v1, v1                   |         __asm ("wsbh v1, v1");
    0x00050ff4 addiu v0, zero, -0x2a6a       |         v0 = -0x2a6a;
    0x00050ff8 sh v0, (s0)                   |         *(s0) = v0;
    0x00050ffc sh v1, 2(s0)                  |         *((s0 + 1)) = v1;
                                             |     }
    0x00051000 move a2, zero                 |     a2 = 0;
    0x00051004 addiu a1, s0, 8               |     a1 = s0 + 8;
    0x00051008 addiu a0, sp, 0x20            |     a0 = sp + 0x20;
    0x0005100c bal 0x501c8                   |     sym_swap_struct ();
    0x00051010 lw gp, 0x18(sp)               |     gp = *(var_18h);
                                             | label_1:
    0x00051014 lbu v0, 4(s0)                 |     v0 = *((s0 + 4));
    0x00051018 sltiu v1, v0, 0xb             |     v1 = (v0 < 0xb) ? 1 : 0;
                                             |     if (v1 == 0) {
    0x0005101c beql v1, zero, 0x5108c        |         goto label_10;
                                             |     }
    0x00051020 lw v1, 8(s0)                  |     v1 = *((s0 + 2));
    0x00051024 addiu v1, zero, 0xa           |     v1 = 0xa;
                                             |     if (v0 == v1) {
    0x00051028 beql v0, v1, 0x5107c          |         goto label_11;
                                             |     }
    0x0005102c lbu v1, 5(s0)                 |     v1 = *((s0 + 5));
    0x00051030 lhu v0, 2(s0)                 |     v0 = *((s0 + 1));
                                             |     do {
                                             | label_0:
    0x00051034 addiu v1, zero, 0x2175        |         v1 = 0x2175;
                                             |         if (v0 != v1) {
    0x00051038 beql v0, v1, 0x5104c          |             
    0x0005103c move v0, zero                 |             v0 = 0;
    0x00051040 xori v0, v0, 0x7521           |             v0 ^= 0x7521;
    0x00051044 sltu v0, zero, v0             |             v0 = (0 < v0) ? 1 : 0;
    0x00051048 negu v0, v0                   |             __asm ("negu v0, v0");
                                             |         }
    0x0005104c lw a0, 0x2c(sp)               |         a0 = *(var_2ch);
    0x00051050 lw v1, (s1)                   |         v1 = *(s1);
    0x00051054 lw ra, 0x4c(sp)               |         ra = *(var_4ch);
                                             |         if (a0 != v1) {
    0x00051058 bne a0, v1, 0x511a4           |             goto label_12;
                                             |         }
    0x0005105c lw s5, 0x48(sp)               |         s5 = *(var_48h);
    0x00051060 lw s4, 0x44(sp)               |         s4 = *(var_44h);
    0x00051064 lw s3, 0x40(sp)               |         s3 = *(var_40h);
    0x00051068 lw s2, 0x3c(sp)               |         s2 = *(var_3ch);
    0x0005106c lw s1, 0x38(sp)               |         s1 = *(var_38h);
    0x00051070 lw s0, 0x34(sp)               |         s0 = *(var_34h);
    0x00051074 addiu sp, sp, 0x50            |         
    0x00051078 jr ra                         |         return v0;
                                             | label_11:
    0x0005107c sltiu v1, v1, 3               |         v1 = (v1 < 3) ? 1 : 0;
    0x00051080 lhu v0, 2(s0)                 |         v0 = *((s0 + 1));
    0x00051084 bnel v1, zero, 0x51034        |         
                                             |     } while (v1 == 0);
    0x00051088 lw v1, 8(s0)                  |     v1 = *((s0 + 2));
                                             | label_10:
    0x0005108c addiu a0, v1, -1              |     a0 = v1 + -1;
    0x00051090 sltiu a0, a0, 0x2000          |     a0 = (a0 < 0x2000) ? 1 : 0;
    0x00051094 sltiu a0, v1, 0x148           |     a0 = (v1 < aav.0x00000148) ? 1 : 0;
                                             |     if (a0 == 0) {
    0x00051098 beqz a0, 0x510dc              |         goto label_13;
                                             |     }
    0x0005109c sltiu a0, v0, 0xc             |     a0 = (v0 < 0xc) ? 1 : 0;
                                             |     if (a0 != 0) {
    0x000510a0 beqz a0, 0x510ac              |         
                                             |         if (s4 == 0) {
    0x000510a4 beql s4, zero, 0x510e0        |             goto label_14;
                                             |         }
    0x000510a8 lw a0, (s3)                   |         a0 = *(s3);
                                             |     }
    0x000510ac addiu a0, zero, 0xb           |     a0 = 0xb;
                                             |     if (a0 != 0) {
    0x000510b0 bnez a0, 0x51120              |         goto label_15;
                                             |     }
    0x000510b4 lw v0, 0x10(s0)               |     v0 = *((s0 + 4));
                                             | label_3:
    0x000510b8 lw a1, 0x14(s0)               |     a1 = *((s0 + 5));
    0x000510bc lw a0, 0x18(s0)               |     a0 = *((s0 + 6));
    0x000510c0 addu v0, v0, a1               |     v0 += a1;
    0x000510c4 sll v0, v0, 1                 |     v0 <<= 1;
    0x000510c8 addu v0, v0, a0               |     v0 += a0;
    0x000510cc sll v0, v0, 2                 |     v0 <<= 2;
    0x000510d0 sltu v0, v1, v0               |     v0 = (v1 < v0) ? 1 : 0;
                                             |     if (v0 == 0) {
    0x000510d4 beql v0, zero, 0x51034        |         goto label_0;
                                             |     }
    0x000510d8 lhu v0, 2(s0)                 |     v0 = *((s0 + 1));
                                             | label_13:
    0x000510dc lw a0, (s3)                   |     a0 = *(s3);
                                             | label_14:
    0x000510e0 lw t9, -0x7d20(gp)            |     t9 = sym.handle_invalid_sa_file;
    0x000510e4 addiu a3, zero, 0x4c          |     a3 = 0x4c;
    0x000510e8 move a2, s2                   |     a2 = s2;
    0x000510ec move a1, s0                   |     a1 = s0;
    0x000510f0 bal 0x4e780                   |     sym_handle_invalid_sa_file ();
                                             | label_6:
    0x000510f4 lhu v1, 2(s0)                 |     v1 = *((s0 + 1));
    0x000510f8 addiu a0, zero, 0x2175        |     a0 = 0x2175;
                                             |     if (v1 == a0) {
    0x000510fc beql v1, a0, 0x51014          |         goto label_1;
                                             |     }
    0x00051100 sw zero, (s5)                 |     *(s5) = 0;
    0x00051104 addiu a0, zero, 0x7521        |     a0 = 0x7521;
                                             |     if (v1 == a0) {
    0x00051108 beql v1, a0, 0x51014          |         goto label_1;
                                             |     }
    0x0005110c sw zero, (s5)                 |     *(s5) = 0;
                                             |     if (s4 == 0) {
    0x00051110 beql s4, zero, 0x50fc8        |         goto label_2;
                                             |     }
    0x00051114 lw a0, (s3)                   |     a0 = *(s3);
    0x00051118 sw zero, (s5)                 |     *(s5) = 0;
    0x0005111c b 0x51014                     |     goto label_1;
                                             | label_15:
    0x00051120 lhu v0, 2(s0)                 |     v0 = *((s0 + 1));
                                             |     if (v0 == a0) {
    0x00051124 bnel v0, a0, 0x51034          |         goto label_0;
                                             |     }
    0x00051128 lbu v0, 5(s0)                 |     v0 = *((s0 + 5));
    0x0005112c sltiu v0, v0, 7               |     v0 = (v0 < 7) ? 1 : 0;
    0x00051130 lhu v0, 2(s0)                 |     v0 = *((s0 + 1));
                                             |     if (v0 == 0) {
    0x00051134 bnel v0, zero, 0x51034        |         goto label_0;
                                             |     }
    0x00051138 lw v0, 0x10(s0)               |     v0 = *((s0 + 4));
    0x0005113c b 0x510b8                     |     goto label_3;
                                             | label_5:
    0x00051140 lw t9, -0x7bfc(gp)            |     t9 = sym.imp.__errno_location;
    0x00051144 lw s0, -0x7b6c(gp)            |     s0 = *((gp - 7899));
    0x00051148 jalr t9                       |     t9 ();
    0x0005114c nop                           |     
    0x00051150 lw gp, 0x18(sp)               |     gp = *(var_18h);
    0x00051154 lw s1, (v0)                   |     s1 = *(v0);
    0x00051158 lw s3, (s0)                   |     s3 = *(s0);
    0x0005115c lw t9, -0x7bc8(gp)            |     t9 = sym.imp.strerror;
    0x00051160 move a0, s1                   |     a0 = s1;
    0x00051164 jalr t9                       |     t9 ();
    0x00051168 lw gp, 0x18(sp)               |     gp = *(var_18h);
    0x0005116c sw v0, 0x10(sp)               |     *(var_10h) = v0;
    0x00051170 move a3, s2                   |     a3 = s2;
    0x00051174 lw a2, -0x7fdc(gp)            |     a2 = *(gp);
    0x00051178 lw t9, -0x7c44(gp)            |     t9 = sym.imp.__fprintf_chk
                                             |     /* str.Cannot_open__s:__s_n */
    0x0005117c addiu a2, a2, 0x3e40          |     a2 += 0x3e40;
    0x00051180 addiu a1, zero, 1             |     a1 = 1;
    0x00051184 move a0, s3                   |     a0 = s3;
    0x00051188 jalr t9                       |     t9 ();
    0x0005118c addiu v0, zero, 2             |     v0 = 2;
    0x00051190 lw gp, 0x18(sp)               |     gp = *(var_18h);
                                             |     if (s1 == v0) {
    0x00051194 beq s1, v0, 0x511b0           |         goto label_16;
                                             |     }
                                             | label_4:
    0x00051198 lw t9, -0x7bd0(gp)            |     t9 = sym.imp.exit;
                                             |     do {
    0x0005119c addiu a0, zero, 2             |         a0 = 2;
    0x000511a0 jalr t9                       |         t9 ();
                                             | label_12:
    0x000511a4 lw t9, -0x7b90(gp)            |         t9 = sym.imp.__stack_chk_fail;
    0x000511a8 jalr t9                       |         t9 ();
    0x000511ac nop                           |         
                                             | label_16:
    0x000511b0 lw v0, -0x7d48(gp)            |         v0 = *(gp);
    0x000511b4 lw v0, (v0)                   |         v0 = *(v0);
    0x000511b8 lw t9, -0x7bd0(gp)            |         t9 = sym.imp.exit;
    0x000511bc beqz v0, 0x5119c              |         
                                             |     } while (v0 == 0);
    0x000511c0 lw a0, -0x7fdc(gp)            |     a0 = *(gp);
    0x000511c4 lw t9, -0x7bb0(gp)            |     t9 = sym.imp.fwrite;
    0x000511c8 lw a3, (s0)                   |     a3 = *(s0);
    0x000511cc addiu a2, zero, 0x2b          |     a2 = 0x2b;
    0x000511d0 addiu a1, zero, 1             |     a1 = 1;
                                             |     /* str.Please_check_if_data_collecting_is_enabled_n */
    0x000511d4 addiu a0, a0, 0x3e54          |     a0 += 0x3e54;
    0x000511d8 jalr t9                       |     t9 ();
    0x000511dc lw gp, 0x18(sp)               |     gp = *(var_18h);
    0x000511e0 b 0x51198                     |     goto label_4;
                                             | }
    ; assembly                           | /* r2dec pseudo code output */
                                         | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0x55758 */
                                         | #include <stdint.h>
                                         |  
    ; (fcn) sym.sysstat_panic ()         | void sysstat_panic () {
    0x00055758 lui gp, 3                 |     
    0x0005575c addiu gp, gp, -0x6798     |     
    0x00055760 addu gp, gp, t9           |     gp += t9;
    0x00055764 lw v0, -0x7b6c(gp)        |     v0 = *((gp - 7899));
    0x00055768 addiu sp, sp, -0x28       |     
    0x0005576c lw a2, -0x7fdc(gp)        |     a2 = *(gp);
    0x00055770 lw t9, -0x7c44(gp)        |     t9 = sym.imp.__fprintf_chk
    0x00055774 move a3, a0               |     a3 = a0;
    0x00055778 lw a0, (v0)               |     a0 = *(v0);
                                         |     /* str.sysstat:__s__d_:_Internal_error..._n */
    0x0005577c addiu a2, a2, 0x42b4      |     a2 += 0x42b4;
    0x00055780 sw gp, 0x18(sp)           |     *(var_18h) = gp;
    0x00055784 sw a1, 0x10(sp)           |     *(var_10h) = a1;
    0x00055788 sw ra, 0x24(sp)           |     *(var_24h) = ra;
    0x0005578c addiu a1, zero, 1         |     a1 = 1;
    0x00055790 jalr t9                   |     t9 ();
    0x00055794 lw gp, 0x18(sp)           |     gp = *(var_18h);
    0x00055798 lw t9, -0x7bd0(gp)        |     t9 = sym.imp.exit;
    0x0005579c addiu a0, zero, 1         |     a0 = 1;
    0x000557a0 jalr t9                   |     t9 ();
    0x000557a4 lui gp, 3                 |     
    0x000557a8 addiu gp, gp, -0x67e4     |     
    0x000557ac addu gp, gp, t9           |     gp += t9;
    0x000557b0 addiu sp, sp, -0x30       |     
    0x000557b4 slti v0, a0, 2            |     v0 = (a0 < 2) ? 1 : 0;
    0x000557b8 sw gp, 0x10(sp)           |     *(var_10h_2) = gp;
    0x000557bc sw ra, 0x2c(sp)           |     *(var_2ch) = ra;
    0x000557c0 sw s3, 0x28(sp)           |     *(var_28h) = s3;
    0x000557c4 sw s2, 0x24(sp)           |     *(var_24h_2) = s2;
    0x000557c8 sw s1, 0x20(sp)           |     *(var_20h) = s1;
    0x000557cc sw s0, 0x1c(sp)           |     *(var_1ch) = s0;
    0x000557d0 sll s3, a0, 2             |     s3 = a0 << 2;
                                         |     if (v0 != 0) {
    0x000557d4 bnez v0, 0x55838          |         goto label_1;
                                         |     }
    0x000557d8 addiu s2, a1, 4           |     s2 = a1 + 4;
    0x000557dc addu s3, a1, s3           |     s3 = a1 + s3;
    0x000557e0 move s1, zero             |     s1 = 0;
    0x000557e4 b 0x557f4                 |     
                                         |     while (v0 == 0) {
    0x000557e8 addiu s2, s2, 4           |         s2 += 4;
                                         | label_0:
    0x000557ec lw ra, 0x2c(sp)           |         ra = *(var_2ch);
                                         |         if (s2 == s3) {
    0x000557f0 beq s2, s3, 0x55840       |             goto label_2;
                                         |         }
    0x000557f4 lw s0, (s2)               |         s0 = *(s2);
    0x000557f8 lw t9, -0x7be0(gp)        |         t9 = sym.imp.strchr;
    0x000557fc addiu a1, zero, 0x2c      |         a1 = 0x2c;
    0x00055800 move a0, s0               |         a0 = s0;
    0x00055804 jalr t9                   |         t9 ();
    0x00055808 lw gp, 0x10(sp)           |         gp = *(var_10h_2);
    0x0005580c beqz v0, 0x557e8          |         
                                         |     }
                                         |     do {
    0x00055810 lw t9, -0x7be0(gp)        |         t9 = sym.imp.strchr;
    0x00055814 addiu a0, s0, 1           |         a0 = s0 + 1;
    0x00055818 addiu a1, zero, 0x2c      |         a1 = 0x2c;
    0x0005581c jalr t9                   |         t9 ();
    0x00055820 move s0, v0               |         s0 = v0;
    0x00055824 lw gp, 0x10(sp)           |         gp = *(var_10h_2);
    0x00055828 addiu s1, s1, 1           |         s1++;
    0x0005582c bnez v0, 0x55810          |         
                                         |     } while (v0 != 0);
    0x00055830 addiu s2, s2, 4           |     s2 += 4;
    0x00055834 b 0x557ec                 |     goto label_0;
                                         | label_1:
    0x00055838 move s1, zero             |     s1 = 0;
    0x0005583c lw ra, 0x2c(sp)           |     ra = *(var_2ch);
                                         | label_2:
    0x00055840 move v0, s1               |     v0 = s1;
    0x00055844 lw s3, 0x28(sp)           |     s3 = *(var_28h);
    0x00055848 lw s2, 0x24(sp)           |     s2 = *(var_24h_2);
    0x0005584c lw s1, 0x20(sp)           |     s1 = *(var_20h);
    0x00055850 lw s0, 0x1c(sp)           |     s0 = *(var_1ch);
    0x00055854 addiu sp, sp, 0x30        |     
    0x00055858 jr ra                     |     return v0;
                                         | }
    ; assembly                               | /* r2dec pseudo code output */
                                             | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0x589a0 */
                                             | #include <stdint.h>
                                             |  
    ; (fcn) sym.transform_devmapname ()      | void transform_devmapname () {
    0x000589a0 lui gp, 2                     |     
    0x000589a4 addiu gp, gp, 0x6620          |     
    0x000589a8 addu gp, gp, t9               |     gp += t9;
    0x000589ac addiu sp, sp, -0x2e8          |     
    0x000589b0 lw t9, -0x7c64(gp)            |     t9 = sym.imp.opendir;
    0x000589b4 sw s6, 0x2d8(sp)              |     *(var_2d8h) = s6;
    0x000589b8 lw s6, -0x7b7c(gp)            |     s6 = *((gp - 7903));
    0x000589bc sw s1, 0x2c4(sp)              |     *(var_2c4h) = s1;
    0x000589c0 lw s1, -0x7fdc(gp)            |     s1 = *(gp);
    0x000589c4 lw v0, (s6)                   |     v0 = *(s6);
    0x000589c8 sw gp, 0x20(sp)               |     *(var_20h) = gp;
    0x000589cc sw s5, 0x2d4(sp)              |     *(var_2d4h) = s5;
    0x000589d0 sw s4, 0x2d0(sp)              |     *(var_2d0h) = s4;
    0x000589d4 sw ra, 0x2e4(sp)              |     *(var_2e4h) = ra;
    0x000589d8 sw fp, 0x2e0(sp)              |     *(var_2e0h) = fp;
    0x000589dc sw s7, 0x2dc(sp)              |     *(var_2dch) = s7;
    0x000589e0 sw s3, 0x2cc(sp)              |     *(var_2cch) = s3;
    0x000589e4 sw s2, 0x2c8(sp)              |     *(var_2c8h) = s2;
    0x000589e8 sw s0, 0x2c0(sp)              |     *(var_2c0h) = s0;
    0x000589ec move s5, a0                   |     s5 = a0;
    0x000589f0 sw v0, 0x2bc(sp)              |     *(var_2bch) = v0;
                                             |     /* str._dev_mapper */
    0x000589f4 addiu a0, s1, 0x4664          |     a0 = s1 + 0x4664;
    0x000589f8 move s4, a1                   |     s4 = a1;
    0x000589fc jalr t9                       |     t9 ();
    0x00058a00 lw gp, 0x20(sp)               |     gp = *(var_20h);
                                             |     if (v0 == 0) {
    0x00058a04 beqz v0, 0x58b34              |         goto label_12;
                                             |     }
    0x00058a08 lw s3, -0x7fdc(gp)            |     s3 = *(gp);
    0x00058a0c move s2, v0                   |     s2 = v0;
    0x00058a10 addiu s7, sp, 0xbc            |     s7 = sp + 0xbc;
                                             |     /* str._dev_mapper */
    0x00058a14 addiu s1, s1, 0x4664          |     s1 += 0x4664;
                                             |     /* esilref: '&s/&s' */
    0x00058a18 addiu s3, s3, 0x42d8          |     s3 += 0x42d8;
    0x00058a1c addiu fp, sp, 0x2c            |     fp = sp + 0x2c;
                                             |     do {
                                             | label_1:
    0x00058a20 lw t9, -0x7c2c(gp)            |         t9 = sym.imp.readdir;
                                             | label_0:
    0x00058a24 move a0, s2                   |         a0 = s2;
    0x00058a28 jalr t9                       |         t9 ();
    0x00058a2c lw gp, 0x20(sp)               |         gp = *(var_20h);
                                             |         if (v0 == 0) {
    0x00058a30 beqz v0, 0x58ad4              |             goto label_13;
                                             |         }
    0x00058a34 lw t9, -0x7b48(gp)            |         t9 = sym.imp.__snprintf_chk;
    0x00058a38 addiu s0, v0, 0xb             |         s0 = v0 + 0xb;
    0x00058a3c addiu a3, zero, 0x200         |         a3 = aav.0x00000200;
    0x00058a40 addiu a2, zero, 1             |         a2 = 1;
    0x00058a44 addiu a1, zero, 0x200         |         a1 = aav.0x00000200;
    0x00058a48 move a0, s7                   |         a0 = s7;
    0x00058a4c sw s0, 0x18(sp)               |         *(var_18h) = s0;
    0x00058a50 sw s1, 0x14(sp)               |         *(var_14h) = s1;
    0x00058a54 sw s3, 0x10(sp)               |         *(var_10h) = s3;
    0x00058a58 jalr t9                       |         t9 ();
    0x00058a5c lw gp, 0x20(sp)               |         gp = *(var_20h);
    0x00058a60 move a2, fp                   |         a2 = fp;
    0x00058a64 move a1, s7                   |         a1 = s7;
    0x00058a68 lw t9, -0x7ba8(gp)            |         t9 = sym.imp.__xstat;
    0x00058a6c addiu a0, zero, 3             |         a0 = 3;
    0x00058a70 sb zero, 0x2bb(sp)            |         *(var_2bbh) = 0;
    0x00058a74 jalr t9                       |         t9 ();
    0x00058a78 lw gp, 0x20(sp)               |         gp = *(var_20h);
    0x00058a7c bnez v0, 0x58a20              |         
                                             |     } while (v0 != 0);
    0x00058a80 lw v1, 0x50(sp)               |     v1 = *(var_50h);
    0x00058a84 addiu a1, zero, -0x100        |     a1 = -aav.0x00000100;
    0x00058a88 srl v0, v1, 0xc               |     v0 = v1 >> 0xc;
    0x00058a8c andi a0, v1, 0xff             |     a0 = v1 & 0xff;
    0x00058a90 and v0, v0, a1                |     v0 &= a1;
    0x00058a94 or v0, v0, a0                 |     v0 |= a0;
    0x00058a98 lw t9, -0x7c2c(gp)            |     t9 = sym.imp.readdir;
                                             |     if (s4 != v0) {
    0x00058a9c bne s4, v0, 0x58a24           |         goto label_0;
                                             |     }
    0x00058aa0 ext v1, v1, 8, 0xc            |     __asm ("ext v1, v1, 8, 0xc");
    0x00058aa4 lw t9, -0x7c00(gp)            |     t9 = sym.imp.strncpy;
                                             |     if (s5 != v1) {
    0x00058aa8 bne s5, v1, 0x58a20           |         goto label_1;
                                             |     }
    0x00058aac lw s1, -0x7d40(gp)            |     s1 = *((gp - 8016));
    0x00058ab0 addiu a0, s1, -0x3910         |     a0 = s1 + -0x3910;
    0x00058ab4 addiu s1, s1, -0x3910         |     s1 += -0x3910;
    0x00058ab8 move a1, s0                   |     a1 = s0;
    0x00058abc addiu a2, zero, 0x80          |     a2 = 0x80;
    0x00058ac0 jalr t9                       |     t9 ();
    0x00058ac4 move s0, s1                   |     s0 = s1;
    0x00058ac8 lw gp, 0x20(sp)               |     gp = *(var_20h);
    0x00058acc sb zero, 0x7f(s1)             |     *((s1 + 127)) = 0;
    0x00058ad0 b 0x58ad8                     |     goto label_14;
                                             | label_13:
    0x00058ad4 move s0, zero                 |     s0 = 0;
                                             | label_14:
    0x00058ad8 lw t9, -0x7c5c(gp)            |     t9 = sym.imp.closedir;
    0x00058adc move a0, s2                   |     a0 = s2;
    0x00058ae0 jalr t9                       |     t9 ();
    0x00058ae4 lw a0, 0x2bc(sp)              |     a0 = *(var_2bch);
    0x00058ae8 lw v1, (s6)                   |     v1 = *(s6);
    0x00058aec lw gp, 0x20(sp)               |     gp = *(var_20h);
    0x00058af0 move v0, s0                   |     v0 = s0;
                                             |     if (a0 == v1) {
    0x00058af4 bne a0, v1, 0x58b28           |         
    0x00058af8 lw ra, 0x2e4(sp)              |         ra = *(var_2e4h);
    0x00058afc lw fp, 0x2e0(sp)              |         fp = *(var_2e0h);
    0x00058b00 lw s7, 0x2dc(sp)              |         s7 = *(var_2dch);
    0x00058b04 lw s6, 0x2d8(sp)              |         s6 = *(var_2d8h);
    0x00058b08 lw s5, 0x2d4(sp)              |         s5 = *(var_2d4h);
    0x00058b0c lw s4, 0x2d0(sp)              |         s4 = *(var_2d0h);
    0x00058b10 lw s3, 0x2cc(sp)              |         s3 = *(var_2cch);
    0x00058b14 lw s2, 0x2c8(sp)              |         s2 = *(var_2c8h);
    0x00058b18 lw s1, 0x2c4(sp)              |         s1 = *(var_2c4h);
    0x00058b1c lw s0, 0x2c0(sp)              |         s0 = *(var_2c0h);
    0x00058b20 addiu sp, sp, 0x2e8           |         
    0x00058b24 jr ra                         |         return v0;
                                             |     }
    0x00058b28 lw t9, -0x7b90(gp)            |     t9 = sym.imp.__stack_chk_fail;
    0x00058b2c jalr t9                       |     t9 ();
    0x00058b30 nop                           |     
                                             | label_12:
    0x00058b34 lw v0, -0x7b6c(gp)            |     v0 = *((gp - 7899));
    0x00058b38 lw t9, -0x7bfc(gp)            |     t9 = sym.imp.__errno_location;
    0x00058b3c lw s0, (v0)                   |     s0 = *(v0);
    0x00058b40 jalr t9                       |     t9 ();
    0x00058b44 lw gp, 0x20(sp)               |     gp = *(var_20h);
    0x00058b48 lw t9, -0x7bc8(gp)            |     t9 = sym.imp.strerror;
    0x00058b4c lw a0, (v0)                   |     a0 = *(v0);
    0x00058b50 jalr t9                       |     t9 ();
    0x00058b54 lw gp, 0x20(sp)               |     gp = *(var_20h);
    0x00058b58 move a0, s0                   |     a0 = s0;
    0x00058b5c sw v0, 0x10(sp)               |     *(var_10h) = v0;
    0x00058b60 lw a2, -0x7fdc(gp)            |     a2 = *(gp);
    0x00058b64 lw t9, -0x7c44(gp)            |     t9 = sym.imp.__fprintf_chk
                                             |     /* str._dev_mapper */
    0x00058b68 addiu a3, s1, 0x4664          |     a3 = s1 + 0x4664;
                                             |     /* str.Cannot_open__s:__s_n */
    0x00058b6c addiu a2, a2, 0x3e40          |     a2 += 0x3e40;
    0x00058b70 addiu a1, zero, 1             |     a1 = 1;
    0x00058b74 jalr t9                       |     t9 ();
    0x00058b78 lw gp, 0x20(sp)               |     gp = *(var_20h);
    0x00058b7c lw t9, -0x7bd0(gp)            |     t9 = sym.imp.exit;
    0x00058b80 addiu a0, zero, 4             |     a0 = 4;
    0x00058b84 jalr t9                       |     t9 ();
    0x00058b88 nop                           |     
    0x00058b8c nop                           |     
    0x00058b90 move t0, a2                   |     t0 = a2;
    0x00058b94 move t1, a0                   |     t1 = a0;
    0x00058b98 move v0, a1                   |     v0 = a1;
                                             |     if (a3 != 0) {
    0x00058b9c bnez a3, 0x58d68              |         goto label_15;
                                             |     }
    0x00058ba0 sltu v1, a1, a2               |     v1 = (a1 < a2) ? 1 : 0;
    0x00058ba4 clz v1, a2                    |     __asm ("clz v1, a2");
                                             |     if (v1 != 0) {
    0x00058ba8 beqz v1, 0x58c88              |         
                                             |         if (v1 != 0) {
    0x00058bac beql v1, zero, 0x58bd0        |             
    0x00058bb0 srl a1, t0, 0x10              |             a1 = t0 >> 0x10;
    0x00058bb4 negu a0, v1                   |             __asm ("negu a0, v1");
    0x00058bb8 srlv a0, t1, a0               |             a0 = t1 >> a0;
    0x00058bbc sllv v0, a1, v1               |             v0 = a1 << v1;
    0x00058bc0 sllv t0, a2, v1               |             t0 = a2 << v1;
    0x00058bc4 or v0, a0, v0                 |             v0 = a0 | v0;
    0x00058bc8 sllv t1, t1, v1               |             t1 <<= v1;
    0x00058bcc srl a1, t0, 0x10              |             a1 = t0 >> 0x10;
                                             |         }
    0x00058bd0 divu zero, v0, a1             |         __asm ("divu zero, v0, a1");
    0x00058bd4 teq a1, zero, 7               |         __asm ("teq a1, zero, 7");
    0x00058bd8 andi a3, t0, 0xffff           |         a3 = t0 & 0xffff;
    0x00058bdc srl v1, t1, 0x10              |         v1 = t1 >> 0x10;
    0x00058be0 mflo v0                       |         __asm ("mflo v0");
    0x00058be4 mfhi a0                       |         __asm ("mfhi a0");
    0x00058be8 mul a2, a3, v0                |         __asm ("mul a2, a3, v0");
    0x00058bec sll a0, a0, 0x10              |         a0 <<= 0x10;
    0x00058bf0 or v1, a0, v1                 |         v1 = a0 | v1;
    0x00058bf4 sltu a0, v1, a2               |         a0 = (v1 < a2) ? 1 : 0;
                                             |         if (a0 != 0) {
    0x00058bf8 beql a0, zero, 0x58c28        |             
    0x00058bfc subu v1, v1, a2               |             __asm ("subu v1, v1, a2");
    0x00058c00 addu v1, v1, t0               |             v1 += t0;
    0x00058c04 sltu a0, v1, t0               |             a0 = (v1 < t0) ? 1 : 0;
    0x00058c08 addiu t2, v0, -1              |             t2 = v0 + -1;
                                             |             if (a0 != 0) {
    0x00058c0c bnez a0, 0x58f7c              |                 goto label_16;
                                             |             }
    0x00058c10 sltu a0, v1, a2               |             a0 = (v1 < a2) ? 1 : 0;
                                             |             if (a0 != 0) {
    0x00058c14 beql a0, zero, 0x58c24        |                 
    0x00058c18 move v0, t2                   |                 v0 = t2;
    0x00058c1c addiu v0, v0, -2              |                 v0 += -2;
    0x00058c20 addu v1, v1, t0               |                 v1 += t0;
                                             |             }
                                             | label_2:
    0x00058c24 subu v1, v1, a2               |             __asm ("subu v1, v1, a2");
                                             |         }
    0x00058c28 divu zero, v1, a1             |         __asm ("divu zero, v1, a1");
    0x00058c2c teq a1, zero, 7               |         __asm ("teq a1, zero, 7");
    0x00058c30 andi t1, t1, 0xffff           |         t1 &= 0xffff;
    0x00058c34 mflo v1                       |         __asm ("mflo v1");
    0x00058c38 mfhi a1                       |         __asm ("mfhi a1");
    0x00058c3c mul a3, a3, v1                |         __asm ("mul a3, a3, v1");
    0x00058c40 sll a1, a1, 0x10              |         a1 <<= 0x10;
    0x00058c44 or t1, a1, t1                 |         t1 = a1 | t1;
    0x00058c48 sltu a0, t1, a3               |         a0 = (t1 < a3) ? 1 : 0;
                                             |         if (a0 != 0) {
    0x00058c4c beql a0, zero, 0x58c78        |             
    0x00058c50 sll v0, v0, 0x10              |             v0 <<= 0x10;
    0x00058c54 addu t1, t0, t1               |             t1 = t0 + t1;
    0x00058c58 sltu a0, t1, t0               |             a0 = (t1 < t0) ? 1 : 0;
    0x00058c5c addiu a1, v1, -1              |             a1 = v1 + -1;
                                             |             if (a0 != 0) {
    0x00058c60 bnez a0, 0x58f94              |                 goto label_17;
                                             |             }
    0x00058c64 sltu t1, t1, a3               |             t1 = (t1 < a3) ? 1 : 0;
                                             |             if (t1 != 0) {
    0x00058c68 beql t1, zero, 0x58c74        |                 
    0x00058c6c move v1, a1                   |                 v1 = a1;
    0x00058c70 addiu v1, v1, -2              |                 v1 += -2;
                                             |             }
                                             | label_4:
    0x00058c74 sll v0, v0, 0x10              |             v0 <<= 0x10;
                                             |         }
    0x00058c78 or v0, v0, v1                 |         v0 |= v1;
    0x00058c7c move v1, zero                 |         v1 = 0;
                                             | label_5:
    0x00058c80 jr ra                         |         return v0;
    0x00058c84 nop                           |         
                                             |     }
    0x00058c88 clz t3, t0                    |     __asm ("clz t3, t0");
                                             |     if (a2 == 0) {
    0x00058c8c bnez a2, 0x58ca4              |         
    0x00058c90 addiu v0, zero, 1             |         v0 = 1;
    0x00058c94 divu zero, v0, a2             |         __asm ("divu zero, v0, a2");
    0x00058c98 teq a2, zero, 7               |         __asm ("teq a2, zero, 7");
    0x00058c9c mflo t0                       |         __asm ("mflo t0");
    0x00058ca0 clz t3, t0                    |         __asm ("clz t3, t0");
                                             |     }
    0x00058ca4 addiu t1, zero, 0x20          |     t1 = 0x20;
                                             |     if (t3 == 0) {
    0x00058ca8 bnel t3, zero, 0x58ea8        |         goto label_18;
                                             |     }
    0x00058cac subu a1, a1, t0               |     __asm ("subu a1, a1, t0");
    0x00058cb0 srl a2, t0, 0x10              |     a2 = t0 >> 0x10;
    0x00058cb4 andi t2, t0, 0xffff           |     t2 = t0 & 0xffff;
    0x00058cb8 addiu v1, zero, 1             |     v1 = 1;
                                             |     do {
    0x00058cbc divu zero, a1, a2             |         __asm ("divu zero, a1, a2");
    0x00058cc0 teq a2, zero, 7               |         __asm ("teq a2, zero, 7");
    0x00058cc4 srl v0, t1, 0x10              |         v0 = t1 >> 0x10;
    0x00058cc8 mflo a1                       |         __asm ("mflo a1");
    0x00058ccc mfhi a0                       |         __asm ("mfhi a0");
    0x00058cd0 mul a3, a1, t2                |         __asm ("mul a3, a1, t2");
    0x00058cd4 sll a0, a0, 0x10              |         a0 <<= 0x10;
    0x00058cd8 or v0, a0, v0                 |         v0 = a0 | v0;
    0x00058cdc sltu a0, v0, a3               |         a0 = (v0 < a3) ? 1 : 0;
                                             |         if (a0 != 0) {
    0x00058ce0 beql a0, zero, 0x58d0c        |             
    0x00058ce4 subu v0, v0, a3               |             __asm ("subu v0, v0, a3");
    0x00058ce8 addu v0, v0, t0               |             v0 += t0;
    0x00058cec sltu a0, v0, t0               |             a0 = (v0 < t0) ? 1 : 0;
    0x00058cf0 addiu t3, a1, -1              |             t3 = a1 + -1;
                                             |             if (a0 == 0) {
    0x00058cf4 bnez a0, 0x58d04              |                 
    0x00058cf8 sltu a0, v0, a3               |                 a0 = (v0 < a3) ? 1 : 0;
    0x00058cfc addiu a1, a1, -2              |                 a1 += -2;
                                             |                 if (a0 != 0) {
    0x00058d00 bnez a0, 0x58fdc              |                     goto label_19;
                                             |                 }
                                             |             }
    0x00058d04 move a1, t3                   |             a1 = t3;
                                             | label_11:
    0x00058d08 subu v0, v0, a3               |             __asm ("subu v0, v0, a3");
                                             |         }
    0x00058d0c divu zero, v0, a2             |         __asm ("divu zero, v0, a2");
    0x00058d10 teq a2, zero, 7               |         __asm ("teq a2, zero, 7");
    0x00058d14 andi t1, t1, 0xffff           |         t1 &= 0xffff;
    0x00058d18 mflo v0                       |         __asm ("mflo v0");
    0x00058d1c mfhi a2                       |         __asm ("mfhi a2");
    0x00058d20 mul t2, v0, t2                |         __asm ("mul t2, v0, t2");
    0x00058d24 sll a2, a2, 0x10              |         a2 <<= 0x10;
    0x00058d28 or a2, a2, t1                 |         a2 |= t1;
    0x00058d2c sltu a0, a2, t2               |         a0 = (a2 < t2) ? 1 : 0;
                                             |         if (a0 != 0) {
    0x00058d30 beql a0, zero, 0x58d5c        |             
    0x00058d34 sll a1, a1, 0x10              |             a1 <<= 0x10;
    0x00058d38 addu a2, t0, a2               |             a2 = t0 + a2;
    0x00058d3c sltu a0, a2, t0               |             a0 = (a2 < t0) ? 1 : 0;
    0x00058d40 addiu a3, v0, -1              |             a3 = v0 + -1;
                                             |             if (a0 != 0) {
    0x00058d44 bnez a0, 0x58f84              |                 goto label_20;
                                             |             }
    0x00058d48 sltu a2, a2, t2               |             a2 = (a2 < t2) ? 1 : 0;
                                             |             if (a2 == 0) {
    0x00058d4c beql a2, zero, 0x58f88        |                 goto label_21;
                                             |             }
    0x00058d50 move v0, a3                   |             v0 = a3;
    0x00058d54 addiu v0, v0, -2              |             v0 += -2;
    0x00058d58 sll a1, a1, 0x10              |             a1 <<= 0x10;
                                             |         }
    0x00058d5c or v0, a1, v0                 |         v0 = a1 | v0;
                                             | label_3:
    0x00058d60 jr ra                         |         return v0;
    0x00058d64 nop                           |         
                                             | label_15:
    0x00058d68 sltu v0, a1, a3               |         v0 = (a1 < a3) ? 1 : 0;
    0x00058d6c move v1, zero                 |         v1 = 0;
                                             |         if (v0 == 0) {
    0x00058d70 bnez v0, 0x58d9c              |             
    0x00058d74 clz v1, a3                    |             __asm ("clz v1, a3");
    0x00058d78 addiu t1, zero, 0x20          |             t1 = 0x20;
                                             |             if (v1 != 0) {
    0x00058d7c bnez v1, 0x58da8              |                 goto label_22;
                                             |             }
    0x00058d80 sltu a1, a3, a1               |             a1 = (a3 < a1) ? 1 : 0;
    0x00058d84 addiu v0, zero, 1             |             v0 = 1;
                                             |             if (a1 == 0) {
    0x00058d88 bnel a1, zero, 0x58fb4        |                 goto label_23;
                                             |             }
    0x00058d8c sltu v0, a0, a2               |             v0 = (a0 < a2) ? 1 : 0;
    0x00058d90 xori v0, v0, 1                |             v0 ^= 1;
    0x00058d94 jr ra                         |             return v0;
    0x00058d98 nop                           |             
                                             |         }
    0x00058d9c move v0, zero                 |         v0 = 0;
    0x00058da0 jr ra                         |         return v0;
    0x00058da4 nop                           |         
                                             | label_22:
    0x00058da8 subu t1, t1, v1               |         __asm ("subu t1, t1, v1");
    0x00058dac srlv v0, a2, t1               |         v0 = a2 >> t1;
    0x00058db0 sllv a3, a3, v1               |         a3 <<= v1;
    0x00058db4 or a3, v0, a3                 |         a3 = v0 | a3;
    0x00058db8 srlv t0, a1, t1               |         t0 = a1 >> t1;
    0x00058dbc srl v0, a3, 0x10              |         v0 = a3 >> 0x10;
    0x00058dc0 divu zero, t0, v0             |         __asm ("divu zero, t0, v0");
    0x00058dc4 teq v0, zero, 7               |         __asm ("teq v0, zero, 7");
    0x00058dc8 andi t3, a3, 0xffff           |         t3 = a3 & 0xffff;
    0x00058dcc srlv t1, a0, t1               |         t1 = a0 >> t1;
    0x00058dd0 sllv a1, a1, v1               |         a1 <<= v1;
    0x00058dd4 or a1, t1, a1                 |         a1 = t1 | a1;
    0x00058dd8 srl t1, a1, 0x10              |         t1 = a1 >> 0x10;
    0x00058ddc mflo t0                       |         __asm ("mflo t0");
    0x00058de0 mfhi t2                       |         __asm ("mfhi t2");
    0x00058de4 mul t4, t3, t0                |         __asm ("mul t4, t3, t0");
    0x00058de8 sll t2, t2, 0x10              |         t2 <<= 0x10;
    0x00058dec or t1, t2, t1                 |         t1 = t2 | t1;
    0x00058df0 sltu t2, t1, t4               |         t2 = (t1 < t4) ? 1 : 0;
    0x00058df4 sllv a2, a2, v1               |         a2 <<= v1;
                                             |         if (t2 != 0) {
    0x00058df8 beqz t2, 0x58e20              |             
    0x00058dfc addu t1, t1, a3               |             t1 += a3;
    0x00058e00 sltu t2, t1, a3               |             t2 = (t1 < a3) ? 1 : 0;
    0x00058e04 addiu t5, t0, -1              |             t5 = t0 + -1;
                                             |             if (t2 != 0) {
    0x00058e08 bnez t2, 0x58fd4              |                 goto label_24;
                                             |             }
    0x00058e0c sltu t2, t1, t4               |             t2 = (t1 < t4) ? 1 : 0;
                                             |             if (t2 == 0) {
    0x00058e10 beql t2, zero, 0x58e20        |                 goto label_10;
                                             |             }
    0x00058e14 move t0, t5                   |             t0 = t5;
    0x00058e18 addiu t0, t0, -2              |             t0 += -2;
    0x00058e1c addu t1, t1, a3               |             t1 += a3;
                                             |         }
                                             | label_10:
    0x00058e20 subu t1, t1, t4               |         __asm ("subu t1, t1, t4");
    0x00058e24 divu zero, t1, v0             |         __asm ("divu zero, t1, v0");
    0x00058e28 teq v0, zero, 7               |         __asm ("teq v0, zero, 7");
    0x00058e2c andi a1, a1, 0xffff           |         a1 &= 0xffff;
    0x00058e30 mflo t1                       |         __asm ("mflo t1");
    0x00058e34 mfhi v0                       |         __asm ("mfhi v0");
    0x00058e38 mul t2, t3, t1                |         __asm ("mul t2, t3, t1");
    0x00058e3c sll v0, v0, 0x10              |         v0 <<= 0x10;
    0x00058e40 or a1, v0, a1                 |         a1 = v0 | a1;
    0x00058e44 sltu v0, a1, t2               |         v0 = (a1 < t2) ? 1 : 0;
    0x00058e48 sll v0, t0, 0x10              |         v0 = t0 << 0x10;
                                             |         if (v0 != 0) {
    0x00058e4c beqz v0, 0x58e78              |             
    0x00058e50 addu a1, a1, a3               |             a1 += a3;
    0x00058e54 sltu v0, a1, a3               |             v0 = (a1 < a3) ? 1 : 0;
    0x00058e58 addiu t3, t1, -1              |             t3 = t1 + -1;
                                             |             if (v0 != 0) {
    0x00058e5c bnez v0, 0x58fc4              |                 goto label_25;
                                             |             }
    0x00058e60 sltu v0, a1, t2               |             v0 = (a1 < t2) ? 1 : 0;
                                             |             if (v0 != 0) {
    0x00058e64 beql v0, zero, 0x58e74        |                 
    0x00058e68 move t1, t3                   |                 t1 = t3;
    0x00058e6c addiu t1, t1, -2              |                 t1 += -2;
    0x00058e70 addu a1, a1, a3               |                 a1 += a3;
                                             |             }
                                             | label_8:
    0x00058e74 sll v0, t0, 0x10              |             v0 = t0 << 0x10;
                                             |         }
    0x00058e78 or v0, v0, t1                 |         v0 |= t1;
    0x00058e7c multu v0, a2                  |         __asm ("multu v0, a2");
    0x00058e80 mfhi a3                       |         __asm ("mfhi a3");
    0x00058e84 subu a1, a1, t2               |         __asm ("subu a1, a1, t2");
    0x00058e88 sltu t0, a1, a3               |         t0 = (a1 < a3) ? 1 : 0;
    0x00058e8c mflo a2                       |         __asm ("mflo a2");
                                             |         if (t0 != 0) {
    0x00058e90 bnez t0, 0x58fa8              |             goto label_26;
                                             |         }
                                             |         if (a1 == a3) {
    0x00058e94 beql a1, a3, 0x58f9c          |             goto label_27;
                                             |         }
    0x00058e98 sllv v1, a0, v1               |         v1 = a0 << v1;
    0x00058e9c move v1, zero                 |         v1 = 0;
                                             | label_6:
    0x00058ea0 jr ra                         |         return v0;
    0x00058ea4 nop                           |         
                                             | label_18:
    0x00058ea8 subu t1, t1, t3               |         __asm ("subu t1, t1, t3");
    0x00058eac sllv t0, t0, t3               |         t0 <<= t3;
    0x00058eb0 srlv v0, a1, t1               |         v0 = a1 >> t1;
    0x00058eb4 srl a2, t0, 0x10              |         a2 = t0 >> 0x10;
    0x00058eb8 divu zero, v0, a2             |         __asm ("divu zero, v0, a2");
    0x00058ebc teq a2, zero, 7               |         __asm ("teq a2, zero, 7");
    0x00058ec0 sllv a1, a1, t3               |         a1 <<= t3;
    0x00058ec4 srlv t1, a0, t1               |         t1 = a0 >> t1;
    0x00058ec8 andi t2, t0, 0xffff           |         t2 = t0 & 0xffff;
    0x00058ecc or a3, t1, a1                 |         a3 = t1 | a1;
    0x00058ed0 srl v1, a3, 0x10              |         v1 = a3 >> 0x10;
    0x00058ed4 mflo t4                       |         __asm ("mflo t4");
    0x00058ed8 mfhi v0                       |         __asm ("mfhi v0");
    0x00058edc mul a1, t2, t4                |         __asm ("mul a1, t2, t4");
    0x00058ee0 sll v0, v0, 0x10              |         v0 <<= 0x10;
    0x00058ee4 or v0, v0, v1                 |         v0 |= v1;
    0x00058ee8 sltu v1, v0, a1               |         v1 = (v0 < a1) ? 1 : 0;
    0x00058eec sllv t1, a0, t3               |         t1 = a0 << t3;
                                             |         if (v1 != 0) {
    0x00058ef0 beqz v1, 0x58f18              |             
    0x00058ef4 addu v0, v0, t0               |             v0 += t0;
    0x00058ef8 sltu v1, v0, t0               |             v1 = (v0 < t0) ? 1 : 0;
    0x00058efc addiu a0, t4, -1              |             a0 = t4 + -1;
                                             |             if (v1 != 0) {
    0x00058f00 bnez v1, 0x58fcc              |                 goto label_28;
                                             |             }
    0x00058f04 sltu v1, v0, a1               |             v1 = (v0 < a1) ? 1 : 0;
                                             |             if (v1 == 0) {
    0x00058f08 beql v1, zero, 0x58f18        |                 goto label_9;
                                             |             }
    0x00058f0c move t4, a0                   |             t4 = a0;
    0x00058f10 addiu t4, t4, -2              |             t4 += -2;
    0x00058f14 addu v0, v0, t0               |             v0 += t0;
                                             |         }
                                             | label_9:
    0x00058f18 subu a1, v0, a1               |         __asm ("subu a1, v0, a1");
    0x00058f1c divu zero, a1, a2             |         __asm ("divu zero, a1, a2");
    0x00058f20 teq a2, zero, 7               |         __asm ("teq a2, zero, 7");
    0x00058f24 andi a3, a3, 0xffff           |         a3 &= 0xffff;
    0x00058f28 mflo v1                       |         __asm ("mflo v1");
    0x00058f2c mfhi a1                       |         __asm ("mfhi a1");
    0x00058f30 mul a0, t2, v1                |         __asm ("mul a0, t2, v1");
    0x00058f34 sll a1, a1, 0x10              |         a1 <<= 0x10;
    0x00058f38 or a1, a1, a3                 |         a1 |= a3;
    0x00058f3c sltu v0, a1, a0               |         v0 = (a1 < a0) ? 1 : 0;
    0x00058f40 sll v0, t4, 0x10              |         v0 = t4 << 0x10;
                                             |         if (v0 != 0) {
    0x00058f44 beqz v0, 0x58f70              |             
    0x00058f48 addu a1, a1, t0               |             a1 += t0;
    0x00058f4c sltu v0, a1, t0               |             v0 = (a1 < t0) ? 1 : 0;
    0x00058f50 addiu a3, v1, -1              |             a3 = v1 + -1;
                                             |             if (v0 != 0) {
    0x00058f54 bnez v0, 0x58fbc              |                 goto label_29;
                                             |             }
    0x00058f58 sltu v0, a1, a0               |             v0 = (a1 < a0) ? 1 : 0;
                                             |             if (v0 != 0) {
    0x00058f5c beql v0, zero, 0x58f6c        |                 
    0x00058f60 move v1, a3                   |                 v1 = a3;
    0x00058f64 addiu v1, v1, -2              |                 v1 += -2;
    0x00058f68 addu a1, a1, t0               |                 a1 += t0;
                                             |             }
                                             | label_7:
    0x00058f6c sll v0, t4, 0x10              |             v0 = t4 << 0x10;
                                             |         }
    0x00058f70 subu a1, a1, a0               |         __asm ("subu a1, a1, a0");
    0x00058f74 or v1, v0, v1                 |         v1 = v0 | v1;
    0x00058f78 b 0x58cbc                     |         
                                             |     } while (1);
                                             | label_16:
    0x00058f7c move v0, t2                   |     v0 = t2;
    0x00058f80 b 0x58c24                     |     goto label_2;
                                             | label_20:
    0x00058f84 move v0, a3                   |     v0 = a3;
                                             | label_21:
    0x00058f88 sll a1, a1, 0x10              |     a1 <<= 0x10;
    0x00058f8c or v0, a1, v0                 |     v0 = a1 | v0;
    0x00058f90 b 0x58d60                     |     goto label_3;
                                             | label_17:
    0x00058f94 move v1, a1                   |     v1 = a1;
    0x00058f98 b 0x58c74                     |     goto label_4;
                                             | label_27:
    0x00058f9c sltu v1, v1, a2               |     v1 = (v1 < a2) ? 1 : 0;
                                             |     if (v1 == 0) {
    0x00058fa0 beqz v1, 0x58c80              |         goto label_5;
                                             |     }
    0x00058fa4 nop                           |     
                                             | label_26:
    0x00058fa8 addiu v0, v0, -1              |     v0 += -1;
    0x00058fac move v1, zero                 |     v1 = 0;
    0x00058fb0 b 0x58ea0                     |     goto label_6;
                                             | label_23:
    0x00058fb4 jr ra                         |     return v0;
    0x00058fb8 nop                           |     
                                             | label_29:
    0x00058fbc move v1, a3                   |     v1 = a3;
    0x00058fc0 b 0x58f6c                     |     goto label_7;
                                             | label_25:
    0x00058fc4 move t1, t3                   |     t1 = t3;
    0x00058fc8 b 0x58e74                     |     goto label_8;
                                             | label_28:
    0x00058fcc move t4, a0                   |     t4 = a0;
    0x00058fd0 b 0x58f18                     |     goto label_9;
                                             | label_24:
    0x00058fd4 move t0, t5                   |     t0 = t5;
    0x00058fd8 b 0x58e20                     |     goto label_10;
                                             | label_19:
    0x00058fdc addu v0, v0, t0               |     v0 += t0;
    0x00058fe0 b 0x58d08                     |     goto label_11;
                                             | }
    ; assembly                                       | /* r2dec pseudo code output */
                                                     | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0xd43c */
                                                     | #include <stdint.h>
                                                     |  
    ; (fcn) sym.upgrade_activity_section ()          | void upgrade_activity_section () {
    0x0000d43c lui gp, 7                             |     
    0x0000d440 addiu gp, gp, 0x1b84                  |     
    0x0000d444 addu gp, gp, t9                       |     gp += t9;
    0x0000d448 addiu sp, sp, -0x78                   |     
    0x0000d44c lw v0, -0x7b7c(gp)                    |     v0 = *((gp - 7903));
    0x0000d450 sw s3, 0x5c(sp)                       |     *(var_5ch) = s3;
    0x0000d454 lw s3, -0x7b6c(gp)                    |     s3 = *((gp - 7899));
    0x0000d458 sw s6, 0x68(sp)                       |     *(var_68h) = s6;
    0x0000d45c sw v0, 0x24(sp)                       |     *(var_24h) = v0;
    0x0000d460 move s6, a0                           |     s6 = a0;
    0x0000d464 lw v0, (v0)                           |     v0 = *(v0);
    0x0000d468 lw a0, -0x7fdc(gp)                    |     a0 = *(gp);
    0x0000d46c lw t9, -0x7bb0(gp)                    |     t9 = sym.imp.fwrite;
    0x0000d470 sw s5, 0x64(sp)                       |     *(var_64h) = s5;
    0x0000d474 sw s2, 0x58(sp)                       |     *(var_58h) = s2;
    0x0000d478 move s5, a3                           |     s5 = a3;
    0x0000d47c move s2, a2                           |     s2 = a2;
    0x0000d480 lw a3, (s3)                           |     a3 = *(s3);
    0x0000d484 sw gp, 0x10(sp)                       |     *(var_10h) = gp;
    0x0000d488 sw s7, 0x6c(sp)                       |     *(var_6ch) = s7;
    0x0000d48c sw s1, 0x54(sp)                       |     *(var_54h) = s1;
    0x0000d490 sw s0, 0x50(sp)                       |     *(var_50h) = s0;
    0x0000d494 sw ra, 0x74(sp)                       |     *(var_74h) = ra;
    0x0000d498 sw fp, 0x70(sp)                       |     *(var_70h) = fp;
    0x0000d49c sw s4, 0x60(sp)                       |     *(var_60h) = s4;
    0x0000d4a0 move s1, a1                           |     s1 = a1;
    0x0000d4a4 addiu a2, zero, 0xf                   |     a2 = 0xf;
    0x0000d4a8 addiu a1, zero, 1                     |     a1 = 1;
                                                     |     /* str.file_activity:_ */
    0x0000d4ac addiu a0, a0, -0x2104                 |     a0 += -0x2104;
    0x0000d4b0 sw v0, 0x4c(sp)                       |     *(var_4ch) = v0;
    0x0000d4b4 lw s0, 0x88(sp)                       |     s0 = *(arg_88h);
    0x0000d4b8 jalr t9                               |     t9 ();
    0x0000d4bc lw v0, 0x14(s2)                       |     v0 = *((s2 + 5));
    0x0000d4c0 lw gp, 0x10(sp)                       |     gp = *(var_10h);
    0x0000d4c4 sll a1, v0, 3                         |     a1 = v0 << 3;
    0x0000d4c8 addu a1, a1, v0                       |     a1 += v0;
    0x0000d4cc sll a1, a1, 2                         |     a1 <<= 2;
    0x0000d4d0 lw s7, (s0)                           |     s7 = *(s0);
                                                     |     if (a1 != 0) {
    0x0000d4d4 bnez a1, 0xd6f0                       |         goto label_4;
                                                     |     }
                                                     | label_3:
    0x0000d4d8 lw a0, -0x7fdc(gp)                    |     a0 = *(gp);
                                                     |     if (s7 == 0) {
    0x0000d4dc beqz s7, 0xd760                       |         goto label_5;
                                                     |     }
    0x0000d4e0 lw v1, 0x14(s2)                       |     v1 = *((s2 + 5));
                                                     | label_2:
    0x0000d4e4 lw v0, -0x7e88(gp)                    |     v0 = *(gp);
                                                     |     if (v1 == 0) {
    0x0000d4e8 beqz v1, 0xd62c                       |         goto label_6;
                                                     |     }
    0x0000d4ec lw s4, -0x7fdc(gp)                    |     s4 = *(gp);
    0x0000d4f0 sw v0, 0x20(sp)                       |     *(var_20h_2) = v0;
                                                     |     /* esilref: '&s ' */
    0x0000d4f4 addiu v0, s4, -0x2b70                 |     v0 = s4 + -0x2b70;
    0x0000d4f8 move s0, zero                         |     s0 = 0;
    0x0000d4fc addiu fp, sp, 0x28                    |     fp = sp + 0x28;
    0x0000d500 sw v0, 0x1c(sp)                       |     *(var_1ch_2) = v0;
                                                     | label_0:
    0x0000d504 lw t9, -0x7f80(gp)                    |     t9 = sym.get_activity_position;
    0x0000d508 lw a1, (s5)                           |     a1 = *(s5);
    0x0000d50c move a0, s1                           |     a0 = s1;
    0x0000d510 addiu a2, zero, 1                     |     a2 = 1;
    0x0000d514 jalr t9                               |     t9 ();
    0x0000d518 lw v1, (s5)                           |     v1 = *(s5);
    0x0000d51c lw gp, 0x10(sp)                       |     gp = *(var_10h);
    0x0000d520 sw v1, (s7)                           |     *(s7) = v1;
    0x0000d524 lw v1, 8(s5)                          |     v1 = *((s5 + 2));
    0x0000d528 sll v0, v0, 2                         |     v0 <<= 2;
    0x0000d52c addu s4, s1, v0                       |     s4 = s1 + v0;
    0x0000d530 sw v1, 8(s7)                          |     *((s7 + 2)) = v1;
    0x0000d534 lw a0, (s4)                           |     a0 = *(s4);
    0x0000d538 lw v1, 0xc(s5)                        |     v1 = *((s5 + 3));
    0x0000d53c move v0, s7                           |     v0 = s7;
    0x0000d540 sw v1, 0xc(s7)                        |     *((s7 + 3)) = v1;
    0x0000d544 lw a1, 8(a0)                          |     a1 = *((a0 + 2));
    0x0000d548 move v1, fp                           |     v1 = fp;
    0x0000d54c sw a1, 4(s7)                          |     *((s7 + 1)) = a1;
    0x0000d550 lw a1, 4(a0)                          |     a1 = *((a0 + 1));
    0x0000d554 addiu t4, s7, 0x20                    |     t4 = s7 + 0x20;
    0x0000d558 ext a1, a1, 2, 1                      |     __asm ("ext a1, a1, 2, 1");
    0x0000d55c sw a1, 0x10(s7)                       |     *((s7 + 4)) = a1;
    0x0000d560 lw a1, 0x8c(a0)                       |     a1 = *((a0 + 35));
    0x0000d564 sw a1, 0x14(s7)                       |     *((s7 + 5)) = a1;
    0x0000d568 lw a1, 0x54(a0)                       |     a1 = *((a0 + 21));
    0x0000d56c sw a1, 0x18(s7)                       |     *((s7 + 6)) = a1;
    0x0000d570 lw a1, 0x58(a0)                       |     a1 = *((a0 + 22));
    0x0000d574 sw a1, 0x1c(s7)                       |     *((s7 + 7)) = a1;
    0x0000d578 lw a0, 0x5c(a0)                       |     a0 = *((a0 + 23));
    0x0000d57c sw a0, 0x20(s7)                       |     *((s7 + 8)) = a0;
                                                     |     do {
    0x0000d580 lwl t3, 3(v0)                         |         __asm ("lwl t3, 3(v0)");
    0x0000d584 lwl a2, 7(v0)                         |         __asm ("lwl a2, 7(v0)");
    0x0000d588 lwl a1, 0xb(v0)                       |         __asm ("lwl a1, 0xb(v0)");
    0x0000d58c lwl a0, 0xf(v0)                       |         __asm ("lwl a0, 0xf(v0)");
    0x0000d590 lwr t3, (v0)                          |         __asm ("lwr t3, (v0)");
    0x0000d594 lwr a2, 4(v0)                         |         __asm ("lwr a2, 4(v0)");
    0x0000d598 lwr a1, 8(v0)                         |         __asm ("lwr a1, 8(v0)");
    0x0000d59c lwr a0, 0xc(v0)                       |         __asm ("lwr a0, 0xc(v0)");
    0x0000d5a0 addiu v0, v0, 0x10                    |         v0 += 0x10;
    0x0000d5a4 sw t3, (v1)                           |         *(v1) = t3;
    0x0000d5a8 sw a2, 4(v1)                          |         *(var_4h) = a2;
    0x0000d5ac sw a1, 8(v1)                          |         *(var_8h) = a1;
    0x0000d5b0 sw a0, 0xc(v1)                        |         *(var_ch) = a0;
    0x0000d5b4 addiu v1, v1, 0x10                    |         v1 += 0x10;
    0x0000d5b8 bne v0, t4, 0xd580                    |         
                                                     |     } while (v0 != t4);
    0x0000d5bc lwl a0, 3(v0)                         |     __asm ("lwl a0, 3(v0)");
    0x0000d5c0 lwr a0, (v0)                          |     __asm ("lwr a0, (v0)");
    0x0000d5c4 sw a0, (v1)                           |     *(v1) = a0;
    0x0000d5c8 lw v0, 0x8c(sp)                       |     v0 = *(arg_8ch);
    0x0000d5cc lw t9, -0x7e90(gp)                    |     t9 = sym.swap_struct;
                                                     |     if (v0 != 0) {
    0x0000d5d0 bnez v0, 0xd690                       |         goto label_7;
                                                     |     }
                                                     | label_1:
    0x0000d5d4 lw t9, -0x7e94(gp)                    |     t9 = sym.write_all;
    0x0000d5d8 addiu a2, zero, 0x24                  |     a2 = 0x24;
    0x0000d5dc move a1, fp                           |     a1 = fp;
    0x0000d5e0 move a0, s6                           |     a0 = s6;
    0x0000d5e4 jalr t9                               |     t9 ();
    0x0000d5e8 addiu v1, zero, 0x24                  |     v1 = 0x24;
    0x0000d5ec lw gp, 0x10(sp)                       |     gp = *(var_10h);
                                                     |     if (v0 != v1) {
    0x0000d5f0 bne v0, v1, 0xd6a8                    |         goto label_8;
                                                     |     }
    0x0000d5f4 lw v0, (s4)                           |     v0 = *(s4);
    0x0000d5f8 lw t9, -0x7c44(gp)                    |     t9 = sym.imp.__fprintf_chk
    0x0000d5fc lw a0, (s3)                           |     a0 = *(s3);
    0x0000d600 lw a3, 0x50(v0)                       |     a3 = *((v0 + 20));
    0x0000d604 lw a2, 0x1c(sp)                       |     a2 = *(var_1ch_2);
    0x0000d608 addiu a1, zero, 1                     |     a1 = 1;
    0x0000d60c jalr t9                               |     t9 ();
    0x0000d610 lw v0, 0x14(s2)                       |     v0 = *((s2 + 5));
    0x0000d614 addiu s0, s0, 1                       |     s0++;
    0x0000d618 sltu v0, s0, v0                       |     v0 = (s0 < v0) ? 1 : 0;
    0x0000d61c lw gp, 0x10(sp)                       |     gp = *(var_10h);
    0x0000d620 addiu s5, s5, 0x14                    |     s5 += 0x14;
    0x0000d624 addiu s7, s7, 0x24                    |     s7 += 0x24;
                                                     |     if (v0 != 0) {
    0x0000d628 bnez v0, 0xd504                       |         goto label_0;
                                                     |     }
                                                     | label_6:
    0x0000d62c lw a0, -0x7fdc(gp)                    |     a0 = *(gp);
    0x0000d630 lw t9, -0x7bb0(gp)                    |     t9 = sym.imp.fwrite;
    0x0000d634 lw a3, (s3)                           |     a3 = *(s3);
    0x0000d638 addiu a2, zero, 3                     |     a2 = 3;
    0x0000d63c addiu a1, zero, 1                     |     a1 = 1;
                                                     |     /* esilref: 'OK
' */
    0x0000d640 addiu a0, a0, -0x2180                 |     a0 += -0x2180;
    0x0000d644 jalr t9                               |     t9 ();
    0x0000d648 lw gp, 0x10(sp)                       |     gp = *(var_10h);
    0x0000d64c move v0, zero                         |     v0 = 0;
                                                     |     do {
    0x0000d650 lw v1, 0x24(sp)                       |         v1 = *(var_24h);
    0x0000d654 lw a0, 0x4c(sp)                       |         a0 = *(var_4ch);
    0x0000d658 lw v1, (v1)                           |         v1 = *(v1);
    0x0000d65c lw ra, 0x74(sp)                       |         ra = *(var_74h);
                                                     |         if (a0 != v1) {
    0x0000d660 bne a0, v1, 0xd788                    |             goto label_9;
                                                     |         }
    0x0000d664 lw fp, 0x70(sp)                       |         fp = *(var_70h);
    0x0000d668 lw s7, 0x6c(sp)                       |         s7 = *(var_6ch);
    0x0000d66c lw s6, 0x68(sp)                       |         s6 = *(var_68h);
    0x0000d670 lw s5, 0x64(sp)                       |         s5 = *(var_64h);
    0x0000d674 lw s4, 0x60(sp)                       |         s4 = *(var_60h);
    0x0000d678 lw s3, 0x5c(sp)                       |         s3 = *(var_5ch);
    0x0000d67c lw s2, 0x58(sp)                       |         s2 = *(var_58h);
    0x0000d680 lw s1, 0x54(sp)                       |         s1 = *(var_54h);
    0x0000d684 lw s0, 0x50(sp)                       |         s0 = *(var_50h);
    0x0000d688 addiu sp, sp, 0x78                    |         
    0x0000d68c jr ra                                 |         return v1;
                                                     | label_7:
    0x0000d690 lw a2, 0x90(sp)                       |         a2 = *(arg_90h);
    0x0000d694 lw a0, 0x20(sp)                       |         a0 = *(var_20h_2);
    0x0000d698 move a1, fp                           |         a1 = fp;
    0x0000d69c jalr t9                               |         t9 ();
    0x0000d6a0 lw gp, 0x10(sp)                       |         gp = *(var_10h);
    0x0000d6a4 b 0xd5d4                              |         goto label_1;
                                                     | label_8:
    0x0000d6a8 lw t9, -0x7bfc(gp)                    |         t9 = sym.imp.__errno_location;
    0x0000d6ac lw s0, (s3)                           |         s0 = *(s3);
    0x0000d6b0 jalr t9                               |         t9 ();
    0x0000d6b4 lw gp, 0x10(sp)                       |         gp = *(var_10h);
    0x0000d6b8 lw t9, -0x7bc8(gp)                    |         t9 = sym.imp.strerror;
    0x0000d6bc lw a0, (v0)                           |         a0 = *(v0);
    0x0000d6c0 jalr t9                               |         t9 ();
    0x0000d6c4 lw gp, 0x10(sp)                       |         gp = *(var_10h);
    0x0000d6c8 move a3, v0                           |         a3 = v0;
    0x0000d6cc addiu a1, zero, 1                     |         a1 = 1;
    0x0000d6d0 lw a2, -0x7fdc(gp)                    |         a2 = *(gp);
    0x0000d6d4 lw t9, -0x7c44(gp)                    |         t9 = sym.imp.__fprintf_chk
                                                     |         /* str._nwrite:__s_n */
    0x0000d6d8 addiu a2, a2, -0x218c                 |         a2 += -0x218c;
    0x0000d6dc move a0, s0                           |         a0 = s0;
    0x0000d6e0 jalr t9                               |         t9 ();
    0x0000d6e4 lw gp, 0x10(sp)                       |         gp = *(var_10h);
    0x0000d6e8 addiu v0, zero, -1                    |         v0 = -1;
    0x0000d6ec b 0xd650                              |         
                                                     |     } while (1);
                                                     | label_4:
    0x0000d6f0 lw t9, -0x7bbc(gp)                    |     t9 = sym.imp.realloc;
    0x0000d6f4 move a0, s7                           |     a0 = s7;
    0x0000d6f8 jalr t9                               |     t9 ();
    0x0000d6fc lw gp, 0x10(sp)                       |     gp = *(var_10h);
    0x0000d700 sw v0, (s0)                           |     *(s0) = v0;
                                                     |     if (v0 != 0) {
    0x0000d704 beqz v0, 0xd740                       |         
    0x0000d708 lw v1, 0x14(s2)                       |         v1 = *((s2 + 5));
                                                     |         if (s7 != 0) {
    0x0000d70c beqz s7, 0xd718                       |             
    0x0000d710 move s7, v0                           |             s7 = v0;
    0x0000d714 b 0xd4e4                              |             goto label_2;
                                                     |         }
    0x0000d718 sll a0, v1, 3                         |         a0 = v1 << 3;
    0x0000d71c addu v1, a0, v1                       |         v1 = a0 + v1;
    0x0000d720 lw t9, -0x7bf4(gp)                    |         t9 = sym.imp.memset;
    0x0000d724 sll a2, v1, 2                         |         a2 = v1 << 2;
    0x0000d728 move a1, zero                         |         a1 = 0;
    0x0000d72c move a0, v0                           |         a0 = v0;
    0x0000d730 jalr t9                               |         t9 ();
    0x0000d734 lw gp, 0x10(sp)                       |         gp = *(var_10h);
    0x0000d738 lw s7, (s0)                           |         s7 = *(s0);
    0x0000d73c b 0xd4d8                              |         goto label_3;
                                                     |     }
    0x0000d740 lw a0, -0x7fdc(gp)                    |     a0 = *(gp);
    0x0000d744 lw t9, -0x7bac(gp)                    |     t9 = sym.imp.perror;
                                                     |     /* str.realloc */
    0x0000d748 addiu a0, a0, -0x2160                 |     a0 += -0x2160;
    0x0000d74c jalr t9                               |     t9 ();
    0x0000d750 lw gp, 0x10(sp)                       |     gp = *(var_10h);
    0x0000d754 lw t9, -0x7bd0(gp)                    |     t9 = sym.imp.exit;
    0x0000d758 addiu a0, zero, 4                     |     a0 = 4;
    0x0000d75c jalr t9                               |     t9 ();
                                                     | label_5:
    0x0000d760 lw t9, -0x7bb0(gp)                    |     t9 = sym.imp.fwrite;
    0x0000d764 lw a3, (s3)                           |     a3 = *(s3);
    0x0000d768 addiu a0, a0, -0x216c                 |     a0 += -0x216c;
    0x0000d76c addiu a2, zero, 9                     |     a2 = 9;
    0x0000d770 addiu a1, zero, 1                     |     a1 = 1;
    0x0000d774 jalr t9                               |     t9 ();
    0x0000d778 lw gp, 0x10(sp)                       |     gp = *(var_10h);
    0x0000d77c lw t9, -0x7bd0(gp)                    |     t9 = sym.imp.exit;
    0x0000d780 addiu a0, zero, 4                     |     a0 = 4;
    0x0000d784 jalr t9                               |     t9 ();
                                                     | label_9:
    0x0000d788 lw t9, -0x7b90(gp)                    |     t9 = sym.imp.__stack_chk_fail;
    0x0000d78c jalr t9                               |     t9 ();
    0x0000d790 nop                                   |     
                                                     | }
    ; assembly                                   | /* r2dec pseudo code output */
                                                 | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0xd914 */
                                                 | #include <stdint.h>
                                                 |  
    ; (fcn) sym.upgrade_comment_record ()        | void upgrade_comment_record () {
    0x0000d914 lui gp, 7                         |     
    0x0000d918 addiu gp, gp, 0x16ac              |     
    0x0000d91c addu gp, gp, t9                   |     gp += t9;
    0x0000d920 addiu sp, sp, -0x78               |     
    0x0000d924 lw t9, -0x7e80(gp)                |     t9 = sym.sa_fread;
    0x0000d928 sw s1, 0x6c(sp)                   |     *(var_6ch) = s1;
    0x0000d92c lw s1, -0x7b7c(gp)                |     s1 = *((gp - 7903));
    0x0000d930 sw s0, 0x68(sp)                   |     *(var_68h) = s0;
    0x0000d934 addiu s0, sp, 0x24                |     s0 = sp + 0x24;
    0x0000d938 lw v0, (s1)                       |     v0 = *(s1);
    0x0000d93c sw gp, 0x18(sp)                   |     *(var_18h) = gp;
    0x0000d940 sw ra, 0x74(sp)                   |     *(var_74h) = ra;
    0x0000d944 sw s2, 0x70(sp)                   |     *(var_70h) = s2;
    0x0000d948 addiu a3, zero, 1                 |     a3 = 1;
    0x0000d94c move s2, a1                       |     s2 = a1;
    0x0000d950 addiu a2, zero, 0x40              |     a2 = 0x40;
    0x0000d954 move a1, s0                       |     a1 = s0;
    0x0000d958 sw zero, 0x10(sp)                 |     *(var_10h) = 0;
    0x0000d95c sw v0, 0x64(sp)                   |     *(var_64h) = v0;
    0x0000d960 jalr t9                           |     t9 ();
    0x0000d964 nop                               |     
    0x0000d968 lw gp, 0x18(sp)                   |     gp = *(var_18h);
    0x0000d96c addiu a2, zero, 0x40              |     a2 = 0x40;
    0x0000d970 move a1, s0                       |     a1 = s0;
    0x0000d974 lw t9, -0x7e94(gp)                |     t9 = sym.write_all;
    0x0000d978 move a0, s2                       |     a0 = s2;
    0x0000d97c sb zero, 0x63(sp)                 |     *(var_63h) = 0;
    0x0000d980 jalr t9                           |     t9 ();
    0x0000d984 addiu v1, zero, 0x40              |     v1 = 0x40;
    0x0000d988 lw gp, 0x18(sp)                   |     gp = *(var_18h);
                                                 |     if (v0 != v1) {
    0x0000d98c bne v0, v1, 0xd9d0                |         goto label_0;
                                                 |     }
    0x0000d990 lw v0, -0x7b6c(gp)                |     v0 = *((gp - 7899));
    0x0000d994 lw t9, -0x7c34(gp)                |     t9 = sym.imp.fputc;
    0x0000d998 addiu a0, zero, 0x43              |     a0 = 0x43;
    0x0000d99c lw a1, (v0)                       |     a1 = *(v0);
    0x0000d9a0 jalr t9                           |     t9 ();
    0x0000d9a4 lw gp, 0x18(sp)                   |     gp = *(var_18h);
    0x0000d9a8 move v0, zero                     |     v0 = 0;
                                                 |     do {
    0x0000d9ac lw a0, 0x64(sp)                   |         a0 = *(var_64h);
    0x0000d9b0 lw v1, (s1)                       |         v1 = *(s1);
    0x0000d9b4 lw ra, 0x74(sp)                   |         ra = *(var_74h);
                                                 |         if (a0 != v1) {
    0x0000d9b8 bne a0, v1, 0xda1c                |             goto label_1;
                                                 |         }
    0x0000d9bc lw s2, 0x70(sp)                   |         s2 = *(var_70h);
    0x0000d9c0 lw s1, 0x6c(sp)                   |         s1 = *(var_6ch);
    0x0000d9c4 lw s0, 0x68(sp)                   |         s0 = *(var_68h);
    0x0000d9c8 addiu sp, sp, 0x78                |         
    0x0000d9cc jr ra                             |         return v0;
                                                 | label_0:
    0x0000d9d0 lw v0, -0x7b6c(gp)                |         v0 = *((gp - 7899));
    0x0000d9d4 lw t9, -0x7bfc(gp)                |         t9 = sym.imp.__errno_location;
    0x0000d9d8 lw s0, (v0)                       |         s0 = *(v0);
    0x0000d9dc jalr t9                           |         t9 ();
    0x0000d9e0 lw gp, 0x18(sp)                   |         gp = *(var_18h);
    0x0000d9e4 lw t9, -0x7bc8(gp)                |         t9 = sym.imp.strerror;
    0x0000d9e8 lw a0, (v0)                       |         a0 = *(v0);
    0x0000d9ec jalr t9                           |         t9 ();
    0x0000d9f0 lw gp, 0x18(sp)                   |         gp = *(var_18h);
    0x0000d9f4 move a3, v0                       |         a3 = v0;
    0x0000d9f8 addiu a1, zero, 1                 |         a1 = 1;
    0x0000d9fc lw a2, -0x7fdc(gp)                |         a2 = *(gp);
    0x0000da00 lw t9, -0x7c44(gp)                |         t9 = sym.imp.__fprintf_chk
                                                 |         /* str._nwrite:__s_n */
    0x0000da04 addiu a2, a2, -0x218c             |         a2 += -0x218c;
    0x0000da08 move a0, s0                       |         a0 = s0;
    0x0000da0c jalr t9                           |         t9 ();
    0x0000da10 lw gp, 0x18(sp)                   |         gp = *(var_18h);
    0x0000da14 addiu v0, zero, -1                |         v0 = -1;
    0x0000da18 b 0xd9ac                          |         
                                                 |     } while (1);
                                                 | label_1:
    0x0000da1c lw t9, -0x7b90(gp)                |     t9 = sym.imp.__stack_chk_fail;
    0x0000da20 jalr t9                           |     t9 ();
    0x0000da24 nop                               |     
                                                 | }
    ; assembly                                   | /* r2dec pseudo code output */
                                                 | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0xdc40 */
                                                 | #include <stdint.h>
                                                 |  
    ; (fcn) sym.upgrade_common_record ()         | void upgrade_common_record () {
    0x0000dc40 lui gp, 7                         |     
    0x0000dc44 addiu gp, gp, 0x1380              |     
    0x0000dc48 addu gp, gp, t9                   |     gp += t9;
    0x0000dc4c lw v0, -0x7b7c(gp)                |     v0 = *((gp - 7903));
    0x0000dc50 addiu sp, sp, -0x70               |     
    0x0000dc54 lw v1, (v0)                       |     v1 = *(v0);
    0x0000dc58 sw v0, 0x28(sp)                   |     *(var_28h) = v0;
    0x0000dc5c lw v0, 0x14(a3)                   |     v0 = *((a3 + 5));
    0x0000dc60 sw gp, 0x18(sp)                   |     *(var_18h_2) = gp;
    0x0000dc64 sw s5, 0x5c(sp)                   |     *(var_5ch_2) = s5;
    0x0000dc68 sw s1, 0x4c(sp)                   |     *(var_4ch_2) = s1;
    0x0000dc6c sw ra, 0x6c(sp)                   |     *(var_6ch) = ra;
    0x0000dc70 sw fp, 0x68(sp)                   |     *(var_68h) = fp;
    0x0000dc74 sw s7, 0x64(sp)                   |     *(var_64h_2) = s7;
    0x0000dc78 sw s6, 0x60(sp)                   |     *(var_60h_2) = s6;
    0x0000dc7c sw s4, 0x58(sp)                   |     *(var_58h_2) = s4;
    0x0000dc80 sw s3, 0x54(sp)                   |     *(var_54h_2) = s3;
    0x0000dc84 sw s2, 0x50(sp)                   |     *(var_50h_2) = s2;
    0x0000dc88 sw s0, 0x48(sp)                   |     *(var_48h_2) = s0;
    0x0000dc8c sw a3, 0x3c(sp)                   |     *(var_3ch_2) = a3;
    0x0000dc90 sw a2, 0x24(sp)                   |     *(var_24h_2) = a2;
    0x0000dc94 lw s5, 0x80(sp)                   |     s5 = *(var_80h);
    0x0000dc98 lw s1, 0x84(sp)                   |     s1 = *(var_84h);
    0x0000dc9c sw v1, 0x44(sp)                   |     *(var_44h_2) = v1;
    0x0000dca0 move v0, zero                     |     v0 = 0;
                                                 |     if (v0 == 0) {
    0x0000dca4 beqz v0, 0xdf08                   |         goto label_3;
                                                 |     }
    0x0000dca8 lw v0, -0x7b6c(gp)                |     v0 = *((gp - 7899));
    0x0000dcac move s6, a0                       |     s6 = a0;
    0x0000dcb0 sw v0, 0x20(sp)                   |     *(var_e0h) = v0;
    0x0000dcb4 lw v0, -0x7fdc(gp)                |     v0 = *(gp);
    0x0000dcb8 move s2, a1                       |     s2 = a1;
    0x0000dcbc addiu v0, v0, -0x1fb8             |     v0 += -0x1fb8;
    0x0000dcc0 sw v0, 0x30(sp)                   |     *(var_30h_2) = v0;
    0x0000dcc4 lw v0, -0x7fdc(gp)                |     v0 = *(gp);
    0x0000dcc8 sw zero, 0x34(sp)                 |     *(var_34h_2) = 0;
    0x0000dccc addiu v0, v0, -0x2050             |     v0 += -0x2050;
    0x0000dcd0 addiu fp, sp, 0x40                |     fp = sp + 0x40;
    0x0000dcd4 sw v0, 0x2c(sp)                   |     *(var_2ch) = v0;
                                                 | label_2:
    0x0000dcd8 lw s3, 0x24(sp)                   |     s3 = *(var_24h_2);
    0x0000dcdc lw t9, -0x7f80(gp)                |     t9 = sym.get_activity_position;
    0x0000dce0 lw a1, (s1)                       |     a1 = *(s1);
    0x0000dce4 move a0, s3                       |     a0 = s3;
    0x0000dce8 addiu a2, zero, 1                 |     a2 = 1;
    0x0000dcec jalr t9                           |     t9 ();
    0x0000dcf0 sll s0, v0, 2                     |     s0 = v0 << 2;
    0x0000dcf4 addu s0, s3, s0                   |     s0 = s3 + s0;
    0x0000dcf8 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
    0x0000dcfc lw v1, (s0)                       |     v1 = *(s0);
    0x0000dd00 lw s3, 0x70(v1)                   |     s3 = *((v1 + 28));
    0x0000dd04 move s7, v0                       |     s7 = v0;
                                                 |     if (s3 <= 0) {
    0x0000dd08 blez s3, 0xdf9c                   |         goto label_12;
                                                 |     }
    0x0000dd0c addiu a0, zero, 1                 |     a0 = 1;
    0x0000dd10 lw v0, 0x74(v1)                   |     v0 = *((v1 + 29));
    0x0000dd14 lw a2, 0x10(s5)                   |     a2 = *((s5 + 4));
                                                 |     if (s3 == a0) {
    0x0000dd18 beq s3, a0, 0xdd90                |         goto label_13;
                                                 |     }
    0x0000dd1c lw a0, 0x90(v1)                   |     a0 = *((v1 + 36));
    0x0000dd20 slt a0, a2, a0                    |     a0 = (a2 < a0) ? 1 : 0;
    0x0000dd24 move s4, zero                     |     s4 = 0;
                                                 |     if (a0 != 0) {
    0x0000dd28 bnez a0, 0xe04c                   |         goto label_10;
                                                 |     }
    0x0000dd2c mul s3, s3, v0                    |     __asm ("mul s3, s3, v0");
                                                 |     do {
                                                 | label_0:
    0x0000dd30 lw a1, 0x98(v1)                   |         a1 = *((v1 + 38));
    0x0000dd34 lw t9, -0x7e80(gp)                |         t9 = sym.sa_fread;
    0x0000dd38 sw zero, 0x10(sp)                 |         *(var_d0h) = 0;
    0x0000dd3c addiu a3, zero, 1                 |         a3 = 1;
    0x0000dd40 mul a2, s3, a2                    |         __asm ("mul a2, s3, a2");
    0x0000dd44 move a0, s6                       |         a0 = s6;
    0x0000dd48 jalr t9                           |         t9 ();
    0x0000dd4c lw v1, (s0)                       |         v1 = *(s0);
    0x0000dd50 lw gp, 0x18(sp)                   |         gp = *(var_18h_2);
    0x0000dd54 lw s3, 0x70(v1)                   |         s3 = *((v1 + 28));
    0x0000dd58 lw a2, 4(s5)                      |         a2 = *((s5 + 1));
                                                 | label_9:
    0x0000dd5c lw v0, 8(v1)                      |         v0 = *((v1 + 2));
    0x0000dd60 sltu v0, a2, v0                   |         v0 = (a2 < v0) ? 1 : 0;
                                                 |         if (v0 == 0) {
    0x0000dd64 beqz v0, 0xdfcc                   |             goto label_14;
                                                 |         }
    0x0000dd68 nop                               |         
    0x0000dd6c lw v0, (s1)                       |         v0 = *(s1);
                                                 | label_4:
    0x0000dd70 sltiu v1, v0, 0x26                |         v1 = (v0 < 0x26) ? 1 : 0;
    0x0000dd74 lw v1, 0x2c(sp)                   |         v1 = *(var_2ch);
                                                 |         if (v1 == 0) {
    0x0000dd78 beqz v1, 0xddcc                   |             goto label_15;
                                                 |         }
    0x0000dd7c sll v0, v0, 2                     |         v0 <<= 2;
    0x0000dd80 lwx v0, v0(v1)                    |         __asm ("lwx v0, v0(v1)");
    0x0000dd84 addu v0, v0, gp                   |         v0 += gp;
    0x0000dd88 jr v0                             |         v0 ();
    0x0000dd8c nop                               |         
                                                 | label_13:
    0x0000dd90 slti a0, v0, 2                    |         a0 = (v0 < 2) ? 1 : 0;
    0x0000dd94 mul s3, s3, v0                    |         __asm ("mul s3, s3, v0");
    0x0000dd98 bnel a0, zero, 0xdd30             |         
                                                 |     } while (a0 == 0);
    0x0000dd9c lw a0, 0x90(v1)                   |     a0 = *((v1 + 36));
    0x0000dda0 slt a0, a2, a0                    |     a0 = (a2 < a0) ? 1 : 0;
                                                 |     if (a0 == 0) {
    0x0000dda4 beql a0, zero, 0xdd30             |         goto label_0;
                                                 |     }
    0x0000dda8 mul s3, s3, v0                    |     __asm ("mul s3, s3, v0");
    0x0000ddac move s4, zero                     |     s4 = 0;
    0x0000ddb0 b 0xe04c                          |     goto label_10;
                                                 | label_15:
    0x0000ddcc lw v0, 0x10(s1)                   |     v0 = *((s1 + 4));
    0x0000ddd0 addiu v0, zero, 0x75              |     v0 = 0x75;
                                                 |     if (v0 == 0) {
    0x0000ddd4 beqz v0, 0xdfc4                   |         goto label_16;
                                                 |     }
    0x0000ddd8 sw v0, 0x38(sp)                   |     *(var_38h_2) = v0;
                                                 | label_8:
    0x0000dddc lw v0, (s1)                       |     v0 = *(s1);
    0x0000dde0 addiu v0, v0, -0xb                |     v0 += -0xb;
    0x0000dde4 sltiu v1, v0, 0x1c                |     v1 = (v0 < 0x1c) ? 1 : 0;
    0x0000dde8 lw v1, 0x30(sp)                   |     v1 = *(var_30h_2);
                                                 |     if (v1 != 0) {
    0x0000ddec beqz v1, 0xde08                   |         
    0x0000ddf0 sll v0, v0, 2                     |         v0 <<= 2;
    0x0000ddf4 lwx v0, v0(v1)                    |         __asm ("lwx v0, v0(v1)");
    0x0000ddf8 addu v0, v0, gp                   |         v0 += gp;
    0x0000ddfc jr v0                             |         v0 ();
    0x0000de00 nop                               |         
                                                 |     }
    0x0000de08 lw v0, 0x88(sp)                   |     v0 = *(var_18h);
    0x0000de0c move v0, s3                       |     v0 = s3;
                                                 |     if (v0 != 0) {
    0x0000de10 beqz v0, 0xde1c                   |         
    0x0000de14 wsbh v0, s3                       |         __asm ("wsbh v0, s3");
    0x0000de18 rotr v0, v0, 0x10                 |         __asm ("rotr v0, v0, 0x10");
                                                 |     }
    0x0000de1c lw t9, -0x7e94(gp)                |     t9 = sym.write_all;
    0x0000de20 addiu a2, zero, 4                 |     a2 = 4;
    0x0000de24 move a1, fp                       |     a1 = fp;
    0x0000de28 move a0, s2                       |     a0 = s2;
    0x0000de2c sw v0, 0x40(sp)                   |     *(var_40h_3) = v0;
    0x0000de30 jalr t9                           |     t9 ();
    0x0000de34 addiu v1, zero, 4                 |     v1 = 4;
    0x0000de38 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
                                                 |     if (v0 != v1) {
    0x0000de3c bne v0, v1, 0xdec0                |         goto label_17;
                                                 |     }
    0x0000de40 lw v0, 0x20(sp)                   |     v0 = *(var_e0h);
    0x0000de44 lw t9, -0x7c34(gp)                |     t9 = sym.imp.fputc;
    0x0000de48 addiu a0, zero, 0x6e              |     a0 = 0x6e;
    0x0000de4c lw a1, (v0)                       |     a1 = *(v0);
    0x0000de50 jalr t9                           |     t9 ();
    0x0000de54 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
                                                 | label_6:
    0x0000de58 lw a0, 0x38(sp)                   |     a0 = *(var_38h_2);
                                                 |     if (s3 <= 0) {
    0x0000de5c blez s3, 0xdf5c                   |         goto label_5;
                                                 |     }
    0x0000de60 lw v1, (s0)                       |     v1 = *(s0);
                                                 | label_11:
    0x0000de64 move s4, zero                     |     s4 = 0;
    0x0000de68 lw v0, 0x74(v1)                   |     v0 = *((v1 + 29));
                                                 | label_1:
    0x0000de6c move s7, zero                     |     s7 = 0;
                                                 |     if (v0 <= 0) {
    0x0000de70 blez v0, 0xdf48                   |         goto label_18;
                                                 |     }
    0x0000de74 lw a2, 0x8c(v1)                   |     a2 = *((v1 + 35));
    0x0000de78 b 0xde90                          |     
                                                 |     while (v0 == a2) {
    0x0000de7c lw v0, 0x74(v1)                   |         v0 = *((v1 + 29));
    0x0000de80 addiu s7, s7, 1                   |         s7++;
    0x0000de84 slt a0, s7, v0                    |         a0 = (s7 < v0) ? 1 : 0;
                                                 |         if (a0 == 0) {
    0x0000de88 beql a0, zero, 0xdf4c             |             goto label_19;
                                                 |         }
    0x0000de8c addiu s4, s4, 1                   |         s4++;
    0x0000de90 lw a1, 0x9c(v1)                   |         a1 = *((v1 + 39));
    0x0000de94 mul v1, v0, s4                    |         __asm ("mul v1, v0, s4");
    0x0000de98 lw t9, -0x7e94(gp)                |         t9 = sym.write_all;
    0x0000de9c move a0, s2                       |         a0 = s2;
    0x0000dea0 addu v0, v1, s7                   |         v0 = v1 + s7;
    0x0000dea4 mul v1, v0, a2                    |         __asm ("mul v1, v0, a2");
    0x0000dea8 addu a1, v1, a1                   |         a1 = v1 + a1;
    0x0000deac jalr t9                           |         t9 ();
    0x0000deb0 lw v1, (s0)                       |         v1 = *(s0);
    0x0000deb4 lw a2, 0x8c(v1)                   |         a2 = *((v1 + 35));
    0x0000deb8 lw gp, 0x18(sp)                   |         gp = *(var_18h_2);
    0x0000debc beq v0, a2, 0xde7c                |         
                                                 |     }
                                                 | label_17:
    0x0000dec0 lw v0, 0x20(sp)                   |     v0 = *(var_e0h);
    0x0000dec4 lw t9, -0x7bfc(gp)                |     t9 = sym.imp.__errno_location;
    0x0000dec8 lw s0, (v0)                       |     s0 = *(v0);
    0x0000decc jalr t9                           |     t9 ();
    0x0000ded0 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
    0x0000ded4 lw t9, -0x7bc8(gp)                |     t9 = sym.imp.strerror;
    0x0000ded8 lw a0, (v0)                       |     a0 = *(v0);
    0x0000dedc jalr t9                           |     t9 ();
    0x0000dee0 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
    0x0000dee4 move a3, v0                       |     a3 = v0;
    0x0000dee8 addiu a1, zero, 1                 |     a1 = 1;
    0x0000deec lw a2, -0x7fdc(gp)                |     a2 = *(gp);
    0x0000def0 lw t9, -0x7c44(gp)                |     t9 = sym.imp.__fprintf_chk
                                                 |     /* str._nwrite:__s_n */
    0x0000def4 addiu a2, a2, -0x218c             |     a2 += -0x218c;
    0x0000def8 move a0, s0                       |     a0 = s0;
    0x0000defc jalr t9                           |     t9 ();
    0x0000df00 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
    0x0000df04 addiu v0, zero, -1                |     v0 = -1;
                                                 | label_3:
    0x0000df08 lw v1, 0x28(sp)                   |     v1 = *(var_28h);
    0x0000df0c lw a0, 0x44(sp)                   |     a0 = *(var_44h_2);
    0x0000df10 lw v1, (v1)                       |     v1 = *(v1);
    0x0000df14 lw ra, 0x6c(sp)                   |     ra = *(var_6ch);
                                                 |     if (a0 != v1) {
    0x0000df18 bne a0, v1, 0xe4f0                |         goto label_20;
                                                 |     }
    0x0000df1c lw fp, 0x68(sp)                   |     fp = *(var_68h);
    0x0000df20 lw s7, 0x64(sp)                   |     s7 = *(var_64h_2);
    0x0000df24 lw s6, 0x60(sp)                   |     s6 = *(var_60h_2);
    0x0000df28 lw s5, 0x5c(sp)                   |     s5 = *(var_5ch_2);
    0x0000df2c lw s4, 0x58(sp)                   |     s4 = *(var_58h_2);
    0x0000df30 lw s3, 0x54(sp)                   |     s3 = *(var_54h_2);
    0x0000df34 lw s2, 0x50(sp)                   |     s2 = *(var_50h_2);
    0x0000df38 lw s1, 0x4c(sp)                   |     s1 = *(var_4ch_2);
    0x0000df3c lw s0, 0x48(sp)                   |     s0 = *(var_48h_2);
    0x0000df40 addiu sp, sp, 0x70                |     
    0x0000df44 jr ra                             |     return v0;
                                                 | label_18:
    0x0000df48 addiu s4, s4, 1                   |     s4++;
                                                 | label_19:
    0x0000df4c slt v0, s4, s3                    |     v0 = (s4 < s3) ? 1 : 0;
    0x0000df50 lw v0, 0x74(v1)                   |     v0 = *((v1 + 29));
                                                 |     if (v0 == 0) {
    0x0000df54 bnel v0, zero, 0xde6c             |         goto label_1;
                                                 |     }
    0x0000df58 lw a0, 0x38(sp)                   |     a0 = *(var_38h_2);
                                                 | label_5:
    0x0000df5c lw v0, 0x20(sp)                   |     v0 = *(var_e0h);
    0x0000df60 lw t9, -0x7c34(gp)                |     t9 = sym.imp.fputc;
    0x0000df64 addiu s5, s5, 0x14                |     s5 += 0x14;
    0x0000df68 lw a1, (v0)                       |     a1 = *(v0);
    0x0000df6c addiu s1, s1, 0x24                |     s1 += 0x24;
    0x0000df70 jalr t9                           |     t9 ();
    0x0000df74 lw v0, 0x3c(sp)                   |     v0 = *(var_3ch_2);
    0x0000df78 lw v1, 0x34(sp)                   |     v1 = *(var_34h_2);
    0x0000df7c lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
    0x0000df80 lw v0, 0x14(v0)                   |     v0 = *((v0 + 5));
    0x0000df84 addiu v1, v1, 1                   |     v1++;
    0x0000df88 sltu v0, v1, v0                   |     v0 = (v1 < v0) ? 1 : 0;
    0x0000df8c sw v1, 0x34(sp)                   |     *(var_34h_2) = v1;
                                                 |     if (v0 != 0) {
    0x0000df90 bnez v0, 0xdcd8                   |         goto label_2;
                                                 |     }
    0x0000df94 move v0, zero                     |     v0 = 0;
    0x0000df98 b 0xdf08                          |     goto label_3;
                                                 | label_12:
    0x0000df9c lw a2, 4(s5)                      |     a2 = *((s5 + 1));
    0x0000dfa0 lw v0, 8(v1)                      |     v0 = *((v1 + 2));
    0x0000dfa4 sltu v0, a2, v0                   |     v0 = (a2 < v0) ? 1 : 0;
    0x0000dfa8 lw v0, (s1)                       |     v0 = *(s1);
                                                 |     if (v0 == 0) {
    0x0000dfac bnel v0, zero, 0xdd70             |         goto label_4;
                                                 |     }
                                                 |     do {
    0x0000dfb0 lw v0, 0x10(s1)                   |         v0 = *((s1 + 4));
    0x0000dfb4 addiu v0, zero, 0x2e              |         v0 = 0x2e;
                                                 |         if (v0 != 0) {
    0x0000dfb8 bnez v0, 0xe044                   |             goto label_21;
                                                 |         }
    0x0000dfbc addiu a0, zero, 0x2e              |         a0 = 0x2e;
    0x0000dfc0 b 0xdf5c                          |         goto label_5;
                                                 | label_16:
    0x0000dfc4 sw v0, 0x38(sp)                   |         *(var_38h_2) = v0;
    0x0000dfc8 b 0xde58                          |         goto label_6;
                                                 | label_14:
    0x0000dfcc move s4, zero                     |         s4 = 0;
    0x0000dfd0 blez s3, 0xdfb0                   |         
                                                 |     } while (s3 <= 0);
    0x0000dfd4 lw v0, 0x74(v1)                   |     v0 = *((v1 + 29));
                                                 | label_7:
    0x0000dfd8 move s7, zero                     |     s7 = 0;
                                                 |     if (v0 <= 0) {
    0x0000dfdc blez v0, 0xe024                   |         goto label_22;
                                                 |     }
                                                 |     do {
    0x0000dfe0 mul a1, v0, s4                    |         __asm ("mul a1, v0, s4");
    0x0000dfe4 lw a0, 0x90(v1)                   |         a0 = *((v1 + 36));
    0x0000dfe8 lw t9, -0x7b78(gp)                |         t9 = sym.imp.memcpy;
    0x0000dfec lw a2, 0x14(s1)                   |         a2 = *((s1 + 5));
    0x0000dff0 addu v0, a1, s7                   |         v0 = a1 + s7;
    0x0000dff4 mul v0, v0, a0                    |         __asm ("mul v0, v0, a0");
    0x0000dff8 lw a1, 0x98(v1)                   |         a1 = *((v1 + 38));
    0x0000dffc lw a0, 0x9c(v1)                   |         a0 = *((v1 + 39));
    0x0000e000 addiu s7, s7, 1                   |         s7++;
    0x0000e004 addu a0, a0, v0                   |         a0 += v0;
    0x0000e008 addu a1, a1, v0                   |         a1 += v0;
    0x0000e00c jalr t9                           |         t9 ();
    0x0000e010 lw v1, (s0)                       |         v1 = *(s0);
    0x0000e014 lw v0, 0x74(v1)                   |         v0 = *((v1 + 29));
    0x0000e018 slt a0, s7, v0                    |         a0 = (s7 < v0) ? 1 : 0;
    0x0000e01c lw gp, 0x18(sp)                   |         gp = *(var_18h_2);
    0x0000e020 bnez a0, 0xdfe0                   |         
                                                 |     } while (a0 != 0);
                                                 | label_22:
    0x0000e024 lw v0, 0x70(v1)                   |     v0 = *((v1 + 28));
    0x0000e028 addiu s4, s4, 1                   |     s4++;
    0x0000e02c slt v0, s4, v0                    |     v0 = (s4 < v0) ? 1 : 0;
    0x0000e030 lw v0, 0x74(v1)                   |     v0 = *((v1 + 29));
                                                 |     if (v0 == 0) {
    0x0000e034 bnel v0, zero, 0xdfd8             |         goto label_7;
                                                 |     }
    0x0000e038 lw v0, 0x10(s1)                   |     v0 = *((s1 + 4));
    0x0000e03c addiu v0, zero, 0x2e              |     v0 = 0x2e;
                                                 |     if (v0 == 0) {
    0x0000e040 beqz v0, 0xe0b8                   |         goto label_23;
                                                 |     }
                                                 | label_21:
    0x0000e044 sw v0, 0x38(sp)                   |     *(var_38h_2) = v0;
    0x0000e048 b 0xdddc                          |     goto label_8;
                                                 | label_10:
    0x0000e04c move s3, zero                     |     s3 = 0;
                                                 |     if (v0 <= 0) {
    0x0000e050 blez v0, 0xe09c                   |         goto label_24;
                                                 |     }
                                                 |     do {
    0x0000e054 mul a0, v0, s4                    |         __asm ("mul a0, v0, s4");
    0x0000e058 lw a1, 0x90(v1)                   |         a1 = *((v1 + 36));
    0x0000e05c lw v1, 0x98(v1)                   |         v1 = *((v1 + 38));
    0x0000e060 lw t9, -0x7e80(gp)                |         t9 = sym.sa_fread;
    0x0000e064 lw a2, 0x10(s5)                   |         a2 = *((s5 + 4));
    0x0000e068 addu v0, a0, s3                   |         v0 = a0 + s3;
    0x0000e06c mul a0, v0, a1                    |         __asm ("mul a0, v0, a1");
    0x0000e070 sw zero, 0x10(sp)                 |         *(var_d0h) = 0;
    0x0000e074 addiu a3, zero, 1                 |         a3 = 1;
    0x0000e078 addiu s3, s3, 1                   |         s3++;
    0x0000e07c addu a1, a0, v1                   |         a1 = a0 + v1;
    0x0000e080 move a0, s6                       |         a0 = s6;
    0x0000e084 jalr t9                           |         t9 ();
    0x0000e088 lw v1, (s0)                       |         v1 = *(s0);
    0x0000e08c lw v0, 0x74(v1)                   |         v0 = *((v1 + 29));
    0x0000e090 slt a0, s3, v0                    |         a0 = (s3 < v0) ? 1 : 0;
    0x0000e094 lw gp, 0x18(sp)                   |         gp = *(var_18h_2);
    0x0000e098 bnez a0, 0xe054                   |         
                                                 |     } while (a0 != 0);
                                                 | label_24:
    0x0000e09c lw s3, 0x70(v1)                   |     s3 = *((v1 + 28));
    0x0000e0a0 addiu s4, s4, 1                   |     s4++;
    0x0000e0a4 slt v0, s4, s3                    |     v0 = (s4 < s3) ? 1 : 0;
                                                 |     if (v0 == 0) {
    0x0000e0a8 beql v0, zero, 0xdd5c             |         goto label_9;
                                                 |     }
    0x0000e0ac lw a2, 4(s5)                      |     a2 = *((s5 + 1));
    0x0000e0b0 lw v0, 0x74(v1)                   |     v0 = *((v1 + 29));
    0x0000e0b4 b 0xe04c                          |     goto label_10;
                                                 | label_23:
    0x0000e0b8 sw v0, 0x38(sp)                   |     *(var_38h_2) = v0;
    0x0000e0bc b 0xde64                          |     goto label_11;
                                                 | label_20:
    0x0000e4f0 lw t9, -0x7b90(gp)                |     t9 = sym.imp.__stack_chk_fail;
    0x0000e4f4 jalr t9                           |     t9 ();
    0x0000e4f8 nop                               |     
                                                 | }
    ; assembly                                   | /* r2dec pseudo code output */
                                                 | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0xb05c */
                                                 | #include <stdint.h>
                                                 |  
    ; (fcn) sym.upgrade_header_section ()        | void upgrade_header_section () {
    0x0000b05c lui gp, 7                         |     
    0x0000b060 addiu gp, gp, 0x3f64              |     
    0x0000b064 addu gp, gp, t9                   |     gp += t9;
    0x0000b068 lw v0, -0x7b7c(gp)                |     v0 = *((gp - 7903));
    0x0000b06c addiu sp, sp, -0x1a0              |     
    0x0000b070 lw v1, -0x7b6c(gp)                |     v1 = *((gp - 7899));
    0x0000b074 lw a0, -0x7fdc(gp)                |     a0 = *(gp);
    0x0000b078 sw v0, 0x24(sp)                   |     *(var_24h_3) = v0;
    0x0000b07c lw v0, (v0)                       |     v0 = *(v0);
    0x0000b080 lw t9, -0x7bb0(gp)                |     t9 = sym.imp.fwrite;
    0x0000b084 sw s2, 0x180(sp)                  |     *(var_180h) = s2;
    0x0000b088 move s2, a3                       |     s2 = a3;
    0x0000b08c lw a3, (v1)                       |     a3 = *(v1);
    0x0000b090 sw gp, 0x18(sp)                   |     *(var_18h_2) = gp;
    0x0000b094 sw s7, 0x194(sp)                  |     *(var_194h) = s7;
    0x0000b098 sw s6, 0x190(sp)                  |     *(var_190h) = s6;
    0x0000b09c sw s5, 0x18c(sp)                  |     *(var_18ch) = s5;
    0x0000b0a0 sw s4, 0x188(sp)                  |     *(var_188h) = s4;
    0x0000b0a4 sw s3, 0x184(sp)                  |     *(var_184h) = s3;
    0x0000b0a8 sw s1, 0x17c(sp)                  |     *(var_17ch) = s1;
    0x0000b0ac sw s0, 0x178(sp)                  |     *(var_178h) = s0;
    0x0000b0b0 sw v1, 0x20(sp)                   |     *(var_20h_2) = v1;
    0x0000b0b4 sw a2, 0x1a8(sp)                  |     *(var_1a8h) = a2;
    0x0000b0b8 sw ra, 0x19c(sp)                  |     *(var_19ch) = ra;
    0x0000b0bc sw fp, 0x198(sp)                  |     *(var_198h) = fp;
    0x0000b0c0 move s4, a1                       |     s4 = a1;
    0x0000b0c4 addiu a2, zero, 0xd               |     a2 = 0xd;
    0x0000b0c8 addiu a1, zero, 1                 |     a1 = 1;
                                                 |     /* str.file_header:_ */
    0x0000b0cc addiu a0, a0, -0x217c             |     a0 += -0x217c;
    0x0000b0d0 sw v0, 0x174(sp)                  |     *(var_174h) = v0;
    0x0000b0d4 lw s0, 0x1b4(sp)                  |     s0 = *(var_1b4h);
    0x0000b0d8 lw s1, 0x1b8(sp)                  |     s1 = *(var_1b8h);
    0x0000b0dc lw s5, 0x1c0(sp)                  |     s5 = *(var_20h);
    0x0000b0e0 lw s3, 0x1c4(sp)                  |     s3 = *(var_24h_2);
    0x0000b0e4 lw s7, 0x1c8(sp)                  |     s7 = *(var_28h_2);
    0x0000b0e8 lw s6, 0x1cc(sp)                  |     s6 = *(var_2ch_2);
    0x0000b0ec jalr t9                           |     t9 ();
    0x0000b0f0 lw v1, 0x1bc(sp)                  |     v1 = *(var_1ch);
    0x0000b0f4 addiu v0, zero, 0x2171            |     v0 = 0x2171;
    0x0000b0f8 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
                                                 |     if (v1 == v0) {
    0x0000b0fc beq v1, v0, 0xb3e0                |         goto label_7;
                                                 |     }
    0x0000b100 lw v0, 0x20(sp)                   |     v0 = *(var_20h_2);
                                                 |     if (s1 == 0) {
    0x0000b104 beqz s1, 0xb4a4                   |         goto label_8;
                                                 |     }
                                                 | label_5:
    0x0000b108 lw t9, -0x7c70(gp)                |     t9 = sym.imp.calloc;
    0x0000b10c addiu a1, zero, 1                 |     a1 = 1;
    0x0000b110 move a0, s1                       |     a0 = s1;
    0x0000b114 jalr t9                           |     t9 ();
    0x0000b118 move fp, v0                       |     fp = v0;
    0x0000b11c lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
                                                 |     if (v0 == 0) {
    0x0000b120 beqz v0, 0xb4d0                   |         goto label_9;
                                                 |     }
    0x0000b124 lw t9, -0x7e80(gp)                |     t9 = sym.sa_fread;
    0x0000b128 addiu a3, zero, 1                 |     a3 = 1;
    0x0000b12c move a2, s1                       |     a2 = s1;
    0x0000b130 move a1, v0                       |     a1 = v0;
    0x0000b134 move a0, s4                       |     a0 = s4;
    0x0000b138 sw zero, 0x10(sp)                 |     *(var_10h_3) = 0;
    0x0000b13c jalr t9                           |     t9 ();
    0x0000b140 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
    0x0000b144 lw a2, 0x1bc(sp)                  |     a2 = *(var_1ch);
    0x0000b148 move a3, s3                       |     a3 = s3;
    0x0000b14c lw t9, -0x7e7c(gp)                |     t9 = sym.upgrade_file_header;
    0x0000b150 move a1, s0                       |     a1 = s0;
    0x0000b154 move a0, fp                       |     a0 = fp;
    0x0000b158 sw s7, 0x14(sp)                   |     *(var_14h_2) = s7;
    0x0000b15c sw s5, 0x10(sp)                   |     *(var_10h_3) = s5;
    0x0000b160 bal 0xad78                        |     sym_upgrade_file_header ();
    0x0000b164 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
    0x0000b168 lw t9, -0x7b74(gp)                |     t9 = sym.imp.free;
    0x0000b16c move a0, fp                       |     a0 = fp;
    0x0000b170 jalr t9                           |     t9 ();
    0x0000b174 lw v0, 0x14(s0)                   |     v0 = *((s0 + 5));
    0x0000b178 sltiu v1, v0, 0x101               |     v1 = (v0 < 0x101) ? 1 : 0;
    0x0000b17c lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
                                                 |     if (v1 == 0) {
    0x0000b180 beqz v1, 0xb284                   |         goto label_10;
                                                 |     }
    0x0000b184 sll a1, v0, 2                     |     a1 = v0 << 2;
    0x0000b188 addu a1, a1, v0                   |     a1 += v0;
    0x0000b18c sll a1, a1, 2                     |     a1 <<= 2;
    0x0000b190 lw fp, (s6)                       |     fp = *(s6);
                                                 |     if (a1 != 0) {
    0x0000b194 bnez a1, 0xb304                   |         goto label_11;
                                                 |     }
                                                 | label_6:
    0x0000b198 lw v0, 0x20(sp)                   |     v0 = *(var_20h_2);
                                                 |     if (fp == 0) {
    0x0000b19c beqz fp, 0xb4a4                   |         goto label_8;
                                                 |     }
    0x0000b1a0 lw a1, 0x14(s0)                   |     a1 = *((s0 + 5));
                                                 | label_3:
    0x0000b1a4 lw v0, 0x20(sp)                   |     v0 = *(var_20h_2);
                                                 |     if (a1 == 0) {
    0x0000b1a8 beqz a1, 0xb430                   |         goto label_12;
                                                 |     }
    0x0000b1ac lw s6, -0x7e78(gp)                |     s6 = *(gp);
    0x0000b1b0 move s7, zero                     |     s7 = 0;
    0x0000b1b4 move s1, zero                     |     s1 = 0;
    0x0000b1b8 b 0xb240                          |     
                                                 |     while (s3 == 0) {
    0x0000b1bc lw v0, 8(fp)                      |         v0 = *(arg_8h);
    0x0000b1c0 lw v0, 0x20(sp)                   |         v0 = *(var_20h_2);
                                                 |         if (v0 <= 0) {
    0x0000b1c4 blez v0, 0xb288                   |             goto label_13;
                                                 |         }
                                                 | label_0:
    0x0000b1c8 lw v0, 0xc(fp)                    |         v0 = *(arg_ch);
    0x0000b1cc lw t9, -0x7f80(gp)                |         t9 = sym.get_activity_position;
                                                 |         if (v0 <= 0) {
    0x0000b1d0 blez v0, 0xb284                   |             goto label_10;
                                                 |         }
    0x0000b1d4 lw a1, (fp)                       |         a1 = *(fp);
    0x0000b1d8 move a2, zero                     |         a2 = 0;
    0x0000b1dc move a0, s2                       |         a0 = s2;
    0x0000b1e0 jalr t9                           |         t9 ();
    0x0000b1e4 lw gp, 0x18(sp)                   |         gp = *(var_18h_2);
                                                 |         if (v0 >= 0) {
    0x0000b1e8 bltz v0, 0xb22c                   |             
    0x0000b1ec lw a1, (fp)                       |             a1 = *(fp);
    0x0000b1f0 addiu a0, zero, 1                 |             a0 = 1;
                                                 |             if (a1 == a0) {
    0x0000b1f4 beq a1, a0, 0xb2ec                |                 goto label_14;
                                                 |             }
    0x0000b1f8 nop                               |             
                                                 | label_2:
    0x0000b1fc lw a1, 0x10(fp)                   |             a1 = *(arg_b8h);
                                                 | label_1:
    0x0000b200 sll v0, v0, 2                     |             v0 <<= 2;
                                                 |             if (a1 == 0) {
    0x0000b204 beqz a1, 0xb284                   |                 goto label_10;
                                                 |             }
    0x0000b208 lwx v0, v0(s2)                    |             __asm ("lwx v0, v0(s2)");
    0x0000b20c lw a0, 0x90(v0)                   |             a0 = *((v0 + 36));
    0x0000b210 slt a0, a0, a1                    |             a0 = (a0 < a1) ? 1 : 0;
    0x0000b214 sw a1, 0x90(v0)                   |             *((v0 + 36)) = a1;
                                                 |             if (a0 != 0) {
    0x0000b218 bnel a0, zero, 0xb21c             |                 
                                                 |             }
    0x0000b21c lw a0, 8(fp)                      |             a0 = *(arg_8h);
    0x0000b220 sw a0, 0x70(v0)                   |             *((v0 + 28)) = a0;
    0x0000b224 lw a0, 0xc(fp)                    |             a0 = *(arg_ch);
    0x0000b228 sw a0, 0x74(v0)                   |             *((v0 + 29)) = a0;
                                                 |         }
    0x0000b22c lw v0, 0x14(s0)                   |         v0 = *((s0 + 5));
    0x0000b230 addiu s1, s1, 1                   |         s1++;
    0x0000b234 sltu v0, s1, v0                   |         v0 = (s1 < v0) ? 1 : 0;
    0x0000b238 addiu fp, fp, 0x14                |         fp += 0x14;
                                                 |         if (v0 == 0) {
    0x0000b23c beqz v0, 0xb32c                   |             goto label_15;
                                                 |         }
    0x0000b240 lw t9, -0x7e80(gp)                |         t9 = sym.sa_fread;
    0x0000b244 sw zero, 0x10(sp)                 |         *(var_10h_3) = 0;
    0x0000b248 addiu a3, zero, 1                 |         a3 = 1;
    0x0000b24c addiu a2, zero, 0x14              |         a2 = 0x14;
    0x0000b250 move a1, fp                       |         a1 = fp;
    0x0000b254 move a0, s4                       |         a0 = s4;
    0x0000b258 jalr t9                           |         t9 ();
    0x0000b25c lw gp, 0x18(sp)                   |         gp = *(var_18h_2);
    0x0000b260 beqz s3, 0xb1bc                   |         
                                                 |     }
    0x0000b264 lw t9, -0x7e90(gp)                |     t9 = sym.swap_struct;
    0x0000b268 lw a2, (s5)                       |     a2 = *(s5);
    0x0000b26c move a1, fp                       |     a1 = fp;
    0x0000b270 move a0, s6                       |     a0 = s6;
    0x0000b274 jalr t9                           |     t9 ();
    0x0000b278 lw v0, 8(fp)                      |     v0 = *(arg_8h);
    0x0000b27c lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
                                                 |     if (v0 > 0) {
    0x0000b280 bgtz v0, 0xb1c8                   |         goto label_0;
                                                 |     }
                                                 | label_10:
    0x0000b284 lw v0, 0x20(sp)                   |     v0 = *(var_20h_2);
                                                 | label_13:
    0x0000b288 lw a0, -0x7fdc(gp)                |     a0 = *(gp);
    0x0000b28c lw t9, -0x7bb0(gp)                |     t9 = sym.imp.fwrite;
    0x0000b290 lw a3, (v0)                       |     a3 = *(v0);
    0x0000b294 addiu a2, zero, 0x21              |     a2 = 0x21;
    0x0000b298 addiu a1, zero, 1                 |     a1 = 1;
                                                 |     /* str._nInvalid_data_found._Aborting..._n */
    0x0000b29c addiu a0, a0, -0x2128             |     a0 += -0x2128;
    0x0000b2a0 jalr t9                           |     t9 ();
    0x0000b2a4 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
    0x0000b2a8 addiu v0, zero, -1                |     v0 = -1;
                                                 | label_4:
    0x0000b2ac lw v1, 0x24(sp)                   |     v1 = *(var_24h_3);
    0x0000b2b0 lw a0, 0x174(sp)                  |     a0 = *(var_174h);
    0x0000b2b4 lw v1, (v1)                       |     v1 = *(v1);
    0x0000b2b8 lw ra, 0x19c(sp)                  |     ra = *(var_19ch);
                                                 |     if (a0 != v1) {
    0x0000b2bc bne a0, v1, 0xb4f0                |         goto label_16;
                                                 |     }
    0x0000b2c0 lw fp, 0x198(sp)                  |     fp = *(var_198h);
    0x0000b2c4 lw s7, 0x194(sp)                  |     s7 = *(var_194h);
    0x0000b2c8 lw s6, 0x190(sp)                  |     s6 = *(var_190h);
    0x0000b2cc lw s5, 0x18c(sp)                  |     s5 = *(var_18ch);
    0x0000b2d0 lw s4, 0x188(sp)                  |     s4 = *(var_188h);
    0x0000b2d4 lw s3, 0x184(sp)                  |     s3 = *(var_184h);
    0x0000b2d8 lw s2, 0x180(sp)                  |     s2 = *(var_180h);
    0x0000b2dc lw s1, 0x17c(sp)                  |     s1 = *(var_17ch);
    0x0000b2e0 lw s0, 0x178(sp)                  |     s0 = *(var_178h);
    0x0000b2e4 addiu sp, sp, 0x1a0               |     
    0x0000b2e8 jr ra                             |     return v1;
                                                 | label_14:
    0x0000b2ec lw a1, 0x10(fp)                   |     a1 = *(arg_b8h);
                                                 |     if (s7 == 0) {
    0x0000b2f0 bnel s7, zero, 0xb200             |         goto label_1;
                                                 |     }
    0x0000b2f4 lw a0, 8(fp)                      |     a0 = *(arg_8h);
    0x0000b2f8 addiu s7, zero, 1                 |     s7 = 1;
    0x0000b2fc sw a0, 0x10(s0)                   |     *((s0 + 4)) = a0;
    0x0000b300 b 0xb1fc                          |     goto label_2;
                                                 | label_11:
    0x0000b304 lw t9, -0x7bbc(gp)                |     t9 = sym.imp.realloc;
    0x0000b308 move a0, fp                       |     a0 = fp;
    0x0000b30c jalr t9                           |     t9 ();
    0x0000b310 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
    0x0000b314 sw v0, (s6)                       |     *(s6) = v0;
                                                 |     if (v0 == 0) {
    0x0000b318 beqz v0, 0xb4d0                   |         goto label_9;
                                                 |     }
    0x0000b31c lw a1, 0x14(s0)                   |     a1 = *((s0 + 5));
                                                 |     if (fp == 0) {
    0x0000b320 beqz fp, 0xb404                   |         goto label_17;
                                                 |     }
    0x0000b324 move fp, v0                       |     fp = v0;
    0x0000b328 b 0xb1a4                          |     goto label_3;
                                                 | label_15:
    0x0000b32c addiu a3, s0, 0x140               |     a3 = s0 + aav.0x00000140;
                                                 |     if (s7 == 0) {
    0x0000b330 beqz s7, 0xb42c                   |         goto label_18;
                                                 |     }
    0x0000b334 addiu s1, sp, 0x28                |     s1 = sp + 0x28;
    0x0000b338 move v0, s1                       |     v0 = s1;
                                                 |     do {
    0x0000b33c lwl a2, 3(s0)                     |         __asm ("lwl a2, 3(s0)");
    0x0000b340 lwl a1, 7(s0)                     |         __asm ("lwl a1, 7(s0)");
    0x0000b344 lwl a0, 0xb(s0)                   |         __asm ("lwl a0, 0xb(s0)");
    0x0000b348 lwl v1, 0xf(s0)                   |         __asm ("lwl v1, 0xf(s0)");
    0x0000b34c lwr a2, (s0)                      |         __asm ("lwr a2, (s0)");
    0x0000b350 lwr a1, 4(s0)                     |         __asm ("lwr a1, 4(s0)");
    0x0000b354 lwr a0, 8(s0)                     |         __asm ("lwr a0, 8(s0)");
    0x0000b358 lwr v1, 0xc(s0)                   |         __asm ("lwr v1, 0xc(s0)");
    0x0000b35c addiu s0, s0, 0x10                |         s0 += 0x10;
    0x0000b360 sw a2, (v0)                       |         *(v0) = a2;
    0x0000b364 sw a1, 4(v0)                      |         *((v0 + 1)) = a1;
    0x0000b368 sw a0, 8(v0)                      |         *((v0 + 2)) = a0;
    0x0000b36c sw v1, 0xc(v0)                    |         *((v0 + 3)) = v1;
    0x0000b370 addiu v0, v0, 0x10                |         v0 += 0x10;
    0x0000b374 bne s0, a3, 0xb33c                |         
                                                 |     } while (s0 != a3);
    0x0000b378 lwl a0, 3(s0)                     |     __asm ("lwl a0, 3(s0)");
    0x0000b37c lwl v1, 7(s0)                     |     __asm ("lwl v1, 7(s0)");
    0x0000b380 lwr a0, (s0)                      |     __asm ("lwr a0, (s0)");
    0x0000b384 lwr v1, 4(s0)                     |     __asm ("lwr v1, 4(s0)");
    0x0000b388 sw a0, (v0)                       |     *(v0) = a0;
    0x0000b38c sw v1, 4(v0)                      |     *((v0 + 1)) = v1;
    0x0000b390 bnez s3, 0xb3e8                   |     
                                                 |     while (1) {
    0x0000b394 lw t9, -0x7e94(gp)                |         t9 = sym.write_all;
    0x0000b398 lw a0, 0x1a8(sp)                  |         a0 = *(var_1a8h);
    0x0000b39c addiu a2, zero, 0x148             |         a2 = aav.0x00000148;
    0x0000b3a0 move a1, s1                       |         a1 = s1;
    0x0000b3a4 jalr t9                           |         t9 ();
    0x0000b3a8 addiu v1, zero, 0x148             |         v1 = aav.0x00000148;
    0x0000b3ac lw gp, 0x18(sp)                   |         gp = *(var_18h_2);
                                                 |         if (v0 != v1) {
    0x0000b3b0 bne v0, v1, 0xb458                |             goto label_19;
                                                 |         }
    0x0000b3b4 lw v0, 0x20(sp)                   |         v0 = *(var_20h_2);
    0x0000b3b8 lw a0, -0x7fdc(gp)                |         a0 = *(gp);
    0x0000b3bc lw t9, -0x7bb0(gp)                |         t9 = sym.imp.fwrite;
    0x0000b3c0 lw a3, (v0)                       |         a3 = *(v0);
    0x0000b3c4 addiu a2, zero, 3                 |         a2 = 3;
    0x0000b3c8 addiu a1, zero, 1                 |         a1 = 1;
                                                 |         /* esilref: 'OK
' */
    0x0000b3cc addiu a0, a0, -0x2180             |         a0 += -0x2180;
    0x0000b3d0 jalr t9                           |         t9 ();
    0x0000b3d4 lw gp, 0x18(sp)                   |         gp = *(var_18h_2);
    0x0000b3d8 move v0, zero                     |         v0 = 0;
    0x0000b3dc b 0xb2ac                          |         goto label_4;
                                                 | label_7:
    0x0000b3e0 addiu s1, zero, 0x118             |         s1 = 0x118;
    0x0000b3e4 b 0xb108                          |         goto label_5;
    0x0000b3e8 lw t9, -0x7e90(gp)                |         t9 = sym.swap_struct;
    0x0000b3ec lw a0, -0x7e74(gp)                |         a0 = *(gp);
    0x0000b3f0 lw a2, (s5)                       |         a2 = *(s5);
    0x0000b3f4 move a1, s1                       |         a1 = s1;
    0x0000b3f8 jalr t9                           |         t9 ();
    0x0000b3fc lw gp, 0x18(sp)                   |         gp = *(var_18h_2);
    0x0000b400 b 0xb394                          |         
                                                 |     }
                                                 | label_17:
    0x0000b404 sll v1, a1, 2                     |     v1 = a1 << 2;
    0x0000b408 addu a1, v1, a1                   |     a1 = v1 + a1;
    0x0000b40c lw t9, -0x7bf4(gp)                |     t9 = sym.imp.memset;
    0x0000b410 sll a2, a1, 2                     |     a2 = a1 << 2;
    0x0000b414 move a0, v0                       |     a0 = v0;
    0x0000b418 move a1, zero                     |     a1 = 0;
    0x0000b41c jalr t9                           |     t9 ();
    0x0000b420 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
    0x0000b424 lw fp, (s6)                       |     fp = *(s6);
    0x0000b428 b 0xb198                          |     goto label_6;
                                                 | label_18:
    0x0000b42c lw v0, 0x20(sp)                   |     v0 = *(var_20h_2);
                                                 | label_12:
    0x0000b430 lw a0, -0x7fdc(gp)                |     a0 = *(gp);
    0x0000b434 lw t9, -0x7bb0(gp)                |     t9 = sym.imp.fwrite;
    0x0000b438 lw a3, (v0)                       |     a3 = *(v0);
    0x0000b43c addiu a2, zero, 0x2d              |     a2 = 0x2d;
    0x0000b440 addiu a1, zero, 1                 |     a1 = 1;
                                                 |     /* str._nCPU_activity_not_found_in_file._Aborting..._n */
    0x0000b444 addiu a0, a0, -0x2158             |     a0 += -0x2158;
    0x0000b448 jalr t9                           |     t9 ();
    0x0000b44c lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
    0x0000b450 addiu v0, zero, -1                |     v0 = -1;
    0x0000b454 b 0xb2ac                          |     goto label_4;
                                                 | label_19:
    0x0000b458 lw v0, 0x20(sp)                   |     v0 = *(var_20h_2);
    0x0000b45c lw t9, -0x7bfc(gp)                |     t9 = sym.imp.__errno_location;
    0x0000b460 lw s0, (v0)                       |     s0 = *(v0);
    0x0000b464 jalr t9                           |     t9 ();
    0x0000b468 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
    0x0000b46c lw t9, -0x7bc8(gp)                |     t9 = sym.imp.strerror;
    0x0000b470 lw a0, (v0)                       |     a0 = *(v0);
    0x0000b474 jalr t9                           |     t9 ();
    0x0000b478 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
    0x0000b47c move a3, v0                       |     a3 = v0;
    0x0000b480 addiu a1, zero, 1                 |     a1 = 1;
    0x0000b484 lw a2, -0x7fdc(gp)                |     a2 = *(gp);
    0x0000b488 lw t9, -0x7c44(gp)                |     t9 = sym.imp.__fprintf_chk
                                                 |     /* str._nwrite:__s_n */
    0x0000b48c addiu a2, a2, -0x218c             |     a2 += -0x218c;
    0x0000b490 move a0, s0                       |     a0 = s0;
    0x0000b494 jalr t9                           |     t9 ();
    0x0000b498 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
    0x0000b49c addiu v0, zero, -1                |     v0 = -1;
    0x0000b4a0 b 0xb2ac                          |     goto label_4;
                                                 | label_8:
    0x0000b4a4 lw a0, -0x7fdc(gp)                |     a0 = *(gp);
    0x0000b4a8 lw t9, -0x7bb0(gp)                |     t9 = sym.imp.fwrite;
    0x0000b4ac lw a3, (v0)                       |     a3 = *(v0);
                                                 |     /* str.srealloc_n */
    0x0000b4b0 addiu a0, a0, -0x216c             |     a0 += -0x216c;
    0x0000b4b4 addiu a2, zero, 9                 |     a2 = 9;
    0x0000b4b8 addiu a1, zero, 1                 |     a1 = 1;
    0x0000b4bc jalr t9                           |     t9 ();
    0x0000b4c0 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
    0x0000b4c4 lw t9, -0x7bd0(gp)                |     t9 = sym.imp.exit;
    0x0000b4c8 addiu a0, zero, 4                 |     a0 = 4;
    0x0000b4cc jalr t9                           |     t9 ();
                                                 | label_9:
    0x0000b4d0 lw a0, -0x7fdc(gp)                |     a0 = *(gp);
    0x0000b4d4 lw t9, -0x7bac(gp)                |     t9 = sym.imp.perror;
                                                 |     /* str.realloc */
    0x0000b4d8 addiu a0, a0, -0x2160             |     a0 += -0x2160;
    0x0000b4dc jalr t9                           |     t9 ();
    0x0000b4e0 lw gp, 0x18(sp)                   |     gp = *(var_18h_2);
    0x0000b4e4 lw t9, -0x7bd0(gp)                |     t9 = sym.imp.exit;
    0x0000b4e8 addiu a0, zero, 4                 |     a0 = 4;
    0x0000b4ec jalr t9                           |     t9 ();
                                                 | label_16:
    0x0000b4f0 lw t9, -0x7b90(gp)                |     t9 = sym.imp.__stack_chk_fail;
    0x0000b4f4 jalr t9                           |     t9 ();
    0x0000b4f8 nop                               |     
    0x0000b4fc lw v0, (a0)                       |     v0 = *(a0);
                                                 |     if (a2 == 0) {
    0x0000b500 bnez a2, 0xb514                   |         
    0x0000b504 move v1, v0                       |         v1 = v0;
                                                 |         if (a1 != 0) {
    0x0000b508 movz v1, zero, a1                 |             v1 = 0;
                                                 |         }
                                                 |         if (a1 == 0) {
    0x0000b50c movn v0, zero, a1                 |             v0 = 0;
                                                 |         }
    0x0000b510 jr ra                             |         return v1;
                                                 |     }
    0x0000b514 lw v1, 4(a0)                      |     v1 = *((a0 + 1));
    0x0000b518 jr ra                             |     return v1;
                                                 | }
    ; assembly                                   | /* r2dec pseudo code output */
                                                 | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0xa9f0 */
                                                 | #include <stdint.h>
                                                 |  
    ; (fcn) sym.upgrade_magic_section ()         | void upgrade_magic_section () {
    0x0000a9f0 lui gp, 7                         |     
    0x0000a9f4 addiu gp, gp, 0x45d0              |     
    0x0000a9f8 addu gp, gp, t9                   |     gp += t9;
    0x0000a9fc addiu sp, sp, -0xa8               |     
    0x0000aa00 lw t9, -0x7e9c(gp)                |     t9 = sym.sa_open_read_magic;
    0x0000aa04 sw s2, 0x8c(sp)                   |     *(var_8ch) = s2;
    0x0000aa08 lw s2, -0x7b7c(gp)                |     s2 = *((gp - 7903));
    0x0000aa0c sw s1, 0x88(sp)                   |     *(var_88h) = s1;
    0x0000aa10 lw s1, 0xc0(sp)                   |     s1 = *(arg_c0h);
    0x0000aa14 lw v0, (s2)                       |     v0 = *(s2);
    0x0000aa18 sw s6, 0x9c(sp)                   |     *(var_9ch) = s6;
    0x0000aa1c sw s0, 0x84(sp)                   |     *(var_84h) = s0;
    0x0000aa20 move s6, a1                       |     s6 = a1;
    0x0000aa24 move s0, a3                       |     s0 = a3;
    0x0000aa28 sw v0, 0x7c(sp)                   |     *(var_7ch) = v0;
    0x0000aa2c addiu v0, zero, 5                 |     v0 = 5;
    0x0000aa30 sw gp, 0x18(sp)                   |     *(var_18h) = gp;
    0x0000aa34 sw s7, 0xa0(sp)                   |     *(var_a0h) = s7;
    0x0000aa38 sw s5, 0x98(sp)                   |     *(var_98h) = s5;
    0x0000aa3c sw s3, 0x90(sp)                   |     *(var_90h) = s3;
    0x0000aa40 move a1, a0                       |     a1 = a0;
    0x0000aa44 sw ra, 0xa4(sp)                   |     *(var_a4h) = ra;
    0x0000aa48 sw s4, 0x94(sp)                   |     *(var_94h) = s4;
    0x0000aa4c move s3, a2                       |     s3 = a2;
    0x0000aa50 sw zero, 0x14(sp)                 |     *(var_14h) = 0;
    0x0000aa54 sw s1, 0x10(sp)                   |     *(var_10h) = s1;
    0x0000aa58 addiu a3, zero, 1                 |     a3 = 1;
    0x0000aa5c move a2, s0                       |     a2 = s0;
    0x0000aa60 move a0, s6                       |     a0 = s6;
    0x0000aa64 sw zero, 0x24(sp)                 |     *(var_24h) = 0;
    0x0000aa68 sw zero, 0x28(sp)                 |     *(var_28h) = 0;
    0x0000aa6c sw v0, 0x2c(sp)                   |     *(var_2ch) = v0;
    0x0000aa70 lw s7, 0xb8(sp)                   |     s7 = *(arg_b8h);
    0x0000aa74 lw s5, 0xbc(sp)                   |     s5 = *(arg_bch);
    0x0000aa78 jalr t9                           |     t9 ();
    0x0000aa7c lhu v0, 2(s0)                     |     v0 = *((s0 + 1));
    0x0000aa80 addiu v1, zero, 0x2175            |     v1 = 0x2175;
    0x0000aa84 lw gp, 0x18(sp)                   |     gp = *(var_18h);
                                                 |     if (v0 == v1) {
    0x0000aa88 beq v0, v1, 0xac9c                |         goto label_3;
                                                 |     }
    0x0000aa8c sltiu v1, v0, 0x2176              |     v1 = (v0 < 0x2176) ? 1 : 0;
    0x0000aa90 addiu v1, zero, 0x7321            |     v1 = 0x7321;
                                                 |     if (v1 != 0) {
    0x0000aa94 bnez v1, 0xab10                   |         goto label_4;
                                                 |     }
    0x0000aa98 addiu v1, zero, 0x7521            |     v1 = 0x7521;
                                                 |     if (v0 == v1) {
    0x0000aa9c beq v0, v1, 0xab24                |         goto label_5;
                                                 |     }
    0x0000aaa0 addiu v1, zero, 0x7121            |     v1 = 0x7121;
                                                 |     if (v0 == v1) {
    0x0000aaa4 beq v0, v1, 0xac9c                |         goto label_3;
                                                 |     }
    0x0000aaa8 addiu v0, zero, 0x2171            |     v0 = 0x2171;
                                                 |     if (v0 == v1) {
    0x0000aaac beq v0, v1, 0xacb0                |         goto label_6;
                                                 |     }
    0x0000aab0 lw v0, -0x7b6c(gp)                |     v0 = *((gp - 7899));
                                                 |     do {
    0x0000aab4 lw a0, -0x7fdc(gp)                |         a0 = *(gp);
    0x0000aab8 lw t9, -0x7bb0(gp)                |         t9 = sym.imp.fwrite;
    0x0000aabc lw a3, (v0)                       |         a3 = *(v0);
    0x0000aac0 addiu a2, zero, 0x27              |         a2 = 0x27;
    0x0000aac4 addiu a1, zero, 1                 |         a1 = 1;
                                                 |         /* str.Cannot_convert_the_format_of_this_file_n */
    0x0000aac8 addiu a0, a0, -0x21d0             |         a0 += -0x21d0;
    0x0000aacc jalr t9                           |         t9 ();
    0x0000aad0 lw gp, 0x18(sp)                   |         gp = *(var_18h);
    0x0000aad4 addiu v0, zero, -1                |         v0 = -1;
                                                 | label_0:
    0x0000aad8 lw a0, 0x7c(sp)                   |         a0 = *(var_7ch);
    0x0000aadc lw v1, (s2)                       |         v1 = *(s2);
    0x0000aae0 lw ra, 0xa4(sp)                   |         ra = *(var_a4h);
                                                 |         if (a0 != v1) {
    0x0000aae4 bne a0, v1, 0xad6c                |             goto label_7;
                                                 |         }
    0x0000aae8 lw s7, 0xa0(sp)                   |         s7 = *(var_a0h);
    0x0000aaec lw s6, 0x9c(sp)                   |         s6 = *(var_9ch);
    0x0000aaf0 lw s5, 0x98(sp)                   |         s5 = *(var_98h);
    0x0000aaf4 lw s4, 0x94(sp)                   |         s4 = *(var_94h);
    0x0000aaf8 lw s3, 0x90(sp)                   |         s3 = *(var_90h);
    0x0000aafc lw s2, 0x8c(sp)                   |         s2 = *(var_8ch);
    0x0000ab00 lw s1, 0x88(sp)                   |         s1 = *(var_88h);
    0x0000ab04 lw s0, 0x84(sp)                   |         s0 = *(var_84h);
    0x0000ab08 addiu sp, sp, 0xa8                |         
    0x0000ab0c jr ra                             |         return v0;
                                                 | label_4:
    0x0000ab10 addiu v1, zero, 0x2171            |         v1 = 0x2171;
    0x0000ab14 addiu v1, zero, 0x2173            |         v1 = 0x2173;
                                                 |         if (v0 == v1) {
    0x0000ab18 beq v0, v1, 0xacac                |             goto label_8;
                                                 |         }
    0x0000ab1c lw v0, -0x7b6c(gp)                |         v0 = *((gp - 7899));
    0x0000ab20 bne v0, v1, 0xaab4                |         
                                                 |     } while (v0 != v1);
                                                 | label_5:
    0x0000ab24 addiu v0, zero, 0x2173            |     v0 = 0x2173;
    0x0000ab28 sw v0, (s5)                       |     *(s5) = v0;
                                                 | label_1:
    0x0000ab2c lw s4, -0x7b6c(gp)                |     s4 = *((gp - 7899));
    0x0000ab30 lw a0, -0x7fdc(gp)                |     a0 = *(gp);
    0x0000ab34 lw t9, -0x7bb0(gp)                |     t9 = sym.imp.fwrite;
    0x0000ab38 lw a3, (s4)                       |     a3 = *(s4);
    0x0000ab3c addiu a2, zero, 0xc               |     a2 = 0xc;
    0x0000ab40 addiu a1, zero, 1                 |     a1 = 1;
                                                 |     /* str.file_magic:_ */
    0x0000ab44 addiu a0, a0, -0x21a8             |     a0 += -0x21a8;
    0x0000ab48 jalr t9                           |     t9 ();
    0x0000ab4c lw v1, (s5)                       |     v1 = *(s5);
    0x0000ab50 addiu v0, zero, 0x2171            |     v0 = 0x2171;
    0x0000ab54 lw gp, 0x18(sp)                   |     gp = *(var_18h);
                                                 |     if (v1 == v0) {
    0x0000ab58 beq v1, v0, 0xacd4                |         goto label_9;
                                                 |     }
                                                 | label_2:
    0x0000ab5c lw v0, (s1)                       |     v0 = *(s1);
    0x0000ab60 addiu a1, zero, 0x7521            |     a1 = 0x7521;
    0x0000ab64 addiu v1, zero, 0x2175            |     v1 = 0x2175;
                                                 |     if (v0 == 0) {
    0x0000ab68 movn v1, a1, v0                   |         v1 = a1;
                                                 |     }
    0x0000ab6c lw a0, 8(s0)                      |     a0 = *((s0 + 2));
    0x0000ab70 move v0, v1                       |     v0 = v1;
    0x0000ab74 sh v0, 2(s0)                      |     *((s0 + 1)) = v0;
    0x0000ab78 addiu v0, zero, 0x148             |     v0 = aav.0x00000148;
    0x0000ab7c sw a0, (s7)                       |     *(s7) = a0;
    0x0000ab80 addiu v1, zero, 1                 |     v1 = 1;
    0x0000ab84 lw t9, -0x7bf4(gp)                |     t9 = sym.imp.memset;
    0x0000ab88 sw v0, 8(s0)                      |     *((s0 + 2)) = v0;
    0x0000ab8c addiu v0, zero, 0xb               |     v0 = 0xb;
    0x0000ab90 sw v1, 0x10(s0)                   |     *((s0 + 4)) = v1;
    0x0000ab94 sw v1, 0x14(s0)                   |     *((s0 + 5)) = v1;
    0x0000ab98 addiu a2, zero, 0x30              |     a2 = 0x30;
    0x0000ab9c move a1, zero                     |     a1 = 0;
    0x0000aba0 addiu a0, s0, 0x1c                |     a0 = s0 + 0x1c;
    0x0000aba4 sw v0, 0x18(s0)                   |     *((s0 + 6)) = v0;
    0x0000aba8 jalr t9                           |     t9 ();
    0x0000abac lw gp, 0x18(sp)                   |     gp = *(var_18h);
    0x0000abb0 addiu s5, sp, 0x30                |     s5 = sp + 0x30;
    0x0000abb4 lw t9, -0x7e98(gp)                |     t9 = sym.enum_version_nr;
    0x0000abb8 move a0, s5                       |     a0 = s5;
    0x0000abbc jalr t9                           |     t9 ();
    0x0000abc0 lbu v1, 0x35(sp)                  |     v1 = *(var_35h);
    0x0000abc4 lbu v0, 0x36(sp)                  |     v0 = *(var_36h);
    0x0000abc8 sll v1, v1, 8                     |     v1 <<= 8;
    0x0000abcc addu v1, v1, v0                   |     v1 += v0;
    0x0000abd0 addiu v1, v1, 1                   |     v1++;
    0x0000abd4 lw gp, 0x18(sp)                   |     gp = *(var_18h);
    0x0000abd8 move v0, s0                       |     v0 = s0;
    0x0000abdc sw v1, 0xc(s0)                    |     *((s0 + 3)) = v1;
    0x0000abe0 addiu t0, s0, 0x40                |     t0 = s0 + 0x40;
    0x0000abe4 move v1, s5                       |     v1 = s5;
                                                 |     do {
    0x0000abe8 lwl a3, 3(v0)                     |         __asm ("lwl a3, 3(v0)");
    0x0000abec lwl a2, 7(v0)                     |         __asm ("lwl a2, 7(v0)");
    0x0000abf0 lwl a1, 0xb(v0)                   |         __asm ("lwl a1, 0xb(v0)");
    0x0000abf4 lwl a0, 0xf(v0)                   |         __asm ("lwl a0, 0xf(v0)");
    0x0000abf8 lwr a3, (v0)                      |         __asm ("lwr a3, (v0)");
    0x0000abfc lwr a2, 4(v0)                     |         __asm ("lwr a2, 4(v0)");
    0x0000ac00 lwr a1, 8(v0)                     |         __asm ("lwr a1, 8(v0)");
    0x0000ac04 lwr a0, 0xc(v0)                   |         __asm ("lwr a0, 0xc(v0)");
    0x0000ac08 addiu v0, v0, 0x10                |         v0 += 0x10;
    0x0000ac0c sw a3, (v1)                       |         *(v1) = a3;
    0x0000ac10 sw a2, 4(v1)                      |         *((v1 + 1)) = a2;
    0x0000ac14 sw a1, 8(v1)                      |         *((v1 + 2)) = a1;
    0x0000ac18 sw a0, 0xc(v1)                    |         *((v1 + 3)) = a0;
    0x0000ac1c addiu v1, v1, 0x10                |         v1 += 0x10;
    0x0000ac20 bne v0, t0, 0xabe8                |         
                                                 |     } while (v0 != t0);
    0x0000ac24 lwl a0, 0xb(v0)                   |     __asm ("lwl a0, 0xb(v0)");
    0x0000ac28 lwl a2, 3(v0)                     |     __asm ("lwl a2, 3(v0)");
    0x0000ac2c lwl a1, 7(v0)                     |     __asm ("lwl a1, 7(v0)");
    0x0000ac30 lwr a0, 8(v0)                     |     __asm ("lwr a0, 8(v0)");
    0x0000ac34 lwr a2, (v0)                      |     __asm ("lwr a2, (v0)");
    0x0000ac38 lwr a1, 4(v0)                     |     __asm ("lwr a1, 4(v0)");
    0x0000ac3c move v0, a0                       |     v0 = a0;
    0x0000ac40 lw a0, (s1)                       |     a0 = *(s1);
    0x0000ac44 sw a2, (v1)                       |     *(v1) = a2;
    0x0000ac48 sw a1, 4(v1)                      |     *((v1 + 1)) = a1;
    0x0000ac4c sw v0, 8(v1)                      |     *((v1 + 2)) = v0;
    0x0000ac50 bnez a0, 0xacb8                   |     
                                                 |     while (1) {
    0x0000ac54 lw t9, -0x7e94(gp)                |         t9 = sym.write_all;
    0x0000ac58 addiu a2, zero, 0x4c              |         a2 = 0x4c;
    0x0000ac5c move a1, s5                       |         a1 = s5;
    0x0000ac60 move a0, s3                       |         a0 = s3;
    0x0000ac64 jalr t9                           |         t9 ();
    0x0000ac68 addiu v1, zero, 0x4c              |         v1 = 0x4c;
    0x0000ac6c lw gp, 0x18(sp)                   |         gp = *(var_18h);
                                                 |         if (v0 != v1) {
    0x0000ac70 bne v0, v1, 0xad38                |             goto label_10;
                                                 |         }
    0x0000ac74 lw a0, -0x7fdc(gp)                |         a0 = *(gp);
    0x0000ac78 lw t9, -0x7bb0(gp)                |         t9 = sym.imp.fwrite;
    0x0000ac7c lw a3, (s4)                       |         a3 = *(s4);
    0x0000ac80 addiu a2, zero, 3                 |         a2 = 3;
    0x0000ac84 addiu a1, zero, 1                 |         a1 = 1;
                                                 |         /* esilref: 'OK
' */
    0x0000ac88 addiu a0, a0, -0x2180             |         a0 += -0x2180;
    0x0000ac8c jalr t9                           |         t9 ();
    0x0000ac90 lw gp, 0x18(sp)                   |         gp = *(var_18h);
    0x0000ac94 move v0, zero                     |         v0 = 0;
    0x0000ac98 b 0xaad8                          |         goto label_0;
                                                 | label_3:
    0x0000ac9c addiu v0, zero, 0x2175            |         v0 = 0x2175;
    0x0000aca0 sw v0, (s5)                       |         *(s5) = v0;
    0x0000aca4 move v0, zero                     |         v0 = 0;
    0x0000aca8 b 0xaad8                          |         goto label_0;
                                                 | label_8:
    0x0000acac addiu v0, zero, 0x2171            |         v0 = 0x2171;
                                                 | label_6:
    0x0000acb0 sw v0, (s5)                       |         *(s5) = v0;
    0x0000acb4 b 0xab2c                          |         goto label_1;
    0x0000acb8 lw t9, -0x7e90(gp)                |         t9 = sym.swap_struct;
    0x0000acbc move a2, zero                     |         a2 = 0;
    0x0000acc0 addiu a1, sp, 0x38                |         a1 = sp + 0x38;
    0x0000acc4 addiu a0, sp, 0x24                |         a0 = sp + 0x24;
    0x0000acc8 jalr t9                           |         t9 ();
    0x0000accc lw gp, 0x18(sp)                   |         gp = *(var_18h);
    0x0000acd0 b 0xac54                          |         
                                                 |     }
                                                 | label_9:
    0x0000acd4 lw t9, -0x7b88(gp)                |     t9 = sym.imp.lseek;
    0x0000acd8 lw a0, (s6)                       |     a0 = *(s6);
    0x0000acdc addiu a2, zero, 1                 |     a2 = 1;
    0x0000ace0 addiu a1, zero, -0x44             |     a1 = -0x44;
    0x0000ace4 jalr t9                           |     t9 ();
    0x0000ace8 lw gp, 0x18(sp)                   |     gp = *(var_18h);
                                                 |     if (v0 >= 0) {
    0x0000acec bgez v0, 0xab5c                   |         goto label_2;
                                                 |     }
    0x0000acf0 lw t9, -0x7bfc(gp)                |     t9 = sym.imp.__errno_location;
    0x0000acf4 lw s0, (s4)                       |     s0 = *(s4);
    0x0000acf8 jalr t9                           |     t9 ();
    0x0000acfc lw gp, 0x18(sp)                   |     gp = *(var_18h);
    0x0000ad00 lw t9, -0x7bc8(gp)                |     t9 = sym.imp.strerror;
    0x0000ad04 lw a0, (v0)                       |     a0 = *(v0);
    0x0000ad08 jalr t9                           |     t9 ();
    0x0000ad0c lw gp, 0x18(sp)                   |     gp = *(var_18h);
    0x0000ad10 move a3, v0                       |     a3 = v0;
    0x0000ad14 lw a2, -0x7fdc(gp)                |     a2 = *(gp);
    0x0000ad18 lw t9, -0x7c44(gp)                |     t9 = sym.imp.__fprintf_chk
                                                 |     /* str._nlseek:__s_n */
    0x0000ad1c addiu a2, a2, -0x2198             |     a2 += -0x2198;
                                                 |     do {
    0x0000ad20 addiu a1, zero, 1                 |         a1 = 1;
    0x0000ad24 move a0, s0                       |         a0 = s0;
    0x0000ad28 jalr t9                           |         t9 ();
    0x0000ad2c lw gp, 0x18(sp)                   |         gp = *(var_18h);
    0x0000ad30 addiu v0, zero, -1                |         v0 = -1;
    0x0000ad34 b 0xaad8                          |         goto label_0;
                                                 | label_10:
    0x0000ad38 lw t9, -0x7bfc(gp)                |         t9 = sym.imp.__errno_location;
    0x0000ad3c lw s0, (s4)                       |         s0 = *(s4);
    0x0000ad40 jalr t9                           |         t9 ();
    0x0000ad44 lw gp, 0x18(sp)                   |         gp = *(var_18h);
    0x0000ad48 lw t9, -0x7bc8(gp)                |         t9 = sym.imp.strerror;
    0x0000ad4c lw a0, (v0)                       |         a0 = *(v0);
    0x0000ad50 jalr t9                           |         t9 ();
    0x0000ad54 lw gp, 0x18(sp)                   |         gp = *(var_18h);
    0x0000ad58 move a3, v0                       |         a3 = v0;
    0x0000ad5c lw a2, -0x7fdc(gp)                |         a2 = *(gp);
    0x0000ad60 lw t9, -0x7c44(gp)                |         t9 = sym.imp.__fprintf_chk
                                                 |         /* str._nwrite:__s_n */
    0x0000ad64 addiu a2, a2, -0x218c             |         a2 += -0x218c;
    0x0000ad68 b 0xad20                          |         
                                                 |     } while (1);
                                                 | label_7:
    0x0000ad6c lw t9, -0x7b90(gp)                |     t9 = sym.imp.__stack_chk_fail;
    0x0000ad70 jalr t9                           |     t9 ();
    0x0000ad74 nop                               |     
                                                 | }
    ; assembly                                   | /* r2dec pseudo code output */
                                                 | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0xd794 */
                                                 | #include <stdint.h>
                                                 |  
    ; (fcn) sym.upgrade_record_header ()         | void upgrade_record_header () {
    0x0000d794 lui gp, 7                         |     
    0x0000d798 addiu gp, gp, 0x182c              |     
    0x0000d79c addu gp, gp, t9                   |     gp += t9;
    0x0000d7a0 addiu sp, sp, -0x50               |     
    0x0000d7a4 lw v0, 0x10(a2)                   |     v0 = *((a2 + 4));
    0x0000d7a8 addiu a0, zero, 0x64              |     a0 = 0x64;
    0x0000d7ac sw s0, 0x3c(sp)                   |     *(var_3ch) = s0;
    0x0000d7b0 move s0, a2                       |     s0 = a2;
    0x0000d7b4 lw a2, 0x14(a2)                   |     a2 = *((a2 + 5));
    0x0000d7b8 multu v0, a0                      |     __asm ("multu v0, a0");
    0x0000d7bc mflo v0                           |     __asm ("mflo v0");
    0x0000d7c0 mfhi v1                           |     __asm ("mfhi v1");
    0x0000d7c4 mul t1, a2, a0                    |     __asm ("mul t1, a2, a0");
    0x0000d7c8 sw s1, 0x40(sp)                   |     *(var_40h) = s1;
    0x0000d7cc lw s1, -0x7b7c(gp)                |     s1 = *((gp - 7903));
    0x0000d7d0 lw a0, -0x7e8c(gp)                |     a0 = *(gp);
    0x0000d7d4 lw t9, -0x7f70(gp)                |     t9 = *((gp - 8156));
    0x0000d7d8 lw t0, (s1)                       |     t0 = *(s1);
    0x0000d7dc addu v1, t1, v1                   |     v1 = t1 + v1;
    0x0000d7e0 lw a2, (a0)                       |     a2 = *(a0);
    0x0000d7e4 sw gp, 0x10(sp)                   |     *(var_10h_2) = gp;
    0x0000d7e8 sw s3, 0x48(sp)                   |     *(var_48h) = s3;
    0x0000d7ec sw s2, 0x44(sp)                   |     *(var_44h) = s2;
    0x0000d7f0 move a0, v0                       |     a0 = v0;
    0x0000d7f4 sw ra, 0x4c(sp)                   |     *(var_4ch_2) = ra;
    0x0000d7f8 move s2, a1                       |     s2 = a1;
    0x0000d7fc move s3, a3                       |     s3 = a3;
    0x0000d800 move a1, v1                       |     a1 = v1;
    0x0000d804 sw t0, 0x34(sp)                   |     *(var_34h) = t0;
    0x0000d808 move a3, zero                     |     a3 = 0;
    0x0000d80c jalr t9                           |     t9 ();
    0x0000d810 lw a1, 0x20(s0)                   |     a1 = *((s0 + 8));
    0x0000d814 lw a0, 0x28(s0)                   |     a0 = *((s0 + 10));
    0x0000d818 lw gp, 0x10(sp)                   |     gp = *(var_10h_2);
    0x0000d81c sw v0, 0x18(sp)                   |     *(var_18h) = v0;
    0x0000d820 sw v1, 0x1c(sp)                   |     *(var_1ch) = v1;
    0x0000d824 sw a1, 0x20(sp)                   |     *(var_20h) = a1;
    0x0000d828 sw zero, 0x24(sp)                 |     *(var_24h_2) = 0;
    0x0000d82c sw a0, 0x28(sp)                   |     *(var_28h) = a0;
                                                 |     if (s3 != 0) {
    0x0000d830 bnez s3, 0xd89c                   |         goto label_1;
                                                 |     }
    0x0000d834 addiu s0, sp, 0x18                |     s0 = sp + 0x18;
                                                 |     do {
    0x0000d838 lw t9, -0x7e94(gp)                |         t9 = sym.write_all;
    0x0000d83c addiu a2, zero, 0x18              |         a2 = 0x18;
    0x0000d840 move a1, s0                       |         a1 = s0;
    0x0000d844 move a0, s2                       |         a0 = s2;
    0x0000d848 jalr t9                           |         t9 ();
    0x0000d84c addiu v1, zero, 0x18              |         v1 = 0x18;
    0x0000d850 lw gp, 0x10(sp)                   |         gp = *(var_10h_2);
                                                 |         if (v0 != v1) {
    0x0000d854 bne v0, v1, 0xd8bc                |             goto label_2;
                                                 |         }
    0x0000d858 lw v0, -0x7b6c(gp)                |         v0 = *((gp - 7899));
    0x0000d85c lw t9, -0x7c34(gp)                |         t9 = sym.imp.fputc;
    0x0000d860 addiu a0, zero, 0x48              |         a0 = 0x48;
    0x0000d864 lw a1, (v0)                       |         a1 = *(v0);
    0x0000d868 jalr t9                           |         t9 ();
    0x0000d86c lw gp, 0x10(sp)                   |         gp = *(var_10h_2);
    0x0000d870 move v0, zero                     |         v0 = 0;
                                                 | label_0:
    0x0000d874 lw a0, 0x34(sp)                   |         a0 = *(var_34h);
    0x0000d878 lw v1, (s1)                       |         v1 = *(s1);
    0x0000d87c lw ra, 0x4c(sp)                   |         ra = *(var_4ch_2);
                                                 |         if (a0 != v1) {
    0x0000d880 bne a0, v1, 0xd908                |             goto label_3;
                                                 |         }
    0x0000d884 lw s3, 0x48(sp)                   |         s3 = *(var_48h);
    0x0000d888 lw s2, 0x44(sp)                   |         s2 = *(var_44h);
    0x0000d88c lw s1, 0x40(sp)                   |         s1 = *(var_40h);
    0x0000d890 lw s0, 0x3c(sp)                   |         s0 = *(var_3ch);
    0x0000d894 addiu sp, sp, 0x50                |         
    0x0000d898 jr ra                             |         return v0;
                                                 | label_1:
    0x0000d89c lw t9, -0x7e90(gp)                |         t9 = sym.swap_struct;
    0x0000d8a0 lw a0, -0x7e84(gp)                |         a0 = *(gp);
    0x0000d8a4 addiu s0, sp, 0x18                |         s0 = sp + 0x18;
    0x0000d8a8 lw a2, 0x60(sp)                   |         a2 = *(var_10h);
    0x0000d8ac move a1, s0                       |         a1 = s0;
    0x0000d8b0 jalr t9                           |         t9 ();
    0x0000d8b4 lw gp, 0x10(sp)                   |         gp = *(var_10h_2);
    0x0000d8b8 b 0xd838                          |         
                                                 |     } while (1);
                                                 | label_2:
    0x0000d8bc lw v0, -0x7b6c(gp)                |     v0 = *((gp - 7899));
    0x0000d8c0 lw t9, -0x7bfc(gp)                |     t9 = sym.imp.__errno_location;
    0x0000d8c4 lw s0, (v0)                       |     s0 = *(v0);
    0x0000d8c8 jalr t9                           |     t9 ();
    0x0000d8cc lw gp, 0x10(sp)                   |     gp = *(var_10h_2);
    0x0000d8d0 lw t9, -0x7bc8(gp)                |     t9 = sym.imp.strerror;
    0x0000d8d4 lw a0, (v0)                       |     a0 = *(v0);
    0x0000d8d8 jalr t9                           |     t9 ();
    0x0000d8dc lw gp, 0x10(sp)                   |     gp = *(var_10h_2);
    0x0000d8e0 move a3, v0                       |     a3 = v0;
    0x0000d8e4 addiu a1, zero, 1                 |     a1 = 1;
    0x0000d8e8 lw a2, -0x7fdc(gp)                |     a2 = *(gp);
    0x0000d8ec lw t9, -0x7c44(gp)                |     t9 = sym.imp.__fprintf_chk
                                                 |     /* str._nwrite:__s_n */
    0x0000d8f0 addiu a2, a2, -0x218c             |     a2 += -0x218c;
    0x0000d8f4 move a0, s0                       |     a0 = s0;
    0x0000d8f8 jalr t9                           |     t9 ();
    0x0000d8fc lw gp, 0x10(sp)                   |     gp = *(var_10h_2);
    0x0000d900 addiu v0, zero, -1                |     v0 = -1;
    0x0000d904 b 0xd874                          |     goto label_0;
                                                 | label_3:
    0x0000d908 lw t9, -0x7b90(gp)                |     t9 = sym.imp.__stack_chk_fail;
    0x0000d90c jalr t9                           |     t9 ();
    0x0000d910 nop                               |     
                                                 | }
    ; assembly                                   | /* r2dec pseudo code output */
                                                 | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0xda28 */
                                                 | #include <stdint.h>
                                                 |  
    ; (fcn) sym.upgrade_restart_record ()        | void upgrade_restart_record () {
    0x0000da28 lui gp, 7                         |     
    0x0000da2c addiu gp, gp, 0x1598              |     
    0x0000da30 addu gp, gp, t9                   |     gp += t9;
    0x0000da34 addiu sp, sp, -0x68               |     
    0x0000da38 lw a3, 0x10(a3)                   |     a3 = *((a3 + 4));
    0x0000da3c sw s4, 0x50(sp)                   |     *(var_50h) = s4;
    0x0000da40 lw s4, -0x7b7c(gp)                |     s4 = *((gp - 7903));
    0x0000da44 lw v1, 0x78(sp)                   |     v1 = *(arg_78h);
    0x0000da48 sw gp, 0x18(sp)                   |     *(var_18h) = gp;
    0x0000da4c lw t0, (s4)                       |     t0 = *(s4);
    0x0000da50 addiu v0, zero, 0x2173            |     v0 = 0x2173;
    0x0000da54 sw s6, 0x58(sp)                   |     *(var_58h) = s6;
    0x0000da58 sw s2, 0x48(sp)                   |     *(var_48h) = s2;
    0x0000da5c sw s1, 0x44(sp)                   |     *(var_44h) = s1;
    0x0000da60 sw ra, 0x64(sp)                   |     *(var_64h) = ra;
    0x0000da64 sw fp, 0x60(sp)                   |     *(var_60h) = fp;
    0x0000da68 sw s7, 0x5c(sp)                   |     *(var_5ch) = s7;
    0x0000da6c sw s5, 0x54(sp)                   |     *(var_54h) = s5;
    0x0000da70 sw s3, 0x4c(sp)                   |     *(var_4ch) = s3;
    0x0000da74 sw s0, 0x40(sp)                   |     *(var_40h) = s0;
    0x0000da78 move s6, a1                       |     s6 = a1;
    0x0000da7c lw s1, 0x7c(sp)                   |     s1 = *(arg_7ch);
    0x0000da80 lw s2, 0x84(sp)                   |     s2 = *(arg_84h);
    0x0000da84 sw t0, 0x3c(sp)                   |     *(var_3ch) = t0;
    0x0000da88 sw a3, 0x24(sp)                   |     *(var_24h) = a3;
                                                 |     if (v1 != v0) {
    0x0000da8c beq v1, v0, 0xdb1c                |         
                                                 | label_3:
    0x0000da90 lw t9, -0x7e94(gp)                |         t9 = sym.write_all;
                                                 |         if (s1 != 0) {
    0x0000da94 beqz s1, 0xdaa8                   |             
    0x0000da98 lw v0, 0x24(sp)                   |             v0 = *(var_24h);
    0x0000da9c wsbh v0, v0                       |             __asm ("wsbh v0, v0");
    0x0000daa0 rotr v0, v0, 0x10                 |             __asm ("rotr v0, v0, 0x10");
    0x0000daa4 sw v0, 0x24(sp)                   |             *(var_24h) = v0;
                                                 |         }
    0x0000daa8 addiu a2, zero, 4                 |         a2 = 4;
    0x0000daac addiu a1, sp, 0x24                |         a1 = sp + 0x24;
    0x0000dab0 move a0, s6                       |         a0 = s6;
    0x0000dab4 jalr t9                           |         t9 ();
    0x0000dab8 addiu v1, zero, 4                 |         v1 = 4;
    0x0000dabc lw gp, 0x18(sp)                   |         gp = *(var_18h);
                                                 |         if (v0 != v1) {
    0x0000dac0 bne v0, v1, 0xdbe8                |             goto label_5;
                                                 |         }
    0x0000dac4 lw v0, -0x7b6c(gp)                |         v0 = *((gp - 7899));
    0x0000dac8 lw t9, -0x7c34(gp)                |         t9 = sym.imp.fputc;
    0x0000dacc addiu a0, zero, 0x52              |         a0 = 0x52;
    0x0000dad0 lw a1, (v0)                       |         a1 = *(v0);
    0x0000dad4 jalr t9                           |         t9 ();
    0x0000dad8 lw gp, 0x18(sp)                   |         gp = *(var_18h);
    0x0000dadc move v0, zero                     |         v0 = 0;
                                                 | label_4:
    0x0000dae0 lw a0, 0x3c(sp)                   |         a0 = *(var_3ch);
    0x0000dae4 lw v1, (s4)                       |         v1 = *(s4);
    0x0000dae8 lw ra, 0x64(sp)                   |         ra = *(var_64h);
                                                 |         if (a0 != v1) {
    0x0000daec bne a0, v1, 0xdc34                |             goto label_6;
                                                 |         }
    0x0000daf0 lw fp, 0x60(sp)                   |         fp = *(var_60h);
    0x0000daf4 lw s7, 0x5c(sp)                   |         s7 = *(var_5ch);
    0x0000daf8 lw s6, 0x58(sp)                   |         s6 = *(var_58h);
    0x0000dafc lw s5, 0x54(sp)                   |         s5 = *(var_54h);
    0x0000db00 lw s4, 0x50(sp)                   |         s4 = *(var_50h);
    0x0000db04 lw s3, 0x4c(sp)                   |         s3 = *(var_4ch);
    0x0000db08 lw s2, 0x48(sp)                   |         s2 = *(var_48h);
    0x0000db0c lw s1, 0x44(sp)                   |         s1 = *(var_44h);
    0x0000db10 lw s0, 0x40(sp)                   |         s0 = *(var_40h);
    0x0000db14 addiu sp, sp, 0x68                |         
    0x0000db18 jr ra                             |         return v0;
                                                 |     }
    0x0000db1c move s5, a2                       |     s5 = a2;
                                                 |     if (s2 == 0) {
    0x0000db20 beqz s2, 0xdbd4                   |         goto label_7;
                                                 |     }
    0x0000db24 move s3, a0                       |     s3 = a0;
    0x0000db28 lw s7, -0x7e78(gp)                |     s7 = *(gp);
    0x0000db2c move s0, zero                     |     s0 = 0;
    0x0000db30 addiu fp, sp, 0x28                |     fp = sp + 0x28;
    0x0000db34 b 0xdb5c                          |     
                                                 |     while (s1 == 0) {
                                                 | label_0:
    0x0000db38 lw a1, 0x28(sp)                   |         a1 = *(var_28h_2);
                                                 |         if (a1 != 0) {
    0x0000db3c beql a1, zero, 0xdb54             |             
    0x0000db40 addiu s0, s0, 1                   |             s0++;
    0x0000db44 lw v0, 0x30(sp)                   |             v0 = *(var_30h_3);
    0x0000db48 lw t9, -0x7f80(gp)                |             t9 = sym.get_activity_position;
                                                 |             if (v0 > 0) {
    0x0000db4c bgtz v0, 0xdb9c                   |                 goto label_8;
                                                 |             }
                                                 | label_1:
    0x0000db50 addiu s0, s0, 1                   |             s0++;
                                                 |         }
    0x0000db54 lw t9, -0x7f38(gp)                |         t9 = sym.allocate_structures;
                                                 |         if (s0 == s2) {
    0x0000db58 beq s0, s2, 0xdbd8                |             goto label_9;
                                                 |         }
                                                 | label_2:
    0x0000db5c lw t9, -0x7e80(gp)                |         t9 = sym.sa_fread;
    0x0000db60 sw zero, 0x10(sp)                 |         *(var_80h) = 0;
    0x0000db64 addiu a3, zero, 1                 |         a3 = 1;
    0x0000db68 addiu a2, zero, 0x14              |         a2 = 0x14;
    0x0000db6c move a1, fp                       |         a1 = fp;
    0x0000db70 move a0, s3                       |         a0 = s3;
    0x0000db74 jalr t9                           |         t9 ();
    0x0000db78 lw gp, 0x18(sp)                   |         gp = *(var_18h);
    0x0000db7c beqz s1, 0xdb38                   |         
                                                 |     }
    0x0000db80 lw t9, -0x7e90(gp)                |     t9 = sym.swap_struct;
    0x0000db84 lw a2, 0x80(sp)                   |     a2 = *(arg_80h);
    0x0000db88 move a1, fp                       |     a1 = fp;
    0x0000db8c move a0, s7                       |     a0 = s7;
    0x0000db90 jalr t9                           |     t9 ();
    0x0000db94 lw gp, 0x18(sp)                   |     gp = *(var_18h);
    0x0000db98 b 0xdb38                          |     goto label_0;
                                                 | label_8:
    0x0000db9c move a0, s5                       |     a0 = s5;
    0x0000dba0 addiu a2, zero, 1                 |     a2 = 1;
    0x0000dba4 jalr t9                           |     t9 ();
    0x0000dba8 sll v0, v0, 2                     |     v0 <<= 2;
    0x0000dbac lw v1, 0x30(sp)                   |     v1 = *(var_30h_3);
    0x0000dbb0 lwx v0, v0(s5)                    |     __asm ("lwx v0, v0(s5)");
    0x0000dbb4 lw a1, 0x28(sp)                   |     a1 = *(var_28h_2);
    0x0000dbb8 addiu a0, zero, 1                 |     a0 = 1;
    0x0000dbbc lw gp, 0x18(sp)                   |     gp = *(var_18h);
    0x0000dbc0 sw v1, 0x70(v0)                   |     *((v0 + 28)) = v1;
                                                 |     if (a1 != a0) {
    0x0000dbc4 bne a1, a0, 0xdb50                |         goto label_1;
                                                 |     }
    0x0000dbc8 addiu s0, s0, 1                   |     s0++;
    0x0000dbcc sw v1, 0x24(sp)                   |     *(var_24h) = v1;
                                                 |     if (s0 != s2) {
    0x0000dbd0 bne s0, s2, 0xdb5c                |         goto label_2;
                                                 |     }
                                                 | label_7:
    0x0000dbd4 lw t9, -0x7f38(gp)                |     t9 = sym.allocate_structures;
                                                 | label_9:
    0x0000dbd8 move a0, s5                       |     a0 = s5;
    0x0000dbdc jalr t9                           |     t9 ();
    0x0000dbe0 lw gp, 0x18(sp)                   |     gp = *(var_18h);
    0x0000dbe4 b 0xda90                          |     goto label_3;
                                                 | label_5:
    0x0000dbe8 lw v0, -0x7b6c(gp)                |     v0 = *((gp - 7899));
    0x0000dbec lw t9, -0x7bfc(gp)                |     t9 = sym.imp.__errno_location;
    0x0000dbf0 lw s0, (v0)                       |     s0 = *(v0);
    0x0000dbf4 jalr t9                           |     t9 ();
    0x0000dbf8 lw gp, 0x18(sp)                   |     gp = *(var_18h);
    0x0000dbfc lw t9, -0x7bc8(gp)                |     t9 = sym.imp.strerror;
    0x0000dc00 lw a0, (v0)                       |     a0 = *(v0);
    0x0000dc04 jalr t9                           |     t9 ();
    0x0000dc08 lw gp, 0x18(sp)                   |     gp = *(var_18h);
    0x0000dc0c move a3, v0                       |     a3 = v0;
    0x0000dc10 addiu a1, zero, 1                 |     a1 = 1;
    0x0000dc14 lw a2, -0x7fdc(gp)                |     a2 = *(gp);
    0x0000dc18 lw t9, -0x7c44(gp)                |     t9 = sym.imp.__fprintf_chk
                                                 |     /* str._nwrite:__s_n */
    0x0000dc1c addiu a2, a2, -0x218c             |     a2 += -0x218c;
    0x0000dc20 move a0, s0                       |     a0 = s0;
    0x0000dc24 jalr t9                           |     t9 ();
    0x0000dc28 lw gp, 0x18(sp)                   |     gp = *(var_18h);
    0x0000dc2c addiu v0, zero, -1                |     v0 = -1;
    0x0000dc30 b 0xdae0                          |     goto label_4;
                                                 | label_6:
    0x0000dc34 lw t9, -0x7b90(gp)                |     t9 = sym.imp.__stack_chk_fail;
    0x0000dc38 jalr t9                           |     t9 ();
    0x0000dc3c nop                               |     
                                                 | }
    ; assembly                           | /* r2dec pseudo code output */
                                         | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/bin/sadf @ 0x5260 */
                                         | #include <stdint.h>
                                         |  
    ; (fcn) sym.usage ()                 | void usage () {
    0x00005260 lui gp, 8                 |     
    0x00005264 addiu gp, gp, -0x62a0     |     
    0x00005268 addu gp, gp, t9           |     gp += t9;
    0x0000526c addiu sp, sp, -0x20       |     
    0x00005270 lw a2, -0x7fdc(gp)        |     a2 = *(gp);
    0x00005274 sw s0, 0x18(sp)           |     *(var_18h) = s0;
    0x00005278 lw s0, -0x7b6c(gp)        |     s0 = *((gp - 7899));
    0x0000527c lw t9, -0x7c44(gp)        |     t9 = sym.imp.__fprintf_chk
    0x00005280 move a3, a0               |     a3 = a0;
    0x00005284 lw a0, (s0)               |     a0 = *(s0);
    0x00005288 sw gp, 0x10(sp)           |     *(var_10h) = gp;
    0x0000528c sw ra, 0x1c(sp)           |     *(var_1ch) = ra;
                                         |     /* str.Usage:__s___options______interval_____count_________datafile_____0_9____n */
    0x00005290 addiu a2, a2, -0x3e7c     |     a2 += -0x3e7c;
    0x00005294 addiu a1, zero, 1         |     a1 = 1;
    0x00005298 jalr t9                   |     t9 ();
    0x0000529c lw gp, 0x10(sp)           |     gp = *(var_10h);
    0x000052a0 lw a3, (s0)               |     a3 = *(s0);
    0x000052a4 addiu a2, zero, 0x11d     |     a2 = 0x11d;
    0x000052a8 lw a0, -0x7fdc(gp)        |     a0 = *(gp);
    0x000052ac lw t9, -0x7bb0(gp)        |     t9 = sym.imp.fwrite;
                                         |     /* str.Options_are:_n___C______c___d___g___j___l___p___r___x______H______h______T___t___U______V___n___O__opts____..._______P___cpu____...___ALL____n____dev_dev_list________fs_fs_list________iface_iface_list____n___s____hh:mm_:ss__________e____hh:mm_:ss_______n______sar_options____n */
    0x000052b0 addiu a0, a0, -0x3e30     |     a0 += -0x3e30;
    0x000052b4 addiu a1, zero, 1         |     a1 = 1;
    0x000052b8 jalr t9                   |     t9 ();
    0x000052bc lw gp, 0x10(sp)           |     gp = *(var_10h);
    0x000052c0 lw t9, -0x7bd0(gp)        |     t9 = sym.imp.exit;
    0x000052c4 addiu a0, zero, 1         |     a0 = 1;
    0x000052c8 jalr t9                   |     t9 ();
    0x000052cc lui gp, 8                 |     
    0x000052d0 addiu gp, gp, -0x630c     |     
    0x000052d4 addu gp, gp, t9           |     gp += t9;
    0x000052d8 lw v0, -0x7fd8(gp)        |     v0 = *(gp);
    0x000052dc sw zero, (v0)             |     *(v0) = 0;
    0x000052e0 sw zero, 4(v0)            |     *((v0 + 1)) = 0;
    0x000052e4 sw zero, 8(v0)            |     *((v0 + 2)) = 0;
    0x000052e8 sw zero, 0xc(v0)          |     *((v0 + 3)) = 0;
    0x000052ec sw zero, 0x10(v0)         |     *((v0 + 4)) = 0;
    0x000052f0 sw zero, 0x14(v0)         |     *((v0 + 5)) = 0;
    0x000052f4 sw zero, 0x18(v0)         |     *((v0 + 6)) = 0;
    0x000052f8 sw zero, 0x1c(v0)         |     *((v0 + 7)) = 0;
    0x000052fc sw zero, 0x20(v0)         |     *((v0 + 8)) = 0;
    0x00005300 sw zero, 0x24(v0)         |     *((v0 + 9)) = 0;
    0x00005304 sw zero, 0x28(v0)         |     *((v0 + 10)) = 0;
    0x00005308 sw zero, 0x2c(v0)         |     *((v0 + 11)) = 0;
    0x0000530c sw zero, 0x30(v0)         |     *((v0 + 12)) = 0;
    0x00005310 sw zero, 0x34(v0)         |     *((v0 + 13)) = 0;
    0x00005314 sw zero, 0x38(v0)         |     *((v0 + 14)) = 0;
    0x00005318 sw zero, 0x3c(v0)         |     *((v0 + 15)) = 0;
    0x0000531c sw zero, 0x40(v0)         |     *((v0 + 16)) = 0;
    0x00005320 sw zero, 0x44(v0)         |     *((v0 + 17)) = 0;
    0x00005324 jr ra                     |     return v0;
                                         | }

[*] Function fprintf used 29 times sadf