
randint randint_genmax(randint_source *s,randint genmax)

{
  ulong uVar1;
  long lVar2;
  randread_source *s_00;
  ulong uVar3;
  byte *pbVar4;
  size_t size;
  ulong uVar5;
  ulong uVar6;
  long in_FS_OFFSET;
  uchar buf [8];
  
  lVar2 = *(long *)(in_FS_OFFSET + 0x28);
  s_00 = s->source;
  uVar5 = s->randmax;
  uVar1 = genmax + 1;
  uVar6 = s->randnum;
  while( true ) {
    if (uVar5 < genmax) {
      size = 0;
      uVar3 = uVar5;
      do {
        uVar3 = uVar3 * 0x100 + 0xff;
        size = size + 1;
      } while (uVar3 < genmax);
      randread(s_00,buf,size);
      pbVar4 = buf;
      do {
        uVar6 = uVar6 * 0x100 + (ulong)*pbVar4;
        uVar5 = uVar5 * 0x100 + 0xff;
        pbVar4 = pbVar4 + 1;
      } while (uVar5 < genmax);
    }
    if (uVar5 == genmax) break;
    uVar3 = (uVar5 - genmax) % uVar1;
    if (uVar6 <= uVar5 - uVar3) {
      s->randnum = uVar6 / uVar1;
      s->randmax = (uVar5 - genmax) / uVar1;
      uVar6 = uVar6 % uVar1;
LAB_00118cd9:
      if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {
        return uVar6;
      }
                    /* WARNING: Subroutine does not return */
      __stack_chk_fail();
    }
    uVar5 = uVar3 - 1;
    uVar6 = uVar6 % uVar1;
  }
  s->randmax = 0;
  s->randnum = 0;
  goto LAB_00118cd9;
}



ulong FUN_00118c01(undefined8 *param_1,ulong param_2)

{
  ulong uVar1;
  undefined8 uVar2;
  ulong uVar3;
  byte *pbVar4;
  long lVar5;
  ulong uVar6;
  ulong uVar7;
  long in_FS_OFFSET;
  byte local_48 [8];
  long local_40;
  
  local_40 = *(long *)(in_FS_OFFSET + 0x28);
  uVar2 = *param_1;
  uVar6 = param_1[2];
  uVar1 = param_2 + 1;
  uVar7 = param_1[1];
  while( true ) {
    if (uVar6 < param_2) {
      lVar5 = 0;
      uVar3 = uVar6;
      do {
        uVar3 = uVar3 * 0x100 + 0xff;
        lVar5 = lVar5 + 1;
      } while (uVar3 < param_2);
      FUN_0011911f(uVar2,local_48,lVar5);
      pbVar4 = local_48;
      do {
        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;
        uVar6 = uVar6 * 0x100 + 0xff;
        pbVar4 = pbVar4 + 1;
      } while (uVar6 < param_2);
    }
    if (uVar6 == param_2) break;
    uVar3 = (uVar6 - param_2) % uVar1;
    if (uVar7 <= uVar6 - uVar3) {
      param_1[1] = uVar7 / uVar1;
      param_1[2] = (uVar6 - param_2) / uVar1;
      uVar7 = uVar7 % uVar1;
LAB_00118cd9:
      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {
        return uVar7;
      }
                    /* WARNING: Subroutine does not return */
      __stack_chk_fail();
    }
    uVar6 = uVar3 - 1;
    uVar7 = uVar7 % uVar1;
  }
  param_1[2] = 0;
  param_1[1] = 0;
  goto LAB_00118cd9;
}


PUSH R15
PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x28
MOV R15,RDI
MOV R12,RSI
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RSP + 0x18],RAX
XOR EAX,EAX
MOV RAX,qword ptr [RDI]
MOV qword ptr [RSP + 0x8],RAX
MOV RBP,qword ptr [RDI + 0x8]
MOV RBX,qword ptr [RDI + 0x10]
LEA R13,[RSI + 0x1]
LEA R14,[RSP + 0x10]
JMP 0x00118ca4
MOV RSI,R14
MOV RDI,qword ptr [RSP + 0x8]
CALL 0x0011911f
MOV RCX,R14
SHL RBP,0x8
MOVZX EAX,byte ptr [RCX]
ADD RBP,RAX
SHL RBX,0x8
ADD RBX,0xff
ADD RCX,0x1
CMP R12,RBX
JA 0x00118c50
CMP RBX,R12
JZ 0x00118cc9
MOV RCX,RBX
SUB RCX,R12
MOV RAX,RCX
MOV EDX,0x0
DIV R13
MOV RSI,RDX
MOV RAX,RBP
MOV EDX,0x0
DIV R13
MOV RDI,RDX
SUB RBX,RSI
CMP RBP,RBX
JBE 0x00118cfb
LEA RBX,[RSI + -0x1]
MOV RBP,RDX
CMP RBX,R12
JNC 0x00118c6e
MOV RAX,RBX
MOV EDX,0x0
SHL RAX,0x8
ADD RAX,0xff
ADD RDX,0x1
CMP R12,RAX
JA 0x00118cb1
JMP 0x00118c40
MOV qword ptr [R15 + 0x10],0x0
MOV qword ptr [R15 + 0x8],0x0
MOV RAX,RBP
MOV RDI,qword ptr [RSP + 0x18]
XOR RDI,qword ptr FS:[0x28]
JNZ 0x00118d1e
ADD RSP,0x28
POP RBX
POP RBP
POP R12
POP R13
POP R14
POP R15
RET
MOV RAX,RBP
MOV EDX,0x0
DIV R13
MOV qword ptr [R15 + 0x8],RAX
MOV RAX,RCX
MOV EDX,0x0
DIV R13
MOV qword ptr [R15 + 0x10],RAX
MOV RBP,RDI
JMP 0x00118cd9
CALL 0x001042e0
(translation_unit "ulong FUN_00118c01(undefined8 *param_1,ulong param_2)\n\n{\n  ulong uVar1;\n  undefined8 uVar2;\n  ulong uVar3;\n  byte *pbVar4;\n  long lVar5;\n  ulong uVar6;\n  ulong uVar7;\n  long in_FS_OFFSET;\n  byte local_48 [8];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  uVar2 = *param_1;\n  uVar6 = param_1[2];\n  uVar1 = param_2 + 1;\n  uVar7 = param_1[1];\n  while( true ) {\n    if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }\n    if (uVar6 == param_2) break;\n    uVar3 = (uVar6 - param_2) % uVar1;\n    if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    /* WARNING: Subroutine does not return */\n      __stack_chk_fail();\n    }\n    uVar6 = uVar3 - 1;\n    uVar7 = uVar7 % uVar1;\n  }\n  param_1[2] = 0;\n  param_1[1] = 0;\n  goto LAB_00118cd9;\n}\n\n" (function_definition "ulong FUN_00118c01(undefined8 *param_1,ulong param_2)\n\n{\n  ulong uVar1;\n  undefined8 uVar2;\n  ulong uVar3;\n  byte *pbVar4;\n  long lVar5;\n  ulong uVar6;\n  ulong uVar7;\n  long in_FS_OFFSET;\n  byte local_48 [8];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  uVar2 = *param_1;\n  uVar6 = param_1[2];\n  uVar1 = param_2 + 1;\n  uVar7 = param_1[1];\n  while( true ) {\n    if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }\n    if (uVar6 == param_2) break;\n    uVar3 = (uVar6 - param_2) % uVar1;\n    if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    /* WARNING: Subroutine does not return */\n      __stack_chk_fail();\n    }\n    uVar6 = uVar3 - 1;\n    uVar7 = uVar7 % uVar1;\n  }\n  param_1[2] = 0;\n  param_1[1] = 0;\n  goto LAB_00118cd9;\n}" type_identifier (function_declarator "FUN_00118c01(undefined8 *param_1,ulong param_2)" identifier (parameter_list "(undefined8 *param_1,ulong param_2)" ( (parameter_declaration "undefined8 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "ulong param_2" type_identifier identifier) ))) (compound_statement "{\n  ulong uVar1;\n  undefined8 uVar2;\n  ulong uVar3;\n  byte *pbVar4;\n  long lVar5;\n  ulong uVar6;\n  ulong uVar7;\n  long in_FS_OFFSET;\n  byte local_48 [8];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  uVar2 = *param_1;\n  uVar6 = param_1[2];\n  uVar1 = param_2 + 1;\n  uVar7 = param_1[1];\n  while( true ) {\n    if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }\n    if (uVar6 == param_2) break;\n    uVar3 = (uVar6 - param_2) % uVar1;\n    if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    /* WARNING: Subroutine does not return */\n      __stack_chk_fail();\n    }\n    uVar6 = uVar3 - 1;\n    uVar7 = uVar7 % uVar1;\n  }\n  param_1[2] = 0;\n  param_1[1] = 0;\n  goto LAB_00118cd9;\n}" { (declaration "ulong uVar1;" type_identifier identifier ;) (declaration "undefined8 uVar2;" type_identifier identifier ;) (declaration "ulong uVar3;" type_identifier identifier ;) (declaration "byte *pbVar4;" type_identifier (pointer_declarator "*pbVar4" * identifier) ;) (declaration "long lVar5;" (sized_type_specifier "long" long) identifier ;) (declaration "ulong uVar6;" type_identifier identifier ;) (declaration "ulong uVar7;" type_identifier identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "byte local_48 [8];" type_identifier (array_declarator "local_48 [8]" identifier [ number_literal ]) ;) (declaration "long local_40;" (sized_type_specifier "long" long) identifier ;) (expression_statement "local_40 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_40 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (expression_statement "uVar2 = *param_1;" (assignment_expression "uVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar6 = param_1[2];" (assignment_expression "uVar6 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) (expression_statement "uVar1 = param_2 + 1;" (assignment_expression "uVar1 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) (expression_statement "uVar7 = param_1[1];" (assignment_expression "uVar7 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (while_statement "while( true ) {\n    if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }\n    if (uVar6 == param_2) break;\n    uVar3 = (uVar6 - param_2) % uVar1;\n    if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    /* WARNING: Subroutine does not return */\n      __stack_chk_fail();\n    }\n    uVar6 = uVar3 - 1;\n    uVar7 = uVar7 % uVar1;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }\n    if (uVar6 == param_2) break;\n    uVar3 = (uVar6 - param_2) % uVar1;\n    if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    /* WARNING: Subroutine does not return */\n      __stack_chk_fail();\n    }\n    uVar6 = uVar3 - 1;\n    uVar7 = uVar7 % uVar1;\n  }" { (if_statement "if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }" if (parenthesized_expression "(uVar6 < param_2)" ( (binary_expression "uVar6 < param_2" identifier < identifier) )) (compound_statement "{\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }" { (expression_statement "lVar5 = 0;" (assignment_expression "lVar5 = 0" identifier = number_literal) ;) (expression_statement "uVar3 = uVar6;" (assignment_expression "uVar3 = uVar6" identifier = identifier) ;) (do_statement "do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);" do (compound_statement "{\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      }" { (expression_statement "uVar3 = uVar3 * 0x100 + 0xff;" (assignment_expression "uVar3 = uVar3 * 0x100 + 0xff" identifier = (binary_expression "uVar3 * 0x100 + 0xff" (binary_expression "uVar3 * 0x100" identifier * number_literal) + number_literal)) ;) (expression_statement "lVar5 = lVar5 + 1;" (assignment_expression "lVar5 = lVar5 + 1" identifier = (binary_expression "lVar5 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar3 < param_2)" ( (binary_expression "uVar3 < param_2" identifier < identifier) )) ;) (expression_statement "FUN_0011911f(uVar2,local_48,lVar5);" (call_expression "FUN_0011911f(uVar2,local_48,lVar5)" identifier (argument_list "(uVar2,local_48,lVar5)" ( identifier , identifier , identifier ))) ;) (expression_statement "pbVar4 = local_48;" (assignment_expression "pbVar4 = local_48" identifier = identifier) ;) (do_statement "do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);" do (compound_statement "{\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      }" { (expression_statement "uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;" (assignment_expression "uVar7 = uVar7 * 0x100 + (ulong)*pbVar4" identifier = (binary_expression "uVar7 * 0x100 + (ulong)*pbVar4" (binary_expression "uVar7 * 0x100" identifier * number_literal) + (binary_expression "(ulong)*pbVar4" (parenthesized_expression "(ulong)" ( identifier )) * identifier))) ;) (expression_statement "uVar6 = uVar6 * 0x100 + 0xff;" (assignment_expression "uVar6 = uVar6 * 0x100 + 0xff" identifier = (binary_expression "uVar6 * 0x100 + 0xff" (binary_expression "uVar6 * 0x100" identifier * number_literal) + number_literal)) ;) (expression_statement "pbVar4 = pbVar4 + 1;" (assignment_expression "pbVar4 = pbVar4 + 1" identifier = (binary_expression "pbVar4 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar6 < param_2)" ( (binary_expression "uVar6 < param_2" identifier < identifier) )) ;) })) (if_statement "if (uVar6 == param_2) break;" if (parenthesized_expression "(uVar6 == param_2)" ( (binary_expression "uVar6 == param_2" identifier == identifier) )) (break_statement "break;" break ;)) (expression_statement "uVar3 = (uVar6 - param_2) % uVar1;" (assignment_expression "uVar3 = (uVar6 - param_2) % uVar1" identifier = (binary_expression "(uVar6 - param_2) % uVar1" (parenthesized_expression "(uVar6 - param_2)" ( (binary_expression "uVar6 - param_2" identifier - identifier) )) % identifier)) ;) (if_statement "if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    /* WARNING: Subroutine does not return */\n      __stack_chk_fail();\n    }" if (parenthesized_expression "(uVar7 <= uVar6 - uVar3)" ( (binary_expression "uVar7 <= uVar6 - uVar3" identifier <= (binary_expression "uVar6 - uVar3" identifier - identifier)) )) (compound_statement "{\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    /* WARNING: Subroutine does not return */\n      __stack_chk_fail();\n    }" { (expression_statement "param_1[1] = uVar7 / uVar1;" (assignment_expression "param_1[1] = uVar7 / uVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (binary_expression "uVar7 / uVar1" identifier / identifier)) ;) (expression_statement "param_1[2] = (uVar6 - param_2) / uVar1;" (assignment_expression "param_1[2] = (uVar6 - param_2) / uVar1" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "(uVar6 - param_2) / uVar1" (parenthesized_expression "(uVar6 - param_2)" ( (binary_expression "uVar6 - param_2" identifier - identifier) )) / identifier)) ;) (expression_statement "uVar7 = uVar7 % uVar1;" (assignment_expression "uVar7 = uVar7 % uVar1" identifier = (binary_expression "uVar7 % uVar1" identifier % identifier)) ;) (labeled_statement "LAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }" statement_identifier : (if_statement "if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }" if (parenthesized_expression "(local_40 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_40 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n        return uVar7;\n      }" { (return_statement "return uVar7;" return identifier ;) }))) comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "uVar6 = uVar3 - 1;" (assignment_expression "uVar6 = uVar3 - 1" identifier = (binary_expression "uVar3 - 1" identifier - number_literal)) ;) (expression_statement "uVar7 = uVar7 % uVar1;" (assignment_expression "uVar7 = uVar7 % uVar1" identifier = (binary_expression "uVar7 % uVar1" identifier % identifier)) ;) })) (expression_statement "param_1[2] = 0;" (assignment_expression "param_1[2] = 0" (subscript_expression "param_1[2]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_1[1] = 0;" (assignment_expression "param_1[1] = 0" (subscript_expression "param_1[1]" identifier [ number_literal ]) = number_literal) ;) (goto_statement "goto LAB_00118cd9;" goto statement_identifier ;) })))
(translation_unit "randint randint_genmax(randint_source *s,randint genmax)\n\n{\n  ulong uVar1;\n  long lVar2;\n  randread_source *s_00;\n  ulong uVar3;\n  byte *pbVar4;\n  size_t size;\n  ulong uVar5;\n  ulong uVar6;\n  long in_FS_OFFSET;\n  uchar buf [8];\n  \n  lVar2 = *(long *)(in_FS_OFFSET + 0x28);\n  s_00 = s->source;\n  uVar5 = s->randmax;\n  uVar1 = genmax + 1;\n  uVar6 = s->randnum;\n  while( true ) {\n    if (uVar5 < genmax) {\n      size = 0;\n      uVar3 = uVar5;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        size = size + 1;\n      } while (uVar3 < genmax);\n      randread(s_00,buf,size);\n      pbVar4 = buf;\n      do {\n        uVar6 = uVar6 * 0x100 + (ulong)*pbVar4;\n        uVar5 = uVar5 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar5 < genmax);\n    }\n    if (uVar5 == genmax) break;\n    uVar3 = (uVar5 - genmax) % uVar1;\n    if (uVar6 <= uVar5 - uVar3) {\n      s->randnum = uVar6 / uVar1;\n      s->randmax = (uVar5 - genmax) / uVar1;\n      uVar6 = uVar6 % uVar1;\nLAB_00118cd9:\n      if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar6;\n      }\n                    /* WARNING: Subroutine does not return */\n      __stack_chk_fail();\n    }\n    uVar5 = uVar3 - 1;\n    uVar6 = uVar6 % uVar1;\n  }\n  s->randmax = 0;\n  s->randnum = 0;\n  goto LAB_00118cd9;\n}\n\n" (function_definition "randint randint_genmax(randint_source *s,randint genmax)\n\n{\n  ulong uVar1;\n  long lVar2;\n  randread_source *s_00;\n  ulong uVar3;\n  byte *pbVar4;\n  size_t size;\n  ulong uVar5;\n  ulong uVar6;\n  long in_FS_OFFSET;\n  uchar buf [8];\n  \n  lVar2 = *(long *)(in_FS_OFFSET + 0x28);\n  s_00 = s->source;\n  uVar5 = s->randmax;\n  uVar1 = genmax + 1;\n  uVar6 = s->randnum;\n  while( true ) {\n    if (uVar5 < genmax) {\n      size = 0;\n      uVar3 = uVar5;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        size = size + 1;\n      } while (uVar3 < genmax);\n      randread(s_00,buf,size);\n      pbVar4 = buf;\n      do {\n        uVar6 = uVar6 * 0x100 + (ulong)*pbVar4;\n        uVar5 = uVar5 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar5 < genmax);\n    }\n    if (uVar5 == genmax) break;\n    uVar3 = (uVar5 - genmax) % uVar1;\n    if (uVar6 <= uVar5 - uVar3) {\n      s->randnum = uVar6 / uVar1;\n      s->randmax = (uVar5 - genmax) / uVar1;\n      uVar6 = uVar6 % uVar1;\nLAB_00118cd9:\n      if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar6;\n      }\n                    /* WARNING: Subroutine does not return */\n      __stack_chk_fail();\n    }\n    uVar5 = uVar3 - 1;\n    uVar6 = uVar6 % uVar1;\n  }\n  s->randmax = 0;\n  s->randnum = 0;\n  goto LAB_00118cd9;\n}" type_identifier (function_declarator "randint_genmax(randint_source *s,randint genmax)" identifier (parameter_list "(randint_source *s,randint genmax)" ( (parameter_declaration "randint_source *s" type_identifier (pointer_declarator "*s" * identifier)) , (parameter_declaration "randint genmax" type_identifier identifier) ))) (compound_statement "{\n  ulong uVar1;\n  long lVar2;\n  randread_source *s_00;\n  ulong uVar3;\n  byte *pbVar4;\n  size_t size;\n  ulong uVar5;\n  ulong uVar6;\n  long in_FS_OFFSET;\n  uchar buf [8];\n  \n  lVar2 = *(long *)(in_FS_OFFSET + 0x28);\n  s_00 = s->source;\n  uVar5 = s->randmax;\n  uVar1 = genmax + 1;\n  uVar6 = s->randnum;\n  while( true ) {\n    if (uVar5 < genmax) {\n      size = 0;\n      uVar3 = uVar5;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        size = size + 1;\n      } while (uVar3 < genmax);\n      randread(s_00,buf,size);\n      pbVar4 = buf;\n      do {\n        uVar6 = uVar6 * 0x100 + (ulong)*pbVar4;\n        uVar5 = uVar5 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar5 < genmax);\n    }\n    if (uVar5 == genmax) break;\n    uVar3 = (uVar5 - genmax) % uVar1;\n    if (uVar6 <= uVar5 - uVar3) {\n      s->randnum = uVar6 / uVar1;\n      s->randmax = (uVar5 - genmax) / uVar1;\n      uVar6 = uVar6 % uVar1;\nLAB_00118cd9:\n      if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar6;\n      }\n                    /* WARNING: Subroutine does not return */\n      __stack_chk_fail();\n    }\n    uVar5 = uVar3 - 1;\n    uVar6 = uVar6 % uVar1;\n  }\n  s->randmax = 0;\n  s->randnum = 0;\n  goto LAB_00118cd9;\n}" { (declaration "ulong uVar1;" type_identifier identifier ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "randread_source *s_00;" type_identifier (pointer_declarator "*s_00" * identifier) ;) (declaration "ulong uVar3;" type_identifier identifier ;) (declaration "byte *pbVar4;" type_identifier (pointer_declarator "*pbVar4" * identifier) ;) (declaration "size_t size;" primitive_type identifier ;) (declaration "ulong uVar5;" type_identifier identifier ;) (declaration "ulong uVar6;" type_identifier identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "uchar buf [8];" type_identifier (array_declarator "buf [8]" identifier [ number_literal ]) ;) (expression_statement "lVar2 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "lVar2 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (expression_statement "s_00 = s->source;" (assignment_expression "s_00 = s->source" identifier = (field_expression "s->source" identifier -> field_identifier)) ;) (expression_statement "uVar5 = s->randmax;" (assignment_expression "uVar5 = s->randmax" identifier = (field_expression "s->randmax" identifier -> field_identifier)) ;) (expression_statement "uVar1 = genmax + 1;" (assignment_expression "uVar1 = genmax + 1" identifier = (binary_expression "genmax + 1" identifier + number_literal)) ;) (expression_statement "uVar6 = s->randnum;" (assignment_expression "uVar6 = s->randnum" identifier = (field_expression "s->randnum" identifier -> field_identifier)) ;) (while_statement "while( true ) {\n    if (uVar5 < genmax) {\n      size = 0;\n      uVar3 = uVar5;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        size = size + 1;\n      } while (uVar3 < genmax);\n      randread(s_00,buf,size);\n      pbVar4 = buf;\n      do {\n        uVar6 = uVar6 * 0x100 + (ulong)*pbVar4;\n        uVar5 = uVar5 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar5 < genmax);\n    }\n    if (uVar5 == genmax) break;\n    uVar3 = (uVar5 - genmax) % uVar1;\n    if (uVar6 <= uVar5 - uVar3) {\n      s->randnum = uVar6 / uVar1;\n      s->randmax = (uVar5 - genmax) / uVar1;\n      uVar6 = uVar6 % uVar1;\nLAB_00118cd9:\n      if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar6;\n      }\n                    /* WARNING: Subroutine does not return */\n      __stack_chk_fail();\n    }\n    uVar5 = uVar3 - 1;\n    uVar6 = uVar6 % uVar1;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    if (uVar5 < genmax) {\n      size = 0;\n      uVar3 = uVar5;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        size = size + 1;\n      } while (uVar3 < genmax);\n      randread(s_00,buf,size);\n      pbVar4 = buf;\n      do {\n        uVar6 = uVar6 * 0x100 + (ulong)*pbVar4;\n        uVar5 = uVar5 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar5 < genmax);\n    }\n    if (uVar5 == genmax) break;\n    uVar3 = (uVar5 - genmax) % uVar1;\n    if (uVar6 <= uVar5 - uVar3) {\n      s->randnum = uVar6 / uVar1;\n      s->randmax = (uVar5 - genmax) / uVar1;\n      uVar6 = uVar6 % uVar1;\nLAB_00118cd9:\n      if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar6;\n      }\n                    /* WARNING: Subroutine does not return */\n      __stack_chk_fail();\n    }\n    uVar5 = uVar3 - 1;\n    uVar6 = uVar6 % uVar1;\n  }" { (if_statement "if (uVar5 < genmax) {\n      size = 0;\n      uVar3 = uVar5;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        size = size + 1;\n      } while (uVar3 < genmax);\n      randread(s_00,buf,size);\n      pbVar4 = buf;\n      do {\n        uVar6 = uVar6 * 0x100 + (ulong)*pbVar4;\n        uVar5 = uVar5 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar5 < genmax);\n    }" if (parenthesized_expression "(uVar5 < genmax)" ( (binary_expression "uVar5 < genmax" identifier < identifier) )) (compound_statement "{\n      size = 0;\n      uVar3 = uVar5;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        size = size + 1;\n      } while (uVar3 < genmax);\n      randread(s_00,buf,size);\n      pbVar4 = buf;\n      do {\n        uVar6 = uVar6 * 0x100 + (ulong)*pbVar4;\n        uVar5 = uVar5 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar5 < genmax);\n    }" { (expression_statement "size = 0;" (assignment_expression "size = 0" identifier = number_literal) ;) (expression_statement "uVar3 = uVar5;" (assignment_expression "uVar3 = uVar5" identifier = identifier) ;) (do_statement "do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        size = size + 1;\n      } while (uVar3 < genmax);" do (compound_statement "{\n        uVar3 = uVar3 * 0x100 + 0xff;\n        size = size + 1;\n      }" { (expression_statement "uVar3 = uVar3 * 0x100 + 0xff;" (assignment_expression "uVar3 = uVar3 * 0x100 + 0xff" identifier = (binary_expression "uVar3 * 0x100 + 0xff" (binary_expression "uVar3 * 0x100" identifier * number_literal) + number_literal)) ;) (expression_statement "size = size + 1;" (assignment_expression "size = size + 1" identifier = (binary_expression "size + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar3 < genmax)" ( (binary_expression "uVar3 < genmax" identifier < identifier) )) ;) (expression_statement "randread(s_00,buf,size);" (call_expression "randread(s_00,buf,size)" identifier (argument_list "(s_00,buf,size)" ( identifier , identifier , identifier ))) ;) (expression_statement "pbVar4 = buf;" (assignment_expression "pbVar4 = buf" identifier = identifier) ;) (do_statement "do {\n        uVar6 = uVar6 * 0x100 + (ulong)*pbVar4;\n        uVar5 = uVar5 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar5 < genmax);" do (compound_statement "{\n        uVar6 = uVar6 * 0x100 + (ulong)*pbVar4;\n        uVar5 = uVar5 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      }" { (expression_statement "uVar6 = uVar6 * 0x100 + (ulong)*pbVar4;" (assignment_expression "uVar6 = uVar6 * 0x100 + (ulong)*pbVar4" identifier = (binary_expression "uVar6 * 0x100 + (ulong)*pbVar4" (binary_expression "uVar6 * 0x100" identifier * number_literal) + (binary_expression "(ulong)*pbVar4" (parenthesized_expression "(ulong)" ( identifier )) * identifier))) ;) (expression_statement "uVar5 = uVar5 * 0x100 + 0xff;" (assignment_expression "uVar5 = uVar5 * 0x100 + 0xff" identifier = (binary_expression "uVar5 * 0x100 + 0xff" (binary_expression "uVar5 * 0x100" identifier * number_literal) + number_literal)) ;) (expression_statement "pbVar4 = pbVar4 + 1;" (assignment_expression "pbVar4 = pbVar4 + 1" identifier = (binary_expression "pbVar4 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar5 < genmax)" ( (binary_expression "uVar5 < genmax" identifier < identifier) )) ;) })) (if_statement "if (uVar5 == genmax) break;" if (parenthesized_expression "(uVar5 == genmax)" ( (binary_expression "uVar5 == genmax" identifier == identifier) )) (break_statement "break;" break ;)) (expression_statement "uVar3 = (uVar5 - genmax) % uVar1;" (assignment_expression "uVar3 = (uVar5 - genmax) % uVar1" identifier = (binary_expression "(uVar5 - genmax) % uVar1" (parenthesized_expression "(uVar5 - genmax)" ( (binary_expression "uVar5 - genmax" identifier - identifier) )) % identifier)) ;) (if_statement "if (uVar6 <= uVar5 - uVar3) {\n      s->randnum = uVar6 / uVar1;\n      s->randmax = (uVar5 - genmax) / uVar1;\n      uVar6 = uVar6 % uVar1;\nLAB_00118cd9:\n      if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar6;\n      }\n                    /* WARNING: Subroutine does not return */\n      __stack_chk_fail();\n    }" if (parenthesized_expression "(uVar6 <= uVar5 - uVar3)" ( (binary_expression "uVar6 <= uVar5 - uVar3" identifier <= (binary_expression "uVar5 - uVar3" identifier - identifier)) )) (compound_statement "{\n      s->randnum = uVar6 / uVar1;\n      s->randmax = (uVar5 - genmax) / uVar1;\n      uVar6 = uVar6 % uVar1;\nLAB_00118cd9:\n      if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar6;\n      }\n                    /* WARNING: Subroutine does not return */\n      __stack_chk_fail();\n    }" { (expression_statement "s->randnum = uVar6 / uVar1;" (assignment_expression "s->randnum = uVar6 / uVar1" (field_expression "s->randnum" identifier -> field_identifier) = (binary_expression "uVar6 / uVar1" identifier / identifier)) ;) (expression_statement "s->randmax = (uVar5 - genmax) / uVar1;" (assignment_expression "s->randmax = (uVar5 - genmax) / uVar1" (field_expression "s->randmax" identifier -> field_identifier) = (binary_expression "(uVar5 - genmax) / uVar1" (parenthesized_expression "(uVar5 - genmax)" ( (binary_expression "uVar5 - genmax" identifier - identifier) )) / identifier)) ;) (expression_statement "uVar6 = uVar6 % uVar1;" (assignment_expression "uVar6 = uVar6 % uVar1" identifier = (binary_expression "uVar6 % uVar1" identifier % identifier)) ;) (labeled_statement "LAB_00118cd9:\n      if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar6;\n      }" statement_identifier : (if_statement "if (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar6;\n      }" if (parenthesized_expression "(lVar2 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "lVar2 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n        return uVar6;\n      }" { (return_statement "return uVar6;" return identifier ;) }))) comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "uVar5 = uVar3 - 1;" (assignment_expression "uVar5 = uVar3 - 1" identifier = (binary_expression "uVar3 - 1" identifier - number_literal)) ;) (expression_statement "uVar6 = uVar6 % uVar1;" (assignment_expression "uVar6 = uVar6 % uVar1" identifier = (binary_expression "uVar6 % uVar1" identifier % identifier)) ;) })) (expression_statement "s->randmax = 0;" (assignment_expression "s->randmax = 0" (field_expression "s->randmax" identifier -> field_identifier) = number_literal) ;) (expression_statement "s->randnum = 0;" (assignment_expression "s->randnum = 0" (field_expression "s->randnum" identifier -> field_identifier) = number_literal) ;) (goto_statement "goto LAB_00118cd9;" goto statement_identifier ;) })))
(translation_unit "ulong FUN_00118c01(undefined8 *param_1,ulong param_2)\n\n{\n  ulong uVar1;\n  undefined8 uVar2;\n  ulong uVar3;\n  byte *pbVar4;\n  long lVar5;\n  ulong uVar6;\n  ulong uVar7;\n  long in_FS_OFFSET;\n  byte local_48 [8];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  uVar2 = *param_1;\n  uVar6 = param_1[2];\n  uVar1 = param_2 + 1;\n  uVar7 = param_1[1];\n  while( true ) {\n    if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }\n    if (uVar6 == param_2) break;\n    uVar3 = (uVar6 - param_2) % uVar1;\n    if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    \n      __stack_chk_fail();\n    }\n    uVar6 = uVar3 - 1;\n    uVar7 = uVar7 % uVar1;\n  }\n  param_1[2] = 0;\n  param_1[1] = 0;\n  goto LAB_00118cd9;\n}\n\n" (function_definition "ulong FUN_00118c01(undefined8 *param_1,ulong param_2)\n\n{\n  ulong uVar1;\n  undefined8 uVar2;\n  ulong uVar3;\n  byte *pbVar4;\n  long lVar5;\n  ulong uVar6;\n  ulong uVar7;\n  long in_FS_OFFSET;\n  byte local_48 [8];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  uVar2 = *param_1;\n  uVar6 = param_1[2];\n  uVar1 = param_2 + 1;\n  uVar7 = param_1[1];\n  while( true ) {\n    if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }\n    if (uVar6 == param_2) break;\n    uVar3 = (uVar6 - param_2) % uVar1;\n    if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    \n      __stack_chk_fail();\n    }\n    uVar6 = uVar3 - 1;\n    uVar7 = uVar7 % uVar1;\n  }\n  param_1[2] = 0;\n  param_1[1] = 0;\n  goto LAB_00118cd9;\n}" type_identifier (function_declarator "FUN_00118c01(undefined8 *param_1,ulong param_2)" identifier (parameter_list "(undefined8 *param_1,ulong param_2)" ( (parameter_declaration "undefined8 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "ulong param_2" type_identifier identifier) ))) (compound_statement "{\n  ulong uVar1;\n  undefined8 uVar2;\n  ulong uVar3;\n  byte *pbVar4;\n  long lVar5;\n  ulong uVar6;\n  ulong uVar7;\n  long in_FS_OFFSET;\n  byte local_48 [8];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  uVar2 = *param_1;\n  uVar6 = param_1[2];\n  uVar1 = param_2 + 1;\n  uVar7 = param_1[1];\n  while( true ) {\n    if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }\n    if (uVar6 == param_2) break;\n    uVar3 = (uVar6 - param_2) % uVar1;\n    if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    \n      __stack_chk_fail();\n    }\n    uVar6 = uVar3 - 1;\n    uVar7 = uVar7 % uVar1;\n  }\n  param_1[2] = 0;\n  param_1[1] = 0;\n  goto LAB_00118cd9;\n}" { (declaration "ulong uVar1;" type_identifier identifier ;) (declaration "undefined8 uVar2;" type_identifier identifier ;) (declaration "ulong uVar3;" type_identifier identifier ;) (declaration "byte *pbVar4;" type_identifier (pointer_declarator "*pbVar4" * identifier) ;) (declaration "long lVar5;" (sized_type_specifier "long" long) identifier ;) (declaration "ulong uVar6;" type_identifier identifier ;) (declaration "ulong uVar7;" type_identifier identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "byte local_48 [8];" type_identifier (array_declarator "local_48 [8]" identifier [ number_literal ]) ;) (declaration "long local_40;" (sized_type_specifier "long" long) identifier ;) (expression_statement "local_40 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_40 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (expression_statement "uVar2 = *param_1;" (assignment_expression "uVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar6 = param_1[2];" (assignment_expression "uVar6 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) (expression_statement "uVar1 = param_2 + 1;" (assignment_expression "uVar1 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) (expression_statement "uVar7 = param_1[1];" (assignment_expression "uVar7 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (while_statement "while( true ) {\n    if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }\n    if (uVar6 == param_2) break;\n    uVar3 = (uVar6 - param_2) % uVar1;\n    if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    \n      __stack_chk_fail();\n    }\n    uVar6 = uVar3 - 1;\n    uVar7 = uVar7 % uVar1;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }\n    if (uVar6 == param_2) break;\n    uVar3 = (uVar6 - param_2) % uVar1;\n    if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    \n      __stack_chk_fail();\n    }\n    uVar6 = uVar3 - 1;\n    uVar7 = uVar7 % uVar1;\n  }" { (if_statement "if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }" if (parenthesized_expression "(uVar6 < param_2)" ( (binary_expression "uVar6 < param_2" identifier < identifier) )) (compound_statement "{\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }" { (expression_statement "lVar5 = 0;" (assignment_expression "lVar5 = 0" identifier = number_literal) ;) (expression_statement "uVar3 = uVar6;" (assignment_expression "uVar3 = uVar6" identifier = identifier) ;) (do_statement "do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);" do (compound_statement "{\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      }" { (expression_statement "uVar3 = uVar3 * 0x100 + 0xff;" (assignment_expression "uVar3 = uVar3 * 0x100 + 0xff" identifier = (binary_expression "uVar3 * 0x100 + 0xff" (binary_expression "uVar3 * 0x100" identifier * number_literal) + number_literal)) ;) (expression_statement "lVar5 = lVar5 + 1;" (assignment_expression "lVar5 = lVar5 + 1" identifier = (binary_expression "lVar5 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar3 < param_2)" ( (binary_expression "uVar3 < param_2" identifier < identifier) )) ;) (expression_statement "FUN_0011911f(uVar2,local_48,lVar5);" (call_expression "FUN_0011911f(uVar2,local_48,lVar5)" identifier (argument_list "(uVar2,local_48,lVar5)" ( identifier , identifier , identifier ))) ;) (expression_statement "pbVar4 = local_48;" (assignment_expression "pbVar4 = local_48" identifier = identifier) ;) (do_statement "do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);" do (compound_statement "{\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      }" { (expression_statement "uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;" (assignment_expression "uVar7 = uVar7 * 0x100 + (ulong)*pbVar4" identifier = (binary_expression "uVar7 * 0x100 + (ulong)*pbVar4" (binary_expression "uVar7 * 0x100" identifier * number_literal) + (binary_expression "(ulong)*pbVar4" (parenthesized_expression "(ulong)" ( identifier )) * identifier))) ;) (expression_statement "uVar6 = uVar6 * 0x100 + 0xff;" (assignment_expression "uVar6 = uVar6 * 0x100 + 0xff" identifier = (binary_expression "uVar6 * 0x100 + 0xff" (binary_expression "uVar6 * 0x100" identifier * number_literal) + number_literal)) ;) (expression_statement "pbVar4 = pbVar4 + 1;" (assignment_expression "pbVar4 = pbVar4 + 1" identifier = (binary_expression "pbVar4 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar6 < param_2)" ( (binary_expression "uVar6 < param_2" identifier < identifier) )) ;) })) (if_statement "if (uVar6 == param_2) break;" if (parenthesized_expression "(uVar6 == param_2)" ( (binary_expression "uVar6 == param_2" identifier == identifier) )) (break_statement "break;" break ;)) (expression_statement "uVar3 = (uVar6 - param_2) % uVar1;" (assignment_expression "uVar3 = (uVar6 - param_2) % uVar1" identifier = (binary_expression "(uVar6 - param_2) % uVar1" (parenthesized_expression "(uVar6 - param_2)" ( (binary_expression "uVar6 - param_2" identifier - identifier) )) % identifier)) ;) (if_statement "if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    \n      __stack_chk_fail();\n    }" if (parenthesized_expression "(uVar7 <= uVar6 - uVar3)" ( (binary_expression "uVar7 <= uVar6 - uVar3" identifier <= (binary_expression "uVar6 - uVar3" identifier - identifier)) )) (compound_statement "{\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    \n      __stack_chk_fail();\n    }" { (expression_statement "param_1[1] = uVar7 / uVar1;" (assignment_expression "param_1[1] = uVar7 / uVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (binary_expression "uVar7 / uVar1" identifier / identifier)) ;) (expression_statement "param_1[2] = (uVar6 - param_2) / uVar1;" (assignment_expression "param_1[2] = (uVar6 - param_2) / uVar1" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "(uVar6 - param_2) / uVar1" (parenthesized_expression "(uVar6 - param_2)" ( (binary_expression "uVar6 - param_2" identifier - identifier) )) / identifier)) ;) (expression_statement "uVar7 = uVar7 % uVar1;" (assignment_expression "uVar7 = uVar7 % uVar1" identifier = (binary_expression "uVar7 % uVar1" identifier % identifier)) ;) (labeled_statement "LAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }" statement_identifier : (if_statement "if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }" if (parenthesized_expression "(local_40 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_40 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n        return uVar7;\n      }" { (return_statement "return uVar7;" return identifier ;) }))) (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "uVar6 = uVar3 - 1;" (assignment_expression "uVar6 = uVar3 - 1" identifier = (binary_expression "uVar3 - 1" identifier - number_literal)) ;) (expression_statement "uVar7 = uVar7 % uVar1;" (assignment_expression "uVar7 = uVar7 % uVar1" identifier = (binary_expression "uVar7 % uVar1" identifier % identifier)) ;) })) (expression_statement "param_1[2] = 0;" (assignment_expression "param_1[2] = 0" (subscript_expression "param_1[2]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_1[1] = 0;" (assignment_expression "param_1[1] = 0" (subscript_expression "param_1[1]" identifier [ number_literal ]) = number_literal) ;) (goto_statement "goto LAB_00118cd9;" goto statement_identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT * LIT) + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT < IDENT) )) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT * LIT) + (binary_expression (parenthesized_expression ( IDENT )) * IDENT))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT * LIT) + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT < IDENT) )) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression IDENT - IDENT) )) % IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= (binary_expression IDENT - IDENT)) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT / IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (parenthesized_expression ( (binary_expression IDENT - IDENT) )) / IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT % IDENT)) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) }))) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT % IDENT)) ;) })) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (goto_statement goto statement_identifier ;) })))
(function_definition "ulong FUN_00118c01(undefined8 *param_1,ulong param_2)\n\n{\n  ulong uVar1;\n  undefined8 uVar2;\n  ulong uVar3;\n  byte *pbVar4;\n  long lVar5;\n  ulong uVar6;\n  ulong uVar7;\n  long in_FS_OFFSET;\n  byte local_48 [8];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  uVar2 = *param_1;\n  uVar6 = param_1[2];\n  uVar1 = param_2 + 1;\n  uVar7 = param_1[1];\n  while( true ) {\n    if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }\n    if (uVar6 == param_2) break;\n    uVar3 = (uVar6 - param_2) % uVar1;\n    if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    \n      __stack_chk_fail();\n    }\n    uVar6 = uVar3 - 1;\n    uVar7 = uVar7 % uVar1;\n  }\n  param_1[2] = 0;\n  param_1[1] = 0;\n  goto LAB_00118cd9;\n}" (type_identifier "ulong") (function_declarator "FUN_00118c01(undefined8 *param_1,ulong param_2)" (identifier "FUN_00118c01") (parameter_list "(undefined8 *param_1,ulong param_2)" (( "(") (parameter_declaration "undefined8 *param_1" (type_identifier "undefined8") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "ulong param_2" (type_identifier "ulong") (identifier "param_2")) () ")"))) (compound_statement "{\n  ulong uVar1;\n  undefined8 uVar2;\n  ulong uVar3;\n  byte *pbVar4;\n  long lVar5;\n  ulong uVar6;\n  ulong uVar7;\n  long in_FS_OFFSET;\n  byte local_48 [8];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  uVar2 = *param_1;\n  uVar6 = param_1[2];\n  uVar1 = param_2 + 1;\n  uVar7 = param_1[1];\n  while( true ) {\n    if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }\n    if (uVar6 == param_2) break;\n    uVar3 = (uVar6 - param_2) % uVar1;\n    if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    \n      __stack_chk_fail();\n    }\n    uVar6 = uVar3 - 1;\n    uVar7 = uVar7 % uVar1;\n  }\n  param_1[2] = 0;\n  param_1[1] = 0;\n  goto LAB_00118cd9;\n}" ({ "{") (declaration "ulong uVar1;" (type_identifier "ulong") (identifier "uVar1") (; ";")) (declaration "undefined8 uVar2;" (type_identifier "undefined8") (identifier "uVar2") (; ";")) (declaration "ulong uVar3;" (type_identifier "ulong") (identifier "uVar3") (; ";")) (declaration "byte *pbVar4;" (type_identifier "byte") (pointer_declarator "*pbVar4" (* "*") (identifier "pbVar4")) (; ";")) (declaration "long lVar5;" (sized_type_specifier "long" (long "long")) (identifier "lVar5") (; ";")) (declaration "ulong uVar6;" (type_identifier "ulong") (identifier "uVar6") (; ";")) (declaration "ulong uVar7;" (type_identifier "ulong") (identifier "uVar7") (; ";")) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" (long "long")) (identifier "in_FS_OFFSET") (; ";")) (declaration "byte local_48 [8];" (type_identifier "byte") (array_declarator "local_48 [8]" (identifier "local_48") ([ "[") (number_literal "8") (] "]")) (; ";")) (declaration "long local_40;" (sized_type_specifier "long" (long "long")) (identifier "local_40") (; ";")) (expression_statement "local_40 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_40 = *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_40") (= "=") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) (; ";")) (expression_statement "uVar2 = *param_1;" (assignment_expression "uVar2 = *param_1" (identifier "uVar2") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "uVar6 = param_1[2];" (assignment_expression "uVar6 = param_1[2]" (identifier "uVar6") (= "=") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (expression_statement "uVar1 = param_2 + 1;" (assignment_expression "uVar1 = param_2 + 1" (identifier "uVar1") (= "=") (binary_expression "param_2 + 1" (identifier "param_2") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "uVar7 = param_1[1];" (assignment_expression "uVar7 = param_1[1]" (identifier "uVar7") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (while_statement "while( true ) {\n    if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }\n    if (uVar6 == param_2) break;\n    uVar3 = (uVar6 - param_2) % uVar1;\n    if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    \n      __stack_chk_fail();\n    }\n    uVar6 = uVar3 - 1;\n    uVar7 = uVar7 % uVar1;\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }\n    if (uVar6 == param_2) break;\n    uVar3 = (uVar6 - param_2) % uVar1;\n    if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    \n      __stack_chk_fail();\n    }\n    uVar6 = uVar3 - 1;\n    uVar7 = uVar7 % uVar1;\n  }" ({ "{") (if_statement "if (uVar6 < param_2) {\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }" (if "if") (parenthesized_expression "(uVar6 < param_2)" (( "(") (binary_expression "uVar6 < param_2" (identifier "uVar6") (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n      lVar5 = 0;\n      uVar3 = uVar6;\n      do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);\n      FUN_0011911f(uVar2,local_48,lVar5);\n      pbVar4 = local_48;\n      do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);\n    }" ({ "{") (expression_statement "lVar5 = 0;" (assignment_expression "lVar5 = 0" (identifier "lVar5") (= "=") (number_literal "0")) (; ";")) (expression_statement "uVar3 = uVar6;" (assignment_expression "uVar3 = uVar6" (identifier "uVar3") (= "=") (identifier "uVar6")) (; ";")) (do_statement "do {\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      } while (uVar3 < param_2);" (do "do") (compound_statement "{\n        uVar3 = uVar3 * 0x100 + 0xff;\n        lVar5 = lVar5 + 1;\n      }" ({ "{") (expression_statement "uVar3 = uVar3 * 0x100 + 0xff;" (assignment_expression "uVar3 = uVar3 * 0x100 + 0xff" (identifier "uVar3") (= "=") (binary_expression "uVar3 * 0x100 + 0xff" (binary_expression "uVar3 * 0x100" (identifier "uVar3") (* "*") (number_literal "0x100")) (+ "+") (number_literal "0xff"))) (; ";")) (expression_statement "lVar5 = lVar5 + 1;" (assignment_expression "lVar5 = lVar5 + 1" (identifier "lVar5") (= "=") (binary_expression "lVar5 + 1" (identifier "lVar5") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(uVar3 < param_2)" (( "(") (binary_expression "uVar3 < param_2" (identifier "uVar3") (< "<") (identifier "param_2")) () ")")) (; ";")) (expression_statement "FUN_0011911f(uVar2,local_48,lVar5);" (call_expression "FUN_0011911f(uVar2,local_48,lVar5)" (identifier "FUN_0011911f") (argument_list "(uVar2,local_48,lVar5)" (( "(") (identifier "uVar2") (, ",") (identifier "local_48") (, ",") (identifier "lVar5") () ")"))) (; ";")) (expression_statement "pbVar4 = local_48;" (assignment_expression "pbVar4 = local_48" (identifier "pbVar4") (= "=") (identifier "local_48")) (; ";")) (do_statement "do {\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      } while (uVar6 < param_2);" (do "do") (compound_statement "{\n        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;\n        uVar6 = uVar6 * 0x100 + 0xff;\n        pbVar4 = pbVar4 + 1;\n      }" ({ "{") (expression_statement "uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;" (assignment_expression "uVar7 = uVar7 * 0x100 + (ulong)*pbVar4" (identifier "uVar7") (= "=") (binary_expression "uVar7 * 0x100 + (ulong)*pbVar4" (binary_expression "uVar7 * 0x100" (identifier "uVar7") (* "*") (number_literal "0x100")) (+ "+") (binary_expression "(ulong)*pbVar4" (parenthesized_expression "(ulong)" (( "(") (identifier "ulong") () ")")) (* "*") (identifier "pbVar4")))) (; ";")) (expression_statement "uVar6 = uVar6 * 0x100 + 0xff;" (assignment_expression "uVar6 = uVar6 * 0x100 + 0xff" (identifier "uVar6") (= "=") (binary_expression "uVar6 * 0x100 + 0xff" (binary_expression "uVar6 * 0x100" (identifier "uVar6") (* "*") (number_literal "0x100")) (+ "+") (number_literal "0xff"))) (; ";")) (expression_statement "pbVar4 = pbVar4 + 1;" (assignment_expression "pbVar4 = pbVar4 + 1" (identifier "pbVar4") (= "=") (binary_expression "pbVar4 + 1" (identifier "pbVar4") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(uVar6 < param_2)" (( "(") (binary_expression "uVar6 < param_2" (identifier "uVar6") (< "<") (identifier "param_2")) () ")")) (; ";")) (} "}"))) (if_statement "if (uVar6 == param_2) break;" (if "if") (parenthesized_expression "(uVar6 == param_2)" (( "(") (binary_expression "uVar6 == param_2" (identifier "uVar6") (== "==") (identifier "param_2")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "uVar3 = (uVar6 - param_2) % uVar1;" (assignment_expression "uVar3 = (uVar6 - param_2) % uVar1" (identifier "uVar3") (= "=") (binary_expression "(uVar6 - param_2) % uVar1" (parenthesized_expression "(uVar6 - param_2)" (( "(") (binary_expression "uVar6 - param_2" (identifier "uVar6") (- "-") (identifier "param_2")) () ")")) (% "%") (identifier "uVar1"))) (; ";")) (if_statement "if (uVar7 <= uVar6 - uVar3) {\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    \n      __stack_chk_fail();\n    }" (if "if") (parenthesized_expression "(uVar7 <= uVar6 - uVar3)" (( "(") (binary_expression "uVar7 <= uVar6 - uVar3" (identifier "uVar7") (<= "<=") (binary_expression "uVar6 - uVar3" (identifier "uVar6") (- "-") (identifier "uVar3"))) () ")")) (compound_statement "{\n      param_1[1] = uVar7 / uVar1;\n      param_1[2] = (uVar6 - param_2) / uVar1;\n      uVar7 = uVar7 % uVar1;\nLAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }\n                    \n      __stack_chk_fail();\n    }" ({ "{") (expression_statement "param_1[1] = uVar7 / uVar1;" (assignment_expression "param_1[1] = uVar7 / uVar1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (binary_expression "uVar7 / uVar1" (identifier "uVar7") (/ "/") (identifier "uVar1"))) (; ";")) (expression_statement "param_1[2] = (uVar6 - param_2) / uVar1;" (assignment_expression "param_1[2] = (uVar6 - param_2) / uVar1" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (binary_expression "(uVar6 - param_2) / uVar1" (parenthesized_expression "(uVar6 - param_2)" (( "(") (binary_expression "uVar6 - param_2" (identifier "uVar6") (- "-") (identifier "param_2")) () ")")) (/ "/") (identifier "uVar1"))) (; ";")) (expression_statement "uVar7 = uVar7 % uVar1;" (assignment_expression "uVar7 = uVar7 % uVar1" (identifier "uVar7") (= "=") (binary_expression "uVar7 % uVar1" (identifier "uVar7") (% "%") (identifier "uVar1"))) (; ";")) (labeled_statement "LAB_00118cd9:\n      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }" (statement_identifier "LAB_00118cd9") (: ":") (if_statement "if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n        return uVar7;\n      }" (if "if") (parenthesized_expression "(local_40 == *(long *)(in_FS_OFFSET + 0x28))" (( "(") (binary_expression "local_40 == *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_40") (== "==") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) () ")")) (compound_statement "{\n        return uVar7;\n      }" ({ "{") (return_statement "return uVar7;" (return "return") (identifier "uVar7") (; ";")) (} "}")))) (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" (identifier "__stack_chk_fail") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (expression_statement "uVar6 = uVar3 - 1;" (assignment_expression "uVar6 = uVar3 - 1" (identifier "uVar6") (= "=") (binary_expression "uVar3 - 1" (identifier "uVar3") (- "-") (number_literal "1"))) (; ";")) (expression_statement "uVar7 = uVar7 % uVar1;" (assignment_expression "uVar7 = uVar7 % uVar1" (identifier "uVar7") (= "=") (binary_expression "uVar7 % uVar1" (identifier "uVar7") (% "%") (identifier "uVar1"))) (; ";")) (} "}"))) (expression_statement "param_1[2] = 0;" (assignment_expression "param_1[2] = 0" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "param_1[1] = 0;" (assignment_expression "param_1[1] = 0" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (number_literal "0")) (; ";")) (goto_statement "goto LAB_00118cd9;" (goto "goto") (statement_identifier "LAB_00118cd9") (; ";")) (} "}")))

type_1 function_1(type_2 *s,type_1 var_2)

{
  type_3 var_9;
  long var_10;
  type_4 *s_00;
  type_3 var_4;
  type_5 *var_8;
  size_t var_5;
  type_3 var_3;
  type_3 var_7;
  long var_1;
  type_6 buf [8];
  
  var_10 = *(long *)(var_1 + 0x28);
  s_00 = s->source;
  var_3 = s->randmax;
  var_9 = var_2 + 1;
  var_7 = s->randnum;
  while( true ) {
    if (var_3 < var_2) {
      var_5 = 0;
      var_4 = var_3;
      do {
        var_4 = var_4 * 0x100 + 0xff;
        var_5 = var_5 + 1;
      } while (var_4 < var_2);
      var_6(s_00,buf,var_5);
      var_8 = buf;
      do {
        var_7 = var_7 * 0x100 + (type_3)*var_8;
        var_3 = var_3 * 0x100 + 0xff;
        var_8 = var_8 + 1;
      } while (var_3 < var_2);
    }
    if (var_3 == var_2) break;
    var_4 = (var_3 - var_2) % var_9;
    if (var_7 <= var_3 - var_4) {
      s->randnum = var_7 / var_9;
      s->randmax = (var_3 - var_2) / var_9;
      var_7 = var_7 % var_9;
LAB_00118cd9:
      if (var_10 == *(long *)(var_1 + 0x28)) {
        return var_7;
      }
                    /* WARNING: Subroutine does not return */
      var_11();
    }
    var_3 = var_4 - 1;
    var_7 = var_7 % var_9;
  }
  s->randmax = 0;
  s->randnum = 0;
  goto LAB_00118cd9;
}


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

ulong MASKED(undefined8 *param_1,ulong param_2)

{
  ulong uVar1;
  undefined8 uVar2;
  ulong uVar3;
  byte *pbVar4;
  long lVar5;
  ulong uVar6;
  ulong uVar7;
  long in_FS_OFFSET;
  byte local_48 [8];
  long local_40;
  
  local_40 = *(long *)(in_FS_OFFSET + 0x28);
  uVar2 = *param_1;
  uVar6 = param_1[2];
  uVar1 = param_2 + 1;
  uVar7 = param_1[1];
  while( true ) {
    if (uVar6 < param_2) {
      lVar5 = 0;
      uVar3 = uVar6;
      do {
        uVar3 = uVar3 * 0x100 + 0xff;
        lVar5 = lVar5 + 1;
      } while (uVar3 < param_2);
      FUN_0011911f(uVar2,local_48,lVar5);
      pbVar4 = local_48;
      do {
        uVar7 = uVar7 * 0x100 + (ulong)*pbVar4;
        uVar6 = uVar6 * 0x100 + 0xff;
        pbVar4 = pbVar4 + 1;
      } while (uVar6 < param_2);
    }
    if (uVar6 == param_2) break;
    uVar3 = (uVar6 - param_2) % uVar1;
    if (uVar7 <= uVar6 - uVar3) {
      param_1[1] = uVar7 / uVar1;
      param_1[2] = (uVar6 - param_2) / uVar1;
      uVar7 = uVar7 % uVar1;
LAB_00118cd9:
      if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {
        return uVar7;
      }
                    /* WARNING: Subroutine does not return */
      __stack_chk_fail();
    }
    uVar6 = uVar3 - 1;
    uVar7 = uVar7 % uVar1;
  }
  param_1[2] = 0;
  param_1[1] = 0;
  goto LAB_00118cd9;
}

