
int memjrnlRead(sqlite3_file *pJfd,void *zBuf,int iAmt,sqlite_int64 iOfst)

{
  long lVar1;
  sqlite3_io_methods *psVar2;
  int iVar3;
  sqlite3_io_methods *psVar4;
  int iVar5;
  int iVar6;
  
  if ((pJfd[6].pMethods == (sqlite3_io_methods *)iOfst) && (iOfst != 0)) {
    psVar4 = pJfd[7].pMethods;
  }
  else {
    psVar4 = pJfd[3].pMethods;
    if (psVar4 != (sqlite3_io_methods *)0x0) {
      lVar1 = (long)*(int *)&pJfd[1].pMethods;
      while ((lVar1 <= iOfst &&
             (psVar4 = *(sqlite3_io_methods **)psVar4, psVar4 != (sqlite3_io_methods *)0x0))) {
        lVar1 = lVar1 + *(int *)&pJfd[1].pMethods;
      }
    }
  }
  lVar1 = iOfst % (long)*(int *)&pJfd[1].pMethods;
  iVar5 = iAmt;
  while( true ) {
    iVar3 = *(int *)&pJfd[1].pMethods - (int)lVar1;
    iVar6 = iVar3;
    if (iVar5 <= iVar3) {
      iVar6 = iVar5;
    }
    memcpy(zBuf,(void *)((long)&psVar4->xClose + (long)(int)lVar1),(long)iVar6);
    zBuf = (void *)((long)zBuf + (long)iVar6);
    iVar5 = iVar5 - iVar3;
    if (iVar5 < 0) break;
    psVar4 = *(sqlite3_io_methods **)psVar4;
    lVar1 = 0;
    if ((iVar5 < 1) || (psVar4 == (sqlite3_io_methods *)0x0)) break;
  }
  psVar2 = (sqlite3_io_methods *)(iAmt + iOfst);
  if (psVar4 == (sqlite3_io_methods *)0x0) {
    psVar2 = (sqlite3_io_methods *)0x0;
  }
  pJfd[6].pMethods = psVar2;
  pJfd[7].pMethods = psVar4;
  return 0;
}



undefined8 FUN_001388e5(long param_1,void *param_2,int param_3,long param_4)

{
  long lVar1;
  int iVar2;
  long *plVar3;
  int iVar4;
  int iVar5;
  
  if ((*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0)) {
    plVar3 = *(long **)(param_1 + 0x38);
  }
  else {
    plVar3 = *(long **)(param_1 + 0x18);
    if (plVar3 != (long *)0x0) {
      lVar1 = (long)*(int *)(param_1 + 8);
      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {
        lVar1 = lVar1 + *(int *)(param_1 + 8);
      }
    }
  }
  lVar1 = param_4 % (long)*(int *)(param_1 + 8);
  iVar4 = param_3;
  while( true ) {
    iVar2 = *(int *)(param_1 + 8) - (int)lVar1;
    iVar5 = iVar2;
    if (iVar4 <= iVar2) {
      iVar5 = iVar4;
    }
    memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);
    param_2 = (void *)((long)param_2 + (long)iVar5);
    iVar4 = iVar4 - iVar2;
    if (iVar4 < 0) break;
    plVar3 = (long *)*plVar3;
    lVar1 = 0;
    if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;
  }
  param_4 = param_3 + param_4;
  if (plVar3 == (long *)0x0) {
    param_4 = 0;
  }
  *(long *)(param_1 + 0x30) = param_4;
  *(long **)(param_1 + 0x38) = plVar3;
  return 0;
}


PUSH R15
PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x18
MOV R15,RDI
MOV R14,RSI
MOV dword ptr [RSP + 0xc],EDX
MOV qword ptr [RSP],RCX
CMP qword ptr [RDI + 0x30],RCX
JNZ 0x00138910
TEST RCX,RCX
JNZ 0x001389bf
MOV RBP,qword ptr [R15 + 0x18]
TEST RBP,RBP
JZ 0x0013893b
MOV EDX,dword ptr [R15 + 0x8]
MOVSXD RAX,EDX
CMP qword ptr [RSP],RAX
JL 0x0013893b
MOV RDX,RAX
MOV RBP,qword ptr [RBP]
TEST RBP,RBP
JZ 0x0013893b
ADD RAX,RDX
CMP qword ptr [RSP],RAX
JGE 0x00138929
MOVSXD RCX,dword ptr [R15 + 0x8]
MOV RAX,qword ptr [RSP]
CQO
IDIV RCX
MOV R12D,dword ptr [RSP + 0xc]
MOV EBX,dword ptr [R15 + 0x8]
SUB EBX,EDX
CMP R12D,EBX
MOV R13D,EBX
CMOVLE R13D,R12D
MOVSXD R13,R13D
MOVSXD RDX,EDX
LEA RSI,[RBP + RDX*0x1 + 0x8]
MOV RDX,R13
MOV RDI,R14
CALL 0x0010e670
ADD R14,R13
SUB R12D,EBX
JS 0x0013898e
MOV RBP,qword ptr [RBP]
MOV EDX,0x0
TEST R12D,R12D
JLE 0x0013898e
TEST RBP,RBP
JNZ 0x0013894d
MOVSXD RAX,dword ptr [RSP + 0xc]
ADD RAX,qword ptr [RSP]
TEST RBP,RBP
MOV EDX,0x0
CMOVZ RAX,RDX
MOV qword ptr [R15 + 0x30],RAX
MOV qword ptr [R15 + 0x38],RBP
MOV EAX,0x0
ADD RSP,0x18
POP RBX
POP RBP
POP R12
POP R13
POP R14
POP R15
RET
MOV RBP,qword ptr [RDI + 0x38]
JMP 0x0013893b
(translation_unit "undefined8 FUN_001388e5(long param_1,void *param_2,int param_3,long param_4)\n\n{\n  long lVar1;\n  int iVar2;\n  long *plVar3;\n  int iVar4;\n  int iVar5;\n  \n  if ((*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0)) {\n    plVar3 = *(long **)(param_1 + 0x38);\n  }\n  else {\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }\n  lVar1 = param_4 % (long)*(int *)(param_1 + 8);\n  iVar4 = param_3;\n  while( true ) {\n    iVar2 = *(int *)(param_1 + 8) - (int)lVar1;\n    iVar5 = iVar2;\n    if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }\n    memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);\n    param_2 = (void *)((long)param_2 + (long)iVar5);\n    iVar4 = iVar4 - iVar2;\n    if (iVar4 < 0) break;\n    plVar3 = (long *)*plVar3;\n    lVar1 = 0;\n    if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;\n  }\n  param_4 = param_3 + param_4;\n  if (plVar3 == (long *)0x0) {\n    param_4 = 0;\n  }\n  *(long *)(param_1 + 0x30) = param_4;\n  *(long **)(param_1 + 0x38) = plVar3;\n  return 0;\n}\n\n" (function_definition "undefined8 FUN_001388e5(long param_1,void *param_2,int param_3,long param_4)\n\n{\n  long lVar1;\n  int iVar2;\n  long *plVar3;\n  int iVar4;\n  int iVar5;\n  \n  if ((*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0)) {\n    plVar3 = *(long **)(param_1 + 0x38);\n  }\n  else {\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }\n  lVar1 = param_4 % (long)*(int *)(param_1 + 8);\n  iVar4 = param_3;\n  while( true ) {\n    iVar2 = *(int *)(param_1 + 8) - (int)lVar1;\n    iVar5 = iVar2;\n    if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }\n    memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);\n    param_2 = (void *)((long)param_2 + (long)iVar5);\n    iVar4 = iVar4 - iVar2;\n    if (iVar4 < 0) break;\n    plVar3 = (long *)*plVar3;\n    lVar1 = 0;\n    if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;\n  }\n  param_4 = param_3 + param_4;\n  if (plVar3 == (long *)0x0) {\n    param_4 = 0;\n  }\n  *(long *)(param_1 + 0x30) = param_4;\n  *(long **)(param_1 + 0x38) = plVar3;\n  return 0;\n}" type_identifier (function_declarator "FUN_001388e5(long param_1,void *param_2,int param_3,long param_4)" identifier (parameter_list "(long param_1,void *param_2,int param_3,long param_4)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "void *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "long param_4" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  long lVar1;\n  int iVar2;\n  long *plVar3;\n  int iVar4;\n  int iVar5;\n  \n  if ((*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0)) {\n    plVar3 = *(long **)(param_1 + 0x38);\n  }\n  else {\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }\n  lVar1 = param_4 % (long)*(int *)(param_1 + 8);\n  iVar4 = param_3;\n  while( true ) {\n    iVar2 = *(int *)(param_1 + 8) - (int)lVar1;\n    iVar5 = iVar2;\n    if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }\n    memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);\n    param_2 = (void *)((long)param_2 + (long)iVar5);\n    iVar4 = iVar4 - iVar2;\n    if (iVar4 < 0) break;\n    plVar3 = (long *)*plVar3;\n    lVar1 = 0;\n    if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;\n  }\n  param_4 = param_3 + param_4;\n  if (plVar3 == (long *)0x0) {\n    param_4 = 0;\n  }\n  *(long *)(param_1 + 0x30) = param_4;\n  *(long **)(param_1 + 0x38) = plVar3;\n  return 0;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "long *plVar3;" (sized_type_specifier "long" long) (pointer_declarator "*plVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (if_statement "if ((*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0)) {\n    plVar3 = *(long **)(param_1 + 0x38);\n  }\n  else {\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }" if (parenthesized_expression "((*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0))" ( (binary_expression "(*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0)" (parenthesized_expression "(*(long *)(param_1 + 0x30) == param_4)" ( (binary_expression "*(long *)(param_1 + 0x30) == param_4" (pointer_expression "*(long *)(param_1 + 0x30)" * (cast_expression "(long *)(param_1 + 0x30)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x30)" ( (binary_expression "param_1 + 0x30" identifier + number_literal) )))) == identifier) )) && (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) ))) )) (compound_statement "{\n    plVar3 = *(long **)(param_1 + 0x38);\n  }" { (expression_statement "plVar3 = *(long **)(param_1 + 0x38);" (assignment_expression "plVar3 = *(long **)(param_1 + 0x38)" identifier = (pointer_expression "*(long **)(param_1 + 0x38)" * (cast_expression "(long **)(param_1 + 0x38)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x38)" ( (binary_expression "param_1 + 0x38" identifier + number_literal) ))))) ;) }) (else_clause "else {\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }" else (compound_statement "{\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }" { (expression_statement "plVar3 = *(long **)(param_1 + 0x18);" (assignment_expression "plVar3 = *(long **)(param_1 + 0x18)" identifier = (pointer_expression "*(long **)(param_1 + 0x18)" * (cast_expression "(long **)(param_1 + 0x18)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) ))))) ;) (if_statement "if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }" if (parenthesized_expression "(plVar3 != (long *)0x0)" ( (binary_expression "plVar3 != (long *)0x0" identifier != (cast_expression "(long *)0x0" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }" { (expression_statement "lVar1 = (long)*(int *)(param_1 + 8);" (assignment_expression "lVar1 = (long)*(int *)(param_1 + 8)" identifier = (cast_expression "(long)*(int *)(param_1 + 8)" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (pointer_expression "*(int *)(param_1 + 8)" * (cast_expression "(int *)(param_1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))))) ;) (while_statement "while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }" while (parenthesized_expression "((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0)))" ( (parenthesized_expression "(lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))" ( (binary_expression "lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0)" (binary_expression "lVar1 <= param_4" identifier <= identifier) && (parenthesized_expression "(plVar3 = (long *)*plVar3, plVar3 != (long *)0x0)" ( (comma_expression "plVar3 = (long *)*plVar3, plVar3 != (long *)0x0" (assignment_expression "plVar3 = (long *)*plVar3" identifier = (cast_expression "(long *)*plVar3" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*plVar3" * identifier))) , (binary_expression "plVar3 != (long *)0x0" identifier != (cast_expression "(long *)0x0" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) )) (compound_statement "{\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }" { (expression_statement "lVar1 = lVar1 + *(int *)(param_1 + 8);" (assignment_expression "lVar1 = lVar1 + *(int *)(param_1 + 8)" identifier = (binary_expression "lVar1 + *(int *)(param_1 + 8)" identifier + (pointer_expression "*(int *)(param_1 + 8)" * (cast_expression "(int *)(param_1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))))) ;) })) })) }))) (expression_statement "lVar1 = param_4 % (long)*(int *)(param_1 + 8);" (assignment_expression "lVar1 = param_4 % (long)*(int *)(param_1 + 8)" identifier = (binary_expression "param_4 % (long)*(int *)(param_1 + 8)" identifier % (cast_expression "(long)*(int *)(param_1 + 8)" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (pointer_expression "*(int *)(param_1 + 8)" * (cast_expression "(int *)(param_1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))))) ;) (expression_statement "iVar4 = param_3;" (assignment_expression "iVar4 = param_3" identifier = identifier) ;) (while_statement "while( true ) {\n    iVar2 = *(int *)(param_1 + 8) - (int)lVar1;\n    iVar5 = iVar2;\n    if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }\n    memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);\n    param_2 = (void *)((long)param_2 + (long)iVar5);\n    iVar4 = iVar4 - iVar2;\n    if (iVar4 < 0) break;\n    plVar3 = (long *)*plVar3;\n    lVar1 = 0;\n    if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    iVar2 = *(int *)(param_1 + 8) - (int)lVar1;\n    iVar5 = iVar2;\n    if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }\n    memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);\n    param_2 = (void *)((long)param_2 + (long)iVar5);\n    iVar4 = iVar4 - iVar2;\n    if (iVar4 < 0) break;\n    plVar3 = (long *)*plVar3;\n    lVar1 = 0;\n    if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;\n  }" { (expression_statement "iVar2 = *(int *)(param_1 + 8) - (int)lVar1;" (assignment_expression "iVar2 = *(int *)(param_1 + 8) - (int)lVar1" identifier = (binary_expression "*(int *)(param_1 + 8) - (int)lVar1" (pointer_expression "*(int *)(param_1 + 8)" * (cast_expression "(int *)(param_1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) - (cast_expression "(int)lVar1" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (expression_statement "iVar5 = iVar2;" (assignment_expression "iVar5 = iVar2" identifier = identifier) ;) (if_statement "if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }" if (parenthesized_expression "(iVar4 <= iVar2)" ( (binary_expression "iVar4 <= iVar2" identifier <= identifier) )) (compound_statement "{\n      iVar5 = iVar4;\n    }" { (expression_statement "iVar5 = iVar4;" (assignment_expression "iVar5 = iVar4" identifier = identifier) ;) })) (expression_statement "memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);" (call_expression "memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5)" identifier (argument_list "(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5)" ( identifier , (cast_expression "(void *)((long)plVar3 + (long)(int)lVar1 + 8)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar3 + (long)(int)lVar1 + 8)" ( (binary_expression "(long)plVar3 + (long)(int)lVar1 + 8" (binary_expression "(long)plVar3 + (long)(int)lVar1" (cast_expression "(long)plVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (cast_expression "(long)(int)lVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (cast_expression "(int)lVar1" ( (type_descriptor "int" primitive_type) ) identifier))) + number_literal) ))) , (cast_expression "(long)iVar5" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) ))) ;) (expression_statement "param_2 = (void *)((long)param_2 + (long)iVar5);" (assignment_expression "param_2 = (void *)((long)param_2 + (long)iVar5)" identifier = (cast_expression "(void *)((long)param_2 + (long)iVar5)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_2 + (long)iVar5)" ( (binary_expression "(long)param_2 + (long)iVar5" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (cast_expression "(long)iVar5" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )))) ;) (expression_statement "iVar4 = iVar4 - iVar2;" (assignment_expression "iVar4 = iVar4 - iVar2" identifier = (binary_expression "iVar4 - iVar2" identifier - identifier)) ;) (if_statement "if (iVar4 < 0) break;" if (parenthesized_expression "(iVar4 < 0)" ( (binary_expression "iVar4 < 0" identifier < number_literal) )) (break_statement "break;" break ;)) (expression_statement "plVar3 = (long *)*plVar3;" (assignment_expression "plVar3 = (long *)*plVar3" identifier = (cast_expression "(long *)*plVar3" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*plVar3" * identifier))) ;) (expression_statement "lVar1 = 0;" (assignment_expression "lVar1 = 0" identifier = number_literal) ;) (if_statement "if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;" if (parenthesized_expression "((iVar4 < 1) || (plVar3 == (long *)0x0))" ( (binary_expression "(iVar4 < 1) || (plVar3 == (long *)0x0)" (parenthesized_expression "(iVar4 < 1)" ( (binary_expression "iVar4 < 1" identifier < number_literal) )) || (parenthesized_expression "(plVar3 == (long *)0x0)" ( (binary_expression "plVar3 == (long *)0x0" identifier == (cast_expression "(long *)0x0" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) number_literal)) ))) )) (break_statement "break;" break ;)) })) (expression_statement "param_4 = param_3 + param_4;" (assignment_expression "param_4 = param_3 + param_4" identifier = (binary_expression "param_3 + param_4" identifier + identifier)) ;) (if_statement "if (plVar3 == (long *)0x0) {\n    param_4 = 0;\n  }" if (parenthesized_expression "(plVar3 == (long *)0x0)" ( (binary_expression "plVar3 == (long *)0x0" identifier == (cast_expression "(long *)0x0" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    param_4 = 0;\n  }" { (expression_statement "param_4 = 0;" (assignment_expression "param_4 = 0" identifier = number_literal) ;) })) (expression_statement "*(long *)(param_1 + 0x30) = param_4;" (assignment_expression "*(long *)(param_1 + 0x30) = param_4" (pointer_expression "*(long *)(param_1 + 0x30)" * (cast_expression "(long *)(param_1 + 0x30)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x30)" ( (binary_expression "param_1 + 0x30" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(long **)(param_1 + 0x38) = plVar3;" (assignment_expression "*(long **)(param_1 + 0x38) = plVar3" (pointer_expression "*(long **)(param_1 + 0x38)" * (cast_expression "(long **)(param_1 + 0x38)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x38)" ( (binary_expression "param_1 + 0x38" identifier + number_literal) )))) = identifier) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "int memjrnlRead(sqlite3_file *pJfd,void *zBuf,int iAmt,sqlite_int64 iOfst)\n\n{\n  long lVar1;\n  sqlite3_io_methods *psVar2;\n  int iVar3;\n  sqlite3_io_methods *psVar4;\n  int iVar5;\n  int iVar6;\n  \n  if ((pJfd[6].pMethods == (sqlite3_io_methods *)iOfst) && (iOfst != 0)) {\n    psVar4 = pJfd[7].pMethods;\n  }\n  else {\n    psVar4 = pJfd[3].pMethods;\n    if (psVar4 != (sqlite3_io_methods *)0x0) {\n      lVar1 = (long)*(int *)&pJfd[1].pMethods;\n      while ((lVar1 <= iOfst &&\n             (psVar4 = *(sqlite3_io_methods **)psVar4, psVar4 != (sqlite3_io_methods *)0x0))) {\n        lVar1 = lVar1 + *(int *)&pJfd[1].pMethods;\n      }\n    }\n  }\n  lVar1 = iOfst % (long)*(int *)&pJfd[1].pMethods;\n  iVar5 = iAmt;\n  while( true ) {\n    iVar3 = *(int *)&pJfd[1].pMethods - (int)lVar1;\n    iVar6 = iVar3;\n    if (iVar5 <= iVar3) {\n      iVar6 = iVar5;\n    }\n    memcpy(zBuf,(void *)((long)&psVar4->xClose + (long)(int)lVar1),(long)iVar6);\n    zBuf = (void *)((long)zBuf + (long)iVar6);\n    iVar5 = iVar5 - iVar3;\n    if (iVar5 < 0) break;\n    psVar4 = *(sqlite3_io_methods **)psVar4;\n    lVar1 = 0;\n    if ((iVar5 < 1) || (psVar4 == (sqlite3_io_methods *)0x0)) break;\n  }\n  psVar2 = (sqlite3_io_methods *)(iAmt + iOfst);\n  if (psVar4 == (sqlite3_io_methods *)0x0) {\n    psVar2 = (sqlite3_io_methods *)0x0;\n  }\n  pJfd[6].pMethods = psVar2;\n  pJfd[7].pMethods = psVar4;\n  return 0;\n}\n\n" (function_definition "int memjrnlRead(sqlite3_file *pJfd,void *zBuf,int iAmt,sqlite_int64 iOfst)\n\n{\n  long lVar1;\n  sqlite3_io_methods *psVar2;\n  int iVar3;\n  sqlite3_io_methods *psVar4;\n  int iVar5;\n  int iVar6;\n  \n  if ((pJfd[6].pMethods == (sqlite3_io_methods *)iOfst) && (iOfst != 0)) {\n    psVar4 = pJfd[7].pMethods;\n  }\n  else {\n    psVar4 = pJfd[3].pMethods;\n    if (psVar4 != (sqlite3_io_methods *)0x0) {\n      lVar1 = (long)*(int *)&pJfd[1].pMethods;\n      while ((lVar1 <= iOfst &&\n             (psVar4 = *(sqlite3_io_methods **)psVar4, psVar4 != (sqlite3_io_methods *)0x0))) {\n        lVar1 = lVar1 + *(int *)&pJfd[1].pMethods;\n      }\n    }\n  }\n  lVar1 = iOfst % (long)*(int *)&pJfd[1].pMethods;\n  iVar5 = iAmt;\n  while( true ) {\n    iVar3 = *(int *)&pJfd[1].pMethods - (int)lVar1;\n    iVar6 = iVar3;\n    if (iVar5 <= iVar3) {\n      iVar6 = iVar5;\n    }\n    memcpy(zBuf,(void *)((long)&psVar4->xClose + (long)(int)lVar1),(long)iVar6);\n    zBuf = (void *)((long)zBuf + (long)iVar6);\n    iVar5 = iVar5 - iVar3;\n    if (iVar5 < 0) break;\n    psVar4 = *(sqlite3_io_methods **)psVar4;\n    lVar1 = 0;\n    if ((iVar5 < 1) || (psVar4 == (sqlite3_io_methods *)0x0)) break;\n  }\n  psVar2 = (sqlite3_io_methods *)(iAmt + iOfst);\n  if (psVar4 == (sqlite3_io_methods *)0x0) {\n    psVar2 = (sqlite3_io_methods *)0x0;\n  }\n  pJfd[6].pMethods = psVar2;\n  pJfd[7].pMethods = psVar4;\n  return 0;\n}" primitive_type (function_declarator "memjrnlRead(sqlite3_file *pJfd,void *zBuf,int iAmt,sqlite_int64 iOfst)" identifier (parameter_list "(sqlite3_file *pJfd,void *zBuf,int iAmt,sqlite_int64 iOfst)" ( (parameter_declaration "sqlite3_file *pJfd" type_identifier (pointer_declarator "*pJfd" * identifier)) , (parameter_declaration "void *zBuf" primitive_type (pointer_declarator "*zBuf" * identifier)) , (parameter_declaration "int iAmt" primitive_type identifier) , (parameter_declaration "sqlite_int64 iOfst" type_identifier identifier) ))) (compound_statement "{\n  long lVar1;\n  sqlite3_io_methods *psVar2;\n  int iVar3;\n  sqlite3_io_methods *psVar4;\n  int iVar5;\n  int iVar6;\n  \n  if ((pJfd[6].pMethods == (sqlite3_io_methods *)iOfst) && (iOfst != 0)) {\n    psVar4 = pJfd[7].pMethods;\n  }\n  else {\n    psVar4 = pJfd[3].pMethods;\n    if (psVar4 != (sqlite3_io_methods *)0x0) {\n      lVar1 = (long)*(int *)&pJfd[1].pMethods;\n      while ((lVar1 <= iOfst &&\n             (psVar4 = *(sqlite3_io_methods **)psVar4, psVar4 != (sqlite3_io_methods *)0x0))) {\n        lVar1 = lVar1 + *(int *)&pJfd[1].pMethods;\n      }\n    }\n  }\n  lVar1 = iOfst % (long)*(int *)&pJfd[1].pMethods;\n  iVar5 = iAmt;\n  while( true ) {\n    iVar3 = *(int *)&pJfd[1].pMethods - (int)lVar1;\n    iVar6 = iVar3;\n    if (iVar5 <= iVar3) {\n      iVar6 = iVar5;\n    }\n    memcpy(zBuf,(void *)((long)&psVar4->xClose + (long)(int)lVar1),(long)iVar6);\n    zBuf = (void *)((long)zBuf + (long)iVar6);\n    iVar5 = iVar5 - iVar3;\n    if (iVar5 < 0) break;\n    psVar4 = *(sqlite3_io_methods **)psVar4;\n    lVar1 = 0;\n    if ((iVar5 < 1) || (psVar4 == (sqlite3_io_methods *)0x0)) break;\n  }\n  psVar2 = (sqlite3_io_methods *)(iAmt + iOfst);\n  if (psVar4 == (sqlite3_io_methods *)0x0) {\n    psVar2 = (sqlite3_io_methods *)0x0;\n  }\n  pJfd[6].pMethods = psVar2;\n  pJfd[7].pMethods = psVar4;\n  return 0;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "sqlite3_io_methods *psVar2;" type_identifier (pointer_declarator "*psVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "sqlite3_io_methods *psVar4;" type_identifier (pointer_declarator "*psVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (if_statement "if ((pJfd[6].pMethods == (sqlite3_io_methods *)iOfst) && (iOfst != 0)) {\n    psVar4 = pJfd[7].pMethods;\n  }\n  else {\n    psVar4 = pJfd[3].pMethods;\n    if (psVar4 != (sqlite3_io_methods *)0x0) {\n      lVar1 = (long)*(int *)&pJfd[1].pMethods;\n      while ((lVar1 <= iOfst &&\n             (psVar4 = *(sqlite3_io_methods **)psVar4, psVar4 != (sqlite3_io_methods *)0x0))) {\n        lVar1 = lVar1 + *(int *)&pJfd[1].pMethods;\n      }\n    }\n  }" if (parenthesized_expression "((pJfd[6].pMethods == (sqlite3_io_methods *)iOfst) && (iOfst != 0))" ( (binary_expression "(pJfd[6].pMethods == (sqlite3_io_methods *)iOfst) && (iOfst != 0)" (parenthesized_expression "(pJfd[6].pMethods == (sqlite3_io_methods *)iOfst)" ( (binary_expression "pJfd[6].pMethods == (sqlite3_io_methods *)iOfst" (field_expression "pJfd[6].pMethods" (subscript_expression "pJfd[6]" identifier [ number_literal ]) . field_identifier) == (cast_expression "(sqlite3_io_methods *)iOfst" ( (type_descriptor "sqlite3_io_methods *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) && (parenthesized_expression "(iOfst != 0)" ( (binary_expression "iOfst != 0" identifier != number_literal) ))) )) (compound_statement "{\n    psVar4 = pJfd[7].pMethods;\n  }" { (expression_statement "psVar4 = pJfd[7].pMethods;" (assignment_expression "psVar4 = pJfd[7].pMethods" identifier = (field_expression "pJfd[7].pMethods" (subscript_expression "pJfd[7]" identifier [ number_literal ]) . field_identifier)) ;) }) (else_clause "else {\n    psVar4 = pJfd[3].pMethods;\n    if (psVar4 != (sqlite3_io_methods *)0x0) {\n      lVar1 = (long)*(int *)&pJfd[1].pMethods;\n      while ((lVar1 <= iOfst &&\n             (psVar4 = *(sqlite3_io_methods **)psVar4, psVar4 != (sqlite3_io_methods *)0x0))) {\n        lVar1 = lVar1 + *(int *)&pJfd[1].pMethods;\n      }\n    }\n  }" else (compound_statement "{\n    psVar4 = pJfd[3].pMethods;\n    if (psVar4 != (sqlite3_io_methods *)0x0) {\n      lVar1 = (long)*(int *)&pJfd[1].pMethods;\n      while ((lVar1 <= iOfst &&\n             (psVar4 = *(sqlite3_io_methods **)psVar4, psVar4 != (sqlite3_io_methods *)0x0))) {\n        lVar1 = lVar1 + *(int *)&pJfd[1].pMethods;\n      }\n    }\n  }" { (expression_statement "psVar4 = pJfd[3].pMethods;" (assignment_expression "psVar4 = pJfd[3].pMethods" identifier = (field_expression "pJfd[3].pMethods" (subscript_expression "pJfd[3]" identifier [ number_literal ]) . field_identifier)) ;) (if_statement "if (psVar4 != (sqlite3_io_methods *)0x0) {\n      lVar1 = (long)*(int *)&pJfd[1].pMethods;\n      while ((lVar1 <= iOfst &&\n             (psVar4 = *(sqlite3_io_methods **)psVar4, psVar4 != (sqlite3_io_methods *)0x0))) {\n        lVar1 = lVar1 + *(int *)&pJfd[1].pMethods;\n      }\n    }" if (parenthesized_expression "(psVar4 != (sqlite3_io_methods *)0x0)" ( (binary_expression "psVar4 != (sqlite3_io_methods *)0x0" identifier != (cast_expression "(sqlite3_io_methods *)0x0" ( (type_descriptor "sqlite3_io_methods *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      lVar1 = (long)*(int *)&pJfd[1].pMethods;\n      while ((lVar1 <= iOfst &&\n             (psVar4 = *(sqlite3_io_methods **)psVar4, psVar4 != (sqlite3_io_methods *)0x0))) {\n        lVar1 = lVar1 + *(int *)&pJfd[1].pMethods;\n      }\n    }" { (expression_statement "lVar1 = (long)*(int *)&pJfd[1].pMethods;" (assignment_expression "lVar1 = (long)*(int *)&pJfd[1].pMethods" identifier = (cast_expression "(long)*(int *)&pJfd[1].pMethods" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (pointer_expression "*(int *)&pJfd[1].pMethods" * (cast_expression "(int *)&pJfd[1].pMethods" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "&pJfd[1].pMethods" & (field_expression "pJfd[1].pMethods" (subscript_expression "pJfd[1]" identifier [ number_literal ]) . field_identifier)))))) ;) (while_statement "while ((lVar1 <= iOfst &&\n             (psVar4 = *(sqlite3_io_methods **)psVar4, psVar4 != (sqlite3_io_methods *)0x0))) {\n        lVar1 = lVar1 + *(int *)&pJfd[1].pMethods;\n      }" while (parenthesized_expression "((lVar1 <= iOfst &&\n             (psVar4 = *(sqlite3_io_methods **)psVar4, psVar4 != (sqlite3_io_methods *)0x0)))" ( (parenthesized_expression "(lVar1 <= iOfst &&\n             (psVar4 = *(sqlite3_io_methods **)psVar4, psVar4 != (sqlite3_io_methods *)0x0))" ( (binary_expression "lVar1 <= iOfst &&\n             (psVar4 = *(sqlite3_io_methods **)psVar4, psVar4 != (sqlite3_io_methods *)0x0)" (binary_expression "lVar1 <= iOfst" identifier <= identifier) && (parenthesized_expression "(psVar4 = *(sqlite3_io_methods **)psVar4, psVar4 != (sqlite3_io_methods *)0x0)" ( (comma_expression "psVar4 = *(sqlite3_io_methods **)psVar4, psVar4 != (sqlite3_io_methods *)0x0" (assignment_expression "psVar4 = *(sqlite3_io_methods **)psVar4" identifier = (pointer_expression "*(sqlite3_io_methods **)psVar4" * (cast_expression "(sqlite3_io_methods **)psVar4" ( (type_descriptor "sqlite3_io_methods **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) , (binary_expression "psVar4 != (sqlite3_io_methods *)0x0" identifier != (cast_expression "(sqlite3_io_methods *)0x0" ( (type_descriptor "sqlite3_io_methods *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) )) (compound_statement "{\n        lVar1 = lVar1 + *(int *)&pJfd[1].pMethods;\n      }" { (expression_statement "lVar1 = lVar1 + *(int *)&pJfd[1].pMethods;" (assignment_expression "lVar1 = lVar1 + *(int *)&pJfd[1].pMethods" identifier = (binary_expression "lVar1 + *(int *)&pJfd[1].pMethods" identifier + (pointer_expression "*(int *)&pJfd[1].pMethods" * (cast_expression "(int *)&pJfd[1].pMethods" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "&pJfd[1].pMethods" & (field_expression "pJfd[1].pMethods" (subscript_expression "pJfd[1]" identifier [ number_literal ]) . field_identifier)))))) ;) })) })) }))) (expression_statement "lVar1 = iOfst % (long)*(int *)&pJfd[1].pMethods;" (assignment_expression "lVar1 = iOfst % (long)*(int *)&pJfd[1].pMethods" identifier = (binary_expression "iOfst % (long)*(int *)&pJfd[1].pMethods" identifier % (cast_expression "(long)*(int *)&pJfd[1].pMethods" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (pointer_expression "*(int *)&pJfd[1].pMethods" * (cast_expression "(int *)&pJfd[1].pMethods" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "&pJfd[1].pMethods" & (field_expression "pJfd[1].pMethods" (subscript_expression "pJfd[1]" identifier [ number_literal ]) . field_identifier))))))) ;) (expression_statement "iVar5 = iAmt;" (assignment_expression "iVar5 = iAmt" identifier = identifier) ;) (while_statement "while( true ) {\n    iVar3 = *(int *)&pJfd[1].pMethods - (int)lVar1;\n    iVar6 = iVar3;\n    if (iVar5 <= iVar3) {\n      iVar6 = iVar5;\n    }\n    memcpy(zBuf,(void *)((long)&psVar4->xClose + (long)(int)lVar1),(long)iVar6);\n    zBuf = (void *)((long)zBuf + (long)iVar6);\n    iVar5 = iVar5 - iVar3;\n    if (iVar5 < 0) break;\n    psVar4 = *(sqlite3_io_methods **)psVar4;\n    lVar1 = 0;\n    if ((iVar5 < 1) || (psVar4 == (sqlite3_io_methods *)0x0)) break;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    iVar3 = *(int *)&pJfd[1].pMethods - (int)lVar1;\n    iVar6 = iVar3;\n    if (iVar5 <= iVar3) {\n      iVar6 = iVar5;\n    }\n    memcpy(zBuf,(void *)((long)&psVar4->xClose + (long)(int)lVar1),(long)iVar6);\n    zBuf = (void *)((long)zBuf + (long)iVar6);\n    iVar5 = iVar5 - iVar3;\n    if (iVar5 < 0) break;\n    psVar4 = *(sqlite3_io_methods **)psVar4;\n    lVar1 = 0;\n    if ((iVar5 < 1) || (psVar4 == (sqlite3_io_methods *)0x0)) break;\n  }" { (expression_statement "iVar3 = *(int *)&pJfd[1].pMethods - (int)lVar1;" (assignment_expression "iVar3 = *(int *)&pJfd[1].pMethods - (int)lVar1" identifier = (binary_expression "*(int *)&pJfd[1].pMethods - (int)lVar1" (pointer_expression "*(int *)&pJfd[1].pMethods" * (cast_expression "(int *)&pJfd[1].pMethods" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "&pJfd[1].pMethods" & (field_expression "pJfd[1].pMethods" (subscript_expression "pJfd[1]" identifier [ number_literal ]) . field_identifier)))) - (cast_expression "(int)lVar1" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (expression_statement "iVar6 = iVar3;" (assignment_expression "iVar6 = iVar3" identifier = identifier) ;) (if_statement "if (iVar5 <= iVar3) {\n      iVar6 = iVar5;\n    }" if (parenthesized_expression "(iVar5 <= iVar3)" ( (binary_expression "iVar5 <= iVar3" identifier <= identifier) )) (compound_statement "{\n      iVar6 = iVar5;\n    }" { (expression_statement "iVar6 = iVar5;" (assignment_expression "iVar6 = iVar5" identifier = identifier) ;) })) (expression_statement "memcpy(zBuf,(void *)((long)&psVar4->xClose + (long)(int)lVar1),(long)iVar6);" (call_expression "memcpy(zBuf,(void *)((long)&psVar4->xClose + (long)(int)lVar1),(long)iVar6)" identifier (argument_list "(zBuf,(void *)((long)&psVar4->xClose + (long)(int)lVar1),(long)iVar6)" ( identifier , (cast_expression "(void *)((long)&psVar4->xClose + (long)(int)lVar1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)&psVar4->xClose + (long)(int)lVar1)" ( (binary_expression "(long)&psVar4->xClose + (long)(int)lVar1" (cast_expression "(long)&psVar4->xClose" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (pointer_expression "&psVar4->xClose" & (field_expression "psVar4->xClose" identifier -> field_identifier))) + (cast_expression "(long)(int)lVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (cast_expression "(int)lVar1" ( (type_descriptor "int" primitive_type) ) identifier))) ))) , (cast_expression "(long)iVar6" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) ))) ;) (expression_statement "zBuf = (void *)((long)zBuf + (long)iVar6);" (assignment_expression "zBuf = (void *)((long)zBuf + (long)iVar6)" identifier = (cast_expression "(void *)((long)zBuf + (long)iVar6)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)zBuf + (long)iVar6)" ( (binary_expression "(long)zBuf + (long)iVar6" (cast_expression "(long)zBuf" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (cast_expression "(long)iVar6" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )))) ;) (expression_statement "iVar5 = iVar5 - iVar3;" (assignment_expression "iVar5 = iVar5 - iVar3" identifier = (binary_expression "iVar5 - iVar3" identifier - identifier)) ;) (if_statement "if (iVar5 < 0) break;" if (parenthesized_expression "(iVar5 < 0)" ( (binary_expression "iVar5 < 0" identifier < number_literal) )) (break_statement "break;" break ;)) (expression_statement "psVar4 = *(sqlite3_io_methods **)psVar4;" (assignment_expression "psVar4 = *(sqlite3_io_methods **)psVar4" identifier = (pointer_expression "*(sqlite3_io_methods **)psVar4" * (cast_expression "(sqlite3_io_methods **)psVar4" ( (type_descriptor "sqlite3_io_methods **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "lVar1 = 0;" (assignment_expression "lVar1 = 0" identifier = number_literal) ;) (if_statement "if ((iVar5 < 1) || (psVar4 == (sqlite3_io_methods *)0x0)) break;" if (parenthesized_expression "((iVar5 < 1) || (psVar4 == (sqlite3_io_methods *)0x0))" ( (binary_expression "(iVar5 < 1) || (psVar4 == (sqlite3_io_methods *)0x0)" (parenthesized_expression "(iVar5 < 1)" ( (binary_expression "iVar5 < 1" identifier < number_literal) )) || (parenthesized_expression "(psVar4 == (sqlite3_io_methods *)0x0)" ( (binary_expression "psVar4 == (sqlite3_io_methods *)0x0" identifier == (cast_expression "(sqlite3_io_methods *)0x0" ( (type_descriptor "sqlite3_io_methods *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ))) )) (break_statement "break;" break ;)) })) (expression_statement "psVar2 = (sqlite3_io_methods *)(iAmt + iOfst);" (assignment_expression "psVar2 = (sqlite3_io_methods *)(iAmt + iOfst)" identifier = (cast_expression "(sqlite3_io_methods *)(iAmt + iOfst)" ( (type_descriptor "sqlite3_io_methods *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iAmt + iOfst)" ( (binary_expression "iAmt + iOfst" identifier + identifier) )))) ;) (if_statement "if (psVar4 == (sqlite3_io_methods *)0x0) {\n    psVar2 = (sqlite3_io_methods *)0x0;\n  }" if (parenthesized_expression "(psVar4 == (sqlite3_io_methods *)0x0)" ( (binary_expression "psVar4 == (sqlite3_io_methods *)0x0" identifier == (cast_expression "(sqlite3_io_methods *)0x0" ( (type_descriptor "sqlite3_io_methods *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    psVar2 = (sqlite3_io_methods *)0x0;\n  }" { (expression_statement "psVar2 = (sqlite3_io_methods *)0x0;" (assignment_expression "psVar2 = (sqlite3_io_methods *)0x0" identifier = (cast_expression "(sqlite3_io_methods *)0x0" ( (type_descriptor "sqlite3_io_methods *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) })) (expression_statement "pJfd[6].pMethods = psVar2;" (assignment_expression "pJfd[6].pMethods = psVar2" (field_expression "pJfd[6].pMethods" (subscript_expression "pJfd[6]" identifier [ number_literal ]) . field_identifier) = identifier) ;) (expression_statement "pJfd[7].pMethods = psVar4;" (assignment_expression "pJfd[7].pMethods = psVar4" (field_expression "pJfd[7].pMethods" (subscript_expression "pJfd[7]" identifier [ number_literal ]) . field_identifier) = identifier) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "undefined8 FUN_001388e5(long param_1,void *param_2,int param_3,long param_4)\n\n{\n  long lVar1;\n  int iVar2;\n  long *plVar3;\n  int iVar4;\n  int iVar5;\n  \n  if ((*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0)) {\n    plVar3 = *(long **)(param_1 + 0x38);\n  }\n  else {\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }\n  lVar1 = param_4 % (long)*(int *)(param_1 + 8);\n  iVar4 = param_3;\n  while( true ) {\n    iVar2 = *(int *)(param_1 + 8) - (int)lVar1;\n    iVar5 = iVar2;\n    if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }\n    memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);\n    param_2 = (void *)((long)param_2 + (long)iVar5);\n    iVar4 = iVar4 - iVar2;\n    if (iVar4 < 0) break;\n    plVar3 = (long *)*plVar3;\n    lVar1 = 0;\n    if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;\n  }\n  param_4 = param_3 + param_4;\n  if (plVar3 == (long *)0x0) {\n    param_4 = 0;\n  }\n  *(long *)(param_1 + 0x30) = param_4;\n  *(long **)(param_1 + 0x38) = plVar3;\n  return 0;\n}\n\n" (function_definition "undefined8 FUN_001388e5(long param_1,void *param_2,int param_3,long param_4)\n\n{\n  long lVar1;\n  int iVar2;\n  long *plVar3;\n  int iVar4;\n  int iVar5;\n  \n  if ((*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0)) {\n    plVar3 = *(long **)(param_1 + 0x38);\n  }\n  else {\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }\n  lVar1 = param_4 % (long)*(int *)(param_1 + 8);\n  iVar4 = param_3;\n  while( true ) {\n    iVar2 = *(int *)(param_1 + 8) - (int)lVar1;\n    iVar5 = iVar2;\n    if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }\n    memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);\n    param_2 = (void *)((long)param_2 + (long)iVar5);\n    iVar4 = iVar4 - iVar2;\n    if (iVar4 < 0) break;\n    plVar3 = (long *)*plVar3;\n    lVar1 = 0;\n    if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;\n  }\n  param_4 = param_3 + param_4;\n  if (plVar3 == (long *)0x0) {\n    param_4 = 0;\n  }\n  *(long *)(param_1 + 0x30) = param_4;\n  *(long **)(param_1 + 0x38) = plVar3;\n  return 0;\n}" type_identifier (function_declarator "FUN_001388e5(long param_1,void *param_2,int param_3,long param_4)" identifier (parameter_list "(long param_1,void *param_2,int param_3,long param_4)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "void *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "long param_4" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  long lVar1;\n  int iVar2;\n  long *plVar3;\n  int iVar4;\n  int iVar5;\n  \n  if ((*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0)) {\n    plVar3 = *(long **)(param_1 + 0x38);\n  }\n  else {\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }\n  lVar1 = param_4 % (long)*(int *)(param_1 + 8);\n  iVar4 = param_3;\n  while( true ) {\n    iVar2 = *(int *)(param_1 + 8) - (int)lVar1;\n    iVar5 = iVar2;\n    if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }\n    memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);\n    param_2 = (void *)((long)param_2 + (long)iVar5);\n    iVar4 = iVar4 - iVar2;\n    if (iVar4 < 0) break;\n    plVar3 = (long *)*plVar3;\n    lVar1 = 0;\n    if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;\n  }\n  param_4 = param_3 + param_4;\n  if (plVar3 == (long *)0x0) {\n    param_4 = 0;\n  }\n  *(long *)(param_1 + 0x30) = param_4;\n  *(long **)(param_1 + 0x38) = plVar3;\n  return 0;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "long *plVar3;" (sized_type_specifier "long" long) (pointer_declarator "*plVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (if_statement "if ((*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0)) {\n    plVar3 = *(long **)(param_1 + 0x38);\n  }\n  else {\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }" if (parenthesized_expression "((*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0))" ( (binary_expression "(*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0)" (parenthesized_expression "(*(long *)(param_1 + 0x30) == param_4)" ( (binary_expression "*(long *)(param_1 + 0x30) == param_4" (pointer_expression "*(long *)(param_1 + 0x30)" * (cast_expression "(long *)(param_1 + 0x30)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x30)" ( (binary_expression "param_1 + 0x30" identifier + number_literal) )))) == identifier) )) && (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) ))) )) (compound_statement "{\n    plVar3 = *(long **)(param_1 + 0x38);\n  }" { (expression_statement "plVar3 = *(long **)(param_1 + 0x38);" (assignment_expression "plVar3 = *(long **)(param_1 + 0x38)" identifier = (pointer_expression "*(long **)(param_1 + 0x38)" * (cast_expression "(long **)(param_1 + 0x38)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x38)" ( (binary_expression "param_1 + 0x38" identifier + number_literal) ))))) ;) }) (else_clause "else {\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }" else (compound_statement "{\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }" { (expression_statement "plVar3 = *(long **)(param_1 + 0x18);" (assignment_expression "plVar3 = *(long **)(param_1 + 0x18)" identifier = (pointer_expression "*(long **)(param_1 + 0x18)" * (cast_expression "(long **)(param_1 + 0x18)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) ))))) ;) (if_statement "if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }" if (parenthesized_expression "(plVar3 != (long *)0x0)" ( (binary_expression "plVar3 != (long *)0x0" identifier != (cast_expression "(long *)0x0" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }" { (expression_statement "lVar1 = (long)*(int *)(param_1 + 8);" (assignment_expression "lVar1 = (long)*(int *)(param_1 + 8)" identifier = (cast_expression "(long)*(int *)(param_1 + 8)" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (pointer_expression "*(int *)(param_1 + 8)" * (cast_expression "(int *)(param_1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))))) ;) (while_statement "while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }" while (parenthesized_expression "((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0)))" ( (parenthesized_expression "(lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))" ( (binary_expression "lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0)" (binary_expression "lVar1 <= param_4" identifier <= identifier) && (parenthesized_expression "(plVar3 = (long *)*plVar3, plVar3 != (long *)0x0)" ( (comma_expression "plVar3 = (long *)*plVar3, plVar3 != (long *)0x0" (assignment_expression "plVar3 = (long *)*plVar3" identifier = (cast_expression "(long *)*plVar3" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*plVar3" * identifier))) , (binary_expression "plVar3 != (long *)0x0" identifier != (cast_expression "(long *)0x0" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) )) (compound_statement "{\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }" { (expression_statement "lVar1 = lVar1 + *(int *)(param_1 + 8);" (assignment_expression "lVar1 = lVar1 + *(int *)(param_1 + 8)" identifier = (binary_expression "lVar1 + *(int *)(param_1 + 8)" identifier + (pointer_expression "*(int *)(param_1 + 8)" * (cast_expression "(int *)(param_1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))))) ;) })) })) }))) (expression_statement "lVar1 = param_4 % (long)*(int *)(param_1 + 8);" (assignment_expression "lVar1 = param_4 % (long)*(int *)(param_1 + 8)" identifier = (binary_expression "param_4 % (long)*(int *)(param_1 + 8)" identifier % (cast_expression "(long)*(int *)(param_1 + 8)" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (pointer_expression "*(int *)(param_1 + 8)" * (cast_expression "(int *)(param_1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))))) ;) (expression_statement "iVar4 = param_3;" (assignment_expression "iVar4 = param_3" identifier = identifier) ;) (while_statement "while( true ) {\n    iVar2 = *(int *)(param_1 + 8) - (int)lVar1;\n    iVar5 = iVar2;\n    if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }\n    memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);\n    param_2 = (void *)((long)param_2 + (long)iVar5);\n    iVar4 = iVar4 - iVar2;\n    if (iVar4 < 0) break;\n    plVar3 = (long *)*plVar3;\n    lVar1 = 0;\n    if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    iVar2 = *(int *)(param_1 + 8) - (int)lVar1;\n    iVar5 = iVar2;\n    if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }\n    memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);\n    param_2 = (void *)((long)param_2 + (long)iVar5);\n    iVar4 = iVar4 - iVar2;\n    if (iVar4 < 0) break;\n    plVar3 = (long *)*plVar3;\n    lVar1 = 0;\n    if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;\n  }" { (expression_statement "iVar2 = *(int *)(param_1 + 8) - (int)lVar1;" (assignment_expression "iVar2 = *(int *)(param_1 + 8) - (int)lVar1" identifier = (binary_expression "*(int *)(param_1 + 8) - (int)lVar1" (pointer_expression "*(int *)(param_1 + 8)" * (cast_expression "(int *)(param_1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) - (cast_expression "(int)lVar1" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (expression_statement "iVar5 = iVar2;" (assignment_expression "iVar5 = iVar2" identifier = identifier) ;) (if_statement "if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }" if (parenthesized_expression "(iVar4 <= iVar2)" ( (binary_expression "iVar4 <= iVar2" identifier <= identifier) )) (compound_statement "{\n      iVar5 = iVar4;\n    }" { (expression_statement "iVar5 = iVar4;" (assignment_expression "iVar5 = iVar4" identifier = identifier) ;) })) (expression_statement "memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);" (call_expression "memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5)" identifier (argument_list "(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5)" ( identifier , (cast_expression "(void *)((long)plVar3 + (long)(int)lVar1 + 8)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar3 + (long)(int)lVar1 + 8)" ( (binary_expression "(long)plVar3 + (long)(int)lVar1 + 8" (binary_expression "(long)plVar3 + (long)(int)lVar1" (cast_expression "(long)plVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (cast_expression "(long)(int)lVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (cast_expression "(int)lVar1" ( (type_descriptor "int" primitive_type) ) identifier))) + number_literal) ))) , (cast_expression "(long)iVar5" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) ))) ;) (expression_statement "param_2 = (void *)((long)param_2 + (long)iVar5);" (assignment_expression "param_2 = (void *)((long)param_2 + (long)iVar5)" identifier = (cast_expression "(void *)((long)param_2 + (long)iVar5)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_2 + (long)iVar5)" ( (binary_expression "(long)param_2 + (long)iVar5" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (cast_expression "(long)iVar5" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )))) ;) (expression_statement "iVar4 = iVar4 - iVar2;" (assignment_expression "iVar4 = iVar4 - iVar2" identifier = (binary_expression "iVar4 - iVar2" identifier - identifier)) ;) (if_statement "if (iVar4 < 0) break;" if (parenthesized_expression "(iVar4 < 0)" ( (binary_expression "iVar4 < 0" identifier < number_literal) )) (break_statement "break;" break ;)) (expression_statement "plVar3 = (long *)*plVar3;" (assignment_expression "plVar3 = (long *)*plVar3" identifier = (cast_expression "(long *)*plVar3" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*plVar3" * identifier))) ;) (expression_statement "lVar1 = 0;" (assignment_expression "lVar1 = 0" identifier = number_literal) ;) (if_statement "if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;" if (parenthesized_expression "((iVar4 < 1) || (plVar3 == (long *)0x0))" ( (binary_expression "(iVar4 < 1) || (plVar3 == (long *)0x0)" (parenthesized_expression "(iVar4 < 1)" ( (binary_expression "iVar4 < 1" identifier < number_literal) )) || (parenthesized_expression "(plVar3 == (long *)0x0)" ( (binary_expression "plVar3 == (long *)0x0" identifier == (cast_expression "(long *)0x0" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) number_literal)) ))) )) (break_statement "break;" break ;)) })) (expression_statement "param_4 = param_3 + param_4;" (assignment_expression "param_4 = param_3 + param_4" identifier = (binary_expression "param_3 + param_4" identifier + identifier)) ;) (if_statement "if (plVar3 == (long *)0x0) {\n    param_4 = 0;\n  }" if (parenthesized_expression "(plVar3 == (long *)0x0)" ( (binary_expression "plVar3 == (long *)0x0" identifier == (cast_expression "(long *)0x0" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    param_4 = 0;\n  }" { (expression_statement "param_4 = 0;" (assignment_expression "param_4 = 0" identifier = number_literal) ;) })) (expression_statement "*(long *)(param_1 + 0x30) = param_4;" (assignment_expression "*(long *)(param_1 + 0x30) = param_4" (pointer_expression "*(long *)(param_1 + 0x30)" * (cast_expression "(long *)(param_1 + 0x30)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x30)" ( (binary_expression "param_1 + 0x30" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(long **)(param_1 + 0x38) = plVar3;" (assignment_expression "*(long **)(param_1 + 0x38) = plVar3" (pointer_expression "*(long **)(param_1 + 0x38)" * (cast_expression "(long **)(param_1 + 0x38)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x38)" ( (binary_expression "param_1 + 0x38" identifier + number_literal) )))) = identifier) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) ))) (compound_statement { (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == IDENT) )) && (parenthesized_expression ( (binary_expression IDENT != LIT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor (sized_type_specifier long)) ) (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))))) ;) (while_statement while (parenthesized_expression ( (parenthesized_expression ( (binary_expression (binary_expression IDENT <= IDENT) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) , (binary_expression IDENT != (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) LIT))) ))) )) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))))) ;) })) })) }))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT % (cast_expression ( (type_descriptor (sized_type_specifier long)) ) (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) - (cast_expression ( (type_descriptor TYPE) ) IDENT))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + (cast_expression ( (type_descriptor (sized_type_specifier long)) ) (cast_expression ( (type_descriptor TYPE) ) IDENT))) + LIT) ))) , (cast_expression ( (type_descriptor (sized_type_specifier long)) ) 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) + (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT < LIT) )) || (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) LIT)) ))) )) (break_statement break ;)) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (return_statement return LIT ;) })))
(function_definition "undefined8 FUN_001388e5(long param_1,void *param_2,int param_3,long param_4)\n\n{\n  long lVar1;\n  int iVar2;\n  long *plVar3;\n  int iVar4;\n  int iVar5;\n  \n  if ((*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0)) {\n    plVar3 = *(long **)(param_1 + 0x38);\n  }\n  else {\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }\n  lVar1 = param_4 % (long)*(int *)(param_1 + 8);\n  iVar4 = param_3;\n  while( true ) {\n    iVar2 = *(int *)(param_1 + 8) - (int)lVar1;\n    iVar5 = iVar2;\n    if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }\n    memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);\n    param_2 = (void *)((long)param_2 + (long)iVar5);\n    iVar4 = iVar4 - iVar2;\n    if (iVar4 < 0) break;\n    plVar3 = (long *)*plVar3;\n    lVar1 = 0;\n    if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;\n  }\n  param_4 = param_3 + param_4;\n  if (plVar3 == (long *)0x0) {\n    param_4 = 0;\n  }\n  *(long *)(param_1 + 0x30) = param_4;\n  *(long **)(param_1 + 0x38) = plVar3;\n  return 0;\n}" (type_identifier "undefined8") (function_declarator "FUN_001388e5(long param_1,void *param_2,int param_3,long param_4)" (identifier "FUN_001388e5") (parameter_list "(long param_1,void *param_2,int param_3,long param_4)" (( "(") (parameter_declaration "long param_1" (sized_type_specifier "long" (long "long")) (identifier "param_1")) (, ",") (parameter_declaration "void *param_2" (primitive_type "void") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) (, ",") (parameter_declaration "long param_4" (sized_type_specifier "long" (long "long")) (identifier "param_4")) () ")"))) (compound_statement "{\n  long lVar1;\n  int iVar2;\n  long *plVar3;\n  int iVar4;\n  int iVar5;\n  \n  if ((*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0)) {\n    plVar3 = *(long **)(param_1 + 0x38);\n  }\n  else {\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }\n  lVar1 = param_4 % (long)*(int *)(param_1 + 8);\n  iVar4 = param_3;\n  while( true ) {\n    iVar2 = *(int *)(param_1 + 8) - (int)lVar1;\n    iVar5 = iVar2;\n    if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }\n    memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);\n    param_2 = (void *)((long)param_2 + (long)iVar5);\n    iVar4 = iVar4 - iVar2;\n    if (iVar4 < 0) break;\n    plVar3 = (long *)*plVar3;\n    lVar1 = 0;\n    if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;\n  }\n  param_4 = param_3 + param_4;\n  if (plVar3 == (long *)0x0) {\n    param_4 = 0;\n  }\n  *(long *)(param_1 + 0x30) = param_4;\n  *(long **)(param_1 + 0x38) = plVar3;\n  return 0;\n}" ({ "{") (declaration "long lVar1;" (sized_type_specifier "long" (long "long")) (identifier "lVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "long *plVar3;" (sized_type_specifier "long" (long "long")) (pointer_declarator "*plVar3" (* "*") (identifier "plVar3")) (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (if_statement "if ((*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0)) {\n    plVar3 = *(long **)(param_1 + 0x38);\n  }\n  else {\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }" (if "if") (parenthesized_expression "((*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0))" (( "(") (binary_expression "(*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0)" (parenthesized_expression "(*(long *)(param_1 + 0x30) == param_4)" (( "(") (binary_expression "*(long *)(param_1 + 0x30) == param_4" (pointer_expression "*(long *)(param_1 + 0x30)" (* "*") (cast_expression "(long *)(param_1 + 0x30)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x30)" (( "(") (binary_expression "param_1 + 0x30" (identifier "param_1") (+ "+") (number_literal "0x30")) () ")")))) (== "==") (identifier "param_4")) () ")")) (&& "&&") (parenthesized_expression "(param_4 != 0)" (( "(") (binary_expression "param_4 != 0" (identifier "param_4") (!= "!=") (number_literal "0")) () ")"))) () ")")) (compound_statement "{\n    plVar3 = *(long **)(param_1 + 0x38);\n  }" ({ "{") (expression_statement "plVar3 = *(long **)(param_1 + 0x38);" (assignment_expression "plVar3 = *(long **)(param_1 + 0x38)" (identifier "plVar3") (= "=") (pointer_expression "*(long **)(param_1 + 0x38)" (* "*") (cast_expression "(long **)(param_1 + 0x38)" (( "(") (type_descriptor "long **" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x38)" (( "(") (binary_expression "param_1 + 0x38" (identifier "param_1") (+ "+") (number_literal "0x38")) () ")"))))) (; ";")) (} "}")) (else_clause "else {\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }" (else "else") (compound_statement "{\n    plVar3 = *(long **)(param_1 + 0x18);\n    if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }\n  }" ({ "{") (expression_statement "plVar3 = *(long **)(param_1 + 0x18);" (assignment_expression "plVar3 = *(long **)(param_1 + 0x18)" (identifier "plVar3") (= "=") (pointer_expression "*(long **)(param_1 + 0x18)" (* "*") (cast_expression "(long **)(param_1 + 0x18)" (( "(") (type_descriptor "long **" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x18)" (( "(") (binary_expression "param_1 + 0x18" (identifier "param_1") (+ "+") (number_literal "0x18")) () ")"))))) (; ";")) (if_statement "if (plVar3 != (long *)0x0) {\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }" (if "if") (parenthesized_expression "(plVar3 != (long *)0x0)" (( "(") (binary_expression "plVar3 != (long *)0x0" (identifier "plVar3") (!= "!=") (cast_expression "(long *)0x0" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      lVar1 = (long)*(int *)(param_1 + 8);\n      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }\n    }" ({ "{") (expression_statement "lVar1 = (long)*(int *)(param_1 + 8);" (assignment_expression "lVar1 = (long)*(int *)(param_1 + 8)" (identifier "lVar1") (= "=") (cast_expression "(long)*(int *)(param_1 + 8)" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (pointer_expression "*(int *)(param_1 + 8)" (* "*") (cast_expression "(int *)(param_1 + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))))) (; ";")) (while_statement "while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }" (while "while") (parenthesized_expression "((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0)))" (( "(") (parenthesized_expression "(lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))" (( "(") (binary_expression "lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0)" (binary_expression "lVar1 <= param_4" (identifier "lVar1") (<= "<=") (identifier "param_4")) (&& "&&") (parenthesized_expression "(plVar3 = (long *)*plVar3, plVar3 != (long *)0x0)" (( "(") (comma_expression "plVar3 = (long *)*plVar3, plVar3 != (long *)0x0" (assignment_expression "plVar3 = (long *)*plVar3" (identifier "plVar3") (= "=") (cast_expression "(long *)*plVar3" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*plVar3" (* "*") (identifier "plVar3")))) (, ",") (binary_expression "plVar3 != (long *)0x0" (identifier "plVar3") (!= "!=") (cast_expression "(long *)0x0" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")))) () ")"))) () ")")) () ")")) (compound_statement "{\n        lVar1 = lVar1 + *(int *)(param_1 + 8);\n      }" ({ "{") (expression_statement "lVar1 = lVar1 + *(int *)(param_1 + 8);" (assignment_expression "lVar1 = lVar1 + *(int *)(param_1 + 8)" (identifier "lVar1") (= "=") (binary_expression "lVar1 + *(int *)(param_1 + 8)" (identifier "lVar1") (+ "+") (pointer_expression "*(int *)(param_1 + 8)" (* "*") (cast_expression "(int *)(param_1 + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))))) (; ";")) (} "}"))) (} "}"))) (} "}")))) (expression_statement "lVar1 = param_4 % (long)*(int *)(param_1 + 8);" (assignment_expression "lVar1 = param_4 % (long)*(int *)(param_1 + 8)" (identifier "lVar1") (= "=") (binary_expression "param_4 % (long)*(int *)(param_1 + 8)" (identifier "param_4") (% "%") (cast_expression "(long)*(int *)(param_1 + 8)" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (pointer_expression "*(int *)(param_1 + 8)" (* "*") (cast_expression "(int *)(param_1 + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")"))))))) (; ";")) (expression_statement "iVar4 = param_3;" (assignment_expression "iVar4 = param_3" (identifier "iVar4") (= "=") (identifier "param_3")) (; ";")) (while_statement "while( true ) {\n    iVar2 = *(int *)(param_1 + 8) - (int)lVar1;\n    iVar5 = iVar2;\n    if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }\n    memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);\n    param_2 = (void *)((long)param_2 + (long)iVar5);\n    iVar4 = iVar4 - iVar2;\n    if (iVar4 < 0) break;\n    plVar3 = (long *)*plVar3;\n    lVar1 = 0;\n    if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    iVar2 = *(int *)(param_1 + 8) - (int)lVar1;\n    iVar5 = iVar2;\n    if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }\n    memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);\n    param_2 = (void *)((long)param_2 + (long)iVar5);\n    iVar4 = iVar4 - iVar2;\n    if (iVar4 < 0) break;\n    plVar3 = (long *)*plVar3;\n    lVar1 = 0;\n    if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;\n  }" ({ "{") (expression_statement "iVar2 = *(int *)(param_1 + 8) - (int)lVar1;" (assignment_expression "iVar2 = *(int *)(param_1 + 8) - (int)lVar1" (identifier "iVar2") (= "=") (binary_expression "*(int *)(param_1 + 8) - (int)lVar1" (pointer_expression "*(int *)(param_1 + 8)" (* "*") (cast_expression "(int *)(param_1 + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (- "-") (cast_expression "(int)lVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "lVar1")))) (; ";")) (expression_statement "iVar5 = iVar2;" (assignment_expression "iVar5 = iVar2" (identifier "iVar5") (= "=") (identifier "iVar2")) (; ";")) (if_statement "if (iVar4 <= iVar2) {\n      iVar5 = iVar4;\n    }" (if "if") (parenthesized_expression "(iVar4 <= iVar2)" (( "(") (binary_expression "iVar4 <= iVar2" (identifier "iVar4") (<= "<=") (identifier "iVar2")) () ")")) (compound_statement "{\n      iVar5 = iVar4;\n    }" ({ "{") (expression_statement "iVar5 = iVar4;" (assignment_expression "iVar5 = iVar4" (identifier "iVar5") (= "=") (identifier "iVar4")) (; ";")) (} "}"))) (expression_statement "memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);" (call_expression "memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5)" (identifier "memcpy") (argument_list "(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5)" (( "(") (identifier "param_2") (, ",") (cast_expression "(void *)((long)plVar3 + (long)(int)lVar1 + 8)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)plVar3 + (long)(int)lVar1 + 8)" (( "(") (binary_expression "(long)plVar3 + (long)(int)lVar1 + 8" (binary_expression "(long)plVar3 + (long)(int)lVar1" (cast_expression "(long)plVar3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "plVar3")) (+ "+") (cast_expression "(long)(int)lVar1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (cast_expression "(int)lVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "lVar1")))) (+ "+") (number_literal "8")) () ")"))) (, ",") (cast_expression "(long)iVar5" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "iVar5")) () ")"))) (; ";")) (expression_statement "param_2 = (void *)((long)param_2 + (long)iVar5);" (assignment_expression "param_2 = (void *)((long)param_2 + (long)iVar5)" (identifier "param_2") (= "=") (cast_expression "(void *)((long)param_2 + (long)iVar5)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)param_2 + (long)iVar5)" (( "(") (binary_expression "(long)param_2 + (long)iVar5" (cast_expression "(long)param_2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_2")) (+ "+") (cast_expression "(long)iVar5" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "iVar5"))) () ")")))) (; ";")) (expression_statement "iVar4 = iVar4 - iVar2;" (assignment_expression "iVar4 = iVar4 - iVar2" (identifier "iVar4") (= "=") (binary_expression "iVar4 - iVar2" (identifier "iVar4") (- "-") (identifier "iVar2"))) (; ";")) (if_statement "if (iVar4 < 0) break;" (if "if") (parenthesized_expression "(iVar4 < 0)" (( "(") (binary_expression "iVar4 < 0" (identifier "iVar4") (< "<") (number_literal "0")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "plVar3 = (long *)*plVar3;" (assignment_expression "plVar3 = (long *)*plVar3" (identifier "plVar3") (= "=") (cast_expression "(long *)*plVar3" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*plVar3" (* "*") (identifier "plVar3")))) (; ";")) (expression_statement "lVar1 = 0;" (assignment_expression "lVar1 = 0" (identifier "lVar1") (= "=") (number_literal "0")) (; ";")) (if_statement "if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;" (if "if") (parenthesized_expression "((iVar4 < 1) || (plVar3 == (long *)0x0))" (( "(") (binary_expression "(iVar4 < 1) || (plVar3 == (long *)0x0)" (parenthesized_expression "(iVar4 < 1)" (( "(") (binary_expression "iVar4 < 1" (identifier "iVar4") (< "<") (number_literal "1")) () ")")) (|| "||") (parenthesized_expression "(plVar3 == (long *)0x0)" (( "(") (binary_expression "plVar3 == (long *)0x0" (identifier "plVar3") (== "==") (cast_expression "(long *)0x0" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")"))) () ")")) (break_statement "break;" (break "break") (; ";"))) (} "}"))) (expression_statement "param_4 = param_3 + param_4;" (assignment_expression "param_4 = param_3 + param_4" (identifier "param_4") (= "=") (binary_expression "param_3 + param_4" (identifier "param_3") (+ "+") (identifier "param_4"))) (; ";")) (if_statement "if (plVar3 == (long *)0x0) {\n    param_4 = 0;\n  }" (if "if") (parenthesized_expression "(plVar3 == (long *)0x0)" (( "(") (binary_expression "plVar3 == (long *)0x0" (identifier "plVar3") (== "==") (cast_expression "(long *)0x0" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    param_4 = 0;\n  }" ({ "{") (expression_statement "param_4 = 0;" (assignment_expression "param_4 = 0" (identifier "param_4") (= "=") (number_literal "0")) (; ";")) (} "}"))) (expression_statement "*(long *)(param_1 + 0x30) = param_4;" (assignment_expression "*(long *)(param_1 + 0x30) = param_4" (pointer_expression "*(long *)(param_1 + 0x30)" (* "*") (cast_expression "(long *)(param_1 + 0x30)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x30)" (( "(") (binary_expression "param_1 + 0x30" (identifier "param_1") (+ "+") (number_literal "0x30")) () ")")))) (= "=") (identifier "param_4")) (; ";")) (expression_statement "*(long **)(param_1 + 0x38) = plVar3;" (assignment_expression "*(long **)(param_1 + 0x38) = plVar3" (pointer_expression "*(long **)(param_1 + 0x38)" (* "*") (cast_expression "(long **)(param_1 + 0x38)" (( "(") (type_descriptor "long **" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x38)" (( "(") (binary_expression "param_1 + 0x38" (identifier "param_1") (+ "+") (number_literal "0x38")) () ")")))) (= "=") (identifier "plVar3")) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

int function_1(type_1 *pJfd,void *zBuf,int var_7,type_2 var_1)

{
  long var_3;
  type_3 *psVar2;
  int var_5;
  type_3 *var_2;
  int var_4;
  int iVar6;
  
  if ((pJfd[6].pMethods == (type_3 *)var_1) && (var_1 != 0)) {
    var_2 = pJfd[7].pMethods;
  }
  else {
    var_2 = pJfd[3].pMethods;
    if (var_2 != (type_3 *)0x0) {
      var_3 = (long)*(int *)&pJfd[1].pMethods;
      while ((var_3 <= var_1 &&
             (var_2 = *(type_3 **)var_2, var_2 != (type_3 *)0x0))) {
        var_3 = var_3 + *(int *)&pJfd[1].pMethods;
      }
    }
  }
  var_3 = var_1 % (long)*(int *)&pJfd[1].pMethods;
  var_4 = var_7;
  while( true ) {
    var_5 = *(int *)&pJfd[1].pMethods - (int)var_3;
    iVar6 = var_5;
    if (var_4 <= var_5) {
      iVar6 = var_4;
    }
    var_6(zBuf,(void *)((long)&var_2->xClose + (long)(int)var_3),(long)iVar6);
    zBuf = (void *)((long)zBuf + (long)iVar6);
    var_4 = var_4 - var_5;
    if (var_4 < 0) break;
    var_2 = *(type_3 **)var_2;
    var_3 = 0;
    if ((var_4 < 1) || (var_2 == (type_3 *)0x0)) break;
  }
  psVar2 = (type_3 *)(var_7 + var_1);
  if (var_2 == (type_3 *)0x0) {
    psVar2 = (type_3 *)0x0;
  }
  pJfd[6].pMethods = psVar2;
  pJfd[7].pMethods = var_2;
  return 0;
}


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

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

{
  long lVar1;
  int iVar2;
  long *plVar3;
  int iVar4;
  int iVar5;
  
  if ((*(long *)(param_1 + 0x30) == param_4) && (param_4 != 0)) {
    plVar3 = *(long **)(param_1 + 0x38);
  }
  else {
    plVar3 = *(long **)(param_1 + 0x18);
    if (plVar3 != (long *)0x0) {
      lVar1 = (long)*(int *)(param_1 + 8);
      while ((lVar1 <= param_4 && (plVar3 = (long *)*plVar3, plVar3 != (long *)0x0))) {
        lVar1 = lVar1 + *(int *)(param_1 + 8);
      }
    }
  }
  lVar1 = param_4 % (long)*(int *)(param_1 + 8);
  iVar4 = param_3;
  while( true ) {
    iVar2 = *(int *)(param_1 + 8) - (int)lVar1;
    iVar5 = iVar2;
    if (iVar4 <= iVar2) {
      iVar5 = iVar4;
    }
    memcpy(param_2,(void *)((long)plVar3 + (long)(int)lVar1 + 8),(long)iVar5);
    param_2 = (void *)((long)param_2 + (long)iVar5);
    iVar4 = iVar4 - iVar2;
    if (iVar4 < 0) break;
    plVar3 = (long *)*plVar3;
    lVar1 = 0;
    if ((iVar4 < 1) || (plVar3 == (long *)0x0)) break;
  }
  param_4 = param_3 + param_4;
  if (plVar3 == (long *)0x0) {
    param_4 = 0;
  }
  *(long *)(param_1 + 0x30) = param_4;
  *(long **)(param_1 + 0x38) = plVar3;
  return 0;
}

