
int loadkmap_main(int argc,char **argv)

{
  undefined *puVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  int iVar5;
  int iVar6;
  uint16_t *puVar7;
  kbentry ke;
  uint16_t ibuff [128];
  
  iVar2 = *(int *)PTR___stack_chk_guard_00132164;
  iVar3 = (*(code *)PTR_xmalloc_00131240)(0x100);
  if (argv[1] != (char *)0x0) {
    (*(code *)PTR_bb_show_usage_001311e8)();
  }
  uVar4 = (*(code *)PTR_get_console_fd_or_die_00131b20)();
  (*(code *)PTR_xread_0013181c)(0,iVar3,7);
  iVar5 = (*(code *)PTR_is_prefixed_with_001311fc)
                    (iVar3,PTR_bdcommands_4__name_4__001311a4 + 0x2650);
  if (iVar5 == 0) {
    (*(code *)PTR_bb_error_msg_and_die_001311f0)(PTR_bdcommands_4__name_4__001311a4 + 0x2658);
  }
  (*(code *)PTR_xread_0013181c)(0,iVar3,0x100);
  puVar1 = PTR_xread_0013181c;
  iVar5 = 0;
  do {
    if (*(char *)(iVar3 + iVar5) == '\x01') {
      (*(code *)puVar1)(0,ibuff,0x100);
      iVar6 = 0;
      puVar7 = ibuff;
      do {
        ke.kb_index = (uchar)iVar6;
        ke.kb_table = (uchar)iVar5;
        ke.kb_value = *puVar7;
        (*(code *)PTR_ioctl_00132074)(uVar4,0x4b47,&ke);
        iVar6 = iVar6 + 1;
        puVar7 = puVar7 + 1;
      } while (iVar6 != 0x80);
    }
    iVar5 = iVar5 + 1;
    iVar6 = 0;
  } while (iVar5 != 0x100);
  if (iVar2 != *(int *)PTR___stack_chk_guard_00132164) {
    iVar6 = (*(code *)PTR___stack_chk_fail_001320e4)();
  }
  return iVar6;
}



undefined4 FUN_000b6430(undefined4 param_1,int param_2)

{
  undefined *puVar1;
  int iVar2;
  undefined4 uVar3;
  int iVar4;
  undefined4 uVar5;
  int iVar6;
  undefined2 *puVar7;
  undefined1 local_130;
  undefined1 local_12f;
  undefined2 local_12e;
  undefined2 local_12c [128];
  int local_2c;
  
  local_2c = *(int *)PTR___stack_chk_guard_00132164;
  iVar2 = (*(code *)PTR_FUN_00131240)(0x100);
  if (*(int *)(param_2 + 4) != 0) {
    (*(code *)PTR_FUN_001311e8)();
  }
  uVar3 = (*(code *)PTR_FUN_00131b20)();
  (*(code *)PTR_FUN_0013181c)(0,iVar2,7);
  iVar4 = (*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650);
  if (iVar4 == 0) {
    (*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);
  }
  (*(code *)PTR_FUN_0013181c)(0,iVar2,0x100);
  puVar1 = PTR_FUN_0013181c;
  iVar4 = 0;
  do {
    if (*(char *)(iVar2 + iVar4) == '\x01') {
      (*(code *)puVar1)(0,local_12c,0x100);
      iVar6 = 0;
      puVar7 = local_12c;
      do {
        local_12f = (undefined1)iVar6;
        local_130 = (undefined1)iVar4;
        local_12e = *puVar7;
        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);
        iVar6 = iVar6 + 1;
        puVar7 = puVar7 + 1;
      } while (iVar6 != 0x80);
    }
    iVar4 = iVar4 + 1;
    uVar5 = 0;
  } while (iVar4 != 0x100);
  if (local_2c != *(int *)PTR___stack_chk_guard_00132164) {
    uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();
  }
  return uVar5;
}


lui gp,0x8
addiu gp,gp,0x2d20
addu gp,gp,t9
addiu sp,sp,-0x150
sw ra,0x14c(sp)
sw s8,0x148(sp)
sw s7,0x144(sp)
sw s6,0x140(sp)
sw s5,0x13c(sp)
sw s4,0x138(sp)
sw s3,0x134(sp)
sw s2,0x130(sp)
sw s1,0x12c(sp)
sw s0,0x128(sp)
sw gp,0x10(sp)
or s0,a1,zero
lw v0,-0x6fec(gp)
lw v0,0x0(v0)
sw v0,0x124(sp)
li a0,0x100
lw t9,-0x7f10(gp)
jalr t9
_nop
lw gp,0x10(sp)
or s1,v0,zero
lw v0,0x4(s0)
beq v0,zero,0x000b64a8
_lw t9,-0x7f68(gp)
jalr t9
_nop
lw t9,-0x7630(gp)
jalr t9
_nop
lw gp,0x10(sp)
sw v0,0x1c(sp)
li a2,0x7
or a1,s1,zero
or a0,zero,zero
lw t9,-0x7934(gp)
jalr t9
_nop
lw gp,0x10(sp)
lw a1,-0x7fac(gp)
addiu a1,a1,0x2650
or a0,s1,zero
lw t9,-0x7f54(gp)
jalr t9
_nop
lw gp,0x10(sp)
bne v0,zero,0x000b650c
_lw a0,-0x7fac(gp)
addiu a0,a0,0x2658
lw t9,-0x7f60(gp)
jalr t9
_nop
li a2,0x100
or a1,s1,zero
or a0,zero,zero
lw t9,-0x7934(gp)
jalr t9
_nop
lw gp,0x10(sp)
or s0,zero,zero
li s7,0x1
addiu s4,sp,0x24
lw s8,-0x7934(gp)
addiu s6,sp,0x20
li s5,0x80
addu v0,s1,s0
lbu v0,0x0(v0)
bne v0,s7,0x000b65a8
_li a2,0x100
or a1,s4,zero
or a0,zero,zero
or t9,s8,zero
jalr t9
_nop
lw gp,0x10(sp)
or s3,s4,zero
or s2,zero,zero
sb s2,0x21(sp)
sb s0,0x20(sp)
lhu v0,0x0(s3)
sh v0,0x22(sp)
or a2,s6,zero
li a1,0x4b47
lw a0,0x1c(sp)
lw t9,-0x70dc(gp)
jalr t9
_nop
lw gp,0x10(sp)
addiu s2,s2,0x1
bne s2,s5,0x000b6570
_addiu s3,s3,0x2
addiu s0,s0,0x1
li v0,0x100
bne s0,v0,0x000b6540
_or v0,zero,zero
lw a0,0x124(sp)
lw v1,-0x6fec(gp)
lw v1,0x0(v1)
beq a0,v1,0x000b65d4
_lw t9,-0x706c(gp)
jalr t9
_nop
lw ra,0x14c(sp)
lw s8,0x148(sp)
lw s7,0x144(sp)
lw s6,0x140(sp)
lw s5,0x13c(sp)
lw s4,0x138(sp)
lw s3,0x134(sp)
lw s2,0x130(sp)
lw s1,0x12c(sp)
lw s0,0x128(sp)
jr ra
_addiu sp,sp,0x150
(translation_unit "undefined4 FUN_000b6430(undefined4 param_1,int param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  undefined4 uVar3;\n  int iVar4;\n  undefined4 uVar5;\n  int iVar6;\n  undefined2 *puVar7;\n  undefined1 local_130;\n  undefined1 local_12f;\n  undefined2 local_12e;\n  undefined2 local_12c [128];\n  int local_2c;\n  \n  local_2c = *(int *)PTR___stack_chk_guard_00132164;\n  iVar2 = (*(code *)PTR_FUN_00131240)(0x100);\n  if (*(int *)(param_2 + 4) != 0) {\n    (*(code *)PTR_FUN_001311e8)();\n  }\n  uVar3 = (*(code *)PTR_FUN_00131b20)();\n  (*(code *)PTR_FUN_0013181c)(0,iVar2,7);\n  iVar4 = (*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650);\n  if (iVar4 == 0) {\n    (*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);\n  }\n  (*(code *)PTR_FUN_0013181c)(0,iVar2,0x100);\n  puVar1 = PTR_FUN_0013181c;\n  iVar4 = 0;\n  do {\n    if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar4 = iVar4 + 1;\n    uVar5 = 0;\n  } while (iVar4 != 0x100);\n  if (local_2c != *(int *)PTR___stack_chk_guard_00132164) {\n    uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }\n  return uVar5;\n}\n\n" (function_definition "undefined4 FUN_000b6430(undefined4 param_1,int param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  undefined4 uVar3;\n  int iVar4;\n  undefined4 uVar5;\n  int iVar6;\n  undefined2 *puVar7;\n  undefined1 local_130;\n  undefined1 local_12f;\n  undefined2 local_12e;\n  undefined2 local_12c [128];\n  int local_2c;\n  \n  local_2c = *(int *)PTR___stack_chk_guard_00132164;\n  iVar2 = (*(code *)PTR_FUN_00131240)(0x100);\n  if (*(int *)(param_2 + 4) != 0) {\n    (*(code *)PTR_FUN_001311e8)();\n  }\n  uVar3 = (*(code *)PTR_FUN_00131b20)();\n  (*(code *)PTR_FUN_0013181c)(0,iVar2,7);\n  iVar4 = (*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650);\n  if (iVar4 == 0) {\n    (*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);\n  }\n  (*(code *)PTR_FUN_0013181c)(0,iVar2,0x100);\n  puVar1 = PTR_FUN_0013181c;\n  iVar4 = 0;\n  do {\n    if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar4 = iVar4 + 1;\n    uVar5 = 0;\n  } while (iVar4 != 0x100);\n  if (local_2c != *(int *)PTR___stack_chk_guard_00132164) {\n    uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }\n  return uVar5;\n}" type_identifier (function_declarator "FUN_000b6430(undefined4 param_1,int param_2)" identifier (parameter_list "(undefined4 param_1,int param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  undefined4 uVar3;\n  int iVar4;\n  undefined4 uVar5;\n  int iVar6;\n  undefined2 *puVar7;\n  undefined1 local_130;\n  undefined1 local_12f;\n  undefined2 local_12e;\n  undefined2 local_12c [128];\n  int local_2c;\n  \n  local_2c = *(int *)PTR___stack_chk_guard_00132164;\n  iVar2 = (*(code *)PTR_FUN_00131240)(0x100);\n  if (*(int *)(param_2 + 4) != 0) {\n    (*(code *)PTR_FUN_001311e8)();\n  }\n  uVar3 = (*(code *)PTR_FUN_00131b20)();\n  (*(code *)PTR_FUN_0013181c)(0,iVar2,7);\n  iVar4 = (*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650);\n  if (iVar4 == 0) {\n    (*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);\n  }\n  (*(code *)PTR_FUN_0013181c)(0,iVar2,0x100);\n  puVar1 = PTR_FUN_0013181c;\n  iVar4 = 0;\n  do {\n    if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar4 = iVar4 + 1;\n    uVar5 = 0;\n  } while (iVar4 != 0x100);\n  if (local_2c != *(int *)PTR___stack_chk_guard_00132164) {\n    uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }\n  return uVar5;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "undefined2 *puVar7;" type_identifier (pointer_declarator "*puVar7" * identifier) ;) (declaration "undefined1 local_130;" type_identifier identifier ;) (declaration "undefined1 local_12f;" type_identifier identifier ;) (declaration "undefined2 local_12e;" type_identifier identifier ;) (declaration "undefined2 local_12c [128];" type_identifier (array_declarator "local_12c [128]" identifier [ number_literal ]) ;) (declaration "int local_2c;" primitive_type identifier ;) (expression_statement "local_2c = *(int *)PTR___stack_chk_guard_00132164;" (assignment_expression "local_2c = *(int *)PTR___stack_chk_guard_00132164" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_00132164" * (cast_expression "(int *)PTR___stack_chk_guard_00132164" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar2 = (*(code *)PTR_FUN_00131240)(0x100);" (assignment_expression "iVar2 = (*(code *)PTR_FUN_00131240)(0x100)" identifier = (call_expression "(*(code *)PTR_FUN_00131240)(0x100)" (parenthesized_expression "(*(code *)PTR_FUN_00131240)" ( (pointer_expression "*(code *)PTR_FUN_00131240" * (cast_expression "(code *)PTR_FUN_00131240" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0x100)" ( number_literal )))) ;) (if_statement "if (*(int *)(param_2 + 4) != 0) {\n    (*(code *)PTR_FUN_001311e8)();\n  }" if (parenthesized_expression "(*(int *)(param_2 + 4) != 0)" ( (binary_expression "*(int *)(param_2 + 4) != 0" (pointer_expression "*(int *)(param_2 + 4)" * (cast_expression "(int *)(param_2 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + 4)" ( (binary_expression "param_2 + 4" identifier + number_literal) )))) != number_literal) )) (compound_statement "{\n    (*(code *)PTR_FUN_001311e8)();\n  }" { (expression_statement "(*(code *)PTR_FUN_001311e8)();" (call_expression "(*(code *)PTR_FUN_001311e8)()" (parenthesized_expression "(*(code *)PTR_FUN_001311e8)" ( (pointer_expression "*(code *)PTR_FUN_001311e8" * (cast_expression "(code *)PTR_FUN_001311e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) })) (expression_statement "uVar3 = (*(code *)PTR_FUN_00131b20)();" (assignment_expression "uVar3 = (*(code *)PTR_FUN_00131b20)()" identifier = (call_expression "(*(code *)PTR_FUN_00131b20)()" (parenthesized_expression "(*(code *)PTR_FUN_00131b20)" ( (pointer_expression "*(code *)PTR_FUN_00131b20" * (cast_expression "(code *)PTR_FUN_00131b20" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (expression_statement "(*(code *)PTR_FUN_0013181c)(0,iVar2,7);" (call_expression "(*(code *)PTR_FUN_0013181c)(0,iVar2,7)" (parenthesized_expression "(*(code *)PTR_FUN_0013181c)" ( (pointer_expression "*(code *)PTR_FUN_0013181c" * (cast_expression "(code *)PTR_FUN_0013181c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0,iVar2,7)" ( number_literal , identifier , number_literal ))) ;) (expression_statement "iVar4 = (*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650);" (assignment_expression "iVar4 = (*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650)" identifier = (call_expression "(*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650)" (parenthesized_expression "(*(code *)PTR_FUN_001311fc)" ( (pointer_expression "*(code *)PTR_FUN_001311fc" * (cast_expression "(code *)PTR_FUN_001311fc" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2,PTR_FUN_001311a4 + 0x2650)" ( identifier , (binary_expression "PTR_FUN_001311a4 + 0x2650" identifier + number_literal) )))) ;) (if_statement "if (iVar4 == 0) {\n    (*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);\n  }" if (parenthesized_expression "(iVar4 == 0)" ( (binary_expression "iVar4 == 0" identifier == number_literal) )) (compound_statement "{\n    (*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);\n  }" { (expression_statement "(*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);" (call_expression "(*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658)" (parenthesized_expression "(*(code *)PTR_FUN_001311f0)" ( (pointer_expression "*(code *)PTR_FUN_001311f0" * (cast_expression "(code *)PTR_FUN_001311f0" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_FUN_001311a4 + 0x2658)" ( (binary_expression "PTR_FUN_001311a4 + 0x2658" identifier + number_literal) ))) ;) })) (expression_statement "(*(code *)PTR_FUN_0013181c)(0,iVar2,0x100);" (call_expression "(*(code *)PTR_FUN_0013181c)(0,iVar2,0x100)" (parenthesized_expression "(*(code *)PTR_FUN_0013181c)" ( (pointer_expression "*(code *)PTR_FUN_0013181c" * (cast_expression "(code *)PTR_FUN_0013181c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0,iVar2,0x100)" ( number_literal , identifier , number_literal ))) ;) (expression_statement "puVar1 = PTR_FUN_0013181c;" (assignment_expression "puVar1 = PTR_FUN_0013181c" identifier = identifier) ;) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) (do_statement "do {\n    if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar4 = iVar4 + 1;\n    uVar5 = 0;\n  } while (iVar4 != 0x100);" do (compound_statement "{\n    if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar4 = iVar4 + 1;\n    uVar5 = 0;\n  }" { (if_statement "if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }" if (parenthesized_expression "(*(char *)(iVar2 + iVar4) == '\x01')" ( (binary_expression "*(char *)(iVar2 + iVar4) == '\x01'" (pointer_expression "*(char *)(iVar2 + iVar4)" * (cast_expression "(char *)(iVar2 + iVar4)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + iVar4)" ( (binary_expression "iVar2 + iVar4" identifier + identifier) )))) == (char_literal "'\x01'" ' escape_sequence ')) )) (compound_statement "{\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }" { (expression_statement "(*(code *)puVar1)(0,local_12c,0x100);" (call_expression "(*(code *)puVar1)(0,local_12c,0x100)" (parenthesized_expression "(*(code *)puVar1)" ( (pointer_expression "*(code *)puVar1" * (cast_expression "(code *)puVar1" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0,local_12c,0x100)" ( number_literal , identifier , number_literal ))) ;) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) (expression_statement "puVar7 = local_12c;" (assignment_expression "puVar7 = local_12c" identifier = identifier) ;) (do_statement "do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);" do (compound_statement "{\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      }" { (expression_statement "local_12f = (undefined1)iVar6;" (assignment_expression "local_12f = (undefined1)iVar6" identifier = (cast_expression "(undefined1)iVar6" ( (type_descriptor "undefined1" type_identifier) ) identifier)) ;) (expression_statement "local_130 = (undefined1)iVar4;" (assignment_expression "local_130 = (undefined1)iVar4" identifier = (cast_expression "(undefined1)iVar4" ( (type_descriptor "undefined1" type_identifier) ) identifier)) ;) (expression_statement "local_12e = *puVar7;" (assignment_expression "local_12e = *puVar7" identifier = (pointer_expression "*puVar7" * identifier)) ;) (expression_statement "(*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);" (call_expression "(*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130)" (parenthesized_expression "(*(code *)PTR_ioctl_00132074)" ( (pointer_expression "*(code *)PTR_ioctl_00132074" * (cast_expression "(code *)PTR_ioctl_00132074" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(uVar3,0x4b47,&local_130)" ( identifier , number_literal , (pointer_expression "&local_130" & identifier) ))) ;) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" identifier = (binary_expression "iVar6 + 1" identifier + number_literal)) ;) (expression_statement "puVar7 = puVar7 + 1;" (assignment_expression "puVar7 = puVar7 + 1" identifier = (binary_expression "puVar7 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar6 != 0x80)" ( (binary_expression "iVar6 != 0x80" identifier != number_literal) )) ;) })) (expression_statement "iVar4 = iVar4 + 1;" (assignment_expression "iVar4 = iVar4 + 1" identifier = (binary_expression "iVar4 + 1" identifier + number_literal)) ;) (expression_statement "uVar5 = 0;" (assignment_expression "uVar5 = 0" identifier = number_literal) ;) }) while (parenthesized_expression "(iVar4 != 0x100)" ( (binary_expression "iVar4 != 0x100" identifier != number_literal) )) ;) (if_statement "if (local_2c != *(int *)PTR___stack_chk_guard_00132164) {\n    uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }" if (parenthesized_expression "(local_2c != *(int *)PTR___stack_chk_guard_00132164)" ( (binary_expression "local_2c != *(int *)PTR___stack_chk_guard_00132164" identifier != (pointer_expression "*(int *)PTR___stack_chk_guard_00132164" * (cast_expression "(int *)PTR___stack_chk_guard_00132164" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }" { (expression_statement "uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();" (assignment_expression "uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)()" identifier = (call_expression "(*(code *)PTR___stack_chk_fail_001320e4)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_001320e4)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_001320e4" * (cast_expression "(code *)PTR___stack_chk_fail_001320e4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) })) (return_statement "return uVar5;" return identifier ;) })))
(translation_unit "int loadkmap_main(int argc,char **argv)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  int iVar5;\n  int iVar6;\n  uint16_t *puVar7;\n  kbentry ke;\n  uint16_t ibuff [128];\n  \n  iVar2 = *(int *)PTR___stack_chk_guard_00132164;\n  iVar3 = (*(code *)PTR_xmalloc_00131240)(0x100);\n  if (argv[1] != (char *)0x0) {\n    (*(code *)PTR_bb_show_usage_001311e8)();\n  }\n  uVar4 = (*(code *)PTR_get_console_fd_or_die_00131b20)();\n  (*(code *)PTR_xread_0013181c)(0,iVar3,7);\n  iVar5 = (*(code *)PTR_is_prefixed_with_001311fc)\n                    (iVar3,PTR_bdcommands_4__name_4__001311a4 + 0x2650);\n  if (iVar5 == 0) {\n    (*(code *)PTR_bb_error_msg_and_die_001311f0)(PTR_bdcommands_4__name_4__001311a4 + 0x2658);\n  }\n  (*(code *)PTR_xread_0013181c)(0,iVar3,0x100);\n  puVar1 = PTR_xread_0013181c;\n  iVar5 = 0;\n  do {\n    if (*(char *)(iVar3 + iVar5) == '\x01') {\n      (*(code *)puVar1)(0,ibuff,0x100);\n      iVar6 = 0;\n      puVar7 = ibuff;\n      do {\n        ke.kb_index = (uchar)iVar6;\n        ke.kb_table = (uchar)iVar5;\n        ke.kb_value = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar4,0x4b47,&ke);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar5 = iVar5 + 1;\n    iVar6 = 0;\n  } while (iVar5 != 0x100);\n  if (iVar2 != *(int *)PTR___stack_chk_guard_00132164) {\n    iVar6 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }\n  return iVar6;\n}\n\n" (function_definition "int loadkmap_main(int argc,char **argv)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  int iVar5;\n  int iVar6;\n  uint16_t *puVar7;\n  kbentry ke;\n  uint16_t ibuff [128];\n  \n  iVar2 = *(int *)PTR___stack_chk_guard_00132164;\n  iVar3 = (*(code *)PTR_xmalloc_00131240)(0x100);\n  if (argv[1] != (char *)0x0) {\n    (*(code *)PTR_bb_show_usage_001311e8)();\n  }\n  uVar4 = (*(code *)PTR_get_console_fd_or_die_00131b20)();\n  (*(code *)PTR_xread_0013181c)(0,iVar3,7);\n  iVar5 = (*(code *)PTR_is_prefixed_with_001311fc)\n                    (iVar3,PTR_bdcommands_4__name_4__001311a4 + 0x2650);\n  if (iVar5 == 0) {\n    (*(code *)PTR_bb_error_msg_and_die_001311f0)(PTR_bdcommands_4__name_4__001311a4 + 0x2658);\n  }\n  (*(code *)PTR_xread_0013181c)(0,iVar3,0x100);\n  puVar1 = PTR_xread_0013181c;\n  iVar5 = 0;\n  do {\n    if (*(char *)(iVar3 + iVar5) == '\x01') {\n      (*(code *)puVar1)(0,ibuff,0x100);\n      iVar6 = 0;\n      puVar7 = ibuff;\n      do {\n        ke.kb_index = (uchar)iVar6;\n        ke.kb_table = (uchar)iVar5;\n        ke.kb_value = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar4,0x4b47,&ke);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar5 = iVar5 + 1;\n    iVar6 = 0;\n  } while (iVar5 != 0x100);\n  if (iVar2 != *(int *)PTR___stack_chk_guard_00132164) {\n    iVar6 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }\n  return iVar6;\n}" primitive_type (function_declarator "loadkmap_main(int argc,char **argv)" identifier (parameter_list "(int argc,char **argv)" ( (parameter_declaration "int argc" primitive_type identifier) , (parameter_declaration "char **argv" primitive_type (pointer_declarator "**argv" * (pointer_declarator "*argv" * identifier))) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 uVar4;\n  int iVar5;\n  int iVar6;\n  uint16_t *puVar7;\n  kbentry ke;\n  uint16_t ibuff [128];\n  \n  iVar2 = *(int *)PTR___stack_chk_guard_00132164;\n  iVar3 = (*(code *)PTR_xmalloc_00131240)(0x100);\n  if (argv[1] != (char *)0x0) {\n    (*(code *)PTR_bb_show_usage_001311e8)();\n  }\n  uVar4 = (*(code *)PTR_get_console_fd_or_die_00131b20)();\n  (*(code *)PTR_xread_0013181c)(0,iVar3,7);\n  iVar5 = (*(code *)PTR_is_prefixed_with_001311fc)\n                    (iVar3,PTR_bdcommands_4__name_4__001311a4 + 0x2650);\n  if (iVar5 == 0) {\n    (*(code *)PTR_bb_error_msg_and_die_001311f0)(PTR_bdcommands_4__name_4__001311a4 + 0x2658);\n  }\n  (*(code *)PTR_xread_0013181c)(0,iVar3,0x100);\n  puVar1 = PTR_xread_0013181c;\n  iVar5 = 0;\n  do {\n    if (*(char *)(iVar3 + iVar5) == '\x01') {\n      (*(code *)puVar1)(0,ibuff,0x100);\n      iVar6 = 0;\n      puVar7 = ibuff;\n      do {\n        ke.kb_index = (uchar)iVar6;\n        ke.kb_table = (uchar)iVar5;\n        ke.kb_value = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar4,0x4b47,&ke);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar5 = iVar5 + 1;\n    iVar6 = 0;\n  } while (iVar5 != 0x100);\n  if (iVar2 != *(int *)PTR___stack_chk_guard_00132164) {\n    iVar6 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }\n  return iVar6;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "uint16_t *puVar7;" primitive_type (pointer_declarator "*puVar7" * identifier) ;) (declaration "kbentry ke;" type_identifier identifier ;) (declaration "uint16_t ibuff [128];" primitive_type (array_declarator "ibuff [128]" identifier [ number_literal ]) ;) (expression_statement "iVar2 = *(int *)PTR___stack_chk_guard_00132164;" (assignment_expression "iVar2 = *(int *)PTR___stack_chk_guard_00132164" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_00132164" * (cast_expression "(int *)PTR___stack_chk_guard_00132164" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar3 = (*(code *)PTR_xmalloc_00131240)(0x100);" (assignment_expression "iVar3 = (*(code *)PTR_xmalloc_00131240)(0x100)" identifier = (call_expression "(*(code *)PTR_xmalloc_00131240)(0x100)" (parenthesized_expression "(*(code *)PTR_xmalloc_00131240)" ( (pointer_expression "*(code *)PTR_xmalloc_00131240" * (cast_expression "(code *)PTR_xmalloc_00131240" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0x100)" ( number_literal )))) ;) (if_statement "if (argv[1] != (char *)0x0) {\n    (*(code *)PTR_bb_show_usage_001311e8)();\n  }" if (parenthesized_expression "(argv[1] != (char *)0x0)" ( (binary_expression "argv[1] != (char *)0x0" (subscript_expression "argv[1]" identifier [ number_literal ]) != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    (*(code *)PTR_bb_show_usage_001311e8)();\n  }" { (expression_statement "(*(code *)PTR_bb_show_usage_001311e8)();" (call_expression "(*(code *)PTR_bb_show_usage_001311e8)()" (parenthesized_expression "(*(code *)PTR_bb_show_usage_001311e8)" ( (pointer_expression "*(code *)PTR_bb_show_usage_001311e8" * (cast_expression "(code *)PTR_bb_show_usage_001311e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) })) (expression_statement "uVar4 = (*(code *)PTR_get_console_fd_or_die_00131b20)();" (assignment_expression "uVar4 = (*(code *)PTR_get_console_fd_or_die_00131b20)()" identifier = (call_expression "(*(code *)PTR_get_console_fd_or_die_00131b20)()" (parenthesized_expression "(*(code *)PTR_get_console_fd_or_die_00131b20)" ( (pointer_expression "*(code *)PTR_get_console_fd_or_die_00131b20" * (cast_expression "(code *)PTR_get_console_fd_or_die_00131b20" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (expression_statement "(*(code *)PTR_xread_0013181c)(0,iVar3,7);" (call_expression "(*(code *)PTR_xread_0013181c)(0,iVar3,7)" (parenthesized_expression "(*(code *)PTR_xread_0013181c)" ( (pointer_expression "*(code *)PTR_xread_0013181c" * (cast_expression "(code *)PTR_xread_0013181c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0,iVar3,7)" ( number_literal , identifier , number_literal ))) ;) (expression_statement "iVar5 = (*(code *)PTR_is_prefixed_with_001311fc)\n                    (iVar3,PTR_bdcommands_4__name_4__001311a4 + 0x2650);" (assignment_expression "iVar5 = (*(code *)PTR_is_prefixed_with_001311fc)\n                    (iVar3,PTR_bdcommands_4__name_4__001311a4 + 0x2650)" identifier = (call_expression "(*(code *)PTR_is_prefixed_with_001311fc)\n                    (iVar3,PTR_bdcommands_4__name_4__001311a4 + 0x2650)" (parenthesized_expression "(*(code *)PTR_is_prefixed_with_001311fc)" ( (pointer_expression "*(code *)PTR_is_prefixed_with_001311fc" * (cast_expression "(code *)PTR_is_prefixed_with_001311fc" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar3,PTR_bdcommands_4__name_4__001311a4 + 0x2650)" ( identifier , (binary_expression "PTR_bdcommands_4__name_4__001311a4 + 0x2650" identifier + number_literal) )))) ;) (if_statement "if (iVar5 == 0) {\n    (*(code *)PTR_bb_error_msg_and_die_001311f0)(PTR_bdcommands_4__name_4__001311a4 + 0x2658);\n  }" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (compound_statement "{\n    (*(code *)PTR_bb_error_msg_and_die_001311f0)(PTR_bdcommands_4__name_4__001311a4 + 0x2658);\n  }" { (expression_statement "(*(code *)PTR_bb_error_msg_and_die_001311f0)(PTR_bdcommands_4__name_4__001311a4 + 0x2658);" (call_expression "(*(code *)PTR_bb_error_msg_and_die_001311f0)(PTR_bdcommands_4__name_4__001311a4 + 0x2658)" (parenthesized_expression "(*(code *)PTR_bb_error_msg_and_die_001311f0)" ( (pointer_expression "*(code *)PTR_bb_error_msg_and_die_001311f0" * (cast_expression "(code *)PTR_bb_error_msg_and_die_001311f0" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_bdcommands_4__name_4__001311a4 + 0x2658)" ( (binary_expression "PTR_bdcommands_4__name_4__001311a4 + 0x2658" identifier + number_literal) ))) ;) })) (expression_statement "(*(code *)PTR_xread_0013181c)(0,iVar3,0x100);" (call_expression "(*(code *)PTR_xread_0013181c)(0,iVar3,0x100)" (parenthesized_expression "(*(code *)PTR_xread_0013181c)" ( (pointer_expression "*(code *)PTR_xread_0013181c" * (cast_expression "(code *)PTR_xread_0013181c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0,iVar3,0x100)" ( number_literal , identifier , number_literal ))) ;) (expression_statement "puVar1 = PTR_xread_0013181c;" (assignment_expression "puVar1 = PTR_xread_0013181c" identifier = identifier) ;) (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" identifier = number_literal) ;) (do_statement "do {\n    if (*(char *)(iVar3 + iVar5) == '\x01') {\n      (*(code *)puVar1)(0,ibuff,0x100);\n      iVar6 = 0;\n      puVar7 = ibuff;\n      do {\n        ke.kb_index = (uchar)iVar6;\n        ke.kb_table = (uchar)iVar5;\n        ke.kb_value = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar4,0x4b47,&ke);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar5 = iVar5 + 1;\n    iVar6 = 0;\n  } while (iVar5 != 0x100);" do (compound_statement "{\n    if (*(char *)(iVar3 + iVar5) == '\x01') {\n      (*(code *)puVar1)(0,ibuff,0x100);\n      iVar6 = 0;\n      puVar7 = ibuff;\n      do {\n        ke.kb_index = (uchar)iVar6;\n        ke.kb_table = (uchar)iVar5;\n        ke.kb_value = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar4,0x4b47,&ke);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar5 = iVar5 + 1;\n    iVar6 = 0;\n  }" { (if_statement "if (*(char *)(iVar3 + iVar5) == '\x01') {\n      (*(code *)puVar1)(0,ibuff,0x100);\n      iVar6 = 0;\n      puVar7 = ibuff;\n      do {\n        ke.kb_index = (uchar)iVar6;\n        ke.kb_table = (uchar)iVar5;\n        ke.kb_value = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar4,0x4b47,&ke);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }" if (parenthesized_expression "(*(char *)(iVar3 + iVar5) == '\x01')" ( (binary_expression "*(char *)(iVar3 + iVar5) == '\x01'" (pointer_expression "*(char *)(iVar3 + iVar5)" * (cast_expression "(char *)(iVar3 + iVar5)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + iVar5)" ( (binary_expression "iVar3 + iVar5" identifier + identifier) )))) == (char_literal "'\x01'" ' escape_sequence ')) )) (compound_statement "{\n      (*(code *)puVar1)(0,ibuff,0x100);\n      iVar6 = 0;\n      puVar7 = ibuff;\n      do {\n        ke.kb_index = (uchar)iVar6;\n        ke.kb_table = (uchar)iVar5;\n        ke.kb_value = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar4,0x4b47,&ke);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }" { (expression_statement "(*(code *)puVar1)(0,ibuff,0x100);" (call_expression "(*(code *)puVar1)(0,ibuff,0x100)" (parenthesized_expression "(*(code *)puVar1)" ( (pointer_expression "*(code *)puVar1" * (cast_expression "(code *)puVar1" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0,ibuff,0x100)" ( number_literal , identifier , number_literal ))) ;) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) (expression_statement "puVar7 = ibuff;" (assignment_expression "puVar7 = ibuff" identifier = identifier) ;) (do_statement "do {\n        ke.kb_index = (uchar)iVar6;\n        ke.kb_table = (uchar)iVar5;\n        ke.kb_value = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar4,0x4b47,&ke);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);" do (compound_statement "{\n        ke.kb_index = (uchar)iVar6;\n        ke.kb_table = (uchar)iVar5;\n        ke.kb_value = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar4,0x4b47,&ke);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      }" { (expression_statement "ke.kb_index = (uchar)iVar6;" (assignment_expression "ke.kb_index = (uchar)iVar6" (field_expression "ke.kb_index" identifier . field_identifier) = (cast_expression "(uchar)iVar6" ( (type_descriptor "uchar" type_identifier) ) identifier)) ;) (expression_statement "ke.kb_table = (uchar)iVar5;" (assignment_expression "ke.kb_table = (uchar)iVar5" (field_expression "ke.kb_table" identifier . field_identifier) = (cast_expression "(uchar)iVar5" ( (type_descriptor "uchar" type_identifier) ) identifier)) ;) (expression_statement "ke.kb_value = *puVar7;" (assignment_expression "ke.kb_value = *puVar7" (field_expression "ke.kb_value" identifier . field_identifier) = (pointer_expression "*puVar7" * identifier)) ;) (expression_statement "(*(code *)PTR_ioctl_00132074)(uVar4,0x4b47,&ke);" (call_expression "(*(code *)PTR_ioctl_00132074)(uVar4,0x4b47,&ke)" (parenthesized_expression "(*(code *)PTR_ioctl_00132074)" ( (pointer_expression "*(code *)PTR_ioctl_00132074" * (cast_expression "(code *)PTR_ioctl_00132074" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(uVar4,0x4b47,&ke)" ( identifier , number_literal , (pointer_expression "&ke" & identifier) ))) ;) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" identifier = (binary_expression "iVar6 + 1" identifier + number_literal)) ;) (expression_statement "puVar7 = puVar7 + 1;" (assignment_expression "puVar7 = puVar7 + 1" identifier = (binary_expression "puVar7 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar6 != 0x80)" ( (binary_expression "iVar6 != 0x80" identifier != number_literal) )) ;) })) (expression_statement "iVar5 = iVar5 + 1;" (assignment_expression "iVar5 = iVar5 + 1" identifier = (binary_expression "iVar5 + 1" identifier + number_literal)) ;) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) }) while (parenthesized_expression "(iVar5 != 0x100)" ( (binary_expression "iVar5 != 0x100" identifier != number_literal) )) ;) (if_statement "if (iVar2 != *(int *)PTR___stack_chk_guard_00132164) {\n    iVar6 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }" if (parenthesized_expression "(iVar2 != *(int *)PTR___stack_chk_guard_00132164)" ( (binary_expression "iVar2 != *(int *)PTR___stack_chk_guard_00132164" identifier != (pointer_expression "*(int *)PTR___stack_chk_guard_00132164" * (cast_expression "(int *)PTR___stack_chk_guard_00132164" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    iVar6 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }" { (expression_statement "iVar6 = (*(code *)PTR___stack_chk_fail_001320e4)();" (assignment_expression "iVar6 = (*(code *)PTR___stack_chk_fail_001320e4)()" identifier = (call_expression "(*(code *)PTR___stack_chk_fail_001320e4)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_001320e4)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_001320e4" * (cast_expression "(code *)PTR___stack_chk_fail_001320e4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) })) (return_statement "return iVar6;" return identifier ;) })))
(translation_unit "undefined4 FUN_000b6430(undefined4 param_1,int param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  undefined4 uVar3;\n  int iVar4;\n  undefined4 uVar5;\n  int iVar6;\n  undefined2 *puVar7;\n  undefined1 local_130;\n  undefined1 local_12f;\n  undefined2 local_12e;\n  undefined2 local_12c [128];\n  int local_2c;\n  \n  local_2c = *(int *)PTR___stack_chk_guard_00132164;\n  iVar2 = (*(code *)PTR_FUN_00131240)(0x100);\n  if (*(int *)(param_2 + 4) != 0) {\n    (*(code *)PTR_FUN_001311e8)();\n  }\n  uVar3 = (*(code *)PTR_FUN_00131b20)();\n  (*(code *)PTR_FUN_0013181c)(0,iVar2,7);\n  iVar4 = (*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650);\n  if (iVar4 == 0) {\n    (*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);\n  }\n  (*(code *)PTR_FUN_0013181c)(0,iVar2,0x100);\n  puVar1 = PTR_FUN_0013181c;\n  iVar4 = 0;\n  do {\n    if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar4 = iVar4 + 1;\n    uVar5 = 0;\n  } while (iVar4 != 0x100);\n  if (local_2c != *(int *)PTR___stack_chk_guard_00132164) {\n    uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }\n  return uVar5;\n}\n\n" (function_definition "undefined4 FUN_000b6430(undefined4 param_1,int param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  undefined4 uVar3;\n  int iVar4;\n  undefined4 uVar5;\n  int iVar6;\n  undefined2 *puVar7;\n  undefined1 local_130;\n  undefined1 local_12f;\n  undefined2 local_12e;\n  undefined2 local_12c [128];\n  int local_2c;\n  \n  local_2c = *(int *)PTR___stack_chk_guard_00132164;\n  iVar2 = (*(code *)PTR_FUN_00131240)(0x100);\n  if (*(int *)(param_2 + 4) != 0) {\n    (*(code *)PTR_FUN_001311e8)();\n  }\n  uVar3 = (*(code *)PTR_FUN_00131b20)();\n  (*(code *)PTR_FUN_0013181c)(0,iVar2,7);\n  iVar4 = (*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650);\n  if (iVar4 == 0) {\n    (*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);\n  }\n  (*(code *)PTR_FUN_0013181c)(0,iVar2,0x100);\n  puVar1 = PTR_FUN_0013181c;\n  iVar4 = 0;\n  do {\n    if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar4 = iVar4 + 1;\n    uVar5 = 0;\n  } while (iVar4 != 0x100);\n  if (local_2c != *(int *)PTR___stack_chk_guard_00132164) {\n    uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }\n  return uVar5;\n}" type_identifier (function_declarator "FUN_000b6430(undefined4 param_1,int param_2)" identifier (parameter_list "(undefined4 param_1,int param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  undefined4 uVar3;\n  int iVar4;\n  undefined4 uVar5;\n  int iVar6;\n  undefined2 *puVar7;\n  undefined1 local_130;\n  undefined1 local_12f;\n  undefined2 local_12e;\n  undefined2 local_12c [128];\n  int local_2c;\n  \n  local_2c = *(int *)PTR___stack_chk_guard_00132164;\n  iVar2 = (*(code *)PTR_FUN_00131240)(0x100);\n  if (*(int *)(param_2 + 4) != 0) {\n    (*(code *)PTR_FUN_001311e8)();\n  }\n  uVar3 = (*(code *)PTR_FUN_00131b20)();\n  (*(code *)PTR_FUN_0013181c)(0,iVar2,7);\n  iVar4 = (*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650);\n  if (iVar4 == 0) {\n    (*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);\n  }\n  (*(code *)PTR_FUN_0013181c)(0,iVar2,0x100);\n  puVar1 = PTR_FUN_0013181c;\n  iVar4 = 0;\n  do {\n    if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar4 = iVar4 + 1;\n    uVar5 = 0;\n  } while (iVar4 != 0x100);\n  if (local_2c != *(int *)PTR___stack_chk_guard_00132164) {\n    uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }\n  return uVar5;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "undefined2 *puVar7;" type_identifier (pointer_declarator "*puVar7" * identifier) ;) (declaration "undefined1 local_130;" type_identifier identifier ;) (declaration "undefined1 local_12f;" type_identifier identifier ;) (declaration "undefined2 local_12e;" type_identifier identifier ;) (declaration "undefined2 local_12c [128];" type_identifier (array_declarator "local_12c [128]" identifier [ number_literal ]) ;) (declaration "int local_2c;" primitive_type identifier ;) (expression_statement "local_2c = *(int *)PTR___stack_chk_guard_00132164;" (assignment_expression "local_2c = *(int *)PTR___stack_chk_guard_00132164" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_00132164" * (cast_expression "(int *)PTR___stack_chk_guard_00132164" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar2 = (*(code *)PTR_FUN_00131240)(0x100);" (assignment_expression "iVar2 = (*(code *)PTR_FUN_00131240)(0x100)" identifier = (call_expression "(*(code *)PTR_FUN_00131240)(0x100)" (parenthesized_expression "(*(code *)PTR_FUN_00131240)" ( (pointer_expression "*(code *)PTR_FUN_00131240" * (cast_expression "(code *)PTR_FUN_00131240" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0x100)" ( number_literal )))) ;) (if_statement "if (*(int *)(param_2 + 4) != 0) {\n    (*(code *)PTR_FUN_001311e8)();\n  }" if (parenthesized_expression "(*(int *)(param_2 + 4) != 0)" ( (binary_expression "*(int *)(param_2 + 4) != 0" (pointer_expression "*(int *)(param_2 + 4)" * (cast_expression "(int *)(param_2 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + 4)" ( (binary_expression "param_2 + 4" identifier + number_literal) )))) != number_literal) )) (compound_statement "{\n    (*(code *)PTR_FUN_001311e8)();\n  }" { (expression_statement "(*(code *)PTR_FUN_001311e8)();" (call_expression "(*(code *)PTR_FUN_001311e8)()" (parenthesized_expression "(*(code *)PTR_FUN_001311e8)" ( (pointer_expression "*(code *)PTR_FUN_001311e8" * (cast_expression "(code *)PTR_FUN_001311e8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) })) (expression_statement "uVar3 = (*(code *)PTR_FUN_00131b20)();" (assignment_expression "uVar3 = (*(code *)PTR_FUN_00131b20)()" identifier = (call_expression "(*(code *)PTR_FUN_00131b20)()" (parenthesized_expression "(*(code *)PTR_FUN_00131b20)" ( (pointer_expression "*(code *)PTR_FUN_00131b20" * (cast_expression "(code *)PTR_FUN_00131b20" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) (expression_statement "(*(code *)PTR_FUN_0013181c)(0,iVar2,7);" (call_expression "(*(code *)PTR_FUN_0013181c)(0,iVar2,7)" (parenthesized_expression "(*(code *)PTR_FUN_0013181c)" ( (pointer_expression "*(code *)PTR_FUN_0013181c" * (cast_expression "(code *)PTR_FUN_0013181c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0,iVar2,7)" ( number_literal , identifier , number_literal ))) ;) (expression_statement "iVar4 = (*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650);" (assignment_expression "iVar4 = (*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650)" identifier = (call_expression "(*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650)" (parenthesized_expression "(*(code *)PTR_FUN_001311fc)" ( (pointer_expression "*(code *)PTR_FUN_001311fc" * (cast_expression "(code *)PTR_FUN_001311fc" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2,PTR_FUN_001311a4 + 0x2650)" ( identifier , (binary_expression "PTR_FUN_001311a4 + 0x2650" identifier + number_literal) )))) ;) (if_statement "if (iVar4 == 0) {\n    (*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);\n  }" if (parenthesized_expression "(iVar4 == 0)" ( (binary_expression "iVar4 == 0" identifier == number_literal) )) (compound_statement "{\n    (*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);\n  }" { (expression_statement "(*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);" (call_expression "(*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658)" (parenthesized_expression "(*(code *)PTR_FUN_001311f0)" ( (pointer_expression "*(code *)PTR_FUN_001311f0" * (cast_expression "(code *)PTR_FUN_001311f0" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_FUN_001311a4 + 0x2658)" ( (binary_expression "PTR_FUN_001311a4 + 0x2658" identifier + number_literal) ))) ;) })) (expression_statement "(*(code *)PTR_FUN_0013181c)(0,iVar2,0x100);" (call_expression "(*(code *)PTR_FUN_0013181c)(0,iVar2,0x100)" (parenthesized_expression "(*(code *)PTR_FUN_0013181c)" ( (pointer_expression "*(code *)PTR_FUN_0013181c" * (cast_expression "(code *)PTR_FUN_0013181c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0,iVar2,0x100)" ( number_literal , identifier , number_literal ))) ;) (expression_statement "puVar1 = PTR_FUN_0013181c;" (assignment_expression "puVar1 = PTR_FUN_0013181c" identifier = identifier) ;) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) (do_statement "do {\n    if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar4 = iVar4 + 1;\n    uVar5 = 0;\n  } while (iVar4 != 0x100);" do (compound_statement "{\n    if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar4 = iVar4 + 1;\n    uVar5 = 0;\n  }" { (if_statement "if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }" if (parenthesized_expression "(*(char *)(iVar2 + iVar4) == '\x01')" ( (binary_expression "*(char *)(iVar2 + iVar4) == '\x01'" (pointer_expression "*(char *)(iVar2 + iVar4)" * (cast_expression "(char *)(iVar2 + iVar4)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + iVar4)" ( (binary_expression "iVar2 + iVar4" identifier + identifier) )))) == (char_literal "'\x01'" ' escape_sequence ')) )) (compound_statement "{\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }" { (expression_statement "(*(code *)puVar1)(0,local_12c,0x100);" (call_expression "(*(code *)puVar1)(0,local_12c,0x100)" (parenthesized_expression "(*(code *)puVar1)" ( (pointer_expression "*(code *)puVar1" * (cast_expression "(code *)puVar1" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(0,local_12c,0x100)" ( number_literal , identifier , number_literal ))) ;) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) (expression_statement "puVar7 = local_12c;" (assignment_expression "puVar7 = local_12c" identifier = identifier) ;) (do_statement "do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);" do (compound_statement "{\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      }" { (expression_statement "local_12f = (undefined1)iVar6;" (assignment_expression "local_12f = (undefined1)iVar6" identifier = (cast_expression "(undefined1)iVar6" ( (type_descriptor "undefined1" type_identifier) ) identifier)) ;) (expression_statement "local_130 = (undefined1)iVar4;" (assignment_expression "local_130 = (undefined1)iVar4" identifier = (cast_expression "(undefined1)iVar4" ( (type_descriptor "undefined1" type_identifier) ) identifier)) ;) (expression_statement "local_12e = *puVar7;" (assignment_expression "local_12e = *puVar7" identifier = (pointer_expression "*puVar7" * identifier)) ;) (expression_statement "(*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);" (call_expression "(*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130)" (parenthesized_expression "(*(code *)PTR_ioctl_00132074)" ( (pointer_expression "*(code *)PTR_ioctl_00132074" * (cast_expression "(code *)PTR_ioctl_00132074" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(uVar3,0x4b47,&local_130)" ( identifier , number_literal , (pointer_expression "&local_130" & identifier) ))) ;) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" identifier = (binary_expression "iVar6 + 1" identifier + number_literal)) ;) (expression_statement "puVar7 = puVar7 + 1;" (assignment_expression "puVar7 = puVar7 + 1" identifier = (binary_expression "puVar7 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar6 != 0x80)" ( (binary_expression "iVar6 != 0x80" identifier != number_literal) )) ;) })) (expression_statement "iVar4 = iVar4 + 1;" (assignment_expression "iVar4 = iVar4 + 1" identifier = (binary_expression "iVar4 + 1" identifier + number_literal)) ;) (expression_statement "uVar5 = 0;" (assignment_expression "uVar5 = 0" identifier = number_literal) ;) }) while (parenthesized_expression "(iVar4 != 0x100)" ( (binary_expression "iVar4 != 0x100" identifier != number_literal) )) ;) (if_statement "if (local_2c != *(int *)PTR___stack_chk_guard_00132164) {\n    uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }" if (parenthesized_expression "(local_2c != *(int *)PTR___stack_chk_guard_00132164)" ( (binary_expression "local_2c != *(int *)PTR___stack_chk_guard_00132164" identifier != (pointer_expression "*(int *)PTR___stack_chk_guard_00132164" * (cast_expression "(int *)PTR___stack_chk_guard_00132164" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }" { (expression_statement "uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();" (assignment_expression "uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)()" identifier = (call_expression "(*(code *)PTR___stack_chk_fail_001320e4)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_001320e4)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_001320e4" * (cast_expression "(code *)PTR___stack_chk_fail_001320e4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( )))) ;) })) (return_statement "return uVar5;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != LIT) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))) ;) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( )))) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( LIT , IDENT , LIT ))) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , (binary_expression IDENT + LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( (binary_expression IDENT + LIT) ))) ;) })) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( LIT , IDENT , LIT ))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) == (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( LIT , IDENT , LIT ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , LIT , (pointer_expression & IDENT) ))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != LIT) )) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }) while (parenthesized_expression ( (binary_expression IDENT != LIT) )) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( )))) ;) })) (return_statement return IDENT ;) })))
(function_definition "undefined4 FUN_000b6430(undefined4 param_1,int param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  undefined4 uVar3;\n  int iVar4;\n  undefined4 uVar5;\n  int iVar6;\n  undefined2 *puVar7;\n  undefined1 local_130;\n  undefined1 local_12f;\n  undefined2 local_12e;\n  undefined2 local_12c [128];\n  int local_2c;\n  \n  local_2c = *(int *)PTR___stack_chk_guard_00132164;\n  iVar2 = (*(code *)PTR_FUN_00131240)(0x100);\n  if (*(int *)(param_2 + 4) != 0) {\n    (*(code *)PTR_FUN_001311e8)();\n  }\n  uVar3 = (*(code *)PTR_FUN_00131b20)();\n  (*(code *)PTR_FUN_0013181c)(0,iVar2,7);\n  iVar4 = (*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650);\n  if (iVar4 == 0) {\n    (*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);\n  }\n  (*(code *)PTR_FUN_0013181c)(0,iVar2,0x100);\n  puVar1 = PTR_FUN_0013181c;\n  iVar4 = 0;\n  do {\n    if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar4 = iVar4 + 1;\n    uVar5 = 0;\n  } while (iVar4 != 0x100);\n  if (local_2c != *(int *)PTR___stack_chk_guard_00132164) {\n    uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }\n  return uVar5;\n}" (type_identifier "undefined4") (function_declarator "FUN_000b6430(undefined4 param_1,int param_2)" (identifier "FUN_000b6430") (parameter_list "(undefined4 param_1,int param_2)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  undefined4 uVar3;\n  int iVar4;\n  undefined4 uVar5;\n  int iVar6;\n  undefined2 *puVar7;\n  undefined1 local_130;\n  undefined1 local_12f;\n  undefined2 local_12e;\n  undefined2 local_12c [128];\n  int local_2c;\n  \n  local_2c = *(int *)PTR___stack_chk_guard_00132164;\n  iVar2 = (*(code *)PTR_FUN_00131240)(0x100);\n  if (*(int *)(param_2 + 4) != 0) {\n    (*(code *)PTR_FUN_001311e8)();\n  }\n  uVar3 = (*(code *)PTR_FUN_00131b20)();\n  (*(code *)PTR_FUN_0013181c)(0,iVar2,7);\n  iVar4 = (*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650);\n  if (iVar4 == 0) {\n    (*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);\n  }\n  (*(code *)PTR_FUN_0013181c)(0,iVar2,0x100);\n  puVar1 = PTR_FUN_0013181c;\n  iVar4 = 0;\n  do {\n    if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar4 = iVar4 + 1;\n    uVar5 = 0;\n  } while (iVar4 != 0x100);\n  if (local_2c != *(int *)PTR___stack_chk_guard_00132164) {\n    uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }\n  return uVar5;\n}" ({ "{") (declaration "undefined *puVar1;" (type_identifier "undefined") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined4 uVar3;" (type_identifier "undefined4") (identifier "uVar3") (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "undefined4 uVar5;" (type_identifier "undefined4") (identifier "uVar5") (; ";")) (declaration "int iVar6;" (primitive_type "int") (identifier "iVar6") (; ";")) (declaration "undefined2 *puVar7;" (type_identifier "undefined2") (pointer_declarator "*puVar7" (* "*") (identifier "puVar7")) (; ";")) (declaration "undefined1 local_130;" (type_identifier "undefined1") (identifier "local_130") (; ";")) (declaration "undefined1 local_12f;" (type_identifier "undefined1") (identifier "local_12f") (; ";")) (declaration "undefined2 local_12e;" (type_identifier "undefined2") (identifier "local_12e") (; ";")) (declaration "undefined2 local_12c [128];" (type_identifier "undefined2") (array_declarator "local_12c [128]" (identifier "local_12c") ([ "[") (number_literal "128") (] "]")) (; ";")) (declaration "int local_2c;" (primitive_type "int") (identifier "local_2c") (; ";")) (expression_statement "local_2c = *(int *)PTR___stack_chk_guard_00132164;" (assignment_expression "local_2c = *(int *)PTR___stack_chk_guard_00132164" (identifier "local_2c") (= "=") (pointer_expression "*(int *)PTR___stack_chk_guard_00132164" (* "*") (cast_expression "(int *)PTR___stack_chk_guard_00132164" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_guard_00132164")))) (; ";")) (expression_statement "iVar2 = (*(code *)PTR_FUN_00131240)(0x100);" (assignment_expression "iVar2 = (*(code *)PTR_FUN_00131240)(0x100)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_FUN_00131240)(0x100)" (parenthesized_expression "(*(code *)PTR_FUN_00131240)" (( "(") (pointer_expression "*(code *)PTR_FUN_00131240" (* "*") (cast_expression "(code *)PTR_FUN_00131240" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_FUN_00131240"))) () ")")) (argument_list "(0x100)" (( "(") (number_literal "0x100") () ")")))) (; ";")) (if_statement "if (*(int *)(param_2 + 4) != 0) {\n    (*(code *)PTR_FUN_001311e8)();\n  }" (if "if") (parenthesized_expression "(*(int *)(param_2 + 4) != 0)" (( "(") (binary_expression "*(int *)(param_2 + 4) != 0" (pointer_expression "*(int *)(param_2 + 4)" (* "*") (cast_expression "(int *)(param_2 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_2 + 4)" (( "(") (binary_expression "param_2 + 4" (identifier "param_2") (+ "+") (number_literal "4")) () ")")))) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    (*(code *)PTR_FUN_001311e8)();\n  }" ({ "{") (expression_statement "(*(code *)PTR_FUN_001311e8)();" (call_expression "(*(code *)PTR_FUN_001311e8)()" (parenthesized_expression "(*(code *)PTR_FUN_001311e8)" (( "(") (pointer_expression "*(code *)PTR_FUN_001311e8" (* "*") (cast_expression "(code *)PTR_FUN_001311e8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_FUN_001311e8"))) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (expression_statement "uVar3 = (*(code *)PTR_FUN_00131b20)();" (assignment_expression "uVar3 = (*(code *)PTR_FUN_00131b20)()" (identifier "uVar3") (= "=") (call_expression "(*(code *)PTR_FUN_00131b20)()" (parenthesized_expression "(*(code *)PTR_FUN_00131b20)" (( "(") (pointer_expression "*(code *)PTR_FUN_00131b20" (* "*") (cast_expression "(code *)PTR_FUN_00131b20" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_FUN_00131b20"))) () ")")) (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "(*(code *)PTR_FUN_0013181c)(0,iVar2,7);" (call_expression "(*(code *)PTR_FUN_0013181c)(0,iVar2,7)" (parenthesized_expression "(*(code *)PTR_FUN_0013181c)" (( "(") (pointer_expression "*(code *)PTR_FUN_0013181c" (* "*") (cast_expression "(code *)PTR_FUN_0013181c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_FUN_0013181c"))) () ")")) (argument_list "(0,iVar2,7)" (( "(") (number_literal "0") (, ",") (identifier "iVar2") (, ",") (number_literal "7") () ")"))) (; ";")) (expression_statement "iVar4 = (*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650);" (assignment_expression "iVar4 = (*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650)" (identifier "iVar4") (= "=") (call_expression "(*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650)" (parenthesized_expression "(*(code *)PTR_FUN_001311fc)" (( "(") (pointer_expression "*(code *)PTR_FUN_001311fc" (* "*") (cast_expression "(code *)PTR_FUN_001311fc" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_FUN_001311fc"))) () ")")) (argument_list "(iVar2,PTR_FUN_001311a4 + 0x2650)" (( "(") (identifier "iVar2") (, ",") (binary_expression "PTR_FUN_001311a4 + 0x2650" (identifier "PTR_FUN_001311a4") (+ "+") (number_literal "0x2650")) () ")")))) (; ";")) (if_statement "if (iVar4 == 0) {\n    (*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);\n  }" (if "if") (parenthesized_expression "(iVar4 == 0)" (( "(") (binary_expression "iVar4 == 0" (identifier "iVar4") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    (*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);\n  }" ({ "{") (expression_statement "(*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);" (call_expression "(*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658)" (parenthesized_expression "(*(code *)PTR_FUN_001311f0)" (( "(") (pointer_expression "*(code *)PTR_FUN_001311f0" (* "*") (cast_expression "(code *)PTR_FUN_001311f0" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_FUN_001311f0"))) () ")")) (argument_list "(PTR_FUN_001311a4 + 0x2658)" (( "(") (binary_expression "PTR_FUN_001311a4 + 0x2658" (identifier "PTR_FUN_001311a4") (+ "+") (number_literal "0x2658")) () ")"))) (; ";")) (} "}"))) (expression_statement "(*(code *)PTR_FUN_0013181c)(0,iVar2,0x100);" (call_expression "(*(code *)PTR_FUN_0013181c)(0,iVar2,0x100)" (parenthesized_expression "(*(code *)PTR_FUN_0013181c)" (( "(") (pointer_expression "*(code *)PTR_FUN_0013181c" (* "*") (cast_expression "(code *)PTR_FUN_0013181c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_FUN_0013181c"))) () ")")) (argument_list "(0,iVar2,0x100)" (( "(") (number_literal "0") (, ",") (identifier "iVar2") (, ",") (number_literal "0x100") () ")"))) (; ";")) (expression_statement "puVar1 = PTR_FUN_0013181c;" (assignment_expression "puVar1 = PTR_FUN_0013181c" (identifier "puVar1") (= "=") (identifier "PTR_FUN_0013181c")) (; ";")) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" (identifier "iVar4") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n    if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar4 = iVar4 + 1;\n    uVar5 = 0;\n  } while (iVar4 != 0x100);" (do "do") (compound_statement "{\n    if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }\n    iVar4 = iVar4 + 1;\n    uVar5 = 0;\n  }" ({ "{") (if_statement "if (*(char *)(iVar2 + iVar4) == '\x01') {\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }" (if "if") (parenthesized_expression "(*(char *)(iVar2 + iVar4) == '\x01')" (( "(") (binary_expression "*(char *)(iVar2 + iVar4) == '\x01'" (pointer_expression "*(char *)(iVar2 + iVar4)" (* "*") (cast_expression "(char *)(iVar2 + iVar4)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + iVar4)" (( "(") (binary_expression "iVar2 + iVar4" (identifier "iVar2") (+ "+") (identifier "iVar4")) () ")")))) (== "==") (char_literal "'\x01'" (' "'") (escape_sequence "\x01") (' "'"))) () ")")) (compound_statement "{\n      (*(code *)puVar1)(0,local_12c,0x100);\n      iVar6 = 0;\n      puVar7 = local_12c;\n      do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);\n    }" ({ "{") (expression_statement "(*(code *)puVar1)(0,local_12c,0x100);" (call_expression "(*(code *)puVar1)(0,local_12c,0x100)" (parenthesized_expression "(*(code *)puVar1)" (( "(") (pointer_expression "*(code *)puVar1" (* "*") (cast_expression "(code *)puVar1" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar1"))) () ")")) (argument_list "(0,local_12c,0x100)" (( "(") (number_literal "0") (, ",") (identifier "local_12c") (, ",") (number_literal "0x100") () ")"))) (; ";")) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" (identifier "iVar6") (= "=") (number_literal "0")) (; ";")) (expression_statement "puVar7 = local_12c;" (assignment_expression "puVar7 = local_12c" (identifier "puVar7") (= "=") (identifier "local_12c")) (; ";")) (do_statement "do {\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      } while (iVar6 != 0x80);" (do "do") (compound_statement "{\n        local_12f = (undefined1)iVar6;\n        local_130 = (undefined1)iVar4;\n        local_12e = *puVar7;\n        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);\n        iVar6 = iVar6 + 1;\n        puVar7 = puVar7 + 1;\n      }" ({ "{") (expression_statement "local_12f = (undefined1)iVar6;" (assignment_expression "local_12f = (undefined1)iVar6" (identifier "local_12f") (= "=") (cast_expression "(undefined1)iVar6" (( "(") (type_descriptor "undefined1" (type_identifier "undefined1")) () ")") (identifier "iVar6"))) (; ";")) (expression_statement "local_130 = (undefined1)iVar4;" (assignment_expression "local_130 = (undefined1)iVar4" (identifier "local_130") (= "=") (cast_expression "(undefined1)iVar4" (( "(") (type_descriptor "undefined1" (type_identifier "undefined1")) () ")") (identifier "iVar4"))) (; ";")) (expression_statement "local_12e = *puVar7;" (assignment_expression "local_12e = *puVar7" (identifier "local_12e") (= "=") (pointer_expression "*puVar7" (* "*") (identifier "puVar7"))) (; ";")) (expression_statement "(*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);" (call_expression "(*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130)" (parenthesized_expression "(*(code *)PTR_ioctl_00132074)" (( "(") (pointer_expression "*(code *)PTR_ioctl_00132074" (* "*") (cast_expression "(code *)PTR_ioctl_00132074" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_ioctl_00132074"))) () ")")) (argument_list "(uVar3,0x4b47,&local_130)" (( "(") (identifier "uVar3") (, ",") (number_literal "0x4b47") (, ",") (pointer_expression "&local_130" (& "&") (identifier "local_130")) () ")"))) (; ";")) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" (identifier "iVar6") (= "=") (binary_expression "iVar6 + 1" (identifier "iVar6") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "puVar7 = puVar7 + 1;" (assignment_expression "puVar7 = puVar7 + 1" (identifier "puVar7") (= "=") (binary_expression "puVar7 + 1" (identifier "puVar7") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(iVar6 != 0x80)" (( "(") (binary_expression "iVar6 != 0x80" (identifier "iVar6") (!= "!=") (number_literal "0x80")) () ")")) (; ";")) (} "}"))) (expression_statement "iVar4 = iVar4 + 1;" (assignment_expression "iVar4 = iVar4 + 1" (identifier "iVar4") (= "=") (binary_expression "iVar4 + 1" (identifier "iVar4") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "uVar5 = 0;" (assignment_expression "uVar5 = 0" (identifier "uVar5") (= "=") (number_literal "0")) (; ";")) (} "}")) (while "while") (parenthesized_expression "(iVar4 != 0x100)" (( "(") (binary_expression "iVar4 != 0x100" (identifier "iVar4") (!= "!=") (number_literal "0x100")) () ")")) (; ";")) (if_statement "if (local_2c != *(int *)PTR___stack_chk_guard_00132164) {\n    uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }" (if "if") (parenthesized_expression "(local_2c != *(int *)PTR___stack_chk_guard_00132164)" (( "(") (binary_expression "local_2c != *(int *)PTR___stack_chk_guard_00132164" (identifier "local_2c") (!= "!=") (pointer_expression "*(int *)PTR___stack_chk_guard_00132164" (* "*") (cast_expression "(int *)PTR___stack_chk_guard_00132164" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_guard_00132164")))) () ")")) (compound_statement "{\n    uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();\n  }" ({ "{") (expression_statement "uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();" (assignment_expression "uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)()" (identifier "uVar5") (= "=") (call_expression "(*(code *)PTR___stack_chk_fail_001320e4)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_001320e4)" (( "(") (pointer_expression "*(code *)PTR___stack_chk_fail_001320e4" (* "*") (cast_expression "(code *)PTR___stack_chk_fail_001320e4" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_fail_001320e4"))) () ")")) (argument_list "()" (( "(") () ")")))) (; ";")) (} "}"))) (return_statement "return uVar5;" (return "return") (identifier "uVar5") (; ";")) (} "}")))

int function_1(int argc,char **argv)

{
  type_1 *puVar1;
  int var_6;
  int var_3;
  type_2 uVar4;
  int var_2;
  int var_4;
  uint16_t *var_5;
  type_3 ke;
  uint16_t ibuff [128];
  
  var_6 = *(int *)PTR___stack_chk_guard_00132164;
  var_3 = (*(type_4 *)PTR_xmalloc_00131240)(0x100);
  if (argv[1] != (char *)0x0) {
    (*(type_4 *)PTR_bb_show_usage_001311e8)();
  }
  uVar4 = (*(type_4 *)PTR_get_console_fd_or_die_00131b20)();
  (*(type_4 *)PTR_xread_0013181c)(0,var_3,7);
  var_2 = (*(type_4 *)PTR_is_prefixed_with_001311fc)
                    (var_3,var_1 + 0x2650);
  if (var_2 == 0) {
    (*(type_4 *)PTR_bb_error_msg_and_die_001311f0)(var_1 + 0x2658);
  }
  (*(type_4 *)PTR_xread_0013181c)(0,var_3,0x100);
  puVar1 = PTR_xread_0013181c;
  var_2 = 0;
  do {
    if (*(char *)(var_3 + var_2) == '\x01') {
      (*(type_4 *)puVar1)(0,ibuff,0x100);
      var_4 = 0;
      var_5 = ibuff;
      do {
        ke.kb_index = (type_5)var_4;
        ke.kb_table = (type_5)var_2;
        ke.kb_value = *var_5;
        (*(type_4 *)PTR_ioctl_00132074)(uVar4,0x4b47,&ke);
        var_4 = var_4 + 1;
        var_5 = var_5 + 1;
      } while (var_4 != 0x80);
    }
    var_2 = var_2 + 1;
    var_4 = 0;
  } while (var_2 != 0x100);
  if (var_6 != *(int *)PTR___stack_chk_guard_00132164) {
    var_4 = (*(type_4 *)PTR___stack_chk_fail_001320e4)();
  }
  return var_4;
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list)))) (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (number_literal) (identifier) (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (number_literal) (identifier) (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (do_statement body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))) right: (char_literal (escape_sequence)))) consequence: (compound_statement (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (number_literal) (identifier) (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier) (number_literal) (pointer_expression argument: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (identifier))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list)))))) (return_statement (identifier)))))

undefined4 MASKED(undefined4 param_1,int param_2)

{
  undefined *puVar1;
  int iVar2;
  undefined4 uVar3;
  int iVar4;
  undefined4 uVar5;
  int iVar6;
  undefined2 *puVar7;
  undefined1 local_130;
  undefined1 local_12f;
  undefined2 local_12e;
  undefined2 local_12c [128];
  int local_2c;
  
  local_2c = *(int *)PTR___stack_chk_guard_00132164;
  iVar2 = (*(code *)PTR_FUN_00131240)(0x100);
  if (*(int *)(param_2 + 4) != 0) {
    (*(code *)PTR_FUN_001311e8)();
  }
  uVar3 = (*(code *)PTR_FUN_00131b20)();
  (*(code *)PTR_FUN_0013181c)(0,iVar2,7);
  iVar4 = (*(code *)PTR_FUN_001311fc)(iVar2,PTR_FUN_001311a4 + 0x2650);
  if (iVar4 == 0) {
    (*(code *)PTR_FUN_001311f0)(PTR_FUN_001311a4 + 0x2658);
  }
  (*(code *)PTR_FUN_0013181c)(0,iVar2,0x100);
  puVar1 = PTR_FUN_0013181c;
  iVar4 = 0;
  do {
    if (*(char *)(iVar2 + iVar4) == '\x01') {
      (*(code *)puVar1)(0,local_12c,0x100);
      iVar6 = 0;
      puVar7 = local_12c;
      do {
        local_12f = (undefined1)iVar6;
        local_130 = (undefined1)iVar4;
        local_12e = *puVar7;
        (*(code *)PTR_ioctl_00132074)(uVar3,0x4b47,&local_130);
        iVar6 = iVar6 + 1;
        puVar7 = puVar7 + 1;
      } while (iVar6 != 0x80);
    }
    iVar4 = iVar4 + 1;
    uVar5 = 0;
  } while (iVar4 != 0x100);
  if (local_2c != *(int *)PTR___stack_chk_guard_00132164) {
    uVar5 = (*(code *)PTR___stack_chk_fail_001320e4)();
  }
  return uVar5;
}

