[*] Binary protection state of filefrag
Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH No Symbols
[*] Function fprintf tear down of filefrag
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-80367616.squashfs_v4_le_extract/usr/sbin/filefrag @ 0x1750 */
| #include <stdint.h>
|
| #define BIT_MASK(t,v) ((t)(-((v)!= 0)))&(((t)-1)>>((sizeof(t)*CHAR_BIT)-(v)))
|
; (fcn) fcn.00001750 () | void fcn_00001750 (int16_t arg_1h, int16_t arg_10h, int16_t arg_14h, int16_t arg_1ch, int16_t arg_20h, int16_t fildes, int16_t arg_28h, int16_t arg_2ch, int16_t arg_30h, int16_t arg_34h, int16_t arg_38h, int16_t arg_3ch, int16_t arg_40h, int16_t arg_44h, int16_t arg_48h, int16_t arg_4ch, int16_t arg_50h, int16_t arg_54h, int16_t arg_58h, int16_t arg_5ch, int16_t arg_60h, int16_t arg_64h, int16_t arg_68h, int16_t arg_6ch, int16_t arg_70h, int16_t arg_74h, int16_t arg_78h, uint32_t request, int16_t arg_84h, int16_t arg_88h, void * s, int16_t arg_128h, int16_t arg_264h) {
| int16_t var_0h;
| int16_t var_4h;
| label_3:
0x00000b20 ldr r2, [sp, 0x28] | r2 = *(arg_28h);
0x00000b22 movs r3, 1 | r3 = 1;
0x00000b24 ldr r0, [sp, 0x34] | r0 = *(arg_34h);
0x00000b26 movs r1, 0 | r1 = 0;
0x00000b28 str r3, [r2] | *(r2) = r3;
0x00000b2a blx 0x8f8 | r0 = open64 ();
0x00000b2e subs r3, r0, 0 | r3 = r0 - 0;
0x00000b30 str r3, [sp, 0x24] | *(fildes) = r3;
| if (r3 < r0) {
0x00000b32 blt.w 0x11a6 | goto label_26;
| }
0x00000b36 add.w sb, sp, 0x88 | sb += arg_88h;
0x00000b3a mov r1, sb | r1 = sb;
0x00000b3c blx 0x9b8 | r0 = fstat64 ();
0x00000b40 cmp r0, 0 |
| if (r0 < 0) {
0x00000b42 blt.w 0x138e | goto label_27;
| }
0x00000b46 ldr r0, [sp, 0x68] | r0 = *(arg_68h);
0x00000b48 ldrd r2, r1, [sb] | __asm ("ldrd r2, r1, [sb]");
0x00000b4c ldrd r3, r0, [r0, 0x28] | __asm ("ldrd r3, r0, [r0, 0x28]");
0x00000b50 cmp r0, r1 |
0x00000b52 it eq |
| if (r0 == r1) {
0x00000b54 cmpeq r3, r2 | __asm ("cmpeq r3, r2");
| }
0x00000b56 ite ne |
| if (r0 == r1) {
0x00000b58 movne r3, 1 | r3 = 1;
| }
| if (r0 != r1) {
0x00000b5a moveq r3, 0 | r3 = 0;
| }
0x00000b5c orrs r2, r1 | r2 |= r1;
0x00000b5e it eq |
| if (r2 != r1) {
0x00000b60 orreq r3, r3, 1 | r3 |= 1;
| }
| if (r3 != 0) {
0x00000b64 cbz r3, 0xba4 |
0x00000b66 ldr r1, [sp, 0x6c] | r1 = *(arg_6ch);
0x00000b68 ldr r0, [sp, 0x24] | r0 = *(fildes);
0x00000b6a blx 0x988 | r0 = fstatfs ();
0x00000b6e cmp r0, 0 |
| if (r0 < 0) {
0x00000b70 blt.w 0x136a | goto label_28;
| }
0x00000b74 ldr r4, [sp, 0x68] | r4 = *(arg_68h);
0x00000b76 movs r1, 2 | r1 = 2;
0x00000b78 ldr r0, [sp, 0x24] | r0 = *(fildes);
0x00000b7a add.w r2, r4, 0x70 | r2 = r4 + 0x70;
0x00000b7e blx 0x8ec | r0 = ioctl (r0, r1);
0x00000b82 cmp r0, 0 |
| if (r0 >= 0) {
0x00000b84 blt 0xb8a |
0x00000b86 ldr r3, [r4, 0x70] | r3 = *((r4 + 0x70));
| if (r3 != 0) {
0x00000b88 cbnz r3, 0xb94 | goto label_29;
| }
| }
0x00000b8a ldr.w r3, [pc, 0xa08] | r3 = *(0x00001594);
0x00000b8e add r3, pc | r3 += pc;
0x00000b90 ldr r2, [r3, 0x34] | r2 = *((r3 + 0x34));
0x00000b92 str r2, [r3, 0x70] | *((r3 + 0x70)) = r2;
| label_29:
0x00000b94 ldr.w r3, [pc, 0xa00] | r3 = *(0x00001598);
0x00000b98 add r3, pc | r3 += pc;
0x00000b9a ldr r1, [r3, 0x14] | r1 = *((r3 + 0x14));
0x00000b9c ldr r2, [r3, 0x30] | r2 = *((r3 + 0x30));
0x00000b9e cmp r1, 0 |
| if (r1 != 0) {
0x00000ba0 bne.w 0x1382 | goto label_30;
| }
| }
| label_14:
0x00000ba4 ldr.w r5, [pc, 0x9f4] | r5 = *(0x0000159c);
0x00000ba8 add r5, pc | r5 += pc;
0x00000baa ldr r3, [r5, 0x30] | r3 = *((r5 + 0x30));
0x00000bac ldr r4, [r5, 0x70] | r4 = *((r5 + 0x70));
0x00000bae sub.w r3, r3, 0xef00 | r3 -= 0xef00;
0x00000bb2 subs r3, 0x51 | r3 -= 0x51;
0x00000bb4 str.w r4, [sb, 0x38] | __asm ("str.w r4, [sb, 0x38]");
0x00000bb8 cmp r3, 2 |
0x00000bba itt hi |
| if (r3 <= 2) {
0x00000bbc movhi r3, 0 | r3 = 0;
| }
| if (r3 <= 2) {
0x00000bbe strhi r3, [sp, 0x1c] | *(arg_1ch) = r3;
| }
| if (r3 < 2) {
0x00000bc0 bls.w 0x12da | goto label_31;
| }
| label_11:
0x00000bc4 movs r3, 1 | r3 = 1;
0x00000bc6 str r3, [sp, 0x20] | *(arg_20h) = r3;
| label_12:
0x00000bc8 ldr.w r1, [pc, 0x9d4] | r1 = *(0x000015a0);
0x00000bcc movw r0, 0xcccd |
0x00000bd0 movt r0, 0xcccc | r0 = 0xcccccccd;
0x00000bd4 mov.w r7, -0x33333334 | r7 = -0x33333334;
0x00000bd8 ldrd sl, fp, [sp, 0x88] | __asm ("ldrd sl, fp, [arg_88h]");
0x00000bdc add r1, pc | r1 += pc;
0x00000bde ldr r2, [r1, 0x38] | r2 = *((r1 + 0x38));
0x00000be0 strd sl, fp, [r1, 0x28] | __asm ("strd sl, fp, [r1, 0x28]");
0x00000be4 adds r3, r2, 0 | r3 = r2 + 0;
0x00000be6 umull r5, r6, r0, r3 | r5:r6 = r0 * r3;
0x00000bea bic r5, r6, 3 | r5 = BIT_MASK (r6, 3);
0x00000bee add.w r5, r5, r6, lsr 2 | r5 += (r6 >> 2);
0x00000bf2 sub.w ip, r3, r5 |
0x00000bf6 subs.w ip, r2, ip |
0x00000bfa mul r3, r7, ip | r3 = r7 * ip;
0x00000bfe sbc.w r6, r6, r6 | __asm ("sbc.w r6, r6, r6");
0x00000c02 cmp r2, 9 |
0x00000c04 umull ip, r5, ip, r0 | ip:r5 = ip * r0;
0x00000c08 mla r3, r0, r6, r3 | __asm ("mla r3, r0, r6, r3");
0x00000c0c lsr.w ip, ip, 1 |
0x00000c10 add r3, r5 | r3 += r5;
0x00000c12 mov.w r5, 0 | r5 = 0;
0x00000c16 orr.w ip, ip, r3, lsl 31 |
0x00000c1a lsr.w r3, r3, 1 | r3 >>= 1;
| if (r2 < 9) {
0x00000c1e bls 0xc6c | goto label_32;
| }
0x00000c20 mov r6, r0 | r6 = r0;
0x00000c22 mov r2, r3 | r2 = r3;
| do {
0x00000c24 adds.w r3, ip, r2 | r3 = ip + r2;
0x00000c28 mov lr, ip | lr = ip;
0x00000c2a adc r3, r3, 0 | __asm ("adc r3, r3, 0");
0x00000c2e adds r5, 1 | r5++;
0x00000c30 umull r1, ip, r0, r3 | r1:ip = r0 * r3;
0x00000c34 mov r1, r2 | r1 = r2;
0x00000c36 bic r2, ip, 3 | r2 = BIT_MASK (ip, 3);
0x00000c3a add.w r2, r2, ip, lsr 2 | r2 += (ip >> 2);
0x00000c3e subs r3, r3, r2 | r3 -= r2;
0x00000c40 subs.w r3, lr, r3 | r3 = lr - r3;
0x00000c44 mul r2, r7, r3 | r2 = r7 * r3;
0x00000c48 sbc ip, r1, 0 | __asm ("sbc ip, r1, 0");
0x00000c4c cmp.w lr, 0xa |
0x00000c50 sbcs r1, r1, 0 | __asm ("sbcs r1, r1, 0");
0x00000c54 mla r2, r0, ip, r2 | __asm ("mla r2, r0, ip, r2");
0x00000c58 umull r3, ip, r3, r6 | r3:ip = r3 * r6;
0x00000c5c lsr.w r3, r3, 1 | r3 >>= 1;
0x00000c60 add r2, ip | r2 += ip;
0x00000c62 orr.w ip, r3, r2, lsl 31 |
0x00000c66 lsr.w r2, r2, 1 | r2 >>= 1;
0x00000c6a bhs 0xc24 |
| } while (lr >= 0xa);
| label_32:
0x00000c6c ldr.w r3, [pc, 0x934] | r3 = *(0x000015a4);
0x00000c70 ldr.w r8, [sb, 0x34] | r8 = *((sb + 0x34));
0x00000c74 add r3, pc | r3 += pc;
0x00000c76 ldr r2, [r3] | r2 = *(r3);
0x00000c78 cmp r2, r5 |
0x00000c7a mov r2, r4 | r2 = r4;
0x00000c7c it lt |
| if (r2 >= r5) {
0x00000c7e strlt r5, [r3] | *(r3) = r5;
| }
0x00000c80 ldr.w r3, [sb, 0x30] | r3 = *((sb + 0x30));
0x00000c82 adds r0, 0x30 | r0 += 0x30;
0x00000c84 mov r1, r3 | r1 = r3;
0x00000c86 str r3, [sp, 0x2c] | *(arg_2ch) = r3;
0x00000c88 adds r0, r1, r4 | r0 = r1 + r4;
0x00000c8a mov.w r3, 0 | r3 = 0;
0x00000c8e adc r1, r8, 0 | __asm ("adc r1, r8, 0");
0x00000c92 subs r0, 1 | r0--;
0x00000c94 sbc r1, r1, 0 | __asm ("sbc r1, r1, 0");
0x00000c98 bl 0x2528 | fcn_00002528 (r0, r1, r2, r3);
0x00000c9c ldr.w r3, [pc, 0x908] | r3 = *(0x000015a8);
0x00000ca0 mov fp, r0 |
0x00000ca2 mov r7, r0 | r7 = r0;
0x00000ca4 add r3, pc | r3 += pc;
0x00000ca6 ldr r2, [r3, 0x1c] | r2 = *((r3 + 0x1c));
0x00000ca8 mov r3, r1 | r3 = r1;
0x00000caa cmp r2, 0 |
| if (r2 == 0) {
0x00000cac beq.w 0x1204 | goto label_33;
| }
0x00000cb0 lsrs r2, r2, 1 | r2 >>= 1;
| if (r2 == r2) {
0x00000cb2 beq.w 0x1682 | goto label_34;
| }
0x00000cb6 mov.w sl, 0 | sl = 0;
| do {
0x00000cba lsrs r2, r2, 1 | r2 >>= 1;
0x00000cbc add.w sl, sl, 1 | sl++;
0x00000cc0 bne 0xcba |
| } while (r2 != r2);
| label_5:
0x00000cc2 ldr.w r2, [pc, 0x8e8] | r2 = *(0x000015ac);
0x00000cc6 add r2, pc | r2 += pc;
0x00000cc8 ldr r5, [r2, 0xc] | r5 = *((r2 + 0xc));
0x00000cca cmp r5, 0 |
| if (r5 != 0) {
0x00000ccc bne.w 0x1200 | goto label_35;
| }
0x00000cd0 adds r3, r7, r3 | r3 = r7 + r3;
0x00000cd2 movw r2, 0xcccd |
0x00000cd6 adc r3, r3, 0 | __asm ("adc r3, r3, 0");
0x00000cda movt r2, 0xcccc | r2 = 0xcccccccd;
0x00000cde umull r0, r6, r2, r3 | r0:r6 = r2 * r3;
0x00000ce2 mov.w ip, -0x33333334 |
0x00000ce6 bic r0, r6, 3 | r0 = BIT_MASK (r6, 3);
0x00000cea add.w r0, r0, r6, lsr 2 | r0 += (r6 >> 2);
0x00000cee sub.w lr, r3, r0 | lr = r3 - r0;
0x00000cf0 lsrs r0, r0, 0x18 | r0 >>= 0x18;
0x00000cf2 subs.w lr, r7, lr | lr = r7 - lr;
0x00000cf6 mul r3, ip, lr | r3 = ip * lr;
0x00000cfa sbc r6, r1, 0 | __asm ("sbc r6, r1, 0");
0x00000cfe cmp.w fp, 0xa |
0x00000d02 umull lr, r0, lr, r2 | lr:r0 = lr * r2;
0x00000d06 mla r3, r2, r6, r3 | __asm ("mla r3, r2, r6, r3");
0x00000d0a lsr.w lr, lr, 1 | lr >>= 1;
0x00000d0e add r3, r0 | r3 += r0;
0x00000d10 sbcs r0, r1, 0 | __asm ("sbcs r0, r1, 0");
0x00000d14 orr.w lr, lr, r3, lsl 31 | lr |= (r3 << 31);
0x00000d16 ldrb r3, [r0, 0x1b] | r3 = *((r0 + 0x1b));
0x00000d18 lsr.w r3, r3, 1 | r3 >>= 1;
| if (fp <= 0xa) {
0x00000d1c blo 0xd74 | goto label_4;
| }
0x00000d1e mov r6, r2 | r6 = r2;
0x00000d20 str r4, [sp, 0x30] | *(arg_30h) = r4;
0x00000d22 str.w sl, [sp, 0x38] | __asm ("str.w sl, [arg_38h]");
| do {
0x00000d26 adds.w r0, lr, r3 | r0 = lr + r3;
0x00000d2a mov sl, lr | sl = lr;
0x00000d2c adc r0, r0, 0 | __asm ("adc r0, r0, 0");
0x00000d30 adds r5, 1 | r5++;
0x00000d32 umull r4, lr, r2, r0 | r4:lr = r2 * r0;
0x00000d36 mov r4, r3 | r4 = r3;
0x00000d38 bic r3, lr, 3 | r3 = BIT_MASK (lr, 3);
0x00000d3c add.w r3, r3, lr, lsr 2 | r3 += (lr >> 2);
0x00000d40 subs r3, r0, r3 | r3 = r0 - r3;
0x00000d42 subs.w r3, sl, r3 | r3 = sl - r3;
0x00000d46 mul lr, ip, r3 | lr = ip * r3;
0x00000d4a sbc r0, r4, 0 | __asm ("sbc r0, r4, 0");
0x00000d4e cmp.w sl, 0xa |
0x00000d52 sbcs r4, r4, 0 | __asm ("sbcs r4, r4, 0");
0x00000d56 mla lr, r2, r0, lr | __asm ("mla lr, r2, r0, lr");
0x00000d5a umull r0, r3, r3, r6 | r0:r3 = r3 * r6;
0x00000d5e lsr.w r0, r0, 1 | r0 >>= 1;
0x00000d62 add r3, lr | r3 += lr;
0x00000d64 orr.w lr, r0, r3, lsl 31 | lr = r0 | (r3 << 31);
0x00000d68 lsr.w r3, r3, 1 | r3 >>= 1;
0x00000d6a lsls r3, r2, 0xd | r3 = r2 << 0xd;
0x00000d6c bhs 0xd26 |
| } while (r3 >= r2);
0x00000d6e ldr r4, [sp, 0x30] | r4 = *(arg_30h);
0x00000d70 ldr.w sl, [sp, 0x38] | sl = *(arg_38h);
| label_4:
0x00000d74 ldr.w r2, [pc, 0x838] | r2 = *(0x000015b0);
0x00000d78 add r2, pc | r2 += pc;
0x00000d7a ldr r3, [r2, 4] | r3 = *((r2 + 4));
0x00000d7c cmp r3, r5 |
0x00000d7e ldr.w r3, [pc, 0x834] | r3 = *(0x000015b4);
0x00000d82 it lt |
| if (r3 >= r5) {
0x00000d84 strlt r5, [r2, 4] | *((r2 + 4)) = r5;
| }
0x00000d86 add r3, pc | r3 += pc;
0x00000d88 ldr r3, [r3, 0x14] | r3 = *((r3 + 0x14));
0x00000d8a cmp r3, 0 |
| if (r3 != 0) {
0x00000d8c beq 0xe02 |
0x00000d8e umull r7, r3, r4, r7 | r7:r3 = r4 * r7;
0x00000d92 rsb.w r2, sl, 0x20 | r2 = 0x20 - sl;
0x00000d96 mla r3, r4, r1, r3 | __asm ("mla r3, r4, r1, r3");
0x00000d9a lsr.w r7, r7, sl | r7 >>= sl;
0x00000d9e lsl.w r2, r3, r2 | r2 = r3 << r2;
0x00000da2 orrs r7, r2 | r7 |= r2;
0x00000da4 sub.w r2, sl, 0x20 | r2 = sl - 0x20;
0x00000da8 lsr.w r2, r3, r2 | r2 = r3 >> r2;
0x00000dac lsr.w r3, r3, sl | r3 >>= sl;
0x00000db0 orrs r7, r2 | r7 |= r2;
0x00000db2 add.w r2, fp, -1 | r2 = fp + -1;
0x00000db6 orrs r2, r1 | r2 |= r1;
| if (r2 == r1) {
0x00000db8 beq.w 0x1478 | goto label_36;
| }
0x00000dbc ldr.w r2, [pc, 0x7f8] |
0x00000dc0 add r2, pc | r2 = 0x237c;
| label_19:
0x00000dc2 strd r7, r3, [sp, 8] | __asm ("strd r7, r3, [sp, 8]");
0x00000dc6 movs r4, 1 | r4 = 1;
0x00000dc8 ldr r3, [sp, 0x2c] | r3 = *(arg_2ch);
0x00000dca mov r0, r4 | r0 = r4;
0x00000dcc ldr.w r1, [pc, 0x7ec] |
0x00000dd0 str r2, [sp, 0x10] | *(arg_10h) = r2;
0x00000dd2 strd r3, r8, [sp] | __asm ("strd r3, r8, [sp]");
0x00000dd6 lsl.w r3, r4, sl | r3 = r4 << sl;
0x00000dda ldr r2, [sp, 0x34] | r2 = *(arg_34h);
0x00000ddc add r1, pc | r1 = 0x239c;
0x00000dde str r3, [sp, 0x14] | *(arg_14h) = r3;
0x00000de0 blx 0x97c | printf_chk ();
0x00000de4 ldr.w r3, [pc, 0x7d8] | r3 = *(0x000015c0);
0x00000de8 add r3, pc | r3 += pc;
0x00000dea ldr r3, [r3, 0xc] | r3 = *((r3 + 0xc));
0x00000dec cmp r3, 0 |
| if (r3 != 0) {
0x00000dee bne.w 0x147e | goto label_37;
| }
| label_20:
0x00000df2 ldr.w r3, [pc, 0x7d0] | r3 = *(0x15c6);
0x00000df6 ldr r2, [sp, 0x54] | r2 = *(arg_54h);
0x00000df8 ldr r5, [r2, r3] | r5 = *((r2 + r3));
| label_21:
0x00000dfa ldr r1, [r5] | r1 = *(r5);
0x00000dfc movs r0, 0xa | r0 = 0xa;
0x00000dfe blx 0x9ac | fputc (r0, r1);
| }
0x00000e02 ldr.w r5, [pc, 0x7c4] | r5 = *(0x000015c8);
0x00000e06 add r5, pc | r5 += pc;
0x00000e08 ldr r3, [r5, 0x18] | r3 = *((r5 + 0x18));
0x00000e0a cmp r3, 0 |
| if (r3 == 0) {
0x00000e0c beq.w 0x1294 | goto label_25;
| }
| label_9:
0x00000e10 add.w r8, sp, 0xf0 | r8 += s;
0x00000e14 movs r2, 0x38 | r2 = 0x38;
0x00000e16 movs r1, 0 | r1 = 0;
0x00000e18 mov r0, r8 | r0 = r8;
0x00000e1a add r5, sp, 0x128 | r5 += arg_128h;
0x00000e1c ldr.w r4, [sb, 0x38] | r4 = *((sb + 0x38));
0x00000e20 blx 0x970 | memset (r0, r1, r2);
0x00000e24 movs r2, 0x38 | r2 = 0x38;
0x00000e26 movs r1, 0 | r1 = 0;
0x00000e28 mov r0, r5 | r0 = r5;
0x00000e2a blx 0x970 | memset (r0, r1, r2);
0x00000e2e ldr.w r3, [pc, 0x79c] | r3 = *(0x000015cc);
0x00000e32 add r3, pc | r3 += pc;
0x00000e34 ldr r3, [r3, 0x20] | r3 = *((r3 + 0x20));
| if (r3 != 0) {
0x00000e36 cbz r3, 0xe40 |
0x00000e38 mov.w r3, 0x1000 | r3 = 0x1000;
0x00000e3c str.w r3, [r8, 0x28] | __asm ("str.w r3, [r8, 0x28]");
| }
0x00000e40 ldr.w r3, [pc, 0x78c] | r3 = *(0x000015d0);
0x00000e44 add r3, pc | r3 += pc;
0x00000e46 ldr r3, [r3] | r3 = *(r3);
0x00000e48 cmp r3, 0 |
| if (r3 != 0) {
0x00000e4a bne.w 0x13b2 | goto label_38;
| }
| label_15:
0x00000e4e ldr r3, [sp, 0x28] | r3 = *(arg_28h);
0x00000e50 movs r2, 0 | r2 = 0;
0x00000e52 str.w fp, [sp, 0x48] | __asm ("str.w fp, [arg_48h]");
0x00000e56 str r2, [r3] | *(r3) = r2;
0x00000e58 ldr r3, [sp, 0x1c] | r3 = *(arg_1ch);
0x00000e5a and r7, r3, 1 | r7 = r3 & 1;
0x00000e5e mov r3, fp | r3 = fp;
0x00000e60 str r7, [sp, 0x3c] | *(arg_3ch) = r7;
0x00000e62 cmp r3, 0 |
| if (r3 == 0) {
0x00000e64 beq.w 0x1092 | goto label_39;
| }
0x00000e68 adds r3, r4, 3 | r3 = r4 + 3;
0x00000e6a mov r0, r2 | r0 = r2;
0x00000e6c cmp r4, r2 |
0x00000e6e it ge |
| if (r4 < r2) {
0x00000e70 movge r3, r4 | r3 = r4;
| }
0x00000e72 str r2, [sp, 0x40] | *(arg_40h) = r2;
0x00000e74 asrs r1, r3, 2 | r1 = r3 >> 2;
0x00000e76 asrs r3, r3, 0x1f | r3 >>= 0x1f;
0x00000e78 str r0, [sp, 0x44] | *(arg_44h) = r0;
0x00000e7a mul r4, r1, r1 | r4 = r1 * r1;
0x00000e7e mvn r2, 0xb | r2 = ~0xb;
0x00000e80 lsls r3, r1, 8 | r3 = r1 << 8;
0x00000e82 str r1, [sp, 0x2c] | *(arg_2ch) = r1;
0x00000e84 mov fp, r0 |
0x00000e86 str r0, [sp, 0x1c] | *(arg_1ch) = r0;
0x00000e88 str r0, [sp, 0x20] | *(arg_20h) = r0;
0x00000e8a subs r6, r2, r4 | r6 = r2 - r4;
0x00000e8c mul r3, r4, r3 | r3 = r4 * r3;
0x00000e90 str r4, [sp, 0x50] | *(arg_50h) = r4;
0x00000e92 mov r4, r1 | r4 = r1;
0x00000e94 smull r1, r2, r4, r4 | r1:r2 = r4 * r4;
0x00000e98 str r6, [sp, 0x5c] | *(arg_5ch) = r6;
0x00000e9a mov r6, r0 | r6 = r0;
0x00000e9c add r0, sp, 0x84 | r0 += arg_84h;
0x00000e9e str.w sl, [sp, 0x70] | __asm ("str.w sl, [arg_70h]");
0x00000ea2 mov sl, r0 | sl = r0;
0x00000ea4 str r7, [sp, 0x78] | *(arg_78h) = r7;
0x00000ea6 mov r7, r6 | r7 = r6;
0x00000ea8 str.w sb, [sp, 0x38] | __asm ("str.w sb, [arg_38h]");
0x00000eac mov sb, r6 | sb = r6;
0x00000eae mla r3, r4, r2, r3 | __asm ("mla r3, r4, r2, r3");
0x00000eb2 ldr r2, [sp, 0x50] | r2 = *(arg_50h);
0x00000eb4 umull r1, r2, r2, r4 | r1:r2 = r2 * r4;
0x00000eb8 add r3, r2 | r3 += r2;
0x00000eba str r1, [sp, 0x60] | *(arg_60h) = r1;
0x00000ebc str r3, [sp, 0x64] | *(arg_64h) = r3;
| do {
0x00000ebe ldr r3, [sp, 0x3c] | r3 = *(arg_3ch);
0x00000ec0 cmp.w sb, 0 |
0x00000ec4 ite eq |
| if (sb != 0) {
0x00000ec6 moveq r3, 0 | r3 = 0;
| }
| if (sb == 0) {
0x00000ec8 andne r3, r3, 1 | r3 &= 1;
| }
| if (r3 != 0) {
0x00000ecc cbz r3, 0xf0a |
0x00000ece ldr r1, [sp, 0x2c] | r1 = *(arg_2ch);
0x00000ed0 sub.w r0, r7, 0xc | r0 = r7 - 0xc;
0x00000ed4 bl 0x225c | fcn_0000225c (r0);
| if (r1 == 0) {
0x00000ed8 cbnz r1, 0xede |
0x00000eda add.w sb, sb, 1 | sb++;
| }
0x00000ede ldr r3, [sp, 0x2c] | r3 = *(arg_2ch);
0x00000ee0 ldr r1, [sp, 0x50] | r1 = *(arg_50h);
0x00000ee2 subs r0, r7, r3 | r0 = r7 - r3;
0x00000ee4 subs r0, 0xc | r0 -= 0xc;
0x00000ee6 bl 0x225c | fcn_0000225c (r0);
| if (r1 == 0) {
0x00000eea cbnz r1, 0xef0 |
0x00000eec add.w sb, sb, 1 | sb++;
| }
0x00000ef0 ldr r3, [sp, 0x5c] | r3 = *(arg_5ch);
0x00000ef2 movs r1, 0 | r1 = 0;
0x00000ef4 ldr r2, [sp, 0x2c] | r2 = *(arg_2ch);
0x00000ef6 subs r0, r3, r2 | r0 = r3 - r2;
0x00000ef8 ldrd r2, r3, [sp, 0x60] | __asm ("ldrd r2, r3, [arg_60h]");
0x00000efc add r0, r7 | r0 += r7;
0x00000efe bl 0x25c8 | fcn_000025c8 (r0, r1, r2, r3, r4, r5);
0x00000f02 orrs r2, r3 | r2 |= r3;
0x00000f04 it eq |
| if (r2 == r3) {
0x00000f06 addeq sb, sb, 1 | sb++;
| goto label_40;
| }
| }
| label_40:
0x00000f0a ldr r0, [sp, 0x24] | r0 = *(fildes);
0x00000f0c mov r2, sl | r2 = sl;
0x00000f0e movs r1, 1 | r1 = 1;
0x00000f10 str.w r7, [sl] | __asm ("str.w r7, [sl]");
0x00000f14 blx 0x8ec | ioctl (r0, r1);
0x00000f16 stcl p8, c2, [sl], 0 | __asm ("stcl p8, c2, [sl], 0");
| if (r1 < 1) {
0x00000f1a blt.w 0x117c | goto label_41;
| }
0x00000f1e ldr.w r6, [sl] | r6 = *(sl);
0x00000f22 cmp r6, 0 |
| if (r6 == 0) {
0x00000f24 beq.w 0x1188 | goto label_42;
| }
0x00000f28 ldr r3, [sp, 0x28] | r3 = *(arg_28h);
0x00000f2a ldr r4, [r3] | r4 = *(r3);
0x00000f2c cmp r4, 0 |
| if (r4 == 0) {
0x00000f2e beq.w 0x1192 | goto label_43;
| }
0x00000f32 add.w sb, sb, 1 | sb++;
0x00000f36 cmp sb, r6 |
| if (sb == r6) {
0x00000f38 beq.w 0x1216 | goto label_44;
| }
| label_6:
0x00000f3c ldr.w r3, [pc, 0x694] | r3 = *(0x000015d4);
0x00000f40 add r3, pc | r3 += pc;
0x00000f42 ldr.w ip, [r3, 0x20] | ip = *((r3 + 0x20));
0x00000f46 ldrd r3, r1, [r5, 0x10] | __asm ("ldrd r3, r1, [r5, 0x10]");
0x00000f4a orrs r3, r1 | r3 |= r1;
| if (r3 != r1) {
0x00000f4c beq 0xf7e |
0x00000f4e ldr.w r1, [r8] | r1 = *(r8);
0x00000f52 ldr r3, [r5, 8] | r3 = *((r5 + 8));
0x00000f54 ldr.w r0, [r8, 4] | r0 = *((r8 + 4));
0x00000f58 adds r3, r3, r1 | r3 += r1;
0x00000f5a ldr r1, [r5, 0xc] | r1 = *((r5 + 0xc));
0x00000f5c adc.w r1, r1, r0 | __asm ("adc.w r1, r1, r0");
0x00000f60 ldr r0, [r5] | r0 = *(r5);
0x00000f62 subs r0, r3, r0 | r0 = r3 - r0;
0x00000f64 ldr r3, [r5, 4] | r3 = *((r5 + 4));
0x00000f66 str r0, [sp, 0x40] | *(arg_40h) = r0;
0x00000f68 sbc.w r3, r1, r3 | __asm ("sbc.w r3, r1, r3");
0x00000f6c mov r2, r3 | r2 = r3;
0x00000f6e str r3, [sp, 0x44] | *(arg_44h) = r3;
0x00000f70 ldrd r1, r3, [r8, 8] | __asm ("ldrd r1, r3, [r8, 8]");
0x00000f72 asrs r2, r0, 0xc | r2 = r0 >> 0xc;
0x00000f74 cmp r2, r3 |
0x00000f76 it eq |
| if (r2 == r3) {
0x00000f78 cmpeq r0, r1 | __asm ("cmpeq r0, r1");
| }
| if (r2 == r3) {
0x00000f7a beq.w 0x116c | goto label_45;
| }
| }
0x00000f7e cmp.w ip, 0 |
| if (ip != 0) {
0x00000f82 beq 0xf98 |
| label_0:
0x00000f84 ldr r3, [sp, 0x38] | r3 = *(arg_38h);
0x00000f86 subs r1, r4, 1 | r1 = r4 - 1;
0x00000f88 mov r0, r8 | r0 = r8;
0x00000f8a str r3, [sp, 4] | var_4h = r3;
0x00000f8c ldr r3, [sp, 0x70] | r3 = *(arg_70h);
0x00000f8e str r3, [sp] | *(sp) = r3;
0x00000f90 ldrd r2, r3, [sp, 0x40] | __asm ("ldrd r2, r3, [arg_40h]");
0x00000f94 bl 0x1b00 | fcn_00001b00 (r0, r1, r2, r3, r4, r5);
| }
| label_2:
0x00000f98 ldr.w r3, [pc, 0x63c] | r3 = *(0x000015d8);
0x00000f9c add r3, pc | r3 += pc;
0x00000f9e ldr r2, [r3, 0x14] | r2 = *((r3 + 0x14));
0x00000fa0 ldrd r3, r1, [sp, 0x40] | __asm ("ldrd r3, r1, [arg_40h]");
0x00000fa4 orrs r3, r1 | r3 |= r1;
0x00000fa6 cmp r2, 0 |
0x00000fa8 it ne |
| if (r2 != 0) {
0x00000faa cmpne r3, 0 | __asm ("cmpne r3, 0");
| }
| if (r2 != 0) {
0x00000fac bne.w 0x124a | goto label_46;
| }
| label_8:
0x00000fb0 ldr r3, [sp, 0x28] | r3 = *(arg_28h);
0x00000fb2 adds r4, 1 | r4++;
0x00000fb4 mov ip, r8 |
0x00000fb6 mov.w lr, 0 | lr = 0;
0x00000fba str.w lr, [sp, 0x30] | __asm ("str.w lr, [arg_30h]");
0x00000fbe str r4, [r3] | *(r3) = r4;
0x00000fc0 mov r4, r5 | r4 = r5;
0x00000fc2 ldr r3, [sp, 0x38] | r3 = *(arg_38h);
0x00000fc4 ldr.w fp, [r3, 0x38] | fp = *((r3 + 0x38));
0x00000fc8 ldm.w ip!, {r0, r1, r2, r3} | r0 = *(ip!);
| r1 = *((ip! + 4));
| r2 = *((ip! + 8));
| r3 = *((ip! + 12));
0x00000fcc str.w lr, [r8, 0xc] | __asm ("str.w lr, [r8, 0xc]");
0x00000fd0 mul sb, r6, fp | sb = r6 * fp;
0x00000fd4 stm r4!, {r0, r1, r2, r3} | *(r4!) = r0;
| *((r4! + 4)) = r1;
| *((r4! + 8)) = r2;
| *((r4! + 12)) = r3;
0x00000fd6 ldm.w ip!, {r0, r1, r2, r3} | r0 = *(ip!);
| r1 = *((ip! + 4));
| r2 = *((ip! + 8));
| r3 = *((ip! + 12));
0x00000fda str.w sb, [r8, 8] | __asm ("str.w sb, [r8, 8]");
0x00000fde stm r4!, {r0, r1, r2, r3} | *(r4!) = r0;
| *((r4! + 4)) = r1;
| *((r4! + 8)) = r2;
| *((r4! + 12)) = r3;
0x00000fe0 ldm.w ip!, {r0, r1, r2, r3} | r0 = *(ip!);
| r1 = *((ip! + 4));
| r2 = *((ip! + 8));
| r3 = *((ip! + 12));
0x00000fe4 stm r4!, {r0, r1, r2, r3} | *(r4!) = r0;
| *((r4! + 4)) = r1;
| *((r4! + 8)) = r2;
| *((r4! + 12)) = r3;
0x00000fe6 ldm.w ip, {r0, r1} | r0 = *(ip);
| r1 = *((ip + 4));
0x00000fea ldr r3, [sp, 0x1c] | r3 = *(arg_1ch);
0x00000fec stm.w r4, {r0, r1} | *(r4) = r0;
| *((r4 + 4)) = r1;
0x00000ff0 str.w r3, [r8] | __asm ("str.w r3, [r8]");
0x00000ff4 ldr r3, [sp, 0x20] | r3 = *(arg_20h);
0x00000ff6 str.w r3, [r8, 4] | __asm ("str.w r3, [r8, 4]");
| label_7:
0x00000ffa adds.w r3, fp, lr | r3 = fp + lr;
0x00000ffe asr.w r2, fp, 0x1f | r2 = fp >> 0x1f;
0x00001000 strb r3, [r5, 0xb] | *((r5 + 0xb)) = r3;
0x00001002 str.w r3, [r8, 0x10] | __asm ("str.w r3, [r8, 0x10]");
0x00001006 mov sb, r6 | sb = r6;
0x00001008 ldr r3, [sp, 0x30] | r3 = *(arg_30h);
0x0000100a adc.w r3, r3, r2 | __asm ("adc.w r3, r3, r2");
0x0000100e str.w r3, [r8, 0x14] | __asm ("str.w r3, [r8, 0x14]");
| label_1:
0x00001012 ldr r3, [sp, 0x1c] | r3 = *(arg_1ch);
0x00001014 adds r7, 1 | r7++;
0x00001016 adds.w fp, r3, fp |
0x0000101a ldr r3, [sp, 0x20] | r3 = *(arg_20h);
0x0000101c str.w fp, [sp, 0x1c] | __asm ("str.w fp, [arg_1ch]");
0x00001020 adc.w r3, r2, r3 | __asm ("adc.w r3, r2, r3");
0x00001024 str r3, [sp, 0x20] | *(arg_20h) = r3;
0x00001026 ldr r3, [sp, 0x48] | r3 = *(arg_48h);
0x00001028 cmp r3, r7 |
0x0000102a bne.w 0xebe |
| } while (r3 != r7);
0x0000102e ldr.w r3, [pc, 0x5ac] | r3 = *(0x000015dc);
0x00001032 ldr r2, [sp, 0x28] | r2 = *(arg_28h);
0x00001034 ldr.w sl, [sp, 0x70] | sl = *(arg_70h);
0x00001038 add r3, pc | r3 += pc;
0x0000103a ldr r7, [sp, 0x78] | r7 = *(arg_78h);
0x0000103c ldr r3, [r3, 0x20] | r3 = *((r3 + 0x20));
0x0000103e ldr.w sb, [sp, 0x38] | sb = *(arg_38h);
0x00001042 ldr r1, [r2] | r1 = *(r2);
| if (r3 != 0) {
0x00001044 cbz r3, 0x1092 |
| if (r1 == 0) {
0x00001046 cbz r1, 0x1092 | goto label_39;
| }
0x00001048 ldrd r3, r2, [r5, 0x10] | __asm ("ldrd r3, r2, [r5, 0x10]");
0x0000104c orrs r3, r2 | r3 |= r2;
| if (r3 != r2) {
0x0000104e beq 0x1082 |
0x00001050 ldr.w r2, [r8] | r2 = *(r8);
0x00001054 ldr r3, [r5, 8] | r3 = *((r5 + 8));
0x00001056 ldr.w r0, [r8, 4] | r0 = *((r8 + 4));
0x0000105a adds r3, r3, r2 | r3 += r2;
0x0000105c ldr r2, [r5, 0xc] | r2 = *((r5 + 0xc));
0x0000105e adc.w r2, r2, r0 | __asm ("adc.w r2, r2, r0");
0x00001062 ldr r0, [r5] | r0 = *(r5);
0x00001064 subs r0, r3, r0 | r0 = r3 - r0;
0x00001066 ldr r3, [r5, 4] | r3 = *((r5 + 4));
0x00001068 str r0, [sp, 0x40] | *(arg_40h) = r0;
0x0000106a sbc.w r4, r2, r3 | __asm ("sbc.w r4, r2, r3");
0x0000106e ldrd r2, r3, [r8, 8] | __asm ("ldrd r2, r3, [r8, 8]");
0x00001072 str r4, [sp, 0x44] | *(arg_44h) = r4;
0x00001074 cmp r4, r3 |
0x00001076 it eq |
| if (r4 == r3) {
0x00001078 cmpeq r0, r2 | __asm ("cmpeq r0, r2");
| }
0x0000107a itt eq |
| if (r4 != r3) {
0x0000107c moveq r3, 0 | r3 = 0;
| }
| if (r4 != r3) {
0x0000107e strdeq r3, r3, [sp, 0x40] | __asm ("strdeq r3, r3, [sp, 0x40]");
| goto label_47;
| }
| }
| label_47:
0x00001082 ldrd r2, r3, [sp, 0x40] | __asm ("ldrd r2, r3, [arg_40h]");
0x00001086 subs r1, 1 | r1--;
0x00001088 mov r0, r8 | r0 = r8;
0x0000108a strd sl, sb, [sp] | __asm ("strd sl, sb, [sp]");
0x0000108e bl 0x1b00 | fcn_00001b00 (r0, r1, r2, r3, r4, r5);
| }
| label_39:
0x00001092 ldr r3, [sp, 0x28] | r3 = *(arg_28h);
0x00001094 ldr r6, [r3] | r6 = *(r3);
0x00001096 cmp r6, 1 |
| if (r6 == 1) {
0x00001098 beq.w 0x16c8 | goto label_48;
| }
0x0000109c movs r4, 1 | r4 = 1;
0x0000109e b 0x141a | goto label_49;
| label_45:
0x0000116c cmp.w ip, 0 |
| if (ip == 0) {
0x00001170 beq.w 0x13ac | goto label_50;
| }
0x00001174 movs r3, 0 | r3 = 0;
0x00001176 strd r3, r3, [sp, 0x40] | __asm ("strd r3, r3, [sp, 0x40]");
0x0000117a b 0xf84 | goto label_0;
| label_41:
0x0000117c blx 0x94c | r0 = errno_location ();
0x00001180 ldr r4, [r0] | r4 = *(r0);
0x00001182 cmp r4, 0 |
| if (r4 > 0) {
0x00001184 bgt.w 0x151c | goto label_51;
| }
| label_42:
0x00001188 ldr r3, [sp, 0x38] | r3 = *(arg_38h);
0x0000118a ldr r3, [r3, 0x38] | r3 = *((r3 + 0x38));
0x0000118c mov fp, r3 |
0x0000118e asrs r2, r3, 0x1f | r2 = r3 >> 0x1f;
0x00001190 b 0x1012 | goto label_1;
| label_43:
0x00001192 ldr.w r3, [pc, 0x468] | r3 = *(0x000015fc);
0x00001196 add r3, pc | r3 += pc;
0x00001198 ldr r3, [r3, 0x20] | r3 = *((r3 + 0x20));
0x0000119a cmp r3, 0 |
| if (r3 == 0) {
0x0000119c beq.w 0xf98 | goto label_2;
| }
0x000011a0 bl 0x184c | fcn_0000184c ();
0x000011a4 b 0xf98 | goto label_2;
| label_26:
0x000011a6 blx 0x94c | r0 = errno_location ();
0x000011aa ldr r4, [r0] | r4 = *(r0);
0x000011ac ldr.w r0, [pc, 0x450] |
0x000011b0 rsbs r4, r4, 0 | r4 -= ;
0x000011b2 add r0, pc | r0 = 0x27b6;
0x000011b4 blx 0x8c8 | perror (r0);
| label_13:
0x000011b8 ldr r2, [sp, 0x58] | r2 = *(arg_58h);
0x000011ba clz r3, r2 | r3 &= r2;
0x000011be lsrs r3, r3, 5 | r3 >>= 5;
0x000011c0 ands.w r3, r3, r4, lsr 31 | r3 &= (r4 >> 31);
0x000011c4 ite eq |
| if (r3 != r3) {
0x000011c6 moveq r3, r2 | r3 = r2;
| }
| if (r3 == r3) {
0x000011c8 movne r3, r4 | r3 = r4;
| }
0x000011ca str r3, [sp, 0x58] | *(arg_58h) = r3;
| label_10:
0x000011cc ldr r3, [sp, 0x4c] | r3 = *(arg_4ch);
0x000011ce ldr r2, [r3, 4]! | r2 = *((r3 += 4));
0x000011d2 str r2, [sp, 0x34] | *(arg_34h) = r2;
0x000011d4 str r3, [sp, 0x4c] | *(arg_4ch) = r3;
0x000011d6 cmp r2, 0 |
| if (r2 != 0) {
0x000011d8 bne.w 0xb20 | goto label_3;
| }
0x000011dc ldr r3, [sp, 0x58] | r3 = *(arg_58h);
0x000011de ldr.w r2, [pc, 0x424] | r2 = *(0x00001604);
0x000011e2 rsbs r0, r3, 0 | r0 = r3 - ;
0x000011e4 ldr r3, [pc, 0x38c] | r3 = *(0x1574);
0x000011e6 add r2, pc | r2 += pc;
0x000011e8 ldr r3, [r2, r3] | r3 = *((r2 + r3));
0x000011ea ldr r2, [r3] | r2 = *(0x1574);
0x000011ec ldr r3, [sp, 0x264] | r3 = *(arg_264h);
0x000011ee eors r2, r3 | r2 ^= r3;
0x000011f0 mov.w r3, 0 | r3 = 0;
| if (r2 != r3) {
0x000011f4 bne.w 0x16f8 | goto label_52;
| }
0x000011f8 add.w sp, sp, 0x26c |
0x000011fc pop.w {r4, r5, r6, r7, r8, sb, sl, fp, pc} |
| label_35:
0x00001200 movs r5, 0xa | r5 = 0xa;
0x00001202 b 0xd74 | goto label_4;
| label_33:
0x00001204 lsrs r0, r4, 1 | r0 = r4 >> 1;
| if (r0 == r4) {
0x00001206 beq.w 0x167c | goto label_53;
| }
0x0000120a mov sl, r2 | sl = r2;
| do {
0x0000120c lsrs r0, r0, 1 | r0 >>= 1;
0x0000120e add.w sl, sl, 1 | sl++;
0x00001212 bne 0x120c |
| } while (r0 != r0);
0x00001214 b 0xcc2 | goto label_5;
| label_44:
0x00001216 ldr.w r2, [r8, 0x14] | r2 = *((r8 + 0x14));
0x0000121a ldr.w lr, [r8, 0x10] |
0x0000121e ldr.w r3, [r8] | r3 = *(r8);
0x00001222 mov r1, r2 | r1 = r2;
0x00001224 str r2, [sp, 0x30] | *(arg_30h) = r2;
0x00001226 ldr.w r2, [r8, 4] | r2 = *((r8 + 4));
0x0000122a adds.w r3, lr, r3 | r3 = lr + r3;
0x0000122e adc.w r2, r1, r2 | __asm ("adc.w r2, r1, r2");
0x00001232 ldrd r1, r0, [sp, 0x1c] | __asm ("ldrd r1, r0, [arg_1ch]");
0x00001236 cmp r2, r0 |
0x00001238 it eq |
| if (r2 == r0) {
0x0000123a cmpeq r3, r1 | __asm ("cmpeq r3, r1");
| }
0x0000123c itt eq |
| if (r2 != r0) {
0x0000123e ldreq r3, [sp, 0x38] | r3 = *(arg_38h);
| }
| if (r2 == r0) {
0x00001240 ldreq fp, [r3, 0x38] | fp = *((r3 + 0x38));
| goto label_54;
| }
| if (r2 != r0) {
| label_54:
0x00001244 bne.w 0xf3c | goto label_6;
| }
0x00001248 b 0xffa | goto label_7;
| label_46:
0x0000124a ldr r3, [sp, 0x38] | r3 = *(arg_38h);
0x0000124c ldrd r0, r1, [r8] | __asm ("ldrd r0, r1, [r8]");
0x00001250 ldr.w sb, [r3, 0x38] | sb = *((r3 + 0x38));
0x00001254 mov r2, sb | r2 = sb;
0x00001256 asr.w fp, sb, 0x1f |
0x0000125a mov r3, fp | r3 = fp;
0x0000125c bl 0x25c8 | fcn_000025c8 (r0, r1, r2, r3, r4, r5);
0x00001260 mov r2, sb | r2 = sb;
0x00001262 mov r3, fp | r3 = fp;
0x00001264 str r0, [sp, 0x30] | *(arg_30h) = r0;
0x00001266 str r1, [sp, 0x74] | *(arg_74h) = r1;
0x00001268 ldrd r0, r1, [sp, 0x40] | __asm ("ldrd r0, r1, [arg_40h]");
0x0000126c bl 0x25c8 | fcn_000025c8 (r0, r1, r2, r3, r4, r5);
0x00001270 mov r2, sb | r2 = sb;
0x00001272 mov r3, fp | r3 = fp;
0x00001274 strd r0, r1, [sp, 8] | __asm ("strd r0, r1, [sp, 8]");
0x00001278 ldrd r0, r1, [r8, 8] | __asm ("ldrd r0, r1, [r8, 8]");
0x0000127c bl 0x25c8 | fcn_000025c8 (r0, r1, r2, r3, r4, r5);
0x00001280 strd r0, r1, [sp] | __asm ("strd r0, r1, [sp]");
0x00001284 movs r0, 1 | r0 = 1;
0x00001286 ldr r1, [pc, 0x380] |
0x00001288 ldr r2, [sp, 0x30] | r2 = *(arg_30h);
0x0000128a ldr r3, [sp, 0x74] | r3 = *(arg_74h);
0x0000128c add r1, pc | r1 = 0x289a;
0x0000128e blx 0x97c | printf_chk ();
0x00001292 b 0xfb0 | goto label_8;
| label_25:
0x00001294 ldr r2, [sp, 0x28] | r2 = *(arg_28h);
0x00001296 mov r3, sb | r3 = sb;
0x00001298 ldr r0, [sp, 0x24] | r0 = *(fildes);
0x0000129a mov r1, sl | r1 = sl;
0x0000129c bl 0x1d44 | r0 = fcn_00001d44 (r0, r1, r2, r3, r4);
0x000012a0 subs r4, r0, 0 | r4 = r0 - 0;
| if (r4 < r0) {
0x000012a2 blt.w 0x14b6 | goto label_55;
| }
0x000012a6 ldr r3, [r5, 0x18] | r3 = *((r5 + 0x18));
0x000012a8 cmp r3, 0 |
| if (r3 != 0) {
0x000012aa bne.w 0xe10 | goto label_9;
| }
0x000012ae ldr r3, [sp, 0x28] | r3 = *(arg_28h);
0x000012b0 ldr r3, [r3] | r3 = *(r3);
0x000012b2 cmp r3, 1 |
| if (r3 == 1) {
0x000012b4 beq.w 0x169e | goto label_56;
| }
0x000012b8 ldr r1, [pc, 0x350] |
0x000012ba movs r0, 1 | r0 = 1;
0x000012bc ldr r2, [sp, 0x34] | r2 = *(arg_34h);
0x000012be add r1, pc | r1 = 0x28ce;
0x000012c0 blx 0x97c | printf_chk ();
| label_17:
0x000012c4 ldr r3, [pc, 0x2fc] | r3 = *(0x15c4);
0x000012c6 movs r0, 0xa | r0 = 0xa;
0x000012c8 ldr r2, [sp, 0x54] | r2 = *(arg_54h);
0x000012ca ldr r5, [r2, r3] | r5 = *((r2 + r3));
0x000012cc ldr r1, [r5] | r1 = *(r5);
0x000012ce blx 0x9ac | fputc (r0, r1);
0x000012d2 ldr r0, [sp, 0x24] | r0 = *(fildes);
0x000012d4 blx 0x9d0 | close (r0);
0x000012d8 b 0x11cc | goto label_10;
| label_31:
0x000012da add r3, sp, 0x84 | r3 += arg_84h;
0x000012dc ldr r1, [sp, 0x7c] | r1 = *(request);
0x000012de ldr r0, [sp, 0x24] | r0 = *(fildes);
0x000012e0 mov r2, r3 | r2 = r3;
0x000012e2 mov r4, r3 | r4 = r3;
0x000012e4 blx 0x8ec | ioctl (r0, r1);
0x000012e8 str r0, [sp, 0x1c] | *(arg_1ch) = r0;
0x000012ea cmp r0, 0 |
| if (r0 != 0) {
0x000012ec bne 0x13a0 | goto label_57;
| }
0x000012ee ldr r3, [r4] | r3 = *(r4);
0x000012f0 ldr r6, [r5, 0x38] | r6 = *((r5 + 0x38));
0x000012f2 ldr r4, [r5, 0x70] | r4 = *((r5 + 0x70));
0x000012f4 lsls r5, r3, 0xc | r5 = r3 << 0xc;
| if (r5 < r3) {
0x000012f6 bmi.w 0xbc4 | goto label_11;
| }
| if (r6 != 0) {
0x000012fa cbz r6, 0x1306 |
0x000012fc subs r0, r6, 1 | r0 = r6 - 1;
0x000012fe lsls r1, r4, 3 | r1 = r4 << 3;
0x00001300 bl 0x2000 | r0 = fcn_00002000 (r0, r1, r2);
0x00001304 adds r6, r0, 1 | r6 = r0 + 1;
| }
0x00001306 ldr r3, [pc, 0x308] |
0x00001308 add r3, pc | r3 = 0x291e;
0x0000130a ldr r2, [r3, 0x14] | r2 = *(0x2932);
| if (r2 != 0) {
0x0000130c cbz r2, 0x132a |
0x0000130e ldrd r0, r2, [r3, 0x28] | __asm ("ldrd r0, r2, [r3, 0x28]");
0x00001312 ldrd r1, r3, [sb] | __asm ("ldrd r1, r3, [sb]");
0x00001316 cmp r2, r3 |
0x00001318 it eq |
| if (r2 == r3) {
0x0000131a cmpeq r0, r1 | __asm ("cmpeq r0, r1");
| }
| if (r2 == r3) {
0x0000131c beq 0x132a | goto label_58;
| }
0x0000131e ldr r1, [pc, 0x2f4] |
0x00001320 mov r2, r6 | r2 = r6;
0x00001322 movs r0, 1 | r0 = 1;
0x00001324 add r1, pc | r1 = 0x293e;
0x00001326 blx 0x97c | printf_chk ();
| }
| label_58:
0x0000132a ldr r3, [pc, 0x2ec] |
0x0000132c movs r2, 1 | r2 = 1;
0x0000132e mov r1, r6 | r1 = r6;
0x00001330 str r2, [sp, 0x1c] | *(arg_1ch) = r2;
0x00001332 add r3, pc | r3 = 0x2950;
0x00001334 ldr r4, [r3, 0x70] | r4 = "30-Dec-2021";
0x00001336 ldr r0, [r3, 0x44] | r0 = *(0x2994);
0x00001338 lsls r5, r4, 3 | r5 = r4 << 3;
0x0000133a lsrs r0, r0, 3 | r0 >>= 3;
0x0000133c subs r5, 3 | r5 -= 3;
0x0000133e bl 0x2000 | r0 = fcn_00002000 (r0, r1, r2);
0x00001342 subs r3, r5, r0 | r3 = r5 - r0;
0x00001344 str r3, [sp, 0x20] | *(arg_20h) = r3;
0x00001346 b 0xbc8 | goto label_12;
| label_28:
0x0000136a blx 0x94c | r0 = errno_location ();
0x0000136e ldr r4, [r0] | r4 = *(r0);
0x00001370 ldr r0, [pc, 0x2b4] |
0x00001372 rsbs r4, r4, 0 | r4 -= ;
0x00001374 add r0, pc | r0 = 0x29a0;
0x00001376 blx 0x8c8 | perror (r0);
| do {
| label_16:
0x0000137a ldr r0, [sp, 0x24] | r0 = *(fildes);
0x0000137c blx 0x9d0 | close (r0);
0x00001380 b 0x11b8 | goto label_13;
| label_30:
0x00001382 ldr r1, [pc, 0x2a8] |
0x00001384 movs r0, 1 | r0 = 1;
0x00001386 add r1, pc | r1 = 0x29b8;
0x00001388 blx 0x97c | printf_chk ();
0x0000138c b 0xba4 | goto label_14;
| label_27:
0x0000138e blx 0x94c | r0 = errno_location ();
0x00001392 ldr r4, [r0] | r4 = *(r0);
0x00001394 ldr r0, [pc, 0x298] |
0x00001396 rsbs r4, r4, 0 | r4 -= ;
0x00001398 add r0, pc | r0 = "1.46.5";
0x0000139a blx 0x8c8 | perror ("1.46.5");
0x0000139e b 0x137a |
| } while (1);
| label_57:
0x000013a0 movs r0, 0 | r0 = 0;
0x000013a2 movs r3, 1 | r3 = 1;
0x000013a4 ldr r4, [r5, 0x70] | r4 = *((r5 + 0x70));
0x000013a6 strd r0, r3, [sp, 0x1c] | __asm ("strd r0, r3, [sp, 0x1c]");
0x000013aa b 0xbc8 | goto label_12;
| label_50:
0x000013ac strd ip, ip, [sp, 0x40] | __asm ("strd ip, ip, [sp, 0x40]");
0x000013b0 b 0xfb0 | goto label_8;
| label_38:
0x000013b2 ldr r0, [sp, 0x24] | r0 = *(fildes);
0x000013b4 blx 0x898 | r0 = fsync ();
0x000013b8 cmp r0, 0 |
| if (r0 == 0) {
0x000013ba beq.w 0xe4e | goto label_15;
| }
0x000013be blx 0x94c | r0 = errno_location ();
0x000013c2 ldr r3, [r0] | r3 = *(r0);
0x000013c4 cmp r3, 0 |
0x000013c6 rsb.w r4, r3, 0 | r4 = r3 - ;
| if (r3 > 0) {
0x000013ca ble 0x1402 |
| label_22:
0x000013cc ldr r3, [pc, 0x24c] | r3 = *(0x161c);
0x000013ce cmn.w r4, 0x16 |
0x000013d2 ldr r2, [sp, 0x54] | r2 = *(arg_54h);
0x000013d4 ldr r3, [r2, r3] | r3 = *((r2 + r3));
0x000013d6 ldr r5, [r3] | r5 = *(0x161c);
| if (r4 == 0x16) {
0x000013d8 beq.w 0x1548 | goto label_59;
| }
0x000013dc cmn.w r4, 0x19 |
| if (r4 == 0x19) {
0x000013e0 beq.w 0x1548 | goto label_59;
| }
0x000013e4 adds r2, r4, 1 | r2 = r4 + 1;
| if (r2 == r4) {
0x000013e6 beq.w 0x16b8 | goto label_60;
| }
0x000013ea mov r0, r4 | r0 = r4;
0x000013ec blx 0x904 | strerror (r0);
0x000013f0 ldr r2, [pc, 0x240] |
0x000013f2 movs r1, 1 | r1 = 1;
0x000013f4 str r0, [sp] | *(sp) = r0;
0x000013f6 mov r0, r5 | r0 = r5;
0x000013f8 ldr r3, [sp, 0x34] | r3 = *(arg_34h);
0x000013fa add r2, pc | r2 = 0x2a32;
0x000013fc blx 0x994 | fprintf_chk ()
0x00001400 b 0x137a | goto label_16;
| }
0x00001402 mov r0, r4 | r0 = r4;
0x00001404 ldr r1, [sp, 0x20] | r1 = *(arg_20h);
0x00001406 bl 0x2278 | fcn_00002278 (r0, r1);
0x0000140a ldr r3, [sp, 0x28] | r3 = *(arg_28h);
0x0000140c adds r4, r0, 1 | r4 = r0 + 1;
0x0000140e ldr r6, [r3] | r6 = *(r3);
0x00001410 cmp r6, 1 |
| if (r6 == 1) {
0x00001412 beq 0x1458 | goto label_61;
| }
0x00001414 ldr r3, [sp, 0x1c] | r3 = *(arg_1ch);
0x00001416 and r7, r3, 1 | r7 = r3 & 1;
| label_49:
0x0000141a ldr r1, [pc, 0x21c] |
0x0000141c mov r3, r6 | r3 = r6;
0x0000141e ldr r2, [sp, 0x34] | r2 = *(arg_34h);
0x00001420 movs r0, 1 | r0 = 1;
0x00001422 add r1, pc | r1 = 0x2a60;
0x00001424 blx 0x97c | printf_chk ();
0x00001428 cmp r4, 0 |
0x0000142a it ne |
| if (r4 != 0) {
0x0000142c cmpne r4, r6 | __asm ("cmpne r4, r6");
| }
0x0000142e ite lt |
| if (r4 >= 0) {
0x00001430 movlt r6, 1 | r6 = 1;
| }
| if (r4 < 0) {
0x00001432 movge r6, 0 | r6 = 0;
| }
0x00001434 tst r6, r7 |
| if ((r6 & r7) == 0) {
0x00001436 beq.w 0x12c4 | goto label_17;
| }
0x0000143a cmp r4, 1 |
| if (r4 <= 1) {
0x0000143c ble.w 0x16b2 | goto label_62;
| }
0x00001440 ldr r3, [pc, 0x1f8] |
0x00001442 add r3, pc | r3 = 0x2a82;
| label_18:
0x00001444 ldr r1, [pc, 0x1f8] |
0x00001446 mov r2, r4 | r2 = r4;
0x00001448 movs r0, 1 | r0 = 1;
0x0000144a add r1, pc | r1 = 0x2a8e;
0x0000144c blx 0x97c | printf_chk ();
0x00001450 ldr r0, [sp, 0x24] | r0 = *(fildes);
0x00001452 blx 0x9d0 | close (r0);
0x00001456 b 0x11cc | goto label_10;
| label_61:
0x00001458 ldr r1, [pc, 0x1e8] |
0x0000145a mov r0, r6 | r0 = r6;
0x0000145c ldr r2, [sp, 0x34] | r2 = *(arg_34h);
0x0000145e add r1, pc | r1 = 0x2aa6;
0x00001460 blx 0x97c | printf_chk ();
0x00001464 cmp r4, 0 |
| if (r4 >= 0) {
0x00001466 bge.w 0x12c4 | goto label_17;
| }
0x0000146a ldr r3, [sp, 0x1c] | r3 = *(arg_1ch);
0x0000146c lsls r3, r3, 0x1f | r3 <<= 0x1f;
| if (r3 >= r3) {
0x0000146e bpl.w 0x12c4 | goto label_17;
| }
0x00001472 ldr r3, [pc, 0x1d4] |
0x00001474 add r3, pc | r3 = 0x2ac2;
0x00001476 b 0x1444 | goto label_18;
| label_36:
0x00001478 ldr r2, [pc, 0x1d0] |
0x0000147a add r2, pc | r2 = 0x2aca;
0x0000147c b 0xdc2 | goto label_19;
| label_37:
0x0000147e add r3, sp, 0x84 | r3 += arg_84h;
0x00001480 movw r1, 0x6629 |
0x00001484 ldr r0, [sp, 0x24] | r0 = *(fildes);
0x00001486 movt r1, 0x4004 | r1 = 0x40046629;
0x0000148a mov r2, r3 | r2 = r3;
0x0000148c mov r5, r3 | r5 = r3;
0x0000148e blx 0x8ec | r0 = ioctl (r0, r1);
0x00001492 cmp r0, 0 |
| if (r0 != 0) {
0x00001494 bne.w 0xdf2 | goto label_20;
| }
0x00001498 ldr r3, [pc, 0x128] | r3 = *(0x15c4);
0x0000149a ldr r1, [sp, 0x54] | r1 = *(arg_54h);
0x0000149c ldr r2, [r5] | r2 = *(r5);
0x0000149e ldr r5, [r1, r3] | r5 = *((r1 + r3));
0x000014a0 lsls r1, r2, 0x1f | r1 = r2 << 0x1f;
0x000014a2 ldr r3, [r5] | r3 = *(r5);
| if (r1 >= r2) {
0x000014a4 bpl.w 0xdfa | goto label_21;
| }
0x000014a8 ldr r0, [pc, 0x1a4] |
0x000014aa mov r1, r4 | r1 = r4;
0x000014ac movs r2, 0xe | r2 = 0xe;
0x000014ae add r0, pc | r0 = 0x2b02;
0x000014b0 blx 0x8d4 | fwrite (r0, r1, r2, r3);
0x000014b4 b 0xdfa | goto label_21;
| label_55:
0x000014b6 ldr r3, [r5, 0xc] | r3 = *((r5 + 0xc));
0x000014b8 cmp r3, 0 |
| if (r3 != 0) {
0x000014ba bne.w 0x1688 | goto label_63;
| }
0x000014bc strh r5, [r4, 6] | *((r4 + 6)) = r5;
0x000014be ldr r3, [r5, 4] | r3 = *((r5 + 4));
| if (r3 != 0) {
0x000014c0 cbnz r3, 0x14ca | goto label_64;
| }
0x000014c2 ldr r3, [r5, 8] | r3 = *((r5 + 8));
0x000014c4 cmp r3, 0 |
| if (r3 == 0) {
0x000014c6 beq.w 0xe10 | goto label_9;
| }
| label_64:
0x000014ca cmn.w r4, 0x35 |
| if (r4 == 0x35) {
0x000014ce beq.w 0x137a | goto label_16;
| }
0x000014d2 ldr r3, [pc, 0x148] | r3 = *(0x161e);
0x000014d4 ldr r2, [sp, 0x54] | r2 = *(arg_54h);
0x000014d6 ldr r6, [pc, 0x17c] |
0x000014d8 ldr r3, [r2, r3] | r3 = *((r2 + r3));
0x000014da add r6, pc | r6 = 0x2b34;
0x000014dc ldr r5, [r3] | r5 = *(0x161e);
| label_23:
0x000014de rsbs r0, r4, 0 | r0 = r4 - ;
0x000014e0 blx 0x904 | strerror (r0);
0x000014e4 ldr r2, [pc, 0x170] |
0x000014e6 movs r1, 1 | r1 = 1;
0x000014e8 strd r6, r0, [sp] | __asm ("strd r6, r0, [sp]");
0x000014ec mov r0, r5 | r0 = r5;
0x000014ee ldr r3, [sp, 0x34] | r3 = *(arg_34h);
0x000014f0 add r2, pc | r2 = 0x2b4c;
0x000014f2 blx 0x994 | fprintf_chk ()
0x000014f6 b 0x137a | goto label_16;
| label_51:
0x0000151c rsbs r4, r4, 0 | r4 -= ;
0x0000151e b 0x13cc | goto label_22;
| label_59:
0x00001548 ldr r3, [pc, 0x124] |
0x0000154a add r3, pc |
0x0000154c ldr r3, [r3, 0x18] | r3 = *(0x2bd6);
0x0000154e cmp r3, 0 |
| if (r3 == 0) {
0x00001550 beq.w 0x16ac | goto label_65;
| }
0x00001554 ldr r3, [pc, 0x11c] |
0x00001556 add r3, pc | r3 = 0x2bce;
| label_24:
0x00001558 ldr r2, [pc, 0x11c] |
0x0000155a mov r0, r5 | r0 = r5;
0x0000155c str r3, [sp] | *(sp) = r3;
0x0000155e movs r1, 1 | r1 = 1;
0x00001560 ldr r3, [sp, 0x34] | r3 = *(arg_34h);
0x00001562 add r2, pc | r2 = 0x2bde;
0x00001564 blx 0x994 | fprintf_chk ()
0x00001568 b 0x137a | goto label_16;
| label_53:
0x0000167c mov sl, r0 | sl = r0;
0x0000167e b.w 0xcc2 | goto label_5;
| label_34:
0x00001682 mov sl, r2 | sl = r2;
0x00001684 b.w 0xcc2 | goto label_5;
| if (r5 != 0) {
0x00001686 cbnz r5, 0x16d0 | goto label_66;
| }
| label_63:
0x00001688 cmn.w r4, 0x35 |
| if (r4 == 0x35) {
0x0000168c beq.w 0x137a | goto label_16;
| }
0x00001690 ldr r3, [pc, 0x68] | r3 = *(0x16fc);
0x00001692 ldr r2, [sp, 0x54] | r2 = *(arg_54h);
0x00001694 ldr r6, [pc, 0x68] |
0x00001696 ldr r3, [r2, r3] | r3 = *((r2 + r3));
0x00001698 add r6, pc | r6 = 0x2d9c;
0x0000169a ldr r5, [r3] | r5 = *(0x16fc);
0x0000169c b 0x14de | goto label_23;
| label_56:
0x0000169e ldr r1, [pc, 0x64] |
0x000016a0 mov r0, r3 | r0 = r3;
0x000016a2 ldr r2, [sp, 0x34] | r2 = *(arg_34h);
0x000016a4 add r1, pc | r1 = 0x2dae;
0x000016a6 blx 0x97c | printf_chk ();
0x000016aa b 0x12c4 | goto label_17;
| label_65:
0x000016ac ldr r3, [pc, 0x58] |
0x000016ae add r3, pc | r3 = 0x2dba;
0x000016b0 b 0x1558 | goto label_24;
| label_62:
0x000016b2 ldr r3, [pc, 0x58] |
0x000016b4 add r3, pc | r3 = 0x2dc6;
0x000016b6 b 0x1444 | goto label_18;
| label_60:
0x000016b8 ldr r2, [pc, 0x54] |
0x000016ba mov r0, r5 | r0 = r5;
0x000016bc ldr r3, [sp, 0x34] | r3 = *(arg_34h);
0x000016be movs r1, 1 | r1 = 1;
0x000016c0 add r2, pc | r2 = 0x2dd4;
0x000016c2 blx 0x994 | fprintf_chk ()
0x000016c6 b 0x137a | goto label_16;
| label_48:
0x000016c8 ldr r1, [pc, 0x48] |
0x000016ca mov r0, r6 | r0 = r6;
0x000016cc ldr r2, [sp, 0x34] | r2 = *(arg_34h);
0x000016ce add r1, pc | r1 = 0x2de6;
| label_66:
0x000016d0 blx 0x97c | printf_chk ();
0x000016d4 b 0x12c4 | goto label_17;
| label_52:
0x000016f8 blx 0x8bc | stack_chk_fail ();
0x000016fc lsls r4, r1, 2 | r4 = r1 << 2;
0x000016fe movs r0, r0 |
0x00001700 asrs r0, r1, 0xa | r0 = r1 >> 0xa;
0x00001702 movs r0, r0 |
0x00001704 asrs r0, r3, 0x12 | r0 = r3 >> 0x12;
0x00001706 movs r0, r0 |
0x00001708 asrs r2, r3, 0xa | r2 = r3 >> 0xa;
0x0000170a movs r0, r0 |
0x0000170c asrs r0, r5, 0x10 | r0 = r5 >> 0x10;
0x0000170e movs r0, r0 |
0x00001710 asrs r4, r7, 0x10 | r4 = r7 >> 0x10;
0x00001712 movs r0, r0 |
0x00001714 asrs r6, r5, 0x11 | r6 = r5 >> 0x11;
0x00001716 movs r0, r0 |
0x00001718 asrs r4, r4, 9 | r4 >>= 9;
0x0000171a movs r0, r0 |
0x00001750 adds r0, 0x14 | r0 += 0x14;
0x00001752 b 0x1294 | goto label_25;
| }
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-80367616.squashfs_v4_le_extract/usr/sbin/filefrag @ 0x1818 */
| #include <stdint.h>
|
; (fcn) fcn.00001818 () | void fcn_00001818 (int16_t arg1) {
| int16_t var_0h;
| int16_t var_4h;
| int16_t var_8h;
| int16_t var_ch;
| r0 = arg1;
0x00001818 ldr.w ip, [pc, 0x24] |
0x0000181c movs r1, 1 | r1 = 1;
0x0000181e push {r3, lr} |
0x00001820 mov r3, r0 | r3 = r0;
0x00001822 ldr.w lr, [pc, 0x20] | lr = *(0x1846);
0x00001826 add ip, pc | ip = 0x306a;
0x00001828 ldr r2, [pc, 0x1c] |
0x0000182a mov r0, ip | r0 = ip;
0x0000182c ldr.w r4, [ip, lr] | r4 = *(0x306a);
0x00001830 add r2, pc | r2 = 0x307c;
0x00001832 ldr r0, [r4] | r0 = *(0x306a);
0x00001834 blx 0x994 | fprintf_chk ()
0x00001838 movs r0, 1 | r0 = 1;
0x0000183a blx 0x91c | exit (r0);
0x0000183e nop |
0x00001840 movs r7, 0x32 | r7 = 0x32;
0x00001842 movs r0, r0 |
0x00001844 lsls r4, r1, 2 | r4 = r1 << 2;
0x00001846 movs r0, r0 |
0x00001848 lsrs r0, r6, 0x1d | r0 = r6 >> 0x1d;
0x0000184a movs r0, r0 |
| }
r2dec has crashed (info: /logs/firmware/patool_extraction/rootfs.img_unblob_extracted/rootfs.img_extract/0-80367616.squashfs_v4_le_extract/usr/sbin/filefrag @ 0x1d44).
Please report the bug at https://github.com/radareorg/r2dec-js/issues
Use the option '--issue' or the command 'pddi' to generate
the needed data for the issue.
[*] Function fprintf used 6 times filefrag