
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

int __regparm3 read_blkdev_capacity(int sg_fd,int64_t *num_sect,int *sect_sz)

{
  int iVar1;
  int in_GS_OFFSET;
  int64_t iVar2;
  uint64_t ull;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x1447f;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar1 = ioctl(sg_fd,0x1268,sect_sz);
  if ((iVar1 < 0) && (0 < *sect_sz)) {
    perror("BLKSSZGET ioctl error");
    iVar1 = -1;
  }
  else {
    iVar1 = ioctl(sg_fd,0x80041272,&ull);
    if (iVar1 < 0) {
      perror("BLKGETSIZE64 ioctl error");
      iVar1 = -1;
    }
    else {
      iVar2 = __divdi3((undefined4)ull,ull._4_4_,*sect_sz,*sect_sz >> 0x1f);
      *num_sect = iVar2;
      iVar1 = 0;
    }
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar1;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

undefined4 __regparm3 FUN_00014470(int param_1,undefined8 *param_2,int *param_3)

{
  int iVar1;
  undefined4 uVar2;
  int in_GS_OFFSET;
  undefined8 uVar3;
  undefined4 local_2c;
  undefined4 local_28;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x1447f;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar1 = ioctl(param_1,0x1268,param_3);
  if ((iVar1 < 0) && (0 < *param_3)) {
    perror("BLKSSZGET ioctl error");
    uVar2 = 0xffffffff;
  }
  else {
    iVar1 = ioctl(param_1,0x80041272,&local_2c);
    if (iVar1 < 0) {
      perror("BLKGETSIZE64 ioctl error");
      uVar2 = 0xffffffff;
    }
    else {
      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);
      *param_2 = uVar3;
      uVar2 = 0;
    }
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar2;
  }
                    /* WARNING: Subroutine does not return */
  FUN_000167d0();
}


PUSH EBP
MOV EBP,ECX
PUSH EDI
MOV EDI,EAX
PUSH ESI
MOV ESI,EDX
PUSH EBX
CALL 0x00013920
ADD EBX,0x6a85
SUB ESP,0x20
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x10],EAX
XOR EAX,EAX
PUSH ECX
PUSH 0x1268
PUSH EDI
CALL 0x00011150
ADD ESP,0x10
TEST EAX,EAX
JNS 0x000144ad
CMP dword ptr [EBP],0x0
JG 0x000144f9
SUB ESP,0x4
LEA EAX,[ESP + 0x4]
PUSH EAX
PUSH 0x80041272
PUSH EDI
CALL 0x00011150
ADD ESP,0x10
TEST EAX,EAX
JS 0x00014510
MOV EAX,dword ptr [EBP]
CDQ
PUSH EDX
PUSH EAX
PUSH dword ptr [ESP + 0xc]
PUSH dword ptr [ESP + 0xc]
CALL 0x00016610
ADD ESP,0x10
MOV dword ptr [ESI + 0x4],EDX
MOV dword ptr [ESI],EAX
XOR EAX,EAX
MOV EDX,dword ptr [ESP + 0xc]
XOR EDX,dword ptr GS:[0x14]
JNZ 0x00014527
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
LEA EAX,[EBX + 0xffffd484]
PUSH EAX
CALL 0x00011160
ADD ESP,0x10
OR EAX,0xffffffff
JMP 0x000144e4
SUB ESP,0xc
LEA EAX,[EBX + 0xffffd49a]
PUSH EAX
CALL 0x00011160
ADD ESP,0x10
OR EAX,0xffffffff
JMP 0x000144e4
CALL 0x000167d0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 __regparm3 FUN_00014470(int param_1,undefined8 *param_2,int *param_3)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  int in_GS_OFFSET;\n  undefined8 uVar3;\n  undefined4 local_2c;\n  undefined4 local_28;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1447f;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = ioctl(param_1,0x1268,param_3);\n  if ((iVar1 < 0) && (0 < *param_3)) {\n    perror("BLKSSZGET ioctl error");\n    uVar2 = 0xffffffff;\n  }\n  else {\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return uVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_000167d0();\n}\n\n" comment (function_definition "undefined4 __regparm3 FUN_00014470(int param_1,undefined8 *param_2,int *param_3)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  int in_GS_OFFSET;\n  undefined8 uVar3;\n  undefined4 local_2c;\n  undefined4 local_28;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1447f;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = ioctl(param_1,0x1268,param_3);\n  if ((iVar1 < 0) && (0 < *param_3)) {\n    perror("BLKSSZGET ioctl error");\n    uVar2 = 0xffffffff;\n  }\n  else {\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return uVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_000167d0();\n}" type_identifier (ERROR "__regparm3" identifier) (function_declarator "FUN_00014470(int param_1,undefined8 *param_2,int *param_3)" identifier (parameter_list "(int param_1,undefined8 *param_2,int *param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined8 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int *param_3" primitive_type (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  int in_GS_OFFSET;\n  undefined8 uVar3;\n  undefined4 local_2c;\n  undefined4 local_28;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1447f;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = ioctl(param_1,0x1268,param_3);\n  if ((iVar1 < 0) && (0 < *param_3)) {\n    perror("BLKSSZGET ioctl error");\n    uVar2 = 0xffffffff;\n  }\n  else {\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return uVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_000167d0();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "undefined8 uVar3;" type_identifier identifier ;) (declaration "undefined4 local_2c;" type_identifier identifier ;) (declaration "undefined4 local_28;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x1447f;" (assignment_expression "uStack_14 = 0x1447f" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar1 = ioctl(param_1,0x1268,param_3);" (assignment_expression "iVar1 = ioctl(param_1,0x1268,param_3)" identifier = (call_expression "ioctl(param_1,0x1268,param_3)" identifier (argument_list "(param_1,0x1268,param_3)" ( identifier , number_literal , identifier )))) ;) (if_statement "if ((iVar1 < 0) && (0 < *param_3)) {\n    perror("BLKSSZGET ioctl error");\n    uVar2 = 0xffffffff;\n  }\n  else {\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }" if (parenthesized_expression "((iVar1 < 0) && (0 < *param_3))" ( (binary_expression "(iVar1 < 0) && (0 < *param_3)" (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) && (parenthesized_expression "(0 < *param_3)" ( (binary_expression "0 < *param_3" number_literal < (pointer_expression "*param_3" * identifier)) ))) )) (compound_statement "{\n    perror("BLKSSZGET ioctl error");\n    uVar2 = 0xffffffff;\n  }" { (expression_statement "perror("BLKSSZGET ioctl error");" (call_expression "perror("BLKSSZGET ioctl error")" identifier (argument_list "("BLKSSZGET ioctl error")" ( (string_literal ""BLKSSZGET ioctl error"" " string_content ") ))) ;) (expression_statement "uVar2 = 0xffffffff;" (assignment_expression "uVar2 = 0xffffffff" identifier = number_literal) ;) }) (else_clause "else {\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }" else (compound_statement "{\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }" { (expression_statement "iVar1 = ioctl(param_1,0x80041272,&local_2c);" (assignment_expression "iVar1 = ioctl(param_1,0x80041272,&local_2c)" identifier = (call_expression "ioctl(param_1,0x80041272,&local_2c)" identifier (argument_list "(param_1,0x80041272,&local_2c)" ( identifier , number_literal , (pointer_expression "&local_2c" & identifier) )))) ;) (if_statement "if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }" { (expression_statement "perror("BLKGETSIZE64 ioctl error");" (call_expression "perror("BLKGETSIZE64 ioctl error")" identifier (argument_list "("BLKGETSIZE64 ioctl error")" ( (string_literal ""BLKGETSIZE64 ioctl error"" " string_content ") ))) ;) (expression_statement "uVar2 = 0xffffffff;" (assignment_expression "uVar2 = 0xffffffff" identifier = number_literal) ;) }) (else_clause "else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }" else (compound_statement "{\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }" { (expression_statement "uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);" (assignment_expression "uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f)" identifier = (call_expression "FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f)" identifier (argument_list "(local_2c,local_28,*param_3,*param_3 >> 0x1f)" ( identifier , identifier , (pointer_expression "*param_3" * identifier) , (binary_expression "*param_3 >> 0x1f" (pointer_expression "*param_3" * identifier) >> number_literal) )))) ;) (expression_statement "*param_2 = uVar3;" (assignment_expression "*param_2 = uVar3" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) }))) }))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return uVar2;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return uVar2;\n  }" { (return_statement "return uVar2;" return identifier ;) })) comment (expression_statement "FUN_000167d0();" (call_expression "FUN_000167d0()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint __regparm3 read_blkdev_capacity(int sg_fd,int64_t *num_sect,int *sect_sz)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  int64_t iVar2;\n  uint64_t ull;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1447f;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = ioctl(sg_fd,0x1268,sect_sz);\n  if ((iVar1 < 0) && (0 < *sect_sz)) {\n    perror("BLKSSZGET ioctl error");\n    iVar1 = -1;\n  }\n  else {\n    iVar1 = ioctl(sg_fd,0x80041272,&ull);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      iVar1 = -1;\n    }\n    else {\n      iVar2 = __divdi3((undefined4)ull,ull._4_4_,*sect_sz,*sect_sz >> 0x1f);\n      *num_sect = iVar2;\n      iVar1 = 0;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment (function_definition "int __regparm3 read_blkdev_capacity(int sg_fd,int64_t *num_sect,int *sect_sz)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  int64_t iVar2;\n  uint64_t ull;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1447f;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = ioctl(sg_fd,0x1268,sect_sz);\n  if ((iVar1 < 0) && (0 < *sect_sz)) {\n    perror("BLKSSZGET ioctl error");\n    iVar1 = -1;\n  }\n  else {\n    iVar1 = ioctl(sg_fd,0x80041272,&ull);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      iVar1 = -1;\n    }\n    else {\n      iVar2 = __divdi3((undefined4)ull,ull._4_4_,*sect_sz,*sect_sz >> 0x1f);\n      *num_sect = iVar2;\n      iVar1 = 0;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "read_blkdev_capacity(int sg_fd,int64_t *num_sect,int *sect_sz)" identifier (parameter_list "(int sg_fd,int64_t *num_sect,int *sect_sz)" ( (parameter_declaration "int sg_fd" primitive_type identifier) , (parameter_declaration "int64_t *num_sect" primitive_type (pointer_declarator "*num_sect" * identifier)) , (parameter_declaration "int *sect_sz" primitive_type (pointer_declarator "*sect_sz" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int in_GS_OFFSET;\n  int64_t iVar2;\n  uint64_t ull;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1447f;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = ioctl(sg_fd,0x1268,sect_sz);\n  if ((iVar1 < 0) && (0 < *sect_sz)) {\n    perror("BLKSSZGET ioctl error");\n    iVar1 = -1;\n  }\n  else {\n    iVar1 = ioctl(sg_fd,0x80041272,&ull);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      iVar1 = -1;\n    }\n    else {\n      iVar2 = __divdi3((undefined4)ull,ull._4_4_,*sect_sz,*sect_sz >> 0x1f);\n      *num_sect = iVar2;\n      iVar1 = 0;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "int64_t iVar2;" primitive_type identifier ;) (declaration "uint64_t ull;" primitive_type identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x1447f;" (assignment_expression "uStack_14 = 0x1447f" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar1 = ioctl(sg_fd,0x1268,sect_sz);" (assignment_expression "iVar1 = ioctl(sg_fd,0x1268,sect_sz)" identifier = (call_expression "ioctl(sg_fd,0x1268,sect_sz)" identifier (argument_list "(sg_fd,0x1268,sect_sz)" ( identifier , number_literal , identifier )))) ;) (if_statement "if ((iVar1 < 0) && (0 < *sect_sz)) {\n    perror("BLKSSZGET ioctl error");\n    iVar1 = -1;\n  }\n  else {\n    iVar1 = ioctl(sg_fd,0x80041272,&ull);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      iVar1 = -1;\n    }\n    else {\n      iVar2 = __divdi3((undefined4)ull,ull._4_4_,*sect_sz,*sect_sz >> 0x1f);\n      *num_sect = iVar2;\n      iVar1 = 0;\n    }\n  }" if (parenthesized_expression "((iVar1 < 0) && (0 < *sect_sz))" ( (binary_expression "(iVar1 < 0) && (0 < *sect_sz)" (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) && (parenthesized_expression "(0 < *sect_sz)" ( (binary_expression "0 < *sect_sz" number_literal < (pointer_expression "*sect_sz" * identifier)) ))) )) (compound_statement "{\n    perror("BLKSSZGET ioctl error");\n    iVar1 = -1;\n  }" { (expression_statement "perror("BLKSSZGET ioctl error");" (call_expression "perror("BLKSSZGET ioctl error")" identifier (argument_list "("BLKSSZGET ioctl error")" ( (string_literal ""BLKSSZGET ioctl error"" " string_content ") ))) ;) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) }) (else_clause "else {\n    iVar1 = ioctl(sg_fd,0x80041272,&ull);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      iVar1 = -1;\n    }\n    else {\n      iVar2 = __divdi3((undefined4)ull,ull._4_4_,*sect_sz,*sect_sz >> 0x1f);\n      *num_sect = iVar2;\n      iVar1 = 0;\n    }\n  }" else (compound_statement "{\n    iVar1 = ioctl(sg_fd,0x80041272,&ull);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      iVar1 = -1;\n    }\n    else {\n      iVar2 = __divdi3((undefined4)ull,ull._4_4_,*sect_sz,*sect_sz >> 0x1f);\n      *num_sect = iVar2;\n      iVar1 = 0;\n    }\n  }" { (expression_statement "iVar1 = ioctl(sg_fd,0x80041272,&ull);" (assignment_expression "iVar1 = ioctl(sg_fd,0x80041272,&ull)" identifier = (call_expression "ioctl(sg_fd,0x80041272,&ull)" identifier (argument_list "(sg_fd,0x80041272,&ull)" ( identifier , number_literal , (pointer_expression "&ull" & identifier) )))) ;) (if_statement "if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      iVar1 = -1;\n    }\n    else {\n      iVar2 = __divdi3((undefined4)ull,ull._4_4_,*sect_sz,*sect_sz >> 0x1f);\n      *num_sect = iVar2;\n      iVar1 = 0;\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      perror("BLKGETSIZE64 ioctl error");\n      iVar1 = -1;\n    }" { (expression_statement "perror("BLKGETSIZE64 ioctl error");" (call_expression "perror("BLKGETSIZE64 ioctl error")" identifier (argument_list "("BLKGETSIZE64 ioctl error")" ( (string_literal ""BLKGETSIZE64 ioctl error"" " string_content ") ))) ;) (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) }) (else_clause "else {\n      iVar2 = __divdi3((undefined4)ull,ull._4_4_,*sect_sz,*sect_sz >> 0x1f);\n      *num_sect = iVar2;\n      iVar1 = 0;\n    }" else (compound_statement "{\n      iVar2 = __divdi3((undefined4)ull,ull._4_4_,*sect_sz,*sect_sz >> 0x1f);\n      *num_sect = iVar2;\n      iVar1 = 0;\n    }" { (expression_statement "iVar2 = __divdi3((undefined4)ull,ull._4_4_,*sect_sz,*sect_sz >> 0x1f);" (assignment_expression "iVar2 = __divdi3((undefined4)ull,ull._4_4_,*sect_sz,*sect_sz >> 0x1f)" identifier = (call_expression "__divdi3((undefined4)ull,ull._4_4_,*sect_sz,*sect_sz >> 0x1f)" identifier (argument_list "((undefined4)ull,ull._4_4_,*sect_sz,*sect_sz >> 0x1f)" ( (cast_expression "(undefined4)ull" ( (type_descriptor "undefined4" type_identifier) ) identifier) , (field_expression "ull._4_4_" identifier . field_identifier) , (pointer_expression "*sect_sz" * identifier) , (binary_expression "*sect_sz >> 0x1f" (pointer_expression "*sect_sz" * identifier) >> number_literal) )))) ;) (expression_statement "*num_sect = iVar2;" (assignment_expression "*num_sect = iVar2" (pointer_expression "*num_sect" * identifier) = identifier) ;) (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" identifier = number_literal) ;) }))) }))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return iVar1;\n  }" { (return_statement "return iVar1;" return identifier ;) })) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "undefined4 __regparm3 FUN_00014470(int param_1,undefined8 *param_2,int *param_3)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  int in_GS_OFFSET;\n  undefined8 uVar3;\n  undefined4 local_2c;\n  undefined4 local_28;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1447f;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = ioctl(param_1,0x1268,param_3);\n  if ((iVar1 < 0) && (0 < *param_3)) {\n    perror("BLKSSZGET ioctl error");\n    uVar2 = 0xffffffff;\n  }\n  else {\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return uVar2;\n  }\n                    \n  FUN_000167d0();\n}\n\n" (function_definition "undefined4 __regparm3 FUN_00014470(int param_1,undefined8 *param_2,int *param_3)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  int in_GS_OFFSET;\n  undefined8 uVar3;\n  undefined4 local_2c;\n  undefined4 local_28;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1447f;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = ioctl(param_1,0x1268,param_3);\n  if ((iVar1 < 0) && (0 < *param_3)) {\n    perror("BLKSSZGET ioctl error");\n    uVar2 = 0xffffffff;\n  }\n  else {\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return uVar2;\n  }\n                    \n  FUN_000167d0();\n}" type_identifier (ERROR "__regparm3" identifier) (function_declarator "FUN_00014470(int param_1,undefined8 *param_2,int *param_3)" identifier (parameter_list "(int param_1,undefined8 *param_2,int *param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined8 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int *param_3" primitive_type (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  int in_GS_OFFSET;\n  undefined8 uVar3;\n  undefined4 local_2c;\n  undefined4 local_28;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1447f;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = ioctl(param_1,0x1268,param_3);\n  if ((iVar1 < 0) && (0 < *param_3)) {\n    perror("BLKSSZGET ioctl error");\n    uVar2 = 0xffffffff;\n  }\n  else {\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return uVar2;\n  }\n                    \n  FUN_000167d0();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "undefined8 uVar3;" type_identifier identifier ;) (declaration "undefined4 local_2c;" type_identifier identifier ;) (declaration "undefined4 local_28;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x1447f;" (assignment_expression "uStack_14 = 0x1447f" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "iVar1 = ioctl(param_1,0x1268,param_3);" (assignment_expression "iVar1 = ioctl(param_1,0x1268,param_3)" identifier = (call_expression "ioctl(param_1,0x1268,param_3)" identifier (argument_list "(param_1,0x1268,param_3)" ( identifier , number_literal , identifier )))) ;) (if_statement "if ((iVar1 < 0) && (0 < *param_3)) {\n    perror("BLKSSZGET ioctl error");\n    uVar2 = 0xffffffff;\n  }\n  else {\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }" if (parenthesized_expression "((iVar1 < 0) && (0 < *param_3))" ( (binary_expression "(iVar1 < 0) && (0 < *param_3)" (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) && (parenthesized_expression "(0 < *param_3)" ( (binary_expression "0 < *param_3" number_literal < (pointer_expression "*param_3" * identifier)) ))) )) (compound_statement "{\n    perror("BLKSSZGET ioctl error");\n    uVar2 = 0xffffffff;\n  }" { (expression_statement "perror("BLKSSZGET ioctl error");" (call_expression "perror("BLKSSZGET ioctl error")" identifier (argument_list "("BLKSSZGET ioctl error")" ( (string_literal ""BLKSSZGET ioctl error"" " string_content ") ))) ;) (expression_statement "uVar2 = 0xffffffff;" (assignment_expression "uVar2 = 0xffffffff" identifier = number_literal) ;) }) (else_clause "else {\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }" else (compound_statement "{\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }" { (expression_statement "iVar1 = ioctl(param_1,0x80041272,&local_2c);" (assignment_expression "iVar1 = ioctl(param_1,0x80041272,&local_2c)" identifier = (call_expression "ioctl(param_1,0x80041272,&local_2c)" identifier (argument_list "(param_1,0x80041272,&local_2c)" ( identifier , number_literal , (pointer_expression "&local_2c" & identifier) )))) ;) (if_statement "if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }" { (expression_statement "perror("BLKGETSIZE64 ioctl error");" (call_expression "perror("BLKGETSIZE64 ioctl error")" identifier (argument_list "("BLKGETSIZE64 ioctl error")" ( (string_literal ""BLKGETSIZE64 ioctl error"" " string_content ") ))) ;) (expression_statement "uVar2 = 0xffffffff;" (assignment_expression "uVar2 = 0xffffffff" identifier = number_literal) ;) }) (else_clause "else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }" else (compound_statement "{\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }" { (expression_statement "uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);" (assignment_expression "uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f)" identifier = (call_expression "FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f)" identifier (argument_list "(local_2c,local_28,*param_3,*param_3 >> 0x1f)" ( identifier , identifier , (pointer_expression "*param_3" * identifier) , (binary_expression "*param_3 >> 0x1f" (pointer_expression "*param_3" * identifier) >> number_literal) )))) ;) (expression_statement "*param_2 = uVar3;" (assignment_expression "*param_2 = uVar3" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) }))) }))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return uVar2;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return uVar2;\n  }" { (return_statement "return uVar2;" return identifier ;) })) (expression_statement "FUN_000167d0();" (call_expression "FUN_000167d0()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT < LIT) )) && (parenthesized_expression ( (binary_expression LIT < (pointer_expression * IDENT)) ))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , (pointer_expression & IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , (pointer_expression * IDENT) , (binary_expression (pointer_expression * IDENT) >> LIT) )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }))) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "undefined4 __regparm3 FUN_00014470(int param_1,undefined8 *param_2,int *param_3)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  int in_GS_OFFSET;\n  undefined8 uVar3;\n  undefined4 local_2c;\n  undefined4 local_28;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1447f;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = ioctl(param_1,0x1268,param_3);\n  if ((iVar1 < 0) && (0 < *param_3)) {\n    perror("BLKSSZGET ioctl error");\n    uVar2 = 0xffffffff;\n  }\n  else {\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return uVar2;\n  }\n                    \n  FUN_000167d0();\n}" (type_identifier "undefined4") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_00014470(int param_1,undefined8 *param_2,int *param_3)" (identifier "FUN_00014470") (parameter_list "(int param_1,undefined8 *param_2,int *param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "undefined8 *param_2" (type_identifier "undefined8") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "int *param_3" (primitive_type "int") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) () ")"))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  int in_GS_OFFSET;\n  undefined8 uVar3;\n  undefined4 local_2c;\n  undefined4 local_28;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1447f;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  iVar1 = ioctl(param_1,0x1268,param_3);\n  if ((iVar1 < 0) && (0 < *param_3)) {\n    perror("BLKSSZGET ioctl error");\n    uVar2 = 0xffffffff;\n  }\n  else {\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return uVar2;\n  }\n                    \n  FUN_000167d0();\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "undefined8 uVar3;" (type_identifier "undefined8") (identifier "uVar3") (; ";")) (declaration "undefined4 local_2c;" (type_identifier "undefined4") (identifier "local_2c") (; ";")) (declaration "undefined4 local_28;" (type_identifier "undefined4") (identifier "local_28") (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x1447f;" (assignment_expression "uStack_14 = 0x1447f" (identifier "uStack_14") (= "=") (number_literal "0x1447f")) (; ";")) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (expression_statement "iVar1 = ioctl(param_1,0x1268,param_3);" (assignment_expression "iVar1 = ioctl(param_1,0x1268,param_3)" (identifier "iVar1") (= "=") (call_expression "ioctl(param_1,0x1268,param_3)" (identifier "ioctl") (argument_list "(param_1,0x1268,param_3)" (( "(") (identifier "param_1") (, ",") (number_literal "0x1268") (, ",") (identifier "param_3") () ")")))) (; ";")) (if_statement "if ((iVar1 < 0) && (0 < *param_3)) {\n    perror("BLKSSZGET ioctl error");\n    uVar2 = 0xffffffff;\n  }\n  else {\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }" (if "if") (parenthesized_expression "((iVar1 < 0) && (0 < *param_3))" (( "(") (binary_expression "(iVar1 < 0) && (0 < *param_3)" (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(0 < *param_3)" (( "(") (binary_expression "0 < *param_3" (number_literal "0") (< "<") (pointer_expression "*param_3" (* "*") (identifier "param_3"))) () ")"))) () ")")) (compound_statement "{\n    perror("BLKSSZGET ioctl error");\n    uVar2 = 0xffffffff;\n  }" ({ "{") (expression_statement "perror("BLKSSZGET ioctl error");" (call_expression "perror("BLKSSZGET ioctl error")" (identifier "perror") (argument_list "("BLKSSZGET ioctl error")" (( "(") (string_literal ""BLKSSZGET ioctl error"" (" """) (string_content "BLKSSZGET ioctl error") (" """)) () ")"))) (; ";")) (expression_statement "uVar2 = 0xffffffff;" (assignment_expression "uVar2 = 0xffffffff" (identifier "uVar2") (= "=") (number_literal "0xffffffff")) (; ";")) (} "}")) (else_clause "else {\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }" (else "else") (compound_statement "{\n    iVar1 = ioctl(param_1,0x80041272,&local_2c);\n    if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }\n  }" ({ "{") (expression_statement "iVar1 = ioctl(param_1,0x80041272,&local_2c);" (assignment_expression "iVar1 = ioctl(param_1,0x80041272,&local_2c)" (identifier "iVar1") (= "=") (call_expression "ioctl(param_1,0x80041272,&local_2c)" (identifier "ioctl") (argument_list "(param_1,0x80041272,&local_2c)" (( "(") (identifier "param_1") (, ",") (number_literal "0x80041272") (, ",") (pointer_expression "&local_2c" (& "&") (identifier "local_2c")) () ")")))) (; ";")) (if_statement "if (iVar1 < 0) {\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }\n    else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n      perror("BLKGETSIZE64 ioctl error");\n      uVar2 = 0xffffffff;\n    }" ({ "{") (expression_statement "perror("BLKGETSIZE64 ioctl error");" (call_expression "perror("BLKGETSIZE64 ioctl error")" (identifier "perror") (argument_list "("BLKGETSIZE64 ioctl error")" (( "(") (string_literal ""BLKGETSIZE64 ioctl error"" (" """) (string_content "BLKGETSIZE64 ioctl error") (" """)) () ")"))) (; ";")) (expression_statement "uVar2 = 0xffffffff;" (assignment_expression "uVar2 = 0xffffffff" (identifier "uVar2") (= "=") (number_literal "0xffffffff")) (; ";")) (} "}")) (else_clause "else {\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }" (else "else") (compound_statement "{\n      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);\n      *param_2 = uVar3;\n      uVar2 = 0;\n    }" ({ "{") (expression_statement "uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);" (assignment_expression "uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f)" (identifier "uVar3") (= "=") (call_expression "FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f)" (identifier "FUN_00016610") (argument_list "(local_2c,local_28,*param_3,*param_3 >> 0x1f)" (( "(") (identifier "local_2c") (, ",") (identifier "local_28") (, ",") (pointer_expression "*param_3" (* "*") (identifier "param_3")) (, ",") (binary_expression "*param_3 >> 0x1f" (pointer_expression "*param_3" (* "*") (identifier "param_3")) (>> ">>") (number_literal "0x1f")) () ")")))) (; ";")) (expression_statement "*param_2 = uVar3;" (assignment_expression "*param_2 = uVar3" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "uVar3")) (; ";")) (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" (identifier "uVar2") (= "=") (number_literal "0")) (; ";")) (} "}")))) (} "}")))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return uVar2;\n  }" (if "if") (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return uVar2;\n  }" ({ "{") (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}"))) (expression_statement "FUN_000167d0();" (call_expression "FUN_000167d0()" (identifier "FUN_000167d0") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

int __regparm3 function_1(int sg_fd,int64_t *num_sect,int *sect_sz)

{
  int var_3;
  int var_1;
  int64_t iVar2;
  uint64_t ull;
  int var_6;
  type_1 uStack_14;
  
  uStack_14 = 0x1447f;
  var_6 = *(int *)(var_1 + 0x14);
  var_3 = var_2(sg_fd,0x1268,sect_sz);
  if ((var_3 < 0) && (0 < *sect_sz)) {
    var_4("BLKSSZGET ioctl error");
    var_3 = -1;
  }
  else {
    var_3 = var_2(sg_fd,0x80041272,&ull);
    if (var_3 < 0) {
      var_4("BLKGETSIZE64 ioctl error");
      var_3 = -1;
    }
    else {
      iVar2 = var_5((type_1)ull,ull._4_4_,*sect_sz,*sect_sz >> 0x1f);
      *num_sect = iVar2;
      var_3 = 0;
    }
  }
  if (var_6 == *(int *)(var_1 + 0x14)) {
    return var_3;
  }
                    /* WARNING: Subroutine does not return */
  var_7();
}


(translation_unit (function_definition type: (type_identifier) (ERROR (identifier)) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (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: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (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))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (number_literal) right: (pointer_expression argument: (identifier)))))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (pointer_expression argument: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (pointer_expression argument: (identifier)) (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_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: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

undefined4 __regparm3 MASKED(int param_1,undefined8 *param_2,int *param_3)

{
  int iVar1;
  undefined4 uVar2;
  int in_GS_OFFSET;
  undefined8 uVar3;
  undefined4 local_2c;
  undefined4 local_28;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x1447f;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar1 = ioctl(param_1,0x1268,param_3);
  if ((iVar1 < 0) && (0 < *param_3)) {
    perror("BLKSSZGET ioctl error");
    uVar2 = 0xffffffff;
  }
  else {
    iVar1 = ioctl(param_1,0x80041272,&local_2c);
    if (iVar1 < 0) {
      perror("BLKGETSIZE64 ioctl error");
      uVar2 = 0xffffffff;
    }
    else {
      uVar3 = FUN_00016610(local_2c,local_28,*param_3,*param_3 >> 0x1f);
      *param_2 = uVar3;
      uVar2 = 0;
    }
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar2;
  }
                    /* WARNING: Subroutine does not return */
  FUN_000167d0();
}

