
/* stdio_sync_filebuf<wchar_t, std::char_traits<wchar_t> >::xsputn(wchar_t const*, long) */

long __thiscall
stdio_sync_filebuf<wchar_t,std::char_traits<wchar_t>>::xsputn
          (stdio_sync_filebuf<wchar_t,std::char_traits<wchar_t>> *this,wchar_t *param_1,long param_2
          )

{
  wint_t wVar1;
  long lVar2;
  
  if (param_2 == 0) {
    lVar2 = 0;
  }
  else {
    lVar2 = 0;
    do {
      wVar1 = putwc(param_1[lVar2],*(__FILE **)(this + 0x40));
      if (wVar1 == 0xffffffff) {
        return lVar2;
      }
      lVar2 = lVar2 + 1;
    } while (param_2 != lVar2);
  }
  return lVar2;
}



long FUN_00323270(long param_1,long param_2,long param_3)

{
  wint_t wVar1;
  long lVar2;
  
  if (param_3 == 0) {
    lVar2 = 0;
  }
  else {
    lVar2 = 0;
    do {
      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));
      if (wVar1 == 0xffffffff) {
        return lVar2;
      }
      lVar2 = lVar2 + 1;
    } while (param_3 != lVar2);
  }
  return lVar2;
}


PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x8
TEST RDX,RDX
JZ 0x003232bb
MOV RBP,RDX
MOV R13,RSI
MOV R12,RDI
XOR EBX,EBX
JMP 0x00323299
ADD RBX,0x1
CMP RBP,RBX
JZ 0x003232ad
MOV RSI,qword ptr [R12 + 0x40]
MOV EDI,dword ptr [R13 + RBX*0x4]
CALL 0x00149690
CMP EAX,-0x1
JNZ 0x00323290
ADD RSP,0x8
MOV RAX,RBX
POP RBX
POP RBP
POP R12
POP R13
RET
XOR EBX,EBX
JMP 0x003232ad
(translation_unit "long FUN_00323270(long param_1,long param_2,long param_3)\n\n{\n  wint_t wVar1;\n  long lVar2;\n  \n  if (param_3 == 0) {\n    lVar2 = 0;\n  }\n  else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }\n  return lVar2;\n}\n\n" (function_definition "long FUN_00323270(long param_1,long param_2,long param_3)\n\n{\n  wint_t wVar1;\n  long lVar2;\n  \n  if (param_3 == 0) {\n    lVar2 = 0;\n  }\n  else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }\n  return lVar2;\n}" (sized_type_specifier "long" long) (function_declarator "FUN_00323270(long param_1,long param_2,long param_3)" identifier (parameter_list "(long param_1,long param_2,long param_3)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) 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  wint_t wVar1;\n  long lVar2;\n  \n  if (param_3 == 0) {\n    lVar2 = 0;\n  }\n  else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }\n  return lVar2;\n}" { (declaration "wint_t wVar1;" type_identifier identifier ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (if_statement "if (param_3 == 0) {\n    lVar2 = 0;\n  }\n  else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n    lVar2 = 0;\n  }" { (expression_statement "lVar2 = 0;" (assignment_expression "lVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }" else (compound_statement "{\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }" { (expression_statement "lVar2 = 0;" (assignment_expression "lVar2 = 0" identifier = number_literal) ;) (do_statement "do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);" do (compound_statement "{\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    }" { (expression_statement "wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));" (assignment_expression "wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40))" identifier = (call_expression "putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40))" identifier (argument_list "(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40))" ( (pointer_expression "*(wchar_t *)(param_2 + lVar2 * 4)" * (cast_expression "(wchar_t *)(param_2 + lVar2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + lVar2 * 4)" ( (binary_expression "param_2 + lVar2 * 4" identifier + (binary_expression "lVar2 * 4" identifier * number_literal)) )))) , (pointer_expression "*(__FILE **)(param_1 + 0x40)" * (cast_expression "(__FILE **)(param_1 + 0x40)" ( (type_descriptor "__FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x40)" ( (binary_expression "param_1 + 0x40" identifier + number_literal) )))) )))) ;) (if_statement "if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }" if (parenthesized_expression "(wVar1 == 0xffffffff)" ( (binary_expression "wVar1 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n        return lVar2;\n      }" { (return_statement "return lVar2;" return identifier ;) })) (expression_statement "lVar2 = lVar2 + 1;" (assignment_expression "lVar2 = lVar2 + 1" identifier = (binary_expression "lVar2 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(param_3 != lVar2)" ( (binary_expression "param_3 != lVar2" identifier != identifier) )) ;) }))) (return_statement "return lVar2;" return identifier ;) })))
(translation_unit "/* stdio_sync_filebuf<wchar_t, std::char_traits<wchar_t> >::xsputn(wchar_t const*, long) */\n\nlong __thiscall\nstdio_sync_filebuf<wchar_t,std::char_traits<wchar_t>>::xsputn\n          (stdio_sync_filebuf<wchar_t,std::char_traits<wchar_t>> *this,wchar_t *param_1,long param_2\n          )\n\n{\n  wint_t wVar1;\n  long lVar2;\n  \n  if (param_2 == 0) {\n    lVar2 = 0;\n  }\n  else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(param_1[lVar2],*(__FILE **)(this + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_2 != lVar2);\n  }\n  return lVar2;\n}\n\n" comment (declaration "long __thiscall\nstdio_sync_filebuf<wchar_t,std::char_traits<wchar_t>>::xsputn\n          (stdio_sync_filebuf<wchar_t,std::char_traits<wchar_t>> *this,wchar_t *param_1,long param_2\n          )\n\n{\n  wint_t wVar1;" (sized_type_specifier "long" long) (ms_call_modifier "__thiscall" __thiscall) identifier (ERROR "<wchar_t" < identifier) , (ERROR "std::char_traits<wchar_t>>::xsputn\n          (stdio_sync_filebuf<wchar_t,std::char_traits<wchar_t>> *this,wchar_t *param_1,long param_2\n          )\n\n{\n  wint_t" identifier : : identifier < identifier >> : : (function_declarator "xsputn\n          (stdio_sync_filebuf<wchar_t,std::char_traits<wchar_t>> *this,wchar_t *param_1,long param_2\n          )" identifier (parameter_list "(stdio_sync_filebuf<wchar_t,std::char_traits<wchar_t>> *this,wchar_t *param_1,long param_2\n          )" ( (parameter_declaration "stdio_sync_filebuf<wchar_t" type_identifier (ERROR "<" <) identifier) , (parameter_declaration "std::char_traits<wchar_t>> *this" type_identifier (ERROR "::char_traits<wchar_t>>" : : identifier < identifier >>) (pointer_declarator "*this" * identifier)) , (parameter_declaration "wchar_t *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "long param_2" (sized_type_specifier "long" long) identifier) ))) { identifier) identifier ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (if_statement "if (param_2 == 0) {\n    lVar2 = 0;\n  }\n  else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(param_1[lVar2],*(__FILE **)(this + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_2 != lVar2);\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    lVar2 = 0;\n  }" { (expression_statement "lVar2 = 0;" (assignment_expression "lVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(param_1[lVar2],*(__FILE **)(this + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_2 != lVar2);\n  }" else (compound_statement "{\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(param_1[lVar2],*(__FILE **)(this + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_2 != lVar2);\n  }" { (expression_statement "lVar2 = 0;" (assignment_expression "lVar2 = 0" identifier = number_literal) ;) (do_statement "do {\n      wVar1 = putwc(param_1[lVar2],*(__FILE **)(this + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_2 != lVar2);" do (compound_statement "{\n      wVar1 = putwc(param_1[lVar2],*(__FILE **)(this + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    }" { (expression_statement "wVar1 = putwc(param_1[lVar2],*(__FILE **)(this + 0x40));" (assignment_expression "wVar1 = putwc(param_1[lVar2],*(__FILE **)(this + 0x40))" identifier = (call_expression "putwc(param_1[lVar2],*(__FILE **)(this + 0x40))" identifier (argument_list "(param_1[lVar2],*(__FILE **)(this + 0x40))" ( (subscript_expression "param_1[lVar2]" identifier [ identifier ]) , (pointer_expression "*(__FILE **)(this + 0x40)" * (cast_expression "(__FILE **)(this + 0x40)" ( (type_descriptor "__FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x40)" ( (binary_expression "this + 0x40" identifier + number_literal) )))) )))) ;) (if_statement "if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }" if (parenthesized_expression "(wVar1 == 0xffffffff)" ( (binary_expression "wVar1 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n        return lVar2;\n      }" { (return_statement "return lVar2;" return identifier ;) })) (expression_statement "lVar2 = lVar2 + 1;" (assignment_expression "lVar2 = lVar2 + 1" identifier = (binary_expression "lVar2 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(param_2 != lVar2)" ( (binary_expression "param_2 != lVar2" identifier != identifier) )) ;) }))) (return_statement "return lVar2;" return identifier ;) (ERROR "}" }))
(translation_unit "long FUN_00323270(long param_1,long param_2,long param_3)\n\n{\n  wint_t wVar1;\n  long lVar2;\n  \n  if (param_3 == 0) {\n    lVar2 = 0;\n  }\n  else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }\n  return lVar2;\n}\n\n" (function_definition "long FUN_00323270(long param_1,long param_2,long param_3)\n\n{\n  wint_t wVar1;\n  long lVar2;\n  \n  if (param_3 == 0) {\n    lVar2 = 0;\n  }\n  else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }\n  return lVar2;\n}" (sized_type_specifier "long" long) (function_declarator "FUN_00323270(long param_1,long param_2,long param_3)" identifier (parameter_list "(long param_1,long param_2,long param_3)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) 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  wint_t wVar1;\n  long lVar2;\n  \n  if (param_3 == 0) {\n    lVar2 = 0;\n  }\n  else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }\n  return lVar2;\n}" { (declaration "wint_t wVar1;" type_identifier identifier ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (if_statement "if (param_3 == 0) {\n    lVar2 = 0;\n  }\n  else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n    lVar2 = 0;\n  }" { (expression_statement "lVar2 = 0;" (assignment_expression "lVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }" else (compound_statement "{\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }" { (expression_statement "lVar2 = 0;" (assignment_expression "lVar2 = 0" identifier = number_literal) ;) (do_statement "do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);" do (compound_statement "{\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    }" { (expression_statement "wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));" (assignment_expression "wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40))" identifier = (call_expression "putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40))" identifier (argument_list "(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40))" ( (pointer_expression "*(wchar_t *)(param_2 + lVar2 * 4)" * (cast_expression "(wchar_t *)(param_2 + lVar2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + lVar2 * 4)" ( (binary_expression "param_2 + lVar2 * 4" identifier + (binary_expression "lVar2 * 4" identifier * number_literal)) )))) , (pointer_expression "*(__FILE **)(param_1 + 0x40)" * (cast_expression "(__FILE **)(param_1 + 0x40)" ( (type_descriptor "__FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x40)" ( (binary_expression "param_1 + 0x40" identifier + number_literal) )))) )))) ;) (if_statement "if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }" if (parenthesized_expression "(wVar1 == 0xffffffff)" ( (binary_expression "wVar1 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n        return lVar2;\n      }" { (return_statement "return lVar2;" return identifier ;) })) (expression_statement "lVar2 = lVar2 + 1;" (assignment_expression "lVar2 = lVar2 + 1" identifier = (binary_expression "lVar2 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(param_3 != lVar2)" ( (binary_expression "param_3 != lVar2" identifier != identifier) )) ;) }))) (return_statement "return lVar2;" return identifier ;) })))
(translation_unit (function_definition (sized_type_specifier long) (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) ))) (compound_statement { (declaration TYPE 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 ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != IDENT) )) ;) }))) (return_statement return IDENT ;) })))
(function_definition "long FUN_00323270(long param_1,long param_2,long param_3)\n\n{\n  wint_t wVar1;\n  long lVar2;\n  \n  if (param_3 == 0) {\n    lVar2 = 0;\n  }\n  else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }\n  return lVar2;\n}" (sized_type_specifier "long" (long "long")) (function_declarator "FUN_00323270(long param_1,long param_2,long param_3)" (identifier "FUN_00323270") (parameter_list "(long param_1,long param_2,long param_3)" (( "(") (parameter_declaration "long param_1" (sized_type_specifier "long" (long "long")) (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  wint_t wVar1;\n  long lVar2;\n  \n  if (param_3 == 0) {\n    lVar2 = 0;\n  }\n  else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }\n  return lVar2;\n}" ({ "{") (declaration "wint_t wVar1;" (type_identifier "wint_t") (identifier "wVar1") (; ";")) (declaration "long lVar2;" (sized_type_specifier "long" (long "long")) (identifier "lVar2") (; ";")) (if_statement "if (param_3 == 0) {\n    lVar2 = 0;\n  }\n  else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }" (if "if") (parenthesized_expression "(param_3 == 0)" (( "(") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    lVar2 = 0;\n  }" ({ "{") (expression_statement "lVar2 = 0;" (assignment_expression "lVar2 = 0" (identifier "lVar2") (= "=") (number_literal "0")) (; ";")) (} "}")) (else_clause "else {\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }" (else "else") (compound_statement "{\n    lVar2 = 0;\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);\n  }" ({ "{") (expression_statement "lVar2 = 0;" (assignment_expression "lVar2 = 0" (identifier "lVar2") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    } while (param_3 != lVar2);" (do "do") (compound_statement "{\n      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));\n      if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }\n      lVar2 = lVar2 + 1;\n    }" ({ "{") (expression_statement "wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));" (assignment_expression "wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40))" (identifier "wVar1") (= "=") (call_expression "putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40))" (identifier "putwc") (argument_list "(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40))" (( "(") (pointer_expression "*(wchar_t *)(param_2 + lVar2 * 4)" (* "*") (cast_expression "(wchar_t *)(param_2 + lVar2 * 4)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_2 + lVar2 * 4)" (( "(") (binary_expression "param_2 + lVar2 * 4" (identifier "param_2") (+ "+") (binary_expression "lVar2 * 4" (identifier "lVar2") (* "*") (number_literal "4"))) () ")")))) (, ",") (pointer_expression "*(__FILE **)(param_1 + 0x40)" (* "*") (cast_expression "(__FILE **)(param_1 + 0x40)" (( "(") (type_descriptor "__FILE **" (type_identifier "__FILE") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x40)" (( "(") (binary_expression "param_1 + 0x40" (identifier "param_1") (+ "+") (number_literal "0x40")) () ")")))) () ")")))) (; ";")) (if_statement "if (wVar1 == 0xffffffff) {\n        return lVar2;\n      }" (if "if") (parenthesized_expression "(wVar1 == 0xffffffff)" (( "(") (binary_expression "wVar1 == 0xffffffff" (identifier "wVar1") (== "==") (number_literal "0xffffffff")) () ")")) (compound_statement "{\n        return lVar2;\n      }" ({ "{") (return_statement "return lVar2;" (return "return") (identifier "lVar2") (; ";")) (} "}"))) (expression_statement "lVar2 = lVar2 + 1;" (assignment_expression "lVar2 = lVar2 + 1" (identifier "lVar2") (= "=") (binary_expression "lVar2 + 1" (identifier "lVar2") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(param_3 != lVar2)" (( "(") (binary_expression "param_3 != lVar2" (identifier "param_3") (!= "!=") (identifier "lVar2")) () ")")) (; ";")) (} "}")))) (return_statement "return lVar2;" (return "return") (identifier "lVar2") (; ";")) (} "}")))

/* stdio_sync_filebuf<wchar_t, std::char_traits<wchar_t> >::xsputn(wchar_t const*, long) */

long __thiscall
stdio_sync_filebuf<wchar_t,std::char_traits<wchar_t>>::xsputn
          (stdio_sync_filebuf<wchar_t,std::char_traits<wchar_t>> *var_3,wchar_t *param_1,long var_1
          )

{
  wint_t var_4;
  long var_5;
  
  if (var_1 == 0) {
    var_5 = 0;
  }
  else {
    var_5 = 0;
    do {
      var_4 = var_2(param_1[var_5],*(type_1 **)(var_3 + 0x40));
      if (var_4 == 0xffffffff) {
        return var_5;
      }
      var_5 = var_5 + 1;
    } while (var_1 != var_5);
  }
  return var_5;
}


(translation_unit (function_definition type: (sized_type_specifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (sized_type_specifier) declarator: (identifier)) (parameter_declaration type: (sized_type_specifier) declarator: (identifier)) (parameter_declaration type: (sized_type_specifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) 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 (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))))) (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))))) (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: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))) (return_statement (identifier)))))

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

{
  wint_t wVar1;
  long lVar2;
  
  if (param_3 == 0) {
    lVar2 = 0;
  }
  else {
    lVar2 = 0;
    do {
      wVar1 = putwc(*(wchar_t *)(param_2 + lVar2 * 4),*(__FILE **)(param_1 + 0x40));
      if (wVar1 == 0xffffffff) {
        return lVar2;
      }
      lVar2 = lVar2 + 1;
    } while (param_3 != lVar2);
  }
  return lVar2;
}

