[*] Binary protection state of example_io
No RELRO No Canary found NX disabled No PIE No RPATH No RUNPATH No Symbols
[*] Function printf tear down of example_io
; assembly | /* r2dec pseudo code output */
| /* /logs/firmware/patool_extraction/DUMP/mtdblock8_unblob_extracted/mtdblock8_extract/0-9650176.squashfs_v4_le_extract/bin/example_io @ 0x400ca0 */
| #include <stdint.h>
|
; (fcn) main () | int32_t main () {
| /* [11] -r-x section size 3264 named .text */
0x00400ca0 addiu sp, sp, -0x58 |
0x00400ca4 sw ra, 0x54(sp) | *(var_54h) = ra;
0x00400ca8 sw s7, 0x50(sp) | *(var_50h) = s7;
0x00400cac sw s6, 0x4c(sp) | *(var_4ch) = s6;
0x00400cb0 sw s5, 0x48(sp) | *(var_48h) = s5;
0x00400cb4 sw s4, 0x44(sp) | *(var_44h) = s4;
0x00400cb8 sw s3, 0x40(sp) | *(var_40h) = s3;
0x00400cbc sw s2, 0x3c(sp) | *(var_3ch) = s2;
0x00400cc0 sw s1, 0x38(sp) | *(var_38h) = s1;
0x00400cc4 sw s0, 0x34(sp) | *(var_34h) = s0;
0x00400cc8 lui s3, 0x40 | s3 = 0x400000;
0x00400ccc lui s4, 0x41 | s4 = 0x410000;
0x00400cd0 lui s5, 0x40 | s5 = 0x400000;
0x00400cd4 move s1, a0 | s1 = a0;
| /* str.t:f:s:a:d:i:l:v:c:b:h */
0x00400cd8 addiu s3, s3, 0x1c7c | s3 += 0x1c7c;
0x00400cdc move s2, a1 | s2 = a1;
| /* esilref: 'help' */
0x00400ce0 addiu s4, s4, 0x2340 | s4 += 0x2340;
0x00400ce4 lui s0, 0x41 | s0 = 0x410000;
| /* str._c_require_argument_n */
0x00400ce8 addiu s5, s5, 0x1c94 | s5 += 0x1c94;
| do {
| label_0:
0x00400cec sw zero, 0x10(sp) | *(var_10h) = 0;
| label_1:
0x00400cf0 move a0, s1 | a0 = s1;
0x00400cf4 move a1, s2 | a1 = s2;
0x00400cf8 move a2, s3 | a2 = s3;
0x00400cfc move a3, s4 | a3 = s4;
0x00400d00 jal 0x4020d0 | fcn_004020d0 ();
0x00400d04 addiu t8, zero, -1 | t8 = -1;
0x00400d08 addiu t8, zero, 0x66 | t8 = 0x66;
| if (v0 == t8) {
0x00400d0c beq v0, t8, 0x400ef8 | goto label_5;
| }
0x00400d10 slti t8, v0, 0x67 | t8 = (v0 < 0x67) ? 1 : 0;
| if (v0 == t8) {
0x00400d14 beq v0, t8, 0x400e24 | goto label_6;
| }
0x00400d18 addiu t8, zero, 0x6c | t8 = 0x6c;
| if (t8 == 0) {
0x00400d1c beqz t8, 0x400d98 | goto label_7;
| }
0x00400d20 addiu t8, zero, 0x61 | t8 = 0x61;
0x00400d24 slti t8, v0, 0x62 | t8 = (v0 < 0x62) ? 1 : 0;
| if (v0 == t8) {
0x00400d28 beq v0, t8, 0x400e40 | goto label_8;
| }
0x00400d2c addiu v1, zero, 0x3a | v1 = 0x3a;
| if (t8 != 0) {
0x00400d30 beqz t8, 0x400d64 |
0x00400d34 lui t8, 0x41 | t8 = 0x410000;
| if (v0 == v1) {
0x00400d38 beq v0, v1, 0x400ed4 | goto label_9;
| }
0x00400d3c addiu v1, zero, 0x3f | v1 = 0x3f;
0x00400d40 lui v0, 0x41 | v0 = 0x410000;
| if (v0 != v1) {
0x00400d44 bne v0, v1, 0x400ee8 | goto label_10;
| }
0x00400d48 lui a1, 0x40 | a1 = 0x400000;
0x00400d4c lw a0, 0x245c(v0) | a0 = *((v0 + 2327));
| /* str._c_invalid_argument_n */
0x00400d50 addiu a1, a1, 0x1cac | a1 += 0x1cac;
0x00400d54 lw a2, 0x2460(t8) | a2 = *((t8 + 2328));
0x00400d58 jal 0x402190 | fcn_00402190 ();
0x00400d5c j 0x400ee0 | goto label_11;
0x00400d60 nop |
| }
0x00400d64 addiu t8, zero, 0x63 | t8 = 0x63;
0x00400d68 slti t8, v0, 0x63 | t8 = (v0 < 0x63) ? 1 : 0;
| if (v0 == t8) {
0x00400d6c beq v0, t8, 0x400e9c | goto label_12;
| }
0x00400d70 addiu t8, zero, 0x64 | t8 = 0x64;
| if (t8 != 0) {
0x00400d74 bnez t8, 0x400eb8 | goto label_13;
| }
0x00400d78 lw a0, 0x2454(s0) | a0 = *((s0 + 2325));
| if (v0 != t8) {
0x00400d7c bne v0, t8, 0x400ee8 | goto label_10;
| }
0x00400d80 move a1, zero | a1 = 0;
0x00400d84 addiu a2, zero, 0xa | a2 = 0xa;
0x00400d88 jal 0x402140 | fcn_00402140 ();
0x00400d8c lui t8, 0x41 | t8 = 0x410000;
0x00400d90 j 0x400cec |
| } while (1);
0x00400d94 sw v0, 0x248c(t8) | *((t8 + 9356)) = v0;
| label_7:
0x00400d98 slti t8, v0, 0x6d | t8 = (v0 < 0x6d) ? 1 : 0;
| if (v0 != t8) {
0x00400d9c beq v0, t8, 0x400e5c |
0x00400da0 addiu t8, zero, 0x74 | t8 = 0x74;
| if (t8 != 0) {
0x00400da4 beqz t8, 0x400dd4 |
0x00400da8 addiu t8, zero, 0x68 | t8 = 0x68;
0x00400dac addiu t8, zero, 0x69 | t8 = 0x69;
| if (v0 == t8) {
0x00400db0 beq v0, t8, 0x400ee8 | goto label_10;
| }
0x00400db4 lw a0, 0x2454(s0) | a0 = *((s0 + 2325));
| if (v0 != t8) {
0x00400db8 bne v0, t8, 0x400ee8 | goto label_10;
| }
0x00400dbc move a1, zero | a1 = 0;
0x00400dc0 addiu a2, zero, 0x10 | a2 = 0x10;
0x00400dc4 jal 0x402100 | fcn_00402100 ();
0x00400dc8 lui t8, 0x41 | t8 = 0x410000;
0x00400dcc j 0x400cec | goto label_0;
0x00400dd0 sw v0, 0x2494(t8) | *((t8 + 9364)) = v0;
| }
0x00400dd4 addiu t8, zero, 0x76 | t8 = 0x76;
| if (v0 != t8) {
0x00400dd8 beq v0, t8, 0x400e08 |
0x00400ddc addiu t8, zero, 0x73 | t8 = 0x73;
| if (v0 == t8) {
0x00400de0 beq v0, t8, 0x400e78 | goto label_14;
| }
0x00400de4 lui t8, 0x41 | t8 = 0x410000;
| if (v0 != t8) {
0x00400de8 bne v0, t8, 0x400eec | goto label_15;
| }
0x00400dec lw a0, 0x2454(s0) | a0 = *((s0 + 2325));
0x00400df0 move a1, zero | a1 = 0;
0x00400df4 addiu a2, zero, 0x10 | a2 = 0x10;
0x00400df8 jal 0x402140 | fcn_00402140 ();
0x00400dfc lui t8, 0x41 | t8 = 0x410000;
0x00400e00 j 0x400cec | goto label_0;
0x00400e04 sw v0, 0x2484(t8) | *((t8 + 9348)) = v0;
| }
0x00400e08 lw a0, 0x2454(s0) | a0 = *((s0 + 2325));
0x00400e0c move a1, zero | a1 = 0;
0x00400e10 addiu a2, zero, 0xa | a2 = 0xa;
0x00400e14 jal 0x402100 | fcn_00402100 ();
0x00400e18 lui t8, 0x41 | t8 = 0x410000;
0x00400e1c j 0x400cec | goto label_0;
0x00400e20 sw v0, 0x2490(t8) | *((t8 + 9360)) = v0;
| label_6:
0x00400e24 lw a0, 0x2454(s0) | a0 = *((s0 + 2325));
0x00400e28 move a1, zero | a1 = 0;
0x00400e2c addiu a2, zero, 0xa | a2 = 0xa;
0x00400e30 jal 0x402100 | fcn_00402100 ();
0x00400e34 lui t8, 0x41 | t8 = 0x410000;
0x00400e38 j 0x400cec | goto label_0;
0x00400e3c sw v0, 0x2498(t8) | *((t8 + 9368)) = v0;
| label_8:
0x00400e40 lw a0, 0x2454(s0) | a0 = *((s0 + 2325));
0x00400e44 move a1, zero | a1 = 0;
0x00400e48 addiu a2, zero, 0xa | a2 = 0xa;
0x00400e4c jal 0x402100 | fcn_00402100 ();
0x00400e50 lui t8, 0x41 | t8 = 0x410000;
0x00400e54 j 0x400cec | goto label_0;
0x00400e58 sw v0, 0x2410(t8) | *((t8 + 9232)) = v0;
| }
0x00400e5c lw a0, 0x2454(s0) | a0 = *((s0 + 2325));
0x00400e60 move a1, zero | a1 = 0;
0x00400e64 addiu a2, zero, 0xa | a2 = 0xa;
0x00400e68 jal 0x402140 | fcn_00402140 ();
0x00400e6c lui t8, 0x41 | t8 = 0x410000;
0x00400e70 j 0x400cec | goto label_0;
0x00400e74 sw v0, 0x2414(t8) | *((t8 + 9236)) = v0;
| label_14:
0x00400e78 lw a0, 0x2454(s0) | a0 = *((s0 + 2325));
0x00400e7c lui v0, 0x41 | v0 = 0x410000;
0x00400e80 move a1, zero | a1 = 0;
0x00400e84 addiu a2, zero, 0x10 | a2 = 0x10;
0x00400e88 sw a0, 0x2480(v0) | *((v0 + 2336)) = a0;
0x00400e8c jal 0x402100 | fcn_00402100 ();
0x00400e90 lui t8, 0x41 | t8 = 0x410000;
0x00400e94 j 0x400cec | goto label_0;
0x00400e98 sw v0, 0x249c(t8) | *((t8 + 9372)) = v0;
| label_12:
0x00400e9c lw a0, 0x2454(s0) | a0 = *((s0 + 2325));
0x00400ea0 move a1, zero | a1 = 0;
0x00400ea4 addiu a2, zero, 0xa | a2 = 0xa;
0x00400ea8 jal 0x402100 | fcn_00402100 ();
0x00400eac lui t8, 0x41 | t8 = 0x410000;
0x00400eb0 j 0x400cec | goto label_0;
0x00400eb4 sw v0, 0x2418(t8) | *((t8 + 9240)) = v0;
| label_13:
0x00400eb8 lw a0, 0x2454(s0) | a0 = *((s0 + 2325));
0x00400ebc move a1, zero | a1 = 0;
0x00400ec0 addiu a2, zero, 0x10 | a2 = 0x10;
0x00400ec4 jal 0x402140 | fcn_00402140 ();
0x00400ec8 lui t8, 0x41 | t8 = 0x410000;
0x00400ecc j 0x400cec | goto label_0;
0x00400ed0 sw v0, 0x2488(t8) | *((t8 + 9352)) = v0;
| label_9:
0x00400ed4 lw a1, 0x2460(t8) | a1 = *((t8 + 2328));
0x00400ed8 move a0, s5 | a0 = s5;
0x00400edc jal 0x4020c0 | fcn_004020c0 ();
| label_11:
0x00400ee0 j 0x400cf0 | goto label_1;
0x00400ee4 sw zero, 0x10(sp) | *(var_10h) = 0;
| label_10:
0x00400ee8 lui t8, 0x41 | t8 = 0x410000;
| label_15:
0x00400eec addiu a1, zero, 1 | a1 = 1;
0x00400ef0 lw a0, 0x2450(t8) | a0 = *((t8 + 2324));
0x00400ef4 jal 0x4017b0 | sym_printf_usage ()
| label_5:
0x00400ef8 lui t8, 0x41 | t8 = 0x410000;
0x00400efc lw s0, 0x2490(t8) | s0 = *((t8 + 2340));
0x00400f00 addiu t8, zero, 2 | t8 = 2;
0x00400f04 addiu t8, zero, 3 | t8 = 3;
| if (s0 == t8) {
0x00400f08 beq s0, t8, 0x401284 | goto label_16;
| }
0x00400f0c addiu t8, zero, 1 | t8 = 1;
| if (s0 == t8) {
0x00400f10 beq s0, t8, 0x401560 | goto label_17;
| }
0x00400f14 lw ra, 0x54(sp) | ra = *(var_54h);
| if (s0 != t8) {
0x00400f18 bne s0, t8, 0x4015a4 | goto label_18;
| }
0x00400f1c lui s3, 0x41 | s3 = 0x410000;
0x00400f20 lui s4, 0x41 | s4 = 0x410000;
0x00400f24 lui s5, 0x41 | s5 = 0x410000;
0x00400f28 lui a0, 0x40 | a0 = 0x400000;
0x00400f2c lw a1, 0x2494(s3) | a1 = *((s3 + 2341));
0x00400f30 lui t8, 0x41 | t8 = 0x410000;
0x00400f34 lw a2, 0x249c(s4) | a2 = *((s4 + 2343));
| /* str.reg__0x_x__value__0x_x__bit_mask__0x_x_n */
0x00400f38 addiu a0, a0, 0x1cc4 | a0 += 0x1cc4;
0x00400f3c lw a3, 0x2488(s5) | a3 = *((s5 + 2338));
0x00400f40 lui s2, 0x41 | s2 = 0x410000;
0x00400f44 lw s6, 0x2498(t8) | s6 = *((t8 + 2342));
0x00400f48 jal 0x4020c0 | fcn_004020c0 ();
0x00400f4c lw t8, 0x2418(s2) | t8 = *((s2 + 2310));
0x00400f50 slti v0, t8, 0x101 | v0 = (t8 < 0x101) ? 1 : 0;
0x00400f54 addiu a1, zero, -0x16 | a1 = -0x16;
| if (v0 == 0) {
0x00400f58 beqz v0, 0x401278 | goto label_19;
| }
0x00400f5c lw a1, 0x2418(s2) | a1 = *((s2 + 2310));
| if (t8 == 0) {
0x00400f60 bnez t8, 0x400f6c |
0x00400f64 sw s0, 0x2418(s2) | *((s2 + 2310)) = s0;
0x00400f68 lw a1, 0x2418(s2) | a1 = *((s2 + 2310));
| }
0x00400f6c addiu a0, zero, 1 | a0 = 1;
0x00400f70 jal 0x402160 | fcn_00402160 ();
0x00400f74 move s1, v0 | s1 = v0;
| if (v0 == 0) {
0x00400f78 beqz v0, 0x401274 | goto label_20;
| }
0x00400f7c addiu t8, zero, 6 | t8 = 6;
0x00400f80 lui t8, 0x41 | t8 = 0x410000;
0x00400f84 beq s6, t8, 0x400f98 |
| while (v0 == 0) {
| label_2:
0x00400f88 lui s7, 0x40 | s7 = 0x400000;
0x00400f8c move s0, zero | s0 = 0;
0x00400f90 j 0x400ff4 | goto label_21;
| /* str._bulk__d___0x_x_ */
0x00400f94 addiu s7, s7, 0x1cf0 | s7 += 0x1cf0;
0x00400f98 lw v0, 0x2480(t8) | v0 = *((t8 + 2336));
0x00400f9c move s7, t8 | s7 = t8;
0x00400fa0 beqz v0, 0x400f88 |
| }
0x00400fa4 move s0, zero | s0 = 0;
| label_3:
0x00400fa8 lw t8, 0x2418(s2) | t8 = *((s2 + 2310));
0x00400fac slt t8, s0, t8 | t8 = (s0 < t8) ? 1 : 0;
0x00400fb0 lw v0, 0x2480(s7) | v0 = *((s7 + 2336));
| if (t8 == 0) {
0x00400fb4 beqz t8, 0x400f88 | goto label_2;
| }
0x00400fb8 sll t8, s0, 1 | t8 = s0 << 1;
0x00400fbc addiu a0, sp, 0x28 | a0 = sp + 0x28;
0x00400fc0 move a1, zero | a1 = 0;
0x00400fc4 addu t8, v0, t8 | t8 = v0 + t8;
0x00400fc8 addiu a2, zero, 0x10 | a2 = 0x10;
0x00400fcc lb v0, (t8) | v0 = *(t8);
0x00400fd0 sb v0, 0x28(sp) | *(var_28h) = v0;
0x00400fd4 lb t8, 1(t8) | t8 = *((t8 + 1));
0x00400fd8 sb zero, 0x2a(sp) | *(var_2ah) = 0;
0x00400fdc sb t8, 0x29(sp) | *(var_29h) = t8;
0x00400fe0 jal 0x402100 | fcn_00402100 ();
0x00400fe4 addu t8, s1, s0 | t8 = s1 + s0;
0x00400fe8 sb v0, (t8) | *(t8) = v0;
0x00400fec j 0x400fa8 | goto label_3;
0x00400ff0 addiu s0, s0, 1 | s0++;
| label_21:
0x00400ff4 lw t8, 0x2418(s2) | t8 = *((s2 + 2310));
| do {
0x00400ff8 slt t8, s0, t8 | t8 = (s0 < t8) ? 1 : 0;
0x00400ffc addu t8, s1, s0 | t8 = s1 + s0;
| if (t8 == 0) {
0x00401000 beqz t8, 0x401020 | goto label_22;
| }
0x00401004 move a1, s0 | a1 = s0;
0x00401008 lbu a2, (t8) | a2 = *(t8);
0x0040100c move a0, s7 | a0 = s7;
0x00401010 addiu s0, s0, 1 | s0++;
0x00401014 jal 0x4020c0 | fcn_004020c0 ();
0x00401018 j 0x400ff8 |
| } while (1);
0x0040101c lw t8, 0x2418(s2) | t8 = *((s2 + 2310));
| label_22:
0x00401020 addiu a0, zero, 0xa | a0 = 0xa;
0x00401024 jal 0x4020a0 | fcn_004020a0 ();
0x00401028 sltiu t8, s6, 9 | t8 = (s6 < 9) ? 1 : 0;
0x0040102c lui t8, 0x40 | t8 = 0x400000;
| if (t8 != 0) {
0x00401030 beqz t8, 0x4011fc |
0x00401034 sll s6, s6, 2 | s6 <<= 2;
0x00401038 addiu t8, t8, 0x2030 | t8 += 0x2030;
0x0040103c lui v0, 0x41 | v0 = 0x410000;
0x00401040 addu s6, t8, s6 | s6 = t8 + s6;
0x00401044 lui v1, 0x41 | v1 = 0x410000;
0x00401048 lw a0, (s6) | a0 = *(s6);
0x0040104c lui t8, 0x41 | t8 = 0x410000;
0x00401050 jr a0 | a0 ();
| }
0x004011fc move s0, zero | s0 = 0;
0x00401200 lw a1, 0x2494(s3) | a1 = *((s3 + 2341));
0x00401204 lui a0, 0x40 | a0 = 0x400000;
0x00401208 lw a2, 0x249c(s4) | a2 = *((s4 + 2343));
0x0040120c lui s4, 0x40 | s4 = 0x400000;
0x00401210 lw a3, 0x2488(s5) | a3 = *((s5 + 2338));
| /* str.reg__0x_x__value__0x_x__bit_mask0x_x_ret___d_n */
0x00401214 addiu a0, a0, 0x1d04 | a0 += 0x1d04;
0x00401218 sw s0, 0x10(sp) | *(var_10h) = s0;
0x0040121c move s3, zero | s3 = 0;
| /* str._bulk__d___0x_x_ */
0x00401220 addiu s4, s4, 0x1cf0 | s4 += 0x1cf0;
0x00401224 jal 0x4020c0 | fcn_004020c0 ();
0x00401228 lw t8, 0x2418(s2) | t8 = *((s2 + 2310));
| do {
0x0040122c slt t8, s3, t8 | t8 = (s3 < t8) ? 1 : 0;
0x00401230 addu t8, s1, s3 | t8 = s1 + s3;
| if (t8 == 0) {
0x00401234 beqz t8, 0x401254 | goto label_23;
| }
0x00401238 move a1, s3 | a1 = s3;
0x0040123c lbu a2, (t8) | a2 = *(t8);
0x00401240 move a0, s4 | a0 = s4;
0x00401244 addiu s3, s3, 1 | s3++;
0x00401248 jal 0x4020c0 | fcn_004020c0 ();
0x0040124c j 0x40122c |
| } while (1);
0x00401250 lw t8, 0x2418(s2) | t8 = *((s2 + 2310));
| label_23:
0x00401254 addiu a0, zero, 0xa | a0 = 0xa;
0x00401258 jal 0x4020a0 | fcn_004020a0 ();
0x0040125c move a0, s1 | a0 = s1;
0x00401260 jal 0x402270 | fcn_00402270 ();
0x00401264 move a1, s0 | a1 = s0;
| if (s0 >= 0) {
0x00401268 bgez s0, 0x4015a0 | goto label_24;
| }
0x0040126c j 0x40127c | goto label_25;
0x00401270 lui a0, 0x40 | a0 = 0x400000;
| label_20:
0x00401274 addiu a1, zero, -0xc | a1 = -0xc;
| label_19:
0x00401278 lui a0, 0x40 | a0 = 0x400000;
| label_25:
0x0040127c j 0x401580 | goto label_26;
| /* str.i2c_transfer_failed_ret___d_n */
0x00401280 addiu a0, a0, 0x1d38 | a0 += 0x1d38;
| label_16:
0x00401284 lui t8, 0x41 | t8 = 0x410000;
0x00401288 lui s0, 0x41 | s0 = 0x410000;
0x0040128c lw s2, 0x2498(t8) | s2 = *((t8 + 2342));
0x00401290 addiu v0, zero, 1 | v0 = 1;
0x00401294 lui t8, 0x41 | t8 = 0x410000;
0x00401298 sw s2, 0x28(sp) | *(var_28h) = s2;
0x0040129c lw a0, 0x248c(t8) | a0 = *((t8 + 2339));
0x004012a0 lw a1, 0x2494(s0) | a1 = *((s0 + 2341));
| if (s2 == v0) {
0x004012a4 bne s2, v0, 0x4012d8 |
0x004012a8 jal 0x4020e0 | fcn_004020e0 ();
0x004012ac nop |
0x004012b0 lui a0, 0x40 | a0 = 0x400000;
| if (v0 == s2) {
0x004012b4 bne v0, s2, 0x4012c0 |
0x004012b8 j 0x4012d0 | goto label_27;
| /* str.gpio__d_has_be_requested_n */
0x004012bc addiu a0, a0, 0x1d58 | a0 += 0x1d58;
| }
0x004012c0 move s1, v0 | s1 = v0;
| if (v0 != 0) {
0x004012c4 bnez v0, 0x401550 | goto label_28;
| }
0x004012c8 lui a0, 0x40 | a0 = "gpio-%d is not requested\n";
| /* str.gpio__d_is_not_requested_n */
0x004012cc addiu a0, a0, 0x1d74 |
| label_27:
0x004012d0 j 0x401580 | goto label_26;
0x004012d4 lw a1, 0x2494(s0) | a1 = *((s0 + 2341));
| }
0x004012d8 jal 0x402240 | fcn_00402240 ();
0x004012dc nop |
0x004012e0 move s0, v0 | s0 = v0;
| if (v0 == 0) {
0x004012e4 bnez v0, 0x4012fc |
0x004012e8 lui a0, 0x40 | a0 = "gpio failed";
| /* str.gpio_failed */
| label_4:
0x004012ec addiu a0, a0, 0x1d90 |
0x004012f0 jal 0x4020f0 | fcn_004020f0 ();
0x004012f4 j 0x4015a0 | goto label_24;
0x004012f8 nop |
| }
0x004012fc lui s3, 0x40 | s3 = 0x400000;
0x00401300 lui s2, 0x40 | s2 = 0x400000;
0x00401304 lui s5, 0x40 | s5 = 0x400000;
| /* str.please_enter_the_function_number */
0x00401308 addiu s3, s3, 0x1d9c | s3 += 0x1d9c;
| /* esilref: '&d' */
0x0040130c addiu s4, s2, 0x1e74 | s4 = s2 + 0x1e74;
0x00401310 addiu s5, s5, 0x2054 | s5 += 0x2054;
| do {
0x00401314 move a0, s3 | a0 = s3;
0x00401318 jal 0x4020f0 | fcn_004020f0 ();
0x0040131c lui a0, 0x40 | a0 = " 1 rts_io_gpio_free";
| /* str._______1_rts_io_gpio_free */
0x00401320 addiu a0, a0, 0x1dc0 |
0x00401324 jal 0x4020f0 | fcn_004020f0 ();
0x00401328 lui a0, 0x40 | a0 = " 2 rts_io_gpio_set_value";
| /* str._______2_rts_io_gpio_set_value */
0x0040132c addiu a0, a0, 0x1ddc |
0x00401330 jal 0x4020f0 | fcn_004020f0 ();
0x00401334 lui a0, 0x40 | a0 = " 3 rts_io_gpio_get_value";
| /* str._______3_rts_io_gpio_get_value */
0x00401338 addiu a0, a0, 0x1dfc |
0x0040133c jal 0x4020f0 | fcn_004020f0 ();
0x00401340 lui a0, 0x40 | a0 = " 4 rts_io_gpio_set_direction";
| /* str._______4_rts_io_gpio_set_direction */
0x00401344 addiu a0, a0, 0x1e1c |
0x00401348 jal 0x4020f0 | fcn_004020f0 ();
0x0040134c lui a0, 0x40 | a0 = " 5 rts_io_gpio_get_direction";
| /* str._______5_rts_io_gpio_get_direction */
0x00401350 addiu a0, a0, 0x1e40 |
0x00401354 jal 0x4020f0 | fcn_004020f0 ();
0x00401358 lui a0, 0x40 | a0 = " 6 exit";
| /* str._______6_exit */
0x0040135c addiu a0, a0, 0x1e64 |
0x00401360 jal 0x4020f0 | fcn_004020f0 ();
| /* esilref: '&d' */
0x00401364 addiu a0, s2, 0x1e74 | a0 = s2 + 0x1e74;
0x00401368 addiu a1, sp, 0x28 | a1 = sp + 0x28;
0x0040136c jal 0x402220 | fcn_00402220 ();
0x00401370 addiu t8, zero, 1 | t8 = 1;
0x00401374 move s1, v0 | s1 = v0;
| if (v0 != t8) {
0x00401378 beq v0, t8, 0x40138c |
0x0040137c lui a0, 0x40 | a0 = 0x400000;
0x00401380 move a1, v0 | a1 = v0;
| /* str.scanf_erro__d_n */
0x00401384 addiu a0, a0, 0x1e78 | a0 += 0x1e78;
0x00401388 jal 0x4020c0 | fcn_004020c0 ();
| }
0x0040138c lui s6, 0x41 | s6 = 0x410000;
0x00401390 lw a0, 0x2458(s6) | a0 = *((s6 + 2326));
0x00401394 lw t8, 0x48(a0) | t8 = *((a0 + 18));
| if (t8 != 0) {
0x00401398 beqz t8, 0x4013cc |
0x0040139c nop |
0x004013a0 lw t8, 0x10(a0) | t8 = *((a0 + 4));
0x004013a4 lw v0, 0x18(a0) | v0 = *((a0 + 6));
0x004013a8 sltu v0, t8, v0 | v0 = (t8 < v0) ? 1 : 0;
0x004013ac addiu t8, t8, 1 | t8++;
| if (v0 != 0) {
0x004013b0 beqz v0, 0x4013bc |
0x004013b4 j 0x4013d4 | goto label_29;
0x004013b8 sw t8, 0x10(a0) | *((a0 + 4)) = t8;
| }
0x004013bc jal 0x402120 | fcn_00402120 ();
0x004013c0 nop |
0x004013c4 j 0x4013d4 | goto label_29;
0x004013c8 nop |
| }
0x004013cc jal 0x402210 | fcn_00402210 ();
0x004013d0 nop |
| label_29:
0x004013d4 lw t8, 0x28(sp) | t8 = *(var_28h);
0x004013d8 addiu v0, zero, 2 | v0 = 2;
0x004013dc addiu v0, zero, 4 | v0 = 4;
| if (t8 != v0) {
0x004013e0 beq t8, v0, 0x4013ec |
0x004013e4 addiu t8, t8, -1 | t8 += -1;
| if (t8 != v0) {
0x004013e8 bne t8, v0, 0x401470 | goto label_30;
| }
| }
0x004013ec lui a0, 0x40 | a0 = "please enter the value :";
| /* str.please_enter_the_value_: */
0x004013f0 addiu a0, a0, 0x1e88 |
0x004013f4 jal 0x4020f0 | fcn_004020f0 ();
0x004013f8 lui a1, 0x41 | a1 = 0x410000;
0x004013fc move a0, s4 | a0 = s4;
0x00401400 addiu a1, a1, 0x249c | a1 += 0x249c;
0x00401404 jal 0x402220 | fcn_00402220 ();
0x00401408 addiu t8, zero, 1 | t8 = 1;
0x0040140c move s1, v0 | s1 = v0;
| if (v0 != t8) {
0x00401410 beq v0, t8, 0x401424 |
0x00401414 lui a0, 0x40 | a0 = 0x400000;
0x00401418 move a1, v0 | a1 = v0;
| /* str.scanf_erro__d_n */
0x0040141c addiu a0, a0, 0x1e78 | a0 += 0x1e78;
0x00401420 jal 0x4020c0 | fcn_004020c0 ();
| }
0x00401424 lw a0, 0x2458(s6) | a0 = *((s6 + 2326));
0x00401428 lw t8, 0x48(a0) | t8 = *((a0 + 18));
| if (t8 != 0) {
0x0040142c beqz t8, 0x401460 |
0x00401430 nop |
0x00401434 lw t8, 0x10(a0) | t8 = *((a0 + 4));
0x00401438 lw v0, 0x18(a0) | v0 = *((a0 + 6));
0x0040143c sltu v0, t8, v0 | v0 = (t8 < v0) ? 1 : 0;
0x00401440 addiu t8, t8, 1 | t8++;
| if (v0 != 0) {
0x00401444 beqz v0, 0x401450 |
0x00401448 j 0x401468 | goto label_31;
0x0040144c sw t8, 0x10(a0) | *((a0 + 4)) = t8;
| }
0x00401450 jal 0x402120 | fcn_00402120 ();
0x00401454 nop |
0x00401458 j 0x401468 | goto label_31;
0x0040145c nop |
| }
0x00401460 jal 0x402210 | fcn_00402210 ();
0x00401464 nop |
| label_31:
0x00401468 lw t8, 0x28(sp) | t8 = *(var_28h);
0x0040146c addiu t8, t8, -1 | t8 += -1;
| label_30:
0x00401470 sltiu v0, t8, 6 | v0 = (t8 < 6) ? 1 : 0;
0x00401474 sll t8, t8, 2 | t8 <<= 2;
0x00401478 beqz v0, 0x401314 |
| } while (v0 == 0);
0x0040147c addu t8, s5, t8 | t8 = s5 + t8;
0x00401480 lw t8, (t8) | t8 = *(t8);
0x00401484 move a0, s0 | a0 = s0;
0x00401488 jr t8 | t8 ();
| label_28:
0x00401550 lw ra, 0x54(sp) | ra = *(var_54h);
| if (s1 < 0) {
0x00401554 bgez s1, 0x4015a4 |
0x00401558 j 0x4012ec | goto label_4;
0x0040155c lui a0, 0x40 | a0 = 0x400000;
| label_17:
0x00401560 lui s0, 0x41 | s0 = 0x410000;
0x00401564 lw a0, 0x2494(s0) | a0 = *((s0 + 2341));
0x00401568 jal 0x402110 | fcn_00402110 ();
0x0040156c move a2, v0 | a2 = v0;
| if (v0 < 0) {
0x00401570 bgez v0, 0x401590 |
0x00401574 lui a0, 0x40 | a0 = 0x400000;
0x00401578 move a1, v0 | a1 = v0;
| /* str.rts_io_adc_get_value_failed_ret___d_n */
0x0040157c addiu a0, a0, 0x1f6c | a0 += 0x1f6c;
| label_26:
0x00401580 jal 0x4020c0 | fcn_004020c0 ();
0x00401584 nop |
0x00401588 j 0x4015a0 | goto label_24;
0x0040158c nop |
| }
0x00401590 lui a0, 0x40 | a0 = 0x400000;
0x00401594 lw a1, 0x2494(s0) | a1 = *((s0 + 2341));
| /* str.the_value_of_adc_channel_d_is__d_n */
0x00401598 addiu a0, a0, 0x1f94 | a0 += 0x1f94;
0x0040159c jal 0x4020c0 | fcn_004020c0 ();
| label_24:
0x004015a0 lw ra, 0x54(sp) | ra = *(var_54h);
| }
| label_18:
0x004015a4 move v0, zero | v0 = 0;
0x004015a8 lw s7, 0x50(sp) | s7 = *(var_50h);
0x004015ac lw s6, 0x4c(sp) | s6 = *(var_4ch);
0x004015b0 lw s5, 0x48(sp) | s5 = *(var_48h);
0x004015b4 lw s4, 0x44(sp) | s4 = *(var_44h);
0x004015b8 lw s3, 0x40(sp) | s3 = *(var_40h);
0x004015bc lw s2, 0x3c(sp) | s2 = *(var_3ch);
0x004015c0 lw s1, 0x38(sp) | s1 = *(var_38h);
0x004015c4 lw s0, 0x34(sp) | s0 = *(var_34h);
0x004015c8 addiu sp, sp, 0x58 |
0x004015cc jr ra | return v0;
| }
[*] Function printf used 2 times example_io