
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* stdio_sync_filebuf<wchar_t, std::char_traits<wchar_t> >::xsputn(wchar_t const*, int) */

int __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,int param_2)

{
  wint_t wVar1;
  int iVar2;
  
  iVar2 = 0;
  if (param_2 != 0) {
    do {
      wVar1 = putwc(param_1[iVar2],*(__FILE **)(this + 0x20));
      if (wVar1 == 0xffffffff) {
        return iVar2;
      }
      iVar2 = iVar2 + 1;
    } while (param_2 != iVar2);
  }
  return iVar2;
}



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

int FUN_0021ca20(int param_1,int param_2,int param_3)

{
  wint_t wVar1;
  int iVar2;
  
  iVar2 = 0;
  if (param_3 != 0) {
    do {
      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));
      if (wVar1 == 0xffffffff) {
        return iVar2;
      }
      iVar2 = iVar2 + 1;
    } while (param_3 != iVar2);
  }
  return iVar2;
}


PUSH EBP
PUSH EDI
PUSH ESI
XOR ESI,ESI
PUSH EBX
CALL 0x00035840
ADD EBX,0x1725d5
SUB ESP,0xc
MOV EAX,dword ptr [ESP + 0x28]
MOV EDI,dword ptr [ESP + 0x20]
MOV EBP,dword ptr [ESP + 0x24]
TEST EAX,EAX
JNZ 0x0021ca59
JMP 0x0021ca70
ADD ESI,0x1
CMP dword ptr [ESP + 0x28],ESI
JZ 0x0021ca70
SUB ESP,0x8
PUSH dword ptr [EDI + 0x20]
PUSH dword ptr [EBP + ESI*0x4]
CALL 0x000291f0
ADD ESP,0x10
CMP EAX,-0x1
JNZ 0x0021ca50
ADD ESP,0xc
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint FUN_0021ca20(int param_1,int param_2,int param_3)\n\n{\n  wint_t wVar1;\n  int iVar2;\n  \n  iVar2 = 0;\n  if (param_3 != 0) {\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);\n  }\n  return iVar2;\n}\n\n" comment (function_definition "int FUN_0021ca20(int param_1,int param_2,int param_3)\n\n{\n  wint_t wVar1;\n  int iVar2;\n  \n  iVar2 = 0;\n  if (param_3 != 0) {\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);\n  }\n  return iVar2;\n}" primitive_type (function_declarator "FUN_0021ca20(int param_1,int param_2,int param_3)" identifier (parameter_list "(int param_1,int param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  wint_t wVar1;\n  int iVar2;\n  \n  iVar2 = 0;\n  if (param_3 != 0) {\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);\n  }\n  return iVar2;\n}" { (declaration "wint_t wVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (if_statement "if (param_3 != 0) {\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);\n  }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);\n  }" { (do_statement "do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);" do (compound_statement "{\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    }" { (expression_statement "wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));" (assignment_expression "wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20))" identifier = (call_expression "putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20))" identifier (argument_list "(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20))" ( (pointer_expression "*(wchar_t *)(param_2 + iVar2 * 4)" * (cast_expression "(wchar_t *)(param_2 + iVar2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + iVar2 * 4)" ( (binary_expression "param_2 + iVar2 * 4" identifier + (binary_expression "iVar2 * 4" identifier * number_literal)) )))) , (pointer_expression "*(__FILE **)(param_1 + 0x20)" * (cast_expression "(__FILE **)(param_1 + 0x20)" ( (type_descriptor "__FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) )))) )))) ;) (if_statement "if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }" if (parenthesized_expression "(wVar1 == 0xffffffff)" ( (binary_expression "wVar1 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n        return iVar2;\n      }" { (return_statement "return iVar2;" return identifier ;) })) (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(param_3 != iVar2)" ( (binary_expression "param_3 != iVar2" identifier != identifier) )) ;) })) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* stdio_sync_filebuf<wchar_t, std::char_traits<wchar_t> >::xsputn(wchar_t const*, int) */\n\nint __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,int param_2)\n\n{\n  wint_t wVar1;\n  int iVar2;\n  \n  iVar2 = 0;\n  if (param_2 != 0) {\n    do {\n      wVar1 = putwc(param_1[iVar2],*(__FILE **)(this + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_2 != iVar2);\n  }\n  return iVar2;\n}\n\n" comment comment (declaration "int __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,int param_2)\n\n{\n  wint_t wVar1;" primitive_type (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,int param_2)\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,int param_2)" identifier (parameter_list "(stdio_sync_filebuf<wchar_t,std::char_traits<wchar_t>> *this,wchar_t *param_1,int param_2)" ( (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 "int param_2" primitive_type identifier) ))) { identifier) identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (if_statement "if (param_2 != 0) {\n    do {\n      wVar1 = putwc(param_1[iVar2],*(__FILE **)(this + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_2 != iVar2);\n  }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n    do {\n      wVar1 = putwc(param_1[iVar2],*(__FILE **)(this + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_2 != iVar2);\n  }" { (do_statement "do {\n      wVar1 = putwc(param_1[iVar2],*(__FILE **)(this + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_2 != iVar2);" do (compound_statement "{\n      wVar1 = putwc(param_1[iVar2],*(__FILE **)(this + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    }" { (expression_statement "wVar1 = putwc(param_1[iVar2],*(__FILE **)(this + 0x20));" (assignment_expression "wVar1 = putwc(param_1[iVar2],*(__FILE **)(this + 0x20))" identifier = (call_expression "putwc(param_1[iVar2],*(__FILE **)(this + 0x20))" identifier (argument_list "(param_1[iVar2],*(__FILE **)(this + 0x20))" ( (subscript_expression "param_1[iVar2]" identifier [ identifier ]) , (pointer_expression "*(__FILE **)(this + 0x20)" * (cast_expression "(__FILE **)(this + 0x20)" ( (type_descriptor "__FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x20)" ( (binary_expression "this + 0x20" identifier + number_literal) )))) )))) ;) (if_statement "if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }" if (parenthesized_expression "(wVar1 == 0xffffffff)" ( (binary_expression "wVar1 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n        return iVar2;\n      }" { (return_statement "return iVar2;" return identifier ;) })) (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(param_2 != iVar2)" ( (binary_expression "param_2 != iVar2" identifier != identifier) )) ;) })) (return_statement "return iVar2;" return identifier ;) (ERROR "}" }))
(translation_unit "int FUN_0021ca20(int param_1,int param_2,int param_3)\n\n{\n  wint_t wVar1;\n  int iVar2;\n  \n  iVar2 = 0;\n  if (param_3 != 0) {\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);\n  }\n  return iVar2;\n}\n\n" (function_definition "int FUN_0021ca20(int param_1,int param_2,int param_3)\n\n{\n  wint_t wVar1;\n  int iVar2;\n  \n  iVar2 = 0;\n  if (param_3 != 0) {\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);\n  }\n  return iVar2;\n}" primitive_type (function_declarator "FUN_0021ca20(int param_1,int param_2,int param_3)" identifier (parameter_list "(int param_1,int param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  wint_t wVar1;\n  int iVar2;\n  \n  iVar2 = 0;\n  if (param_3 != 0) {\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);\n  }\n  return iVar2;\n}" { (declaration "wint_t wVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (if_statement "if (param_3 != 0) {\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);\n  }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);\n  }" { (do_statement "do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);" do (compound_statement "{\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    }" { (expression_statement "wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));" (assignment_expression "wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20))" identifier = (call_expression "putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20))" identifier (argument_list "(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20))" ( (pointer_expression "*(wchar_t *)(param_2 + iVar2 * 4)" * (cast_expression "(wchar_t *)(param_2 + iVar2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + iVar2 * 4)" ( (binary_expression "param_2 + iVar2 * 4" identifier + (binary_expression "iVar2 * 4" identifier * number_literal)) )))) , (pointer_expression "*(__FILE **)(param_1 + 0x20)" * (cast_expression "(__FILE **)(param_1 + 0x20)" ( (type_descriptor "__FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) )))) )))) ;) (if_statement "if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }" if (parenthesized_expression "(wVar1 == 0xffffffff)" ( (binary_expression "wVar1 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n        return iVar2;\n      }" { (return_statement "return iVar2;" return identifier ;) })) (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(param_3 != iVar2)" ( (binary_expression "param_3 != iVar2" identifier != identifier) )) ;) })) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (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 "int FUN_0021ca20(int param_1,int param_2,int param_3)\n\n{\n  wint_t wVar1;\n  int iVar2;\n  \n  iVar2 = 0;\n  if (param_3 != 0) {\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);\n  }\n  return iVar2;\n}" (primitive_type "int") (function_declarator "FUN_0021ca20(int param_1,int param_2,int param_3)" (identifier "FUN_0021ca20") (parameter_list "(int param_1,int param_2,int param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  wint_t wVar1;\n  int iVar2;\n  \n  iVar2 = 0;\n  if (param_3 != 0) {\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);\n  }\n  return iVar2;\n}" ({ "{") (declaration "wint_t wVar1;" (type_identifier "wint_t") (identifier "wVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" (identifier "iVar2") (= "=") (number_literal "0")) (; ";")) (if_statement "if (param_3 != 0) {\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);\n  }" (if "if") (parenthesized_expression "(param_3 != 0)" (( "(") (binary_expression "param_3 != 0" (identifier "param_3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);\n  }" ({ "{") (do_statement "do {\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    } while (param_3 != iVar2);" (do "do") (compound_statement "{\n      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));\n      if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }\n      iVar2 = iVar2 + 1;\n    }" ({ "{") (expression_statement "wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));" (assignment_expression "wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20))" (identifier "wVar1") (= "=") (call_expression "putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20))" (identifier "putwc") (argument_list "(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20))" (( "(") (pointer_expression "*(wchar_t *)(param_2 + iVar2 * 4)" (* "*") (cast_expression "(wchar_t *)(param_2 + iVar2 * 4)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_2 + iVar2 * 4)" (( "(") (binary_expression "param_2 + iVar2 * 4" (identifier "param_2") (+ "+") (binary_expression "iVar2 * 4" (identifier "iVar2") (* "*") (number_literal "4"))) () ")")))) (, ",") (pointer_expression "*(__FILE **)(param_1 + 0x20)" (* "*") (cast_expression "(__FILE **)(param_1 + 0x20)" (( "(") (type_descriptor "__FILE **" (type_identifier "__FILE") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x20)" (( "(") (binary_expression "param_1 + 0x20" (identifier "param_1") (+ "+") (number_literal "0x20")) () ")")))) () ")")))) (; ";")) (if_statement "if (wVar1 == 0xffffffff) {\n        return iVar2;\n      }" (if "if") (parenthesized_expression "(wVar1 == 0xffffffff)" (( "(") (binary_expression "wVar1 == 0xffffffff" (identifier "wVar1") (== "==") (number_literal "0xffffffff")) () ")")) (compound_statement "{\n        return iVar2;\n      }" ({ "{") (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" (identifier "iVar2") (= "=") (binary_expression "iVar2 + 1" (identifier "iVar2") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(param_3 != iVar2)" (( "(") (binary_expression "param_3 != iVar2" (identifier "param_3") (!= "!=") (identifier "iVar2")) () ")")) (; ";")) (} "}"))) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* stdio_sync_filebuf<wchar_t, std::char_traits<wchar_t> >::xsputn(wchar_t const*, int) */

int __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,int var_1)

{
  wint_t var_4;
  int var_5;
  
  var_5 = 0;
  if (var_1 != 0) {
    do {
      var_4 = var_2(param_1[var_5],*(type_1 **)(var_3 + 0x20));
      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: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (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)))))

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

int MASKED(int param_1,int param_2,int param_3)

{
  wint_t wVar1;
  int iVar2;
  
  iVar2 = 0;
  if (param_3 != 0) {
    do {
      wVar1 = putwc(*(wchar_t *)(param_2 + iVar2 * 4),*(__FILE **)(param_1 + 0x20));
      if (wVar1 == 0xffffffff) {
        return iVar2;
      }
      iVar2 = iVar2 + 1;
    } while (param_3 != iVar2);
  }
  return iVar2;
}

