
/* std::wfilebuf::pbackfail(unsigned int) */

uint __thiscall std::wfilebuf::pbackfail(wfilebuf *this,uint param_1)

{
  ulong uVar1;
  undefined8 uVar2;
  int iVar3;
  uint uVar4;
  wfilebuf *pwVar5;
  long lVar6;
  wfilebuf wVar7;
  
  if (((byte)this[0x78] & 8) == 0) {
    return 0xffffffff;
  }
  if (this[0xaa] == (wfilebuf)0x0) {
    uVar1 = *(ulong *)(this + 0x10);
    wVar7 = this[0xc0];
    if (*(ulong *)(this + 8) < uVar1) {
      *(ulong *)(this + 0x10) = uVar1 - 4;
      uVar4 = *(uint *)(uVar1 - 4);
      goto LAB_00301ea1;
    }
  }
  else {
    iVar3 = (**(code **)(*(long *)this + 0x68))(this,0xffffffff);
    if (iVar3 == -1) {
      return 0xffffffff;
    }
    uVar2 = *(undefined8 *)(this + 0x98);
    *(undefined8 *)(this + 0x28) = 0;
    *(undefined8 *)(this + 0x20) = 0;
    wVar7 = this[0xc0];
    *(undefined8 *)(this + 8) = uVar2;
    *(undefined8 *)(this + 0x10) = uVar2;
    *(undefined8 *)(this + 0x18) = uVar2;
    *(undefined8 *)(this + 0x30) = 0;
    this[0xaa] = (wfilebuf)0x0;
  }
  lVar6 = (**(code **)(*(long *)this + 0x20))(this,0xffffffffffffffff,1,0x18);
  if (lVar6 == -1) {
    return 0xffffffff;
  }
  uVar4 = (**(code **)(*(long *)this + 0x48))(this);
  if (uVar4 == 0xffffffff) {
    return 0xffffffff;
  }
LAB_00301ea1:
  if (param_1 == 0xffffffff) {
    return 0;
  }
  if (uVar4 != param_1) {
    if (wVar7 != (wfilebuf)0x0) {
      return 0xffffffff;
    }
    pwVar5 = *(wfilebuf **)(this + 0x10);
    if (this[0xc0] == (wfilebuf)0x0) {
      *(wfilebuf **)(this + 0xb0) = pwVar5;
      uVar2 = *(undefined8 *)(this + 0x18);
      *(wfilebuf **)(this + 0x18) = this + 0xb0;
      *(undefined8 *)(this + 0xb8) = uVar2;
      pwVar5 = this + 0xac;
      *(wfilebuf **)(this + 8) = pwVar5;
      *(wfilebuf **)(this + 0x10) = pwVar5;
      this[0xc0] = (wfilebuf)0x1;
    }
    this[0xa9] = (wfilebuf)0x1;
    *(uint *)pwVar5 = param_1;
    return param_1;
  }
  return uVar4;
}



int FUN_00301e60(long *param_1,int param_2)

{
  ulong uVar1;
  int iVar2;
  int *piVar3;
  long lVar4;
  char cVar5;
  
  if ((*(byte *)(param_1 + 0xf) & 8) == 0) {
    return -1;
  }
  if (*(char *)((long)param_1 + 0xaa) == '\0') {
    uVar1 = param_1[2];
    cVar5 = (char)param_1[0x18];
    if ((ulong)param_1[1] < uVar1) {
      param_1[2] = uVar1 - 4;
      iVar2 = *(int *)(uVar1 - 4);
      goto LAB_00301ea1;
    }
  }
  else {
    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);
    if (iVar2 == -1) {
      return -1;
    }
    lVar4 = param_1[0x13];
    param_1[5] = 0;
    param_1[4] = 0;
    cVar5 = (char)param_1[0x18];
    param_1[1] = lVar4;
    param_1[2] = lVar4;
    param_1[3] = lVar4;
    param_1[6] = 0;
    *(undefined1 *)((long)param_1 + 0xaa) = 0;
  }
  lVar4 = (**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18);
  if (lVar4 == -1) {
    return -1;
  }
  iVar2 = (**(code **)(*param_1 + 0x48))(param_1);
  if (iVar2 == -1) {
    return -1;
  }
LAB_00301ea1:
  if (param_2 == -1) {
    return 0;
  }
  if (iVar2 != param_2) {
    if (cVar5 != '\0') {
      return -1;
    }
    piVar3 = (int *)param_1[2];
    if ((char)param_1[0x18] == '\0') {
      param_1[0x16] = (long)piVar3;
      lVar4 = param_1[3];
      param_1[3] = (long)(param_1 + 0x16);
      param_1[0x17] = lVar4;
      piVar3 = (int *)((long)param_1 + 0xac);
      param_1[1] = (long)piVar3;
      param_1[2] = (long)piVar3;
      *(undefined1 *)(param_1 + 0x18) = 1;
    }
    *(undefined1 *)((long)param_1 + 0xa9) = 1;
    *piVar3 = param_2;
    return param_2;
  }
  return iVar2;
}


TEST byte ptr [RDI + 0x78],0x8
JZ 0x00301fa0
PUSH R12
PUSH RBP
MOV EBP,ESI
PUSH RBX
CMP byte ptr [RDI + 0xaa],0x0
MOV RBX,RDI
JNZ 0x00301f10
MOV RAX,qword ptr [RDI + 0x10]
MOVZX R12D,byte ptr [RDI + 0xc0]
CMP RAX,qword ptr [RDI + 0x8]
JBE 0x00301f5a
LEA RDX,[RAX + -0x4]
MOV qword ptr [RDI + 0x10],RDX
MOV EDX,dword ptr [RAX + -0x4]
XOR EAX,EAX
CMP EBP,-0x1
JZ 0x00301f95
MOV EAX,EDX
CMP EDX,EBP
JZ 0x00301f95
TEST R12B,R12B
JNZ 0x00301f90
CMP byte ptr [RBX + 0xc0],0x0
MOV RAX,qword ptr [RBX + 0x10]
JNZ 0x00301eff
MOV qword ptr [RBX + 0xb0],RAX
MOV RAX,qword ptr [RBX + 0x18]
LEA RDX,[RBX + 0xb0]
MOV qword ptr [RBX + 0x18],RDX
MOV qword ptr [RBX + 0xb8],RAX
LEA RAX,[RBX + 0xac]
MOV qword ptr [RBX + 0x8],RAX
MOV qword ptr [RBX + 0x10],RAX
MOV byte ptr [RBX + 0xc0],0x1
MOV byte ptr [RBX + 0xa9],0x1
MOV dword ptr [RAX],EBP
MOV EAX,EBP
POP RBX
POP RBP
POP R12
RET
MOV RAX,qword ptr [RDI]
MOV ESI,0xffffffff
CALL qword ptr [RAX + 0x68]
CMP EAX,-0x1
JZ 0x00301f90
MOV RAX,qword ptr [RBX + 0x98]
MOV qword ptr [RBX + 0x28],0x0
MOV qword ptr [RBX + 0x20],0x0
MOVZX R12D,byte ptr [RBX + 0xc0]
MOV qword ptr [RBX + 0x8],RAX
MOV qword ptr [RBX + 0x10],RAX
MOV qword ptr [RBX + 0x18],RAX
MOV qword ptr [RBX + 0x30],0x0
MOV byte ptr [RBX + 0xaa],0x0
MOV RAX,qword ptr [RBX]
MOV ECX,0x18
MOV EDX,0x1
MOV RDI,RBX
MOV RSI,-0x1
CALL qword ptr [RAX + 0x20]
CMP RAX,-0x1
JZ 0x00301f90
MOV RAX,qword ptr [RBX]
MOV RDI,RBX
CALL qword ptr [RAX + 0x48]
MOV EDX,EAX
CMP EAX,-0x1
JNZ 0x00301ea1
NOP
MOV EAX,0xffffffff
POP RBX
POP RBP
POP R12
RET
MOV EAX,0xffffffff
RET
(translation_unit "int FUN_00301e60(long *param_1,int param_2)\n\n{\n  ulong uVar1;\n  int iVar2;\n  int *piVar3;\n  long lVar4;\n  char cVar5;\n  \n  if ((*(byte *)(param_1 + 0xf) & 8) == 0) {\n    return -1;\n  }\n  if (*(char *)((long)param_1 + 0xaa) == '\0') {\n    uVar1 = param_1[2];\n    cVar5 = (char)param_1[0x18];\n    if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }\n  else {\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }\n  lVar4 = (**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18);\n  if (lVar4 == -1) {\n    return -1;\n  }\n  iVar2 = (**(code **)(*param_1 + 0x48))(param_1);\n  if (iVar2 == -1) {\n    return -1;\n  }\nLAB_00301ea1:\n  if (param_2 == -1) {\n    return 0;\n  }\n  if (iVar2 != param_2) {\n    if (cVar5 != '\0') {\n      return -1;\n    }\n    piVar3 = (int *)param_1[2];\n    if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }\n    *(undefined1 *)((long)param_1 + 0xa9) = 1;\n    *piVar3 = param_2;\n    return param_2;\n  }\n  return iVar2;\n}\n\n" (function_definition "int FUN_00301e60(long *param_1,int param_2)\n\n{\n  ulong uVar1;\n  int iVar2;\n  int *piVar3;\n  long lVar4;\n  char cVar5;\n  \n  if ((*(byte *)(param_1 + 0xf) & 8) == 0) {\n    return -1;\n  }\n  if (*(char *)((long)param_1 + 0xaa) == '\0') {\n    uVar1 = param_1[2];\n    cVar5 = (char)param_1[0x18];\n    if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }\n  else {\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }\n  lVar4 = (**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18);\n  if (lVar4 == -1) {\n    return -1;\n  }\n  iVar2 = (**(code **)(*param_1 + 0x48))(param_1);\n  if (iVar2 == -1) {\n    return -1;\n  }\nLAB_00301ea1:\n  if (param_2 == -1) {\n    return 0;\n  }\n  if (iVar2 != param_2) {\n    if (cVar5 != '\0') {\n      return -1;\n    }\n    piVar3 = (int *)param_1[2];\n    if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }\n    *(undefined1 *)((long)param_1 + 0xa9) = 1;\n    *piVar3 = param_2;\n    return param_2;\n  }\n  return iVar2;\n}" primitive_type (function_declarator "FUN_00301e60(long *param_1,int param_2)" identifier (parameter_list "(long *param_1,int param_2)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  ulong uVar1;\n  int iVar2;\n  int *piVar3;\n  long lVar4;\n  char cVar5;\n  \n  if ((*(byte *)(param_1 + 0xf) & 8) == 0) {\n    return -1;\n  }\n  if (*(char *)((long)param_1 + 0xaa) == '\0') {\n    uVar1 = param_1[2];\n    cVar5 = (char)param_1[0x18];\n    if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }\n  else {\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }\n  lVar4 = (**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18);\n  if (lVar4 == -1) {\n    return -1;\n  }\n  iVar2 = (**(code **)(*param_1 + 0x48))(param_1);\n  if (iVar2 == -1) {\n    return -1;\n  }\nLAB_00301ea1:\n  if (param_2 == -1) {\n    return 0;\n  }\n  if (iVar2 != param_2) {\n    if (cVar5 != '\0') {\n      return -1;\n    }\n    piVar3 = (int *)param_1[2];\n    if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }\n    *(undefined1 *)((long)param_1 + 0xa9) = 1;\n    *piVar3 = param_2;\n    return param_2;\n  }\n  return iVar2;\n}" { (declaration "ulong uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (declaration "char cVar5;" primitive_type identifier ;) (if_statement "if ((*(byte *)(param_1 + 0xf) & 8) == 0) {\n    return -1;\n  }" if (parenthesized_expression "((*(byte *)(param_1 + 0xf) & 8) == 0)" ( (binary_expression "(*(byte *)(param_1 + 0xf) & 8) == 0" (parenthesized_expression "(*(byte *)(param_1 + 0xf) & 8)" ( (binary_expression "*(byte *)(param_1 + 0xf) & 8" (pointer_expression "*(byte *)(param_1 + 0xf)" * (cast_expression "(byte *)(param_1 + 0xf)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xf)" ( (binary_expression "param_1 + 0xf" identifier + number_literal) )))) & number_literal) )) == number_literal) )) (compound_statement "{\n    return -1;\n  }" { (return_statement "return -1;" return number_literal ;) })) (if_statement "if (*(char *)((long)param_1 + 0xaa) == '\0') {\n    uVar1 = param_1[2];\n    cVar5 = (char)param_1[0x18];\n    if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }\n  else {\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }" if (parenthesized_expression "(*(char *)((long)param_1 + 0xaa) == '\0')" ( (binary_expression "*(char *)((long)param_1 + 0xaa) == '\0'" (pointer_expression "*(char *)((long)param_1 + 0xaa)" * (cast_expression "(char *)((long)param_1 + 0xaa)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_1 + 0xaa)" ( (binary_expression "(long)param_1 + 0xaa" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    uVar1 = param_1[2];\n    cVar5 = (char)param_1[0x18];\n    if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }" { (expression_statement "uVar1 = param_1[2];" (assignment_expression "uVar1 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) (expression_statement "cVar5 = (char)param_1[0x18];" (assignment_expression "cVar5 = (char)param_1[0x18]" identifier = (cast_expression "(char)param_1[0x18]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "param_1[0x18]" identifier [ number_literal ]))) ;) (if_statement "if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }" if (parenthesized_expression "((ulong)param_1[1] < uVar1)" ( (binary_expression "(ulong)param_1[1] < uVar1" (cast_expression "(ulong)param_1[1]" ( (type_descriptor "ulong" type_identifier) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) < identifier) )) (compound_statement "{\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }" { (expression_statement "param_1[2] = uVar1 - 4;" (assignment_expression "param_1[2] = uVar1 - 4" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "uVar1 - 4" identifier - number_literal)) ;) (expression_statement "iVar2 = *(int *)(uVar1 - 4);" (assignment_expression "iVar2 = *(int *)(uVar1 - 4)" identifier = (pointer_expression "*(int *)(uVar1 - 4)" * (cast_expression "(int *)(uVar1 - 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar1 - 4)" ( (binary_expression "uVar1 - 4" identifier - number_literal) ))))) ;) (goto_statement "goto LAB_00301ea1;" goto statement_identifier ;) })) }) (else_clause "else {\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }" else (compound_statement "{\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }" { (expression_statement "iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);" (assignment_expression "iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff)" identifier = (call_expression "(**(code **)(*param_1 + 0x68))(param_1,0xffffffff)" (parenthesized_expression "(**(code **)(*param_1 + 0x68))" ( (pointer_expression "**(code **)(*param_1 + 0x68)" * (pointer_expression "*(code **)(*param_1 + 0x68)" * (cast_expression "(code **)(*param_1 + 0x68)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x68)" ( (binary_expression "*param_1 + 0x68" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )) (argument_list "(param_1,0xffffffff)" ( identifier , number_literal )))) ;) (if_statement "if (iVar2 == -1) {\n      return -1;\n    }" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (compound_statement "{\n      return -1;\n    }" { (return_statement "return -1;" return number_literal ;) })) (expression_statement "lVar4 = param_1[0x13];" (assignment_expression "lVar4 = param_1[0x13]" identifier = (subscript_expression "param_1[0x13]" identifier [ number_literal ])) ;) (expression_statement "param_1[5] = 0;" (assignment_expression "param_1[5] = 0" (subscript_expression "param_1[5]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_1[4] = 0;" (assignment_expression "param_1[4] = 0" (subscript_expression "param_1[4]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "cVar5 = (char)param_1[0x18];" (assignment_expression "cVar5 = (char)param_1[0x18]" identifier = (cast_expression "(char)param_1[0x18]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "param_1[0x18]" identifier [ number_literal ]))) ;) (expression_statement "param_1[1] = lVar4;" (assignment_expression "param_1[1] = lVar4" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "param_1[2] = lVar4;" (assignment_expression "param_1[2] = lVar4" (subscript_expression "param_1[2]" identifier [ number_literal ]) = identifier) ;) (expression_statement "param_1[3] = lVar4;" (assignment_expression "param_1[3] = lVar4" (subscript_expression "param_1[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "param_1[6] = 0;" (assignment_expression "param_1[6] = 0" (subscript_expression "param_1[6]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "*(undefined1 *)((long)param_1 + 0xaa) = 0;" (assignment_expression "*(undefined1 *)((long)param_1 + 0xaa) = 0" (pointer_expression "*(undefined1 *)((long)param_1 + 0xaa)" * (cast_expression "(undefined1 *)((long)param_1 + 0xaa)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_1 + 0xaa)" ( (binary_expression "(long)param_1 + 0xaa" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) = number_literal) ;) }))) (expression_statement "lVar4 = (**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18);" (assignment_expression "lVar4 = (**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18)" identifier = (call_expression "(**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18)" (parenthesized_expression "(**(code **)(*param_1 + 0x20))" ( (pointer_expression "**(code **)(*param_1 + 0x20)" * (pointer_expression "*(code **)(*param_1 + 0x20)" * (cast_expression "(code **)(*param_1 + 0x20)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x20)" ( (binary_expression "*param_1 + 0x20" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )) (argument_list "(param_1,0xffffffffffffffff,1,0x18)" ( identifier , number_literal , number_literal , number_literal )))) ;) (if_statement "if (lVar4 == -1) {\n    return -1;\n  }" if (parenthesized_expression "(lVar4 == -1)" ( (binary_expression "lVar4 == -1" identifier == number_literal) )) (compound_statement "{\n    return -1;\n  }" { (return_statement "return -1;" return number_literal ;) })) (expression_statement "iVar2 = (**(code **)(*param_1 + 0x48))(param_1);" (assignment_expression "iVar2 = (**(code **)(*param_1 + 0x48))(param_1)" identifier = (call_expression "(**(code **)(*param_1 + 0x48))(param_1)" (parenthesized_expression "(**(code **)(*param_1 + 0x48))" ( (pointer_expression "**(code **)(*param_1 + 0x48)" * (pointer_expression "*(code **)(*param_1 + 0x48)" * (cast_expression "(code **)(*param_1 + 0x48)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x48)" ( (binary_expression "*param_1 + 0x48" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )) (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar2 == -1) {\n    return -1;\n  }" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (compound_statement "{\n    return -1;\n  }" { (return_statement "return -1;" return number_literal ;) })) (labeled_statement "LAB_00301ea1:\n  if (param_2 == -1) {\n    return 0;\n  }" statement_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 ;) }))) (if_statement "if (iVar2 != param_2) {\n    if (cVar5 != '\0') {\n      return -1;\n    }\n    piVar3 = (int *)param_1[2];\n    if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }\n    *(undefined1 *)((long)param_1 + 0xa9) = 1;\n    *piVar3 = param_2;\n    return param_2;\n  }" if (parenthesized_expression "(iVar2 != param_2)" ( (binary_expression "iVar2 != param_2" identifier != identifier) )) (compound_statement "{\n    if (cVar5 != '\0') {\n      return -1;\n    }\n    piVar3 = (int *)param_1[2];\n    if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }\n    *(undefined1 *)((long)param_1 + 0xa9) = 1;\n    *piVar3 = param_2;\n    return param_2;\n  }" { (if_statement "if (cVar5 != '\0') {\n      return -1;\n    }" if (parenthesized_expression "(cVar5 != '\0')" ( (binary_expression "cVar5 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      return -1;\n    }" { (return_statement "return -1;" return number_literal ;) })) (expression_statement "piVar3 = (int *)param_1[2];" (assignment_expression "piVar3 = (int *)param_1[2]" identifier = (cast_expression "(int *)param_1[2]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ]))) ;) (if_statement "if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }" if (parenthesized_expression "((char)param_1[0x18] == '\0')" ( (binary_expression "(char)param_1[0x18] == '\0'" (cast_expression "(char)param_1[0x18]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "param_1[0x18]" identifier [ number_literal ])) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }" { (expression_statement "param_1[0x16] = (long)piVar3;" (assignment_expression "param_1[0x16] = (long)piVar3" (subscript_expression "param_1[0x16]" identifier [ number_literal ]) = (cast_expression "(long)piVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) (expression_statement "lVar4 = param_1[3];" (assignment_expression "lVar4 = param_1[3]" identifier = (subscript_expression "param_1[3]" identifier [ number_literal ])) ;) (expression_statement "param_1[3] = (long)(param_1 + 0x16);" (assignment_expression "param_1[3] = (long)(param_1 + 0x16)" (subscript_expression "param_1[3]" identifier [ number_literal ]) = (cast_expression "(long)(param_1 + 0x16)" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (parenthesized_expression "(param_1 + 0x16)" ( (binary_expression "param_1 + 0x16" identifier + number_literal) )))) ;) (expression_statement "param_1[0x17] = lVar4;" (assignment_expression "param_1[0x17] = lVar4" (subscript_expression "param_1[0x17]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar3 = (int *)((long)param_1 + 0xac);" (assignment_expression "piVar3 = (int *)((long)param_1 + 0xac)" identifier = (cast_expression "(int *)((long)param_1 + 0xac)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_1 + 0xac)" ( (binary_expression "(long)param_1 + 0xac" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) ;) (expression_statement "param_1[1] = (long)piVar3;" (assignment_expression "param_1[1] = (long)piVar3" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (cast_expression "(long)piVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) (expression_statement "param_1[2] = (long)piVar3;" (assignment_expression "param_1[2] = (long)piVar3" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (cast_expression "(long)piVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) (expression_statement "*(undefined1 *)(param_1 + 0x18) = 1;" (assignment_expression "*(undefined1 *)(param_1 + 0x18) = 1" (pointer_expression "*(undefined1 *)(param_1 + 0x18)" * (cast_expression "(undefined1 *)(param_1 + 0x18)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) )))) = number_literal) ;) })) (expression_statement "*(undefined1 *)((long)param_1 + 0xa9) = 1;" (assignment_expression "*(undefined1 *)((long)param_1 + 0xa9) = 1" (pointer_expression "*(undefined1 *)((long)param_1 + 0xa9)" * (cast_expression "(undefined1 *)((long)param_1 + 0xa9)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_1 + 0xa9)" ( (binary_expression "(long)param_1 + 0xa9" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) = number_literal) ;) (expression_statement "*piVar3 = param_2;" (assignment_expression "*piVar3 = param_2" (pointer_expression "*piVar3" * identifier) = identifier) ;) (return_statement "return param_2;" return identifier ;) })) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "/* std::wfilebuf::pbackfail(unsigned int) */\n\nuint __thiscall std::wfilebuf::pbackfail(wfilebuf *this,uint param_1)\n\n{\n  ulong uVar1;\n  undefined8 uVar2;\n  int iVar3;\n  uint uVar4;\n  wfilebuf *pwVar5;\n  long lVar6;\n  wfilebuf wVar7;\n  \n  if (((byte)this[0x78] & 8) == 0) {\n    return 0xffffffff;\n  }\n  if (this[0xaa] == (wfilebuf)0x0) {\n    uVar1 = *(ulong *)(this + 0x10);\n    wVar7 = this[0xc0];\n    if (*(ulong *)(this + 8) < uVar1) {\n      *(ulong *)(this + 0x10) = uVar1 - 4;\n      uVar4 = *(uint *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }\n  else {\n    iVar3 = (**(code **)(*(long *)this + 0x68))(this,0xffffffff);\n    if (iVar3 == -1) {\n      return 0xffffffff;\n    }\n    uVar2 = *(undefined8 *)(this + 0x98);\n    *(undefined8 *)(this + 0x28) = 0;\n    *(undefined8 *)(this + 0x20) = 0;\n    wVar7 = this[0xc0];\n    *(undefined8 *)(this + 8) = uVar2;\n    *(undefined8 *)(this + 0x10) = uVar2;\n    *(undefined8 *)(this + 0x18) = uVar2;\n    *(undefined8 *)(this + 0x30) = 0;\n    this[0xaa] = (wfilebuf)0x0;\n  }\n  lVar6 = (**(code **)(*(long *)this + 0x20))(this,0xffffffffffffffff,1,0x18);\n  if (lVar6 == -1) {\n    return 0xffffffff;\n  }\n  uVar4 = (**(code **)(*(long *)this + 0x48))(this);\n  if (uVar4 == 0xffffffff) {\n    return 0xffffffff;\n  }\nLAB_00301ea1:\n  if (param_1 == 0xffffffff) {\n    return 0;\n  }\n  if (uVar4 != param_1) {\n    if (wVar7 != (wfilebuf)0x0) {\n      return 0xffffffff;\n    }\n    pwVar5 = *(wfilebuf **)(this + 0x10);\n    if (this[0xc0] == (wfilebuf)0x0) {\n      *(wfilebuf **)(this + 0xb0) = pwVar5;\n      uVar2 = *(undefined8 *)(this + 0x18);\n      *(wfilebuf **)(this + 0x18) = this + 0xb0;\n      *(undefined8 *)(this + 0xb8) = uVar2;\n      pwVar5 = this + 0xac;\n      *(wfilebuf **)(this + 8) = pwVar5;\n      *(wfilebuf **)(this + 0x10) = pwVar5;\n      this[0xc0] = (wfilebuf)0x1;\n    }\n    this[0xa9] = (wfilebuf)0x1;\n    *(uint *)pwVar5 = param_1;\n    return param_1;\n  }\n  return uVar4;\n}\n\n" comment (function_definition "uint __thiscall std::wfilebuf::pbackfail(wfilebuf *this,uint param_1)\n\n{\n  ulong uVar1;\n  undefined8 uVar2;\n  int iVar3;\n  uint uVar4;\n  wfilebuf *pwVar5;\n  long lVar6;\n  wfilebuf wVar7;\n  \n  if (((byte)this[0x78] & 8) == 0) {\n    return 0xffffffff;\n  }\n  if (this[0xaa] == (wfilebuf)0x0) {\n    uVar1 = *(ulong *)(this + 0x10);\n    wVar7 = this[0xc0];\n    if (*(ulong *)(this + 8) < uVar1) {\n      *(ulong *)(this + 0x10) = uVar1 - 4;\n      uVar4 = *(uint *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }\n  else {\n    iVar3 = (**(code **)(*(long *)this + 0x68))(this,0xffffffff);\n    if (iVar3 == -1) {\n      return 0xffffffff;\n    }\n    uVar2 = *(undefined8 *)(this + 0x98);\n    *(undefined8 *)(this + 0x28) = 0;\n    *(undefined8 *)(this + 0x20) = 0;\n    wVar7 = this[0xc0];\n    *(undefined8 *)(this + 8) = uVar2;\n    *(undefined8 *)(this + 0x10) = uVar2;\n    *(undefined8 *)(this + 0x18) = uVar2;\n    *(undefined8 *)(this + 0x30) = 0;\n    this[0xaa] = (wfilebuf)0x0;\n  }\n  lVar6 = (**(code **)(*(long *)this + 0x20))(this,0xffffffffffffffff,1,0x18);\n  if (lVar6 == -1) {\n    return 0xffffffff;\n  }\n  uVar4 = (**(code **)(*(long *)this + 0x48))(this);\n  if (uVar4 == 0xffffffff) {\n    return 0xffffffff;\n  }\nLAB_00301ea1:\n  if (param_1 == 0xffffffff) {\n    return 0;\n  }\n  if (uVar4 != param_1) {\n    if (wVar7 != (wfilebuf)0x0) {\n      return 0xffffffff;\n    }\n    pwVar5 = *(wfilebuf **)(this + 0x10);\n    if (this[0xc0] == (wfilebuf)0x0) {\n      *(wfilebuf **)(this + 0xb0) = pwVar5;\n      uVar2 = *(undefined8 *)(this + 0x18);\n      *(wfilebuf **)(this + 0x18) = this + 0xb0;\n      *(undefined8 *)(this + 0xb8) = uVar2;\n      pwVar5 = this + 0xac;\n      *(wfilebuf **)(this + 8) = pwVar5;\n      *(wfilebuf **)(this + 0x10) = pwVar5;\n      this[0xc0] = (wfilebuf)0x1;\n    }\n    this[0xa9] = (wfilebuf)0x1;\n    *(uint *)pwVar5 = param_1;\n    return param_1;\n  }\n  return uVar4;\n}" type_identifier (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wfilebuf::" identifier : : identifier : :) (function_declarator "pbackfail(wfilebuf *this,uint param_1)" identifier (parameter_list "(wfilebuf *this,uint param_1)" ( (parameter_declaration "wfilebuf *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "uint param_1" type_identifier identifier) ))) (compound_statement "{\n  ulong uVar1;\n  undefined8 uVar2;\n  int iVar3;\n  uint uVar4;\n  wfilebuf *pwVar5;\n  long lVar6;\n  wfilebuf wVar7;\n  \n  if (((byte)this[0x78] & 8) == 0) {\n    return 0xffffffff;\n  }\n  if (this[0xaa] == (wfilebuf)0x0) {\n    uVar1 = *(ulong *)(this + 0x10);\n    wVar7 = this[0xc0];\n    if (*(ulong *)(this + 8) < uVar1) {\n      *(ulong *)(this + 0x10) = uVar1 - 4;\n      uVar4 = *(uint *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }\n  else {\n    iVar3 = (**(code **)(*(long *)this + 0x68))(this,0xffffffff);\n    if (iVar3 == -1) {\n      return 0xffffffff;\n    }\n    uVar2 = *(undefined8 *)(this + 0x98);\n    *(undefined8 *)(this + 0x28) = 0;\n    *(undefined8 *)(this + 0x20) = 0;\n    wVar7 = this[0xc0];\n    *(undefined8 *)(this + 8) = uVar2;\n    *(undefined8 *)(this + 0x10) = uVar2;\n    *(undefined8 *)(this + 0x18) = uVar2;\n    *(undefined8 *)(this + 0x30) = 0;\n    this[0xaa] = (wfilebuf)0x0;\n  }\n  lVar6 = (**(code **)(*(long *)this + 0x20))(this,0xffffffffffffffff,1,0x18);\n  if (lVar6 == -1) {\n    return 0xffffffff;\n  }\n  uVar4 = (**(code **)(*(long *)this + 0x48))(this);\n  if (uVar4 == 0xffffffff) {\n    return 0xffffffff;\n  }\nLAB_00301ea1:\n  if (param_1 == 0xffffffff) {\n    return 0;\n  }\n  if (uVar4 != param_1) {\n    if (wVar7 != (wfilebuf)0x0) {\n      return 0xffffffff;\n    }\n    pwVar5 = *(wfilebuf **)(this + 0x10);\n    if (this[0xc0] == (wfilebuf)0x0) {\n      *(wfilebuf **)(this + 0xb0) = pwVar5;\n      uVar2 = *(undefined8 *)(this + 0x18);\n      *(wfilebuf **)(this + 0x18) = this + 0xb0;\n      *(undefined8 *)(this + 0xb8) = uVar2;\n      pwVar5 = this + 0xac;\n      *(wfilebuf **)(this + 8) = pwVar5;\n      *(wfilebuf **)(this + 0x10) = pwVar5;\n      this[0xc0] = (wfilebuf)0x1;\n    }\n    this[0xa9] = (wfilebuf)0x1;\n    *(uint *)pwVar5 = param_1;\n    return param_1;\n  }\n  return uVar4;\n}" { (declaration "ulong uVar1;" type_identifier identifier ;) (declaration "undefined8 uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "wfilebuf *pwVar5;" type_identifier (pointer_declarator "*pwVar5" * identifier) ;) (declaration "long lVar6;" (sized_type_specifier "long" long) identifier ;) (declaration "wfilebuf wVar7;" type_identifier identifier ;) (if_statement "if (((byte)this[0x78] & 8) == 0) {\n    return 0xffffffff;\n  }" if (parenthesized_expression "(((byte)this[0x78] & 8) == 0)" ( (binary_expression "((byte)this[0x78] & 8) == 0" (parenthesized_expression "((byte)this[0x78] & 8)" ( (binary_expression "(byte)this[0x78] & 8" (cast_expression "(byte)this[0x78]" ( (type_descriptor "byte" type_identifier) ) (subscript_expression "this[0x78]" identifier [ number_literal ])) & number_literal) )) == number_literal) )) (compound_statement "{\n    return 0xffffffff;\n  }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (if_statement "if (this[0xaa] == (wfilebuf)0x0) {\n    uVar1 = *(ulong *)(this + 0x10);\n    wVar7 = this[0xc0];\n    if (*(ulong *)(this + 8) < uVar1) {\n      *(ulong *)(this + 0x10) = uVar1 - 4;\n      uVar4 = *(uint *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }\n  else {\n    iVar3 = (**(code **)(*(long *)this + 0x68))(this,0xffffffff);\n    if (iVar3 == -1) {\n      return 0xffffffff;\n    }\n    uVar2 = *(undefined8 *)(this + 0x98);\n    *(undefined8 *)(this + 0x28) = 0;\n    *(undefined8 *)(this + 0x20) = 0;\n    wVar7 = this[0xc0];\n    *(undefined8 *)(this + 8) = uVar2;\n    *(undefined8 *)(this + 0x10) = uVar2;\n    *(undefined8 *)(this + 0x18) = uVar2;\n    *(undefined8 *)(this + 0x30) = 0;\n    this[0xaa] = (wfilebuf)0x0;\n  }" if (parenthesized_expression "(this[0xaa] == (wfilebuf)0x0)" ( (binary_expression "this[0xaa] == (wfilebuf)0x0" (subscript_expression "this[0xaa]" identifier [ number_literal ]) == (cast_expression "(wfilebuf)0x0" ( (type_descriptor "wfilebuf" type_identifier) ) number_literal)) )) (compound_statement "{\n    uVar1 = *(ulong *)(this + 0x10);\n    wVar7 = this[0xc0];\n    if (*(ulong *)(this + 8) < uVar1) {\n      *(ulong *)(this + 0x10) = uVar1 - 4;\n      uVar4 = *(uint *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }" { (expression_statement "uVar1 = *(ulong *)(this + 0x10);" (assignment_expression "uVar1 = *(ulong *)(this + 0x10)" identifier = (pointer_expression "*(ulong *)(this + 0x10)" * (cast_expression "(ulong *)(this + 0x10)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x10)" ( (binary_expression "this + 0x10" identifier + number_literal) ))))) ;) (expression_statement "wVar7 = this[0xc0];" (assignment_expression "wVar7 = this[0xc0]" identifier = (subscript_expression "this[0xc0]" identifier [ number_literal ])) ;) (if_statement "if (*(ulong *)(this + 8) < uVar1) {\n      *(ulong *)(this + 0x10) = uVar1 - 4;\n      uVar4 = *(uint *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }" if (parenthesized_expression "(*(ulong *)(this + 8) < uVar1)" ( (binary_expression "*(ulong *)(this + 8) < uVar1" (pointer_expression "*(ulong *)(this + 8)" * (cast_expression "(ulong *)(this + 8)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) < identifier) )) (compound_statement "{\n      *(ulong *)(this + 0x10) = uVar1 - 4;\n      uVar4 = *(uint *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }" { (expression_statement "*(ulong *)(this + 0x10) = uVar1 - 4;" (assignment_expression "*(ulong *)(this + 0x10) = uVar1 - 4" (pointer_expression "*(ulong *)(this + 0x10)" * (cast_expression "(ulong *)(this + 0x10)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x10)" ( (binary_expression "this + 0x10" identifier + number_literal) )))) = (binary_expression "uVar1 - 4" identifier - number_literal)) ;) (expression_statement "uVar4 = *(uint *)(uVar1 - 4);" (assignment_expression "uVar4 = *(uint *)(uVar1 - 4)" identifier = (pointer_expression "*(uint *)(uVar1 - 4)" * (cast_expression "(uint *)(uVar1 - 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar1 - 4)" ( (binary_expression "uVar1 - 4" identifier - number_literal) ))))) ;) (goto_statement "goto LAB_00301ea1;" goto statement_identifier ;) })) }) (else_clause "else {\n    iVar3 = (**(code **)(*(long *)this + 0x68))(this,0xffffffff);\n    if (iVar3 == -1) {\n      return 0xffffffff;\n    }\n    uVar2 = *(undefined8 *)(this + 0x98);\n    *(undefined8 *)(this + 0x28) = 0;\n    *(undefined8 *)(this + 0x20) = 0;\n    wVar7 = this[0xc0];\n    *(undefined8 *)(this + 8) = uVar2;\n    *(undefined8 *)(this + 0x10) = uVar2;\n    *(undefined8 *)(this + 0x18) = uVar2;\n    *(undefined8 *)(this + 0x30) = 0;\n    this[0xaa] = (wfilebuf)0x0;\n  }" else (compound_statement "{\n    iVar3 = (**(code **)(*(long *)this + 0x68))(this,0xffffffff);\n    if (iVar3 == -1) {\n      return 0xffffffff;\n    }\n    uVar2 = *(undefined8 *)(this + 0x98);\n    *(undefined8 *)(this + 0x28) = 0;\n    *(undefined8 *)(this + 0x20) = 0;\n    wVar7 = this[0xc0];\n    *(undefined8 *)(this + 8) = uVar2;\n    *(undefined8 *)(this + 0x10) = uVar2;\n    *(undefined8 *)(this + 0x18) = uVar2;\n    *(undefined8 *)(this + 0x30) = 0;\n    this[0xaa] = (wfilebuf)0x0;\n  }" { (expression_statement "iVar3 = (**(code **)(*(long *)this + 0x68))(this,0xffffffff);" (assignment_expression "iVar3 = (**(code **)(*(long *)this + 0x68))(this,0xffffffff)" identifier = (call_expression "(**(code **)(*(long *)this + 0x68))(this,0xffffffff)" (parenthesized_expression "(**(code **)(*(long *)this + 0x68))" ( (pointer_expression "**(code **)(*(long *)this + 0x68)" * (pointer_expression "*(code **)(*(long *)this + 0x68)" * (cast_expression "(code **)(*(long *)this + 0x68)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(long *)this + 0x68)" ( (binary_expression "*(long *)this + 0x68" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) )) (argument_list "(this,0xffffffff)" ( identifier , number_literal )))) ;) (if_statement "if (iVar3 == -1) {\n      return 0xffffffff;\n    }" if (parenthesized_expression "(iVar3 == -1)" ( (binary_expression "iVar3 == -1" identifier == number_literal) )) (compound_statement "{\n      return 0xffffffff;\n    }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (expression_statement "uVar2 = *(undefined8 *)(this + 0x98);" (assignment_expression "uVar2 = *(undefined8 *)(this + 0x98)" identifier = (pointer_expression "*(undefined8 *)(this + 0x98)" * (cast_expression "(undefined8 *)(this + 0x98)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x98)" ( (binary_expression "this + 0x98" identifier + number_literal) ))))) ;) (expression_statement "*(undefined8 *)(this + 0x28) = 0;" (assignment_expression "*(undefined8 *)(this + 0x28) = 0" (pointer_expression "*(undefined8 *)(this + 0x28)" * (cast_expression "(undefined8 *)(this + 0x28)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x28)" ( (binary_expression "this + 0x28" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined8 *)(this + 0x20) = 0;" (assignment_expression "*(undefined8 *)(this + 0x20) = 0" (pointer_expression "*(undefined8 *)(this + 0x20)" * (cast_expression "(undefined8 *)(this + 0x20)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x20)" ( (binary_expression "this + 0x20" identifier + number_literal) )))) = number_literal) ;) (expression_statement "wVar7 = this[0xc0];" (assignment_expression "wVar7 = this[0xc0]" identifier = (subscript_expression "this[0xc0]" identifier [ number_literal ])) ;) (expression_statement "*(undefined8 *)(this + 8) = uVar2;" (assignment_expression "*(undefined8 *)(this + 8) = uVar2" (pointer_expression "*(undefined8 *)(this + 8)" * (cast_expression "(undefined8 *)(this + 8)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined8 *)(this + 0x10) = uVar2;" (assignment_expression "*(undefined8 *)(this + 0x10) = uVar2" (pointer_expression "*(undefined8 *)(this + 0x10)" * (cast_expression "(undefined8 *)(this + 0x10)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x10)" ( (binary_expression "this + 0x10" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined8 *)(this + 0x18) = uVar2;" (assignment_expression "*(undefined8 *)(this + 0x18) = uVar2" (pointer_expression "*(undefined8 *)(this + 0x18)" * (cast_expression "(undefined8 *)(this + 0x18)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x18)" ( (binary_expression "this + 0x18" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(undefined8 *)(this + 0x30) = 0;" (assignment_expression "*(undefined8 *)(this + 0x30) = 0" (pointer_expression "*(undefined8 *)(this + 0x30)" * (cast_expression "(undefined8 *)(this + 0x30)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x30)" ( (binary_expression "this + 0x30" identifier + number_literal) )))) = number_literal) ;) (expression_statement "this[0xaa] = (wfilebuf)0x0;" (assignment_expression "this[0xaa] = (wfilebuf)0x0" (subscript_expression "this[0xaa]" identifier [ number_literal ]) = (cast_expression "(wfilebuf)0x0" ( (type_descriptor "wfilebuf" type_identifier) ) number_literal)) ;) }))) (expression_statement "lVar6 = (**(code **)(*(long *)this + 0x20))(this,0xffffffffffffffff,1,0x18);" (assignment_expression "lVar6 = (**(code **)(*(long *)this + 0x20))(this,0xffffffffffffffff,1,0x18)" identifier = (call_expression "(**(code **)(*(long *)this + 0x20))(this,0xffffffffffffffff,1,0x18)" (parenthesized_expression "(**(code **)(*(long *)this + 0x20))" ( (pointer_expression "**(code **)(*(long *)this + 0x20)" * (pointer_expression "*(code **)(*(long *)this + 0x20)" * (cast_expression "(code **)(*(long *)this + 0x20)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(long *)this + 0x20)" ( (binary_expression "*(long *)this + 0x20" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) )) (argument_list "(this,0xffffffffffffffff,1,0x18)" ( identifier , number_literal , number_literal , number_literal )))) ;) (if_statement "if (lVar6 == -1) {\n    return 0xffffffff;\n  }" if (parenthesized_expression "(lVar6 == -1)" ( (binary_expression "lVar6 == -1" identifier == number_literal) )) (compound_statement "{\n    return 0xffffffff;\n  }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (expression_statement "uVar4 = (**(code **)(*(long *)this + 0x48))(this);" (assignment_expression "uVar4 = (**(code **)(*(long *)this + 0x48))(this)" identifier = (call_expression "(**(code **)(*(long *)this + 0x48))(this)" (parenthesized_expression "(**(code **)(*(long *)this + 0x48))" ( (pointer_expression "**(code **)(*(long *)this + 0x48)" * (pointer_expression "*(code **)(*(long *)this + 0x48)" * (cast_expression "(code **)(*(long *)this + 0x48)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(long *)this + 0x48)" ( (binary_expression "*(long *)this + 0x48" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) )) (argument_list "(this)" ( identifier )))) ;) (if_statement "if (uVar4 == 0xffffffff) {\n    return 0xffffffff;\n  }" if (parenthesized_expression "(uVar4 == 0xffffffff)" ( (binary_expression "uVar4 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n    return 0xffffffff;\n  }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (labeled_statement "LAB_00301ea1:\n  if (param_1 == 0xffffffff) {\n    return 0;\n  }" statement_identifier : (if_statement "if (param_1 == 0xffffffff) {\n    return 0;\n  }" if (parenthesized_expression "(param_1 == 0xffffffff)" ( (binary_expression "param_1 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) }))) (if_statement "if (uVar4 != param_1) {\n    if (wVar7 != (wfilebuf)0x0) {\n      return 0xffffffff;\n    }\n    pwVar5 = *(wfilebuf **)(this + 0x10);\n    if (this[0xc0] == (wfilebuf)0x0) {\n      *(wfilebuf **)(this + 0xb0) = pwVar5;\n      uVar2 = *(undefined8 *)(this + 0x18);\n      *(wfilebuf **)(this + 0x18) = this + 0xb0;\n      *(undefined8 *)(this + 0xb8) = uVar2;\n      pwVar5 = this + 0xac;\n      *(wfilebuf **)(this + 8) = pwVar5;\n      *(wfilebuf **)(this + 0x10) = pwVar5;\n      this[0xc0] = (wfilebuf)0x1;\n    }\n    this[0xa9] = (wfilebuf)0x1;\n    *(uint *)pwVar5 = param_1;\n    return param_1;\n  }" if (parenthesized_expression "(uVar4 != param_1)" ( (binary_expression "uVar4 != param_1" identifier != identifier) )) (compound_statement "{\n    if (wVar7 != (wfilebuf)0x0) {\n      return 0xffffffff;\n    }\n    pwVar5 = *(wfilebuf **)(this + 0x10);\n    if (this[0xc0] == (wfilebuf)0x0) {\n      *(wfilebuf **)(this + 0xb0) = pwVar5;\n      uVar2 = *(undefined8 *)(this + 0x18);\n      *(wfilebuf **)(this + 0x18) = this + 0xb0;\n      *(undefined8 *)(this + 0xb8) = uVar2;\n      pwVar5 = this + 0xac;\n      *(wfilebuf **)(this + 8) = pwVar5;\n      *(wfilebuf **)(this + 0x10) = pwVar5;\n      this[0xc0] = (wfilebuf)0x1;\n    }\n    this[0xa9] = (wfilebuf)0x1;\n    *(uint *)pwVar5 = param_1;\n    return param_1;\n  }" { (if_statement "if (wVar7 != (wfilebuf)0x0) {\n      return 0xffffffff;\n    }" if (parenthesized_expression "(wVar7 != (wfilebuf)0x0)" ( (binary_expression "wVar7 != (wfilebuf)0x0" identifier != (cast_expression "(wfilebuf)0x0" ( (type_descriptor "wfilebuf" type_identifier) ) number_literal)) )) (compound_statement "{\n      return 0xffffffff;\n    }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (expression_statement "pwVar5 = *(wfilebuf **)(this + 0x10);" (assignment_expression "pwVar5 = *(wfilebuf **)(this + 0x10)" identifier = (pointer_expression "*(wfilebuf **)(this + 0x10)" * (cast_expression "(wfilebuf **)(this + 0x10)" ( (type_descriptor "wfilebuf **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x10)" ( (binary_expression "this + 0x10" identifier + number_literal) ))))) ;) (if_statement "if (this[0xc0] == (wfilebuf)0x0) {\n      *(wfilebuf **)(this + 0xb0) = pwVar5;\n      uVar2 = *(undefined8 *)(this + 0x18);\n      *(wfilebuf **)(this + 0x18) = this + 0xb0;\n      *(undefined8 *)(this + 0xb8) = uVar2;\n      pwVar5 = this + 0xac;\n      *(wfilebuf **)(this + 8) = pwVar5;\n      *(wfilebuf **)(this + 0x10) = pwVar5;\n      this[0xc0] = (wfilebuf)0x1;\n    }" if (parenthesized_expression "(this[0xc0] == (wfilebuf)0x0)" ( (binary_expression "this[0xc0] == (wfilebuf)0x0" (subscript_expression "this[0xc0]" identifier [ number_literal ]) == (cast_expression "(wfilebuf)0x0" ( (type_descriptor "wfilebuf" type_identifier) ) number_literal)) )) (compound_statement "{\n      *(wfilebuf **)(this + 0xb0) = pwVar5;\n      uVar2 = *(undefined8 *)(this + 0x18);\n      *(wfilebuf **)(this + 0x18) = this + 0xb0;\n      *(undefined8 *)(this + 0xb8) = uVar2;\n      pwVar5 = this + 0xac;\n      *(wfilebuf **)(this + 8) = pwVar5;\n      *(wfilebuf **)(this + 0x10) = pwVar5;\n      this[0xc0] = (wfilebuf)0x1;\n    }" { (expression_statement "*(wfilebuf **)(this + 0xb0) = pwVar5;" (assignment_expression "*(wfilebuf **)(this + 0xb0) = pwVar5" (pointer_expression "*(wfilebuf **)(this + 0xb0)" * (cast_expression "(wfilebuf **)(this + 0xb0)" ( (type_descriptor "wfilebuf **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0xb0)" ( (binary_expression "this + 0xb0" identifier + number_literal) )))) = identifier) ;) (expression_statement "uVar2 = *(undefined8 *)(this + 0x18);" (assignment_expression "uVar2 = *(undefined8 *)(this + 0x18)" identifier = (pointer_expression "*(undefined8 *)(this + 0x18)" * (cast_expression "(undefined8 *)(this + 0x18)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x18)" ( (binary_expression "this + 0x18" identifier + number_literal) ))))) ;) (expression_statement "*(wfilebuf **)(this + 0x18) = this + 0xb0;" (assignment_expression "*(wfilebuf **)(this + 0x18) = this + 0xb0" (pointer_expression "*(wfilebuf **)(this + 0x18)" * (cast_expression "(wfilebuf **)(this + 0x18)" ( (type_descriptor "wfilebuf **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x18)" ( (binary_expression "this + 0x18" identifier + number_literal) )))) = (binary_expression "this + 0xb0" identifier + number_literal)) ;) (expression_statement "*(undefined8 *)(this + 0xb8) = uVar2;" (assignment_expression "*(undefined8 *)(this + 0xb8) = uVar2" (pointer_expression "*(undefined8 *)(this + 0xb8)" * (cast_expression "(undefined8 *)(this + 0xb8)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0xb8)" ( (binary_expression "this + 0xb8" identifier + number_literal) )))) = identifier) ;) (expression_statement "pwVar5 = this + 0xac;" (assignment_expression "pwVar5 = this + 0xac" identifier = (binary_expression "this + 0xac" identifier + number_literal)) ;) (expression_statement "*(wfilebuf **)(this + 8) = pwVar5;" (assignment_expression "*(wfilebuf **)(this + 8) = pwVar5" (pointer_expression "*(wfilebuf **)(this + 8)" * (cast_expression "(wfilebuf **)(this + 8)" ( (type_descriptor "wfilebuf **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(wfilebuf **)(this + 0x10) = pwVar5;" (assignment_expression "*(wfilebuf **)(this + 0x10) = pwVar5" (pointer_expression "*(wfilebuf **)(this + 0x10)" * (cast_expression "(wfilebuf **)(this + 0x10)" ( (type_descriptor "wfilebuf **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x10)" ( (binary_expression "this + 0x10" identifier + number_literal) )))) = identifier) ;) (expression_statement "this[0xc0] = (wfilebuf)0x1;" (assignment_expression "this[0xc0] = (wfilebuf)0x1" (subscript_expression "this[0xc0]" identifier [ number_literal ]) = (cast_expression "(wfilebuf)0x1" ( (type_descriptor "wfilebuf" type_identifier) ) number_literal)) ;) })) (expression_statement "this[0xa9] = (wfilebuf)0x1;" (assignment_expression "this[0xa9] = (wfilebuf)0x1" (subscript_expression "this[0xa9]" identifier [ number_literal ]) = (cast_expression "(wfilebuf)0x1" ( (type_descriptor "wfilebuf" type_identifier) ) number_literal)) ;) (expression_statement "*(uint *)pwVar5 = param_1;" (assignment_expression "*(uint *)pwVar5 = param_1" (pointer_expression "*(uint *)pwVar5" * (cast_expression "(uint *)pwVar5" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) = identifier) ;) (return_statement "return param_1;" return identifier ;) })) (return_statement "return uVar4;" return identifier ;) })))
(translation_unit "int FUN_00301e60(long *param_1,int param_2)\n\n{\n  ulong uVar1;\n  int iVar2;\n  int *piVar3;\n  long lVar4;\n  char cVar5;\n  \n  if ((*(byte *)(param_1 + 0xf) & 8) == 0) {\n    return -1;\n  }\n  if (*(char *)((long)param_1 + 0xaa) == '\0') {\n    uVar1 = param_1[2];\n    cVar5 = (char)param_1[0x18];\n    if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }\n  else {\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }\n  lVar4 = (**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18);\n  if (lVar4 == -1) {\n    return -1;\n  }\n  iVar2 = (**(code **)(*param_1 + 0x48))(param_1);\n  if (iVar2 == -1) {\n    return -1;\n  }\nLAB_00301ea1:\n  if (param_2 == -1) {\n    return 0;\n  }\n  if (iVar2 != param_2) {\n    if (cVar5 != '\0') {\n      return -1;\n    }\n    piVar3 = (int *)param_1[2];\n    if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }\n    *(undefined1 *)((long)param_1 + 0xa9) = 1;\n    *piVar3 = param_2;\n    return param_2;\n  }\n  return iVar2;\n}\n\n" (function_definition "int FUN_00301e60(long *param_1,int param_2)\n\n{\n  ulong uVar1;\n  int iVar2;\n  int *piVar3;\n  long lVar4;\n  char cVar5;\n  \n  if ((*(byte *)(param_1 + 0xf) & 8) == 0) {\n    return -1;\n  }\n  if (*(char *)((long)param_1 + 0xaa) == '\0') {\n    uVar1 = param_1[2];\n    cVar5 = (char)param_1[0x18];\n    if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }\n  else {\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }\n  lVar4 = (**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18);\n  if (lVar4 == -1) {\n    return -1;\n  }\n  iVar2 = (**(code **)(*param_1 + 0x48))(param_1);\n  if (iVar2 == -1) {\n    return -1;\n  }\nLAB_00301ea1:\n  if (param_2 == -1) {\n    return 0;\n  }\n  if (iVar2 != param_2) {\n    if (cVar5 != '\0') {\n      return -1;\n    }\n    piVar3 = (int *)param_1[2];\n    if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }\n    *(undefined1 *)((long)param_1 + 0xa9) = 1;\n    *piVar3 = param_2;\n    return param_2;\n  }\n  return iVar2;\n}" primitive_type (function_declarator "FUN_00301e60(long *param_1,int param_2)" identifier (parameter_list "(long *param_1,int param_2)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  ulong uVar1;\n  int iVar2;\n  int *piVar3;\n  long lVar4;\n  char cVar5;\n  \n  if ((*(byte *)(param_1 + 0xf) & 8) == 0) {\n    return -1;\n  }\n  if (*(char *)((long)param_1 + 0xaa) == '\0') {\n    uVar1 = param_1[2];\n    cVar5 = (char)param_1[0x18];\n    if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }\n  else {\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }\n  lVar4 = (**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18);\n  if (lVar4 == -1) {\n    return -1;\n  }\n  iVar2 = (**(code **)(*param_1 + 0x48))(param_1);\n  if (iVar2 == -1) {\n    return -1;\n  }\nLAB_00301ea1:\n  if (param_2 == -1) {\n    return 0;\n  }\n  if (iVar2 != param_2) {\n    if (cVar5 != '\0') {\n      return -1;\n    }\n    piVar3 = (int *)param_1[2];\n    if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }\n    *(undefined1 *)((long)param_1 + 0xa9) = 1;\n    *piVar3 = param_2;\n    return param_2;\n  }\n  return iVar2;\n}" { (declaration "ulong uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (declaration "char cVar5;" primitive_type identifier ;) (if_statement "if ((*(byte *)(param_1 + 0xf) & 8) == 0) {\n    return -1;\n  }" if (parenthesized_expression "((*(byte *)(param_1 + 0xf) & 8) == 0)" ( (binary_expression "(*(byte *)(param_1 + 0xf) & 8) == 0" (parenthesized_expression "(*(byte *)(param_1 + 0xf) & 8)" ( (binary_expression "*(byte *)(param_1 + 0xf) & 8" (pointer_expression "*(byte *)(param_1 + 0xf)" * (cast_expression "(byte *)(param_1 + 0xf)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xf)" ( (binary_expression "param_1 + 0xf" identifier + number_literal) )))) & number_literal) )) == number_literal) )) (compound_statement "{\n    return -1;\n  }" { (return_statement "return -1;" return number_literal ;) })) (if_statement "if (*(char *)((long)param_1 + 0xaa) == '\0') {\n    uVar1 = param_1[2];\n    cVar5 = (char)param_1[0x18];\n    if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }\n  else {\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }" if (parenthesized_expression "(*(char *)((long)param_1 + 0xaa) == '\0')" ( (binary_expression "*(char *)((long)param_1 + 0xaa) == '\0'" (pointer_expression "*(char *)((long)param_1 + 0xaa)" * (cast_expression "(char *)((long)param_1 + 0xaa)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_1 + 0xaa)" ( (binary_expression "(long)param_1 + 0xaa" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    uVar1 = param_1[2];\n    cVar5 = (char)param_1[0x18];\n    if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }" { (expression_statement "uVar1 = param_1[2];" (assignment_expression "uVar1 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) (expression_statement "cVar5 = (char)param_1[0x18];" (assignment_expression "cVar5 = (char)param_1[0x18]" identifier = (cast_expression "(char)param_1[0x18]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "param_1[0x18]" identifier [ number_literal ]))) ;) (if_statement "if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }" if (parenthesized_expression "((ulong)param_1[1] < uVar1)" ( (binary_expression "(ulong)param_1[1] < uVar1" (cast_expression "(ulong)param_1[1]" ( (type_descriptor "ulong" type_identifier) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) < identifier) )) (compound_statement "{\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }" { (expression_statement "param_1[2] = uVar1 - 4;" (assignment_expression "param_1[2] = uVar1 - 4" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "uVar1 - 4" identifier - number_literal)) ;) (expression_statement "iVar2 = *(int *)(uVar1 - 4);" (assignment_expression "iVar2 = *(int *)(uVar1 - 4)" identifier = (pointer_expression "*(int *)(uVar1 - 4)" * (cast_expression "(int *)(uVar1 - 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar1 - 4)" ( (binary_expression "uVar1 - 4" identifier - number_literal) ))))) ;) (goto_statement "goto LAB_00301ea1;" goto statement_identifier ;) })) }) (else_clause "else {\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }" else (compound_statement "{\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }" { (expression_statement "iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);" (assignment_expression "iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff)" identifier = (call_expression "(**(code **)(*param_1 + 0x68))(param_1,0xffffffff)" (parenthesized_expression "(**(code **)(*param_1 + 0x68))" ( (pointer_expression "**(code **)(*param_1 + 0x68)" * (pointer_expression "*(code **)(*param_1 + 0x68)" * (cast_expression "(code **)(*param_1 + 0x68)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x68)" ( (binary_expression "*param_1 + 0x68" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )) (argument_list "(param_1,0xffffffff)" ( identifier , number_literal )))) ;) (if_statement "if (iVar2 == -1) {\n      return -1;\n    }" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (compound_statement "{\n      return -1;\n    }" { (return_statement "return -1;" return number_literal ;) })) (expression_statement "lVar4 = param_1[0x13];" (assignment_expression "lVar4 = param_1[0x13]" identifier = (subscript_expression "param_1[0x13]" identifier [ number_literal ])) ;) (expression_statement "param_1[5] = 0;" (assignment_expression "param_1[5] = 0" (subscript_expression "param_1[5]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_1[4] = 0;" (assignment_expression "param_1[4] = 0" (subscript_expression "param_1[4]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "cVar5 = (char)param_1[0x18];" (assignment_expression "cVar5 = (char)param_1[0x18]" identifier = (cast_expression "(char)param_1[0x18]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "param_1[0x18]" identifier [ number_literal ]))) ;) (expression_statement "param_1[1] = lVar4;" (assignment_expression "param_1[1] = lVar4" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "param_1[2] = lVar4;" (assignment_expression "param_1[2] = lVar4" (subscript_expression "param_1[2]" identifier [ number_literal ]) = identifier) ;) (expression_statement "param_1[3] = lVar4;" (assignment_expression "param_1[3] = lVar4" (subscript_expression "param_1[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "param_1[6] = 0;" (assignment_expression "param_1[6] = 0" (subscript_expression "param_1[6]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "*(undefined1 *)((long)param_1 + 0xaa) = 0;" (assignment_expression "*(undefined1 *)((long)param_1 + 0xaa) = 0" (pointer_expression "*(undefined1 *)((long)param_1 + 0xaa)" * (cast_expression "(undefined1 *)((long)param_1 + 0xaa)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_1 + 0xaa)" ( (binary_expression "(long)param_1 + 0xaa" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) = number_literal) ;) }))) (expression_statement "lVar4 = (**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18);" (assignment_expression "lVar4 = (**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18)" identifier = (call_expression "(**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18)" (parenthesized_expression "(**(code **)(*param_1 + 0x20))" ( (pointer_expression "**(code **)(*param_1 + 0x20)" * (pointer_expression "*(code **)(*param_1 + 0x20)" * (cast_expression "(code **)(*param_1 + 0x20)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x20)" ( (binary_expression "*param_1 + 0x20" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )) (argument_list "(param_1,0xffffffffffffffff,1,0x18)" ( identifier , number_literal , number_literal , number_literal )))) ;) (if_statement "if (lVar4 == -1) {\n    return -1;\n  }" if (parenthesized_expression "(lVar4 == -1)" ( (binary_expression "lVar4 == -1" identifier == number_literal) )) (compound_statement "{\n    return -1;\n  }" { (return_statement "return -1;" return number_literal ;) })) (expression_statement "iVar2 = (**(code **)(*param_1 + 0x48))(param_1);" (assignment_expression "iVar2 = (**(code **)(*param_1 + 0x48))(param_1)" identifier = (call_expression "(**(code **)(*param_1 + 0x48))(param_1)" (parenthesized_expression "(**(code **)(*param_1 + 0x48))" ( (pointer_expression "**(code **)(*param_1 + 0x48)" * (pointer_expression "*(code **)(*param_1 + 0x48)" * (cast_expression "(code **)(*param_1 + 0x48)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x48)" ( (binary_expression "*param_1 + 0x48" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )) (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar2 == -1) {\n    return -1;\n  }" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (compound_statement "{\n    return -1;\n  }" { (return_statement "return -1;" return number_literal ;) })) (labeled_statement "LAB_00301ea1:\n  if (param_2 == -1) {\n    return 0;\n  }" statement_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 ;) }))) (if_statement "if (iVar2 != param_2) {\n    if (cVar5 != '\0') {\n      return -1;\n    }\n    piVar3 = (int *)param_1[2];\n    if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }\n    *(undefined1 *)((long)param_1 + 0xa9) = 1;\n    *piVar3 = param_2;\n    return param_2;\n  }" if (parenthesized_expression "(iVar2 != param_2)" ( (binary_expression "iVar2 != param_2" identifier != identifier) )) (compound_statement "{\n    if (cVar5 != '\0') {\n      return -1;\n    }\n    piVar3 = (int *)param_1[2];\n    if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }\n    *(undefined1 *)((long)param_1 + 0xa9) = 1;\n    *piVar3 = param_2;\n    return param_2;\n  }" { (if_statement "if (cVar5 != '\0') {\n      return -1;\n    }" if (parenthesized_expression "(cVar5 != '\0')" ( (binary_expression "cVar5 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      return -1;\n    }" { (return_statement "return -1;" return number_literal ;) })) (expression_statement "piVar3 = (int *)param_1[2];" (assignment_expression "piVar3 = (int *)param_1[2]" identifier = (cast_expression "(int *)param_1[2]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ]))) ;) (if_statement "if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }" if (parenthesized_expression "((char)param_1[0x18] == '\0')" ( (binary_expression "(char)param_1[0x18] == '\0'" (cast_expression "(char)param_1[0x18]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "param_1[0x18]" identifier [ number_literal ])) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }" { (expression_statement "param_1[0x16] = (long)piVar3;" (assignment_expression "param_1[0x16] = (long)piVar3" (subscript_expression "param_1[0x16]" identifier [ number_literal ]) = (cast_expression "(long)piVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) (expression_statement "lVar4 = param_1[3];" (assignment_expression "lVar4 = param_1[3]" identifier = (subscript_expression "param_1[3]" identifier [ number_literal ])) ;) (expression_statement "param_1[3] = (long)(param_1 + 0x16);" (assignment_expression "param_1[3] = (long)(param_1 + 0x16)" (subscript_expression "param_1[3]" identifier [ number_literal ]) = (cast_expression "(long)(param_1 + 0x16)" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (parenthesized_expression "(param_1 + 0x16)" ( (binary_expression "param_1 + 0x16" identifier + number_literal) )))) ;) (expression_statement "param_1[0x17] = lVar4;" (assignment_expression "param_1[0x17] = lVar4" (subscript_expression "param_1[0x17]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar3 = (int *)((long)param_1 + 0xac);" (assignment_expression "piVar3 = (int *)((long)param_1 + 0xac)" identifier = (cast_expression "(int *)((long)param_1 + 0xac)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_1 + 0xac)" ( (binary_expression "(long)param_1 + 0xac" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) ;) (expression_statement "param_1[1] = (long)piVar3;" (assignment_expression "param_1[1] = (long)piVar3" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (cast_expression "(long)piVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) (expression_statement "param_1[2] = (long)piVar3;" (assignment_expression "param_1[2] = (long)piVar3" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (cast_expression "(long)piVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) (expression_statement "*(undefined1 *)(param_1 + 0x18) = 1;" (assignment_expression "*(undefined1 *)(param_1 + 0x18) = 1" (pointer_expression "*(undefined1 *)(param_1 + 0x18)" * (cast_expression "(undefined1 *)(param_1 + 0x18)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) )))) = number_literal) ;) })) (expression_statement "*(undefined1 *)((long)param_1 + 0xa9) = 1;" (assignment_expression "*(undefined1 *)((long)param_1 + 0xa9) = 1" (pointer_expression "*(undefined1 *)((long)param_1 + 0xa9)" * (cast_expression "(undefined1 *)((long)param_1 + 0xa9)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_1 + 0xa9)" ( (binary_expression "(long)param_1 + 0xa9" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) = number_literal) ;) (expression_statement "*piVar3 = param_2;" (assignment_expression "*piVar3 = param_2" (pointer_expression "*piVar3" * identifier) = identifier) ;) (return_statement "return param_2;" return identifier ;) })) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) & LIT) )) == LIT) )) (compound_statement { (return_statement return LIT ;) })) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + LIT) )))) == (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ]))) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) < IDENT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT - LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT - LIT) ))))) ;) (goto_statement goto statement_identifier ;) })) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) )) (argument_list ( IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + LIT) )))) = LIT) ;) }))) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) )) (argument_list ( IDENT , LIT , LIT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) )) (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT != IDENT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != (char_literal ' escape_sequence ')) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) == (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor (sized_type_specifier long)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + LIT) )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + LIT) )))) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (return_statement return IDENT ;) })) (return_statement return IDENT ;) })))
(function_definition "int FUN_00301e60(long *param_1,int param_2)\n\n{\n  ulong uVar1;\n  int iVar2;\n  int *piVar3;\n  long lVar4;\n  char cVar5;\n  \n  if ((*(byte *)(param_1 + 0xf) & 8) == 0) {\n    return -1;\n  }\n  if (*(char *)((long)param_1 + 0xaa) == '\0') {\n    uVar1 = param_1[2];\n    cVar5 = (char)param_1[0x18];\n    if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }\n  else {\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }\n  lVar4 = (**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18);\n  if (lVar4 == -1) {\n    return -1;\n  }\n  iVar2 = (**(code **)(*param_1 + 0x48))(param_1);\n  if (iVar2 == -1) {\n    return -1;\n  }\nLAB_00301ea1:\n  if (param_2 == -1) {\n    return 0;\n  }\n  if (iVar2 != param_2) {\n    if (cVar5 != '\0') {\n      return -1;\n    }\n    piVar3 = (int *)param_1[2];\n    if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }\n    *(undefined1 *)((long)param_1 + 0xa9) = 1;\n    *piVar3 = param_2;\n    return param_2;\n  }\n  return iVar2;\n}" (primitive_type "int") (function_declarator "FUN_00301e60(long *param_1,int param_2)" (identifier "FUN_00301e60") (parameter_list "(long *param_1,int param_2)" (( "(") (parameter_declaration "long *param_1" (sized_type_specifier "long" (long "long")) (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  ulong uVar1;\n  int iVar2;\n  int *piVar3;\n  long lVar4;\n  char cVar5;\n  \n  if ((*(byte *)(param_1 + 0xf) & 8) == 0) {\n    return -1;\n  }\n  if (*(char *)((long)param_1 + 0xaa) == '\0') {\n    uVar1 = param_1[2];\n    cVar5 = (char)param_1[0x18];\n    if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }\n  else {\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }\n  lVar4 = (**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18);\n  if (lVar4 == -1) {\n    return -1;\n  }\n  iVar2 = (**(code **)(*param_1 + 0x48))(param_1);\n  if (iVar2 == -1) {\n    return -1;\n  }\nLAB_00301ea1:\n  if (param_2 == -1) {\n    return 0;\n  }\n  if (iVar2 != param_2) {\n    if (cVar5 != '\0') {\n      return -1;\n    }\n    piVar3 = (int *)param_1[2];\n    if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }\n    *(undefined1 *)((long)param_1 + 0xa9) = 1;\n    *piVar3 = param_2;\n    return param_2;\n  }\n  return iVar2;\n}" ({ "{") (declaration "ulong uVar1;" (type_identifier "ulong") (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (declaration "long lVar4;" (sized_type_specifier "long" (long "long")) (identifier "lVar4") (; ";")) (declaration "char cVar5;" (primitive_type "char") (identifier "cVar5") (; ";")) (if_statement "if ((*(byte *)(param_1 + 0xf) & 8) == 0) {\n    return -1;\n  }" (if "if") (parenthesized_expression "((*(byte *)(param_1 + 0xf) & 8) == 0)" (( "(") (binary_expression "(*(byte *)(param_1 + 0xf) & 8) == 0" (parenthesized_expression "(*(byte *)(param_1 + 0xf) & 8)" (( "(") (binary_expression "*(byte *)(param_1 + 0xf) & 8" (pointer_expression "*(byte *)(param_1 + 0xf)" (* "*") (cast_expression "(byte *)(param_1 + 0xf)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xf)" (( "(") (binary_expression "param_1 + 0xf" (identifier "param_1") (+ "+") (number_literal "0xf")) () ")")))) (& "&") (number_literal "8")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    return -1;\n  }" ({ "{") (return_statement "return -1;" (return "return") (number_literal "-1") (; ";")) (} "}"))) (if_statement "if (*(char *)((long)param_1 + 0xaa) == '\0') {\n    uVar1 = param_1[2];\n    cVar5 = (char)param_1[0x18];\n    if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }\n  else {\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }" (if "if") (parenthesized_expression "(*(char *)((long)param_1 + 0xaa) == '\0')" (( "(") (binary_expression "*(char *)((long)param_1 + 0xaa) == '\0'" (pointer_expression "*(char *)((long)param_1 + 0xaa)" (* "*") (cast_expression "(char *)((long)param_1 + 0xaa)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)param_1 + 0xaa)" (( "(") (binary_expression "(long)param_1 + 0xaa" (cast_expression "(long)param_1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_1")) (+ "+") (number_literal "0xaa")) () ")")))) (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n    uVar1 = param_1[2];\n    cVar5 = (char)param_1[0x18];\n    if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }\n  }" ({ "{") (expression_statement "uVar1 = param_1[2];" (assignment_expression "uVar1 = param_1[2]" (identifier "uVar1") (= "=") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (expression_statement "cVar5 = (char)param_1[0x18];" (assignment_expression "cVar5 = (char)param_1[0x18]" (identifier "cVar5") (= "=") (cast_expression "(char)param_1[0x18]" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (subscript_expression "param_1[0x18]" (identifier "param_1") ([ "[") (number_literal "0x18") (] "]")))) (; ";")) (if_statement "if ((ulong)param_1[1] < uVar1) {\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }" (if "if") (parenthesized_expression "((ulong)param_1[1] < uVar1)" (( "(") (binary_expression "(ulong)param_1[1] < uVar1" (cast_expression "(ulong)param_1[1]" (( "(") (type_descriptor "ulong" (type_identifier "ulong")) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (< "<") (identifier "uVar1")) () ")")) (compound_statement "{\n      param_1[2] = uVar1 - 4;\n      iVar2 = *(int *)(uVar1 - 4);\n      goto LAB_00301ea1;\n    }" ({ "{") (expression_statement "param_1[2] = uVar1 - 4;" (assignment_expression "param_1[2] = uVar1 - 4" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (binary_expression "uVar1 - 4" (identifier "uVar1") (- "-") (number_literal "4"))) (; ";")) (expression_statement "iVar2 = *(int *)(uVar1 - 4);" (assignment_expression "iVar2 = *(int *)(uVar1 - 4)" (identifier "iVar2") (= "=") (pointer_expression "*(int *)(uVar1 - 4)" (* "*") (cast_expression "(int *)(uVar1 - 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(uVar1 - 4)" (( "(") (binary_expression "uVar1 - 4" (identifier "uVar1") (- "-") (number_literal "4")) () ")"))))) (; ";")) (goto_statement "goto LAB_00301ea1;" (goto "goto") (statement_identifier "LAB_00301ea1") (; ";")) (} "}"))) (} "}")) (else_clause "else {\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }" (else "else") (compound_statement "{\n    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);\n    if (iVar2 == -1) {\n      return -1;\n    }\n    lVar4 = param_1[0x13];\n    param_1[5] = 0;\n    param_1[4] = 0;\n    cVar5 = (char)param_1[0x18];\n    param_1[1] = lVar4;\n    param_1[2] = lVar4;\n    param_1[3] = lVar4;\n    param_1[6] = 0;\n    *(undefined1 *)((long)param_1 + 0xaa) = 0;\n  }" ({ "{") (expression_statement "iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);" (assignment_expression "iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff)" (identifier "iVar2") (= "=") (call_expression "(**(code **)(*param_1 + 0x68))(param_1,0xffffffff)" (parenthesized_expression "(**(code **)(*param_1 + 0x68))" (( "(") (pointer_expression "**(code **)(*param_1 + 0x68)" (* "*") (pointer_expression "*(code **)(*param_1 + 0x68)" (* "*") (cast_expression "(code **)(*param_1 + 0x68)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*param_1 + 0x68)" (( "(") (binary_expression "*param_1 + 0x68" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "0x68")) () ")"))))) () ")")) (argument_list "(param_1,0xffffffff)" (( "(") (identifier "param_1") (, ",") (number_literal "0xffffffff") () ")")))) (; ";")) (if_statement "if (iVar2 == -1) {\n      return -1;\n    }" (if "if") (parenthesized_expression "(iVar2 == -1)" (( "(") (binary_expression "iVar2 == -1" (identifier "iVar2") (== "==") (number_literal "-1")) () ")")) (compound_statement "{\n      return -1;\n    }" ({ "{") (return_statement "return -1;" (return "return") (number_literal "-1") (; ";")) (} "}"))) (expression_statement "lVar4 = param_1[0x13];" (assignment_expression "lVar4 = param_1[0x13]" (identifier "lVar4") (= "=") (subscript_expression "param_1[0x13]" (identifier "param_1") ([ "[") (number_literal "0x13") (] "]"))) (; ";")) (expression_statement "param_1[5] = 0;" (assignment_expression "param_1[5] = 0" (subscript_expression "param_1[5]" (identifier "param_1") ([ "[") (number_literal "5") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "param_1[4] = 0;" (assignment_expression "param_1[4] = 0" (subscript_expression "param_1[4]" (identifier "param_1") ([ "[") (number_literal "4") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "cVar5 = (char)param_1[0x18];" (assignment_expression "cVar5 = (char)param_1[0x18]" (identifier "cVar5") (= "=") (cast_expression "(char)param_1[0x18]" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (subscript_expression "param_1[0x18]" (identifier "param_1") ([ "[") (number_literal "0x18") (] "]")))) (; ";")) (expression_statement "param_1[1] = lVar4;" (assignment_expression "param_1[1] = lVar4" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "lVar4")) (; ";")) (expression_statement "param_1[2] = lVar4;" (assignment_expression "param_1[2] = lVar4" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (identifier "lVar4")) (; ";")) (expression_statement "param_1[3] = lVar4;" (assignment_expression "param_1[3] = lVar4" (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]")) (= "=") (identifier "lVar4")) (; ";")) (expression_statement "param_1[6] = 0;" (assignment_expression "param_1[6] = 0" (subscript_expression "param_1[6]" (identifier "param_1") ([ "[") (number_literal "6") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(undefined1 *)((long)param_1 + 0xaa) = 0;" (assignment_expression "*(undefined1 *)((long)param_1 + 0xaa) = 0" (pointer_expression "*(undefined1 *)((long)param_1 + 0xaa)" (* "*") (cast_expression "(undefined1 *)((long)param_1 + 0xaa)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)param_1 + 0xaa)" (( "(") (binary_expression "(long)param_1 + 0xaa" (cast_expression "(long)param_1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_1")) (+ "+") (number_literal "0xaa")) () ")")))) (= "=") (number_literal "0")) (; ";")) (} "}")))) (expression_statement "lVar4 = (**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18);" (assignment_expression "lVar4 = (**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18)" (identifier "lVar4") (= "=") (call_expression "(**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18)" (parenthesized_expression "(**(code **)(*param_1 + 0x20))" (( "(") (pointer_expression "**(code **)(*param_1 + 0x20)" (* "*") (pointer_expression "*(code **)(*param_1 + 0x20)" (* "*") (cast_expression "(code **)(*param_1 + 0x20)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*param_1 + 0x20)" (( "(") (binary_expression "*param_1 + 0x20" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "0x20")) () ")"))))) () ")")) (argument_list "(param_1,0xffffffffffffffff,1,0x18)" (( "(") (identifier "param_1") (, ",") (number_literal "0xffffffffffffffff") (, ",") (number_literal "1") (, ",") (number_literal "0x18") () ")")))) (; ";")) (if_statement "if (lVar4 == -1) {\n    return -1;\n  }" (if "if") (parenthesized_expression "(lVar4 == -1)" (( "(") (binary_expression "lVar4 == -1" (identifier "lVar4") (== "==") (number_literal "-1")) () ")")) (compound_statement "{\n    return -1;\n  }" ({ "{") (return_statement "return -1;" (return "return") (number_literal "-1") (; ";")) (} "}"))) (expression_statement "iVar2 = (**(code **)(*param_1 + 0x48))(param_1);" (assignment_expression "iVar2 = (**(code **)(*param_1 + 0x48))(param_1)" (identifier "iVar2") (= "=") (call_expression "(**(code **)(*param_1 + 0x48))(param_1)" (parenthesized_expression "(**(code **)(*param_1 + 0x48))" (( "(") (pointer_expression "**(code **)(*param_1 + 0x48)" (* "*") (pointer_expression "*(code **)(*param_1 + 0x48)" (* "*") (cast_expression "(code **)(*param_1 + 0x48)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*param_1 + 0x48)" (( "(") (binary_expression "*param_1 + 0x48" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "0x48")) () ")"))))) () ")")) (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar2 == -1) {\n    return -1;\n  }" (if "if") (parenthesized_expression "(iVar2 == -1)" (( "(") (binary_expression "iVar2 == -1" (identifier "iVar2") (== "==") (number_literal "-1")) () ")")) (compound_statement "{\n    return -1;\n  }" ({ "{") (return_statement "return -1;" (return "return") (number_literal "-1") (; ";")) (} "}"))) (labeled_statement "LAB_00301ea1:\n  if (param_2 == -1) {\n    return 0;\n  }" (statement_identifier "LAB_00301ea1") (: ":") (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") (; ";")) (} "}")))) (if_statement "if (iVar2 != param_2) {\n    if (cVar5 != '\0') {\n      return -1;\n    }\n    piVar3 = (int *)param_1[2];\n    if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }\n    *(undefined1 *)((long)param_1 + 0xa9) = 1;\n    *piVar3 = param_2;\n    return param_2;\n  }" (if "if") (parenthesized_expression "(iVar2 != param_2)" (( "(") (binary_expression "iVar2 != param_2" (identifier "iVar2") (!= "!=") (identifier "param_2")) () ")")) (compound_statement "{\n    if (cVar5 != '\0') {\n      return -1;\n    }\n    piVar3 = (int *)param_1[2];\n    if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }\n    *(undefined1 *)((long)param_1 + 0xa9) = 1;\n    *piVar3 = param_2;\n    return param_2;\n  }" ({ "{") (if_statement "if (cVar5 != '\0') {\n      return -1;\n    }" (if "if") (parenthesized_expression "(cVar5 != '\0')" (( "(") (binary_expression "cVar5 != '\0'" (identifier "cVar5") (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n      return -1;\n    }" ({ "{") (return_statement "return -1;" (return "return") (number_literal "-1") (; ";")) (} "}"))) (expression_statement "piVar3 = (int *)param_1[2];" (assignment_expression "piVar3 = (int *)param_1[2]" (identifier "piVar3") (= "=") (cast_expression "(int *)param_1[2]" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")))) (; ";")) (if_statement "if ((char)param_1[0x18] == '\0') {\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }" (if "if") (parenthesized_expression "((char)param_1[0x18] == '\0')" (( "(") (binary_expression "(char)param_1[0x18] == '\0'" (cast_expression "(char)param_1[0x18]" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (subscript_expression "param_1[0x18]" (identifier "param_1") ([ "[") (number_literal "0x18") (] "]"))) (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n      param_1[0x16] = (long)piVar3;\n      lVar4 = param_1[3];\n      param_1[3] = (long)(param_1 + 0x16);\n      param_1[0x17] = lVar4;\n      piVar3 = (int *)((long)param_1 + 0xac);\n      param_1[1] = (long)piVar3;\n      param_1[2] = (long)piVar3;\n      *(undefined1 *)(param_1 + 0x18) = 1;\n    }" ({ "{") (expression_statement "param_1[0x16] = (long)piVar3;" (assignment_expression "param_1[0x16] = (long)piVar3" (subscript_expression "param_1[0x16]" (identifier "param_1") ([ "[") (number_literal "0x16") (] "]")) (= "=") (cast_expression "(long)piVar3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "piVar3"))) (; ";")) (expression_statement "lVar4 = param_1[3];" (assignment_expression "lVar4 = param_1[3]" (identifier "lVar4") (= "=") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) (; ";")) (expression_statement "param_1[3] = (long)(param_1 + 0x16);" (assignment_expression "param_1[3] = (long)(param_1 + 0x16)" (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]")) (= "=") (cast_expression "(long)(param_1 + 0x16)" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (parenthesized_expression "(param_1 + 0x16)" (( "(") (binary_expression "param_1 + 0x16" (identifier "param_1") (+ "+") (number_literal "0x16")) () ")")))) (; ";")) (expression_statement "param_1[0x17] = lVar4;" (assignment_expression "param_1[0x17] = lVar4" (subscript_expression "param_1[0x17]" (identifier "param_1") ([ "[") (number_literal "0x17") (] "]")) (= "=") (identifier "lVar4")) (; ";")) (expression_statement "piVar3 = (int *)((long)param_1 + 0xac);" (assignment_expression "piVar3 = (int *)((long)param_1 + 0xac)" (identifier "piVar3") (= "=") (cast_expression "(int *)((long)param_1 + 0xac)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)param_1 + 0xac)" (( "(") (binary_expression "(long)param_1 + 0xac" (cast_expression "(long)param_1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_1")) (+ "+") (number_literal "0xac")) () ")")))) (; ";")) (expression_statement "param_1[1] = (long)piVar3;" (assignment_expression "param_1[1] = (long)piVar3" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (cast_expression "(long)piVar3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "piVar3"))) (; ";")) (expression_statement "param_1[2] = (long)piVar3;" (assignment_expression "param_1[2] = (long)piVar3" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (cast_expression "(long)piVar3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "piVar3"))) (; ";")) (expression_statement "*(undefined1 *)(param_1 + 0x18) = 1;" (assignment_expression "*(undefined1 *)(param_1 + 0x18) = 1" (pointer_expression "*(undefined1 *)(param_1 + 0x18)" (* "*") (cast_expression "(undefined1 *)(param_1 + 0x18)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x18)" (( "(") (binary_expression "param_1 + 0x18" (identifier "param_1") (+ "+") (number_literal "0x18")) () ")")))) (= "=") (number_literal "1")) (; ";")) (} "}"))) (expression_statement "*(undefined1 *)((long)param_1 + 0xa9) = 1;" (assignment_expression "*(undefined1 *)((long)param_1 + 0xa9) = 1" (pointer_expression "*(undefined1 *)((long)param_1 + 0xa9)" (* "*") (cast_expression "(undefined1 *)((long)param_1 + 0xa9)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)param_1 + 0xa9)" (( "(") (binary_expression "(long)param_1 + 0xa9" (cast_expression "(long)param_1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_1")) (+ "+") (number_literal "0xa9")) () ")")))) (= "=") (number_literal "1")) (; ";")) (expression_statement "*piVar3 = param_2;" (assignment_expression "*piVar3 = param_2" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (= "=") (identifier "param_2")) (; ";")) (return_statement "return param_2;" (return "return") (identifier "param_2") (; ";")) (} "}"))) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}")))

/* std::wfilebuf::pbackfail(unsigned int) */

type_1 __thiscall std::type_2::function_1(type_2 *var_1,type_1 var_6)

{
  type_3 var_2;
  type_4 uVar2;
  int var_3;
  type_1 var_5;
  type_2 *pwVar5;
  long var_4;
  type_2 var_7;
  
  if (((type_5)var_1[0x78] & 8) == 0) {
    return 0xffffffff;
  }
  if (var_1[0xaa] == (type_2)0x0) {
    var_2 = *(type_3 *)(var_1 + 0x10);
    var_7 = var_1[0xc0];
    if (*(type_3 *)(var_1 + 8) < var_2) {
      *(type_3 *)(var_1 + 0x10) = var_2 - 4;
      var_5 = *(type_1 *)(var_2 - 4);
      goto LAB_00301ea1;
    }
  }
  else {
    var_3 = (**(type_6 **)(*(long *)var_1 + 0x68))(var_1,0xffffffff);
    if (var_3 == -1) {
      return 0xffffffff;
    }
    uVar2 = *(type_4 *)(var_1 + 0x98);
    *(type_4 *)(var_1 + 0x28) = 0;
    *(type_4 *)(var_1 + 0x20) = 0;
    var_7 = var_1[0xc0];
    *(type_4 *)(var_1 + 8) = uVar2;
    *(type_4 *)(var_1 + 0x10) = uVar2;
    *(type_4 *)(var_1 + 0x18) = uVar2;
    *(type_4 *)(var_1 + 0x30) = 0;
    var_1[0xaa] = (type_2)0x0;
  }
  var_4 = (**(type_6 **)(*(long *)var_1 + 0x20))(var_1,0xffffffffffffffff,1,0x18);
  if (var_4 == -1) {
    return 0xffffffff;
  }
  var_5 = (**(type_6 **)(*(long *)var_1 + 0x48))(var_1);
  if (var_5 == 0xffffffff) {
    return 0xffffffff;
  }
LAB_00301ea1:
  if (var_6 == 0xffffffff) {
    return 0;
  }
  if (var_5 != var_6) {
    if (var_7 != (type_2)0x0) {
      return 0xffffffff;
    }
    pwVar5 = *(type_2 **)(var_1 + 0x10);
    if (var_1[0xc0] == (type_2)0x0) {
      *(type_2 **)(var_1 + 0xb0) = pwVar5;
      uVar2 = *(type_4 *)(var_1 + 0x18);
      *(type_2 **)(var_1 + 0x18) = var_1 + 0xb0;
      *(type_4 *)(var_1 + 0xb8) = uVar2;
      pwVar5 = var_1 + 0xac;
      *(type_2 **)(var_1 + 8) = pwVar5;
      *(type_2 **)(var_1 + 0x10) = pwVar5;
      var_1[0xc0] = (type_2)0x1;
    }
    var_1[0xa9] = (type_2)0x1;
    *(type_1 *)pwVar5 = var_6;
    return var_6;
  }
  return var_5;
}


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

int MASKED(long *param_1,int param_2)

{
  ulong uVar1;
  int iVar2;
  int *piVar3;
  long lVar4;
  char cVar5;
  
  if ((*(byte *)(param_1 + 0xf) & 8) == 0) {
    return -1;
  }
  if (*(char *)((long)param_1 + 0xaa) == '\0') {
    uVar1 = param_1[2];
    cVar5 = (char)param_1[0x18];
    if ((ulong)param_1[1] < uVar1) {
      param_1[2] = uVar1 - 4;
      iVar2 = *(int *)(uVar1 - 4);
      goto LAB_00301ea1;
    }
  }
  else {
    iVar2 = (**(code **)(*param_1 + 0x68))(param_1,0xffffffff);
    if (iVar2 == -1) {
      return -1;
    }
    lVar4 = param_1[0x13];
    param_1[5] = 0;
    param_1[4] = 0;
    cVar5 = (char)param_1[0x18];
    param_1[1] = lVar4;
    param_1[2] = lVar4;
    param_1[3] = lVar4;
    param_1[6] = 0;
    *(undefined1 *)((long)param_1 + 0xaa) = 0;
  }
  lVar4 = (**(code **)(*param_1 + 0x20))(param_1,0xffffffffffffffff,1,0x18);
  if (lVar4 == -1) {
    return -1;
  }
  iVar2 = (**(code **)(*param_1 + 0x48))(param_1);
  if (iVar2 == -1) {
    return -1;
  }
LAB_00301ea1:
  if (param_2 == -1) {
    return 0;
  }
  if (iVar2 != param_2) {
    if (cVar5 != '\0') {
      return -1;
    }
    piVar3 = (int *)param_1[2];
    if ((char)param_1[0x18] == '\0') {
      param_1[0x16] = (long)piVar3;
      lVar4 = param_1[3];
      param_1[3] = (long)(param_1 + 0x16);
      param_1[0x17] = lVar4;
      piVar3 = (int *)((long)param_1 + 0xac);
      param_1[1] = (long)piVar3;
      param_1[2] = (long)piVar3;
      *(undefined1 *)(param_1 + 0x18) = 1;
    }
    *(undefined1 *)((long)param_1 + 0xa9) = 1;
    *piVar3 = param_2;
    return param_2;
  }
  return iVar2;
}

