
ulong rng_get_bytes(uchar *out,ulong outlen,_func_void *callback)

{
  int iVar1;
  FILE *__stream;
  size_t sVar2;
  clock_t cVar3;
  clock_t cVar4;
  byte *pbVar5;
  byte *pbVar6;
  byte bVar7;
  byte bVar8;
  byte bVar9;
  int local_4c;
  
  if (out == (uchar *)0x0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);
  }
  __stream = fopen("/dev/urandom","rb");
  if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))
  {
    iVar1 = setvbuf(__stream,(char *)0x0,2,0);
    if (iVar1 == 0) {
      sVar2 = fread(out,1,outlen,__stream);
      fclose(__stream);
      if (sVar2 != 0) {
        return sVar2;
      }
    }
    else {
      fclose(__stream);
    }
  }
  if (outlen != 0) {
    bVar9 = 0;
    bVar8 = 0;
    pbVar6 = out;
    do {
      if (callback != (_func_void *)0x0) {
        (*callback)();
      }
      local_4c = 8;
      bVar7 = 0;
      do {
        do {
          cVar3 = clock();
          while (cVar4 = clock(), cVar3 == cVar4) {
            bVar8 = bVar8 ^ 1;
          }
          cVar3 = clock();
          while (cVar4 = clock(), cVar3 == cVar4) {
            bVar9 = bVar9 ^ 1;
          }
        } while (bVar8 == bVar9);
        bVar7 = bVar7 * '\x02' | bVar8;
        local_4c = local_4c + -1;
      } while (local_4c != 0);
      pbVar5 = pbVar6 + 1;
      *pbVar6 = bVar7;
      pbVar6 = pbVar5;
    } while (pbVar5 != out + outlen);
  }
  return (long)(int)outlen;
}



size_t rng_get_bytes(byte *param_1,size_t param_2,code *param_3)

{
  int iVar1;
  FILE *__stream;
  size_t sVar2;
  clock_t cVar3;
  clock_t cVar4;
  byte *pbVar5;
  byte *pbVar6;
  byte bVar7;
  byte bVar8;
  byte bVar9;
  int local_4c;
  
  if (param_1 == (byte *)0x0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);
  }
  __stream = fopen("/dev/urandom","rb");
  if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))
  {
    iVar1 = setvbuf(__stream,(char *)0x0,2,0);
    if (iVar1 == 0) {
      sVar2 = fread(param_1,1,param_2,__stream);
      fclose(__stream);
      if (sVar2 != 0) {
        return sVar2;
      }
    }
    else {
      fclose(__stream);
    }
  }
  if (param_2 != 0) {
    bVar9 = 0;
    bVar8 = 0;
    pbVar6 = param_1;
    do {
      if (param_3 != (code *)0x0) {
        (*param_3)();
      }
      local_4c = 8;
      bVar7 = 0;
      do {
        do {
          cVar3 = clock();
          while (cVar4 = clock(), cVar3 == cVar4) {
            bVar8 = bVar8 ^ 1;
          }
          cVar3 = clock();
          while (cVar4 = clock(), cVar3 == cVar4) {
            bVar9 = bVar9 ^ 1;
          }
        } while (bVar8 == bVar9);
        bVar7 = bVar7 * '\x02' | bVar8;
        local_4c = local_4c + -1;
      } while (local_4c != 0);
      pbVar5 = pbVar6 + 1;
      *pbVar6 = bVar7;
      pbVar6 = pbVar5;
    } while (pbVar5 != param_1 + param_2);
  }
  return (long)(int)param_2;
}


PUSH R15
PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x28
TEST RDI,RDI
JZ 0x0018a74d
MOV RBX,RDI
MOV R15,RSI
MOV R14,RDX
LEA RSI,[0x1b1733]
LEA RDI,[0x1ca236]
CALL 0x00114890
MOV RBP,RAX
TEST RAX,RAX
JZ 0x0018a765
MOV ECX,0x0
MOV EDX,0x2
MOV ESI,0x0
MOV RDI,RBP
CALL 0x001146c0
TEST EAX,EAX
JNZ 0x0018a7a4
MOV RCX,RBP
MOV RDX,R15
MOV ESI,0x1
MOV RDI,RBX
CALL 0x00113480
MOV R13,RAX
MOV RDI,RBP
CALL 0x00113700
TEST R13,R13
JZ 0x0018a784
MOV RAX,R13
ADD RSP,0x28
POP RBX
POP RBP
POP R12
POP R13
POP R14
POP R15
RET
MOV EDX,0x86
LEA RSI,[0x1ca21c]
LEA RDI,[0x1ab721]
CALL 0x00114260
LEA RSI,[0x1b1733]
LEA RDI,[0x1ca243]
CALL 0x00114890
MOV RBP,RAX
TEST RAX,RAX
JNZ 0x0018a6f9
TEST R15,R15
JZ 0x0018a81d
LEA RAX,[RBX + R15*0x1]
MOV qword ptr [RSP + 0x18],RAX
MOV R13D,0x0
MOV R12D,0x0
JMP 0x0018a806
MOV RDI,RBP
CALL 0x00113700
JMP 0x0018a784
CALL 0x00113690
MOV qword ptr [RSP + 0x10],RAX
CALL 0x00113690
CMP qword ptr [RSP + 0x10],RAX
JNZ 0x0018a7ca
XOR R13D,0x1
JMP 0x0018a7b8
CMP R12D,R13D
JNZ 0x0018a7eb
CALL 0x00113690
MOV qword ptr [RSP + 0x10],RAX
CALL 0x00113690
CMP qword ptr [RSP + 0x10],RAX
JNZ 0x0018a7ae
XOR R12D,0x1
JMP 0x0018a7d9
ADD EBP,EBP
OR EBP,R12D
SUB dword ptr [RSP + 0xc],0x1
JNZ 0x0018a7cf
ADD RBX,0x1
MOV byte ptr [RBX + -0x1],BPL
CMP RBX,qword ptr [RSP + 0x18]
JZ 0x0018a81d
TEST R14,R14
JZ 0x0018a80e
CALL R14
MOV dword ptr [RSP + 0xc],0x8
MOV EBP,0x0
JMP 0x0018a7cf
MOVSXD R13,R15D
JMP 0x0018a73b
(translation_unit "size_t rng_get_bytes(byte *param_1,size_t param_2,code *param_3)\n\n{\n  int iVar1;\n  FILE *__stream;\n  size_t sVar2;\n  clock_t cVar3;\n  clock_t cVar4;\n  byte *pbVar5;\n  byte *pbVar6;\n  byte bVar7;\n  byte bVar8;\n  byte bVar9;\n  int local_4c;\n  \n  if (param_1 == (byte *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }\n  __stream = fopen("/dev/urandom","rb");\n  if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))\n  {\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }\n  if (param_2 != 0) {\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = param_1;\n    do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);\n  }\n  return (long)(int)param_2;\n}\n\n" (function_definition "size_t rng_get_bytes(byte *param_1,size_t param_2,code *param_3)\n\n{\n  int iVar1;\n  FILE *__stream;\n  size_t sVar2;\n  clock_t cVar3;\n  clock_t cVar4;\n  byte *pbVar5;\n  byte *pbVar6;\n  byte bVar7;\n  byte bVar8;\n  byte bVar9;\n  int local_4c;\n  \n  if (param_1 == (byte *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }\n  __stream = fopen("/dev/urandom","rb");\n  if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))\n  {\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }\n  if (param_2 != 0) {\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = param_1;\n    do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);\n  }\n  return (long)(int)param_2;\n}" primitive_type (function_declarator "rng_get_bytes(byte *param_1,size_t param_2,code *param_3)" identifier (parameter_list "(byte *param_1,size_t param_2,code *param_3)" ( (parameter_declaration "byte *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "size_t param_2" primitive_type identifier) , (parameter_declaration "code *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  FILE *__stream;\n  size_t sVar2;\n  clock_t cVar3;\n  clock_t cVar4;\n  byte *pbVar5;\n  byte *pbVar6;\n  byte bVar7;\n  byte bVar8;\n  byte bVar9;\n  int local_4c;\n  \n  if (param_1 == (byte *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }\n  __stream = fopen("/dev/urandom","rb");\n  if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))\n  {\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }\n  if (param_2 != 0) {\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = param_1;\n    do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);\n  }\n  return (long)(int)param_2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "FILE *__stream;" type_identifier (pointer_declarator "*__stream" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "clock_t cVar3;" type_identifier identifier ;) (declaration "clock_t cVar4;" type_identifier identifier ;) (declaration "byte *pbVar5;" type_identifier (pointer_declarator "*pbVar5" * identifier) ;) (declaration "byte *pbVar6;" type_identifier (pointer_declarator "*pbVar6" * identifier) ;) (declaration "byte bVar7;" type_identifier identifier ;) (declaration "byte bVar8;" type_identifier identifier ;) (declaration "byte bVar9;" type_identifier identifier ;) (declaration "int local_4c;" primitive_type identifier ;) (if_statement "if (param_1 == (byte *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }" if (parenthesized_expression "(param_1 == (byte *)0x0)" ( (binary_expression "param_1 == (byte *)0x0" identifier == (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }" { comment (expression_statement "crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);" (call_expression "crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86)" identifier (argument_list "("out != NULL","src/prngs/rng_get_bytes.c",0x86)" ( (string_literal ""out != NULL"" " string_content ") , (string_literal ""src/prngs/rng_get_bytes.c"" " string_content ") , number_literal ))) ;) })) (expression_statement "__stream = fopen("/dev/urandom","rb");" (assignment_expression "__stream = fopen("/dev/urandom","rb")" identifier = (call_expression "fopen("/dev/urandom","rb")" identifier (argument_list "("/dev/urandom","rb")" ( (string_literal ""/dev/urandom"" " string_content ") , (string_literal ""rb"" " string_content ") )))) ;) (if_statement "if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))\n  {\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }" if (parenthesized_expression "((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))" ( (binary_expression "(__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0)" (parenthesized_expression "(__stream != (FILE *)0x0)" ( (binary_expression "__stream != (FILE *)0x0" identifier != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) || (parenthesized_expression "(__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0)" ( (comma_expression "__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0" (assignment_expression "__stream = fopen("/dev/random","rb")" identifier = (call_expression "fopen("/dev/random","rb")" identifier (argument_list "("/dev/random","rb")" ( (string_literal ""/dev/random"" " string_content ") , (string_literal ""rb"" " string_content ") )))) , (binary_expression "__stream != (FILE *)0x0" identifier != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) (compound_statement "{\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }" { (expression_statement "iVar1 = setvbuf(__stream,(char *)0x0,2,0);" (assignment_expression "iVar1 = setvbuf(__stream,(char *)0x0,2,0)" identifier = (call_expression "setvbuf(__stream,(char *)0x0,2,0)" identifier (argument_list "(__stream,(char *)0x0,2,0)" ( identifier , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , number_literal , number_literal )))) ;) (if_statement "if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }" { (expression_statement "sVar2 = fread(param_1,1,param_2,__stream);" (assignment_expression "sVar2 = fread(param_1,1,param_2,__stream)" identifier = (call_expression "fread(param_1,1,param_2,__stream)" identifier (argument_list "(param_1,1,param_2,__stream)" ( identifier , number_literal , identifier , identifier )))) ;) (expression_statement "fclose(__stream);" (call_expression "fclose(__stream)" identifier (argument_list "(__stream)" ( identifier ))) ;) (if_statement "if (sVar2 != 0) {\n        return sVar2;\n      }" if (parenthesized_expression "(sVar2 != 0)" ( (binary_expression "sVar2 != 0" identifier != number_literal) )) (compound_statement "{\n        return sVar2;\n      }" { (return_statement "return sVar2;" return identifier ;) })) }) (else_clause "else {\n      fclose(__stream);\n    }" else (compound_statement "{\n      fclose(__stream);\n    }" { (expression_statement "fclose(__stream);" (call_expression "fclose(__stream)" identifier (argument_list "(__stream)" ( identifier ))) ;) }))) })) (if_statement "if (param_2 != 0) {\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = param_1;\n    do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);\n  }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = param_1;\n    do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);\n  }" { (expression_statement "bVar9 = 0;" (assignment_expression "bVar9 = 0" identifier = number_literal) ;) (expression_statement "bVar8 = 0;" (assignment_expression "bVar8 = 0" identifier = number_literal) ;) (expression_statement "pbVar6 = param_1;" (assignment_expression "pbVar6 = param_1" identifier = identifier) ;) (do_statement "do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);" do (compound_statement "{\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    }" { (if_statement "if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }" if (parenthesized_expression "(param_3 != (code *)0x0)" ( (binary_expression "param_3 != (code *)0x0" identifier != (cast_expression "(code *)0x0" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        (*param_3)();\n      }" { (expression_statement "(*param_3)();" (call_expression "(*param_3)()" (parenthesized_expression "(*param_3)" ( (pointer_expression "*param_3" * identifier) )) (argument_list "()" ( ))) ;) })) (expression_statement "local_4c = 8;" (assignment_expression "local_4c = 8" identifier = number_literal) ;) (expression_statement "bVar7 = 0;" (assignment_expression "bVar7 = 0" identifier = number_literal) ;) (do_statement "do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);" do (compound_statement "{\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      }" { (do_statement "do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);" do (compound_statement "{\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        }" { (expression_statement "cVar3 = clock();" (assignment_expression "cVar3 = clock()" identifier = (call_expression "clock()" identifier (argument_list "()" ( )))) ;) (while_statement "while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }" while (parenthesized_expression "(cVar4 = clock(), cVar3 == cVar4)" ( (comma_expression "cVar4 = clock(), cVar3 == cVar4" (assignment_expression "cVar4 = clock()" identifier = (call_expression "clock()" identifier (argument_list "()" ( )))) , (binary_expression "cVar3 == cVar4" identifier == identifier)) )) (compound_statement "{\n            bVar8 = bVar8 ^ 1;\n          }" { (expression_statement "bVar8 = bVar8 ^ 1;" (assignment_expression "bVar8 = bVar8 ^ 1" identifier = (binary_expression "bVar8 ^ 1" identifier ^ number_literal)) ;) })) (expression_statement "cVar3 = clock();" (assignment_expression "cVar3 = clock()" identifier = (call_expression "clock()" identifier (argument_list "()" ( )))) ;) (while_statement "while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }" while (parenthesized_expression "(cVar4 = clock(), cVar3 == cVar4)" ( (comma_expression "cVar4 = clock(), cVar3 == cVar4" (assignment_expression "cVar4 = clock()" identifier = (call_expression "clock()" identifier (argument_list "()" ( )))) , (binary_expression "cVar3 == cVar4" identifier == identifier)) )) (compound_statement "{\n            bVar9 = bVar9 ^ 1;\n          }" { (expression_statement "bVar9 = bVar9 ^ 1;" (assignment_expression "bVar9 = bVar9 ^ 1" identifier = (binary_expression "bVar9 ^ 1" identifier ^ number_literal)) ;) })) }) while (parenthesized_expression "(bVar8 == bVar9)" ( (binary_expression "bVar8 == bVar9" identifier == identifier) )) ;) (expression_statement "bVar7 = bVar7 * '\x02' | bVar8;" (assignment_expression "bVar7 = bVar7 * '\x02' | bVar8" identifier = (binary_expression "bVar7 * '\x02' | bVar8" (binary_expression "bVar7 * '\x02'" identifier * (char_literal "'\x02'" ' escape_sequence ')) | identifier)) ;) (expression_statement "local_4c = local_4c + -1;" (assignment_expression "local_4c = local_4c + -1" identifier = (binary_expression "local_4c + -1" identifier + number_literal)) ;) }) while (parenthesized_expression "(local_4c != 0)" ( (binary_expression "local_4c != 0" identifier != number_literal) )) ;) (expression_statement "pbVar5 = pbVar6 + 1;" (assignment_expression "pbVar5 = pbVar6 + 1" identifier = (binary_expression "pbVar6 + 1" identifier + number_literal)) ;) (expression_statement "*pbVar6 = bVar7;" (assignment_expression "*pbVar6 = bVar7" (pointer_expression "*pbVar6" * identifier) = identifier) ;) (expression_statement "pbVar6 = pbVar5;" (assignment_expression "pbVar6 = pbVar5" identifier = identifier) ;) }) while (parenthesized_expression "(pbVar5 != param_1 + param_2)" ( (binary_expression "pbVar5 != param_1 + param_2" identifier != (binary_expression "param_1 + param_2" identifier + identifier)) )) ;) })) (return_statement "return (long)(int)param_2;" return (cast_expression "(long)(int)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier)) ;) })))
(translation_unit "ulong rng_get_bytes(uchar *out,ulong outlen,_func_void *callback)\n\n{\n  int iVar1;\n  FILE *__stream;\n  size_t sVar2;\n  clock_t cVar3;\n  clock_t cVar4;\n  byte *pbVar5;\n  byte *pbVar6;\n  byte bVar7;\n  byte bVar8;\n  byte bVar9;\n  int local_4c;\n  \n  if (out == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }\n  __stream = fopen("/dev/urandom","rb");\n  if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))\n  {\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(out,1,outlen,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }\n  if (outlen != 0) {\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = out;\n    do {\n      if (callback != (_func_void *)0x0) {\n        (*callback)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != out + outlen);\n  }\n  return (long)(int)outlen;\n}\n\n" (function_definition "ulong rng_get_bytes(uchar *out,ulong outlen,_func_void *callback)\n\n{\n  int iVar1;\n  FILE *__stream;\n  size_t sVar2;\n  clock_t cVar3;\n  clock_t cVar4;\n  byte *pbVar5;\n  byte *pbVar6;\n  byte bVar7;\n  byte bVar8;\n  byte bVar9;\n  int local_4c;\n  \n  if (out == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }\n  __stream = fopen("/dev/urandom","rb");\n  if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))\n  {\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(out,1,outlen,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }\n  if (outlen != 0) {\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = out;\n    do {\n      if (callback != (_func_void *)0x0) {\n        (*callback)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != out + outlen);\n  }\n  return (long)(int)outlen;\n}" type_identifier (function_declarator "rng_get_bytes(uchar *out,ulong outlen,_func_void *callback)" identifier (parameter_list "(uchar *out,ulong outlen,_func_void *callback)" ( (parameter_declaration "uchar *out" type_identifier (pointer_declarator "*out" * identifier)) , (parameter_declaration "ulong outlen" type_identifier identifier) , (parameter_declaration "_func_void *callback" type_identifier (pointer_declarator "*callback" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  FILE *__stream;\n  size_t sVar2;\n  clock_t cVar3;\n  clock_t cVar4;\n  byte *pbVar5;\n  byte *pbVar6;\n  byte bVar7;\n  byte bVar8;\n  byte bVar9;\n  int local_4c;\n  \n  if (out == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }\n  __stream = fopen("/dev/urandom","rb");\n  if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))\n  {\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(out,1,outlen,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }\n  if (outlen != 0) {\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = out;\n    do {\n      if (callback != (_func_void *)0x0) {\n        (*callback)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != out + outlen);\n  }\n  return (long)(int)outlen;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "FILE *__stream;" type_identifier (pointer_declarator "*__stream" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "clock_t cVar3;" type_identifier identifier ;) (declaration "clock_t cVar4;" type_identifier identifier ;) (declaration "byte *pbVar5;" type_identifier (pointer_declarator "*pbVar5" * identifier) ;) (declaration "byte *pbVar6;" type_identifier (pointer_declarator "*pbVar6" * identifier) ;) (declaration "byte bVar7;" type_identifier identifier ;) (declaration "byte bVar8;" type_identifier identifier ;) (declaration "byte bVar9;" type_identifier identifier ;) (declaration "int local_4c;" primitive_type identifier ;) (if_statement "if (out == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }" if (parenthesized_expression "(out == (uchar *)0x0)" ( (binary_expression "out == (uchar *)0x0" identifier == (cast_expression "(uchar *)0x0" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }" { comment (expression_statement "crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);" (call_expression "crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86)" identifier (argument_list "("out != NULL","src/prngs/rng_get_bytes.c",0x86)" ( (string_literal ""out != NULL"" " string_content ") , (string_literal ""src/prngs/rng_get_bytes.c"" " string_content ") , number_literal ))) ;) })) (expression_statement "__stream = fopen("/dev/urandom","rb");" (assignment_expression "__stream = fopen("/dev/urandom","rb")" identifier = (call_expression "fopen("/dev/urandom","rb")" identifier (argument_list "("/dev/urandom","rb")" ( (string_literal ""/dev/urandom"" " string_content ") , (string_literal ""rb"" " string_content ") )))) ;) (if_statement "if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))\n  {\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(out,1,outlen,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }" if (parenthesized_expression "((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))" ( (binary_expression "(__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0)" (parenthesized_expression "(__stream != (FILE *)0x0)" ( (binary_expression "__stream != (FILE *)0x0" identifier != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) || (parenthesized_expression "(__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0)" ( (comma_expression "__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0" (assignment_expression "__stream = fopen("/dev/random","rb")" identifier = (call_expression "fopen("/dev/random","rb")" identifier (argument_list "("/dev/random","rb")" ( (string_literal ""/dev/random"" " string_content ") , (string_literal ""rb"" " string_content ") )))) , (binary_expression "__stream != (FILE *)0x0" identifier != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) (compound_statement "{\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(out,1,outlen,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }" { (expression_statement "iVar1 = setvbuf(__stream,(char *)0x0,2,0);" (assignment_expression "iVar1 = setvbuf(__stream,(char *)0x0,2,0)" identifier = (call_expression "setvbuf(__stream,(char *)0x0,2,0)" identifier (argument_list "(__stream,(char *)0x0,2,0)" ( identifier , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , number_literal , number_literal )))) ;) (if_statement "if (iVar1 == 0) {\n      sVar2 = fread(out,1,outlen,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      sVar2 = fread(out,1,outlen,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }" { (expression_statement "sVar2 = fread(out,1,outlen,__stream);" (assignment_expression "sVar2 = fread(out,1,outlen,__stream)" identifier = (call_expression "fread(out,1,outlen,__stream)" identifier (argument_list "(out,1,outlen,__stream)" ( identifier , number_literal , identifier , identifier )))) ;) (expression_statement "fclose(__stream);" (call_expression "fclose(__stream)" identifier (argument_list "(__stream)" ( identifier ))) ;) (if_statement "if (sVar2 != 0) {\n        return sVar2;\n      }" if (parenthesized_expression "(sVar2 != 0)" ( (binary_expression "sVar2 != 0" identifier != number_literal) )) (compound_statement "{\n        return sVar2;\n      }" { (return_statement "return sVar2;" return identifier ;) })) }) (else_clause "else {\n      fclose(__stream);\n    }" else (compound_statement "{\n      fclose(__stream);\n    }" { (expression_statement "fclose(__stream);" (call_expression "fclose(__stream)" identifier (argument_list "(__stream)" ( identifier ))) ;) }))) })) (if_statement "if (outlen != 0) {\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = out;\n    do {\n      if (callback != (_func_void *)0x0) {\n        (*callback)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != out + outlen);\n  }" if (parenthesized_expression "(outlen != 0)" ( (binary_expression "outlen != 0" identifier != number_literal) )) (compound_statement "{\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = out;\n    do {\n      if (callback != (_func_void *)0x0) {\n        (*callback)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != out + outlen);\n  }" { (expression_statement "bVar9 = 0;" (assignment_expression "bVar9 = 0" identifier = number_literal) ;) (expression_statement "bVar8 = 0;" (assignment_expression "bVar8 = 0" identifier = number_literal) ;) (expression_statement "pbVar6 = out;" (assignment_expression "pbVar6 = out" identifier = identifier) ;) (do_statement "do {\n      if (callback != (_func_void *)0x0) {\n        (*callback)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != out + outlen);" do (compound_statement "{\n      if (callback != (_func_void *)0x0) {\n        (*callback)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    }" { (if_statement "if (callback != (_func_void *)0x0) {\n        (*callback)();\n      }" if (parenthesized_expression "(callback != (_func_void *)0x0)" ( (binary_expression "callback != (_func_void *)0x0" identifier != (cast_expression "(_func_void *)0x0" ( (type_descriptor "_func_void *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        (*callback)();\n      }" { (expression_statement "(*callback)();" (call_expression "(*callback)()" (parenthesized_expression "(*callback)" ( (pointer_expression "*callback" * identifier) )) (argument_list "()" ( ))) ;) })) (expression_statement "local_4c = 8;" (assignment_expression "local_4c = 8" identifier = number_literal) ;) (expression_statement "bVar7 = 0;" (assignment_expression "bVar7 = 0" identifier = number_literal) ;) (do_statement "do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);" do (compound_statement "{\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      }" { (do_statement "do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);" do (compound_statement "{\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        }" { (expression_statement "cVar3 = clock();" (assignment_expression "cVar3 = clock()" identifier = (call_expression "clock()" identifier (argument_list "()" ( )))) ;) (while_statement "while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }" while (parenthesized_expression "(cVar4 = clock(), cVar3 == cVar4)" ( (comma_expression "cVar4 = clock(), cVar3 == cVar4" (assignment_expression "cVar4 = clock()" identifier = (call_expression "clock()" identifier (argument_list "()" ( )))) , (binary_expression "cVar3 == cVar4" identifier == identifier)) )) (compound_statement "{\n            bVar8 = bVar8 ^ 1;\n          }" { (expression_statement "bVar8 = bVar8 ^ 1;" (assignment_expression "bVar8 = bVar8 ^ 1" identifier = (binary_expression "bVar8 ^ 1" identifier ^ number_literal)) ;) })) (expression_statement "cVar3 = clock();" (assignment_expression "cVar3 = clock()" identifier = (call_expression "clock()" identifier (argument_list "()" ( )))) ;) (while_statement "while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }" while (parenthesized_expression "(cVar4 = clock(), cVar3 == cVar4)" ( (comma_expression "cVar4 = clock(), cVar3 == cVar4" (assignment_expression "cVar4 = clock()" identifier = (call_expression "clock()" identifier (argument_list "()" ( )))) , (binary_expression "cVar3 == cVar4" identifier == identifier)) )) (compound_statement "{\n            bVar9 = bVar9 ^ 1;\n          }" { (expression_statement "bVar9 = bVar9 ^ 1;" (assignment_expression "bVar9 = bVar9 ^ 1" identifier = (binary_expression "bVar9 ^ 1" identifier ^ number_literal)) ;) })) }) while (parenthesized_expression "(bVar8 == bVar9)" ( (binary_expression "bVar8 == bVar9" identifier == identifier) )) ;) (expression_statement "bVar7 = bVar7 * '\x02' | bVar8;" (assignment_expression "bVar7 = bVar7 * '\x02' | bVar8" identifier = (binary_expression "bVar7 * '\x02' | bVar8" (binary_expression "bVar7 * '\x02'" identifier * (char_literal "'\x02'" ' escape_sequence ')) | identifier)) ;) (expression_statement "local_4c = local_4c + -1;" (assignment_expression "local_4c = local_4c + -1" identifier = (binary_expression "local_4c + -1" identifier + number_literal)) ;) }) while (parenthesized_expression "(local_4c != 0)" ( (binary_expression "local_4c != 0" identifier != number_literal) )) ;) (expression_statement "pbVar5 = pbVar6 + 1;" (assignment_expression "pbVar5 = pbVar6 + 1" identifier = (binary_expression "pbVar6 + 1" identifier + number_literal)) ;) (expression_statement "*pbVar6 = bVar7;" (assignment_expression "*pbVar6 = bVar7" (pointer_expression "*pbVar6" * identifier) = identifier) ;) (expression_statement "pbVar6 = pbVar5;" (assignment_expression "pbVar6 = pbVar5" identifier = identifier) ;) }) while (parenthesized_expression "(pbVar5 != out + outlen)" ( (binary_expression "pbVar5 != out + outlen" identifier != (binary_expression "out + outlen" identifier + identifier)) )) ;) })) (return_statement "return (long)(int)outlen;" return (cast_expression "(long)(int)outlen" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (cast_expression "(int)outlen" ( (type_descriptor "int" primitive_type) ) identifier)) ;) })))
(translation_unit "size_t rng_get_bytes(byte *param_1,size_t param_2,code *param_3)\n\n{\n  int iVar1;\n  FILE *__stream;\n  size_t sVar2;\n  clock_t cVar3;\n  clock_t cVar4;\n  byte *pbVar5;\n  byte *pbVar6;\n  byte bVar7;\n  byte bVar8;\n  byte bVar9;\n  int local_4c;\n  \n  if (param_1 == (byte *)0x0) {\n                    \n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }\n  __stream = fopen("/dev/urandom","rb");\n  if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))\n  {\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }\n  if (param_2 != 0) {\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = param_1;\n    do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);\n  }\n  return (long)(int)param_2;\n}\n\n" (function_definition "size_t rng_get_bytes(byte *param_1,size_t param_2,code *param_3)\n\n{\n  int iVar1;\n  FILE *__stream;\n  size_t sVar2;\n  clock_t cVar3;\n  clock_t cVar4;\n  byte *pbVar5;\n  byte *pbVar6;\n  byte bVar7;\n  byte bVar8;\n  byte bVar9;\n  int local_4c;\n  \n  if (param_1 == (byte *)0x0) {\n                    \n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }\n  __stream = fopen("/dev/urandom","rb");\n  if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))\n  {\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }\n  if (param_2 != 0) {\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = param_1;\n    do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);\n  }\n  return (long)(int)param_2;\n}" primitive_type (function_declarator "rng_get_bytes(byte *param_1,size_t param_2,code *param_3)" identifier (parameter_list "(byte *param_1,size_t param_2,code *param_3)" ( (parameter_declaration "byte *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "size_t param_2" primitive_type identifier) , (parameter_declaration "code *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  FILE *__stream;\n  size_t sVar2;\n  clock_t cVar3;\n  clock_t cVar4;\n  byte *pbVar5;\n  byte *pbVar6;\n  byte bVar7;\n  byte bVar8;\n  byte bVar9;\n  int local_4c;\n  \n  if (param_1 == (byte *)0x0) {\n                    \n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }\n  __stream = fopen("/dev/urandom","rb");\n  if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))\n  {\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }\n  if (param_2 != 0) {\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = param_1;\n    do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);\n  }\n  return (long)(int)param_2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "FILE *__stream;" type_identifier (pointer_declarator "*__stream" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "clock_t cVar3;" type_identifier identifier ;) (declaration "clock_t cVar4;" type_identifier identifier ;) (declaration "byte *pbVar5;" type_identifier (pointer_declarator "*pbVar5" * identifier) ;) (declaration "byte *pbVar6;" type_identifier (pointer_declarator "*pbVar6" * identifier) ;) (declaration "byte bVar7;" type_identifier identifier ;) (declaration "byte bVar8;" type_identifier identifier ;) (declaration "byte bVar9;" type_identifier identifier ;) (declaration "int local_4c;" primitive_type identifier ;) (if_statement "if (param_1 == (byte *)0x0) {\n                    \n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }" if (parenthesized_expression "(param_1 == (byte *)0x0)" ( (binary_expression "param_1 == (byte *)0x0" identifier == (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    \n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }" { (expression_statement "crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);" (call_expression "crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86)" identifier (argument_list "("out != NULL","src/prngs/rng_get_bytes.c",0x86)" ( (string_literal ""out != NULL"" " string_content ") , (string_literal ""src/prngs/rng_get_bytes.c"" " string_content ") , number_literal ))) ;) })) (expression_statement "__stream = fopen("/dev/urandom","rb");" (assignment_expression "__stream = fopen("/dev/urandom","rb")" identifier = (call_expression "fopen("/dev/urandom","rb")" identifier (argument_list "("/dev/urandom","rb")" ( (string_literal ""/dev/urandom"" " string_content ") , (string_literal ""rb"" " string_content ") )))) ;) (if_statement "if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))\n  {\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }" if (parenthesized_expression "((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))" ( (binary_expression "(__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0)" (parenthesized_expression "(__stream != (FILE *)0x0)" ( (binary_expression "__stream != (FILE *)0x0" identifier != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) || (parenthesized_expression "(__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0)" ( (comma_expression "__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0" (assignment_expression "__stream = fopen("/dev/random","rb")" identifier = (call_expression "fopen("/dev/random","rb")" identifier (argument_list "("/dev/random","rb")" ( (string_literal ""/dev/random"" " string_content ") , (string_literal ""rb"" " string_content ") )))) , (binary_expression "__stream != (FILE *)0x0" identifier != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) (compound_statement "{\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }" { (expression_statement "iVar1 = setvbuf(__stream,(char *)0x0,2,0);" (assignment_expression "iVar1 = setvbuf(__stream,(char *)0x0,2,0)" identifier = (call_expression "setvbuf(__stream,(char *)0x0,2,0)" identifier (argument_list "(__stream,(char *)0x0,2,0)" ( identifier , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , number_literal , number_literal )))) ;) (if_statement "if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }" { (expression_statement "sVar2 = fread(param_1,1,param_2,__stream);" (assignment_expression "sVar2 = fread(param_1,1,param_2,__stream)" identifier = (call_expression "fread(param_1,1,param_2,__stream)" identifier (argument_list "(param_1,1,param_2,__stream)" ( identifier , number_literal , identifier , identifier )))) ;) (expression_statement "fclose(__stream);" (call_expression "fclose(__stream)" identifier (argument_list "(__stream)" ( identifier ))) ;) (if_statement "if (sVar2 != 0) {\n        return sVar2;\n      }" if (parenthesized_expression "(sVar2 != 0)" ( (binary_expression "sVar2 != 0" identifier != number_literal) )) (compound_statement "{\n        return sVar2;\n      }" { (return_statement "return sVar2;" return identifier ;) })) }) (else_clause "else {\n      fclose(__stream);\n    }" else (compound_statement "{\n      fclose(__stream);\n    }" { (expression_statement "fclose(__stream);" (call_expression "fclose(__stream)" identifier (argument_list "(__stream)" ( identifier ))) ;) }))) })) (if_statement "if (param_2 != 0) {\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = param_1;\n    do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);\n  }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = param_1;\n    do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);\n  }" { (expression_statement "bVar9 = 0;" (assignment_expression "bVar9 = 0" identifier = number_literal) ;) (expression_statement "bVar8 = 0;" (assignment_expression "bVar8 = 0" identifier = number_literal) ;) (expression_statement "pbVar6 = param_1;" (assignment_expression "pbVar6 = param_1" identifier = identifier) ;) (do_statement "do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);" do (compound_statement "{\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    }" { (if_statement "if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }" if (parenthesized_expression "(param_3 != (code *)0x0)" ( (binary_expression "param_3 != (code *)0x0" identifier != (cast_expression "(code *)0x0" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        (*param_3)();\n      }" { (expression_statement "(*param_3)();" (call_expression "(*param_3)()" (parenthesized_expression "(*param_3)" ( (pointer_expression "*param_3" * identifier) )) (argument_list "()" ( ))) ;) })) (expression_statement "local_4c = 8;" (assignment_expression "local_4c = 8" identifier = number_literal) ;) (expression_statement "bVar7 = 0;" (assignment_expression "bVar7 = 0" identifier = number_literal) ;) (do_statement "do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);" do (compound_statement "{\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      }" { (do_statement "do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);" do (compound_statement "{\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        }" { (expression_statement "cVar3 = clock();" (assignment_expression "cVar3 = clock()" identifier = (call_expression "clock()" identifier (argument_list "()" ( )))) ;) (while_statement "while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }" while (parenthesized_expression "(cVar4 = clock(), cVar3 == cVar4)" ( (comma_expression "cVar4 = clock(), cVar3 == cVar4" (assignment_expression "cVar4 = clock()" identifier = (call_expression "clock()" identifier (argument_list "()" ( )))) , (binary_expression "cVar3 == cVar4" identifier == identifier)) )) (compound_statement "{\n            bVar8 = bVar8 ^ 1;\n          }" { (expression_statement "bVar8 = bVar8 ^ 1;" (assignment_expression "bVar8 = bVar8 ^ 1" identifier = (binary_expression "bVar8 ^ 1" identifier ^ number_literal)) ;) })) (expression_statement "cVar3 = clock();" (assignment_expression "cVar3 = clock()" identifier = (call_expression "clock()" identifier (argument_list "()" ( )))) ;) (while_statement "while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }" while (parenthesized_expression "(cVar4 = clock(), cVar3 == cVar4)" ( (comma_expression "cVar4 = clock(), cVar3 == cVar4" (assignment_expression "cVar4 = clock()" identifier = (call_expression "clock()" identifier (argument_list "()" ( )))) , (binary_expression "cVar3 == cVar4" identifier == identifier)) )) (compound_statement "{\n            bVar9 = bVar9 ^ 1;\n          }" { (expression_statement "bVar9 = bVar9 ^ 1;" (assignment_expression "bVar9 = bVar9 ^ 1" identifier = (binary_expression "bVar9 ^ 1" identifier ^ number_literal)) ;) })) }) while (parenthesized_expression "(bVar8 == bVar9)" ( (binary_expression "bVar8 == bVar9" identifier == identifier) )) ;) (expression_statement "bVar7 = bVar7 * '\x02' | bVar8;" (assignment_expression "bVar7 = bVar7 * '\x02' | bVar8" identifier = (binary_expression "bVar7 * '\x02' | bVar8" (binary_expression "bVar7 * '\x02'" identifier * (char_literal "'\x02'" ' escape_sequence ')) | identifier)) ;) (expression_statement "local_4c = local_4c + -1;" (assignment_expression "local_4c = local_4c + -1" identifier = (binary_expression "local_4c + -1" identifier + number_literal)) ;) }) while (parenthesized_expression "(local_4c != 0)" ( (binary_expression "local_4c != 0" identifier != number_literal) )) ;) (expression_statement "pbVar5 = pbVar6 + 1;" (assignment_expression "pbVar5 = pbVar6 + 1" identifier = (binary_expression "pbVar6 + 1" identifier + number_literal)) ;) (expression_statement "*pbVar6 = bVar7;" (assignment_expression "*pbVar6 = bVar7" (pointer_expression "*pbVar6" * identifier) = identifier) ;) (expression_statement "pbVar6 = pbVar5;" (assignment_expression "pbVar6 = pbVar5" identifier = identifier) ;) }) while (parenthesized_expression "(pbVar5 != param_1 + param_2)" ( (binary_expression "pbVar5 != param_1 + param_2" identifier != (binary_expression "param_1 + param_2" identifier + identifier)) )) ;) })) (return_statement "return (long)(int)param_2;" return (cast_expression "(long)(int)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier)) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT ))) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) || (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") )))) , (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT))) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) , LIT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , IDENT , IDENT )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (return_statement return IDENT ;) })) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }))) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * IDENT) )) (argument_list ( ))) ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (while_statement while (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) , (binary_expression IDENT == IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT ^ LIT)) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (while_statement while (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) , (binary_expression IDENT == IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT ^ LIT)) ;) })) }) while (parenthesized_expression ( (binary_expression IDENT == IDENT) )) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT * (char_literal ' escape_sequence ')) | IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != LIT) )) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) while (parenthesized_expression ( (binary_expression IDENT != (binary_expression IDENT + IDENT)) )) ;) })) (return_statement return (cast_expression ( (type_descriptor (sized_type_specifier long)) ) (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) })))
(function_definition "size_t rng_get_bytes(byte *param_1,size_t param_2,code *param_3)\n\n{\n  int iVar1;\n  FILE *__stream;\n  size_t sVar2;\n  clock_t cVar3;\n  clock_t cVar4;\n  byte *pbVar5;\n  byte *pbVar6;\n  byte bVar7;\n  byte bVar8;\n  byte bVar9;\n  int local_4c;\n  \n  if (param_1 == (byte *)0x0) {\n                    \n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }\n  __stream = fopen("/dev/urandom","rb");\n  if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))\n  {\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }\n  if (param_2 != 0) {\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = param_1;\n    do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);\n  }\n  return (long)(int)param_2;\n}" (primitive_type "size_t") (function_declarator "rng_get_bytes(byte *param_1,size_t param_2,code *param_3)" (identifier "rng_get_bytes") (parameter_list "(byte *param_1,size_t param_2,code *param_3)" (( "(") (parameter_declaration "byte *param_1" (type_identifier "byte") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "size_t param_2" (primitive_type "size_t") (identifier "param_2")) (, ",") (parameter_declaration "code *param_3" (type_identifier "code") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) () ")"))) (compound_statement "{\n  int iVar1;\n  FILE *__stream;\n  size_t sVar2;\n  clock_t cVar3;\n  clock_t cVar4;\n  byte *pbVar5;\n  byte *pbVar6;\n  byte bVar7;\n  byte bVar8;\n  byte bVar9;\n  int local_4c;\n  \n  if (param_1 == (byte *)0x0) {\n                    \n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }\n  __stream = fopen("/dev/urandom","rb");\n  if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))\n  {\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }\n  if (param_2 != 0) {\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = param_1;\n    do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);\n  }\n  return (long)(int)param_2;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "FILE *__stream;" (type_identifier "FILE") (pointer_declarator "*__stream" (* "*") (identifier "__stream")) (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (declaration "clock_t cVar3;" (type_identifier "clock_t") (identifier "cVar3") (; ";")) (declaration "clock_t cVar4;" (type_identifier "clock_t") (identifier "cVar4") (; ";")) (declaration "byte *pbVar5;" (type_identifier "byte") (pointer_declarator "*pbVar5" (* "*") (identifier "pbVar5")) (; ";")) (declaration "byte *pbVar6;" (type_identifier "byte") (pointer_declarator "*pbVar6" (* "*") (identifier "pbVar6")) (; ";")) (declaration "byte bVar7;" (type_identifier "byte") (identifier "bVar7") (; ";")) (declaration "byte bVar8;" (type_identifier "byte") (identifier "bVar8") (; ";")) (declaration "byte bVar9;" (type_identifier "byte") (identifier "bVar9") (; ";")) (declaration "int local_4c;" (primitive_type "int") (identifier "local_4c") (; ";")) (if_statement "if (param_1 == (byte *)0x0) {\n                    \n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }" (if "if") (parenthesized_expression "(param_1 == (byte *)0x0)" (( "(") (binary_expression "param_1 == (byte *)0x0" (identifier "param_1") (== "==") (cast_expression "(byte *)0x0" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n                    \n    crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);\n  }" ({ "{") (expression_statement "crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86);" (call_expression "crypt_argchk("out != NULL","src/prngs/rng_get_bytes.c",0x86)" (identifier "crypt_argchk") (argument_list "("out != NULL","src/prngs/rng_get_bytes.c",0x86)" (( "(") (string_literal ""out != NULL"" (" """) (string_content "out != NULL") (" """)) (, ",") (string_literal ""src/prngs/rng_get_bytes.c"" (" """) (string_content "src/prngs/rng_get_bytes.c") (" """)) (, ",") (number_literal "0x86") () ")"))) (; ";")) (} "}"))) (expression_statement "__stream = fopen("/dev/urandom","rb");" (assignment_expression "__stream = fopen("/dev/urandom","rb")" (identifier "__stream") (= "=") (call_expression "fopen("/dev/urandom","rb")" (identifier "fopen") (argument_list "("/dev/urandom","rb")" (( "(") (string_literal ""/dev/urandom"" (" """) (string_content "/dev/urandom") (" """)) (, ",") (string_literal ""rb"" (" """) (string_content "rb") (" """)) () ")")))) (; ";")) (if_statement "if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))\n  {\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }" (if "if") (parenthesized_expression "((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))" (( "(") (binary_expression "(__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0)" (parenthesized_expression "(__stream != (FILE *)0x0)" (( "(") (binary_expression "__stream != (FILE *)0x0" (identifier "__stream") (!= "!=") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (|| "||") (parenthesized_expression "(__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0)" (( "(") (comma_expression "__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0" (assignment_expression "__stream = fopen("/dev/random","rb")" (identifier "__stream") (= "=") (call_expression "fopen("/dev/random","rb")" (identifier "fopen") (argument_list "("/dev/random","rb")" (( "(") (string_literal ""/dev/random"" (" """) (string_content "/dev/random") (" """)) (, ",") (string_literal ""rb"" (" """) (string_content "rb") (" """)) () ")")))) (, ",") (binary_expression "__stream != (FILE *)0x0" (identifier "__stream") (!= "!=") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")))) () ")"))) () ")")) (compound_statement "{\n    iVar1 = setvbuf(__stream,(char *)0x0,2,0);\n    if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }\n  }" ({ "{") (expression_statement "iVar1 = setvbuf(__stream,(char *)0x0,2,0);" (assignment_expression "iVar1 = setvbuf(__stream,(char *)0x0,2,0)" (identifier "iVar1") (= "=") (call_expression "setvbuf(__stream,(char *)0x0,2,0)" (identifier "setvbuf") (argument_list "(__stream,(char *)0x0,2,0)" (( "(") (identifier "__stream") (, ",") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (, ",") (number_literal "2") (, ",") (number_literal "0") () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }\n    else {\n      fclose(__stream);\n    }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      sVar2 = fread(param_1,1,param_2,__stream);\n      fclose(__stream);\n      if (sVar2 != 0) {\n        return sVar2;\n      }\n    }" ({ "{") (expression_statement "sVar2 = fread(param_1,1,param_2,__stream);" (assignment_expression "sVar2 = fread(param_1,1,param_2,__stream)" (identifier "sVar2") (= "=") (call_expression "fread(param_1,1,param_2,__stream)" (identifier "fread") (argument_list "(param_1,1,param_2,__stream)" (( "(") (identifier "param_1") (, ",") (number_literal "1") (, ",") (identifier "param_2") (, ",") (identifier "__stream") () ")")))) (; ";")) (expression_statement "fclose(__stream);" (call_expression "fclose(__stream)" (identifier "fclose") (argument_list "(__stream)" (( "(") (identifier "__stream") () ")"))) (; ";")) (if_statement "if (sVar2 != 0) {\n        return sVar2;\n      }" (if "if") (parenthesized_expression "(sVar2 != 0)" (( "(") (binary_expression "sVar2 != 0" (identifier "sVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        return sVar2;\n      }" ({ "{") (return_statement "return sVar2;" (return "return") (identifier "sVar2") (; ";")) (} "}"))) (} "}")) (else_clause "else {\n      fclose(__stream);\n    }" (else "else") (compound_statement "{\n      fclose(__stream);\n    }" ({ "{") (expression_statement "fclose(__stream);" (call_expression "fclose(__stream)" (identifier "fclose") (argument_list "(__stream)" (( "(") (identifier "__stream") () ")"))) (; ";")) (} "}")))) (} "}"))) (if_statement "if (param_2 != 0) {\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = param_1;\n    do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);\n  }" (if "if") (parenthesized_expression "(param_2 != 0)" (( "(") (binary_expression "param_2 != 0" (identifier "param_2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    bVar9 = 0;\n    bVar8 = 0;\n    pbVar6 = param_1;\n    do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);\n  }" ({ "{") (expression_statement "bVar9 = 0;" (assignment_expression "bVar9 = 0" (identifier "bVar9") (= "=") (number_literal "0")) (; ";")) (expression_statement "bVar8 = 0;" (assignment_expression "bVar8 = 0" (identifier "bVar8") (= "=") (number_literal "0")) (; ";")) (expression_statement "pbVar6 = param_1;" (assignment_expression "pbVar6 = param_1" (identifier "pbVar6") (= "=") (identifier "param_1")) (; ";")) (do_statement "do {\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    } while (pbVar5 != param_1 + param_2);" (do "do") (compound_statement "{\n      if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }\n      local_4c = 8;\n      bVar7 = 0;\n      do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);\n      pbVar5 = pbVar6 + 1;\n      *pbVar6 = bVar7;\n      pbVar6 = pbVar5;\n    }" ({ "{") (if_statement "if (param_3 != (code *)0x0) {\n        (*param_3)();\n      }" (if "if") (parenthesized_expression "(param_3 != (code *)0x0)" (( "(") (binary_expression "param_3 != (code *)0x0" (identifier "param_3") (!= "!=") (cast_expression "(code *)0x0" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        (*param_3)();\n      }" ({ "{") (expression_statement "(*param_3)();" (call_expression "(*param_3)()" (parenthesized_expression "(*param_3)" (( "(") (pointer_expression "*param_3" (* "*") (identifier "param_3")) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (expression_statement "local_4c = 8;" (assignment_expression "local_4c = 8" (identifier "local_4c") (= "=") (number_literal "8")) (; ";")) (expression_statement "bVar7 = 0;" (assignment_expression "bVar7 = 0" (identifier "bVar7") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      } while (local_4c != 0);" (do "do") (compound_statement "{\n        do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);\n        bVar7 = bVar7 * '\x02' | bVar8;\n        local_4c = local_4c + -1;\n      }" ({ "{") (do_statement "do {\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        } while (bVar8 == bVar9);" (do "do") (compound_statement "{\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }\n          cVar3 = clock();\n          while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }\n        }" ({ "{") (expression_statement "cVar3 = clock();" (assignment_expression "cVar3 = clock()" (identifier "cVar3") (= "=") (call_expression "clock()" (identifier "clock") (argument_list "()" (( "(") () ")")))) (; ";")) (while_statement "while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar8 = bVar8 ^ 1;\n          }" (while "while") (parenthesized_expression "(cVar4 = clock(), cVar3 == cVar4)" (( "(") (comma_expression "cVar4 = clock(), cVar3 == cVar4" (assignment_expression "cVar4 = clock()" (identifier "cVar4") (= "=") (call_expression "clock()" (identifier "clock") (argument_list "()" (( "(") () ")")))) (, ",") (binary_expression "cVar3 == cVar4" (identifier "cVar3") (== "==") (identifier "cVar4"))) () ")")) (compound_statement "{\n            bVar8 = bVar8 ^ 1;\n          }" ({ "{") (expression_statement "bVar8 = bVar8 ^ 1;" (assignment_expression "bVar8 = bVar8 ^ 1" (identifier "bVar8") (= "=") (binary_expression "bVar8 ^ 1" (identifier "bVar8") (^ "^") (number_literal "1"))) (; ";")) (} "}"))) (expression_statement "cVar3 = clock();" (assignment_expression "cVar3 = clock()" (identifier "cVar3") (= "=") (call_expression "clock()" (identifier "clock") (argument_list "()" (( "(") () ")")))) (; ";")) (while_statement "while (cVar4 = clock(), cVar3 == cVar4) {\n            bVar9 = bVar9 ^ 1;\n          }" (while "while") (parenthesized_expression "(cVar4 = clock(), cVar3 == cVar4)" (( "(") (comma_expression "cVar4 = clock(), cVar3 == cVar4" (assignment_expression "cVar4 = clock()" (identifier "cVar4") (= "=") (call_expression "clock()" (identifier "clock") (argument_list "()" (( "(") () ")")))) (, ",") (binary_expression "cVar3 == cVar4" (identifier "cVar3") (== "==") (identifier "cVar4"))) () ")")) (compound_statement "{\n            bVar9 = bVar9 ^ 1;\n          }" ({ "{") (expression_statement "bVar9 = bVar9 ^ 1;" (assignment_expression "bVar9 = bVar9 ^ 1" (identifier "bVar9") (= "=") (binary_expression "bVar9 ^ 1" (identifier "bVar9") (^ "^") (number_literal "1"))) (; ";")) (} "}"))) (} "}")) (while "while") (parenthesized_expression "(bVar8 == bVar9)" (( "(") (binary_expression "bVar8 == bVar9" (identifier "bVar8") (== "==") (identifier "bVar9")) () ")")) (; ";")) (expression_statement "bVar7 = bVar7 * '\x02' | bVar8;" (assignment_expression "bVar7 = bVar7 * '\x02' | bVar8" (identifier "bVar7") (= "=") (binary_expression "bVar7 * '\x02' | bVar8" (binary_expression "bVar7 * '\x02'" (identifier "bVar7") (* "*") (char_literal "'\x02'" (' "'") (escape_sequence "\x02") (' "'"))) (| "|") (identifier "bVar8"))) (; ";")) (expression_statement "local_4c = local_4c + -1;" (assignment_expression "local_4c = local_4c + -1" (identifier "local_4c") (= "=") (binary_expression "local_4c + -1" (identifier "local_4c") (+ "+") (number_literal "-1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(local_4c != 0)" (( "(") (binary_expression "local_4c != 0" (identifier "local_4c") (!= "!=") (number_literal "0")) () ")")) (; ";")) (expression_statement "pbVar5 = pbVar6 + 1;" (assignment_expression "pbVar5 = pbVar6 + 1" (identifier "pbVar5") (= "=") (binary_expression "pbVar6 + 1" (identifier "pbVar6") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "*pbVar6 = bVar7;" (assignment_expression "*pbVar6 = bVar7" (pointer_expression "*pbVar6" (* "*") (identifier "pbVar6")) (= "=") (identifier "bVar7")) (; ";")) (expression_statement "pbVar6 = pbVar5;" (assignment_expression "pbVar6 = pbVar5" (identifier "pbVar6") (= "=") (identifier "pbVar5")) (; ";")) (} "}")) (while "while") (parenthesized_expression "(pbVar5 != param_1 + param_2)" (( "(") (binary_expression "pbVar5 != param_1 + param_2" (identifier "pbVar5") (!= "!=") (binary_expression "param_1 + param_2" (identifier "param_1") (+ "+") (identifier "param_2"))) () ")")) (; ";")) (} "}"))) (return_statement "return (long)(int)param_2;" (return "return") (cast_expression "(long)(int)param_2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (cast_expression "(int)param_2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_2"))) (; ";")) (} "}")))

type_1 function_1(type_2 *var_1,type_1 var_10,type_3 *var_11)

{
  int var_6;
  type_4 *var_4;
  size_t var_9;
  type_5 var_13;
  type_5 var_14;
  type_6 *var_20;
  type_6 *var_19;
  type_6 var_17;
  type_6 var_15;
  type_6 var_16;
  int var_18;
  
  if (var_1 == (type_2 *)0x0) {
                    /* WARNING: Subroutine does not return */
    var_2("out != NULL","src/prngs/rng_get_bytes.c",0x86);
  }
  var_4 = var_3("/dev/urandom","rb");
  if ((var_4 != (type_4 *)0x0) || (var_4 = var_3("/dev/random","rb"), var_4 != (type_4 *)0x0))
  {
    var_6 = var_5(var_4,(char *)0x0,2,0);
    if (var_6 == 0) {
      var_9 = var_7(var_1,1,var_10,var_4);
      var_8(var_4);
      if (var_9 != 0) {
        return var_9;
      }
    }
    else {
      var_8(var_4);
    }
  }
  if (var_10 != 0) {
    var_16 = 0;
    var_15 = 0;
    var_19 = var_1;
    do {
      if (var_11 != (type_3 *)0x0) {
        (*var_11)();
      }
      var_18 = 8;
      var_17 = 0;
      do {
        do {
          var_13 = var_12();
          while (var_14 = var_12(), var_13 == var_14) {
            var_15 = var_15 ^ 1;
          }
          var_13 = var_12();
          while (var_14 = var_12(), var_13 == var_14) {
            var_16 = var_16 ^ 1;
          }
        } while (var_15 == var_16);
        var_17 = var_17 * '\x02' | var_15;
        var_18 = var_18 + -1;
      } while (var_18 != 0);
      var_20 = var_19 + 1;
      *var_19 = var_17;
      var_19 = var_20;
    } while (var_20 != var_1 + var_10);
  }
  return (long)(int)var_10;
}


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

size_t MASKED(byte *param_1,size_t param_2,code *param_3)

{
  int iVar1;
  FILE *__stream;
  size_t sVar2;
  clock_t cVar3;
  clock_t cVar4;
  byte *pbVar5;
  byte *pbVar6;
  byte bVar7;
  byte bVar8;
  byte bVar9;
  int local_4c;
  
  if (param_1 == (byte *)0x0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("out != NULL","src/prngs/MASKED.c",0x86);
  }
  __stream = fopen("/dev/urandom","rb");
  if ((__stream != (FILE *)0x0) || (__stream = fopen("/dev/random","rb"), __stream != (FILE *)0x0))
  {
    iVar1 = setvbuf(__stream,(char *)0x0,2,0);
    if (iVar1 == 0) {
      sVar2 = fread(param_1,1,param_2,__stream);
      fclose(__stream);
      if (sVar2 != 0) {
        return sVar2;
      }
    }
    else {
      fclose(__stream);
    }
  }
  if (param_2 != 0) {
    bVar9 = 0;
    bVar8 = 0;
    pbVar6 = param_1;
    do {
      if (param_3 != (code *)0x0) {
        (*param_3)();
      }
      local_4c = 8;
      bVar7 = 0;
      do {
        do {
          cVar3 = clock();
          while (cVar4 = clock(), cVar3 == cVar4) {
            bVar8 = bVar8 ^ 1;
          }
          cVar3 = clock();
          while (cVar4 = clock(), cVar3 == cVar4) {
            bVar9 = bVar9 ^ 1;
          }
        } while (bVar8 == bVar9);
        bVar7 = bVar7 * '\x02' | bVar8;
        local_4c = local_4c + -1;
      } while (local_4c != 0);
      pbVar5 = pbVar6 + 1;
      *pbVar6 = bVar7;
      pbVar6 = pbVar5;
    } while (pbVar5 != param_1 + param_2);
  }
  return (long)(int)param_2;
}

