[*] Binary protection state of cryptsetup-reencrypt

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


[*] Function sprintf tear down of cryptsetup-reencrypt

    ; assembly                           | /* r2dec pseudo code output */
                                         | /* /logs/firmware/unblob_extracted/firmware_extract/4325012-58052244.squashfs_v4_le_extract/usr/sbin/cryptsetup-reencrypt @ 0x9310 */
                                         | #include <stdint.h>
                                         |  
    ; (fcn) fcn.00009310 ()              | void fcn_00009310 () {
    0x00009310 lui gp, 3                 |     
    0x00009314 addiu gp, gp, -0x7b10     |     
    0x00009318 addu gp, gp, t9           |     gp += t9;
    0x0000931c addiu sp, sp, -0x10e8     |     
    0x00009320 lw t9, -0x7e94(gp)        |     t9 = sym.imp.__xstat64;
    0x00009324 sw s0, 0x10d4(sp)         |     *(var_10d4h) = s0;
    0x00009328 lw s0, -0x7cdc(gp)        |     s0 = *((gp - 7991));
    0x0000932c sw gp, 0x20(sp)           |     *(var_20h) = gp;
    0x00009330 move a1, a0               |     a1 = a0;
    0x00009334 lw v0, (s0)               |     v0 = *(s0);
    0x00009338 sw ra, 0x10e4(sp)         |     *(var_10e4h) = ra;
    0x0000933c sw s3, 0x10e0(sp)         |     *(var_10e0h) = s3;
    0x00009340 sw s2, 0x10dc(sp)         |     *(var_10dch) = s2;
    0x00009344 sw s1, 0x10d8(sp)         |     *(var_10d8h) = s1;
    0x00009348 addiu a2, sp, 0x28        |     a2 = sp + 0x28;
    0x0000934c addiu a0, zero, 3         |     a0 = 3;
    0x00009350 sw v0, 0x10cc(sp)         |     *(var_10cch) = v0;
    0x00009354 jalr t9                   |     t9 ();
    0x00009358 nop                       |     
    0x0000935c invalid                   |     
    0x00009360 lw zero, (t8)             |     0 = *(t8);
    0x00009364 lw v0, 0x40(sp)           |     v0 = *(var_40h);
    0x00009368 addiu v1, zero, 0x6000    |     v1 = 0x6000;
    0x0000936c andi v0, v0, 0xf000       |     v0 &= 0xf000;
    0x00009370 lw v0, 0x50(sp)           |     v0 = *(var_50h);
                                         |     if (v0 == v1) {
    0x00009374 bne v0, v1, 0x9434        |         
    0x00009378 addiu a1, zero, -0x100    |         a1 = -0x100;
    0x0000937c andi a0, v0, 0xff         |         a0 = v0 & 0xff;
    0x00009380 srl v1, v0, 0xc           |         v1 = v0 >> 0xc;
    0x00009384 ext v0, v0, 8, 0xc        |         __asm ("ext v0, v0, 8, 0xc");
    0x00009388 sw v0, 0x14(sp)           |         *(var_14h) = v0;
    0x0000938c lw v0, -0x7fd4(gp)        |         v0 = *(gp);
    0x00009390 and v1, v1, a1            |         v1 &= a1;
    0x00009394 or v1, v1, a0             |         v1 |= a0;
    0x00009398 lw t9, -0x7d48(gp)        |         t9 = sym.imp.__snprintf_chk;
    0x0000939c addiu s1, sp, 0xcc        |         s1 = sp + 0xcc;
                                         |         /* esilref: '/sys/dev/block/&d:&d/loop/backing_file' */
    0x000093a0 addiu v0, v0, 0x1300      |         v0 += 0x1300;
    0x000093a4 addiu a3, zero, 0x1000    |         a3 = 0x1000;
    0x000093a8 addiu a2, zero, 1         |         a2 = 1;
    0x000093ac addiu a1, zero, 0x1000    |         a1 = 0x1000;
    0x000093b0 move a0, s1               |         a0 = s1;
    0x000093b4 sw v1, 0x18(sp)           |         *(var_18h_3) = v1;
    0x000093b8 sw v0, 0x10(sp)           |         *(var_280h) = v0;
    0x000093bc jalr t9                   |         t9 ();
    0x000093c0 lw gp, 0x20(sp)           |         gp = *(var_20h);
    0x000093c4 move a1, zero             |         a1 = 0;
    0x000093c8 lw t9, -0x7cd0(gp)        |         t9 = sym.imp.open64;
    0x000093cc move a0, s1               |         a0 = s1;
    0x000093d0 jalr t9                   |         t9 ();
    0x000093d4 move s2, v0               |         s2 = v0;
    0x000093d8 lw gp, 0x20(sp)           |         gp = *(var_20h);
                                         |         if (v0 >= 0) {
    0x000093dc bltz v0, 0x9434           |             
    0x000093e0 lw t9, -0x7e88(gp)        |             t9 = sym.imp.read;
    0x000093e4 addiu a2, zero, 0x1000    |             a2 = 0x1000;
    0x000093e8 move a1, s1               |             a1 = s1;
    0x000093ec move a0, v0               |             a0 = v0;
    0x000093f0 jalr t9                   |             t9 ();
    0x000093f4 lw gp, 0x20(sp)           |             gp = *(var_20h);
    0x000093f8 move s3, v0               |             s3 = v0;
    0x000093fc lw t9, -0x7e84(gp)        |             t9 = sym.imp.close;
    0x00009400 move a0, s2               |             a0 = s2;
    0x00009404 jalr t9                   |             t9 ();
    0x00009408 sltiu v0, s3, 2           |             v0 = (s3 < 2) ? 1 : 0;
    0x0000940c lw gp, 0x20(sp)           |             gp = *(var_20h);
                                         |             if (v0 != 0) {
    0x00009410 bnez v0, 0x9434           |                 goto label_5;
                                         |             }
    0x00009414 addiu v0, sp, 0x10d0      |             v0 = sp + 0x10d0;
    0x00009418 addu s3, v0, s3           |             s3 = v0 + s3;
    0x0000941c lw t9, -0x7ce4(gp)        |             t9 = sym.imp.strdup;
    0x00009420 move a0, s1               |             a0 = s1;
    0x00009424 sb zero, -0x1005(s3)      |             *((s3 - 4101)) = 0;
    0x00009428 jalr t9                   |             t9 ();
    0x0000942c lw gp, 0x20(sp)           |             gp = *(var_20h);
    0x00009430 b 0x9438                  |             
                                         |         }
                                         |     } else {
                                         | label_5:
    0x00009434 move v0, zero             |         v0 = 0;
                                         |     }
    0x00009438 lw a0, 0x10cc(sp)         |     a0 = *(var_10cch);
    0x0000943c lw v1, (s0)               |     v1 = *(s0);
    0x00009440 lw ra, 0x10e4(sp)         |     ra = *(var_10e4h);
                                         |     if (a0 == v1) {
    0x00009444 bne a0, v1, 0x9460        |         
    0x00009448 lw s3, 0x10e0(sp)         |         s3 = *(var_10e0h);
    0x0000944c lw s2, 0x10dc(sp)         |         s2 = *(var_10dch);
    0x00009450 lw s1, 0x10d8(sp)         |         s1 = *(var_10d8h);
    0x00009454 lw s0, 0x10d4(sp)         |         s0 = *(var_10d4h);
    0x00009458 addiu sp, sp, 0x10e8      |         
    0x0000945c jr ra                     |         return v0;
                                         |     }
    0x00009460 lw t9, -0x7dec(gp)        |     t9 = sym.imp.__stack_chk_fail;
    0x00009464 jalr t9                   |     t9 ();
    0x00009468 nop                       |     
    0x0000946c lui gp, 3                 |     
    0x00009470 addiu gp, gp, -0x7c6c     |     
    0x00009474 addu gp, gp, t9           |     gp += t9;
    0x00009478 lw v0, -0x7cdc(gp)        |     v0 = *((gp - 7991));
    0x0000947c addiu sp, sp, -0x270      |     
    0x00009480 lw t9, -0x7e68(gp)        |     t9 = sym.imp.memset;
    0x00009484 sw v0, 0x24(sp)           |     *(var_24h) = v0;
    0x00009488 lw v0, (v0)               |     v0 = *(v0);
    0x0000948c addiu v1, sp, 0x30        |     v1 = sp + 0x30;
    0x00009490 sw s7, 0x264(sp)          |     *(var_264h) = s7;
    0x00009494 lw s7, 0x280(sp)          |     s7 = *(var_280h);
    0x00009498 sw gp, 0x18(sp)           |     *(var_18h) = gp;
    0x0000949c sw ra, 0x26c(sp)          |     *(var_26ch) = ra;
    0x000094a0 sw s1, 0x24c(sp)          |     *(var_24ch) = s1;
    0x000094a4 sw s0, 0x248(sp)          |     *(var_248h) = s0;
    0x000094a8 sw v1, 0x2c(sp)           |     *(var_2ch) = v1;
    0x000094ac move s1, a0               |     s1 = a0;
    0x000094b0 move s0, a1               |     s0 = a1;
    0x000094b4 move a0, v1               |     a0 = v1;
    0x000094b8 sw a1, 0x28(sp)           |     *(var_28h_2) = a1;
    0x000094bc sw a2, 0x278(sp)          |     *(var_278h) = a2;
    0x000094c0 move a1, zero             |     a1 = 0;
    0x000094c4 addiu a2, zero, 0xe8      |     a2 = 0xe8;
    0x000094c8 sw a3, 0x27c(sp)          |     *(var_27ch) = a3;
    0x000094cc sw fp, 0x268(sp)          |     *(var_268h) = fp;
    0x000094d0 sw s6, 0x260(sp)          |     *(var_260h) = s6;
    0x000094d4 sw s5, 0x25c(sp)          |     *(var_25ch) = s5;
    0x000094d8 sw s4, 0x258(sp)          |     *(var_258h) = s4;
    0x000094dc sw s3, 0x254(sp)          |     *(var_254h) = s3;
    0x000094e0 sw s2, 0x250(sp)          |     *(var_250h) = s2;
    0x000094e4 sw v0, 0x244(sp)          |     *(var_244h) = v0;
    0x000094e8 jalr t9                   |     t9 ();
    0x000094ec nop                       |     
    0x000094f0 lw gp, 0x18(sp)           |     gp = *(var_18h);
    0x000094f4 lw a1, (s7)               |     a1 = *(s7);
    0x000094f8 addiu v1, zero, 0x400     |     v1 = 0x400;
    0x000094fc addiu v0, zero, 0x402     |     v0 = 0x402;
                                         |     if (a1 == 0) {
    0x00009500 movn v0, v1, a1           |         v0 = v1;
                                         |     }
    0x00009504 lw t9, -0x7cc8(gp)        |     t9 = sym.imp.__open64_2;
    0x00009508 sw zero, (s1)             |     *(s1) = 0;
    0x0000950c move a1, v0               |     a1 = v0;
    0x00009510 move a0, s0               |     a0 = s0;
    0x00009514 jalr t9                   |     t9 ();
    0x00009518 lw gp, 0x18(sp)           |     gp = *(var_18h);
                                         |     if (v0 < 0) {
    0x0000951c bltz v0, 0x97e8           |         goto label_6;
                                         |     }
    0x00009520 move s3, v0               |     s3 = v0;
                                         | label_3:
    0x00009524 lw s4, -0x7fd4(gp)        |     s4 = *(gp);
    0x00009528 lw s2, -0x7fd4(gp)        |     s2 = *(gp);
                                         |     /* str._dev_loop_control */
    0x0000952c addiu v0, s4, 0x1328      |     v0 = s4 + 0x1328;
    0x00009530 sw v0, 0x20(sp)           |     *(var_20h_2) = v0;
    0x00009534 addiu s4, sp, 0x204       |     s4 = sp + 0x204;
                                         |     /* str._dev_loop_d */
    0x00009538 addiu s2, s2, 0x133c      |     s2 += 0x133c;
    0x0000953c addiu fp, sp, 0x118       |     fp = sp + 0x118;
    0x00009540 b 0x9660                  |     
                                         |     while (v0 >= 0) {
    0x00009544 lw t9, -0x7eac(gp)        |         t9 = sym.imp.ioctl;
    0x00009548 move a0, v0               |         a0 = v0;
    0x0000954c addiu a1, zero, 0x4c82    |         a1 = 0x4c82;
    0x00009550 jalr t9                   |         t9 ();
    0x00009554 lw gp, 0x18(sp)           |         gp = *(var_18h);
    0x00009558 move s5, v0               |         s5 = v0;
    0x0000955c move a0, s0               |         a0 = s0;
    0x00009560 lw t9, -0x7e84(gp)        |         t9 = sym.imp.close;
                                         |         if (v0 < 0) {
    0x00009564 bltz v0, 0x97a4           |             goto label_7;
                                         |         }
    0x00009568 jalr t9                   |         t9 ();
    0x0000956c nop                       |         
    0x00009570 lw gp, 0x18(sp)           |         gp = *(var_18h);
    0x00009574 move a3, s2               |         a3 = s2;
    0x00009578 addiu a2, zero, 0x40      |         a2 = 0x40;
    0x0000957c lw t9, -0x7d38(gp)        |         t9 = sym.imp.__sprintf_chk
    0x00009580 addiu a1, zero, 1         |         a1 = 1;
    0x00009584 move a0, s4               |         a0 = s4;
    0x00009588 sw s5, 0x10(sp)           |         *(var_10h_2) = s5;
    0x0000958c jalr t9                   |         t9 ();
    0x00009590 lw gp, 0x18(sp)           |         gp = *(var_18h);
    0x00009594 move a2, fp               |         a2 = fp;
    0x00009598 move a1, s4               |         a1 = s4;
    0x0000959c lw t9, -0x7e94(gp)        |         t9 = sym.imp.__xstat64;
    0x000095a0 addiu a0, zero, 3         |         a0 = 3;
    0x000095a4 jalr t9                   |         t9 ();
    0x000095a8 lw gp, 0x18(sp)           |         gp = *(var_18h);
                                         |         if (v0 != 0) {
    0x000095ac bnez v0, 0x97b0           |             goto label_8;
                                         |         }
    0x000095b0 lw v0, 0x130(sp)          |         v0 = *(var_130h);
    0x000095b4 addiu v1, zero, 0x6000    |         v1 = 0x6000;
    0x000095b8 andi v0, v0, 0xf000       |         v0 &= 0xf000;
    0x000095bc lw t9, -0x7e84(gp)        |         t9 = sym.imp.close;
                                         |         if (v0 != v1) {
    0x000095c0 bne v0, v1, 0x97b4        |             goto label_9;
                                         |         }
                                         | label_1:
    0x000095c4 lw t9, -0x7ce4(gp)        |         t9 = sym.imp.strdup;
    0x000095c8 move a0, s4               |         a0 = s4;
    0x000095cc jalr t9                   |         t9 ();
    0x000095d0 move a0, v0               |         a0 = v0;
    0x000095d4 lw gp, 0x18(sp)           |         gp = *(var_18h);
    0x000095d8 sw v0, (s1)               |         *(s1) = v0;
                                         |         if (v0 == 0) {
    0x000095dc beqz v0, 0x9730           |             goto label_4;
                                         |         }
    0x000095e0 lw a1, (s7)               |         a1 = *(s7);
    0x000095e4 addiu v1, zero, 2         |         v1 = 2;
    0x000095e8 lw t9, -0x7cc8(gp)        |         t9 = sym.imp.__open64_2;
                                         |         if (a1 == 0) {
    0x000095ec movn v1, zero, a1         |             v1 = 0;
                                         |         }
    0x000095f0 move a1, v1               |         a1 = v1;
    0x000095f4 jalr t9                   |         t9 ();
    0x000095f8 move s0, v0               |         s0 = v0;
    0x000095fc lw gp, 0x18(sp)           |         gp = *(var_18h);
                                         |         if (v0 < 0) {
    0x00009600 bltz v0, 0x9730           |             goto label_4;
                                         |         }
    0x00009604 lw t9, -0x7eac(gp)        |         t9 = sym.imp.ioctl;
    0x00009608 move a2, s3               |         a2 = s3;
    0x0000960c addiu a1, zero, 0x4c00    |         a1 = 0x4c00;
    0x00009610 move a0, v0               |         a0 = v0;
    0x00009614 jalr t9                   |         t9 ();
    0x00009618 lw gp, 0x18(sp)           |         gp = *(var_18h);
                                         |         if (v0 >= 0) {
    0x0000961c bgez v0, 0x9848           |             goto label_10;
                                         |         }
    0x00009620 lw t9, -0x7d74(gp)        |         t9 = sym.imp.__errno_location;
    0x00009624 jalr t9                   |         t9 ();
    0x00009628 nop                       |         
    0x0000962c lw v1, (v0)               |         v1 = *(v0);
    0x00009630 addiu v0, zero, 0x10      |         v0 = 0x10;
    0x00009634 lw gp, 0x18(sp)           |         gp = *(var_18h);
                                         |         if (v1 != v0) {
    0x00009638 bne v1, v0, 0x9908        |             goto label_11;
                                         |         }
    0x0000963c lw t9, -0x7e08(gp)        |         t9 = sym.imp.free;
    0x00009640 lw a0, (s1)               |         a0 = *(s1);
    0x00009644 jalr t9                   |         t9 ();
    0x00009648 lw gp, 0x18(sp)           |         gp = *(var_18h);
    0x0000964c sw zero, (s1)             |         *(s1) = 0;
    0x00009650 lw t9, -0x7e84(gp)        |         t9 = sym.imp.close;
    0x00009654 move a0, s0               |         a0 = s0;
    0x00009658 jalr t9                   |         t9 ();
    0x0000965c lw gp, 0x18(sp)           |         gp = *(var_18h);
    0x00009660 lw t9, -0x7cd0(gp)        |         t9 = sym.imp.open64;
    0x00009664 lw a0, 0x20(sp)           |         a0 = *(var_20h_2);
    0x00009668 move a1, zero             |         a1 = 0;
    0x0000966c jalr t9                   |         t9 ();
    0x00009670 move s0, v0               |         s0 = v0;
    0x00009674 lw gp, 0x18(sp)           |         gp = *(var_18h);
    0x00009678 bgez v0, 0x9544           |         
                                         |     }
    0x0000967c lw t9, -0x7e68(gp)        |     t9 = sym.imp.memset;
    0x00009680 addiu a2, zero, 0xe8      |     a2 = 0xe8;
    0x00009684 move a1, zero             |     a1 = 0;
    0x00009688 move a0, fp               |     a0 = fp;
    0x0000968c jalr t9                   |     t9 ();
    0x00009690 move s0, zero             |     s0 = 0;
    0x00009694 addiu s6, zero, 6         |     s6 = 6;
    0x00009698 lw gp, 0x18(sp)           |     gp = *(var_18h);
    0x0000969c b 0x96f0                  |     
                                         |     while (v0 >= 0) {
    0x000096a0 lw t9, -0x7eac(gp)        |         t9 = sym.imp.ioctl;
    0x000096a4 move a2, fp               |         a2 = fp;
    0x000096a8 addiu a1, zero, 0x4c05    |         a1 = 0x4c05;
    0x000096ac move a0, v0               |         a0 = v0;
    0x000096b0 jalr t9                   |         t9 ();
    0x000096b4 lw gp, 0x18(sp)           |         gp = *(var_18h);
                                         |         if (v0 != 0) {
    0x000096b8 beqz v0, 0x96d4           |             
    0x000096bc lw t9, -0x7d74(gp)        |             t9 = sym.imp.__errno_location;
    0x000096c0 jalr t9                   |             t9 ();
    0x000096c4 nop                       |             
    0x000096c8 lw v0, (v0)               |             v0 = *(v0);
    0x000096cc lw gp, 0x18(sp)           |             gp = *(var_18h);
                                         |             if (v0 == s6) {
    0x000096d0 beq v0, s6, 0x97d4        |                 goto label_12;
                                         |             }
                                         |         }
    0x000096d4 lw t9, -0x7e84(gp)        |         t9 = sym.imp.close;
    0x000096d8 move a0, s5               |         a0 = s5;
    0x000096dc jalr t9                   |         t9 ();
    0x000096e0 addiu s0, s0, 1           |         s0++;
    0x000096e4 addiu v0, zero, 0x100     |         v0 = 0x100;
    0x000096e8 lw gp, 0x18(sp)           |         gp = *(var_18h);
                                         |         if (s0 == v0) {
    0x000096ec beq s0, v0, 0x972c        |             goto label_13;
                                         |         }
    0x000096f0 lw t9, -0x7d38(gp)        |         t9 = sym.imp.__sprintf_chk
    0x000096f4 move a3, s2               |         a3 = s2;
    0x000096f8 addiu a2, zero, 0x14      |         a2 = 0x14;
    0x000096fc addiu a1, zero, 1         |         a1 = 1;
    0x00009700 move a0, s4               |         a0 = s4;
    0x00009704 sw s0, 0x10(sp)           |         *(var_10h_2) = s0;
    0x00009708 jalr t9                   |         t9 ();
    0x0000970c lw gp, 0x18(sp)           |         gp = *(var_18h);
    0x00009710 move a1, zero             |         a1 = 0;
    0x00009714 lw t9, -0x7cd0(gp)        |         t9 = sym.imp.open64;
    0x00009718 move a0, s4               |         a0 = s4;
    0x0000971c jalr t9                   |         t9 ();
    0x00009720 move s5, v0               |         s5 = v0;
    0x00009724 lw gp, 0x18(sp)           |         gp = *(var_18h);
    0x00009728 bgez v0, 0x96a0           |         
                                         |     }
                                         | label_13:
    0x0000972c sw zero, (s1)             |     *(s1) = 0;
                                         | label_4:
    0x00009730 lw t9, -0x7e84(gp)        |     t9 = sym.imp.close;
    0x00009734 move a0, s3               |     a0 = s3;
    0x00009738 jalr t9                   |     t9 ();
    0x0000973c lw gp, 0x18(sp)           |     gp = *(var_18h);
    0x00009740 lw a0, (s1)               |     a0 = *(s1);
                                         |     if (a0 == 0) {
                                         | label_2:
    0x00009744 beql a0, zero, 0x9760     |         goto label_0;
                                         |     }
    0x00009748 addiu s0, zero, -1        |     s0 = -1;
                                         |     do {
    0x0000974c lw t9, -0x7e08(gp)        |         t9 = sym.imp.free;
    0x00009750 addiu s0, zero, -1        |         s0 = -1;
    0x00009754 jalr t9                   |         t9 ();
    0x00009758 lw gp, 0x18(sp)           |         gp = *(var_18h);
    0x0000975c sw zero, (s1)             |         *(s1) = 0;
                                         | label_0:
    0x00009760 lw v0, 0x24(sp)           |         v0 = *(var_24h);
    0x00009764 lw a0, 0x244(sp)          |         a0 = *(var_244h);
    0x00009768 lw v1, (v0)               |         v1 = *(v0);
    0x0000976c move v0, s0               |         v0 = s0;
                                         |         if (a0 != v1) {
    0x00009770 bne a0, v1, 0x994c        |             goto label_14;
                                         |         }
    0x00009774 lw ra, 0x26c(sp)          |         ra = *(var_26ch);
    0x00009778 lw fp, 0x268(sp)          |         fp = *(var_268h);
    0x0000977c lw s7, 0x264(sp)          |         s7 = *(var_264h);
    0x00009780 lw s6, 0x260(sp)          |         s6 = *(var_260h);
    0x00009784 lw s5, 0x25c(sp)          |         s5 = *(var_25ch);
    0x00009788 lw s4, 0x258(sp)          |         s4 = *(var_258h);
    0x0000978c lw s3, 0x254(sp)          |         s3 = *(var_254h);
    0x00009790 lw s2, 0x250(sp)          |         s2 = *(var_250h);
    0x00009794 lw s1, 0x24c(sp)          |         s1 = *(var_24ch);
    0x00009798 lw s0, 0x248(sp)          |         s0 = *(var_248h);
    0x0000979c addiu sp, sp, 0x270       |         
    0x000097a0 jr ra                     |         return v0;
                                         | label_7:
    0x000097a4 jalr t9                   |         t9 ();
    0x000097a8 nop                       |         
    0x000097ac lw gp, 0x18(sp)           |         gp = *(var_18h);
                                         | label_8:
    0x000097b0 lw t9, -0x7e84(gp)        |         t9 = sym.imp.close;
                                         | label_9:
    0x000097b4 move a0, s3               |         a0 = s3;
    0x000097b8 sw zero, (s1)             |         *(s1) = 0;
    0x000097bc jalr t9                   |         t9 ();
    0x000097c0 lw a0, (s1)               |         a0 = *(s1);
    0x000097c4 lw gp, 0x18(sp)           |         gp = *(var_18h);
    0x000097c8 bnez a0, 0x974c           |         
                                         |     } while (a0 != 0);
    0x000097cc addiu s0, zero, -1        |     s0 = -1;
    0x000097d0 b 0x9760                  |     goto label_0;
                                         | label_12:
    0x000097d4 lw t9, -0x7e84(gp)        |     t9 = sym.imp.close;
    0x000097d8 move a0, s5               |     a0 = s5;
    0x000097dc jalr t9                   |     t9 ();
    0x000097e0 lw gp, 0x18(sp)           |     gp = *(var_18h);
    0x000097e4 b 0x95c4                  |     goto label_1;
                                         | label_6:
    0x000097e8 lw t9, -0x7d74(gp)        |     t9 = sym.imp.__errno_location;
    0x000097ec jalr t9                   |     t9 ();
    0x000097f0 nop                       |     
    0x000097f4 lw v0, (v0)               |     v0 = *(v0);
    0x000097f8 addiu v1, zero, 0x1e      |     v1 = 0x1e;
    0x000097fc lw gp, 0x18(sp)           |     gp = *(var_18h);
                                         |     if (v0 == v1) {
    0x00009800 beq v0, v1, 0x9810        |         goto label_15;
                                         |     }
    0x00009804 addiu v1, zero, 0xd       |     v1 = 0xd;
    0x00009808 lw a0, (s1)               |     a0 = *(s1);
                                         |     if (v0 == v1) {
    0x0000980c bnel v0, v1, 0x9744       |         goto label_2;
                                         |     }
                                         | label_15:
    0x00009810 lw v0, (s7)               |     v0 = *(s7);
    0x00009814 lw a0, (s1)               |     a0 = *(s1);
                                         |     if (v0 == 0) {
    0x00009818 bnel v0, zero, 0x9744     |         goto label_2;
                                         |     }
    0x0000981c lw t9, -0x7cd0(gp)        |     t9 = sym.imp.open64;
    0x00009820 addiu v0, zero, 1         |     v0 = 1;
    0x00009824 lw a0, 0x28(sp)           |     a0 = *(var_28h_2);
    0x00009828 sw v0, (s7)               |     *(s7) = v0;
    0x0000982c addiu a1, zero, 0x400     |     a1 = 0x400;
    0x00009830 jalr t9                   |     t9 ();
    0x00009834 move s3, v0               |     s3 = v0;
    0x00009838 lw gp, 0x18(sp)           |     gp = *(var_18h);
                                         |     if (v0 >= 0) {
    0x0000983c bgez v0, 0x9524           |         goto label_3;
                                         |     }
    0x00009840 lw a0, (s1)               |     a0 = *(s1);
    0x00009844 b 0x9744                  |     goto label_2;
                                         | label_10:
    0x00009848 lw t9, -0x7d7c(gp)        |     t9 = sym.imp.strncpy;
    0x0000984c lw a1, 0x28(sp)           |     a1 = *(var_28h_2);
    0x00009850 sb zero, 0xa7(sp)         |     *(var_a7h) = 0;
    0x00009854 addiu a2, zero, 0x3f      |     a2 = 0x3f;
    0x00009858 addiu a0, sp, 0x68        |     a0 = sp + 0x68;
    0x0000985c jalr t9                   |     t9 ();
    0x00009860 lw v0, 0x278(sp)          |     v0 = *(var_278h);
    0x00009864 lw v1, 0x278(sp)          |     v1 = *(var_278h);
    0x00009868 sra v0, v0, 0x1f          |     v0 >>= 0x1f;
    0x0000986c sw v0, 0x4c(sp)           |     *(var_4ch) = v0;
    0x00009870 lw v0, 0x27c(sp)          |     v0 = *(var_27ch);
    0x00009874 lw gp, 0x18(sp)           |     gp = *(var_18h);
    0x00009878 sw v1, 0x48(sp)           |     *(var_48h) = v1;
                                         |     if (v0 == 0) {
    0x0000987c beqz v0, 0x991c           |         goto label_16;
                                         |     }
    0x00009880 lw v0, 0x64(sp)           |     v0 = *(var_64h);
    0x00009884 lw t9, -0x7eac(gp)        |     t9 = sym.imp.ioctl;
    0x00009888 ori v0, v0, 4             |     v0 |= 4;
    0x0000988c lw a2, 0x2c(sp)           |     a2 = *(var_2ch);
    0x00009890 addiu a1, zero, 0x4c04    |     a1 = 0x4c04;
    0x00009894 move a0, s0               |     a0 = s0;
    0x00009898 sw v0, 0x64(sp)           |     *(var_64h) = v0;
    0x0000989c jalr t9                   |     t9 ();
    0x000098a0 lw gp, 0x18(sp)           |     gp = *(var_18h);
                                         |     if (v0 < 0) {
    0x000098a4 bltz v0, 0x98f0           |         goto label_17;
                                         |     }
    0x000098a8 lw s2, 0x2c(sp)           |     s2 = *(var_2ch);
    0x000098ac lw t9, -0x7e68(gp)        |     t9 = sym.imp.memset;
    0x000098b0 addiu a2, zero, 0xe8      |     a2 = 0xe8;
    0x000098b4 move a1, zero             |     a1 = 0;
    0x000098b8 move a0, s2               |     a0 = s2;
    0x000098bc jalr t9                   |     t9 ();
    0x000098c0 lw gp, 0x18(sp)           |     gp = *(var_18h);
    0x000098c4 move a2, s2               |     a2 = s2;
    0x000098c8 addiu a1, zero, 0x4c05    |     a1 = 0x4c05;
    0x000098cc lw t9, -0x7eac(gp)        |     t9 = sym.imp.ioctl;
    0x000098d0 move a0, s0               |     a0 = s0;
    0x000098d4 jalr t9                   |     t9 ();
    0x000098d8 lw gp, 0x18(sp)           |     gp = *(var_18h);
                                         |     if (v0 < 0) {
    0x000098dc bltz v0, 0x98f0           |         goto label_17;
                                         |     }
    0x000098e0 lw v0, 0x64(sp)           |     v0 = *(var_64h);
    0x000098e4 andi v0, v0, 4            |     v0 &= 4;
    0x000098e8 lw t9, -0x7e84(gp)        |     t9 = sym.imp.close;
                                         |     if (v0 != 0) {
    0x000098ec bnez v0, 0x993c           |         goto label_18;
                                         |     }
                                         |     do {
                                         | label_17:
    0x000098f0 lw t9, -0x7eac(gp)        |         t9 = sym.imp.ioctl;
    0x000098f4 move a2, zero             |         a2 = 0;
    0x000098f8 addiu a1, zero, 0x4c01    |         a1 = 0x4c01;
    0x000098fc move a0, s0               |         a0 = s0;
    0x00009900 jalr t9                   |         t9 ();
    0x00009904 lw gp, 0x18(sp)           |         gp = *(var_18h);
                                         | label_11:
    0x00009908 lw t9, -0x7e84(gp)        |         t9 = sym.imp.close;
    0x0000990c move a0, s0               |         a0 = s0;
    0x00009910 jalr t9                   |         t9 ();
    0x00009914 lw gp, 0x18(sp)           |         gp = *(var_18h);
    0x00009918 b 0x9730                  |         goto label_4;
                                         | label_16:
    0x0000991c lw t9, -0x7eac(gp)        |         t9 = sym.imp.ioctl;
    0x00009920 lw a2, 0x2c(sp)           |         a2 = *(var_2ch);
    0x00009924 addiu a1, zero, 0x4c04    |         a1 = 0x4c04;
    0x00009928 move a0, s0               |         a0 = s0;
    0x0000992c jalr t9                   |         t9 ();
    0x00009930 lw gp, 0x18(sp)           |         gp = *(var_18h);
    0x00009934 bltz v0, 0x98f0           |         
                                         |     } while (v0 < 0);
    0x00009938 lw t9, -0x7e84(gp)        |     t9 = sym.imp.close;
                                         | label_18:
    0x0000993c move a0, s3               |     a0 = s3;
    0x00009940 jalr t9                   |     t9 ();
    0x00009944 lw gp, 0x18(sp)           |     gp = *(var_18h);
    0x00009948 b 0x9760                  |     goto label_0;
                                         | label_14:
    0x0000994c lw t9, -0x7dec(gp)        |     t9 = sym.imp.__stack_chk_fail;
    0x00009950 jalr t9                   |     t9 ();
    0x00009954 nop                       |     
    0x00009958 lui gp, 2                 |     
    0x0000995c addiu gp, gp, 0x7ea8      |     
    0x00009960 addu gp, gp, t9           |     gp += t9;
    0x00009964 addiu sp, sp, -0x20       |     
    0x00009968 lw t9, -0x7cd0(gp)        |     t9 = sym.imp.open64;
    0x0000996c sw gp, 0x10(sp)           |     *(var_10h) = gp;
    0x00009970 sw ra, 0x1c(sp)           |     *(var_1ch) = ra;
    0x00009974 sw s0, 0x18(sp)           |     *(var_18h_2) = s0;
    0x00009978 move a1, zero             |     a1 = 0;
    0x0000997c jalr t9                   |     t9 ();
    0x00009980 lw gp, 0x10(sp)           |     gp = *(var_10h);
                                         |     if (v0 >= 0) {
    0x00009984 bltz v0, 0x99c8           |         
    0x00009988 lw t9, -0x7eac(gp)        |         t9 = sym.imp.ioctl;
    0x0000998c move a2, zero             |         a2 = 0;
    0x00009990 addiu a1, zero, 0x4c01    |         a1 = 0x4c01;
    0x00009994 move a0, v0               |         a0 = v0;
    0x00009998 move s0, v0               |         s0 = v0;
    0x0000999c jalr t9                   |         t9 ();
    0x000099a0 lw gp, 0x10(sp)           |         gp = *(var_10h);
    0x000099a4 move a0, s0               |         a0 = s0;
    0x000099a8 lw t9, -0x7e84(gp)        |         t9 = sym.imp.close;
    0x000099ac sltu s0, zero, v0         |         s0 = (0 < v0) ? 1 : 0;
    0x000099b0 jalr t9                   |         t9 ();
    0x000099b4 lw ra, 0x1c(sp)           |         ra = *(var_1ch);
    0x000099b8 move v0, s0               |         v0 = s0;
    0x000099bc lw s0, 0x18(sp)           |         s0 = *(var_18h_2);
    0x000099c0 addiu sp, sp, 0x20        |         
    0x000099c4 jr ra                     |         return v0;
                                         |     }
    0x000099c8 lw ra, 0x1c(sp)           |     ra = *(var_1ch);
    0x000099cc addiu s0, zero, 1         |     s0 = 1;
    0x000099d0 move v0, s0               |     v0 = s0;
    0x000099d4 lw s0, 0x18(sp)           |     s0 = *(var_18h_2);
    0x000099d8 addiu sp, sp, 0x20        |     
    0x000099dc jr ra                     |     return v0;
                                         | }

[*] Function sprintf used 3 times cryptsetup-reencrypt