[*] Binary protection state of libmbedtls.so.2.2.1

  
  	Partial RELRO  No Canary found   NX disabled  DSO          No RPATH     No RUNPATH   Symbols


[*] Function sprintf tear down of libmbedtls.so.2.2.1

    ; assembly                           | /* r2dec pseudo code output */
                                         | /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/lib/libmbedtls.so.2.2.1 @ 0x4d28 */
                                         | #include <stdint.h>
                                         |  
    ; (fcn) entry.fini0 ()               | void entry_fini0 () {
    0x00004d28 ldr r3, [pc, 0x68]        |     r3 = *(0x4d94);
    0x00004d2c push {r4, lr}             |     
    0x00004d30 ldr r4, [pc, 0x64]        |     r4 = $d;
    0x00004d34 add r3, pc, r3            |     r3 = pc + r3;
    0x00004d38 ldrb r3, [r3]             |     r3 = *(r3);
    0x00004d3c add r4, pc, r4            |     r4 = pc + r4;
    0x00004d40 cmp r3, 0                 |     
    0x00004d44 popne {r4, pc}            |     
    0x00004d48 ldr r3, [pc, 0x50]        |     r3 = *(0x4d9c);
    0x00004d4c ldr r3, [r4, r3]          |     r3 = $d;
    0x00004d50 cmp r3, 0                 |     
                                         |     if (r3 != 0) {
    0x00004d54 beq 0x4d64                |         
    0x00004d58 ldr r3, [pc, 0x44]        |         r3 = *(0x4da0);
    0x00004d5c ldr r0, [pc, r3]          |         r0 = *(0x00004d64);
    0x00004d60 bl 0x457c                 |         cxa_finalize ();
                                         |     }
    0x00004d64 bl 0x4c6c                 |     entry0 ();
    0x00004d68 ldr r3, [pc, 0x38]        |     r3 = *(0x4da4);
    0x00004d6c ldr r3, [r4, r3]          |     r3 = *((r4 + r3));
    0x00004d70 cmp r3, 0                 |     
                                         |     if (r3 != 0) {
    0x00004d74 beq 0x4d84                |         
    0x00004d78 ldr r0, [pc, 0x2c]        |         r0 = *(0x4da8);
    0x00004d7c add r0, pc, r0            |         r0 = pc + r0;
    0x00004d80 bl 0x4714                 |         loc_imp_deregister_frame_info ();
                                         |     }
    0x00004d84 ldr r3, [pc, 0x24]        |     r3 = *(0x4dac);
    0x00004d88 mov r2, 1                 |     r2 = 1;
    0x00004d8c add r3, pc, r3            |     r3 = pc + r3;
    0x00004d90 strb r2, [r3]             |     *(r3) = r2;
    0x00004d94 pop {r4, pc}              |     
                                         | }
    ; assembly                                               | /* r2dec pseudo code output */
                                                             | /* /logs/firmware/unblob_extracted/firmware_extract/56048-12514271.gzip_extract/gzip.uncompressed_extract/5243916-15068666.gzip_extract/gzip.uncompressed_extract/usr/lib/libmbedtls.so.2.2.1 @ 0x12e74 */
                                                             | #include <stdint.h>
                                                             |  
    ; (fcn) sym.mbedtls_ssl_derive_keys ()                   | void mbedtls_ssl_derive_keys (int32_t arg_40ch, int32_t arg_410h, int32_t arg_414h, int32_t arg_418h, void * arg_430h, int32_t arg_450h, int32_t arg_880h, int32_t arg1) {
                                                             |     int32_t var_0h;
                                                             |     int32_t var_4h;
                                                             |     int32_t var_8h;
                                                             |     int32_t var_ch;
                                                             |     int32_t var_10h;
                                                             |     int32_t var_18h;
                                                             |     int32_t var_1ch;
                                                             |     int32_t var_20h;
                                                             |     int32_t var_24h;
                                                             |     void * s1;
                                                             |     int32_t var_1h;
                                                             |     void * s2;
                                                             |     void * var_68h;
                                                             |     int32_t var_1h_2;
                                                             |     int32_t var_168h;
                                                             |     int32_t var_16ch;
                                                             |     r0 = arg1;
    0x00012e74 ldr r3, [pc, 0xaf4]                           |     r3 = *(0x1396c);
    0x00012e78 push {r4, r5, r6, r7, r8, sb, sl, fp, lr}     |     
    0x00012e7c ldr r4, [pc, 0xaf0]                           |     r4 = *(0x13970);
    0x00012e80 sub sp, sp, 0x16c                             |     
    0x00012e84 add r3, pc, r3                                |     r3 = pc + r3;
    0x00012e88 ldr sl, [r0, 0x4c]                            |     sl = *((r0 + 0x4c));
    0x00012e8c str r3, [sp]                                  |     *(sp) = r3;
    0x00012e90 ldr ip, [r0, 0x38]                            |     ip = *((r0 + 0x38));
    0x00012e94 add r4, pc, r4                                |     r4 = pc + r4;
    0x00012e98 mov r2, r4                                    |     r2 = r4;
    0x00012e9c ldr r3, [pc, 0xad4]                           |     r3 = *(0x13974);
    0x00012ea0 mov r1, 2                                     |     r1 = 2;
    0x00012ea4 mov sb, r0                                    |     sb = r0;
    0x00012ea8 str ip, [sp, 0x1c]                            |     var_1ch = ip;
    0x00012eac ldr fp, [r0, 0x3c]                            |     fp = *((r0 + 0x3c));
    0x00012eb0 bl 0x4594                                     |     fcn_00004594 ();
    0x00012eb4 ldr r3, [sl]                                  |     r3 = *(sl);
    0x00012eb8 ldr r0, [r3, 8]                               |     r0 = *(0x1397c);
    0x00012ebc bl 0x49a8                                     |     r0 = mbedtls_cipher_info_from_type ();
    0x00012ec0 subs r3, r0, 0                                |     r3 = r0 - 0;
    0x00012ec4 str r3, [sp, 0x20]                            |     var_20h = r3;
                                                             |     if (r3 == r0) {
    0x00012ec8 beq 0x137d4                                   |         goto label_9;
                                                             |     }
    0x00012ecc ldr r3, [sl]                                  |     r3 = *(sl);
    0x00012ed0 ldr r0, [r3, 0xc]                             |     r0 = *((r3 + 0xc));
    0x00012ed4 bl 0x4be8                                     |     r0 = mbedtls_md_info_from_type ();
    0x00012ed8 subs r3, r0, 0                                |     r3 = r0 - 0;
    0x00012edc str r3, [sp, 0x24]                            |     var_24h = r3;
                                                             |     if (r3 == r0) {
    0x00012ee0 beq 0x13808                                   |         goto label_10;
                                                             |     }
    0x00012ee4 ldr r3, [sb, 0x14]                            |     r3 = *((sb + 0x14));
    0x00012ee8 cmp r3, 0                                     |     
                                                             |     if (r3 == 0) {
    0x00012eec beq 0x1334c                                   |         goto label_11;
                                                             |     }
    0x00012ef0 cmp r3, 2                                     |     
                                                             |     if (r3 > 2) {
    0x00012ef4 bgt 0x133e0                                   |         goto label_12;
                                                             |     }
    0x00012ef8 ldr r1, [pc, 0xa7c]                           |     r1 = *(0x13978);
    0x00012efc ldr r2, [pc, 0xa7c]                           |     r2 = *(0x1397c);
    0x00012f00 ldr r3, [pc, 0xa7c]                           |     r3 = *(0x13980);
    0x00012f04 add r1, pc, r1                                |     r1 = pc + r1;
    0x00012f08 add r2, pc, r2                                |     r2 = pc + r2;
    0x00012f0c add r3, pc, r3                                |     r3 = pc + r3;
    0x00012f10 str r1, [fp, 0x414]                           |     *(arg_414h) = r1;
    0x00012f14 str r2, [fp, 0x40c]                           |     *(arg_40ch) = r2;
    0x00012f18 str r3, [fp, 0x410]                           |     *(arg_410h) = r3;
                                                             | label_0:
    0x00012f1c ldr r3, [fp, 0x880]                           |     r3 = *(arg_880h);
    0x00012f20 ldr r2, [sp, 0x1c]                            |     r2 = var_1ch;
    0x00012f24 cmp r3, 0                                     |     
    0x00012f28 add r2, r2, 0x30                              |     r2 += 0x30;
    0x00012f2c str r2, [sp, 0x18]                            |     var_18h = r2;
                                                             |     if (r3 != 0) {
    0x00012f30 bne 0x13374                                   |         goto label_13;
                                                             |     }
    0x00012f34 ldr r6, [pc, 0xa4c]                           |     r6 = *(0x13984);
    0x00012f38 ldr r3, [pc, 0xa4c]                           |     r3 = *(0x13988);
    0x00012f3c ldr r2, [fp, 0x418]                           |     r2 = *(arg_418h);
    0x00012f40 add r4, fp, 0x450                             |     r4 += arg_450h;
    0x00012f44 add r3, pc, r3                                |     r3 = pc + r3;
    0x00012f48 add r6, pc, r6                                |     r6 = pc + r6;
    0x00012f4c add r4, r4, 0xc                               |     r4 += 0xc;
    0x00012f50 str r2, [sp, 8]                               |     var_8h = r2;
    0x00012f54 str r3, [sp]                                  |     *(sp) = r3;
    0x00012f58 str r4, [sp, 4]                               |     var_4h = r4;
    0x00012f5c mov r3, 0x244                                 |     r3 = 0x244;
    0x00012f60 mov r2, r6                                    |     r2 = r6;
    0x00012f64 mov r1, 3                                     |     r1 = 3;
    0x00012f68 mov r0, sb                                    |     r0 = sb;
    0x00012f6c bl 0x496c                                     |     fcn_0000496c ();
    0x00012f70 ldr r3, [sb, 0x3c]                            |     r3 = *((sb + 0x3c));
    0x00012f74 ldr r3, [r3, 0x894]                           |     r3 = *((r3 + 0x894));
    0x00012f78 cmp r3, 1                                     |     
                                                             |     if (r3 == 1) {
    0x00012f7c beq 0x136e0                                   |         goto label_14;
                                                             |     }
    0x00012f80 ldr r3, [sp, 0x18]                            |     r3 = var_18h;
    0x00012f84 mov r2, 0x40                                  |     r2 = 0x40;
    0x00012f88 ldr r1, [fp, 0x418]                           |     r1 = *(arg_418h);
    0x00012f8c str r2, [sp]                                  |     *(sp) = r2;
    0x00012f90 ldr r2, [pc, 0x9f8]                           |     r2 = *(0x1398c);
    0x00012f94 mov r0, 0x30                                  |     r0 = 0x30;
    0x00012f98 add r7, fp, 0x410                             |     r7 += arg_410h;
    0x00012f9c str r3, [sp, 4]                               |     var_4h = r3;
    0x00012fa0 str r0, [sp, 8]                               |     var_8h = r0;
    0x00012fa4 add r7, r7, 0xc                               |     r7 += 0xc;
    0x00012fa8 ldr r5, [fp, 0x414]                           |     r5 = *(arg_414h);
    0x00012fac mov r3, r7                                    |     r3 = r7;
    0x00012fb0 add r2, pc, r2                                |     r2 = pc + r2;
    0x00012fb4 mov r0, r4                                    |     r0 = r4;
    0x00012fb8 blx r5                                        |     uint32_t (*r5)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
    0x00012fbc mov r5, r7                                    |     r5 = r7;
    0x00012fc0 subs r8, r0, 0                                |     r8 = r0 - 0;
                                                             |     if (r8 != r0) {
    0x00012fc4 addeq r6, sp, 0x68                            |         r6 += var_68h;
                                                             |     }
                                                             |     if (r8 != r0) {
    0x00012fc8 bne 0x13568                                   |         goto label_15;
                                                             |     }
                                                             | label_6:
    0x00012fcc add r2, fp, 0x880                             |     r2 += arg_880h;
    0x00012fd0 mov r3, 0                                     |     r3 = 0;
                                                             |     do {
    0x00012fd4 strb r3, [r4]                                 |         *(r4) = r3;
    0x00012fd8 add r4, r4, 1                                 |         r4++;
    0x00012fdc cmp r4, r2                                    |         
    0x00012fe0 bne 0x12fd4                                   |         
                                                             |     } while (r4 != r2);
                                                             | label_1:
    0x00012fe4 add r4, sp, 0x28                              |     r4 += s1;
    0x00012fe8 mov r2, 0x40                                  |     r2 = 0x40;
    0x00012fec mov r1, r7                                    |     r1 = r7;
    0x00012ff0 mov r0, r4                                    |     r0 = r4;
    0x00012ff4 bl 0x4558                                     |     memcpy (r0, r1, r2);
    0x00012ff8 mov r2, 0x20                                  |     r2 = 0x20;
    0x00012ffc add r1, sp, 0x48                              |     r1 += s2;
    0x00013000 mov r0, r7                                    |     r0 = r7;
    0x00013004 bl 0x4558                                     |     memcpy (r0, r1, r2);
    0x00013008 add r0, fp, 0x430                             |     r0 += arg_430h;
    0x0001300c mov r1, r4                                    |     r1 = r4;
    0x00013010 add r0, r0, 0xc                               |     r0 += 0xc;
    0x00013014 mov r2, 0x20                                  |     r2 = 0x20;
    0x00013018 bl 0x4558                                     |     memcpy (r0, r1, r2);
    0x0001301c mov r1, r4                                    |     r1 = r4;
    0x00013020 mov r3, 0                                     |     r3 = 0;
                                                             |     do {
    0x00013024 strb r3, [r1]                                 |         *(r1) = r3;
    0x00013028 add r1, r1, 1                                 |         r1 += var_1h;
    0x0001302c cmp r1, r6                                    |         
    0x00013030 bne 0x13024                                   |         
                                                             |     } while (r1 != r6);
    0x00013034 mov r3, 0x100                                 |     r3 = 0x100;
    0x00013038 ldr r2, [pc, 0x954]                           |     r2 = *(0x13990);
    0x0001303c str r3, [sp, 8]                               |     var_8h = r3;
    0x00013040 mov r3, 0x40                                  |     r3 = 0x40;
    0x00013044 str r1, [sp, 4]                               |     var_4h = r1;
    0x00013048 str r3, [sp]                                  |     *(sp) = r3;
    0x0001304c ldr r4, [fp, 0x414]                           |     r4 = *(arg_414h);
    0x00013050 mov r3, r7                                    |     r3 = r7;
    0x00013054 add r2, pc, r2                                |     r2 = pc + r2;
    0x00013058 mov r1, 0x30                                  |     r1 = 0x30;
    0x0001305c ldr r0, [sp, 0x18]                            |     r0 = var_18h;
    0x00013060 blx r4                                        |     r0 = uint32_t (*r4)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
    0x00013064 subs r8, r0, 0                                |     r8 = r0 - 0;
                                                             |     if (r8 != r0) {
    0x00013068 bne 0x133ac                                   |         goto label_16;
                                                             |     }
    0x0001306c ldr r3, [sp, 0x1c]                            |     r3 = var_1ch;
    0x00013070 ldr r4, [pc, 0x920]                           |     r4 = *(0x13994);
    0x00013074 ldr r0, [r3, 4]                               |     r0 = *((r3 + 4));
    0x00013078 bl 0x475c                                     |     fcn_0000475c ();
    0x0001307c ldr r3, [pc, 0x918]                           |     r3 = *(0x13998);
    0x00013080 add r4, pc, r4                                |     r4 = pc + r4;
    0x00013084 add r3, pc, r3                                |     r3 = pc + r3;
    0x00013088 mov r2, r4                                    |     r2 = r4;
    0x0001308c str r3, [sp]                                  |     *(sp) = r3;
    0x00013090 mov r1, 3                                     |     r1 = 3;
    0x00013094 mov r3, 0x29c                                 |     r3 = 0x29c;
    0x00013098 str r0, [sp, 4]                               |     var_4h = r0;
    0x0001309c mov r0, sb                                    |     r0 = sb;
    0x000130a0 bl 0x4594                                     |     fcn_00004594 ();
    0x000130a4 ldr r3, [pc, 0x8f4]                           |     r3 = *(0x1399c);
    0x000130a8 ldr r2, [sp, 0x18]                            |     r2 = var_18h;
    0x000130ac add r3, pc, r3                                |     r3 = pc + r3;
    0x000130b0 mov r1, 0x30                                  |     r1 = 0x30;
    0x000130b4 str r2, [sp, 4]                               |     var_4h = r2;
    0x000130b8 str r3, [sp]                                  |     *(sp) = r3;
    0x000130bc mov r2, r4                                    |     r2 = r4;
    0x000130c0 str r1, [sp, 8]                               |     var_8h = r1;
    0x000130c4 ldr r3, [pc, 0x8d8]                           |     r3 = *(0x139a0);
    0x000130c8 mov r1, 3                                     |     r1 = 3;
    0x000130cc mov r0, sb                                    |     r0 = sb;
    0x000130d0 bl 0x496c                                     |     fcn_0000496c ();
    0x000130d4 ldr r3, [pc, 0x8cc]                           |     r3 = *(0x139a4);
    0x000130d8 mov r2, 0x40                                  |     r2 = 0x40;
    0x000130dc add r3, pc, r3                                |     r3 = pc + r3;
    0x000130e0 str r2, [sp, 8]                               |     var_8h = r2;
    0x000130e4 str r7, [sp, 4]                               |     var_4h = r7;
    0x000130e8 mov r2, r4                                    |     r2 = r4;
    0x000130ec str r3, [sp]                                  |     *(sp) = r3;
    0x000130f0 mov r1, 4                                     |     r1 = 4;
    0x000130f4 ldr r3, [pc, 0x8b0]                           |     r3 = *(0x139a8);
    0x000130f8 mov r0, sb                                    |     r0 = sb;
    0x000130fc bl 0x496c                                     |     fcn_0000496c ();
    0x00013100 ldr r3, [pc, 0x8a8]                           |     r3 = *(0x139ac);
    0x00013104 mov r1, 0x100                                 |     r1 = 0x100;
    0x00013108 add r3, pc, r3                                |     r3 = pc + r3;
    0x0001310c str r1, [sp, 8]                               |     var_8h = r1;
    0x00013110 stm sp, {r3, r6}                              |     *(sp) = r3;
                                                             |     *((sp + 4)) = r6;
    0x00013114 ldr r3, [pc, 0x898]                           |     r3 = *(0x139b0);
    0x00013118 mov r2, r4                                    |     r2 = r4;
    0x0001311c mov r1, 4                                     |     r1 = 4;
    0x00013120 mov r0, sb                                    |     r0 = sb;
    0x00013124 bl 0x496c                                     |     fcn_0000496c ();
    0x00013128 add r7, r7, 0x40                              |     r7 += 0x40;
                                                             |     do {
    0x0001312c strb r8, [r5]                                 |         *(r5) = r8;
    0x00013130 add r5, r5, 1                                 |         r5++;
    0x00013134 cmp r5, r7                                    |         
    0x00013138 bne 0x1312c                                   |         
                                                             |     } while (r5 != r7);
    0x0001313c ldr r2, [sp, 0x20]                            |     r2 = var_20h;
    0x00013140 ldr r3, [r2, 4]                               |     r3 = *((r2 + 4));
    0x00013144 ldr r2, [r2, 8]                               |     r2 = *((r2 + 8));
    0x00013148 sub r3, r3, 6                                 |     r3 -= 6;
    0x0001314c bics r4, r3, 2                                |     __asm ("bics r4, r3, 2");
    0x00013150 lsr r3, r2, 3                                 |     r3 = r2 >> 3;
    0x00013154 str r3, [sl, 4]                               |     *((sl + 4)) = r3;
                                                             |     if (r5 != r7) {
    0x00013158 bne 0x13500                                   |         goto label_17;
                                                             |     }
    0x0001315c ldr r2, [sl]                                  |     r2 = *(sl);
    0x00013160 mov r1, 4                                     |     r1 = 4;
    0x00013164 mov r5, 0xc                                   |     r5 = 0xc;
    0x00013168 str r1, [sl, 0x10]                            |     *((sl + 0x10)) = r1;
    0x0001316c str r4, [sl, 0x14]                            |     *((sl + 0x14)) = r4;
    0x00013170 str r5, [sl, 0xc]                             |     *((sl + 0xc)) = r5;
    0x00013174 ldrb r2, [r2, 0x24]                           |     r2 = *((r2 + 0x24));
    0x00013178 tst r2, 2                                     |     
                                                             |     if ((r2 & 2) != 0) {
    0x0001317c moveq r1, 0x18                                |         r1 = 0x18;
                                                             |     }
                                                             |     if ((r2 & 2) == 0) {
    0x00013180 movne r1, 0x10                                |         r1 = 0x10;
                                                             |     }
    0x00013184 str r1, [sl, 8]                               |     *((sl + 8)) = r1;
                                                             | label_5:
    0x00013188 ldr r2, [pc, 0x828]                           |     r2 = *(0x139b4);
    0x0001318c str r1, [sp, 8]                               |     var_8h = r1;
    0x00013190 add r2, pc, r2                                |     r2 = pc + r2;
    0x00013194 str r2, [sp]                                  |     *(sp) = r2;
    0x00013198 ldr r2, [pc, 0x81c]                           |     r2 = *(0x139b8);
    0x0001319c str r3, [sp, 4]                               |     var_4h = r3;
    0x000131a0 str r4, [sp, 0x10]                            |     var_10h = r4;
    0x000131a4 mov r3, 0x300                                 |     r3 = 0x300;
    0x000131a8 str r5, [sp, 0xc]                             |     var_ch = r5;
    0x000131ac add r2, pc, r2                                |     r2 = pc + r2;
    0x000131b0 mov r1, 3                                     |     r1 = 3;
    0x000131b4 mov r0, sb                                    |     r0 = sb;
    0x000131b8 bl 0x4594                                     |     fcn_00004594 ();
    0x000131bc ldr r3, [sb]                                  |     r3 = *(sb);
    0x000131c0 ldrb r3, [r3, 0xcc]                           |     r3 = *((r3 + 0xcc));
    0x000131c4 tst r3, 1                                     |     
                                                             |     if ((r3 & 1) == 0) {
    0x000131c8 beq 0x13410                                   |         goto label_18;
                                                             |     }
    0x000131cc ldr r4, [sl, 0x10]                            |     r4 = *((sl + 0x10));
    0x000131d0 ldr fp, [sl, 0x14]                            |     fp = *((sl + 0x14));
    0x000131d4 ldr r8, [sl, 4]                               |     r8 = *((sl + 4));
    0x000131d8 cmp r4, 0                                     |     
                                                             |     if (r4 != 0) {
    0x000131dc ldreq r4, [sl, 0xc]                           |         r4 = *((sl + 0xc));
                                                             |     }
    0x000131e0 lsl r5, fp, 1                                 |     r5 = fp << 1;
    0x000131e4 add r7, r5, r8                                |     r7 = r5 + r8;
    0x000131e8 add r7, r6, r7                                |     r7 = r6 + r7;
    0x000131ec add r1, r7, r8                                |     r1 = r7 + r8;
    0x000131f0 mov r2, r4                                    |     r2 = r4;
    0x000131f4 add r0, sl, 0x28                              |     r0 = sl + 0x28;
    0x000131f8 bl 0x4558                                     |     memcpy (r0, r1, r2);
    0x000131fc add r1, r8, r4                                |     r1 = r8 + r4;
    0x00013200 add r1, r7, r1                                |     r1 = r7 + r1;
    0x00013204 mov r2, r4                                    |     r2 = r4;
    0x00013208 add r0, sl, 0x18                              |     r0 = sl + 0x18;
    0x0001320c bl 0x4558                                     |     memcpy (r0, r1, r2);
    0x00013210 ldr r3, [sb, 0x14]                            |     r3 = *((sb + 0x14));
    0x00013214 add fp, r6, fp                                |     
    0x00013218 cmp r3, 0                                     |     
    0x0001321c add r5, r6, r5                                |     r5 = r6 + r5;
    0x00013220 mov r8, r6                                    |     r8 = r6;
                                                             |     if (r3 != 0) {
    0x00013224 bne 0x1346c                                   |         goto label_19;
                                                             |     }
                                                             | label_2:
    0x00013228 ldr r3, [sl, 0x14]                            |     r3 = *((sl + 0x14));
    0x0001322c cmp r3, 0x14                                  |     
                                                             |     if (r3 > 0x14) {
    0x00013230 bhi 0x13894                                   |         goto label_20;
                                                             |     }
    0x00013234 mov r2, r3                                    |     r2 = r3;
    0x00013238 mov r1, fp                                    |     r1 = fp;
    0x0001323c add r0, sl, 0x38                              |     r0 = sl + 0x38;
    0x00013240 str r3, [sp, 0x1c]                            |     var_1ch = r3;
    0x00013244 bl 0x4558                                     |     memcpy (r0, r1, r2);
    0x00013248 ldr r3, [sp, 0x1c]                            |     r3 = var_1ch;
    0x0001324c mov r1, r8                                    |     r1 = r8;
    0x00013250 mov r2, r3                                    |     r2 = r3;
    0x00013254 add r0, sl, 0x4c                              |     r0 = sl + 0x4c;
    0x00013258 bl 0x4558                                     |     memcpy (r0, r1, r2);
                                                             | label_3:
    0x0001325c ldr r3, [sb]                                  |     r3 = *(sb);
    0x00013260 ldr r8, [r3, 0x5c]                            |     r8 = *((r3 + 0x5c));
    0x00013264 cmp r8, 0                                     |     
                                                             |     if (r8 != 0) {
    0x00013268 beq 0x1328c                                   |         
    0x0001326c ldr r0, [r3, 0x60]                            |         r0 = *((r3 + 0x60));
    0x00013270 ldr r3, [sl, 0x14]                            |         r3 = *((sl + 0x14));
    0x00013274 str r4, [sp, 4]                               |         var_4h = r4;
    0x00013278 ldr r2, [sl, 4]                               |         r2 = *((sl + 4));
    0x0001327c ldr r1, [sp, 0x18]                            |         r1 = var_18h;
    0x00013280 str r2, [sp]                                  |         *(sp) = r2;
    0x00013284 mov r2, r6                                    |         r2 = r6;
    0x00013288 blx r8                                        |         uint32_t (*r8)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
                                                             |     }
    0x0001328c add r4, sl, 0x78                              |     r4 = sl + 0x78;
    0x00013290 mov r0, r4                                    |     r0 = r4;
    0x00013294 ldr r1, [sp, 0x20]                            |     r1 = var_20h;
    0x00013298 bl 0x4798                                     |     r0 = mbedtls_cipher_setup ();
    0x0001329c subs r8, r0, 0                                |     r8 = r0 - 0;
                                                             |     if (r8 != r0) {
    0x000132a0 bne 0x134cc                                   |         goto label_21;
                                                             |     }
    0x000132a4 add sl, sl, 0xb8                              |     sl += 0xb8;
    0x000132a8 mov r0, sl                                    |     r0 = sl;
    0x000132ac ldr r1, [sp, 0x20]                            |     r1 = var_20h;
    0x000132b0 bl 0x4798                                     |     r0 = mbedtls_cipher_setup ();
    0x000132b4 subs r8, r0, 0                                |     r8 = r0 - 0;
                                                             |     if (r8 != r0) {
    0x000132b8 bne 0x13598                                   |         goto label_22;
                                                             |     }
    0x000132bc ldr r2, [sp, 0x20]                            |     r2 = var_20h;
    0x000132c0 mov r1, r7                                    |     r1 = r7;
    0x000132c4 mov r3, 1                                     |     r3 = 1;
    0x000132c8 ldr r2, [r2, 8]                               |     r2 = *((r2 + 8));
    0x000132cc mov r0, r4                                    |     r0 = r4;
    0x000132d0 bl 0x4708                                     |     r0 = mbedtls_cipher_setkey ();
    0x000132d4 subs r8, r0, 0                                |     r8 = r0 - 0;
                                                             |     if (r8 != r0) {
    0x000132d8 bne 0x135f0                                   |         goto label_23;
                                                             |     }
    0x000132dc ldr r2, [sp, 0x20]                            |     r2 = var_20h;
    0x000132e0 mov r3, r8                                    |     r3 = r8;
    0x000132e4 mov r1, r5                                    |     r1 = r5;
    0x000132e8 ldr r2, [r2, 8]                               |     r2 = *((r2 + 8));
    0x000132ec mov r0, sl                                    |     r0 = sl;
    0x000132f0 bl 0x4708                                     |     r0 = mbedtls_cipher_setkey ();
    0x000132f4 subs r8, r0, 0                                |     r8 = r0 - 0;
                                                             |     if (r8 != r0) {
    0x000132f8 bne 0x135c4                                   |         goto label_24;
                                                             |     }
    0x000132fc ldr r3, [sp, 0x20]                            |     r3 = var_20h;
    0x00013300 ldr r3, [r3, 4]                               |     r3 = *((r3 + 4));
    0x00013304 cmp r3, 2                                     |     
                                                             |     if (r3 == 2) {
    0x00013308 beq 0x1383c                                   |         goto label_25;
                                                             |     }
                                                             | label_7:
    0x0001330c mov r3, 0                                     |     r3 = 0;
                                                             |     do {
    0x00013310 strb r3, [r6]                                 |         *(r6) = r3;
    0x00013314 add r2, sp, 0x168                             |         r2 += var_168h;
    0x00013318 add r6, r6, 1                                 |         r6 += var_1h_2;
    0x0001331c cmp r6, r2                                    |         
    0x00013320 bne 0x13310                                   |         
                                                             |     } while (r6 != r2);
    0x00013324 ldr r3, [pc, 0x694]                           |     r3 = *(0x139bc);
    0x00013328 ldr r2, [pc, 0x694]                           |     r2 = *(0x139c0);
    0x0001332c add r3, pc, r3                                |     r3 = pc + r3;
    0x00013330 str r3, [sp]                                  |     *(sp) = r3;
    0x00013334 mov r0, sb                                    |     r0 = sb;
    0x00013338 ldr r3, [pc, 0x688]                           |     r3 = *(0x139c4);
    0x0001333c add r2, pc, r2                                |     r2 = pc + r2;
    0x00013340 mov r1, 2                                     |     r1 = 2;
    0x00013344 bl 0x4594                                     |     fcn_00004594 ();
    0x00013348 b 0x133d4                                     |     goto label_4;
                                                             | label_11:
    0x0001334c ldr r1, [pc, 0x678]                           |     r1 = *(0x139c8);
    0x00013350 ldr r2, [pc, 0x678]                           |     r2 = *(0x139cc);
    0x00013354 ldr r3, [pc, 0x678]                           |     r3 = *(0x139d0);
    0x00013358 add r1, pc, r1                                |     r1 = pc + r1;
    0x0001335c add r2, pc, r2                                |     r2 = pc + r2;
    0x00013360 add r3, pc, r3                                |     r3 = pc + r3;
    0x00013364 str r1, [fp, 0x414]                           |     *(arg_414h) = r1;
    0x00013368 str r2, [fp, 0x40c]                           |     *(arg_40ch) = r2;
    0x0001336c str r3, [fp, 0x410]                           |     *(arg_410h) = r3;
    0x00013370 b 0x12f1c                                     |     goto label_0;
                                                             | label_13:
    0x00013374 ldr r2, [pc, 0x65c]                           |     r2 = *(0x139d4);
    0x00013378 add r7, fp, 0x410                             |     r7 += arg_410h;
    0x0001337c add r2, pc, r2                                |     r2 = pc + r2;
    0x00013380 str r2, [sp]                                  |     *(sp) = r2;
    0x00013384 ldr r2, [pc, 0x650]                           |     r2 = *(0x139d8);
    0x00013388 ldr r3, [pc, 0x650]                           |     r3 = *(0x139dc);
    0x0001338c add r2, pc, r2                                |     r2 = pc + r2;
    0x00013390 mov r1, 3                                     |     r1 = 3;
    0x00013394 mov r0, sb                                    |     r0 = sb;
    0x00013398 add r7, r7, 0xc                               |     r7 += 0xc;
    0x0001339c bl 0x4594                                     |     fcn_00004594 ();
    0x000133a0 mov r5, r7                                    |     r5 = r7;
    0x000133a4 add r6, sp, 0x68                              |     r6 += var_68h;
    0x000133a8 b 0x12fe4                                     |     goto label_1;
                                                             | label_16:
    0x000133ac ldr r3, [pc, 0x630]                           |     r3 = *(0x139e0);
    0x000133b0 ldr r2, [pc, 0x630]                           |     r2 = *(0x139e4);
    0x000133b4 add r3, pc, r3                                |     r3 = pc + r3;
    0x000133b8 str r3, [sp]                                  |     *(sp) = r3;
    0x000133bc str r8, [sp, 4]                               |     var_4h = r8;
    0x000133c0 mov r0, sb                                    |     r0 = sb;
    0x000133c4 ldr r3, [pc, 0x620]                           |     r3 = *(0x139e8);
    0x000133c8 add r2, pc, r2                                |     r2 = pc + r2;
    0x000133cc mov r1, 1                                     |     r1 = 1;
    0x000133d0 bl 0x47b0                                     |     fcn_000047b0 ();
                                                             |     do {
                                                             | label_4:
    0x000133d4 mov r0, r8                                    |         r0 = r8;
    0x000133d8 add sp, sp, 0x16c                             |         
    0x000133dc pop {r4, r5, r6, r7, r8, sb, sl, fp, pc}      |         
                                                             | label_12:
    0x000133e0 cmp r3, 3                                     |         
                                                             |         if (r3 == 3) {
    0x000133e4 beq 0x13494                                   |             goto label_26;
                                                             |         }
    0x000133e8 ldr r3, [pc, 0x600]                           |         r3 = *(0x139ec);
    0x000133ec mov r2, r4                                    |         r2 = r4;
    0x000133f0 add r3, pc, r3                                |         r3 = pc + r3;
    0x000133f4 str r3, [sp]                                  |         *(sp) = r3;
    0x000133f8 mov r0, sb                                    |         r0 = sb;
    0x000133fc ldr r3, [pc, 0x5f0]                           |         r3 = *(0x139f0);
    0x00013400 mov r1, 1                                     |         r1 = 1;
    0x00013404 bl 0x4594                                     |         fcn_00004594 ();
    0x00013408 ldr r8, [pc, 0x5e8]                           |         r8 = *(0x139f4);
    0x0001340c b 0x133d4                                     |         
                                                             |     } while (1);
                                                             | label_18:
    0x00013410 ldr r4, [sl, 0x10]                            |     r4 = *((sl + 0x10));
    0x00013414 ldr r8, [sl, 0x14]                            |     r8 = *((sl + 0x14));
    0x00013418 ldr fp, [sl, 4]                               |     fp = *((sl + 4));
    0x0001341c cmp r4, 0                                     |     
                                                             |     if (r4 != 0) {
    0x00013420 ldreq r4, [sl, 0xc]                           |         r4 = *((sl + 0xc));
                                                             |     }
    0x00013424 lsl r7, r8, 1                                 |     r7 = r8 << 1;
    0x00013428 add r5, r7, fp                                |     r5 = r7 + fp;
    0x0001342c add r5, r6, r5                                |     r5 = r6 + r5;
    0x00013430 add r1, r5, fp                                |     r1 = r5 + fp;
    0x00013434 mov r2, r4                                    |     r2 = r4;
    0x00013438 add r0, sl, 0x18                              |     r0 = sl + 0x18;
    0x0001343c bl 0x4558                                     |     memcpy (r0, r1, r2);
    0x00013440 add r1, fp, r4                                |     r1 = fp + r4;
    0x00013444 add r1, r5, r1                                |     r1 = r5 + r1;
    0x00013448 mov r2, r4                                    |     r2 = r4;
    0x0001344c add r0, sl, 0x28                              |     r0 = sl + 0x28;
    0x00013450 bl 0x4558                                     |     memcpy (r0, r1, r2);
    0x00013454 ldr r3, [sb, 0x14]                            |     r3 = *((sb + 0x14));
    0x00013458 add r8, r6, r8                                |     r8 = r6 + r8;
    0x0001345c cmp r3, 0                                     |     
    0x00013460 add r7, r6, r7                                |     r7 = r6 + r7;
    0x00013464 mov fp, r6                                    |     
                                                             |     if (r3 == 0) {
    0x00013468 beq 0x13228                                   |         goto label_2;
                                                             |     }
                                                             |     if (r3 <= 0) {
                                                             | label_19:
    0x0001346c ble 0x13944                                   |         goto label_27;
                                                             |     }
    0x00013470 mov r1, fp                                    |     r1 = fp;
    0x00013474 ldr r2, [sl, 0x14]                            |     r2 = *((sl + 0x14));
    0x00013478 add r0, sl, 0x60                              |     r0 = sl + 0x60;
    0x0001347c bl 0x4bb8                                     |     mbedtls_md_hmac_starts ();
    0x00013480 mov r1, r8                                    |     r1 = r8;
    0x00013484 ldr r2, [sl, 0x14]                            |     r2 = *((sl + 0x14));
    0x00013488 add r0, sl, 0x6c                              |     r0 = sl + 0x6c;
    0x0001348c bl 0x4bb8                                     |     mbedtls_md_hmac_starts ();
    0x00013490 b 0x1325c                                     |     goto label_3;
                                                             | label_26:
    0x00013494 ldr r3, [sl]                                  |     r3 = *(sl);
    0x00013498 ldr r3, [r3, 0xc]                             |     r3 = *((r3 + 0xc));
    0x0001349c cmp r3, 7                                     |     
                                                             |     if (r3 != 7) {
    0x000134a0 beq 0x136b8                                   |         
    0x000134a4 ldr r1, [pc, 0x550]                           |         r1 = *(0x139f8);
    0x000134a8 ldr r2, [pc, 0x550]                           |         r2 = *(0x139fc);
    0x000134ac ldr r3, [pc, 0x550]                           |         r3 = *(0x13a00);
    0x000134b0 add r1, pc, r1                                |         r1 = pc + r1;
    0x000134b4 add r2, pc, r2                                |         r2 = pc + r2;
    0x000134b8 add r3, pc, r3                                |         r3 = pc + r3;
    0x000134bc str r1, [fp, 0x414]                           |         *(arg_414h) = r1;
    0x000134c0 str r2, [fp, 0x40c]                           |         *(arg_40ch) = r2;
    0x000134c4 str r3, [fp, 0x410]                           |         *(arg_410h) = r3;
    0x000134c8 b 0x12f1c                                     |         goto label_0;
                                                             | label_21:
    0x000134cc ldr r3, [pc, 0x534]                           |         r3 = *(0x13a04);
    0x000134d0 ldr r2, [pc, 0x534]                           |         r2 = *(0x13a08);
    0x000134d4 add r3, pc, r3                                |         r3 = pc + r3;
    0x000134d8 mov r0, sb                                    |         r0 = sb;
    0x000134dc str r3, [sp]                                  |         *(sp) = r3;
    0x000134e0 str r8, [sp, 4]                               |         var_4h = r8;
    0x000134e4 ldr r3, [pc, 0x524]                           |         r3 = *(0x13a0c);
    0x000134e8 add r2, pc, r2                                |         r2 = pc + r2;
    0x000134ec mov r1, 1                                     |         r1 = 1;
    0x000134f0 bl 0x47b0                                     |         fcn_000047b0 ();
    0x000134f4 mov r0, r8                                    |         r0 = r8;
    0x000134f8 add sp, sp, 0x16c                             |         
    0x000134fc pop {r4, r5, r6, r7, r8, sb, sl, fp, pc}      |         
                                                             | label_17:
    0x00013500 ldr r4, [sp, 0x24]                            |         r4 = var_24h;
    0x00013504 mov r2, 1                                     |         r2 = 1;
    0x00013508 mov r1, r4                                    |         r1 = r4;
    0x0001350c add r0, sl, 0x60                              |         r0 = sl + 0x60;
    0x00013510 bl 0x4894                                     |         r0 = mbedtls_md_setup ();
    0x00013514 subs r8, r0, 0                                |         r8 = r0 - 0;
                                                             |         if (r8 == r0) {
    0x00013518 bne 0x13534                                   |             
    0x0001351c mov r2, 1                                     |             r2 = 1;
    0x00013520 mov r1, r4                                    |             r1 = r4;
    0x00013524 add r0, sl, 0x6c                              |             r0 = sl + 0x6c;
    0x00013528 bl 0x4894                                     |             r0 = mbedtls_md_setup ();
    0x0001352c subs r8, r0, 0                                |             r8 = r0 - 0;
                                                             |             if (r8 == r0) {
    0x00013530 beq 0x1361c                                   |                 goto label_28;
                                                             |             }
                                                             |         }
    0x00013534 ldr r3, [pc, 0x4d8]                           |         r3 = *(0x13a10);
    0x00013538 ldr r2, [pc, 0x4d8]                           |         r2 = *(0x13a14);
    0x0001353c add r3, pc, r3                                |         r3 = pc + r3;
    0x00013540 mov r0, sb                                    |         r0 = sb;
    0x00013544 str r3, [sp]                                  |         *(sp) = r3;
    0x00013548 str r8, [sp, 4]                               |         var_4h = r8;
    0x0001354c mov r3, 0x2bc                                 |         r3 = 0x2bc;
    0x00013550 add r2, pc, r2                                |         r2 = pc + r2;
    0x00013554 mov r1, 1                                     |         r1 = 1;
    0x00013558 bl 0x47b0                                     |         fcn_000047b0 ();
    0x0001355c mov r0, r8                                    |         r0 = r8;
    0x00013560 add sp, sp, 0x16c                             |         
    0x00013564 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc}      |         
                                                             | label_15:
    0x00013568 ldr r3, [pc, 0x4ac]                           |         r3 = *(0x13a18);
    0x0001356c mov r0, sb                                    |         r0 = sb;
    0x00013570 add r3, pc, r3                                |         r3 = pc + r3;
    0x00013574 str r3, [sp]                                  |         *(sp) = r3;
    0x00013578 str r8, [sp, 4]                               |         var_4h = r8;
    0x0001357c mov r2, r6                                    |         r2 = r6;
    0x00013580 ldr r3, [pc, 0x498]                           |         r3 = *(0x13a1c);
    0x00013584 mov r1, 1                                     |         r1 = 1;
    0x00013588 bl 0x47b0                                     |         fcn_000047b0 ();
    0x0001358c mov r0, r8                                    |         r0 = r8;
    0x00013590 add sp, sp, 0x16c                             |         
    0x00013594 pop {r4, r5, r6, r7, r8, sb, sl, fp, pc}      |         
                                                             | label_22:
    0x00013598 ldr r3, [pc, 0x484]                           |         r3 = *(0x13a20);
    0x0001359c ldr r2, [pc, 0x484]                           |         r2 = *(0x13a24);
    0x000135a0 add r3, pc, r3                                |         r3 = pc + r3;
    0x000135a4 str r3, [sp]                                  |         *(sp) = r3;
    0x000135a8 str r8, [sp, 4]                               |         var_4h = r8;
    0x000135ac mov r0, sb                                    |         r0 = sb;
    0x000135b0 ldr r3, [pc, 0x474]                           |         r3 = *(0x13a28);
    0x000135b4 add r2, pc, r2                                |         r2 = pc + r2;
    0x000135b8 mov r1, 1                                     |         r1 = 1;
    0x000135bc bl 0x47b0                                     |         fcn_000047b0 ();
    0x000135c0 b 0x133d4                                     |         goto label_4;
                                                             | label_24:
    0x000135c4 ldr r3, [pc, 0x464]                           |         r3 = *(0x13a2c);
    0x000135c8 ldr r2, [pc, 0x464]                           |         r2 = *(0x13a30);
    0x000135cc add r3, pc, r3                                |         r3 = pc + r3;
    0x000135d0 str r3, [sp]                                  |         *(sp) = r3;
    0x000135d4 str r8, [sp, 4]                               |         var_4h = r8;
    0x000135d8 mov r0, sb                                    |         r0 = sb;
    0x000135dc ldr r3, [pc, 0x454]                           |         r3 = *(0x13a34);
    0x000135e0 add r2, pc, r2                                |         r2 = pc + r2;
    0x000135e4 mov r1, 1                                     |         r1 = 1;
    0x000135e8 bl 0x47b0                                     |         fcn_000047b0 ();
    0x000135ec b 0x133d4                                     |         goto label_4;
                                                             | label_23:
    0x000135f0 ldr r3, [pc, 0x444]                           |         r3 = *(0x13a38);
    0x000135f4 ldr r2, [pc, 0x444]                           |         r2 = *(0x13a3c);
    0x000135f8 add r3, pc, r3                                |         r3 = pc + r3;
    0x000135fc str r3, [sp]                                  |         *(sp) = r3;
    0x00013600 str r8, [sp, 4]                               |         var_4h = r8;
    0x00013604 mov r0, sb                                    |         r0 = sb;
    0x00013608 ldr r3, [pc, 0x434]                           |         r3 = *(0x13a40);
    0x0001360c add r2, pc, r2                                |         r2 = pc + r2;
    0x00013610 mov r1, 1                                     |         r1 = 1;
    0x00013614 bl 0x47b0                                     |         fcn_000047b0 ();
    0x00013618 b 0x133d4                                     |         goto label_4;
                                                             | label_28:
    0x0001361c ldr r0, [sp, 0x24]                            |         r0 = var_24h;
    0x00013620 bl 0x4b4c                                     |         mbedtls_md_get_size ();
    0x00013624 ldr r3, [sp, 0x1c]                            |         r3 = var_1ch;
    0x00013628 ldr r2, [sp, 0x20]                            |         r2 = var_20h;
    0x0001362c ldr r3, [r3, 0x78]                            |         r3 = *((r3 + 0x78));
    0x00013630 ldr r5, [r2, 0x10]                            |         r5 = *((r2 + 0x10));
    0x00013634 cmp r3, 1                                     |         
                                                             |         if (r3 != 1) {
    0x00013638 moveq r3, 0xa                                 |             r3 = 0xa;
                                                             |         }
    0x0001363c mov r4, r0                                    |         r4 = r0;
    0x00013640 str r0, [sl, 0x14]                            |         *((sl + 0x14)) = r0;
                                                             |         if (r3 != 1) {
    0x00013644 moveq r4, r3                                  |             r4 = r3;
                                                             |         }
                                                             |         if (r3 != 1) {
    0x00013648 streq r3, [sl, 0x14]                          |             *((sl + 0x14)) = r3;
                                                             |         }
    0x0001364c ldr r3, [r2, 4]                               |         r3 = *((r2 + 4));
    0x00013650 str r5, [sl, 0xc]                             |         *((sl + 0xc)) = r5;
    0x00013654 cmp r3, 7                                     |         
                                                             |         if (r3 == 7) {
    0x00013658 beq 0x137c4                                   |             goto label_29;
                                                             |         }
    0x0001365c ldr r3, [sp, 0x1c]                            |         r3 = var_1ch;
    0x00013660 ldr r2, [sp, 0x20]                            |         r2 = var_20h;
    0x00013664 ldr r3, [r3, 0x7c]                            |         r3 = *((r3 + 0x7c));
    0x00013668 ldr r1, [r2, 0x18]                            |         r1 = *((r2 + 0x18));
    0x0001366c cmp r3, 1                                     |         
    0x00013670 add r7, r4, r1                                |         r7 = r4 + r1;
                                                             |         if (r3 != 1) {
    0x00013674 streq r7, [sl, 8]                             |             *((sl + 8)) = r7;
                                                             |         }
                                                             |         if (r3 != 1) {
    0x00013678 beq 0x1368c                                   |             
    0x0001367c mov r0, r4                                    |             r0 = r4;
    0x00013680 bl 0x1c508                                    |             aeabi_uidivmod ();
    0x00013684 sub r1, r7, r1                                |             r1 = r7 - r1;
    0x00013688 str r1, [sl, 8]                               |             *((sl + 8)) = r1;
                                                             |         }
    0x0001368c ldr r3, [sb, 0x14]                            |         r3 = *((sb + 0x14));
    0x00013690 cmp r3, 1                                     |         
                                                             |         if (r3 < 1) {
    0x00013694 bls 0x138f0                                   |             goto label_30;
                                                             |         }
    0x00013698 sub r3, r3, 2                                 |         r3 -= 2;
    0x0001369c cmp r3, 1                                     |         
                                                             |         if (r3 > 1) {
    0x000136a0 bhi 0x13918                                   |             goto label_31;
                                                             |         }
    0x000136a4 ldr r1, [sl, 8]                               |         r1 = *((sl + 8));
    0x000136a8 ldr r3, [sl, 4]                               |         r3 = *((sl + 4));
    0x000136ac add r1, r5, r1                                |         r1 = r5 + r1;
    0x000136b0 str r1, [sl, 8]                               |         *((sl + 8)) = r1;
    0x000136b4 b 0x13188                                     |         goto label_5;
                                                             |     }
    0x000136b8 ldr r1, [pc, 0x388]                           |     r1 = *(0x13a44);
    0x000136bc ldr r2, [pc, 0x388]                           |     r2 = *(0x13a48);
    0x000136c0 ldr r3, [pc, 0x388]                           |     r3 = *(0x13a4c);
    0x000136c4 add r1, pc, r1                                |     r1 = pc + r1;
    0x000136c8 add r2, pc, r2                                |     r2 = pc + r2;
    0x000136cc add r3, pc, r3                                |     r3 = pc + r3;
    0x000136d0 str r1, [fp, 0x414]                           |     *(arg_414h) = r1;
    0x000136d4 str r2, [fp, 0x40c]                           |     *(arg_40ch) = r2;
    0x000136d8 str r3, [fp, 0x410]                           |     *(arg_410h) = r3;
    0x000136dc b 0x12f1c                                     |     goto label_0;
                                                             | label_14:
    0x000136e0 ldr r3, [pc, 0x36c]                           |     r3 = *(0x13a50);
    0x000136e4 mov r2, r6                                    |     r2 = r6;
    0x000136e8 add r3, pc, r3                                |     r3 = pc + r3;
    0x000136ec str r3, [sp]                                  |     *(sp) = r3;
    0x000136f0 mov r1, 3                                     |     r1 = 3;
    0x000136f4 mov r3, 0x24c                                 |     r3 = 0x24c;
    0x000136f8 mov r0, sb                                    |     r0 = sb;
    0x000136fc bl 0x4594                                     |     fcn_00004594 ();
    0x00013700 ldr r3, [sb, 0x3c]                            |     r3 = *((sb + 0x3c));
    0x00013704 add r6, sp, 0x68                              |     r6 += var_68h;
    0x00013708 ldr r3, [r3, 0x40c]                           |     r3 = *((r3 + 0x40c));
    0x0001370c mov r1, r6                                    |     r1 = r6;
    0x00013710 mov r0, sb                                    |     r0 = sb;
    0x00013714 blx r3                                        |     uint32_t (*r3)(uint32_t, uint32_t, uint32_t) (r0, r1, r3);
    0x00013718 ldr r3, [sb, 0x14]                            |     r3 = *((sb + 0x14));
    0x0001371c cmp r3, 3                                     |     
                                                             |     if (r3 == 3) {
    0x00013720 movne r5, 0x24                                |         r5 = 0x24;
                                                             |     }
                                                             |     if (r3 == 3) {
    0x00013724 beq 0x138fc                                   |         goto label_32;
                                                             |     }
                                                             | label_8:
    0x00013728 ldr r7, [pc, 0x328]                           |     r7 = *(0x13a54);
    0x0001372c ldr r3, [pc, 0x328]                           |     r3 = *(0x13a58);
    0x00013730 add r7, pc, r7                                |     r7 = pc + r7;
    0x00013734 add r3, pc, r3                                |     r3 = pc + r3;
    0x00013738 mov r2, r7                                    |     r2 = r7;
    0x0001373c str r5, [sp, 8]                               |     var_8h = r5;
    0x00013740 str r3, [sp]                                  |     *(sp) = r3;
    0x00013744 mov r1, 3                                     |     r1 = 3;
    0x00013748 ldr r3, [pc, 0x310]                           |     r3 = *(0x13a5c);
    0x0001374c mov r0, sb                                    |     r0 = sb;
    0x00013750 str r6, [sp, 4]                               |     var_4h = r6;
    0x00013754 bl 0x496c                                     |     fcn_0000496c ();
    0x00013758 ldr r2, [sp, 0x18]                            |     r2 = var_18h;
    0x0001375c ldr r1, [fp, 0x418]                           |     r1 = *(arg_418h);
    0x00013760 str r2, [sp, 4]                               |     var_4h = r2;
    0x00013764 ldr r2, [pc, 0x2f8]                           |     r2 = *(0x13a60);
    0x00013768 mov r3, 0x30                                  |     r3 = 0x30;
    0x0001376c str r3, [sp, 8]                               |     var_8h = r3;
    0x00013770 str r5, [sp]                                  |     *(sp) = r5;
    0x00013774 ldr r5, [fp, 0x414]                           |     r5 = *(arg_414h);
    0x00013778 mov r3, r6                                    |     r3 = r6;
    0x0001377c add r2, pc, r2                                |     r2 = pc + r2;
    0x00013780 mov r0, r4                                    |     r0 = r4;
    0x00013784 blx r5                                        |     r0 = uint32_t (*r5)(uint32_t, uint32_t, uint32_t, uint32_t) (r0, r1, r2, r3);
    0x00013788 subs r8, r0, 0                                |     r8 = r0 - 0;
                                                             |     if (r8 != r0) {
    0x0001378c addeq r7, fp, 0x410                           |         r7 += arg_410h;
                                                             |     }
                                                             |     if (r8 != r0) {
    0x00013790 addeq r7, r7, 0xc                             |         r7 += 0xc;
                                                             |     }
                                                             |     if (r8 == r0) {
    0x00013794 moveq r5, r7                                  |         r5 = r7;
                                                             |         goto label_33;
                                                             |     }
                                                             |     if (r8 == r0) {
                                                             | label_33:
    0x00013798 beq 0x12fcc                                   |         goto label_6;
                                                             |     }
    0x0001379c ldr r3, [pc, 0x2c4]                           |     r3 = *(0x13a64);
    0x000137a0 str r8, [sp, 4]                               |     var_4h = r8;
    0x000137a4 add r3, pc, r3                                |     r3 = pc + r3;
    0x000137a8 str r3, [sp]                                  |     *(sp) = r3;
    0x000137ac mov r2, r7                                    |     r2 = r7;
    0x000137b0 mov r0, sb                                    |     r0 = sb;
    0x000137b4 ldr r3, [pc, 0x2b0]                           |     r3 = *(0x13a68);
    0x000137b8 mov r1, 1                                     |     r1 = 1;
    0x000137bc bl 0x47b0                                     |     fcn_000047b0 ();
    0x000137c0 b 0x133d4                                     |     goto label_4;
                                                             | label_29:
    0x000137c4 str r4, [sl, 8]                               |     *((sl + 8)) = r4;
    0x000137c8 ldr r3, [sl, 4]                               |     r3 = *((sl + 4));
    0x000137cc mov r1, r4                                    |     r1 = r4;
    0x000137d0 b 0x13188                                     |     goto label_5;
                                                             | label_9:
    0x000137d4 ldr r2, [sl]                                  |     r2 = *(sl);
    0x000137d8 ldr r3, [pc, 0x290]                           |     r3 = *(0x13a6c);
    0x000137dc ldr r1, [r2, 8]                               |     r1 = *((r2 + 8));
    0x000137e0 add r3, pc, r3                                |     r3 = pc + r3;
    0x000137e4 str r1, [sp, 4]                               |     var_4h = r1;
    0x000137e8 str r3, [sp]                                  |     *(sp) = r3;
    0x000137ec mov r2, r4                                    |     r2 = r4;
    0x000137f0 mov r0, sb                                    |     r0 = sb;
    0x000137f4 mov r3, 0x1fc                                 |     r3 = 0x1fc;
    0x000137f8 mov r1, 1                                     |     r1 = 1;
    0x000137fc bl 0x4594                                     |     fcn_00004594 ();
    0x00013800 ldr r8, [pc, 0x26c]                           |     r8 = *(0x13a70);
    0x00013804 b 0x133d4                                     |     goto label_4;
                                                             | label_10:
    0x00013808 ldr r2, [sl]                                  |     r2 = *(sl);
    0x0001380c ldr r3, [pc, 0x264]                           |     r3 = *(0x13a74);
    0x00013810 ldr r1, [r2, 0xc]                             |     r1 = *((r2 + 0xc));
    0x00013814 add r3, pc, r3                                |     r3 = pc + r3;
    0x00013818 str r1, [sp, 4]                               |     var_4h = r1;
    0x0001381c str r3, [sp]                                  |     *(sp) = r3;
    0x00013820 mov r2, r4                                    |     r2 = r4;
    0x00013824 mov r0, sb                                    |     r0 = sb;
    0x00013828 mov r3, 0x204                                 |     r3 = 0x204;
    0x0001382c mov r1, 1                                     |     r1 = 1;
    0x00013830 bl 0x4594                                     |     fcn_00004594 ();
    0x00013834 ldr r8, [pc, 0x238]                           |     r8 = *(0x13a70);
    0x00013838 b 0x133d4                                     |     goto label_4;
                                                             | label_25:
    0x0001383c mov r0, r4                                    |     r0 = r4;
    0x00013840 mov r1, 4                                     |     r1 = 4;
    0x00013844 bl 0x4bd0                                     |     r0 = mbedtls_cipher_set_padding_mode ();
    0x00013848 subs ip, r0, 0                                |     
                                                             |     if (ip != r0) {
    0x0001384c bne 0x138c0                                   |         goto label_34;
                                                             |     }
    0x00013850 mov r0, sl                                    |     r0 = sl;
    0x00013854 mov r1, 4                                     |     r1 = 4;
    0x00013858 bl 0x4bd0                                     |     r0 = mbedtls_cipher_set_padding_mode ();
    0x0001385c subs ip, r0, 0                                |     
                                                             |     if (ip == r0) {
    0x00013860 beq 0x1330c                                   |         goto label_7;
                                                             |     }
    0x00013864 ldr r3, [pc, 0x210]                           |     r3 = *(0x13a78);
    0x00013868 ldr r2, [pc, 0x210]                           |     r2 = *(0x13a7c);
    0x0001386c add r3, pc, r3                                |     r3 = pc + r3;
    0x00013870 str r3, [sp]                                  |     *(sp) = r3;
    0x00013874 str ip, [sp, 4]                               |     var_4h = ip;
    0x00013878 mov r0, sb                                    |     r0 = sb;
    0x0001387c ldr r3, [pc, 0x200]                           |     r3 = *(0x13a80);
    0x00013880 add r2, pc, r2                                |     r2 = pc + r2;
    0x00013884 mov r1, 1                                     |     r1 = 1;
    0x00013888 mov r8, ip                                    |     r8 = ip;
    0x0001388c bl 0x47b0                                     |     fcn_000047b0 ();
    0x00013890 b 0x133d4                                     |     goto label_4;
                                                             | label_20:
    0x00013894 ldr r3, [pc, 0x1ec]                           |     r3 = *(0x13a84);
    0x00013898 ldr r2, [pc, 0x1ec]                           |     r2 = *(0x13a88);
    0x0001389c add r3, pc, r3                                |     r3 = pc + r3;
    0x000138a0 str r3, [sp]                                  |     *(sp) = r3;
    0x000138a4 mov r0, sb                                    |     r0 = sb;
    0x000138a8 ldr r3, [pc, 0x1e0]                           |     r3 = *(0x13a8c);
    0x000138ac add r2, pc, r2                                |     r2 = pc + r2;
    0x000138b0 mov r1, 1                                     |     r1 = 1;
    0x000138b4 bl 0x4594                                     |     fcn_00004594 ();
    0x000138b8 ldr r8, [pc, 0x138]                           |     r8 = *(0x139f4);
    0x000138bc b 0x133d4                                     |     goto label_4;
                                                             | label_34:
    0x000138c0 ldr r3, [pc, 0x1cc]                           |     r3 = *(0x13a90);
    0x000138c4 ldr r2, [pc, 0x1cc]                           |     r2 = *(0x13a94);
    0x000138c8 add r3, pc, r3                                |     r3 = pc + r3;
    0x000138cc str r3, [sp]                                  |     *(sp) = r3;
    0x000138d0 str ip, [sp, 4]                               |     var_4h = ip;
    0x000138d4 mov r0, sb                                    |     r0 = sb;
    0x000138d8 ldr r3, [pc, 0x1bc]                           |     r3 = *(0x13a98);
    0x000138dc add r2, pc, r2                                |     r2 = pc + r2;
    0x000138e0 mov r1, 1                                     |     r1 = 1;
    0x000138e4 mov r8, ip                                    |     r8 = ip;
    0x000138e8 bl 0x47b0                                     |     fcn_000047b0 ();
    0x000138ec b 0x133d4                                     |     goto label_4;
                                                             | label_30:
    0x000138f0 ldr r3, [sl, 4]                               |     r3 = *((sl + 4));
    0x000138f4 ldr r1, [sl, 8]                               |     r1 = *((sl + 8));
    0x000138f8 b 0x13188                                     |     goto label_5;
                                                             | label_32:
    0x000138fc ldr r3, [sb, 0x4c]                            |     r3 = *((sb + 0x4c));
    0x00013900 ldr r3, [r3]                                  |     r3 = *(r3);
    0x00013904 ldr r3, [r3, 0xc]                             |     r3 = *((r3 + 0xc));
    0x00013908 cmp r3, 7                                     |     
                                                             |     if (r3 == 7) {
    0x0001390c movne r5, 0x20                                |         r5 = 0x20;
                                                             |     }
                                                             |     if (r3 != 7) {
    0x00013910 moveq r5, 0x30                                |         r5 = 0x30;
                                                             |     }
    0x00013914 b 0x13728                                     |     goto label_8;
                                                             | label_31:
    0x00013918 ldr r3, [pc, 0x180]                           |     r3 = *(0x13a9c);
    0x0001391c ldr r2, [pc, 0x180]                           |     r2 = *(0x13aa0);
    0x00013920 add r3, pc, r3                                |     r3 = pc + r3;
    0x00013924 str r3, [sp]                                  |     *(sp) = r3;
    0x00013928 mov r0, sb                                    |     r0 = sb;
    0x0001392c mov r3, 0x2f8                                 |     r3 = 0x2f8;
    0x00013930 add r2, pc, r2                                |     r2 = pc + r2;
    0x00013934 mov r1, 1                                     |     r1 = 1;
    0x00013938 bl 0x4594                                     |     fcn_00004594 ();
    0x0001393c ldr r8, [pc, 0xb4]                            |     r8 = *(0x139f4);
    0x00013940 b 0x133d4                                     |     goto label_4;
                                                             | label_27:
    0x00013944 ldr r3, [pc, 0x15c]                           |     r3 = *(0x13aa4);
    0x00013948 ldr r2, [pc, 0x15c]                           |     r2 = *(0x13aa8);
    0x0001394c add r3, pc, r3                                |     r3 = pc + r3;
    0x00013950 str r3, [sp]                                  |     *(sp) = r3;
    0x00013954 mov r0, sb                                    |     r0 = sb;
    0x00013958 ldr r3, [pc, 0x150]                           |     r3 = *(0x13aac);
    0x0001395c add r2, pc, r2                                |     r2 = pc + r2;
    0x00013960 mov r1, 1                                     |     r1 = 1;
    0x00013964 bl 0x4594                                     |     fcn_00004594 ();
    0x00013968 ldr r8, [pc, 0x88]                            |     r8 = *(0x139f4);
    0x0001396c b 0x133d4                                     |     goto label_4;
                                                             | }

[*] Function sprintf used 1 times libmbedtls.so.2.2.1