
/* std::__basic_file<char>::xsputn_2(char const*, long, char const*, long) */

long __thiscall
std::__basic_file<char>::xsputn_2
          (__basic_file<char> *this,char *param_1,long param_2,char *param_3,long param_4)

{
  long lVar1;
  int __fd;
  ssize_t sVar2;
  int *piVar3;
  long lVar4;
  long lVar5;
  iovec local_58;
  char *local_48;
  long local_40;
  
  lVar1 = param_2 + param_4;
  __fd = fd(this);
  lVar4 = lVar1;
  local_48 = param_3;
  local_40 = param_4;
  while( true ) {
    while (local_58.iov_base = param_1, local_58.iov_len = param_2, sVar2 = writev(__fd,&local_58,2)
          , sVar2 == -1) {
      piVar3 = __errno_location();
      if (*piVar3 != 4) {
        return lVar1 - lVar4;
      }
    }
    lVar4 = lVar4 - sVar2;
    if (lVar4 == 0) {
      return lVar1;
    }
    lVar5 = sVar2 - param_2;
    if (-1 < lVar5) break;
    param_1 = param_1 + sVar2;
    param_2 = param_2 - sVar2;
  }
  lVar5 = ::(anonymous_namespace)::xwrite(__fd,param_3 + lVar5,param_4 - lVar5);
  return lVar1 - (lVar4 - lVar5);
}



long FUN_00277470(undefined8 param_1,void *param_2,size_t param_3,long param_4,long param_5)

{
  long lVar1;
  int __fd;
  ssize_t sVar2;
  int *piVar3;
  long lVar4;
  long lVar5;
  iovec local_58;
  long local_48;
  long local_40;
  
  lVar1 = param_3 + param_5;
  __fd = FUN_00277370();
  lVar4 = lVar1;
  local_48 = param_4;
  local_40 = param_5;
  while( true ) {
    while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)
          , sVar2 == -1) {
      piVar3 = __errno_location();
      if (*piVar3 != 4) {
        return lVar1 - lVar4;
      }
    }
    lVar4 = lVar4 - sVar2;
    if (lVar4 == 0) {
      return lVar1;
    }
    lVar5 = sVar2 - param_3;
    if (-1 < lVar5) break;
    param_2 = (void *)((long)param_2 + sVar2);
    param_3 = param_3 - sVar2;
  }
  lVar5 = FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5);
  return lVar1 - (lVar4 - lVar5);
}


PUSH R15
PUSH R14
MOV R14,RCX
PUSH R13
MOV R13,R8
PUSH R12
MOV R12,RSI
PUSH RBP
PUSH RBX
MOV RBX,RDX
LEA R15,[RBX + R13*0x1]
MOV RBP,R15
SUB RSP,0x38
CALL 0x00277370
MOV qword ptr [RSP + 0x20],R14
MOV dword ptr [RSP + 0x4],EAX
LEA RAX,[RSP + 0x10]
MOV qword ptr [RSP + 0x28],R13
MOV qword ptr [RSP + 0x8],RAX
JMP 0x002774c3
SUB RBP,RAX
JZ 0x002774f3
MOV RSI,RAX
SUB RSI,RBX
JNS 0x00277508
ADD R12,RAX
SUB RBX,RAX
MOV RSI,qword ptr [RSP + 0x8]
MOV EDI,dword ptr [RSP + 0x4]
MOV EDX,0x2
MOV qword ptr [RSP + 0x10],R12
MOV qword ptr [RSP + 0x18],RBX
CALL 0x0013e880
CMP RAX,-0x1
JNZ 0x002774b0
CALL 0x0013e770
CMP dword ptr [RAX],0x4
JZ 0x002774c3
SUB R15,RBP
ADD RSP,0x38
MOV RAX,R15
POP RBX
POP RBP
POP R12
POP R13
POP R14
POP R15
RET
MOV RDX,R13
MOV EDI,dword ptr [RSP + 0x4]
SUB RDX,RSI
ADD RSI,R14
CALL 0x002771a0
SUB RBP,RAX
SUB R15,RBP
JMP 0x002774f3
(translation_unit "long FUN_00277470(undefined8 param_1,void *param_2,size_t param_3,long param_4,long param_5)\n\n{\n  long lVar1;\n  int __fd;\n  ssize_t sVar2;\n  int *piVar3;\n  long lVar4;\n  long lVar5;\n  iovec local_58;\n  long local_48;\n  long local_40;\n  \n  lVar1 = param_3 + param_5;\n  __fd = FUN_00277370();\n  lVar4 = lVar1;\n  local_48 = param_4;\n  local_40 = param_5;\n  while( true ) {\n    while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_3;\n    if (-1 < lVar5) break;\n    param_2 = (void *)((long)param_2 + sVar2);\n    param_3 = param_3 - sVar2;\n  }\n  lVar5 = FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5);\n  return lVar1 - (lVar4 - lVar5);\n}\n\n" (function_definition "long FUN_00277470(undefined8 param_1,void *param_2,size_t param_3,long param_4,long param_5)\n\n{\n  long lVar1;\n  int __fd;\n  ssize_t sVar2;\n  int *piVar3;\n  long lVar4;\n  long lVar5;\n  iovec local_58;\n  long local_48;\n  long local_40;\n  \n  lVar1 = param_3 + param_5;\n  __fd = FUN_00277370();\n  lVar4 = lVar1;\n  local_48 = param_4;\n  local_40 = param_5;\n  while( true ) {\n    while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_3;\n    if (-1 < lVar5) break;\n    param_2 = (void *)((long)param_2 + sVar2);\n    param_3 = param_3 - sVar2;\n  }\n  lVar5 = FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5);\n  return lVar1 - (lVar4 - lVar5);\n}" (sized_type_specifier "long" long) (function_declarator "FUN_00277470(undefined8 param_1,void *param_2,size_t param_3,long param_4,long param_5)" identifier (parameter_list "(undefined8 param_1,void *param_2,size_t param_3,long param_4,long param_5)" ( (parameter_declaration "undefined8 param_1" type_identifier identifier) , (parameter_declaration "void *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "size_t param_3" primitive_type identifier) , (parameter_declaration "long param_4" (sized_type_specifier "long" long) identifier) , (parameter_declaration "long param_5" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  long lVar1;\n  int __fd;\n  ssize_t sVar2;\n  int *piVar3;\n  long lVar4;\n  long lVar5;\n  iovec local_58;\n  long local_48;\n  long local_40;\n  \n  lVar1 = param_3 + param_5;\n  __fd = FUN_00277370();\n  lVar4 = lVar1;\n  local_48 = param_4;\n  local_40 = param_5;\n  while( true ) {\n    while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_3;\n    if (-1 < lVar5) break;\n    param_2 = (void *)((long)param_2 + sVar2);\n    param_3 = param_3 - sVar2;\n  }\n  lVar5 = FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5);\n  return lVar1 - (lVar4 - lVar5);\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "int __fd;" primitive_type identifier ;) (declaration "ssize_t sVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (declaration "long lVar5;" (sized_type_specifier "long" long) identifier ;) (declaration "iovec local_58;" type_identifier identifier ;) (declaration "long local_48;" (sized_type_specifier "long" long) identifier ;) (declaration "long local_40;" (sized_type_specifier "long" long) identifier ;) (expression_statement "lVar1 = param_3 + param_5;" (assignment_expression "lVar1 = param_3 + param_5" identifier = (binary_expression "param_3 + param_5" identifier + identifier)) ;) (expression_statement "__fd = FUN_00277370();" (assignment_expression "__fd = FUN_00277370()" identifier = (call_expression "FUN_00277370()" identifier (argument_list "()" ( )))) ;) (expression_statement "lVar4 = lVar1;" (assignment_expression "lVar4 = lVar1" identifier = identifier) ;) (expression_statement "local_48 = param_4;" (assignment_expression "local_48 = param_4" identifier = identifier) ;) (expression_statement "local_40 = param_5;" (assignment_expression "local_40 = param_5" identifier = identifier) ;) (while_statement "while( true ) {\n    while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_3;\n    if (-1 < lVar5) break;\n    param_2 = (void *)((long)param_2 + sVar2);\n    param_3 = param_3 - sVar2;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_3;\n    if (-1 < lVar5) break;\n    param_2 = (void *)((long)param_2 + sVar2);\n    param_3 = param_3 - sVar2;\n  }" { (while_statement "while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }" while (parenthesized_expression "(local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1)" ( (comma_expression "local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1" (assignment_expression "local_58.iov_base = param_2" (field_expression "local_58.iov_base" identifier . field_identifier) = identifier) , (comma_expression "local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1" (assignment_expression "local_58.iov_len = param_3" (field_expression "local_58.iov_len" identifier . field_identifier) = identifier) , (comma_expression "sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1" (assignment_expression "sVar2 = writev(__fd,&local_58,2)" identifier = (call_expression "writev(__fd,&local_58,2)" identifier (argument_list "(__fd,&local_58,2)" ( identifier , (pointer_expression "&local_58" & identifier) , number_literal )))) , (binary_expression "sVar2 == -1" identifier == number_literal)))) )) (compound_statement "{\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }" if (parenthesized_expression "(*piVar3 != 4)" ( (binary_expression "*piVar3 != 4" (pointer_expression "*piVar3" * identifier) != number_literal) )) (compound_statement "{\n        return lVar1 - lVar4;\n      }" { (return_statement "return lVar1 - lVar4;" return (binary_expression "lVar1 - lVar4" identifier - identifier) ;) })) })) (expression_statement "lVar4 = lVar4 - sVar2;" (assignment_expression "lVar4 = lVar4 - sVar2" identifier = (binary_expression "lVar4 - sVar2" identifier - identifier)) ;) (if_statement "if (lVar4 == 0) {\n      return lVar1;\n    }" if (parenthesized_expression "(lVar4 == 0)" ( (binary_expression "lVar4 == 0" identifier == number_literal) )) (compound_statement "{\n      return lVar1;\n    }" { (return_statement "return lVar1;" return identifier ;) })) (expression_statement "lVar5 = sVar2 - param_3;" (assignment_expression "lVar5 = sVar2 - param_3" identifier = (binary_expression "sVar2 - param_3" identifier - identifier)) ;) (if_statement "if (-1 < lVar5) break;" if (parenthesized_expression "(-1 < lVar5)" ( (binary_expression "-1 < lVar5" number_literal < identifier) )) (break_statement "break;" break ;)) (expression_statement "param_2 = (void *)((long)param_2 + sVar2);" (assignment_expression "param_2 = (void *)((long)param_2 + sVar2)" identifier = (cast_expression "(void *)((long)param_2 + sVar2)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_2 + sVar2)" ( (binary_expression "(long)param_2 + sVar2" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) ;) (expression_statement "param_3 = param_3 - sVar2;" (assignment_expression "param_3 = param_3 - sVar2" identifier = (binary_expression "param_3 - sVar2" identifier - identifier)) ;) })) (expression_statement "lVar5 = FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5);" (assignment_expression "lVar5 = FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5)" identifier = (call_expression "FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5)" identifier (argument_list "(__fd,lVar5 + param_4,param_5 - lVar5)" ( identifier , (binary_expression "lVar5 + param_4" identifier + identifier) , (binary_expression "param_5 - lVar5" identifier - identifier) )))) ;) (return_statement "return lVar1 - (lVar4 - lVar5);" return (binary_expression "lVar1 - (lVar4 - lVar5)" identifier - (parenthesized_expression "(lVar4 - lVar5)" ( (binary_expression "lVar4 - lVar5" identifier - identifier) ))) ;) })))
(translation_unit "/* std::__basic_file<char>::xsputn_2(char const*, long, char const*, long) */\n\nlong __thiscall\nstd::__basic_file<char>::xsputn_2\n          (__basic_file<char> *this,char *param_1,long param_2,char *param_3,long param_4)\n\n{\n  long lVar1;\n  int __fd;\n  ssize_t sVar2;\n  int *piVar3;\n  long lVar4;\n  long lVar5;\n  iovec local_58;\n  char *local_48;\n  long local_40;\n  \n  lVar1 = param_2 + param_4;\n  __fd = fd(this);\n  lVar4 = lVar1;\n  local_48 = param_3;\n  local_40 = param_4;\n  while( true ) {\n    while (local_58.iov_base = param_1, local_58.iov_len = param_2, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_2;\n    if (-1 < lVar5) break;\n    param_1 = param_1 + sVar2;\n    param_2 = param_2 - sVar2;\n  }\n  lVar5 = ::(anonymous_namespace)::xwrite(__fd,param_3 + lVar5,param_4 - lVar5);\n  return lVar1 - (lVar4 - lVar5);\n}\n\n" comment (function_definition "long __thiscall\nstd::__basic_file<char>::xsputn_2\n          (__basic_file<char> *this,char *param_1,long param_2,char *param_3,long param_4)\n\n{\n  long lVar1;\n  int __fd;\n  ssize_t sVar2;\n  int *piVar3;\n  long lVar4;\n  long lVar5;\n  iovec local_58;\n  char *local_48;\n  long local_40;\n  \n  lVar1 = param_2 + param_4;\n  __fd = fd(this);\n  lVar4 = lVar1;\n  local_48 = param_3;\n  local_40 = param_4;\n  while( true ) {\n    while (local_58.iov_base = param_1, local_58.iov_len = param_2, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_2;\n    if (-1 < lVar5) break;\n    param_1 = param_1 + sVar2;\n    param_2 = param_2 - sVar2;\n  }\n  lVar5 = ::(anonymous_namespace)::xwrite(__fd,param_3 + lVar5,param_4 - lVar5);\n  return lVar1 - (lVar4 - lVar5);\n}" (sized_type_specifier "long" long) (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::__basic_file<char>::" identifier : : identifier < primitive_type > : :) (function_declarator "xsputn_2\n          (__basic_file<char> *this,char *param_1,long param_2,char *param_3,long param_4)" identifier (parameter_list "(__basic_file<char> *this,char *param_1,long param_2,char *param_3,long param_4)" ( (parameter_declaration "__basic_file<char> *this" type_identifier (ERROR "<char>" < primitive_type >) (pointer_declarator "*this" * identifier)) , (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "long param_2" (sized_type_specifier "long" long) identifier) , (parameter_declaration "char *param_3" primitive_type (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "long param_4" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  long lVar1;\n  int __fd;\n  ssize_t sVar2;\n  int *piVar3;\n  long lVar4;\n  long lVar5;\n  iovec local_58;\n  char *local_48;\n  long local_40;\n  \n  lVar1 = param_2 + param_4;\n  __fd = fd(this);\n  lVar4 = lVar1;\n  local_48 = param_3;\n  local_40 = param_4;\n  while( true ) {\n    while (local_58.iov_base = param_1, local_58.iov_len = param_2, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_2;\n    if (-1 < lVar5) break;\n    param_1 = param_1 + sVar2;\n    param_2 = param_2 - sVar2;\n  }\n  lVar5 = ::(anonymous_namespace)::xwrite(__fd,param_3 + lVar5,param_4 - lVar5);\n  return lVar1 - (lVar4 - lVar5);\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "int __fd;" primitive_type identifier ;) (declaration "ssize_t sVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (declaration "long lVar5;" (sized_type_specifier "long" long) identifier ;) (declaration "iovec local_58;" type_identifier identifier ;) (declaration "char *local_48;" primitive_type (pointer_declarator "*local_48" * identifier) ;) (declaration "long local_40;" (sized_type_specifier "long" long) identifier ;) (expression_statement "lVar1 = param_2 + param_4;" (assignment_expression "lVar1 = param_2 + param_4" identifier = (binary_expression "param_2 + param_4" identifier + identifier)) ;) (expression_statement "__fd = fd(this);" (assignment_expression "__fd = fd(this)" identifier = (call_expression "fd(this)" identifier (argument_list "(this)" ( identifier )))) ;) (expression_statement "lVar4 = lVar1;" (assignment_expression "lVar4 = lVar1" identifier = identifier) ;) (expression_statement "local_48 = param_3;" (assignment_expression "local_48 = param_3" identifier = identifier) ;) (expression_statement "local_40 = param_4;" (assignment_expression "local_40 = param_4" identifier = identifier) ;) (while_statement "while( true ) {\n    while (local_58.iov_base = param_1, local_58.iov_len = param_2, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_2;\n    if (-1 < lVar5) break;\n    param_1 = param_1 + sVar2;\n    param_2 = param_2 - sVar2;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    while (local_58.iov_base = param_1, local_58.iov_len = param_2, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_2;\n    if (-1 < lVar5) break;\n    param_1 = param_1 + sVar2;\n    param_2 = param_2 - sVar2;\n  }" { (while_statement "while (local_58.iov_base = param_1, local_58.iov_len = param_2, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }" while (parenthesized_expression "(local_58.iov_base = param_1, local_58.iov_len = param_2, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1)" ( (comma_expression "local_58.iov_base = param_1, local_58.iov_len = param_2, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1" (assignment_expression "local_58.iov_base = param_1" (field_expression "local_58.iov_base" identifier . field_identifier) = identifier) , (comma_expression "local_58.iov_len = param_2, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1" (assignment_expression "local_58.iov_len = param_2" (field_expression "local_58.iov_len" identifier . field_identifier) = identifier) , (comma_expression "sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1" (assignment_expression "sVar2 = writev(__fd,&local_58,2)" identifier = (call_expression "writev(__fd,&local_58,2)" identifier (argument_list "(__fd,&local_58,2)" ( identifier , (pointer_expression "&local_58" & identifier) , number_literal )))) , (binary_expression "sVar2 == -1" identifier == number_literal)))) )) (compound_statement "{\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }" if (parenthesized_expression "(*piVar3 != 4)" ( (binary_expression "*piVar3 != 4" (pointer_expression "*piVar3" * identifier) != number_literal) )) (compound_statement "{\n        return lVar1 - lVar4;\n      }" { (return_statement "return lVar1 - lVar4;" return (binary_expression "lVar1 - lVar4" identifier - identifier) ;) })) })) (expression_statement "lVar4 = lVar4 - sVar2;" (assignment_expression "lVar4 = lVar4 - sVar2" identifier = (binary_expression "lVar4 - sVar2" identifier - identifier)) ;) (if_statement "if (lVar4 == 0) {\n      return lVar1;\n    }" if (parenthesized_expression "(lVar4 == 0)" ( (binary_expression "lVar4 == 0" identifier == number_literal) )) (compound_statement "{\n      return lVar1;\n    }" { (return_statement "return lVar1;" return identifier ;) })) (expression_statement "lVar5 = sVar2 - param_2;" (assignment_expression "lVar5 = sVar2 - param_2" identifier = (binary_expression "sVar2 - param_2" identifier - identifier)) ;) (if_statement "if (-1 < lVar5) break;" if (parenthesized_expression "(-1 < lVar5)" ( (binary_expression "-1 < lVar5" number_literal < identifier) )) (break_statement "break;" break ;)) (expression_statement "param_1 = param_1 + sVar2;" (assignment_expression "param_1 = param_1 + sVar2" identifier = (binary_expression "param_1 + sVar2" identifier + identifier)) ;) (expression_statement "param_2 = param_2 - sVar2;" (assignment_expression "param_2 = param_2 - sVar2" identifier = (binary_expression "param_2 - sVar2" identifier - identifier)) ;) })) (labeled_statement "lVar5 = ::(anonymous_namespace)::xwrite(__fd,param_3 + lVar5,param_4 - lVar5);" statement_identifier (ERROR "= ::(anonymous_namespace):" = : : (parenthesized_expression "(anonymous_namespace)" ( identifier )) :) : (expression_statement "xwrite(__fd,param_3 + lVar5,param_4 - lVar5);" (call_expression "xwrite(__fd,param_3 + lVar5,param_4 - lVar5)" identifier (argument_list "(__fd,param_3 + lVar5,param_4 - lVar5)" ( identifier , (binary_expression "param_3 + lVar5" identifier + identifier) , (binary_expression "param_4 - lVar5" identifier - identifier) ))) ;)) (return_statement "return lVar1 - (lVar4 - lVar5);" return (binary_expression "lVar1 - (lVar4 - lVar5)" identifier - (parenthesized_expression "(lVar4 - lVar5)" ( (binary_expression "lVar4 - lVar5" identifier - identifier) ))) ;) })))
(translation_unit "long FUN_00277470(undefined8 param_1,void *param_2,size_t param_3,long param_4,long param_5)\n\n{\n  long lVar1;\n  int __fd;\n  ssize_t sVar2;\n  int *piVar3;\n  long lVar4;\n  long lVar5;\n  iovec local_58;\n  long local_48;\n  long local_40;\n  \n  lVar1 = param_3 + param_5;\n  __fd = FUN_00277370();\n  lVar4 = lVar1;\n  local_48 = param_4;\n  local_40 = param_5;\n  while( true ) {\n    while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_3;\n    if (-1 < lVar5) break;\n    param_2 = (void *)((long)param_2 + sVar2);\n    param_3 = param_3 - sVar2;\n  }\n  lVar5 = FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5);\n  return lVar1 - (lVar4 - lVar5);\n}\n\n" (function_definition "long FUN_00277470(undefined8 param_1,void *param_2,size_t param_3,long param_4,long param_5)\n\n{\n  long lVar1;\n  int __fd;\n  ssize_t sVar2;\n  int *piVar3;\n  long lVar4;\n  long lVar5;\n  iovec local_58;\n  long local_48;\n  long local_40;\n  \n  lVar1 = param_3 + param_5;\n  __fd = FUN_00277370();\n  lVar4 = lVar1;\n  local_48 = param_4;\n  local_40 = param_5;\n  while( true ) {\n    while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_3;\n    if (-1 < lVar5) break;\n    param_2 = (void *)((long)param_2 + sVar2);\n    param_3 = param_3 - sVar2;\n  }\n  lVar5 = FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5);\n  return lVar1 - (lVar4 - lVar5);\n}" (sized_type_specifier "long" long) (function_declarator "FUN_00277470(undefined8 param_1,void *param_2,size_t param_3,long param_4,long param_5)" identifier (parameter_list "(undefined8 param_1,void *param_2,size_t param_3,long param_4,long param_5)" ( (parameter_declaration "undefined8 param_1" type_identifier identifier) , (parameter_declaration "void *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "size_t param_3" primitive_type identifier) , (parameter_declaration "long param_4" (sized_type_specifier "long" long) identifier) , (parameter_declaration "long param_5" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  long lVar1;\n  int __fd;\n  ssize_t sVar2;\n  int *piVar3;\n  long lVar4;\n  long lVar5;\n  iovec local_58;\n  long local_48;\n  long local_40;\n  \n  lVar1 = param_3 + param_5;\n  __fd = FUN_00277370();\n  lVar4 = lVar1;\n  local_48 = param_4;\n  local_40 = param_5;\n  while( true ) {\n    while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_3;\n    if (-1 < lVar5) break;\n    param_2 = (void *)((long)param_2 + sVar2);\n    param_3 = param_3 - sVar2;\n  }\n  lVar5 = FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5);\n  return lVar1 - (lVar4 - lVar5);\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "int __fd;" primitive_type identifier ;) (declaration "ssize_t sVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (declaration "long lVar5;" (sized_type_specifier "long" long) identifier ;) (declaration "iovec local_58;" type_identifier identifier ;) (declaration "long local_48;" (sized_type_specifier "long" long) identifier ;) (declaration "long local_40;" (sized_type_specifier "long" long) identifier ;) (expression_statement "lVar1 = param_3 + param_5;" (assignment_expression "lVar1 = param_3 + param_5" identifier = (binary_expression "param_3 + param_5" identifier + identifier)) ;) (expression_statement "__fd = FUN_00277370();" (assignment_expression "__fd = FUN_00277370()" identifier = (call_expression "FUN_00277370()" identifier (argument_list "()" ( )))) ;) (expression_statement "lVar4 = lVar1;" (assignment_expression "lVar4 = lVar1" identifier = identifier) ;) (expression_statement "local_48 = param_4;" (assignment_expression "local_48 = param_4" identifier = identifier) ;) (expression_statement "local_40 = param_5;" (assignment_expression "local_40 = param_5" identifier = identifier) ;) (while_statement "while( true ) {\n    while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_3;\n    if (-1 < lVar5) break;\n    param_2 = (void *)((long)param_2 + sVar2);\n    param_3 = param_3 - sVar2;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_3;\n    if (-1 < lVar5) break;\n    param_2 = (void *)((long)param_2 + sVar2);\n    param_3 = param_3 - sVar2;\n  }" { (while_statement "while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }" while (parenthesized_expression "(local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1)" ( (comma_expression "local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1" (assignment_expression "local_58.iov_base = param_2" (field_expression "local_58.iov_base" identifier . field_identifier) = identifier) , (comma_expression "local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1" (assignment_expression "local_58.iov_len = param_3" (field_expression "local_58.iov_len" identifier . field_identifier) = identifier) , (comma_expression "sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1" (assignment_expression "sVar2 = writev(__fd,&local_58,2)" identifier = (call_expression "writev(__fd,&local_58,2)" identifier (argument_list "(__fd,&local_58,2)" ( identifier , (pointer_expression "&local_58" & identifier) , number_literal )))) , (binary_expression "sVar2 == -1" identifier == number_literal)))) )) (compound_statement "{\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }" { (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }" if (parenthesized_expression "(*piVar3 != 4)" ( (binary_expression "*piVar3 != 4" (pointer_expression "*piVar3" * identifier) != number_literal) )) (compound_statement "{\n        return lVar1 - lVar4;\n      }" { (return_statement "return lVar1 - lVar4;" return (binary_expression "lVar1 - lVar4" identifier - identifier) ;) })) })) (expression_statement "lVar4 = lVar4 - sVar2;" (assignment_expression "lVar4 = lVar4 - sVar2" identifier = (binary_expression "lVar4 - sVar2" identifier - identifier)) ;) (if_statement "if (lVar4 == 0) {\n      return lVar1;\n    }" if (parenthesized_expression "(lVar4 == 0)" ( (binary_expression "lVar4 == 0" identifier == number_literal) )) (compound_statement "{\n      return lVar1;\n    }" { (return_statement "return lVar1;" return identifier ;) })) (expression_statement "lVar5 = sVar2 - param_3;" (assignment_expression "lVar5 = sVar2 - param_3" identifier = (binary_expression "sVar2 - param_3" identifier - identifier)) ;) (if_statement "if (-1 < lVar5) break;" if (parenthesized_expression "(-1 < lVar5)" ( (binary_expression "-1 < lVar5" number_literal < identifier) )) (break_statement "break;" break ;)) (expression_statement "param_2 = (void *)((long)param_2 + sVar2);" (assignment_expression "param_2 = (void *)((long)param_2 + sVar2)" identifier = (cast_expression "(void *)((long)param_2 + sVar2)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_2 + sVar2)" ( (binary_expression "(long)param_2 + sVar2" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) ;) (expression_statement "param_3 = param_3 - sVar2;" (assignment_expression "param_3 = param_3 - sVar2" identifier = (binary_expression "param_3 - sVar2" identifier - identifier)) ;) })) (expression_statement "lVar5 = FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5);" (assignment_expression "lVar5 = FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5)" identifier = (call_expression "FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5)" identifier (argument_list "(__fd,lVar5 + param_4,param_5 - lVar5)" ( identifier , (binary_expression "lVar5 + param_4" identifier + identifier) , (binary_expression "param_5 - lVar5" identifier - identifier) )))) ;) (return_statement "return lVar1 - (lVar4 - lVar5);" return (binary_expression "lVar1 - (lVar4 - lVar5)" identifier - (parenthesized_expression "(lVar4 - lVar5)" ( (binary_expression "lVar4 - lVar5" identifier - identifier) ))) ;) })))
(translation_unit (function_definition (sized_type_specifier long) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (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 IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (while_statement while (parenthesized_expression ( (comma_expression (assignment_expression (field_expression IDENT . field_identifier) = IDENT) , (comma_expression (assignment_expression (field_expression IDENT . field_identifier) = IDENT) , (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (pointer_expression & IDENT) , LIT )))) , (binary_expression IDENT == LIT)))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) (compound_statement { (return_statement return (binary_expression IDENT - IDENT) ;) })) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (binary_expression IDENT + IDENT) , (binary_expression IDENT - IDENT) )))) ;) (return_statement return (binary_expression IDENT - (parenthesized_expression ( (binary_expression IDENT - IDENT) ))) ;) })))
(function_definition "long FUN_00277470(undefined8 param_1,void *param_2,size_t param_3,long param_4,long param_5)\n\n{\n  long lVar1;\n  int __fd;\n  ssize_t sVar2;\n  int *piVar3;\n  long lVar4;\n  long lVar5;\n  iovec local_58;\n  long local_48;\n  long local_40;\n  \n  lVar1 = param_3 + param_5;\n  __fd = FUN_00277370();\n  lVar4 = lVar1;\n  local_48 = param_4;\n  local_40 = param_5;\n  while( true ) {\n    while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_3;\n    if (-1 < lVar5) break;\n    param_2 = (void *)((long)param_2 + sVar2);\n    param_3 = param_3 - sVar2;\n  }\n  lVar5 = FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5);\n  return lVar1 - (lVar4 - lVar5);\n}" (sized_type_specifier "long" (long "long")) (function_declarator "FUN_00277470(undefined8 param_1,void *param_2,size_t param_3,long param_4,long param_5)" (identifier "FUN_00277470") (parameter_list "(undefined8 param_1,void *param_2,size_t param_3,long param_4,long param_5)" (( "(") (parameter_declaration "undefined8 param_1" (type_identifier "undefined8") (identifier "param_1")) (, ",") (parameter_declaration "void *param_2" (primitive_type "void") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "size_t param_3" (primitive_type "size_t") (identifier "param_3")) (, ",") (parameter_declaration "long param_4" (sized_type_specifier "long" (long "long")) (identifier "param_4")) (, ",") (parameter_declaration "long param_5" (sized_type_specifier "long" (long "long")) (identifier "param_5")) () ")"))) (compound_statement "{\n  long lVar1;\n  int __fd;\n  ssize_t sVar2;\n  int *piVar3;\n  long lVar4;\n  long lVar5;\n  iovec local_58;\n  long local_48;\n  long local_40;\n  \n  lVar1 = param_3 + param_5;\n  __fd = FUN_00277370();\n  lVar4 = lVar1;\n  local_48 = param_4;\n  local_40 = param_5;\n  while( true ) {\n    while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_3;\n    if (-1 < lVar5) break;\n    param_2 = (void *)((long)param_2 + sVar2);\n    param_3 = param_3 - sVar2;\n  }\n  lVar5 = FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5);\n  return lVar1 - (lVar4 - lVar5);\n}" ({ "{") (declaration "long lVar1;" (sized_type_specifier "long" (long "long")) (identifier "lVar1") (; ";")) (declaration "int __fd;" (primitive_type "int") (identifier "__fd") (; ";")) (declaration "ssize_t sVar2;" (primitive_type "ssize_t") (identifier "sVar2") (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (declaration "long lVar4;" (sized_type_specifier "long" (long "long")) (identifier "lVar4") (; ";")) (declaration "long lVar5;" (sized_type_specifier "long" (long "long")) (identifier "lVar5") (; ";")) (declaration "iovec local_58;" (type_identifier "iovec") (identifier "local_58") (; ";")) (declaration "long local_48;" (sized_type_specifier "long" (long "long")) (identifier "local_48") (; ";")) (declaration "long local_40;" (sized_type_specifier "long" (long "long")) (identifier "local_40") (; ";")) (expression_statement "lVar1 = param_3 + param_5;" (assignment_expression "lVar1 = param_3 + param_5" (identifier "lVar1") (= "=") (binary_expression "param_3 + param_5" (identifier "param_3") (+ "+") (identifier "param_5"))) (; ";")) (expression_statement "__fd = FUN_00277370();" (assignment_expression "__fd = FUN_00277370()" (identifier "__fd") (= "=") (call_expression "FUN_00277370()" (identifier "FUN_00277370") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "lVar4 = lVar1;" (assignment_expression "lVar4 = lVar1" (identifier "lVar4") (= "=") (identifier "lVar1")) (; ";")) (expression_statement "local_48 = param_4;" (assignment_expression "local_48 = param_4" (identifier "local_48") (= "=") (identifier "param_4")) (; ";")) (expression_statement "local_40 = param_5;" (assignment_expression "local_40 = param_5" (identifier "local_40") (= "=") (identifier "param_5")) (; ";")) (while_statement "while( true ) {\n    while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_3;\n    if (-1 < lVar5) break;\n    param_2 = (void *)((long)param_2 + sVar2);\n    param_3 = param_3 - sVar2;\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }\n    lVar4 = lVar4 - sVar2;\n    if (lVar4 == 0) {\n      return lVar1;\n    }\n    lVar5 = sVar2 - param_3;\n    if (-1 < lVar5) break;\n    param_2 = (void *)((long)param_2 + sVar2);\n    param_3 = param_3 - sVar2;\n  }" ({ "{") (while_statement "while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1) {\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }" (while "while") (parenthesized_expression "(local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1)" (( "(") (comma_expression "local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1" (assignment_expression "local_58.iov_base = param_2" (field_expression "local_58.iov_base" (identifier "local_58") (. ".") (field_identifier "iov_base")) (= "=") (identifier "param_2")) (, ",") (comma_expression "local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1" (assignment_expression "local_58.iov_len = param_3" (field_expression "local_58.iov_len" (identifier "local_58") (. ".") (field_identifier "iov_len")) (= "=") (identifier "param_3")) (, ",") (comma_expression "sVar2 = writev(__fd,&local_58,2)\n          , sVar2 == -1" (assignment_expression "sVar2 = writev(__fd,&local_58,2)" (identifier "sVar2") (= "=") (call_expression "writev(__fd,&local_58,2)" (identifier "writev") (argument_list "(__fd,&local_58,2)" (( "(") (identifier "__fd") (, ",") (pointer_expression "&local_58" (& "&") (identifier "local_58")) (, ",") (number_literal "2") () ")")))) (, ",") (binary_expression "sVar2 == -1" (identifier "sVar2") (== "==") (number_literal "-1"))))) () ")")) (compound_statement "{\n      piVar3 = __errno_location();\n      if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }\n    }" ({ "{") (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" (identifier "piVar3") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (*piVar3 != 4) {\n        return lVar1 - lVar4;\n      }" (if "if") (parenthesized_expression "(*piVar3 != 4)" (( "(") (binary_expression "*piVar3 != 4" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (!= "!=") (number_literal "4")) () ")")) (compound_statement "{\n        return lVar1 - lVar4;\n      }" ({ "{") (return_statement "return lVar1 - lVar4;" (return "return") (binary_expression "lVar1 - lVar4" (identifier "lVar1") (- "-") (identifier "lVar4")) (; ";")) (} "}"))) (} "}"))) (expression_statement "lVar4 = lVar4 - sVar2;" (assignment_expression "lVar4 = lVar4 - sVar2" (identifier "lVar4") (= "=") (binary_expression "lVar4 - sVar2" (identifier "lVar4") (- "-") (identifier "sVar2"))) (; ";")) (if_statement "if (lVar4 == 0) {\n      return lVar1;\n    }" (if "if") (parenthesized_expression "(lVar4 == 0)" (( "(") (binary_expression "lVar4 == 0" (identifier "lVar4") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      return lVar1;\n    }" ({ "{") (return_statement "return lVar1;" (return "return") (identifier "lVar1") (; ";")) (} "}"))) (expression_statement "lVar5 = sVar2 - param_3;" (assignment_expression "lVar5 = sVar2 - param_3" (identifier "lVar5") (= "=") (binary_expression "sVar2 - param_3" (identifier "sVar2") (- "-") (identifier "param_3"))) (; ";")) (if_statement "if (-1 < lVar5) break;" (if "if") (parenthesized_expression "(-1 < lVar5)" (( "(") (binary_expression "-1 < lVar5" (number_literal "-1") (< "<") (identifier "lVar5")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "param_2 = (void *)((long)param_2 + sVar2);" (assignment_expression "param_2 = (void *)((long)param_2 + sVar2)" (identifier "param_2") (= "=") (cast_expression "(void *)((long)param_2 + sVar2)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)param_2 + sVar2)" (( "(") (binary_expression "(long)param_2 + sVar2" (cast_expression "(long)param_2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_2")) (+ "+") (identifier "sVar2")) () ")")))) (; ";")) (expression_statement "param_3 = param_3 - sVar2;" (assignment_expression "param_3 = param_3 - sVar2" (identifier "param_3") (= "=") (binary_expression "param_3 - sVar2" (identifier "param_3") (- "-") (identifier "sVar2"))) (; ";")) (} "}"))) (expression_statement "lVar5 = FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5);" (assignment_expression "lVar5 = FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5)" (identifier "lVar5") (= "=") (call_expression "FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5)" (identifier "FUN_002771a0") (argument_list "(__fd,lVar5 + param_4,param_5 - lVar5)" (( "(") (identifier "__fd") (, ",") (binary_expression "lVar5 + param_4" (identifier "lVar5") (+ "+") (identifier "param_4")) (, ",") (binary_expression "param_5 - lVar5" (identifier "param_5") (- "-") (identifier "lVar5")) () ")")))) (; ";")) (return_statement "return lVar1 - (lVar4 - lVar5);" (return "return") (binary_expression "lVar1 - (lVar4 - lVar5)" (identifier "lVar1") (- "-") (parenthesized_expression "(lVar4 - lVar5)" (( "(") (binary_expression "lVar4 - lVar5" (identifier "lVar4") (- "-") (identifier "lVar5")) () ")"))) (; ";")) (} "}")))

/* std::__basic_file<char>::xsputn_2(char const*, long, char const*, long) */

long __thiscall
std::type_1<char>::function_1
          (type_1<char> *this,char *var_10,long var_1,char *var_12,long var_2)

{
  long var_7;
  int __fd;
  ssize_t var_5;
  int *piVar3;
  long var_8;
  long var_9;
  type_2 local_58;
  char *local_48;
  long local_40;
  
  var_7 = var_1 + var_2;
  __fd = var_3(this);
  var_8 = var_7;
  local_48 = var_12;
  local_40 = var_2;
  while( true ) {
    while (local_58.iov_base = var_10, local_58.iov_len = var_1, var_5 = var_4(__fd,&local_58,2)
          , var_5 == -1) {
      piVar3 = var_6();
      if (*piVar3 != 4) {
        return var_7 - var_8;
      }
    }
    var_8 = var_8 - var_5;
    if (var_8 == 0) {
      return var_7;
    }
    var_9 = var_5 - var_1;
    if (-1 < var_9) break;
    var_10 = var_10 + var_5;
    var_1 = var_1 - var_5;
  }
  lVar5 = ::(anonymous_namespace)::var_11(__fd,var_12 + var_9,var_2 - var_9);
  return var_7 - (var_8 - var_9);
}


(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: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) 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: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (while_statement condition: (parenthesized_expression (true)) body: (compound_statement (while_statement condition: (parenthesized_expression (comma_expression left: (assignment_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (identifier)) right: (comma_expression left: (assignment_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (identifier)) right: (comma_expression left: (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (pointer_expression argument: (identifier)) (number_literal)))) right: (binary_expression left: (identifier) right: (number_literal)))))) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) consequence: (compound_statement (return_statement (binary_expression left: (identifier) right: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (break_statement)) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier)) (binary_expression left: (identifier) right: (identifier)))))) (return_statement (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))))

long MASKED(undefined8 param_1,void *param_2,size_t param_3,long param_4,long param_5)

{
  long lVar1;
  int __fd;
  ssize_t sVar2;
  int *piVar3;
  long lVar4;
  long lVar5;
  iovec local_58;
  long local_48;
  long local_40;
  
  lVar1 = param_3 + param_5;
  __fd = FUN_00277370();
  lVar4 = lVar1;
  local_48 = param_4;
  local_40 = param_5;
  while( true ) {
    while (local_58.iov_base = param_2, local_58.iov_len = param_3, sVar2 = writev(__fd,&local_58,2)
          , sVar2 == -1) {
      piVar3 = __errno_location();
      if (*piVar3 != 4) {
        return lVar1 - lVar4;
      }
    }
    lVar4 = lVar4 - sVar2;
    if (lVar4 == 0) {
      return lVar1;
    }
    lVar5 = sVar2 - param_3;
    if (-1 < lVar5) break;
    param_2 = (void *)((long)param_2 + sVar2);
    param_3 = param_3 - sVar2;
  }
  lVar5 = FUN_002771a0(__fd,lVar5 + param_4,param_5 - lVar5);
  return lVar1 - (lVar4 - lVar5);
}

