
void randread(randread_source *s,void *buf,size_t size)

{
  isaac_word *result;
  int iVar1;
  size_t sVar2;
  int *piVar3;
  ulong __n;
  
  if (s->source != (FILE *)0x0) {
    while( true ) {
      sVar2 = fread_unlocked(buf,1,size,(FILE *)s->source);
      piVar3 = __errno_location();
      iVar1 = *piVar3;
      buf = (void *)((long)buf + sVar2);
      size = size - sVar2;
      if (size == 0) break;
      if ((s->source->_flags & 0x20U) == 0) {
        iVar1 = 0;
      }
      *piVar3 = iVar1;
      (*s->handler)(s->handler_arg);
    }
    return;
  }
  __n = (s->buf).isaac.buffered;
  result = (isaac_word *)((s->buf).c + 0x820);
  if (size <= __n) {
LAB_00119222:
    memcpy(buf,(void *)((long)s + (0x1038 - __n)),size);
    (s->buf).isaac.buffered = __n - size;
    return;
  }
  while( true ) {
    memcpy(buf,(void *)((long)result + (0x800 - __n)),__n);
    buf = (void *)((long)buf + __n);
    size = size - __n;
    if ((((ulong)buf & 7) == 0) && (0x7ff < size)) break;
    isaac_refill(&(s->buf).isaac.state,result);
    __n = 0x800;
    if (size < 0x801) goto LAB_0011921c;
  }
  do {
    isaac_refill(&(s->buf).isaac.state,(isaac_word *)buf);
    buf = (void *)((long)buf + 0x800);
    size = size - 0x800;
    if (size == 0) {
      (s->buf).isaac.buffered = 0;
      return;
    }
  } while (0x7ff < size);
  isaac_refill(&(s->buf).isaac.state,result);
LAB_0011921c:
  __n = 0x800;
  goto LAB_00119222;
}



void FUN_0011911f(long *param_1,void *param_2,ulong param_3)

{
  long *plVar1;
  int iVar2;
  size_t sVar3;
  int *piVar4;
  ulong __n;
  
  if (*param_1 != 0) {
    while( true ) {
      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);
      piVar4 = __errno_location();
      iVar2 = *piVar4;
      param_2 = (void *)((long)param_2 + sVar3);
      param_3 = param_3 - sVar3;
      if (param_3 == 0) break;
      if ((*(uint *)*param_1 & 0x20) == 0) {
        iVar2 = 0;
      }
      *piVar4 = iVar2;
      (*(code *)param_1[1])(param_1[2]);
    }
    return;
  }
  __n = param_1[3];
  plVar1 = param_1 + 0x107;
  if (param_3 <= __n) {
LAB_00119222:
    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);
    param_1[3] = __n - param_3;
    return;
  }
  while( true ) {
    memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);
    param_2 = (void *)((long)param_2 + __n);
    param_3 = param_3 - __n;
    if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;
    FUN_00119285(param_1 + 4,plVar1);
    __n = 0x800;
    if (param_3 < 0x801) goto LAB_0011921c;
  }
  do {
    FUN_00119285(param_1 + 4,param_2);
    param_2 = (void *)((long)param_2 + 0x800);
    param_3 = param_3 - 0x800;
    if (param_3 == 0) {
      param_1[3] = 0;
      return;
    }
  } while (0x7ff < param_3);
  FUN_00119285(param_1 + 4,plVar1);
LAB_0011921c:
  __n = 0x800;
  goto LAB_00119222;
}


PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
MOV R12,RDI
MOV RBP,RSI
MOV RBX,RDX
CMP qword ptr [RDI],0x0
JZ 0x00119176
MOV RCX,qword ptr [R12]
MOV RDX,RBX
MOV ESI,0x1
MOV RDI,RBP
CALL 0x001041e0
MOV R13,RAX
CALL 0x001040b0
MOV ECX,dword ptr [RAX]
ADD RBP,R13
SUB RBX,R13
JZ 0x00119194
MOV RDX,qword ptr [R12]
MOV EDX,dword ptr [RDX]
AND EDX,0x20
CMOVZ ECX,EDX
MOV dword ptr [RAX],ECX
MOV RDI,qword ptr [R12 + 0x10]
CALL qword ptr [R12 + 0x8]
JMP 0x00119136
MOV R13,qword ptr [RDI + 0x18]
LEA R14,[RDI + 0x838]
CMP RDX,R13
JA 0x001191b9
JMP 0x00119222
MOV qword ptr [R12 + 0x18],0x0
POP RBX
POP RBP
POP R12
POP R13
POP R14
RET
LEA RDI,[R12 + 0x20]
MOV RSI,R14
CALL 0x00119285
MOV R13D,0x800
CMP RBX,0x800
JBE 0x0011921c
MOV RAX,R14
SUB RAX,R13
LEA RSI,[RAX + 0x800]
MOV RDX,R13
MOV RDI,RBP
CALL 0x001045d0
ADD RBP,R13
SUB RBX,R13
TEST BPL,0x7
JNZ 0x0011919d
CMP RBX,0x7ff
JBE 0x0011919d
LEA R13,[R12 + 0x20]
MOV RSI,RBP
MOV RDI,R13
CALL 0x00119285
ADD RBP,0x800
SUB RBX,0x800
JZ 0x0011918b
CMP RBX,0x7ff
JA 0x001191eb
LEA RDI,[R12 + 0x20]
MOV RSI,R14
CALL 0x00119285
MOV R13D,0x800
MOV RAX,R12
SUB RAX,R13
LEA RSI,[RAX + 0x1038]
MOV RDX,RBX
MOV RDI,RBP
CALL 0x001045d0
SUB R13,RBX
MOV qword ptr [R12 + 0x18],R13
JMP 0x00119194
(translation_unit "void FUN_0011911f(long *param_1,void *param_2,ulong param_3)\n\n{\n  long *plVar1;\n  int iVar2;\n  size_t sVar3;\n  int *piVar4;\n  ulong __n;\n  \n  if (*param_1 != 0) {\n    while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }\n    return;\n  }\n  __n = param_1[3];\n  plVar1 = param_1 + 0x107;\n  if (param_3 <= __n) {\nLAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);\n    param_1[3] = __n - param_3;\n    return;\n  }\n  while( true ) {\n    memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);\n    param_2 = (void *)((long)param_2 + __n);\n    param_3 = param_3 - __n;\n    if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;\n    FUN_00119285(param_1 + 4,plVar1);\n    __n = 0x800;\n    if (param_3 < 0x801) goto LAB_0011921c;\n  }\n  do {\n    FUN_00119285(param_1 + 4,param_2);\n    param_2 = (void *)((long)param_2 + 0x800);\n    param_3 = param_3 - 0x800;\n    if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }\n  } while (0x7ff < param_3);\n  FUN_00119285(param_1 + 4,plVar1);\nLAB_0011921c:\n  __n = 0x800;\n  goto LAB_00119222;\n}\n\n" (function_definition "void FUN_0011911f(long *param_1,void *param_2,ulong param_3)\n\n{\n  long *plVar1;\n  int iVar2;\n  size_t sVar3;\n  int *piVar4;\n  ulong __n;\n  \n  if (*param_1 != 0) {\n    while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }\n    return;\n  }\n  __n = param_1[3];\n  plVar1 = param_1 + 0x107;\n  if (param_3 <= __n) {\nLAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);\n    param_1[3] = __n - param_3;\n    return;\n  }\n  while( true ) {\n    memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);\n    param_2 = (void *)((long)param_2 + __n);\n    param_3 = param_3 - __n;\n    if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;\n    FUN_00119285(param_1 + 4,plVar1);\n    __n = 0x800;\n    if (param_3 < 0x801) goto LAB_0011921c;\n  }\n  do {\n    FUN_00119285(param_1 + 4,param_2);\n    param_2 = (void *)((long)param_2 + 0x800);\n    param_3 = param_3 - 0x800;\n    if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }\n  } while (0x7ff < param_3);\n  FUN_00119285(param_1 + 4,plVar1);\nLAB_0011921c:\n  __n = 0x800;\n  goto LAB_00119222;\n}" primitive_type (function_declarator "FUN_0011911f(long *param_1,void *param_2,ulong param_3)" identifier (parameter_list "(long *param_1,void *param_2,ulong param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "void *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "ulong param_3" type_identifier identifier) ))) (compound_statement "{\n  long *plVar1;\n  int iVar2;\n  size_t sVar3;\n  int *piVar4;\n  ulong __n;\n  \n  if (*param_1 != 0) {\n    while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }\n    return;\n  }\n  __n = param_1[3];\n  plVar1 = param_1 + 0x107;\n  if (param_3 <= __n) {\nLAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);\n    param_1[3] = __n - param_3;\n    return;\n  }\n  while( true ) {\n    memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);\n    param_2 = (void *)((long)param_2 + __n);\n    param_3 = param_3 - __n;\n    if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;\n    FUN_00119285(param_1 + 4,plVar1);\n    __n = 0x800;\n    if (param_3 < 0x801) goto LAB_0011921c;\n  }\n  do {\n    FUN_00119285(param_1 + 4,param_2);\n    param_2 = (void *)((long)param_2 + 0x800);\n    param_3 = param_3 - 0x800;\n    if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }\n  } while (0x7ff < param_3);\n  FUN_00119285(param_1 + 4,plVar1);\nLAB_0011921c:\n  __n = 0x800;\n  goto LAB_00119222;\n}" { (declaration "long *plVar1;" (sized_type_specifier "long" long) (pointer_declarator "*plVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "ulong __n;" type_identifier identifier ;) (if_statement "if (*param_1 != 0) {\n    while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }\n    return;\n  }" if (parenthesized_expression "(*param_1 != 0)" ( (binary_expression "*param_1 != 0" (pointer_expression "*param_1" * identifier) != number_literal) )) (compound_statement "{\n    while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }\n    return;\n  }" { (while_statement "while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }" { (expression_statement "sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);" (assignment_expression "sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1)" identifier = (call_expression "fread_unlocked(param_2,1,param_3,(FILE *)*param_1)" identifier (argument_list "(param_2,1,param_3,(FILE *)*param_1)" ( identifier , number_literal , identifier , (cast_expression "(FILE *)*param_1" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)) )))) ;) (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar2 = *piVar4;" (assignment_expression "iVar2 = *piVar4" identifier = (pointer_expression "*piVar4" * identifier)) ;) (expression_statement "param_2 = (void *)((long)param_2 + sVar3);" (assignment_expression "param_2 = (void *)((long)param_2 + sVar3)" identifier = (cast_expression "(void *)((long)param_2 + sVar3)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_2 + sVar3)" ( (binary_expression "(long)param_2 + sVar3" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) ;) (expression_statement "param_3 = param_3 - sVar3;" (assignment_expression "param_3 = param_3 - sVar3" identifier = (binary_expression "param_3 - sVar3" identifier - identifier)) ;) (if_statement "if (param_3 == 0) break;" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (if_statement "if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }" if (parenthesized_expression "((*(uint *)*param_1 & 0x20) == 0)" ( (binary_expression "(*(uint *)*param_1 & 0x20) == 0" (parenthesized_expression "(*(uint *)*param_1 & 0x20)" ( (binary_expression "*(uint *)*param_1 & 0x20" (pointer_expression "*(uint *)*param_1" * (cast_expression "(uint *)*param_1" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) & number_literal) )) == number_literal) )) (compound_statement "{\n        iVar2 = 0;\n      }" { (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) })) (expression_statement "*piVar4 = iVar2;" (assignment_expression "*piVar4 = iVar2" (pointer_expression "*piVar4" * identifier) = identifier) ;) (expression_statement "(*(code *)param_1[1])(param_1[2]);" (call_expression "(*(code *)param_1[1])(param_1[2])" (parenthesized_expression "(*(code *)param_1[1])" ( (pointer_expression "*(code *)param_1[1]" * (cast_expression "(code *)param_1[1]" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) )) (argument_list "(param_1[2])" ( (subscript_expression "param_1[2]" identifier [ number_literal ]) ))) ;) })) (return_statement "return;" return ;) })) (expression_statement "__n = param_1[3];" (assignment_expression "__n = param_1[3]" identifier = (subscript_expression "param_1[3]" identifier [ number_literal ])) ;) (expression_statement "plVar1 = param_1 + 0x107;" (assignment_expression "plVar1 = param_1 + 0x107" identifier = (binary_expression "param_1 + 0x107" identifier + number_literal)) ;) (if_statement "if (param_3 <= __n) {\nLAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);\n    param_1[3] = __n - param_3;\n    return;\n  }" if (parenthesized_expression "(param_3 <= __n)" ( (binary_expression "param_3 <= __n" identifier <= identifier) )) (compound_statement "{\nLAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);\n    param_1[3] = __n - param_3;\n    return;\n  }" { (labeled_statement "LAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);" statement_identifier : (expression_statement "memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);" (call_expression "memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3)" identifier (argument_list "(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3)" ( identifier , (cast_expression "(void *)((long)param_1 + (0x1038 - __n))" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_1 + (0x1038 - __n))" ( (binary_expression "(long)param_1 + (0x1038 - __n)" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (parenthesized_expression "(0x1038 - __n)" ( (binary_expression "0x1038 - __n" number_literal - identifier) ))) ))) , identifier ))) ;)) (expression_statement "param_1[3] = __n - param_3;" (assignment_expression "param_1[3] = __n - param_3" (subscript_expression "param_1[3]" identifier [ number_literal ]) = (binary_expression "__n - param_3" identifier - identifier)) ;) (return_statement "return;" return ;) })) (while_statement "while( true ) {\n    memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);\n    param_2 = (void *)((long)param_2 + __n);\n    param_3 = param_3 - __n;\n    if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;\n    FUN_00119285(param_1 + 4,plVar1);\n    __n = 0x800;\n    if (param_3 < 0x801) goto LAB_0011921c;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);\n    param_2 = (void *)((long)param_2 + __n);\n    param_3 = param_3 - __n;\n    if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;\n    FUN_00119285(param_1 + 4,plVar1);\n    __n = 0x800;\n    if (param_3 < 0x801) goto LAB_0011921c;\n  }" { (expression_statement "memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);" (call_expression "memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n)" identifier (argument_list "(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n)" ( identifier , (cast_expression "(void *)((long)plVar1 + (0x800 - __n))" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar1 + (0x800 - __n))" ( (binary_expression "(long)plVar1 + (0x800 - __n)" (cast_expression "(long)plVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (parenthesized_expression "(0x800 - __n)" ( (binary_expression "0x800 - __n" number_literal - identifier) ))) ))) , identifier ))) ;) (expression_statement "param_2 = (void *)((long)param_2 + __n);" (assignment_expression "param_2 = (void *)((long)param_2 + __n)" identifier = (cast_expression "(void *)((long)param_2 + __n)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_2 + __n)" ( (binary_expression "(long)param_2 + __n" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) ;) (expression_statement "param_3 = param_3 - __n;" (assignment_expression "param_3 = param_3 - __n" identifier = (binary_expression "param_3 - __n" identifier - identifier)) ;) (if_statement "if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;" if (parenthesized_expression "((((ulong)param_2 & 7) == 0) && (0x7ff < param_3))" ( (binary_expression "(((ulong)param_2 & 7) == 0) && (0x7ff < param_3)" (parenthesized_expression "(((ulong)param_2 & 7) == 0)" ( (binary_expression "((ulong)param_2 & 7) == 0" (parenthesized_expression "((ulong)param_2 & 7)" ( (binary_expression "(ulong)param_2 & 7" (cast_expression "(ulong)param_2" ( (type_descriptor "ulong" type_identifier) ) identifier) & number_literal) )) == number_literal) )) && (parenthesized_expression "(0x7ff < param_3)" ( (binary_expression "0x7ff < param_3" number_literal < identifier) ))) )) (break_statement "break;" break ;)) (expression_statement "FUN_00119285(param_1 + 4,plVar1);" (call_expression "FUN_00119285(param_1 + 4,plVar1)" identifier (argument_list "(param_1 + 4,plVar1)" ( (binary_expression "param_1 + 4" identifier + number_literal) , identifier ))) ;) (expression_statement "__n = 0x800;" (assignment_expression "__n = 0x800" identifier = number_literal) ;) (if_statement "if (param_3 < 0x801) goto LAB_0011921c;" if (parenthesized_expression "(param_3 < 0x801)" ( (binary_expression "param_3 < 0x801" identifier < number_literal) )) (goto_statement "goto LAB_0011921c;" goto statement_identifier ;)) })) (do_statement "do {\n    FUN_00119285(param_1 + 4,param_2);\n    param_2 = (void *)((long)param_2 + 0x800);\n    param_3 = param_3 - 0x800;\n    if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }\n  } while (0x7ff < param_3);" do (compound_statement "{\n    FUN_00119285(param_1 + 4,param_2);\n    param_2 = (void *)((long)param_2 + 0x800);\n    param_3 = param_3 - 0x800;\n    if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }\n  }" { (expression_statement "FUN_00119285(param_1 + 4,param_2);" (call_expression "FUN_00119285(param_1 + 4,param_2)" identifier (argument_list "(param_1 + 4,param_2)" ( (binary_expression "param_1 + 4" identifier + number_literal) , identifier ))) ;) (expression_statement "param_2 = (void *)((long)param_2 + 0x800);" (assignment_expression "param_2 = (void *)((long)param_2 + 0x800)" identifier = (cast_expression "(void *)((long)param_2 + 0x800)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_2 + 0x800)" ( (binary_expression "(long)param_2 + 0x800" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) ;) (expression_statement "param_3 = param_3 - 0x800;" (assignment_expression "param_3 = param_3 - 0x800" identifier = (binary_expression "param_3 - 0x800" identifier - number_literal)) ;) (if_statement "if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n      param_1[3] = 0;\n      return;\n    }" { (expression_statement "param_1[3] = 0;" (assignment_expression "param_1[3] = 0" (subscript_expression "param_1[3]" identifier [ number_literal ]) = number_literal) ;) (return_statement "return;" return ;) })) }) while (parenthesized_expression "(0x7ff < param_3)" ( (binary_expression "0x7ff < param_3" number_literal < identifier) )) ;) (expression_statement "FUN_00119285(param_1 + 4,plVar1);" (call_expression "FUN_00119285(param_1 + 4,plVar1)" identifier (argument_list "(param_1 + 4,plVar1)" ( (binary_expression "param_1 + 4" identifier + number_literal) , identifier ))) ;) (labeled_statement "LAB_0011921c:\n  __n = 0x800;" statement_identifier : (expression_statement "__n = 0x800;" (assignment_expression "__n = 0x800" identifier = number_literal) ;)) (goto_statement "goto LAB_00119222;" goto statement_identifier ;) })))
(translation_unit "void randread(randread_source *s,void *buf,size_t size)\n\n{\n  isaac_word *result;\n  int iVar1;\n  size_t sVar2;\n  int *piVar3;\n  ulong __n;\n  \n  if (s->source != (FILE *)0x0) {\n    while( true ) {\n      sVar2 = fread_unlocked(buf,1,size,(FILE *)s->source);\n      piVar3 = __errno_location();\n      iVar1 = *piVar3;\n      buf = (void *)((long)buf + sVar2);\n      size = size - sVar2;\n      if (size == 0) break;\n      if ((s->source->_flags & 0x20U) == 0) {\n        iVar1 = 0;\n      }\n      *piVar3 = iVar1;\n      (*s->handler)(s->handler_arg);\n    }\n    return;\n  }\n  __n = (s->buf).isaac.buffered;\n  result = (isaac_word *)((s->buf).c + 0x820);\n  if (size <= __n) {\nLAB_00119222:\n    memcpy(buf,(void *)((long)s + (0x1038 - __n)),size);\n    (s->buf).isaac.buffered = __n - size;\n    return;\n  }\n  while( true ) {\n    memcpy(buf,(void *)((long)result + (0x800 - __n)),__n);\n    buf = (void *)((long)buf + __n);\n    size = size - __n;\n    if ((((ulong)buf & 7) == 0) && (0x7ff < size)) break;\n    isaac_refill(&(s->buf).isaac.state,result);\n    __n = 0x800;\n    if (size < 0x801) goto LAB_0011921c;\n  }\n  do {\n    isaac_refill(&(s->buf).isaac.state,(isaac_word *)buf);\n    buf = (void *)((long)buf + 0x800);\n    size = size - 0x800;\n    if (size == 0) {\n      (s->buf).isaac.buffered = 0;\n      return;\n    }\n  } while (0x7ff < size);\n  isaac_refill(&(s->buf).isaac.state,result);\nLAB_0011921c:\n  __n = 0x800;\n  goto LAB_00119222;\n}\n\n" (function_definition "void randread(randread_source *s,void *buf,size_t size)\n\n{\n  isaac_word *result;\n  int iVar1;\n  size_t sVar2;\n  int *piVar3;\n  ulong __n;\n  \n  if (s->source != (FILE *)0x0) {\n    while( true ) {\n      sVar2 = fread_unlocked(buf,1,size,(FILE *)s->source);\n      piVar3 = __errno_location();\n      iVar1 = *piVar3;\n      buf = (void *)((long)buf + sVar2);\n      size = size - sVar2;\n      if (size == 0) break;\n      if ((s->source->_flags & 0x20U) == 0) {\n        iVar1 = 0;\n      }\n      *piVar3 = iVar1;\n      (*s->handler)(s->handler_arg);\n    }\n    return;\n  }\n  __n = (s->buf).isaac.buffered;\n  result = (isaac_word *)((s->buf).c + 0x820);\n  if (size <= __n) {\nLAB_00119222:\n    memcpy(buf,(void *)((long)s + (0x1038 - __n)),size);\n    (s->buf).isaac.buffered = __n - size;\n    return;\n  }\n  while( true ) {\n    memcpy(buf,(void *)((long)result + (0x800 - __n)),__n);\n    buf = (void *)((long)buf + __n);\n    size = size - __n;\n    if ((((ulong)buf & 7) == 0) && (0x7ff < size)) break;\n    isaac_refill(&(s->buf).isaac.state,result);\n    __n = 0x800;\n    if (size < 0x801) goto LAB_0011921c;\n  }\n  do {\n    isaac_refill(&(s->buf).isaac.state,(isaac_word *)buf);\n    buf = (void *)((long)buf + 0x800);\n    size = size - 0x800;\n    if (size == 0) {\n      (s->buf).isaac.buffered = 0;\n      return;\n    }\n  } while (0x7ff < size);\n  isaac_refill(&(s->buf).isaac.state,result);\nLAB_0011921c:\n  __n = 0x800;\n  goto LAB_00119222;\n}" primitive_type (function_declarator "randread(randread_source *s,void *buf,size_t size)" identifier (parameter_list "(randread_source *s,void *buf,size_t size)" ( (parameter_declaration "randread_source *s" type_identifier (pointer_declarator "*s" * identifier)) , (parameter_declaration "void *buf" primitive_type (pointer_declarator "*buf" * identifier)) , (parameter_declaration "size_t size" primitive_type identifier) ))) (compound_statement "{\n  isaac_word *result;\n  int iVar1;\n  size_t sVar2;\n  int *piVar3;\n  ulong __n;\n  \n  if (s->source != (FILE *)0x0) {\n    while( true ) {\n      sVar2 = fread_unlocked(buf,1,size,(FILE *)s->source);\n      piVar3 = __errno_location();\n      iVar1 = *piVar3;\n      buf = (void *)((long)buf + sVar2);\n      size = size - sVar2;\n      if (size == 0) break;\n      if ((s->source->_flags & 0x20U) == 0) {\n        iVar1 = 0;\n      }\n      *piVar3 = iVar1;\n      (*s->handler)(s->handler_arg);\n    }\n    return;\n  }\n  __n = (s->buf).isaac.buffered;\n  result = (isaac_word *)((s->buf).c + 0x820);\n  if (size <= __n) {\nLAB_00119222:\n    memcpy(buf,(void *)((long)s + (0x1038 - __n)),size);\n    (s->buf).isaac.buffered = __n - size;\n    return;\n  }\n  while( true ) {\n    memcpy(buf,(void *)((long)result + (0x800 - __n)),__n);\n    buf = (void *)((long)buf + __n);\n    size = size - __n;\n    if ((((ulong)buf & 7) == 0) && (0x7ff < size)) break;\n    isaac_refill(&(s->buf).isaac.state,result);\n    __n = 0x800;\n    if (size < 0x801) goto LAB_0011921c;\n  }\n  do {\n    isaac_refill(&(s->buf).isaac.state,(isaac_word *)buf);\n    buf = (void *)((long)buf + 0x800);\n    size = size - 0x800;\n    if (size == 0) {\n      (s->buf).isaac.buffered = 0;\n      return;\n    }\n  } while (0x7ff < size);\n  isaac_refill(&(s->buf).isaac.state,result);\nLAB_0011921c:\n  __n = 0x800;\n  goto LAB_00119222;\n}" { (declaration "isaac_word *result;" type_identifier (pointer_declarator "*result" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "ulong __n;" type_identifier identifier ;) (if_statement "if (s->source != (FILE *)0x0) {\n    while( true ) {\n      sVar2 = fread_unlocked(buf,1,size,(FILE *)s->source);\n      piVar3 = __errno_location();\n      iVar1 = *piVar3;\n      buf = (void *)((long)buf + sVar2);\n      size = size - sVar2;\n      if (size == 0) break;\n      if ((s->source->_flags & 0x20U) == 0) {\n        iVar1 = 0;\n      }\n      *piVar3 = iVar1;\n      (*s->handler)(s->handler_arg);\n    }\n    return;\n  }" if (parenthesized_expression "(s->source != (FILE *)0x0)" ( (binary_expression "s->source != (FILE *)0x0" (field_expression "s->source" identifier -> field_identifier) != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    while( true ) {\n      sVar2 = fread_unlocked(buf,1,size,(FILE *)s->source);\n      piVar3 = __errno_location();\n      iVar1 = *piVar3;\n      buf = (void *)((long)buf + sVar2);\n      size = size - sVar2;\n      if (size == 0) break;\n      if ((s->source->_flags & 0x20U) == 0) {\n        iVar1 = 0;\n      }\n      *piVar3 = iVar1;\n      (*s->handler)(s->handler_arg);\n    }\n    return;\n  }" { (while_statement "while( true ) {\n      sVar2 = fread_unlocked(buf,1,size,(FILE *)s->source);\n      piVar3 = __errno_location();\n      iVar1 = *piVar3;\n      buf = (void *)((long)buf + sVar2);\n      size = size - sVar2;\n      if (size == 0) break;\n      if ((s->source->_flags & 0x20U) == 0) {\n        iVar1 = 0;\n      }\n      *piVar3 = iVar1;\n      (*s->handler)(s->handler_arg);\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      sVar2 = fread_unlocked(buf,1,size,(FILE *)s->source);\n      piVar3 = __errno_location();\n      iVar1 = *piVar3;\n      buf = (void *)((long)buf + sVar2);\n      size = size - sVar2;\n      if (size == 0) break;\n      if ((s->source->_flags & 0x20U) == 0) {\n        iVar1 = 0;\n      }\n      *piVar3 = iVar1;\n      (*s->handler)(s->handler_arg);\n    }" { (expression_statement "sVar2 = fread_unlocked(buf,1,size,(FILE *)s->source);" (assignment_expression "sVar2 = fread_unlocked(buf,1,size,(FILE *)s->source)" identifier = (call_expression "fread_unlocked(buf,1,size,(FILE *)s->source)" identifier (argument_list "(buf,1,size,(FILE *)s->source)" ( identifier , number_literal , identifier , (cast_expression "(FILE *)s->source" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "s->source" identifier -> field_identifier)) )))) ;) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "buf = (void *)((long)buf + sVar2);" (assignment_expression "buf = (void *)((long)buf + sVar2)" identifier = (cast_expression "(void *)((long)buf + sVar2)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)buf + sVar2)" ( (binary_expression "(long)buf + sVar2" (cast_expression "(long)buf" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) ;) (expression_statement "size = size - sVar2;" (assignment_expression "size = size - sVar2" identifier = (binary_expression "size - sVar2" identifier - identifier)) ;) (if_statement "if (size == 0) break;" if (parenthesized_expression "(size == 0)" ( (binary_expression "size == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (if_statement "if ((s->source->_flags & 0x20U) == 0) {\n        iVar1 = 0;\n      }" if (parenthesized_expression "((s->source->_flags & 0x20U) == 0)" ( (binary_expression "(s->source->_flags & 0x20U) == 0" (parenthesized_expression "(s->source->_flags & 0x20U)" ( (binary_expression "s->source->_flags & 0x20U" (field_expression "s->source->_flags" (field_expression "s->source" identifier -> field_identifier) -> field_identifier) & number_literal) )) == number_literal) )) (compound_statement "{\n        iVar1 = 0;\n      }" { (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" identifier = number_literal) ;) })) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "(*s->handler)(s->handler_arg);" (call_expression "(*s->handler)(s->handler_arg)" (parenthesized_expression "(*s->handler)" ( (pointer_expression "*s->handler" * (field_expression "s->handler" identifier -> field_identifier)) )) (argument_list "(s->handler_arg)" ( (field_expression "s->handler_arg" identifier -> field_identifier) ))) ;) })) (return_statement "return;" return ;) })) (expression_statement "__n = (s->buf).isaac.buffered;" (assignment_expression "__n = (s->buf).isaac.buffered" identifier = (field_expression "(s->buf).isaac.buffered" (field_expression "(s->buf).isaac" (parenthesized_expression "(s->buf)" ( (field_expression "s->buf" identifier -> field_identifier) )) . field_identifier) . field_identifier)) ;) (expression_statement "result = (isaac_word *)((s->buf).c + 0x820);" (assignment_expression "result = (isaac_word *)((s->buf).c + 0x820)" identifier = (cast_expression "(isaac_word *)((s->buf).c + 0x820)" ( (type_descriptor "isaac_word *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((s->buf).c + 0x820)" ( (binary_expression "(s->buf).c + 0x820" (field_expression "(s->buf).c" (parenthesized_expression "(s->buf)" ( (field_expression "s->buf" identifier -> field_identifier) )) . field_identifier) + number_literal) )))) ;) (if_statement "if (size <= __n) {\nLAB_00119222:\n    memcpy(buf,(void *)((long)s + (0x1038 - __n)),size);\n    (s->buf).isaac.buffered = __n - size;\n    return;\n  }" if (parenthesized_expression "(size <= __n)" ( (binary_expression "size <= __n" identifier <= identifier) )) (compound_statement "{\nLAB_00119222:\n    memcpy(buf,(void *)((long)s + (0x1038 - __n)),size);\n    (s->buf).isaac.buffered = __n - size;\n    return;\n  }" { (labeled_statement "LAB_00119222:\n    memcpy(buf,(void *)((long)s + (0x1038 - __n)),size);" statement_identifier : (expression_statement "memcpy(buf,(void *)((long)s + (0x1038 - __n)),size);" (call_expression "memcpy(buf,(void *)((long)s + (0x1038 - __n)),size)" identifier (argument_list "(buf,(void *)((long)s + (0x1038 - __n)),size)" ( identifier , (cast_expression "(void *)((long)s + (0x1038 - __n))" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)s + (0x1038 - __n))" ( (binary_expression "(long)s + (0x1038 - __n)" (cast_expression "(long)s" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (parenthesized_expression "(0x1038 - __n)" ( (binary_expression "0x1038 - __n" number_literal - identifier) ))) ))) , identifier ))) ;)) (expression_statement "(s->buf).isaac.buffered = __n - size;" (assignment_expression "(s->buf).isaac.buffered = __n - size" (field_expression "(s->buf).isaac.buffered" (field_expression "(s->buf).isaac" (parenthesized_expression "(s->buf)" ( (field_expression "s->buf" identifier -> field_identifier) )) . field_identifier) . field_identifier) = (binary_expression "__n - size" identifier - identifier)) ;) (return_statement "return;" return ;) })) (while_statement "while( true ) {\n    memcpy(buf,(void *)((long)result + (0x800 - __n)),__n);\n    buf = (void *)((long)buf + __n);\n    size = size - __n;\n    if ((((ulong)buf & 7) == 0) && (0x7ff < size)) break;\n    isaac_refill(&(s->buf).isaac.state,result);\n    __n = 0x800;\n    if (size < 0x801) goto LAB_0011921c;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    memcpy(buf,(void *)((long)result + (0x800 - __n)),__n);\n    buf = (void *)((long)buf + __n);\n    size = size - __n;\n    if ((((ulong)buf & 7) == 0) && (0x7ff < size)) break;\n    isaac_refill(&(s->buf).isaac.state,result);\n    __n = 0x800;\n    if (size < 0x801) goto LAB_0011921c;\n  }" { (expression_statement "memcpy(buf,(void *)((long)result + (0x800 - __n)),__n);" (call_expression "memcpy(buf,(void *)((long)result + (0x800 - __n)),__n)" identifier (argument_list "(buf,(void *)((long)result + (0x800 - __n)),__n)" ( identifier , (cast_expression "(void *)((long)result + (0x800 - __n))" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)result + (0x800 - __n))" ( (binary_expression "(long)result + (0x800 - __n)" (cast_expression "(long)result" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (parenthesized_expression "(0x800 - __n)" ( (binary_expression "0x800 - __n" number_literal - identifier) ))) ))) , identifier ))) ;) (expression_statement "buf = (void *)((long)buf + __n);" (assignment_expression "buf = (void *)((long)buf + __n)" identifier = (cast_expression "(void *)((long)buf + __n)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)buf + __n)" ( (binary_expression "(long)buf + __n" (cast_expression "(long)buf" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) ;) (expression_statement "size = size - __n;" (assignment_expression "size = size - __n" identifier = (binary_expression "size - __n" identifier - identifier)) ;) (if_statement "if ((((ulong)buf & 7) == 0) && (0x7ff < size)) break;" if (parenthesized_expression "((((ulong)buf & 7) == 0) && (0x7ff < size))" ( (binary_expression "(((ulong)buf & 7) == 0) && (0x7ff < size)" (parenthesized_expression "(((ulong)buf & 7) == 0)" ( (binary_expression "((ulong)buf & 7) == 0" (parenthesized_expression "((ulong)buf & 7)" ( (binary_expression "(ulong)buf & 7" (cast_expression "(ulong)buf" ( (type_descriptor "ulong" type_identifier) ) identifier) & number_literal) )) == number_literal) )) && (parenthesized_expression "(0x7ff < size)" ( (binary_expression "0x7ff < size" number_literal < identifier) ))) )) (break_statement "break;" break ;)) (expression_statement "isaac_refill(&(s->buf).isaac.state,result);" (call_expression "isaac_refill(&(s->buf).isaac.state,result)" identifier (argument_list "(&(s->buf).isaac.state,result)" ( (pointer_expression "&(s->buf).isaac.state" & (field_expression "(s->buf).isaac.state" (field_expression "(s->buf).isaac" (parenthesized_expression "(s->buf)" ( (field_expression "s->buf" identifier -> field_identifier) )) . field_identifier) . field_identifier)) , identifier ))) ;) (expression_statement "__n = 0x800;" (assignment_expression "__n = 0x800" identifier = number_literal) ;) (if_statement "if (size < 0x801) goto LAB_0011921c;" if (parenthesized_expression "(size < 0x801)" ( (binary_expression "size < 0x801" identifier < number_literal) )) (goto_statement "goto LAB_0011921c;" goto statement_identifier ;)) })) (do_statement "do {\n    isaac_refill(&(s->buf).isaac.state,(isaac_word *)buf);\n    buf = (void *)((long)buf + 0x800);\n    size = size - 0x800;\n    if (size == 0) {\n      (s->buf).isaac.buffered = 0;\n      return;\n    }\n  } while (0x7ff < size);" do (compound_statement "{\n    isaac_refill(&(s->buf).isaac.state,(isaac_word *)buf);\n    buf = (void *)((long)buf + 0x800);\n    size = size - 0x800;\n    if (size == 0) {\n      (s->buf).isaac.buffered = 0;\n      return;\n    }\n  }" { (expression_statement "isaac_refill(&(s->buf).isaac.state,(isaac_word *)buf);" (call_expression "isaac_refill(&(s->buf).isaac.state,(isaac_word *)buf)" identifier (argument_list "(&(s->buf).isaac.state,(isaac_word *)buf)" ( (pointer_expression "&(s->buf).isaac.state" & (field_expression "(s->buf).isaac.state" (field_expression "(s->buf).isaac" (parenthesized_expression "(s->buf)" ( (field_expression "s->buf" identifier -> field_identifier) )) . field_identifier) . field_identifier)) , (cast_expression "(isaac_word *)buf" ( (type_descriptor "isaac_word *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ))) ;) (expression_statement "buf = (void *)((long)buf + 0x800);" (assignment_expression "buf = (void *)((long)buf + 0x800)" identifier = (cast_expression "(void *)((long)buf + 0x800)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)buf + 0x800)" ( (binary_expression "(long)buf + 0x800" (cast_expression "(long)buf" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) ;) (expression_statement "size = size - 0x800;" (assignment_expression "size = size - 0x800" identifier = (binary_expression "size - 0x800" identifier - number_literal)) ;) (if_statement "if (size == 0) {\n      (s->buf).isaac.buffered = 0;\n      return;\n    }" if (parenthesized_expression "(size == 0)" ( (binary_expression "size == 0" identifier == number_literal) )) (compound_statement "{\n      (s->buf).isaac.buffered = 0;\n      return;\n    }" { (expression_statement "(s->buf).isaac.buffered = 0;" (assignment_expression "(s->buf).isaac.buffered = 0" (field_expression "(s->buf).isaac.buffered" (field_expression "(s->buf).isaac" (parenthesized_expression "(s->buf)" ( (field_expression "s->buf" identifier -> field_identifier) )) . field_identifier) . field_identifier) = number_literal) ;) (return_statement "return;" return ;) })) }) while (parenthesized_expression "(0x7ff < size)" ( (binary_expression "0x7ff < size" number_literal < identifier) )) ;) (expression_statement "isaac_refill(&(s->buf).isaac.state,result);" (call_expression "isaac_refill(&(s->buf).isaac.state,result)" identifier (argument_list "(&(s->buf).isaac.state,result)" ( (pointer_expression "&(s->buf).isaac.state" & (field_expression "(s->buf).isaac.state" (field_expression "(s->buf).isaac" (parenthesized_expression "(s->buf)" ( (field_expression "s->buf" identifier -> field_identifier) )) . field_identifier) . field_identifier)) , identifier ))) ;) (labeled_statement "LAB_0011921c:\n  __n = 0x800;" statement_identifier : (expression_statement "__n = 0x800;" (assignment_expression "__n = 0x800" identifier = number_literal) ;)) (goto_statement "goto LAB_00119222;" goto statement_identifier ;) })))
(translation_unit "void FUN_0011911f(long *param_1,void *param_2,ulong param_3)\n\n{\n  long *plVar1;\n  int iVar2;\n  size_t sVar3;\n  int *piVar4;\n  ulong __n;\n  \n  if (*param_1 != 0) {\n    while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }\n    return;\n  }\n  __n = param_1[3];\n  plVar1 = param_1 + 0x107;\n  if (param_3 <= __n) {\nLAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);\n    param_1[3] = __n - param_3;\n    return;\n  }\n  while( true ) {\n    memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);\n    param_2 = (void *)((long)param_2 + __n);\n    param_3 = param_3 - __n;\n    if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;\n    FUN_00119285(param_1 + 4,plVar1);\n    __n = 0x800;\n    if (param_3 < 0x801) goto LAB_0011921c;\n  }\n  do {\n    FUN_00119285(param_1 + 4,param_2);\n    param_2 = (void *)((long)param_2 + 0x800);\n    param_3 = param_3 - 0x800;\n    if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }\n  } while (0x7ff < param_3);\n  FUN_00119285(param_1 + 4,plVar1);\nLAB_0011921c:\n  __n = 0x800;\n  goto LAB_00119222;\n}\n\n" (function_definition "void FUN_0011911f(long *param_1,void *param_2,ulong param_3)\n\n{\n  long *plVar1;\n  int iVar2;\n  size_t sVar3;\n  int *piVar4;\n  ulong __n;\n  \n  if (*param_1 != 0) {\n    while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }\n    return;\n  }\n  __n = param_1[3];\n  plVar1 = param_1 + 0x107;\n  if (param_3 <= __n) {\nLAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);\n    param_1[3] = __n - param_3;\n    return;\n  }\n  while( true ) {\n    memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);\n    param_2 = (void *)((long)param_2 + __n);\n    param_3 = param_3 - __n;\n    if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;\n    FUN_00119285(param_1 + 4,plVar1);\n    __n = 0x800;\n    if (param_3 < 0x801) goto LAB_0011921c;\n  }\n  do {\n    FUN_00119285(param_1 + 4,param_2);\n    param_2 = (void *)((long)param_2 + 0x800);\n    param_3 = param_3 - 0x800;\n    if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }\n  } while (0x7ff < param_3);\n  FUN_00119285(param_1 + 4,plVar1);\nLAB_0011921c:\n  __n = 0x800;\n  goto LAB_00119222;\n}" primitive_type (function_declarator "FUN_0011911f(long *param_1,void *param_2,ulong param_3)" identifier (parameter_list "(long *param_1,void *param_2,ulong param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "void *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "ulong param_3" type_identifier identifier) ))) (compound_statement "{\n  long *plVar1;\n  int iVar2;\n  size_t sVar3;\n  int *piVar4;\n  ulong __n;\n  \n  if (*param_1 != 0) {\n    while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }\n    return;\n  }\n  __n = param_1[3];\n  plVar1 = param_1 + 0x107;\n  if (param_3 <= __n) {\nLAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);\n    param_1[3] = __n - param_3;\n    return;\n  }\n  while( true ) {\n    memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);\n    param_2 = (void *)((long)param_2 + __n);\n    param_3 = param_3 - __n;\n    if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;\n    FUN_00119285(param_1 + 4,plVar1);\n    __n = 0x800;\n    if (param_3 < 0x801) goto LAB_0011921c;\n  }\n  do {\n    FUN_00119285(param_1 + 4,param_2);\n    param_2 = (void *)((long)param_2 + 0x800);\n    param_3 = param_3 - 0x800;\n    if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }\n  } while (0x7ff < param_3);\n  FUN_00119285(param_1 + 4,plVar1);\nLAB_0011921c:\n  __n = 0x800;\n  goto LAB_00119222;\n}" { (declaration "long *plVar1;" (sized_type_specifier "long" long) (pointer_declarator "*plVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "ulong __n;" type_identifier identifier ;) (if_statement "if (*param_1 != 0) {\n    while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }\n    return;\n  }" if (parenthesized_expression "(*param_1 != 0)" ( (binary_expression "*param_1 != 0" (pointer_expression "*param_1" * identifier) != number_literal) )) (compound_statement "{\n    while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }\n    return;\n  }" { (while_statement "while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }" { (expression_statement "sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);" (assignment_expression "sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1)" identifier = (call_expression "fread_unlocked(param_2,1,param_3,(FILE *)*param_1)" identifier (argument_list "(param_2,1,param_3,(FILE *)*param_1)" ( identifier , number_literal , identifier , (cast_expression "(FILE *)*param_1" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)) )))) ;) (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar2 = *piVar4;" (assignment_expression "iVar2 = *piVar4" identifier = (pointer_expression "*piVar4" * identifier)) ;) (expression_statement "param_2 = (void *)((long)param_2 + sVar3);" (assignment_expression "param_2 = (void *)((long)param_2 + sVar3)" identifier = (cast_expression "(void *)((long)param_2 + sVar3)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_2 + sVar3)" ( (binary_expression "(long)param_2 + sVar3" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) ;) (expression_statement "param_3 = param_3 - sVar3;" (assignment_expression "param_3 = param_3 - sVar3" identifier = (binary_expression "param_3 - sVar3" identifier - identifier)) ;) (if_statement "if (param_3 == 0) break;" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (if_statement "if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }" if (parenthesized_expression "((*(uint *)*param_1 & 0x20) == 0)" ( (binary_expression "(*(uint *)*param_1 & 0x20) == 0" (parenthesized_expression "(*(uint *)*param_1 & 0x20)" ( (binary_expression "*(uint *)*param_1 & 0x20" (pointer_expression "*(uint *)*param_1" * (cast_expression "(uint *)*param_1" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) & number_literal) )) == number_literal) )) (compound_statement "{\n        iVar2 = 0;\n      }" { (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) })) (expression_statement "*piVar4 = iVar2;" (assignment_expression "*piVar4 = iVar2" (pointer_expression "*piVar4" * identifier) = identifier) ;) (expression_statement "(*(code *)param_1[1])(param_1[2]);" (call_expression "(*(code *)param_1[1])(param_1[2])" (parenthesized_expression "(*(code *)param_1[1])" ( (pointer_expression "*(code *)param_1[1]" * (cast_expression "(code *)param_1[1]" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) )) (argument_list "(param_1[2])" ( (subscript_expression "param_1[2]" identifier [ number_literal ]) ))) ;) })) (return_statement "return;" return ;) })) (expression_statement "__n = param_1[3];" (assignment_expression "__n = param_1[3]" identifier = (subscript_expression "param_1[3]" identifier [ number_literal ])) ;) (expression_statement "plVar1 = param_1 + 0x107;" (assignment_expression "plVar1 = param_1 + 0x107" identifier = (binary_expression "param_1 + 0x107" identifier + number_literal)) ;) (if_statement "if (param_3 <= __n) {\nLAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);\n    param_1[3] = __n - param_3;\n    return;\n  }" if (parenthesized_expression "(param_3 <= __n)" ( (binary_expression "param_3 <= __n" identifier <= identifier) )) (compound_statement "{\nLAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);\n    param_1[3] = __n - param_3;\n    return;\n  }" { (labeled_statement "LAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);" statement_identifier : (expression_statement "memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);" (call_expression "memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3)" identifier (argument_list "(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3)" ( identifier , (cast_expression "(void *)((long)param_1 + (0x1038 - __n))" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_1 + (0x1038 - __n))" ( (binary_expression "(long)param_1 + (0x1038 - __n)" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (parenthesized_expression "(0x1038 - __n)" ( (binary_expression "0x1038 - __n" number_literal - identifier) ))) ))) , identifier ))) ;)) (expression_statement "param_1[3] = __n - param_3;" (assignment_expression "param_1[3] = __n - param_3" (subscript_expression "param_1[3]" identifier [ number_literal ]) = (binary_expression "__n - param_3" identifier - identifier)) ;) (return_statement "return;" return ;) })) (while_statement "while( true ) {\n    memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);\n    param_2 = (void *)((long)param_2 + __n);\n    param_3 = param_3 - __n;\n    if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;\n    FUN_00119285(param_1 + 4,plVar1);\n    __n = 0x800;\n    if (param_3 < 0x801) goto LAB_0011921c;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);\n    param_2 = (void *)((long)param_2 + __n);\n    param_3 = param_3 - __n;\n    if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;\n    FUN_00119285(param_1 + 4,plVar1);\n    __n = 0x800;\n    if (param_3 < 0x801) goto LAB_0011921c;\n  }" { (expression_statement "memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);" (call_expression "memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n)" identifier (argument_list "(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n)" ( identifier , (cast_expression "(void *)((long)plVar1 + (0x800 - __n))" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)plVar1 + (0x800 - __n))" ( (binary_expression "(long)plVar1 + (0x800 - __n)" (cast_expression "(long)plVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (parenthesized_expression "(0x800 - __n)" ( (binary_expression "0x800 - __n" number_literal - identifier) ))) ))) , identifier ))) ;) (expression_statement "param_2 = (void *)((long)param_2 + __n);" (assignment_expression "param_2 = (void *)((long)param_2 + __n)" identifier = (cast_expression "(void *)((long)param_2 + __n)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_2 + __n)" ( (binary_expression "(long)param_2 + __n" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) ;) (expression_statement "param_3 = param_3 - __n;" (assignment_expression "param_3 = param_3 - __n" identifier = (binary_expression "param_3 - __n" identifier - identifier)) ;) (if_statement "if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;" if (parenthesized_expression "((((ulong)param_2 & 7) == 0) && (0x7ff < param_3))" ( (binary_expression "(((ulong)param_2 & 7) == 0) && (0x7ff < param_3)" (parenthesized_expression "(((ulong)param_2 & 7) == 0)" ( (binary_expression "((ulong)param_2 & 7) == 0" (parenthesized_expression "((ulong)param_2 & 7)" ( (binary_expression "(ulong)param_2 & 7" (cast_expression "(ulong)param_2" ( (type_descriptor "ulong" type_identifier) ) identifier) & number_literal) )) == number_literal) )) && (parenthesized_expression "(0x7ff < param_3)" ( (binary_expression "0x7ff < param_3" number_literal < identifier) ))) )) (break_statement "break;" break ;)) (expression_statement "FUN_00119285(param_1 + 4,plVar1);" (call_expression "FUN_00119285(param_1 + 4,plVar1)" identifier (argument_list "(param_1 + 4,plVar1)" ( (binary_expression "param_1 + 4" identifier + number_literal) , identifier ))) ;) (expression_statement "__n = 0x800;" (assignment_expression "__n = 0x800" identifier = number_literal) ;) (if_statement "if (param_3 < 0x801) goto LAB_0011921c;" if (parenthesized_expression "(param_3 < 0x801)" ( (binary_expression "param_3 < 0x801" identifier < number_literal) )) (goto_statement "goto LAB_0011921c;" goto statement_identifier ;)) })) (do_statement "do {\n    FUN_00119285(param_1 + 4,param_2);\n    param_2 = (void *)((long)param_2 + 0x800);\n    param_3 = param_3 - 0x800;\n    if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }\n  } while (0x7ff < param_3);" do (compound_statement "{\n    FUN_00119285(param_1 + 4,param_2);\n    param_2 = (void *)((long)param_2 + 0x800);\n    param_3 = param_3 - 0x800;\n    if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }\n  }" { (expression_statement "FUN_00119285(param_1 + 4,param_2);" (call_expression "FUN_00119285(param_1 + 4,param_2)" identifier (argument_list "(param_1 + 4,param_2)" ( (binary_expression "param_1 + 4" identifier + number_literal) , identifier ))) ;) (expression_statement "param_2 = (void *)((long)param_2 + 0x800);" (assignment_expression "param_2 = (void *)((long)param_2 + 0x800)" identifier = (cast_expression "(void *)((long)param_2 + 0x800)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_2 + 0x800)" ( (binary_expression "(long)param_2 + 0x800" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) )))) ;) (expression_statement "param_3 = param_3 - 0x800;" (assignment_expression "param_3 = param_3 - 0x800" identifier = (binary_expression "param_3 - 0x800" identifier - number_literal)) ;) (if_statement "if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n      param_1[3] = 0;\n      return;\n    }" { (expression_statement "param_1[3] = 0;" (assignment_expression "param_1[3] = 0" (subscript_expression "param_1[3]" identifier [ number_literal ]) = number_literal) ;) (return_statement "return;" return ;) })) }) while (parenthesized_expression "(0x7ff < param_3)" ( (binary_expression "0x7ff < param_3" number_literal < identifier) )) ;) (expression_statement "FUN_00119285(param_1 + 4,plVar1);" (call_expression "FUN_00119285(param_1 + 4,plVar1)" identifier (argument_list "(param_1 + 4,plVar1)" ( (binary_expression "param_1 + 4" identifier + number_literal) , identifier ))) ;) (labeled_statement "LAB_0011921c:\n  __n = 0x800;" statement_identifier : (expression_statement "__n = 0x800;" (assignment_expression "__n = 0x800" identifier = number_literal) ;)) (goto_statement "goto LAB_00119222;" goto statement_identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration (sized_type_specifier long) (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) (compound_statement { (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT)) )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * 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) + IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (break_statement break ;)) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) & LIT) )) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) )) (argument_list ( (subscript_expression IDENT [ LIT ]) ))) ;) })) (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + (parenthesized_expression ( (binary_expression LIT - IDENT) ))) ))) , IDENT ))) ;)) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT - IDENT)) ;) (return_statement return ;) })) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + (parenthesized_expression ( (binary_expression LIT - IDENT) ))) ))) , 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) + IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) & LIT) )) == LIT) )) && (parenthesized_expression ( (binary_expression LIT < IDENT) ))) )) (break_statement break ;)) (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , IDENT ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (goto_statement goto statement_identifier ;)) })) (do_statement do (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + LIT) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (return_statement return ;) })) }) while (parenthesized_expression ( (binary_expression LIT < IDENT) )) ;) (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , IDENT ))) ;) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = LIT) ;)) (goto_statement goto statement_identifier ;) })))
(function_definition "void FUN_0011911f(long *param_1,void *param_2,ulong param_3)\n\n{\n  long *plVar1;\n  int iVar2;\n  size_t sVar3;\n  int *piVar4;\n  ulong __n;\n  \n  if (*param_1 != 0) {\n    while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }\n    return;\n  }\n  __n = param_1[3];\n  plVar1 = param_1 + 0x107;\n  if (param_3 <= __n) {\nLAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);\n    param_1[3] = __n - param_3;\n    return;\n  }\n  while( true ) {\n    memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);\n    param_2 = (void *)((long)param_2 + __n);\n    param_3 = param_3 - __n;\n    if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;\n    FUN_00119285(param_1 + 4,plVar1);\n    __n = 0x800;\n    if (param_3 < 0x801) goto LAB_0011921c;\n  }\n  do {\n    FUN_00119285(param_1 + 4,param_2);\n    param_2 = (void *)((long)param_2 + 0x800);\n    param_3 = param_3 - 0x800;\n    if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }\n  } while (0x7ff < param_3);\n  FUN_00119285(param_1 + 4,plVar1);\nLAB_0011921c:\n  __n = 0x800;\n  goto LAB_00119222;\n}" (primitive_type "void") (function_declarator "FUN_0011911f(long *param_1,void *param_2,ulong param_3)" (identifier "FUN_0011911f") (parameter_list "(long *param_1,void *param_2,ulong param_3)" (( "(") (parameter_declaration "long *param_1" (sized_type_specifier "long" (long "long")) (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "void *param_2" (primitive_type "void") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "ulong param_3" (type_identifier "ulong") (identifier "param_3")) () ")"))) (compound_statement "{\n  long *plVar1;\n  int iVar2;\n  size_t sVar3;\n  int *piVar4;\n  ulong __n;\n  \n  if (*param_1 != 0) {\n    while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }\n    return;\n  }\n  __n = param_1[3];\n  plVar1 = param_1 + 0x107;\n  if (param_3 <= __n) {\nLAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);\n    param_1[3] = __n - param_3;\n    return;\n  }\n  while( true ) {\n    memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);\n    param_2 = (void *)((long)param_2 + __n);\n    param_3 = param_3 - __n;\n    if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;\n    FUN_00119285(param_1 + 4,plVar1);\n    __n = 0x800;\n    if (param_3 < 0x801) goto LAB_0011921c;\n  }\n  do {\n    FUN_00119285(param_1 + 4,param_2);\n    param_2 = (void *)((long)param_2 + 0x800);\n    param_3 = param_3 - 0x800;\n    if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }\n  } while (0x7ff < param_3);\n  FUN_00119285(param_1 + 4,plVar1);\nLAB_0011921c:\n  __n = 0x800;\n  goto LAB_00119222;\n}" ({ "{") (declaration "long *plVar1;" (sized_type_specifier "long" (long "long")) (pointer_declarator "*plVar1" (* "*") (identifier "plVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "size_t sVar3;" (primitive_type "size_t") (identifier "sVar3") (; ";")) (declaration "int *piVar4;" (primitive_type "int") (pointer_declarator "*piVar4" (* "*") (identifier "piVar4")) (; ";")) (declaration "ulong __n;" (type_identifier "ulong") (identifier "__n") (; ";")) (if_statement "if (*param_1 != 0) {\n    while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }\n    return;\n  }" (if "if") (parenthesized_expression "(*param_1 != 0)" (( "(") (binary_expression "*param_1 != 0" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }\n    return;\n  }" ({ "{") (while_statement "while( true ) {\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);\n      piVar4 = __errno_location();\n      iVar2 = *piVar4;\n      param_2 = (void *)((long)param_2 + sVar3);\n      param_3 = param_3 - sVar3;\n      if (param_3 == 0) break;\n      if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }\n      *piVar4 = iVar2;\n      (*(code *)param_1[1])(param_1[2]);\n    }" ({ "{") (expression_statement "sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);" (assignment_expression "sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1)" (identifier "sVar3") (= "=") (call_expression "fread_unlocked(param_2,1,param_3,(FILE *)*param_1)" (identifier "fread_unlocked") (argument_list "(param_2,1,param_3,(FILE *)*param_1)" (( "(") (identifier "param_2") (, ",") (number_literal "1") (, ",") (identifier "param_3") (, ",") (cast_expression "(FILE *)*param_1" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) () ")")))) (; ";")) (expression_statement "piVar4 = __errno_location();" (assignment_expression "piVar4 = __errno_location()" (identifier "piVar4") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "iVar2 = *piVar4;" (assignment_expression "iVar2 = *piVar4" (identifier "iVar2") (= "=") (pointer_expression "*piVar4" (* "*") (identifier "piVar4"))) (; ";")) (expression_statement "param_2 = (void *)((long)param_2 + sVar3);" (assignment_expression "param_2 = (void *)((long)param_2 + sVar3)" (identifier "param_2") (= "=") (cast_expression "(void *)((long)param_2 + sVar3)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)param_2 + sVar3)" (( "(") (binary_expression "(long)param_2 + sVar3" (cast_expression "(long)param_2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_2")) (+ "+") (identifier "sVar3")) () ")")))) (; ";")) (expression_statement "param_3 = param_3 - sVar3;" (assignment_expression "param_3 = param_3 - sVar3" (identifier "param_3") (= "=") (binary_expression "param_3 - sVar3" (identifier "param_3") (- "-") (identifier "sVar3"))) (; ";")) (if_statement "if (param_3 == 0) break;" (if "if") (parenthesized_expression "(param_3 == 0)" (( "(") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0")) () ")")) (break_statement "break;" (break "break") (; ";"))) (if_statement "if ((*(uint *)*param_1 & 0x20) == 0) {\n        iVar2 = 0;\n      }" (if "if") (parenthesized_expression "((*(uint *)*param_1 & 0x20) == 0)" (( "(") (binary_expression "(*(uint *)*param_1 & 0x20) == 0" (parenthesized_expression "(*(uint *)*param_1 & 0x20)" (( "(") (binary_expression "*(uint *)*param_1 & 0x20" (pointer_expression "*(uint *)*param_1" (* "*") (cast_expression "(uint *)*param_1" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (& "&") (number_literal "0x20")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        iVar2 = 0;\n      }" ({ "{") (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" (identifier "iVar2") (= "=") (number_literal "0")) (; ";")) (} "}"))) (expression_statement "*piVar4 = iVar2;" (assignment_expression "*piVar4 = iVar2" (pointer_expression "*piVar4" (* "*") (identifier "piVar4")) (= "=") (identifier "iVar2")) (; ";")) (expression_statement "(*(code *)param_1[1])(param_1[2]);" (call_expression "(*(code *)param_1[1])(param_1[2])" (parenthesized_expression "(*(code *)param_1[1])" (( "(") (pointer_expression "*(code *)param_1[1]" (* "*") (cast_expression "(code *)param_1[1]" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")))) () ")")) (argument_list "(param_1[2])" (( "(") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) () ")"))) (; ";")) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "__n = param_1[3];" (assignment_expression "__n = param_1[3]" (identifier "__n") (= "=") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) (; ";")) (expression_statement "plVar1 = param_1 + 0x107;" (assignment_expression "plVar1 = param_1 + 0x107" (identifier "plVar1") (= "=") (binary_expression "param_1 + 0x107" (identifier "param_1") (+ "+") (number_literal "0x107"))) (; ";")) (if_statement "if (param_3 <= __n) {\nLAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);\n    param_1[3] = __n - param_3;\n    return;\n  }" (if "if") (parenthesized_expression "(param_3 <= __n)" (( "(") (binary_expression "param_3 <= __n" (identifier "param_3") (<= "<=") (identifier "__n")) () ")")) (compound_statement "{\nLAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);\n    param_1[3] = __n - param_3;\n    return;\n  }" ({ "{") (labeled_statement "LAB_00119222:\n    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);" (statement_identifier "LAB_00119222") (: ":") (expression_statement "memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);" (call_expression "memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3)" (identifier "memcpy") (argument_list "(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3)" (( "(") (identifier "param_2") (, ",") (cast_expression "(void *)((long)param_1 + (0x1038 - __n))" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)param_1 + (0x1038 - __n))" (( "(") (binary_expression "(long)param_1 + (0x1038 - __n)" (cast_expression "(long)param_1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_1")) (+ "+") (parenthesized_expression "(0x1038 - __n)" (( "(") (binary_expression "0x1038 - __n" (number_literal "0x1038") (- "-") (identifier "__n")) () ")"))) () ")"))) (, ",") (identifier "param_3") () ")"))) (; ";"))) (expression_statement "param_1[3] = __n - param_3;" (assignment_expression "param_1[3] = __n - param_3" (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]")) (= "=") (binary_expression "__n - param_3" (identifier "__n") (- "-") (identifier "param_3"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (while_statement "while( true ) {\n    memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);\n    param_2 = (void *)((long)param_2 + __n);\n    param_3 = param_3 - __n;\n    if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;\n    FUN_00119285(param_1 + 4,plVar1);\n    __n = 0x800;\n    if (param_3 < 0x801) goto LAB_0011921c;\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);\n    param_2 = (void *)((long)param_2 + __n);\n    param_3 = param_3 - __n;\n    if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;\n    FUN_00119285(param_1 + 4,plVar1);\n    __n = 0x800;\n    if (param_3 < 0x801) goto LAB_0011921c;\n  }" ({ "{") (expression_statement "memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);" (call_expression "memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n)" (identifier "memcpy") (argument_list "(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n)" (( "(") (identifier "param_2") (, ",") (cast_expression "(void *)((long)plVar1 + (0x800 - __n))" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)plVar1 + (0x800 - __n))" (( "(") (binary_expression "(long)plVar1 + (0x800 - __n)" (cast_expression "(long)plVar1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "plVar1")) (+ "+") (parenthesized_expression "(0x800 - __n)" (( "(") (binary_expression "0x800 - __n" (number_literal "0x800") (- "-") (identifier "__n")) () ")"))) () ")"))) (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "param_2 = (void *)((long)param_2 + __n);" (assignment_expression "param_2 = (void *)((long)param_2 + __n)" (identifier "param_2") (= "=") (cast_expression "(void *)((long)param_2 + __n)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)param_2 + __n)" (( "(") (binary_expression "(long)param_2 + __n" (cast_expression "(long)param_2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_2")) (+ "+") (identifier "__n")) () ")")))) (; ";")) (expression_statement "param_3 = param_3 - __n;" (assignment_expression "param_3 = param_3 - __n" (identifier "param_3") (= "=") (binary_expression "param_3 - __n" (identifier "param_3") (- "-") (identifier "__n"))) (; ";")) (if_statement "if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;" (if "if") (parenthesized_expression "((((ulong)param_2 & 7) == 0) && (0x7ff < param_3))" (( "(") (binary_expression "(((ulong)param_2 & 7) == 0) && (0x7ff < param_3)" (parenthesized_expression "(((ulong)param_2 & 7) == 0)" (( "(") (binary_expression "((ulong)param_2 & 7) == 0" (parenthesized_expression "((ulong)param_2 & 7)" (( "(") (binary_expression "(ulong)param_2 & 7" (cast_expression "(ulong)param_2" (( "(") (type_descriptor "ulong" (type_identifier "ulong")) () ")") (identifier "param_2")) (& "&") (number_literal "7")) () ")")) (== "==") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(0x7ff < param_3)" (( "(") (binary_expression "0x7ff < param_3" (number_literal "0x7ff") (< "<") (identifier "param_3")) () ")"))) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "FUN_00119285(param_1 + 4,plVar1);" (call_expression "FUN_00119285(param_1 + 4,plVar1)" (identifier "FUN_00119285") (argument_list "(param_1 + 4,plVar1)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) (, ",") (identifier "plVar1") () ")"))) (; ";")) (expression_statement "__n = 0x800;" (assignment_expression "__n = 0x800" (identifier "__n") (= "=") (number_literal "0x800")) (; ";")) (if_statement "if (param_3 < 0x801) goto LAB_0011921c;" (if "if") (parenthesized_expression "(param_3 < 0x801)" (( "(") (binary_expression "param_3 < 0x801" (identifier "param_3") (< "<") (number_literal "0x801")) () ")")) (goto_statement "goto LAB_0011921c;" (goto "goto") (statement_identifier "LAB_0011921c") (; ";"))) (} "}"))) (do_statement "do {\n    FUN_00119285(param_1 + 4,param_2);\n    param_2 = (void *)((long)param_2 + 0x800);\n    param_3 = param_3 - 0x800;\n    if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }\n  } while (0x7ff < param_3);" (do "do") (compound_statement "{\n    FUN_00119285(param_1 + 4,param_2);\n    param_2 = (void *)((long)param_2 + 0x800);\n    param_3 = param_3 - 0x800;\n    if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }\n  }" ({ "{") (expression_statement "FUN_00119285(param_1 + 4,param_2);" (call_expression "FUN_00119285(param_1 + 4,param_2)" (identifier "FUN_00119285") (argument_list "(param_1 + 4,param_2)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) (, ",") (identifier "param_2") () ")"))) (; ";")) (expression_statement "param_2 = (void *)((long)param_2 + 0x800);" (assignment_expression "param_2 = (void *)((long)param_2 + 0x800)" (identifier "param_2") (= "=") (cast_expression "(void *)((long)param_2 + 0x800)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)param_2 + 0x800)" (( "(") (binary_expression "(long)param_2 + 0x800" (cast_expression "(long)param_2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_2")) (+ "+") (number_literal "0x800")) () ")")))) (; ";")) (expression_statement "param_3 = param_3 - 0x800;" (assignment_expression "param_3 = param_3 - 0x800" (identifier "param_3") (= "=") (binary_expression "param_3 - 0x800" (identifier "param_3") (- "-") (number_literal "0x800"))) (; ";")) (if_statement "if (param_3 == 0) {\n      param_1[3] = 0;\n      return;\n    }" (if "if") (parenthesized_expression "(param_3 == 0)" (( "(") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      param_1[3] = 0;\n      return;\n    }" ({ "{") (expression_statement "param_1[3] = 0;" (assignment_expression "param_1[3] = 0" (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]")) (= "=") (number_literal "0")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (} "}")) (while "while") (parenthesized_expression "(0x7ff < param_3)" (( "(") (binary_expression "0x7ff < param_3" (number_literal "0x7ff") (< "<") (identifier "param_3")) () ")")) (; ";")) (expression_statement "FUN_00119285(param_1 + 4,plVar1);" (call_expression "FUN_00119285(param_1 + 4,plVar1)" (identifier "FUN_00119285") (argument_list "(param_1 + 4,plVar1)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) (, ",") (identifier "plVar1") () ")"))) (; ";")) (labeled_statement "LAB_0011921c:\n  __n = 0x800;" (statement_identifier "LAB_0011921c") (: ":") (expression_statement "__n = 0x800;" (assignment_expression "__n = 0x800" (identifier "__n") (= "=") (number_literal "0x800")) (; ";"))) (goto_statement "goto LAB_00119222;" (goto "goto") (statement_identifier "LAB_00119222") (; ";")) (} "}")))

void function_1(type_1 *s,void *buf,size_t var_4)

{
  type_2 *result;
  int iVar1;
  size_t var_3;
  int *piVar3;
  type_3 var_5;
  
  if (s->source != (type_4 *)0x0) {
    while( true ) {
      var_3 = var_1(buf,1,var_4,(type_4 *)s->source);
      piVar3 = var_2();
      iVar1 = *piVar3;
      buf = (void *)((long)buf + var_3);
      var_4 = var_4 - var_3;
      if (var_4 == 0) break;
      if ((s->source->_flags & 0x20U) == 0) {
        iVar1 = 0;
      }
      *piVar3 = iVar1;
      (*s->handler)(s->handler_arg);
    }
    return;
  }
  var_5 = (s->buf).isaac.buffered;
  result = (type_2 *)((s->buf).c + 0x820);
  if (var_4 <= var_5) {
LAB_00119222:
    var_6(buf,(void *)((long)s + (0x1038 - var_5)),var_4);
    (s->buf).isaac.buffered = var_5 - var_4;
    return;
  }
  while( true ) {
    var_6(buf,(void *)((long)result + (0x800 - var_5)),var_5);
    buf = (void *)((long)buf + var_5);
    var_4 = var_4 - var_5;
    if ((((type_3)buf & 7) == 0) && (0x7ff < var_4)) break;
    var_7(&(s->buf).isaac.state,result);
    var_5 = 0x800;
    if (var_4 < 0x801) goto LAB_0011921c;
  }
  do {
    var_7(&(s->buf).isaac.state,(type_2 *)buf);
    buf = (void *)((long)buf + 0x800);
    var_4 = var_4 - 0x800;
    if (var_4 == 0) {
      (s->buf).isaac.buffered = 0;
      return;
    }
  } while (0x7ff < var_4);
  var_7(&(s->buf).isaac.state,result);
LAB_0011921c:
  var_5 = 0x800;
  goto LAB_00119222;
}


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

void MASKED(long *param_1,void *param_2,ulong param_3)

{
  long *plVar1;
  int iVar2;
  size_t sVar3;
  int *piVar4;
  ulong __n;
  
  if (*param_1 != 0) {
    while( true ) {
      sVar3 = fread_unlocked(param_2,1,param_3,(FILE *)*param_1);
      piVar4 = __errno_location();
      iVar2 = *piVar4;
      param_2 = (void *)((long)param_2 + sVar3);
      param_3 = param_3 - sVar3;
      if (param_3 == 0) break;
      if ((*(uint *)*param_1 & 0x20) == 0) {
        iVar2 = 0;
      }
      *piVar4 = iVar2;
      (*(code *)param_1[1])(param_1[2]);
    }
    return;
  }
  __n = param_1[3];
  plVar1 = param_1 + 0x107;
  if (param_3 <= __n) {
LAB_00119222:
    memcpy(param_2,(void *)((long)param_1 + (0x1038 - __n)),param_3);
    param_1[3] = __n - param_3;
    return;
  }
  while( true ) {
    memcpy(param_2,(void *)((long)plVar1 + (0x800 - __n)),__n);
    param_2 = (void *)((long)param_2 + __n);
    param_3 = param_3 - __n;
    if ((((ulong)param_2 & 7) == 0) && (0x7ff < param_3)) break;
    FUN_00119285(param_1 + 4,plVar1);
    __n = 0x800;
    if (param_3 < 0x801) goto LAB_0011921c;
  }
  do {
    FUN_00119285(param_1 + 4,param_2);
    param_2 = (void *)((long)param_2 + 0x800);
    param_3 = param_3 - 0x800;
    if (param_3 == 0) {
      param_1[3] = 0;
      return;
    }
  } while (0x7ff < param_3);
  FUN_00119285(param_1 + 4,plVar1);
LAB_0011921c:
  __n = 0x800;
  goto LAB_00119222;
}

