
/* std::wstreambuf::xsgetn(wchar_t*, int) */

int __thiscall std::wstreambuf::xsgetn(wstreambuf *this,wchar_t *param_1,int param_2)

{
  undefined *puVar1;
  undefined *puVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  code *pcVar7;
  
  puVar2 = PTR_uflow_00435ec4;
  puVar1 = PTR_underflow_00435eb8;
  if (param_2 < 1) {
    return 0;
  }
  iVar6 = 0;
  do {
    iVar5 = *(int *)(this + 8);
    if (*(int *)(this + 0xc) != iVar5) {
      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;
      iVar4 = param_2 - iVar6;
      if (iVar3 <= param_2 - iVar6) {
        iVar4 = iVar3;
      }
      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);
      iVar6 = iVar6 + iVar4;
      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;
      if (param_2 <= iVar6) {
        return iVar6;
      }
      param_1 = param_1 + iVar4 * 2;
    }
    pcVar7 = *(code **)(*(int *)this + 0x28);
    if (pcVar7 == (code *)puVar2) {
      pcVar7 = *(code **)(*(int *)this + 0x24);
      if (pcVar7 == (code *)puVar1) {
        return iVar6;
      }
      iVar5 = (*pcVar7)(this);
      if (iVar5 == -1) {
        return iVar6;
      }
      iVar5 = **(int **)(this + 8);
      *(int **)(this + 8) = *(int **)(this + 8) + 1;
    }
    else {
      iVar5 = (*pcVar7)(this);
    }
    if (iVar5 == -1) {
      return iVar6;
    }
    iVar6 = iVar6 + 1;
    *(int *)param_1 = iVar5;
    param_1 = param_1 + 2;
  } while (iVar6 < param_2);
  return iVar6;
}



/* std::wstreambuf::xsgetn(wchar_t*, int) */

int __thiscall std::wstreambuf::xsgetn(wstreambuf *this,wchar_t *param_1,int param_2)

{
  undefined *puVar1;
  undefined *puVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  code *pcVar7;
  
  puVar2 = PTR_uflow_00435ec4;
  puVar1 = PTR_underflow_00435eb8;
  if (param_2 < 1) {
    return 0;
  }
  iVar6 = 0;
  do {
    iVar5 = *(int *)(this + 8);
    if (*(int *)(this + 0xc) != iVar5) {
      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;
      iVar4 = param_2 - iVar6;
      if (iVar3 <= param_2 - iVar6) {
        iVar4 = iVar3;
      }
      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);
      iVar6 = iVar6 + iVar4;
      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;
      if (param_2 <= iVar6) {
        return iVar6;
      }
      param_1 = param_1 + iVar4 * 2;
    }
    pcVar7 = *(code **)(*(int *)this + 0x28);
    if (pcVar7 == (code *)puVar2) {
      pcVar7 = *(code **)(*(int *)this + 0x24);
      if (pcVar7 == (code *)puVar1) {
        return iVar6;
      }
      iVar5 = (*pcVar7)(this);
      if (iVar5 == -1) {
        return iVar6;
      }
      iVar5 = **(int **)(this + 8);
      *(int **)(this + 8) = *(int **)(this + 8) + 1;
    }
    else {
      iVar5 = (*pcVar7)(this);
    }
    if (iVar5 == -1) {
      return iVar6;
    }
    iVar6 = iVar6 + 1;
    *(int *)param_1 = iVar5;
    param_1 = param_1 + 2;
  } while (iVar6 < param_2);
  return iVar6;
}


lui gp,0x17
addiu gp,gp,0x6318
addu gp,gp,t9
addiu sp,sp,-0x40
sw gp,0x10(sp)
sw ra,0x3c(sp)
sw s7,0x38(sp)
sw s6,0x34(sp)
sw s5,0x30(sp)
sw s4,0x2c(sp)
sw s3,0x28(sp)
sw s2,0x24(sp)
sw s1,0x20(sp)
blez a2,0x002c4004
_sw s0,0x1c(sp)
lw s4,-0x430c(gp)
or s0,zero,zero
lw s5,-0x4318(gp)
li s3,-0x1
or s7,a2,zero
or s1,a0,zero
or s2,a1,zero
lw v0,0xc(s1)
lw a1,0x8(s1)
beq v0,a1,0x002c3f94
_subu v0,v0,a1
lw t9,-0x39a4(gp)
subu v1,s7,s0
sra v0,v0,0x2
or a0,s2,zero
slt s6,v1,v0
movz v1,v0,s6
or a2,v1,zero
jalr t9
_or s6,v1,zero
lw v0,0x8(s1)
sll v1,s6,0x2
addu s0,s0,s6
addu v0,v0,v1
slt a0,s0,s7
bne a0,zero,0x002c3f90
_sw v0,0x8(s1)
lw ra,0x3c(sp)
or v0,s0,zero
lw s7,0x38(sp)
lw s6,0x34(sp)
lw s5,0x30(sp)
lw s4,0x2c(sp)
lw s3,0x28(sp)
lw s2,0x24(sp)
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x40
addu s2,s2,v1
lw v0,0x0(s1)
lw t9,0x28(v0)
bne t9,s4,0x002c3ff4
_nop
lw t9,0x24(v0)
beq t9,s5,0x002c3f64
_lw ra,0x3c(sp)
jalr t9
_or a0,s1,zero
beq v0,s3,0x002c3f60
_lw gp,0x10(sp)
lw v0,0x8(s1)
addiu v1,v0,0x4
lw v0,0x0(v0)
sw v1,0x8(s1)
beq v0,s3,0x002c3f64
_lw ra,0x3c(sp)
addiu s0,s0,0x1
sw v0,0x0(s2)
slt v0,s0,s7
bne v0,zero,0x002c3f10
_addiu s2,s2,0x4
b 0x002c3f64
_lw ra,0x3c(sp)
jalr t9
_or a0,s1,zero
b 0x002c3fd0
_lw gp,0x10(sp)
b 0x002c3f60
_or s0,zero,zero
(translation_unit "/* std::wstreambuf::xsgetn(wchar_t*, int) */\n\nint __thiscall std::wstreambuf::xsgetn(wstreambuf *this,wchar_t *param_1,int param_2)\n\n{\n  undefined *puVar1;\n  undefined *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  code *pcVar7;\n  \n  puVar2 = PTR_uflow_00435ec4;\n  puVar1 = PTR_underflow_00435eb8;\n  if (param_2 < 1) {\n    return 0;\n  }\n  iVar6 = 0;\n  do {\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  } while (iVar6 < param_2);\n  return iVar6;\n}\n\n" comment (function_definition "int __thiscall std::wstreambuf::xsgetn(wstreambuf *this,wchar_t *param_1,int param_2)\n\n{\n  undefined *puVar1;\n  undefined *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  code *pcVar7;\n  \n  puVar2 = PTR_uflow_00435ec4;\n  puVar1 = PTR_underflow_00435eb8;\n  if (param_2 < 1) {\n    return 0;\n  }\n  iVar6 = 0;\n  do {\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  } while (iVar6 < param_2);\n  return iVar6;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstreambuf::" identifier : : identifier : :) (function_declarator "xsgetn(wstreambuf *this,wchar_t *param_1,int param_2)" identifier (parameter_list "(wstreambuf *this,wchar_t *param_1,int param_2)" ( (parameter_declaration "wstreambuf *this" type_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) ))) (compound_statement "{\n  undefined *puVar1;\n  undefined *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  code *pcVar7;\n  \n  puVar2 = PTR_uflow_00435ec4;\n  puVar1 = PTR_underflow_00435eb8;\n  if (param_2 < 1) {\n    return 0;\n  }\n  iVar6 = 0;\n  do {\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  } while (iVar6 < param_2);\n  return iVar6;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "undefined *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "code *pcVar7;" type_identifier (pointer_declarator "*pcVar7" * identifier) ;) (expression_statement "puVar2 = PTR_uflow_00435ec4;" (assignment_expression "puVar2 = PTR_uflow_00435ec4" identifier = identifier) ;) (expression_statement "puVar1 = PTR_underflow_00435eb8;" (assignment_expression "puVar1 = PTR_underflow_00435eb8" identifier = identifier) ;) (if_statement "if (param_2 < 1) {\n    return 0;\n  }" if (parenthesized_expression "(param_2 < 1)" ( (binary_expression "param_2 < 1" identifier < number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) (do_statement "do {\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  } while (iVar6 < param_2);" do (compound_statement "{\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  }" { (expression_statement "iVar5 = *(int *)(this + 8);" (assignment_expression "iVar5 = *(int *)(this + 8)" identifier = (pointer_expression "*(int *)(this + 8)" * (cast_expression "(int *)(this + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) ))))) ;) (if_statement "if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }" if (parenthesized_expression "(*(int *)(this + 0xc) != iVar5)" ( (binary_expression "*(int *)(this + 0xc) != iVar5" (pointer_expression "*(int *)(this + 0xc)" * (cast_expression "(int *)(this + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0xc)" ( (binary_expression "this + 0xc" identifier + number_literal) )))) != identifier) )) (compound_statement "{\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }" { (expression_statement "iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;" (assignment_expression "iVar3 = *(int *)(this + 0xc) - iVar5 >> 2" identifier = (binary_expression "*(int *)(this + 0xc) - iVar5 >> 2" (binary_expression "*(int *)(this + 0xc) - iVar5" (pointer_expression "*(int *)(this + 0xc)" * (cast_expression "(int *)(this + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0xc)" ( (binary_expression "this + 0xc" identifier + number_literal) )))) - identifier) >> number_literal)) ;) (expression_statement "iVar4 = param_2 - iVar6;" (assignment_expression "iVar4 = param_2 - iVar6" identifier = (binary_expression "param_2 - iVar6" identifier - identifier)) ;) (if_statement "if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }" if (parenthesized_expression "(iVar3 <= param_2 - iVar6)" ( (binary_expression "iVar3 <= param_2 - iVar6" identifier <= (binary_expression "param_2 - iVar6" identifier - identifier)) )) (compound_statement "{\n        iVar4 = iVar3;\n      }" { (expression_statement "iVar4 = iVar3;" (assignment_expression "iVar4 = iVar3" identifier = identifier) ;) })) (expression_statement "(*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);" (call_expression "(*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4)" (parenthesized_expression "(*(code *)PTR_wmemcpy_0043682c)" ( (pointer_expression "*(code *)PTR_wmemcpy_0043682c" * (cast_expression "(code *)PTR_wmemcpy_0043682c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,iVar5,iVar4)" ( identifier , identifier , identifier ))) ;) (expression_statement "iVar6 = iVar6 + iVar4;" (assignment_expression "iVar6 = iVar6 + iVar4" identifier = (binary_expression "iVar6 + iVar4" identifier + identifier)) ;) (expression_statement "*(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;" (assignment_expression "*(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4" (pointer_expression "*(int *)(this + 8)" * (cast_expression "(int *)(this + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = (binary_expression "*(int *)(this + 8) + iVar4 * 4" (pointer_expression "*(int *)(this + 8)" * (cast_expression "(int *)(this + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) + (binary_expression "iVar4 * 4" identifier * number_literal))) ;) (if_statement "if (param_2 <= iVar6) {\n        return iVar6;\n      }" if (parenthesized_expression "(param_2 <= iVar6)" ( (binary_expression "param_2 <= iVar6" identifier <= identifier) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "param_1 = param_1 + iVar4 * 2;" (assignment_expression "param_1 = param_1 + iVar4 * 2" identifier = (binary_expression "param_1 + iVar4 * 2" identifier + (binary_expression "iVar4 * 2" identifier * number_literal))) ;) })) (expression_statement "pcVar7 = *(code **)(*(int *)this + 0x28);" (assignment_expression "pcVar7 = *(code **)(*(int *)this + 0x28)" identifier = (pointer_expression "*(code **)(*(int *)this + 0x28)" * (cast_expression "(code **)(*(int *)this + 0x28)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)this + 0x28)" ( (binary_expression "*(int *)this + 0x28" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ;) (if_statement "if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }" if (parenthesized_expression "(pcVar7 == (code *)puVar2)" ( (binary_expression "pcVar7 == (code *)puVar2" identifier == (cast_expression "(code *)puVar2" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }" { (expression_statement "pcVar7 = *(code **)(*(int *)this + 0x24);" (assignment_expression "pcVar7 = *(code **)(*(int *)this + 0x24)" identifier = (pointer_expression "*(code **)(*(int *)this + 0x24)" * (cast_expression "(code **)(*(int *)this + 0x24)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)this + 0x24)" ( (binary_expression "*(int *)this + 0x24" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ;) (if_statement "if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }" if (parenthesized_expression "(pcVar7 == (code *)puVar1)" ( (binary_expression "pcVar7 == (code *)puVar1" identifier == (cast_expression "(code *)puVar1" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "iVar5 = (*pcVar7)(this);" (assignment_expression "iVar5 = (*pcVar7)(this)" identifier = (call_expression "(*pcVar7)(this)" (parenthesized_expression "(*pcVar7)" ( (pointer_expression "*pcVar7" * identifier) )) (argument_list "(this)" ( identifier )))) ;) (if_statement "if (iVar5 == -1) {\n        return iVar6;\n      }" if (parenthesized_expression "(iVar5 == -1)" ( (binary_expression "iVar5 == -1" identifier == number_literal) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "iVar5 = **(int **)(this + 8);" (assignment_expression "iVar5 = **(int **)(this + 8)" identifier = (pointer_expression "**(int **)(this + 8)" * (pointer_expression "*(int **)(this + 8)" * (cast_expression "(int **)(this + 8)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))))) ;) (expression_statement "*(int **)(this + 8) = *(int **)(this + 8) + 1;" (assignment_expression "*(int **)(this + 8) = *(int **)(this + 8) + 1" (pointer_expression "*(int **)(this + 8)" * (cast_expression "(int **)(this + 8)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = (binary_expression "*(int **)(this + 8) + 1" (pointer_expression "*(int **)(this + 8)" * (cast_expression "(int **)(this + 8)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) + number_literal)) ;) }) (else_clause "else {\n      iVar5 = (*pcVar7)(this);\n    }" else (compound_statement "{\n      iVar5 = (*pcVar7)(this);\n    }" { (expression_statement "iVar5 = (*pcVar7)(this);" (assignment_expression "iVar5 = (*pcVar7)(this)" identifier = (call_expression "(*pcVar7)(this)" (parenthesized_expression "(*pcVar7)" ( (pointer_expression "*pcVar7" * identifier) )) (argument_list "(this)" ( identifier )))) ;) }))) (if_statement "if (iVar5 == -1) {\n      return iVar6;\n    }" if (parenthesized_expression "(iVar5 == -1)" ( (binary_expression "iVar5 == -1" identifier == number_literal) )) (compound_statement "{\n      return iVar6;\n    }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" identifier = (binary_expression "iVar6 + 1" identifier + number_literal)) ;) (expression_statement "*(int *)param_1 = iVar5;" (assignment_expression "*(int *)param_1 = iVar5" (pointer_expression "*(int *)param_1" * (cast_expression "(int *)param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) = identifier) ;) (expression_statement "param_1 = param_1 + 2;" (assignment_expression "param_1 = param_1 + 2" identifier = (binary_expression "param_1 + 2" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar6 < param_2)" ( (binary_expression "iVar6 < param_2" identifier < identifier) )) ;) (return_statement "return iVar6;" return identifier ;) })))
(translation_unit "/* std::wstreambuf::xsgetn(wchar_t*, int) */\n\nint __thiscall std::wstreambuf::xsgetn(wstreambuf *this,wchar_t *param_1,int param_2)\n\n{\n  undefined *puVar1;\n  undefined *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  code *pcVar7;\n  \n  puVar2 = PTR_uflow_00435ec4;\n  puVar1 = PTR_underflow_00435eb8;\n  if (param_2 < 1) {\n    return 0;\n  }\n  iVar6 = 0;\n  do {\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  } while (iVar6 < param_2);\n  return iVar6;\n}\n\n" comment (function_definition "int __thiscall std::wstreambuf::xsgetn(wstreambuf *this,wchar_t *param_1,int param_2)\n\n{\n  undefined *puVar1;\n  undefined *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  code *pcVar7;\n  \n  puVar2 = PTR_uflow_00435ec4;\n  puVar1 = PTR_underflow_00435eb8;\n  if (param_2 < 1) {\n    return 0;\n  }\n  iVar6 = 0;\n  do {\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  } while (iVar6 < param_2);\n  return iVar6;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstreambuf::" identifier : : identifier : :) (function_declarator "xsgetn(wstreambuf *this,wchar_t *param_1,int param_2)" identifier (parameter_list "(wstreambuf *this,wchar_t *param_1,int param_2)" ( (parameter_declaration "wstreambuf *this" type_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) ))) (compound_statement "{\n  undefined *puVar1;\n  undefined *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  code *pcVar7;\n  \n  puVar2 = PTR_uflow_00435ec4;\n  puVar1 = PTR_underflow_00435eb8;\n  if (param_2 < 1) {\n    return 0;\n  }\n  iVar6 = 0;\n  do {\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  } while (iVar6 < param_2);\n  return iVar6;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "undefined *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "code *pcVar7;" type_identifier (pointer_declarator "*pcVar7" * identifier) ;) (expression_statement "puVar2 = PTR_uflow_00435ec4;" (assignment_expression "puVar2 = PTR_uflow_00435ec4" identifier = identifier) ;) (expression_statement "puVar1 = PTR_underflow_00435eb8;" (assignment_expression "puVar1 = PTR_underflow_00435eb8" identifier = identifier) ;) (if_statement "if (param_2 < 1) {\n    return 0;\n  }" if (parenthesized_expression "(param_2 < 1)" ( (binary_expression "param_2 < 1" identifier < number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) (do_statement "do {\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  } while (iVar6 < param_2);" do (compound_statement "{\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  }" { (expression_statement "iVar5 = *(int *)(this + 8);" (assignment_expression "iVar5 = *(int *)(this + 8)" identifier = (pointer_expression "*(int *)(this + 8)" * (cast_expression "(int *)(this + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) ))))) ;) (if_statement "if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }" if (parenthesized_expression "(*(int *)(this + 0xc) != iVar5)" ( (binary_expression "*(int *)(this + 0xc) != iVar5" (pointer_expression "*(int *)(this + 0xc)" * (cast_expression "(int *)(this + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0xc)" ( (binary_expression "this + 0xc" identifier + number_literal) )))) != identifier) )) (compound_statement "{\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }" { (expression_statement "iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;" (assignment_expression "iVar3 = *(int *)(this + 0xc) - iVar5 >> 2" identifier = (binary_expression "*(int *)(this + 0xc) - iVar5 >> 2" (binary_expression "*(int *)(this + 0xc) - iVar5" (pointer_expression "*(int *)(this + 0xc)" * (cast_expression "(int *)(this + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0xc)" ( (binary_expression "this + 0xc" identifier + number_literal) )))) - identifier) >> number_literal)) ;) (expression_statement "iVar4 = param_2 - iVar6;" (assignment_expression "iVar4 = param_2 - iVar6" identifier = (binary_expression "param_2 - iVar6" identifier - identifier)) ;) (if_statement "if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }" if (parenthesized_expression "(iVar3 <= param_2 - iVar6)" ( (binary_expression "iVar3 <= param_2 - iVar6" identifier <= (binary_expression "param_2 - iVar6" identifier - identifier)) )) (compound_statement "{\n        iVar4 = iVar3;\n      }" { (expression_statement "iVar4 = iVar3;" (assignment_expression "iVar4 = iVar3" identifier = identifier) ;) })) (expression_statement "(*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);" (call_expression "(*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4)" (parenthesized_expression "(*(code *)PTR_wmemcpy_0043682c)" ( (pointer_expression "*(code *)PTR_wmemcpy_0043682c" * (cast_expression "(code *)PTR_wmemcpy_0043682c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,iVar5,iVar4)" ( identifier , identifier , identifier ))) ;) (expression_statement "iVar6 = iVar6 + iVar4;" (assignment_expression "iVar6 = iVar6 + iVar4" identifier = (binary_expression "iVar6 + iVar4" identifier + identifier)) ;) (expression_statement "*(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;" (assignment_expression "*(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4" (pointer_expression "*(int *)(this + 8)" * (cast_expression "(int *)(this + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = (binary_expression "*(int *)(this + 8) + iVar4 * 4" (pointer_expression "*(int *)(this + 8)" * (cast_expression "(int *)(this + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) + (binary_expression "iVar4 * 4" identifier * number_literal))) ;) (if_statement "if (param_2 <= iVar6) {\n        return iVar6;\n      }" if (parenthesized_expression "(param_2 <= iVar6)" ( (binary_expression "param_2 <= iVar6" identifier <= identifier) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "param_1 = param_1 + iVar4 * 2;" (assignment_expression "param_1 = param_1 + iVar4 * 2" identifier = (binary_expression "param_1 + iVar4 * 2" identifier + (binary_expression "iVar4 * 2" identifier * number_literal))) ;) })) (expression_statement "pcVar7 = *(code **)(*(int *)this + 0x28);" (assignment_expression "pcVar7 = *(code **)(*(int *)this + 0x28)" identifier = (pointer_expression "*(code **)(*(int *)this + 0x28)" * (cast_expression "(code **)(*(int *)this + 0x28)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)this + 0x28)" ( (binary_expression "*(int *)this + 0x28" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ;) (if_statement "if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }" if (parenthesized_expression "(pcVar7 == (code *)puVar2)" ( (binary_expression "pcVar7 == (code *)puVar2" identifier == (cast_expression "(code *)puVar2" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }" { (expression_statement "pcVar7 = *(code **)(*(int *)this + 0x24);" (assignment_expression "pcVar7 = *(code **)(*(int *)this + 0x24)" identifier = (pointer_expression "*(code **)(*(int *)this + 0x24)" * (cast_expression "(code **)(*(int *)this + 0x24)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)this + 0x24)" ( (binary_expression "*(int *)this + 0x24" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ;) (if_statement "if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }" if (parenthesized_expression "(pcVar7 == (code *)puVar1)" ( (binary_expression "pcVar7 == (code *)puVar1" identifier == (cast_expression "(code *)puVar1" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "iVar5 = (*pcVar7)(this);" (assignment_expression "iVar5 = (*pcVar7)(this)" identifier = (call_expression "(*pcVar7)(this)" (parenthesized_expression "(*pcVar7)" ( (pointer_expression "*pcVar7" * identifier) )) (argument_list "(this)" ( identifier )))) ;) (if_statement "if (iVar5 == -1) {\n        return iVar6;\n      }" if (parenthesized_expression "(iVar5 == -1)" ( (binary_expression "iVar5 == -1" identifier == number_literal) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "iVar5 = **(int **)(this + 8);" (assignment_expression "iVar5 = **(int **)(this + 8)" identifier = (pointer_expression "**(int **)(this + 8)" * (pointer_expression "*(int **)(this + 8)" * (cast_expression "(int **)(this + 8)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))))) ;) (expression_statement "*(int **)(this + 8) = *(int **)(this + 8) + 1;" (assignment_expression "*(int **)(this + 8) = *(int **)(this + 8) + 1" (pointer_expression "*(int **)(this + 8)" * (cast_expression "(int **)(this + 8)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = (binary_expression "*(int **)(this + 8) + 1" (pointer_expression "*(int **)(this + 8)" * (cast_expression "(int **)(this + 8)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) + number_literal)) ;) }) (else_clause "else {\n      iVar5 = (*pcVar7)(this);\n    }" else (compound_statement "{\n      iVar5 = (*pcVar7)(this);\n    }" { (expression_statement "iVar5 = (*pcVar7)(this);" (assignment_expression "iVar5 = (*pcVar7)(this)" identifier = (call_expression "(*pcVar7)(this)" (parenthesized_expression "(*pcVar7)" ( (pointer_expression "*pcVar7" * identifier) )) (argument_list "(this)" ( identifier )))) ;) }))) (if_statement "if (iVar5 == -1) {\n      return iVar6;\n    }" if (parenthesized_expression "(iVar5 == -1)" ( (binary_expression "iVar5 == -1" identifier == number_literal) )) (compound_statement "{\n      return iVar6;\n    }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" identifier = (binary_expression "iVar6 + 1" identifier + number_literal)) ;) (expression_statement "*(int *)param_1 = iVar5;" (assignment_expression "*(int *)param_1 = iVar5" (pointer_expression "*(int *)param_1" * (cast_expression "(int *)param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) = identifier) ;) (expression_statement "param_1 = param_1 + 2;" (assignment_expression "param_1 = param_1 + 2" identifier = (binary_expression "param_1 + 2" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar6 < param_2)" ( (binary_expression "iVar6 < param_2" identifier < identifier) )) ;) (return_statement "return iVar6;" return identifier ;) })))
(translation_unit "int __thiscall std::wstreambuf::xsgetn(wstreambuf *this,wchar_t *param_1,int param_2)\n\n{\n  undefined *puVar1;\n  undefined *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  code *pcVar7;\n  \n  puVar2 = PTR_uflow_00435ec4;\n  puVar1 = PTR_underflow_00435eb8;\n  if (param_2 < 1) {\n    return 0;\n  }\n  iVar6 = 0;\n  do {\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  } while (iVar6 < param_2);\n  return iVar6;\n}\n\n" (function_definition "int __thiscall std::wstreambuf::xsgetn(wstreambuf *this,wchar_t *param_1,int param_2)\n\n{\n  undefined *puVar1;\n  undefined *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  code *pcVar7;\n  \n  puVar2 = PTR_uflow_00435ec4;\n  puVar1 = PTR_underflow_00435eb8;\n  if (param_2 < 1) {\n    return 0;\n  }\n  iVar6 = 0;\n  do {\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  } while (iVar6 < param_2);\n  return iVar6;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstreambuf::" identifier : : identifier : :) (function_declarator "xsgetn(wstreambuf *this,wchar_t *param_1,int param_2)" identifier (parameter_list "(wstreambuf *this,wchar_t *param_1,int param_2)" ( (parameter_declaration "wstreambuf *this" type_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) ))) (compound_statement "{\n  undefined *puVar1;\n  undefined *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  code *pcVar7;\n  \n  puVar2 = PTR_uflow_00435ec4;\n  puVar1 = PTR_underflow_00435eb8;\n  if (param_2 < 1) {\n    return 0;\n  }\n  iVar6 = 0;\n  do {\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  } while (iVar6 < param_2);\n  return iVar6;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "undefined *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "code *pcVar7;" type_identifier (pointer_declarator "*pcVar7" * identifier) ;) (expression_statement "puVar2 = PTR_uflow_00435ec4;" (assignment_expression "puVar2 = PTR_uflow_00435ec4" identifier = identifier) ;) (expression_statement "puVar1 = PTR_underflow_00435eb8;" (assignment_expression "puVar1 = PTR_underflow_00435eb8" identifier = identifier) ;) (if_statement "if (param_2 < 1) {\n    return 0;\n  }" if (parenthesized_expression "(param_2 < 1)" ( (binary_expression "param_2 < 1" identifier < number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) (do_statement "do {\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  } while (iVar6 < param_2);" do (compound_statement "{\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  }" { (expression_statement "iVar5 = *(int *)(this + 8);" (assignment_expression "iVar5 = *(int *)(this + 8)" identifier = (pointer_expression "*(int *)(this + 8)" * (cast_expression "(int *)(this + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) ))))) ;) (if_statement "if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }" if (parenthesized_expression "(*(int *)(this + 0xc) != iVar5)" ( (binary_expression "*(int *)(this + 0xc) != iVar5" (pointer_expression "*(int *)(this + 0xc)" * (cast_expression "(int *)(this + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0xc)" ( (binary_expression "this + 0xc" identifier + number_literal) )))) != identifier) )) (compound_statement "{\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }" { (expression_statement "iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;" (assignment_expression "iVar3 = *(int *)(this + 0xc) - iVar5 >> 2" identifier = (binary_expression "*(int *)(this + 0xc) - iVar5 >> 2" (binary_expression "*(int *)(this + 0xc) - iVar5" (pointer_expression "*(int *)(this + 0xc)" * (cast_expression "(int *)(this + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0xc)" ( (binary_expression "this + 0xc" identifier + number_literal) )))) - identifier) >> number_literal)) ;) (expression_statement "iVar4 = param_2 - iVar6;" (assignment_expression "iVar4 = param_2 - iVar6" identifier = (binary_expression "param_2 - iVar6" identifier - identifier)) ;) (if_statement "if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }" if (parenthesized_expression "(iVar3 <= param_2 - iVar6)" ( (binary_expression "iVar3 <= param_2 - iVar6" identifier <= (binary_expression "param_2 - iVar6" identifier - identifier)) )) (compound_statement "{\n        iVar4 = iVar3;\n      }" { (expression_statement "iVar4 = iVar3;" (assignment_expression "iVar4 = iVar3" identifier = identifier) ;) })) (expression_statement "(*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);" (call_expression "(*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4)" (parenthesized_expression "(*(code *)PTR_wmemcpy_0043682c)" ( (pointer_expression "*(code *)PTR_wmemcpy_0043682c" * (cast_expression "(code *)PTR_wmemcpy_0043682c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,iVar5,iVar4)" ( identifier , identifier , identifier ))) ;) (expression_statement "iVar6 = iVar6 + iVar4;" (assignment_expression "iVar6 = iVar6 + iVar4" identifier = (binary_expression "iVar6 + iVar4" identifier + identifier)) ;) (expression_statement "*(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;" (assignment_expression "*(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4" (pointer_expression "*(int *)(this + 8)" * (cast_expression "(int *)(this + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = (binary_expression "*(int *)(this + 8) + iVar4 * 4" (pointer_expression "*(int *)(this + 8)" * (cast_expression "(int *)(this + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) + (binary_expression "iVar4 * 4" identifier * number_literal))) ;) (if_statement "if (param_2 <= iVar6) {\n        return iVar6;\n      }" if (parenthesized_expression "(param_2 <= iVar6)" ( (binary_expression "param_2 <= iVar6" identifier <= identifier) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "param_1 = param_1 + iVar4 * 2;" (assignment_expression "param_1 = param_1 + iVar4 * 2" identifier = (binary_expression "param_1 + iVar4 * 2" identifier + (binary_expression "iVar4 * 2" identifier * number_literal))) ;) })) (expression_statement "pcVar7 = *(code **)(*(int *)this + 0x28);" (assignment_expression "pcVar7 = *(code **)(*(int *)this + 0x28)" identifier = (pointer_expression "*(code **)(*(int *)this + 0x28)" * (cast_expression "(code **)(*(int *)this + 0x28)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)this + 0x28)" ( (binary_expression "*(int *)this + 0x28" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ;) (if_statement "if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }" if (parenthesized_expression "(pcVar7 == (code *)puVar2)" ( (binary_expression "pcVar7 == (code *)puVar2" identifier == (cast_expression "(code *)puVar2" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }" { (expression_statement "pcVar7 = *(code **)(*(int *)this + 0x24);" (assignment_expression "pcVar7 = *(code **)(*(int *)this + 0x24)" identifier = (pointer_expression "*(code **)(*(int *)this + 0x24)" * (cast_expression "(code **)(*(int *)this + 0x24)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)this + 0x24)" ( (binary_expression "*(int *)this + 0x24" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ;) (if_statement "if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }" if (parenthesized_expression "(pcVar7 == (code *)puVar1)" ( (binary_expression "pcVar7 == (code *)puVar1" identifier == (cast_expression "(code *)puVar1" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "iVar5 = (*pcVar7)(this);" (assignment_expression "iVar5 = (*pcVar7)(this)" identifier = (call_expression "(*pcVar7)(this)" (parenthesized_expression "(*pcVar7)" ( (pointer_expression "*pcVar7" * identifier) )) (argument_list "(this)" ( identifier )))) ;) (if_statement "if (iVar5 == -1) {\n        return iVar6;\n      }" if (parenthesized_expression "(iVar5 == -1)" ( (binary_expression "iVar5 == -1" identifier == number_literal) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "iVar5 = **(int **)(this + 8);" (assignment_expression "iVar5 = **(int **)(this + 8)" identifier = (pointer_expression "**(int **)(this + 8)" * (pointer_expression "*(int **)(this + 8)" * (cast_expression "(int **)(this + 8)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))))) ;) (expression_statement "*(int **)(this + 8) = *(int **)(this + 8) + 1;" (assignment_expression "*(int **)(this + 8) = *(int **)(this + 8) + 1" (pointer_expression "*(int **)(this + 8)" * (cast_expression "(int **)(this + 8)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = (binary_expression "*(int **)(this + 8) + 1" (pointer_expression "*(int **)(this + 8)" * (cast_expression "(int **)(this + 8)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) + number_literal)) ;) }) (else_clause "else {\n      iVar5 = (*pcVar7)(this);\n    }" else (compound_statement "{\n      iVar5 = (*pcVar7)(this);\n    }" { (expression_statement "iVar5 = (*pcVar7)(this);" (assignment_expression "iVar5 = (*pcVar7)(this)" identifier = (call_expression "(*pcVar7)(this)" (parenthesized_expression "(*pcVar7)" ( (pointer_expression "*pcVar7" * identifier) )) (argument_list "(this)" ( identifier )))) ;) }))) (if_statement "if (iVar5 == -1) {\n      return iVar6;\n    }" if (parenthesized_expression "(iVar5 == -1)" ( (binary_expression "iVar5 == -1" identifier == number_literal) )) (compound_statement "{\n      return iVar6;\n    }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" identifier = (binary_expression "iVar6 + 1" identifier + number_literal)) ;) (expression_statement "*(int *)param_1 = iVar5;" (assignment_expression "*(int *)param_1 = iVar5" (pointer_expression "*(int *)param_1" * (cast_expression "(int *)param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) = identifier) ;) (expression_statement "param_1 = param_1 + 2;" (assignment_expression "param_1 = param_1 + 2" identifier = (binary_expression "param_1 + 2" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar6 < param_2)" ( (binary_expression "iVar6 < param_2" identifier < identifier) )) ;) (return_statement "return iVar6;" return identifier ;) })))
(translation_unit (function_definition TYPE (ms_call_modifier __thiscall) (ERROR IDENT : : IDENT : :) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) - IDENT) >> LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= (binary_expression IDENT - IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + (binary_expression IDENT * LIT))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + (binary_expression IDENT * LIT))) ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * IDENT) )) (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * IDENT) )) (argument_list ( IDENT )))) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) = IDENT) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT < IDENT) )) ;) (return_statement return IDENT ;) })))
(function_definition "int __thiscall std::wstreambuf::xsgetn(wstreambuf *this,wchar_t *param_1,int param_2)\n\n{\n  undefined *puVar1;\n  undefined *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  code *pcVar7;\n  \n  puVar2 = PTR_uflow_00435ec4;\n  puVar1 = PTR_underflow_00435eb8;\n  if (param_2 < 1) {\n    return 0;\n  }\n  iVar6 = 0;\n  do {\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  } while (iVar6 < param_2);\n  return iVar6;\n}" (primitive_type "int") (ms_call_modifier "__thiscall" (__thiscall "__thiscall")) (ERROR "std::wstreambuf::" (identifier "std") (: ":") (: ":") (identifier "wstreambuf") (: ":") (: ":")) (function_declarator "xsgetn(wstreambuf *this,wchar_t *param_1,int param_2)" (identifier "xsgetn") (parameter_list "(wstreambuf *this,wchar_t *param_1,int param_2)" (( "(") (parameter_declaration "wstreambuf *this" (type_identifier "wstreambuf") (pointer_declarator "*this" (* "*") (identifier "this"))) (, ",") (parameter_declaration "wchar_t *param_1" (type_identifier "wchar_t") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  undefined *puVar1;\n  undefined *puVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  code *pcVar7;\n  \n  puVar2 = PTR_uflow_00435ec4;\n  puVar1 = PTR_underflow_00435eb8;\n  if (param_2 < 1) {\n    return 0;\n  }\n  iVar6 = 0;\n  do {\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  } while (iVar6 < param_2);\n  return iVar6;\n}" ({ "{") (declaration "undefined *puVar1;" (type_identifier "undefined") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "undefined *puVar2;" (type_identifier "undefined") (pointer_declarator "*puVar2" (* "*") (identifier "puVar2")) (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (declaration "int iVar6;" (primitive_type "int") (identifier "iVar6") (; ";")) (declaration "code *pcVar7;" (type_identifier "code") (pointer_declarator "*pcVar7" (* "*") (identifier "pcVar7")) (; ";")) (expression_statement "puVar2 = PTR_uflow_00435ec4;" (assignment_expression "puVar2 = PTR_uflow_00435ec4" (identifier "puVar2") (= "=") (identifier "PTR_uflow_00435ec4")) (; ";")) (expression_statement "puVar1 = PTR_underflow_00435eb8;" (assignment_expression "puVar1 = PTR_underflow_00435eb8" (identifier "puVar1") (= "=") (identifier "PTR_underflow_00435eb8")) (; ";")) (if_statement "if (param_2 < 1) {\n    return 0;\n  }" (if "if") (parenthesized_expression "(param_2 < 1)" (( "(") (binary_expression "param_2 < 1" (identifier "param_2") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n    return 0;\n  }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" (identifier "iVar6") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  } while (iVar6 < param_2);" (do "do") (compound_statement "{\n    iVar5 = *(int *)(this + 8);\n    if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }\n    pcVar7 = *(code **)(*(int *)this + 0x28);\n    if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }\n    if (iVar5 == -1) {\n      return iVar6;\n    }\n    iVar6 = iVar6 + 1;\n    *(int *)param_1 = iVar5;\n    param_1 = param_1 + 2;\n  }" ({ "{") (expression_statement "iVar5 = *(int *)(this + 8);" (assignment_expression "iVar5 = *(int *)(this + 8)" (identifier "iVar5") (= "=") (pointer_expression "*(int *)(this + 8)" (* "*") (cast_expression "(int *)(this + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(this + 8)" (( "(") (binary_expression "this + 8" (identifier "this") (+ "+") (number_literal "8")) () ")"))))) (; ";")) (if_statement "if (*(int *)(this + 0xc) != iVar5) {\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }" (if "if") (parenthesized_expression "(*(int *)(this + 0xc) != iVar5)" (( "(") (binary_expression "*(int *)(this + 0xc) != iVar5" (pointer_expression "*(int *)(this + 0xc)" (* "*") (cast_expression "(int *)(this + 0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(this + 0xc)" (( "(") (binary_expression "this + 0xc" (identifier "this") (+ "+") (number_literal "0xc")) () ")")))) (!= "!=") (identifier "iVar5")) () ")")) (compound_statement "{\n      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;\n      iVar4 = param_2 - iVar6;\n      if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }\n      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);\n      iVar6 = iVar6 + iVar4;\n      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      param_1 = param_1 + iVar4 * 2;\n    }" ({ "{") (expression_statement "iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;" (assignment_expression "iVar3 = *(int *)(this + 0xc) - iVar5 >> 2" (identifier "iVar3") (= "=") (binary_expression "*(int *)(this + 0xc) - iVar5 >> 2" (binary_expression "*(int *)(this + 0xc) - iVar5" (pointer_expression "*(int *)(this + 0xc)" (* "*") (cast_expression "(int *)(this + 0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(this + 0xc)" (( "(") (binary_expression "this + 0xc" (identifier "this") (+ "+") (number_literal "0xc")) () ")")))) (- "-") (identifier "iVar5")) (>> ">>") (number_literal "2"))) (; ";")) (expression_statement "iVar4 = param_2 - iVar6;" (assignment_expression "iVar4 = param_2 - iVar6" (identifier "iVar4") (= "=") (binary_expression "param_2 - iVar6" (identifier "param_2") (- "-") (identifier "iVar6"))) (; ";")) (if_statement "if (iVar3 <= param_2 - iVar6) {\n        iVar4 = iVar3;\n      }" (if "if") (parenthesized_expression "(iVar3 <= param_2 - iVar6)" (( "(") (binary_expression "iVar3 <= param_2 - iVar6" (identifier "iVar3") (<= "<=") (binary_expression "param_2 - iVar6" (identifier "param_2") (- "-") (identifier "iVar6"))) () ")")) (compound_statement "{\n        iVar4 = iVar3;\n      }" ({ "{") (expression_statement "iVar4 = iVar3;" (assignment_expression "iVar4 = iVar3" (identifier "iVar4") (= "=") (identifier "iVar3")) (; ";")) (} "}"))) (expression_statement "(*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);" (call_expression "(*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4)" (parenthesized_expression "(*(code *)PTR_wmemcpy_0043682c)" (( "(") (pointer_expression "*(code *)PTR_wmemcpy_0043682c" (* "*") (cast_expression "(code *)PTR_wmemcpy_0043682c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_wmemcpy_0043682c"))) () ")")) (argument_list "(param_1,iVar5,iVar4)" (( "(") (identifier "param_1") (, ",") (identifier "iVar5") (, ",") (identifier "iVar4") () ")"))) (; ";")) (expression_statement "iVar6 = iVar6 + iVar4;" (assignment_expression "iVar6 = iVar6 + iVar4" (identifier "iVar6") (= "=") (binary_expression "iVar6 + iVar4" (identifier "iVar6") (+ "+") (identifier "iVar4"))) (; ";")) (expression_statement "*(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;" (assignment_expression "*(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4" (pointer_expression "*(int *)(this + 8)" (* "*") (cast_expression "(int *)(this + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(this + 8)" (( "(") (binary_expression "this + 8" (identifier "this") (+ "+") (number_literal "8")) () ")")))) (= "=") (binary_expression "*(int *)(this + 8) + iVar4 * 4" (pointer_expression "*(int *)(this + 8)" (* "*") (cast_expression "(int *)(this + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(this + 8)" (( "(") (binary_expression "this + 8" (identifier "this") (+ "+") (number_literal "8")) () ")")))) (+ "+") (binary_expression "iVar4 * 4" (identifier "iVar4") (* "*") (number_literal "4")))) (; ";")) (if_statement "if (param_2 <= iVar6) {\n        return iVar6;\n      }" (if "if") (parenthesized_expression "(param_2 <= iVar6)" (( "(") (binary_expression "param_2 <= iVar6" (identifier "param_2") (<= "<=") (identifier "iVar6")) () ")")) (compound_statement "{\n        return iVar6;\n      }" ({ "{") (return_statement "return iVar6;" (return "return") (identifier "iVar6") (; ";")) (} "}"))) (expression_statement "param_1 = param_1 + iVar4 * 2;" (assignment_expression "param_1 = param_1 + iVar4 * 2" (identifier "param_1") (= "=") (binary_expression "param_1 + iVar4 * 2" (identifier "param_1") (+ "+") (binary_expression "iVar4 * 2" (identifier "iVar4") (* "*") (number_literal "2")))) (; ";")) (} "}"))) (expression_statement "pcVar7 = *(code **)(*(int *)this + 0x28);" (assignment_expression "pcVar7 = *(code **)(*(int *)this + 0x28)" (identifier "pcVar7") (= "=") (pointer_expression "*(code **)(*(int *)this + 0x28)" (* "*") (cast_expression "(code **)(*(int *)this + 0x28)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*(int *)this + 0x28)" (( "(") (binary_expression "*(int *)this + 0x28" (pointer_expression "*(int *)this" (* "*") (cast_expression "(int *)this" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "this"))) (+ "+") (number_literal "0x28")) () ")"))))) (; ";")) (if_statement "if (pcVar7 == (code *)puVar2) {\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }\n    else {\n      iVar5 = (*pcVar7)(this);\n    }" (if "if") (parenthesized_expression "(pcVar7 == (code *)puVar2)" (( "(") (binary_expression "pcVar7 == (code *)puVar2" (identifier "pcVar7") (== "==") (cast_expression "(code *)puVar2" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar2"))) () ")")) (compound_statement "{\n      pcVar7 = *(code **)(*(int *)this + 0x24);\n      if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }\n      iVar5 = (*pcVar7)(this);\n      if (iVar5 == -1) {\n        return iVar6;\n      }\n      iVar5 = **(int **)(this + 8);\n      *(int **)(this + 8) = *(int **)(this + 8) + 1;\n    }" ({ "{") (expression_statement "pcVar7 = *(code **)(*(int *)this + 0x24);" (assignment_expression "pcVar7 = *(code **)(*(int *)this + 0x24)" (identifier "pcVar7") (= "=") (pointer_expression "*(code **)(*(int *)this + 0x24)" (* "*") (cast_expression "(code **)(*(int *)this + 0x24)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*(int *)this + 0x24)" (( "(") (binary_expression "*(int *)this + 0x24" (pointer_expression "*(int *)this" (* "*") (cast_expression "(int *)this" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "this"))) (+ "+") (number_literal "0x24")) () ")"))))) (; ";")) (if_statement "if (pcVar7 == (code *)puVar1) {\n        return iVar6;\n      }" (if "if") (parenthesized_expression "(pcVar7 == (code *)puVar1)" (( "(") (binary_expression "pcVar7 == (code *)puVar1" (identifier "pcVar7") (== "==") (cast_expression "(code *)puVar1" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar1"))) () ")")) (compound_statement "{\n        return iVar6;\n      }" ({ "{") (return_statement "return iVar6;" (return "return") (identifier "iVar6") (; ";")) (} "}"))) (expression_statement "iVar5 = (*pcVar7)(this);" (assignment_expression "iVar5 = (*pcVar7)(this)" (identifier "iVar5") (= "=") (call_expression "(*pcVar7)(this)" (parenthesized_expression "(*pcVar7)" (( "(") (pointer_expression "*pcVar7" (* "*") (identifier "pcVar7")) () ")")) (argument_list "(this)" (( "(") (identifier "this") () ")")))) (; ";")) (if_statement "if (iVar5 == -1) {\n        return iVar6;\n      }" (if "if") (parenthesized_expression "(iVar5 == -1)" (( "(") (binary_expression "iVar5 == -1" (identifier "iVar5") (== "==") (number_literal "-1")) () ")")) (compound_statement "{\n        return iVar6;\n      }" ({ "{") (return_statement "return iVar6;" (return "return") (identifier "iVar6") (; ";")) (} "}"))) (expression_statement "iVar5 = **(int **)(this + 8);" (assignment_expression "iVar5 = **(int **)(this + 8)" (identifier "iVar5") (= "=") (pointer_expression "**(int **)(this + 8)" (* "*") (pointer_expression "*(int **)(this + 8)" (* "*") (cast_expression "(int **)(this + 8)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(this + 8)" (( "(") (binary_expression "this + 8" (identifier "this") (+ "+") (number_literal "8")) () ")")))))) (; ";")) (expression_statement "*(int **)(this + 8) = *(int **)(this + 8) + 1;" (assignment_expression "*(int **)(this + 8) = *(int **)(this + 8) + 1" (pointer_expression "*(int **)(this + 8)" (* "*") (cast_expression "(int **)(this + 8)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(this + 8)" (( "(") (binary_expression "this + 8" (identifier "this") (+ "+") (number_literal "8")) () ")")))) (= "=") (binary_expression "*(int **)(this + 8) + 1" (pointer_expression "*(int **)(this + 8)" (* "*") (cast_expression "(int **)(this + 8)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(this + 8)" (( "(") (binary_expression "this + 8" (identifier "this") (+ "+") (number_literal "8")) () ")")))) (+ "+") (number_literal "1"))) (; ";")) (} "}")) (else_clause "else {\n      iVar5 = (*pcVar7)(this);\n    }" (else "else") (compound_statement "{\n      iVar5 = (*pcVar7)(this);\n    }" ({ "{") (expression_statement "iVar5 = (*pcVar7)(this);" (assignment_expression "iVar5 = (*pcVar7)(this)" (identifier "iVar5") (= "=") (call_expression "(*pcVar7)(this)" (parenthesized_expression "(*pcVar7)" (( "(") (pointer_expression "*pcVar7" (* "*") (identifier "pcVar7")) () ")")) (argument_list "(this)" (( "(") (identifier "this") () ")")))) (; ";")) (} "}")))) (if_statement "if (iVar5 == -1) {\n      return iVar6;\n    }" (if "if") (parenthesized_expression "(iVar5 == -1)" (( "(") (binary_expression "iVar5 == -1" (identifier "iVar5") (== "==") (number_literal "-1")) () ")")) (compound_statement "{\n      return iVar6;\n    }" ({ "{") (return_statement "return iVar6;" (return "return") (identifier "iVar6") (; ";")) (} "}"))) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" (identifier "iVar6") (= "=") (binary_expression "iVar6 + 1" (identifier "iVar6") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "*(int *)param_1 = iVar5;" (assignment_expression "*(int *)param_1 = iVar5" (pointer_expression "*(int *)param_1" (* "*") (cast_expression "(int *)param_1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "param_1"))) (= "=") (identifier "iVar5")) (; ";")) (expression_statement "param_1 = param_1 + 2;" (assignment_expression "param_1 = param_1 + 2" (identifier "param_1") (= "=") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(iVar6 < param_2)" (( "(") (binary_expression "iVar6 < param_2" (identifier "iVar6") (< "<") (identifier "param_2")) () ")")) (; ";")) (return_statement "return iVar6;" (return "return") (identifier "iVar6") (; ";")) (} "}")))

/* std::wstreambuf::xsgetn(wchar_t*, int) */

int __thiscall std::type_1::function_1(type_1 *var_2,type_2 *var_7,int var_1)

{
  type_3 *puVar1;
  type_3 *puVar2;
  int var_5;
  int var_6;
  int var_3;
  int var_4;
  type_4 *var_8;
  
  puVar2 = PTR_uflow_00435ec4;
  puVar1 = PTR_underflow_00435eb8;
  if (var_1 < 1) {
    return 0;
  }
  var_4 = 0;
  do {
    var_3 = *(int *)(var_2 + 8);
    if (*(int *)(var_2 + 0xc) != var_3) {
      var_5 = *(int *)(var_2 + 0xc) - var_3 >> 2;
      var_6 = var_1 - var_4;
      if (var_5 <= var_1 - var_4) {
        var_6 = var_5;
      }
      (*(type_4 *)PTR_wmemcpy_0043682c)(var_7,var_3,var_6);
      var_4 = var_4 + var_6;
      *(int *)(var_2 + 8) = *(int *)(var_2 + 8) + var_6 * 4;
      if (var_1 <= var_4) {
        return var_4;
      }
      var_7 = var_7 + var_6 * 2;
    }
    var_8 = *(type_4 **)(*(int *)var_2 + 0x28);
    if (var_8 == (type_4 *)puVar2) {
      var_8 = *(type_4 **)(*(int *)var_2 + 0x24);
      if (var_8 == (type_4 *)puVar1) {
        return var_4;
      }
      var_3 = (*var_8)(var_2);
      if (var_3 == -1) {
        return var_4;
      }
      var_3 = **(int **)(var_2 + 8);
      *(int **)(var_2 + 8) = *(int **)(var_2 + 8) + 1;
    }
    else {
      var_3 = (*var_8)(var_2);
    }
    if (var_3 == -1) {
      return var_4;
    }
    var_4 = var_4 + 1;
    *(int *)var_7 = var_3;
    var_7 = var_7 + 2;
  } while (var_4 < var_1);
  return var_4;
}


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

/* std::wstreambuf::MASKED(wchar_t*, int) */

int __thiscall std::wstreambuf::MASKED(wstreambuf *this,wchar_t *param_1,int param_2)

{
  undefined *puVar1;
  undefined *puVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  code *pcVar7;
  
  puVar2 = PTR_uflow_00435ec4;
  puVar1 = PTR_underflow_00435eb8;
  if (param_2 < 1) {
    return 0;
  }
  iVar6 = 0;
  do {
    iVar5 = *(int *)(this + 8);
    if (*(int *)(this + 0xc) != iVar5) {
      iVar3 = *(int *)(this + 0xc) - iVar5 >> 2;
      iVar4 = param_2 - iVar6;
      if (iVar3 <= param_2 - iVar6) {
        iVar4 = iVar3;
      }
      (*(code *)PTR_wmemcpy_0043682c)(param_1,iVar5,iVar4);
      iVar6 = iVar6 + iVar4;
      *(int *)(this + 8) = *(int *)(this + 8) + iVar4 * 4;
      if (param_2 <= iVar6) {
        return iVar6;
      }
      param_1 = param_1 + iVar4 * 2;
    }
    pcVar7 = *(code **)(*(int *)this + 0x28);
    if (pcVar7 == (code *)puVar2) {
      pcVar7 = *(code **)(*(int *)this + 0x24);
      if (pcVar7 == (code *)puVar1) {
        return iVar6;
      }
      iVar5 = (*pcVar7)(this);
      if (iVar5 == -1) {
        return iVar6;
      }
      iVar5 = **(int **)(this + 8);
      *(int **)(this + 8) = *(int **)(this + 8) + 1;
    }
    else {
      iVar5 = (*pcVar7)(this);
    }
    if (iVar5 == -1) {
      return iVar6;
    }
    iVar6 = iVar6 + 1;
    *(int *)param_1 = iVar5;
    param_1 = param_1 + 2;
  } while (iVar6 < param_2);
  return iVar6;
}

