
size_t full_write(int fd,void *buf,size_t count)

{
  size_t sVar1;
  int *piVar2;
  size_t sVar3;
  
  if (count == 0) {
    sVar3 = 0;
  }
  else {
    sVar3 = 0;
    do {
      sVar1 = safe_write(fd,buf,count);
      if (sVar1 == 0xffffffffffffffff) {
        return sVar3;
      }
      if (sVar1 == 0) {
        piVar2 = __errno_location();
        *piVar2 = 0x1c;
        return sVar3;
      }
      sVar3 = sVar3 + sVar1;
      buf = (void *)((long)buf + sVar1);
      count = count - sVar1;
    } while (count != 0);
  }
  return sVar3;
}



long FUN_0010efc2(undefined4 param_1,long param_2,long param_3)

{
  long lVar1;
  int *piVar2;
  long lVar3;
  
  if (param_3 == 0) {
    lVar3 = 0;
  }
  else {
    lVar3 = 0;
    do {
      lVar1 = FUN_00112915(param_1,param_2,param_3);
      if (lVar1 == -1) {
        return lVar3;
      }
      if (lVar1 == 0) {
        piVar2 = __errno_location();
        *piVar2 = 0x1c;
        return lVar3;
      }
      lVar3 = lVar3 + lVar1;
      param_2 = param_2 + lVar1;
      param_3 = param_3 - lVar1;
    } while (param_3 != 0);
  }
  return lVar3;
}


PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x8
MOV RBX,RDX
TEST RDX,RDX
JZ 0x0010f01f
MOV R13D,EDI
MOV RBP,RSI
MOV R12D,0x0
MOV RDX,RBX
MOV RSI,RBP
MOV EDI,R13D
CALL 0x00112915
CMP RAX,-0x1
JZ 0x0010f011
TEST RAX,RAX
JZ 0x0010f006
ADD R12,RAX
ADD RBP,RAX
SUB RBX,RAX
JNZ 0x0010efe0
JMP 0x0010f011
CALL 0x001040b0
MOV dword ptr [RAX],0x1c
MOV RAX,R12
ADD RSP,0x8
POP RBX
POP RBP
POP R12
POP R13
RET
MOV R12,RDX
JMP 0x0010f011
(translation_unit "long FUN_0010efc2(undefined4 param_1,long param_2,long param_3)\n\n{\n  long lVar1;\n  int *piVar2;\n  long lVar3;\n  \n  if (param_3 == 0) {\n    lVar3 = 0;\n  }\n  else {\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }\n  return lVar3;\n}\n\n" (function_definition "long FUN_0010efc2(undefined4 param_1,long param_2,long param_3)\n\n{\n  long lVar1;\n  int *piVar2;\n  long lVar3;\n  \n  if (param_3 == 0) {\n    lVar3 = 0;\n  }\n  else {\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }\n  return lVar3;\n}" (sized_type_specifier "long" long) (function_declarator "FUN_0010efc2(undefined4 param_1,long param_2,long param_3)" identifier (parameter_list "(undefined4 param_1,long param_2,long param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "long param_2" (sized_type_specifier "long" long) identifier) , (parameter_declaration "long param_3" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  long lVar1;\n  int *piVar2;\n  long lVar3;\n  \n  if (param_3 == 0) {\n    lVar3 = 0;\n  }\n  else {\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }\n  return lVar3;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (if_statement "if (param_3 == 0) {\n    lVar3 = 0;\n  }\n  else {\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n    lVar3 = 0;\n  }" { (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }" else (compound_statement "{\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }" { (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) (do_statement "do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);" do (compound_statement "{\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    }" { (expression_statement "lVar1 = FUN_00112915(param_1,param_2,param_3);" (assignment_expression "lVar1 = FUN_00112915(param_1,param_2,param_3)" identifier = (call_expression "FUN_00112915(param_1,param_2,param_3)" identifier (argument_list "(param_1,param_2,param_3)" ( identifier , identifier , identifier )))) ;) (if_statement "if (lVar1 == -1) {\n        return lVar3;\n      }" if (parenthesized_expression "(lVar1 == -1)" ( (binary_expression "lVar1 == -1" identifier == number_literal) )) (compound_statement "{\n        return lVar3;\n      }" { (return_statement "return lVar3;" return identifier ;) })) (if_statement "if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }" if (parenthesized_expression "(lVar1 == 0)" ( (binary_expression "lVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*piVar2 = 0x1c;" (assignment_expression "*piVar2 = 0x1c" (pointer_expression "*piVar2" * identifier) = number_literal) ;) (return_statement "return lVar3;" return identifier ;) })) (expression_statement "lVar3 = lVar3 + lVar1;" (assignment_expression "lVar3 = lVar3 + lVar1" identifier = (binary_expression "lVar3 + lVar1" identifier + identifier)) ;) (expression_statement "param_2 = param_2 + lVar1;" (assignment_expression "param_2 = param_2 + lVar1" identifier = (binary_expression "param_2 + lVar1" identifier + identifier)) ;) (expression_statement "param_3 = param_3 - lVar1;" (assignment_expression "param_3 = param_3 - lVar1" identifier = (binary_expression "param_3 - lVar1" identifier - identifier)) ;) }) while (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) ;) }))) (return_statement "return lVar3;" return identifier ;) })))
(translation_unit "size_t full_write(int fd,void *buf,size_t count)\n\n{\n  size_t sVar1;\n  int *piVar2;\n  size_t sVar3;\n  \n  if (count == 0) {\n    sVar3 = 0;\n  }\n  else {\n    sVar3 = 0;\n    do {\n      sVar1 = safe_write(fd,buf,count);\n      if (sVar1 == 0xffffffffffffffff) {\n        return sVar3;\n      }\n      if (sVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return sVar3;\n      }\n      sVar3 = sVar3 + sVar1;\n      buf = (void *)((long)buf + sVar1);\n      count = count - sVar1;\n    } while (count != 0);\n  }\n  return sVar3;\n}\n\n" (function_definition "size_t full_write(int fd,void *buf,size_t count)\n\n{\n  size_t sVar1;\n  int *piVar2;\n  size_t sVar3;\n  \n  if (count == 0) {\n    sVar3 = 0;\n  }\n  else {\n    sVar3 = 0;\n    do {\n      sVar1 = safe_write(fd,buf,count);\n      if (sVar1 == 0xffffffffffffffff) {\n        return sVar3;\n      }\n      if (sVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return sVar3;\n      }\n      sVar3 = sVar3 + sVar1;\n      buf = (void *)((long)buf + sVar1);\n      count = count - sVar1;\n    } while (count != 0);\n  }\n  return sVar3;\n}" primitive_type (function_declarator "full_write(int fd,void *buf,size_t count)" identifier (parameter_list "(int fd,void *buf,size_t count)" ( (parameter_declaration "int fd" primitive_type identifier) , (parameter_declaration "void *buf" primitive_type (pointer_declarator "*buf" * identifier)) , (parameter_declaration "size_t count" primitive_type identifier) ))) (compound_statement "{\n  size_t sVar1;\n  int *piVar2;\n  size_t sVar3;\n  \n  if (count == 0) {\n    sVar3 = 0;\n  }\n  else {\n    sVar3 = 0;\n    do {\n      sVar1 = safe_write(fd,buf,count);\n      if (sVar1 == 0xffffffffffffffff) {\n        return sVar3;\n      }\n      if (sVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return sVar3;\n      }\n      sVar3 = sVar3 + sVar1;\n      buf = (void *)((long)buf + sVar1);\n      count = count - sVar1;\n    } while (count != 0);\n  }\n  return sVar3;\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "size_t sVar3;" primitive_type identifier ;) (if_statement "if (count == 0) {\n    sVar3 = 0;\n  }\n  else {\n    sVar3 = 0;\n    do {\n      sVar1 = safe_write(fd,buf,count);\n      if (sVar1 == 0xffffffffffffffff) {\n        return sVar3;\n      }\n      if (sVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return sVar3;\n      }\n      sVar3 = sVar3 + sVar1;\n      buf = (void *)((long)buf + sVar1);\n      count = count - sVar1;\n    } while (count != 0);\n  }" if (parenthesized_expression "(count == 0)" ( (binary_expression "count == 0" identifier == number_literal) )) (compound_statement "{\n    sVar3 = 0;\n  }" { (expression_statement "sVar3 = 0;" (assignment_expression "sVar3 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    sVar3 = 0;\n    do {\n      sVar1 = safe_write(fd,buf,count);\n      if (sVar1 == 0xffffffffffffffff) {\n        return sVar3;\n      }\n      if (sVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return sVar3;\n      }\n      sVar3 = sVar3 + sVar1;\n      buf = (void *)((long)buf + sVar1);\n      count = count - sVar1;\n    } while (count != 0);\n  }" else (compound_statement "{\n    sVar3 = 0;\n    do {\n      sVar1 = safe_write(fd,buf,count);\n      if (sVar1 == 0xffffffffffffffff) {\n        return sVar3;\n      }\n      if (sVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return sVar3;\n      }\n      sVar3 = sVar3 + sVar1;\n      buf = (void *)((long)buf + sVar1);\n      count = count - sVar1;\n    } while (count != 0);\n  }" { (expression_statement "sVar3 = 0;" (assignment_expression "sVar3 = 0" identifier = number_literal) ;) (do_statement "do {\n      sVar1 = safe_write(fd,buf,count);\n      if (sVar1 == 0xffffffffffffffff) {\n        return sVar3;\n      }\n      if (sVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return sVar3;\n      }\n      sVar3 = sVar3 + sVar1;\n      buf = (void *)((long)buf + sVar1);\n      count = count - sVar1;\n    } while (count != 0);" do (compound_statement "{\n      sVar1 = safe_write(fd,buf,count);\n      if (sVar1 == 0xffffffffffffffff) {\n        return sVar3;\n      }\n      if (sVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return sVar3;\n      }\n      sVar3 = sVar3 + sVar1;\n      buf = (void *)((long)buf + sVar1);\n      count = count - sVar1;\n    }" { (expression_statement "sVar1 = safe_write(fd,buf,count);" (assignment_expression "sVar1 = safe_write(fd,buf,count)" identifier = (call_expression "safe_write(fd,buf,count)" identifier (argument_list "(fd,buf,count)" ( identifier , identifier , identifier )))) ;) (if_statement "if (sVar1 == 0xffffffffffffffff) {\n        return sVar3;\n      }" if (parenthesized_expression "(sVar1 == 0xffffffffffffffff)" ( (binary_expression "sVar1 == 0xffffffffffffffff" identifier == number_literal) )) (compound_statement "{\n        return sVar3;\n      }" { (return_statement "return sVar3;" return identifier ;) })) (if_statement "if (sVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return sVar3;\n      }" if (parenthesized_expression "(sVar1 == 0)" ( (binary_expression "sVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return sVar3;\n      }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*piVar2 = 0x1c;" (assignment_expression "*piVar2 = 0x1c" (pointer_expression "*piVar2" * identifier) = number_literal) ;) (return_statement "return sVar3;" return identifier ;) })) (expression_statement "sVar3 = sVar3 + sVar1;" (assignment_expression "sVar3 = sVar3 + sVar1" identifier = (binary_expression "sVar3 + sVar1" identifier + identifier)) ;) (expression_statement "buf = (void *)((long)buf + sVar1);" (assignment_expression "buf = (void *)((long)buf + sVar1)" identifier = (cast_expression "(void *)((long)buf + sVar1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)buf + sVar1)" ( (binary_expression "(long)buf + sVar1" (cast_expression "(long)buf" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) ;) (expression_statement "count = count - sVar1;" (assignment_expression "count = count - sVar1" identifier = (binary_expression "count - sVar1" identifier - identifier)) ;) }) while (parenthesized_expression "(count != 0)" ( (binary_expression "count != 0" identifier != number_literal) )) ;) }))) (return_statement "return sVar3;" return identifier ;) })))
(translation_unit "long FUN_0010efc2(undefined4 param_1,long param_2,long param_3)\n\n{\n  long lVar1;\n  int *piVar2;\n  long lVar3;\n  \n  if (param_3 == 0) {\n    lVar3 = 0;\n  }\n  else {\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }\n  return lVar3;\n}\n\n" (function_definition "long FUN_0010efc2(undefined4 param_1,long param_2,long param_3)\n\n{\n  long lVar1;\n  int *piVar2;\n  long lVar3;\n  \n  if (param_3 == 0) {\n    lVar3 = 0;\n  }\n  else {\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }\n  return lVar3;\n}" (sized_type_specifier "long" long) (function_declarator "FUN_0010efc2(undefined4 param_1,long param_2,long param_3)" identifier (parameter_list "(undefined4 param_1,long param_2,long param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "long param_2" (sized_type_specifier "long" long) identifier) , (parameter_declaration "long param_3" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  long lVar1;\n  int *piVar2;\n  long lVar3;\n  \n  if (param_3 == 0) {\n    lVar3 = 0;\n  }\n  else {\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }\n  return lVar3;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (if_statement "if (param_3 == 0) {\n    lVar3 = 0;\n  }\n  else {\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n    lVar3 = 0;\n  }" { (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }" else (compound_statement "{\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }" { (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) (do_statement "do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);" do (compound_statement "{\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    }" { (expression_statement "lVar1 = FUN_00112915(param_1,param_2,param_3);" (assignment_expression "lVar1 = FUN_00112915(param_1,param_2,param_3)" identifier = (call_expression "FUN_00112915(param_1,param_2,param_3)" identifier (argument_list "(param_1,param_2,param_3)" ( identifier , identifier , identifier )))) ;) (if_statement "if (lVar1 == -1) {\n        return lVar3;\n      }" if (parenthesized_expression "(lVar1 == -1)" ( (binary_expression "lVar1 == -1" identifier == number_literal) )) (compound_statement "{\n        return lVar3;\n      }" { (return_statement "return lVar3;" return identifier ;) })) (if_statement "if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }" if (parenthesized_expression "(lVar1 == 0)" ( (binary_expression "lVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*piVar2 = 0x1c;" (assignment_expression "*piVar2 = 0x1c" (pointer_expression "*piVar2" * identifier) = number_literal) ;) (return_statement "return lVar3;" return identifier ;) })) (expression_statement "lVar3 = lVar3 + lVar1;" (assignment_expression "lVar3 = lVar3 + lVar1" identifier = (binary_expression "lVar3 + lVar1" identifier + identifier)) ;) (expression_statement "param_2 = param_2 + lVar1;" (assignment_expression "param_2 = param_2 + lVar1" identifier = (binary_expression "param_2 + lVar1" identifier + identifier)) ;) (expression_statement "param_3 = param_3 - lVar1;" (assignment_expression "param_3 = param_3 - lVar1" identifier = (binary_expression "param_3 - lVar1" identifier - identifier)) ;) }) while (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) ;) }))) (return_statement "return lVar3;" return identifier ;) })))
(translation_unit (function_definition (sized_type_specifier long) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) ))) (compound_statement { (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return IDENT ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != LIT) )) ;) }))) (return_statement return IDENT ;) })))
(function_definition "long FUN_0010efc2(undefined4 param_1,long param_2,long param_3)\n\n{\n  long lVar1;\n  int *piVar2;\n  long lVar3;\n  \n  if (param_3 == 0) {\n    lVar3 = 0;\n  }\n  else {\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }\n  return lVar3;\n}" (sized_type_specifier "long" (long "long")) (function_declarator "FUN_0010efc2(undefined4 param_1,long param_2,long param_3)" (identifier "FUN_0010efc2") (parameter_list "(undefined4 param_1,long param_2,long param_3)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "long param_2" (sized_type_specifier "long" (long "long")) (identifier "param_2")) (, ",") (parameter_declaration "long param_3" (sized_type_specifier "long" (long "long")) (identifier "param_3")) () ")"))) (compound_statement "{\n  long lVar1;\n  int *piVar2;\n  long lVar3;\n  \n  if (param_3 == 0) {\n    lVar3 = 0;\n  }\n  else {\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }\n  return lVar3;\n}" ({ "{") (declaration "long lVar1;" (sized_type_specifier "long" (long "long")) (identifier "lVar1") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "long lVar3;" (sized_type_specifier "long" (long "long")) (identifier "lVar3") (; ";")) (if_statement "if (param_3 == 0) {\n    lVar3 = 0;\n  }\n  else {\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }" (if "if") (parenthesized_expression "(param_3 == 0)" (( "(") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    lVar3 = 0;\n  }" ({ "{") (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" (identifier "lVar3") (= "=") (number_literal "0")) (; ";")) (} "}")) (else_clause "else {\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }" (else "else") (compound_statement "{\n    lVar3 = 0;\n    do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);\n  }" ({ "{") (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" (identifier "lVar3") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    } while (param_3 != 0);" (do "do") (compound_statement "{\n      lVar1 = FUN_00112915(param_1,param_2,param_3);\n      if (lVar1 == -1) {\n        return lVar3;\n      }\n      if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }\n      lVar3 = lVar3 + lVar1;\n      param_2 = param_2 + lVar1;\n      param_3 = param_3 - lVar1;\n    }" ({ "{") (expression_statement "lVar1 = FUN_00112915(param_1,param_2,param_3);" (assignment_expression "lVar1 = FUN_00112915(param_1,param_2,param_3)" (identifier "lVar1") (= "=") (call_expression "FUN_00112915(param_1,param_2,param_3)" (identifier "FUN_00112915") (argument_list "(param_1,param_2,param_3)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")")))) (; ";")) (if_statement "if (lVar1 == -1) {\n        return lVar3;\n      }" (if "if") (parenthesized_expression "(lVar1 == -1)" (( "(") (binary_expression "lVar1 == -1" (identifier "lVar1") (== "==") (number_literal "-1")) () ")")) (compound_statement "{\n        return lVar3;\n      }" ({ "{") (return_statement "return lVar3;" (return "return") (identifier "lVar3") (; ";")) (} "}"))) (if_statement "if (lVar1 == 0) {\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }" (if "if") (parenthesized_expression "(lVar1 == 0)" (( "(") (binary_expression "lVar1 == 0" (identifier "lVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        piVar2 = __errno_location();\n        *piVar2 = 0x1c;\n        return lVar3;\n      }" ({ "{") (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" (identifier "piVar2") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "*piVar2 = 0x1c;" (assignment_expression "*piVar2 = 0x1c" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (number_literal "0x1c")) (; ";")) (return_statement "return lVar3;" (return "return") (identifier "lVar3") (; ";")) (} "}"))) (expression_statement "lVar3 = lVar3 + lVar1;" (assignment_expression "lVar3 = lVar3 + lVar1" (identifier "lVar3") (= "=") (binary_expression "lVar3 + lVar1" (identifier "lVar3") (+ "+") (identifier "lVar1"))) (; ";")) (expression_statement "param_2 = param_2 + lVar1;" (assignment_expression "param_2 = param_2 + lVar1" (identifier "param_2") (= "=") (binary_expression "param_2 + lVar1" (identifier "param_2") (+ "+") (identifier "lVar1"))) (; ";")) (expression_statement "param_3 = param_3 - lVar1;" (assignment_expression "param_3 = param_3 - lVar1" (identifier "param_3") (= "=") (binary_expression "param_3 - lVar1" (identifier "param_3") (- "-") (identifier "lVar1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(param_3 != 0)" (( "(") (binary_expression "param_3 != 0" (identifier "param_3") (!= "!=") (number_literal "0")) () ")")) (; ";")) (} "}")))) (return_statement "return lVar3;" (return "return") (identifier "lVar3") (; ";")) (} "}")))

size_t function_1(int fd,void *buf,size_t var_1)

{
  size_t var_3;
  int *piVar2;
  size_t var_5;
  
  if (var_1 == 0) {
    var_5 = 0;
  }
  else {
    var_5 = 0;
    do {
      var_3 = var_2(fd,buf,var_1);
      if (var_3 == 0xffffffffffffffff) {
        return var_5;
      }
      if (var_3 == 0) {
        piVar2 = var_4();
        *piVar2 = 0x1c;
        return var_5;
      }
      var_5 = var_5 + var_3;
      buf = (void *)((long)buf + var_3);
      var_1 = var_1 - var_3;
    } while (var_1 != 0);
  }
  return var_5;
}


(translation_unit (function_definition type: (sized_type_specifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (sized_type_specifier) declarator: (identifier)) (parameter_declaration type: (sized_type_specifier) declarator: (identifier)))) body: (compound_statement (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (sized_type_specifier) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (return_statement (identifier)))))

long MASKED(undefined4 param_1,long param_2,long param_3)

{
  long lVar1;
  int *piVar2;
  long lVar3;
  
  if (param_3 == 0) {
    lVar3 = 0;
  }
  else {
    lVar3 = 0;
    do {
      lVar1 = FUN_00112915(param_1,param_2,param_3);
      if (lVar1 == -1) {
        return lVar3;
      }
      if (lVar1 == 0) {
        piVar2 = __errno_location();
        *piVar2 = 0x1c;
        return lVar3;
      }
      lVar3 = lVar3 + lVar1;
      param_2 = param_2 + lVar1;
      param_3 = param_3 - lVar1;
    } while (param_3 != 0);
  }
  return lVar3;
}

