
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

Bignum_conflict bignum_random_in_range(Bignum_conflict lower,Bignum_conflict upper)

{
  int iVar1;
  uchar *data;
  size_t sVar2;
  Bignum_conflict a;
  int iVar3;
  uchar *puVar4;
  uchar *puVar5;
  size_t n;
  byte local_20;
  
  iVar1 = *upper * 0x20;
  iVar3 = iVar1 + -1;
  if ((-1 < iVar3) && (-1 < (int)upper[(iVar3 >> 5) + 1])) {
    do {
      iVar1 = iVar3;
      iVar3 = iVar1 + -1;
      if (iVar3 == -1) break;
    } while (upper[(iVar3 >> 5) + 1] >> ((byte)iVar3 & 0x1f) == 0);
  }
  iVar3 = iVar1 + 7;
  if (-1 < iVar1) {
    iVar3 = iVar1;
  }
  iVar1 = iVar1 % 8;
  n = ((iVar3 >> 3) + 1) - (uint)(iVar1 == 0);
  data = (uchar *)safemalloc(n,1);
  sVar2 = 0;
  if (-1 < (int)n) {
    sVar2 = n;
  }
  while( true ) {
    puVar4 = data;
    if (0 < (int)n) {
      do {
        iVar3 = random_byte();
        puVar5 = puVar4 + 1;
        *puVar4 = (uchar)iVar3;
        puVar4 = puVar5;
      } while (data + n != puVar5);
    }
    if (iVar1 != 0) {
      local_20 = (byte)(0xff >> (8U - (char)iVar1 & 0x1f));
      data[sVar2 - 1] = data[sVar2 - 1] & local_20;
    }
    a = bignum_from_bytes(data,n);
    iVar3 = bignum_cmp(a,lower);
    if ((-1 < iVar3) && (iVar3 = bignum_cmp(a,upper), iVar3 < 1)) break;
    if (a != (Bignum_conflict)0x0) {
      freebn(a);
    }
  }
  smemclr(data,n);
  safefree(data);
  return a;
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

int FUN_000461c0(undefined4 param_1,int *param_2)

{
  undefined1 uVar1;
  int iVar2;
  undefined1 *puVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined1 *puVar7;
  undefined1 *puVar8;
  int iVar9;
  byte local_20;
  
  iVar2 = *param_2 * 0x20;
  iVar6 = iVar2 + -1;
  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {
    do {
      iVar2 = iVar6;
      iVar6 = iVar2 + -1;
      if (iVar6 == -1) break;
    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);
  }
  iVar6 = iVar2 + 7;
  if (-1 < iVar2) {
    iVar6 = iVar2;
  }
  iVar2 = iVar2 % 8;
  iVar9 = ((iVar6 >> 3) + 1) - (uint)(iVar2 == 0);
  puVar3 = (undefined1 *)FUN_0001a9c0(iVar9,1);
  iVar6 = 0;
  if (-1 < iVar9) {
    iVar6 = iVar9;
  }
  while( true ) {
    puVar7 = puVar3;
    if (0 < iVar9) {
      do {
        uVar1 = FUN_00057c60();
        puVar8 = puVar7 + 1;
        *puVar7 = uVar1;
        puVar7 = puVar8;
      } while (puVar3 + iVar9 != puVar8);
    }
    if (iVar2 != 0) {
      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));
      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;
    }
    iVar4 = FUN_00045bd0(puVar3,iVar9);
    iVar5 = FUN_000460c0(iVar4,param_1);
    if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;
    if (iVar4 != 0) {
      FUN_00045740(iVar4);
    }
  }
  FUN_0001b330(puVar3,iVar9);
  FUN_0001b250(puVar3);
  return iVar4;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00014980
ADD EBX,0x62ba7
SUB ESP,0x1c
MOV EAX,dword ptr [ESP + 0x34]
MOV EAX,dword ptr [EAX]
MOV dword ptr [ESP],EAX
SHL EAX,0x5
MOV EDX,EAX
SUB EDX,0x1
JS 0x0004631a
MOV ECX,EDX
MOV EDI,dword ptr [ESP + 0x34]
SAR ECX,0x5
MOV ESI,dword ptr [EDI + ECX*0x4 + 0x4]
TEST ESI,ESI
JS 0x0004631a
MOV ESI,dword ptr [ESP + 0x34]
JMP 0x00046219
MOV EAX,ECX
SAR EAX,0x5
MOV EAX,dword ptr [ESI + EAX*0x4 + 0x4]
SHR EAX,CL
TEST EAX,EAX
JNZ 0x00046221
MOV EDX,ECX
LEA ECX,[EDX + -0x1]
CMP ECX,-0x1
JNZ 0x00046208
TEST EDX,EDX
LEA EDI,[EDX + 0x7]
MOV EAX,EDX
CMOVNS EDI,EDX
SAR EAX,0x1f
SHR EAX,0x1d
ADD EDX,EAX
SAR EDI,0x3
AND EDX,0x7
SUB EDX,EAX
CMP EDX,0x1
MOV dword ptr [ESP + 0x4],EDX
MOV ESI,EDX
SBB EDI,-0x1
SUB ESP,0x8
PUSH 0x1
PUSH EDI
CALL 0x0001a9c0
MOV ECX,0x8
MOV EDX,EAX
MOV dword ptr [ESP + 0x10],EAX
SUB ECX,ESI
MOV EAX,0xff
SAR EAX,CL
LEA ESI,[EDX + EDI*0x1]
MOV dword ptr [ESP + 0x1c],EAX
ADD ESP,0x10
MOV EAX,0x0
TEST EDI,EDI
CMOVNS EAX,EDI
LEA EAX,[EDX + EAX*0x1 + -0x1]
MOV dword ptr [ESP + 0x8],EAX
LEA ESI,[ESI]
TEST EDI,EDI
JLE 0x0004629f
MOV EBP,dword ptr [ESP]
NOP
CALL 0x00057c60
ADD EBP,0x1
MOV byte ptr [EBP + -0x1],AL
CMP ESI,EBP
JNZ 0x00046290
MOV ECX,dword ptr [ESP + 0x4]
TEST ECX,ECX
JZ 0x000462b2
MOV EDX,dword ptr [ESP + 0x8]
MOVZX EAX,byte ptr [ESP + 0xc]
AND byte ptr [EDX],AL
SUB ESP,0x8
PUSH EDI
PUSH dword ptr [ESP + 0xc]
CALL 0x00045bd0
MOV EBP,EAX
POP EAX
POP EDX
PUSH dword ptr [ESP + 0x38]
PUSH EBP
CALL 0x000460c0
ADD ESP,0x10
TEST EAX,EAX
JS 0x000462e8
SUB ESP,0x8
PUSH dword ptr [ESP + 0x3c]
PUSH EBP
CALL 0x000460c0
ADD ESP,0x10
TEST EAX,EAX
JLE 0x000462fa
TEST EBP,EBP
JZ 0x00046288
SUB ESP,0xc
PUSH EBP
CALL 0x00045740
ADD ESP,0x10
JMP 0x00046288
SUB ESP,0x8
PUSH EDI
MOV EDI,dword ptr [ESP + 0xc]
PUSH EDI
CALL 0x0001b330
MOV dword ptr [ESP],EDI
CALL 0x0001b250
ADD ESP,0x2c
MOV EAX,EBP
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EDX,EAX
JMP 0x00046221
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint FUN_000461c0(undefined4 param_1,int *param_2)\n\n{\n  undefined1 uVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  undefined1 *puVar7;\n  undefined1 *puVar8;\n  int iVar9;\n  byte local_20;\n  \n  iVar2 = *param_2 * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  iVar6 = iVar2 + 7;\n  if (-1 < iVar2) {\n    iVar6 = iVar2;\n  }\n  iVar2 = iVar2 % 8;\n  iVar9 = ((iVar6 >> 3) + 1) - (uint)(iVar2 == 0);\n  puVar3 = (undefined1 *)FUN_0001a9c0(iVar9,1);\n  iVar6 = 0;\n  if (-1 < iVar9) {\n    iVar6 = iVar9;\n  }\n  while( true ) {\n    puVar7 = puVar3;\n    if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }\n    if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }\n    iVar4 = FUN_00045bd0(puVar3,iVar9);\n    iVar5 = FUN_000460c0(iVar4,param_1);\n    if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;\n    if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }\n  }\n  FUN_0001b330(puVar3,iVar9);\n  FUN_0001b250(puVar3);\n  return iVar4;\n}\n\n" comment (function_definition "int FUN_000461c0(undefined4 param_1,int *param_2)\n\n{\n  undefined1 uVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  undefined1 *puVar7;\n  undefined1 *puVar8;\n  int iVar9;\n  byte local_20;\n  \n  iVar2 = *param_2 * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  iVar6 = iVar2 + 7;\n  if (-1 < iVar2) {\n    iVar6 = iVar2;\n  }\n  iVar2 = iVar2 % 8;\n  iVar9 = ((iVar6 >> 3) + 1) - (uint)(iVar2 == 0);\n  puVar3 = (undefined1 *)FUN_0001a9c0(iVar9,1);\n  iVar6 = 0;\n  if (-1 < iVar9) {\n    iVar6 = iVar9;\n  }\n  while( true ) {\n    puVar7 = puVar3;\n    if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }\n    if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }\n    iVar4 = FUN_00045bd0(puVar3,iVar9);\n    iVar5 = FUN_000460c0(iVar4,param_1);\n    if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;\n    if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }\n  }\n  FUN_0001b330(puVar3,iVar9);\n  FUN_0001b250(puVar3);\n  return iVar4;\n}" primitive_type (function_declarator "FUN_000461c0(undefined4 param_1,int *param_2)" identifier (parameter_list "(undefined4 param_1,int *param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  undefined1 uVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  undefined1 *puVar7;\n  undefined1 *puVar8;\n  int iVar9;\n  byte local_20;\n  \n  iVar2 = *param_2 * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  iVar6 = iVar2 + 7;\n  if (-1 < iVar2) {\n    iVar6 = iVar2;\n  }\n  iVar2 = iVar2 % 8;\n  iVar9 = ((iVar6 >> 3) + 1) - (uint)(iVar2 == 0);\n  puVar3 = (undefined1 *)FUN_0001a9c0(iVar9,1);\n  iVar6 = 0;\n  if (-1 < iVar9) {\n    iVar6 = iVar9;\n  }\n  while( true ) {\n    puVar7 = puVar3;\n    if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }\n    if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }\n    iVar4 = FUN_00045bd0(puVar3,iVar9);\n    iVar5 = FUN_000460c0(iVar4,param_1);\n    if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;\n    if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }\n  }\n  FUN_0001b330(puVar3,iVar9);\n  FUN_0001b250(puVar3);\n  return iVar4;\n}" { (declaration "undefined1 uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined1 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "undefined1 *puVar7;" type_identifier (pointer_declarator "*puVar7" * identifier) ;) (declaration "undefined1 *puVar8;" type_identifier (pointer_declarator "*puVar8" * identifier) ;) (declaration "int iVar9;" primitive_type identifier ;) (declaration "byte local_20;" type_identifier identifier ;) (expression_statement "iVar2 = *param_2 * 0x20;" (assignment_expression "iVar2 = *param_2 * 0x20" identifier = (binary_expression "*param_2 * 0x20" (pointer_expression "*param_2" * identifier) * number_literal)) ;) (expression_statement "iVar6 = iVar2 + -1;" (assignment_expression "iVar6 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (if_statement "if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }" if (parenthesized_expression "((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1]))" ( (binary_expression "(-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])" (parenthesized_expression "(-1 < iVar6)" ( (binary_expression "-1 < iVar6" number_literal < identifier) )) && (parenthesized_expression "(-1 < param_2[(iVar6 >> 5) + 1])" ( (binary_expression "-1 < param_2[(iVar6 >> 5) + 1]" number_literal < (subscript_expression "param_2[(iVar6 >> 5) + 1]" identifier [ (binary_expression "(iVar6 >> 5) + 1" (parenthesized_expression "(iVar6 >> 5)" ( (binary_expression "iVar6 >> 5" identifier >> number_literal) )) + number_literal) ])) ))) )) (compound_statement "{\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }" { (do_statement "do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);" do (compound_statement "{\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    }" { (expression_statement "iVar2 = iVar6;" (assignment_expression "iVar2 = iVar6" identifier = identifier) ;) (expression_statement "iVar6 = iVar2 + -1;" (assignment_expression "iVar6 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (if_statement "if (iVar6 == -1) break;" if (parenthesized_expression "(iVar6 == -1)" ( (binary_expression "iVar6 == -1" identifier == number_literal) )) (break_statement "break;" break ;)) }) while (parenthesized_expression "((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0)" ( (binary_expression "(uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0" (binary_expression "(uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f)" (cast_expression "(uint)param_2[(iVar6 >> 5) + 1]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_2[(iVar6 >> 5) + 1]" identifier [ (binary_expression "(iVar6 >> 5) + 1" (parenthesized_expression "(iVar6 >> 5)" ( (binary_expression "iVar6 >> 5" identifier >> number_literal) )) + number_literal) ])) >> (parenthesized_expression "((byte)iVar6 & 0x1f)" ( (binary_expression "(byte)iVar6 & 0x1f" (cast_expression "(byte)iVar6" ( (type_descriptor "byte" type_identifier) ) identifier) & number_literal) ))) == number_literal) )) ;) })) (expression_statement "iVar6 = iVar2 + 7;" (assignment_expression "iVar6 = iVar2 + 7" identifier = (binary_expression "iVar2 + 7" identifier + number_literal)) ;) (if_statement "if (-1 < iVar2) {\n    iVar6 = iVar2;\n  }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n    iVar6 = iVar2;\n  }" { (expression_statement "iVar6 = iVar2;" (assignment_expression "iVar6 = iVar2" identifier = identifier) ;) })) (expression_statement "iVar2 = iVar2 % 8;" (assignment_expression "iVar2 = iVar2 % 8" identifier = (binary_expression "iVar2 % 8" identifier % number_literal)) ;) (expression_statement "iVar9 = ((iVar6 >> 3) + 1) - (uint)(iVar2 == 0);" (assignment_expression "iVar9 = ((iVar6 >> 3) + 1) - (uint)(iVar2 == 0)" identifier = (binary_expression "((iVar6 >> 3) + 1) - (uint)(iVar2 == 0)" (parenthesized_expression "((iVar6 >> 3) + 1)" ( (binary_expression "(iVar6 >> 3) + 1" (parenthesized_expression "(iVar6 >> 3)" ( (binary_expression "iVar6 >> 3" identifier >> number_literal) )) + number_literal) )) - (call_expression "(uint)(iVar2 == 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) ))))) ;) (expression_statement "puVar3 = (undefined1 *)FUN_0001a9c0(iVar9,1);" (assignment_expression "puVar3 = (undefined1 *)FUN_0001a9c0(iVar9,1)" identifier = (cast_expression "(undefined1 *)FUN_0001a9c0(iVar9,1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001a9c0(iVar9,1)" identifier (argument_list "(iVar9,1)" ( identifier , number_literal ))))) ;) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) (if_statement "if (-1 < iVar9) {\n    iVar6 = iVar9;\n  }" if (parenthesized_expression "(-1 < iVar9)" ( (binary_expression "-1 < iVar9" number_literal < identifier) )) (compound_statement "{\n    iVar6 = iVar9;\n  }" { (expression_statement "iVar6 = iVar9;" (assignment_expression "iVar6 = iVar9" identifier = identifier) ;) })) (while_statement "while( true ) {\n    puVar7 = puVar3;\n    if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }\n    if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }\n    iVar4 = FUN_00045bd0(puVar3,iVar9);\n    iVar5 = FUN_000460c0(iVar4,param_1);\n    if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;\n    if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    puVar7 = puVar3;\n    if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }\n    if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }\n    iVar4 = FUN_00045bd0(puVar3,iVar9);\n    iVar5 = FUN_000460c0(iVar4,param_1);\n    if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;\n    if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }\n  }" { (expression_statement "puVar7 = puVar3;" (assignment_expression "puVar7 = puVar3" identifier = identifier) ;) (if_statement "if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }" if (parenthesized_expression "(0 < iVar9)" ( (binary_expression "0 < iVar9" number_literal < identifier) )) (compound_statement "{\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }" { (do_statement "do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);" do (compound_statement "{\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      }" { (expression_statement "uVar1 = FUN_00057c60();" (assignment_expression "uVar1 = FUN_00057c60()" identifier = (call_expression "FUN_00057c60()" identifier (argument_list "()" ( )))) ;) (expression_statement "puVar8 = puVar7 + 1;" (assignment_expression "puVar8 = puVar7 + 1" identifier = (binary_expression "puVar7 + 1" identifier + number_literal)) ;) (expression_statement "*puVar7 = uVar1;" (assignment_expression "*puVar7 = uVar1" (pointer_expression "*puVar7" * identifier) = identifier) ;) (expression_statement "puVar7 = puVar8;" (assignment_expression "puVar7 = puVar8" identifier = identifier) ;) }) while (parenthesized_expression "(puVar3 + iVar9 != puVar8)" ( (binary_expression "puVar3 + iVar9 != puVar8" (binary_expression "puVar3 + iVar9" identifier + identifier) != identifier) )) ;) })) (if_statement "if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }" { (expression_statement "local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));" (assignment_expression "local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f))" identifier = (call_expression "(byte)(0xff >> (8U - (char)iVar2 & 0x1f))" (parenthesized_expression "(byte)" ( identifier )) (argument_list "(0xff >> (8U - (char)iVar2 & 0x1f))" ( (binary_expression "0xff >> (8U - (char)iVar2 & 0x1f)" number_literal >> (parenthesized_expression "(8U - (char)iVar2 & 0x1f)" ( (binary_expression "8U - (char)iVar2 & 0x1f" (binary_expression "8U - (char)iVar2" number_literal - (cast_expression "(char)iVar2" ( (type_descriptor "char" primitive_type) ) identifier)) & number_literal) ))) )))) ;) (expression_statement "puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;" (assignment_expression "puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20" (subscript_expression "puVar3[iVar6 + -1]" identifier [ (binary_expression "iVar6 + -1" identifier + number_literal) ]) = (binary_expression "puVar3[iVar6 + -1] & local_20" (subscript_expression "puVar3[iVar6 + -1]" identifier [ (binary_expression "iVar6 + -1" identifier + number_literal) ]) & identifier)) ;) })) (expression_statement "iVar4 = FUN_00045bd0(puVar3,iVar9);" (assignment_expression "iVar4 = FUN_00045bd0(puVar3,iVar9)" identifier = (call_expression "FUN_00045bd0(puVar3,iVar9)" identifier (argument_list "(puVar3,iVar9)" ( identifier , identifier )))) ;) (expression_statement "iVar5 = FUN_000460c0(iVar4,param_1);" (assignment_expression "iVar5 = FUN_000460c0(iVar4,param_1)" identifier = (call_expression "FUN_000460c0(iVar4,param_1)" identifier (argument_list "(iVar4,param_1)" ( identifier , identifier )))) ;) (if_statement "if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;" if (parenthesized_expression "((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1))" ( (binary_expression "(-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)" (parenthesized_expression "(-1 < iVar5)" ( (binary_expression "-1 < iVar5" number_literal < identifier) )) && (parenthesized_expression "(iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)" ( (comma_expression "iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1" (assignment_expression "iVar5 = FUN_000460c0(iVar4,param_2)" identifier = (call_expression "FUN_000460c0(iVar4,param_2)" identifier (argument_list "(iVar4,param_2)" ( identifier , identifier )))) , (binary_expression "iVar5 < 1" identifier < number_literal)) ))) )) (break_statement "break;" break ;)) (if_statement "if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }" if (parenthesized_expression "(iVar4 != 0)" ( (binary_expression "iVar4 != 0" identifier != number_literal) )) (compound_statement "{\n      FUN_00045740(iVar4);\n    }" { (expression_statement "FUN_00045740(iVar4);" (call_expression "FUN_00045740(iVar4)" identifier (argument_list "(iVar4)" ( identifier ))) ;) })) })) (expression_statement "FUN_0001b330(puVar3,iVar9);" (call_expression "FUN_0001b330(puVar3,iVar9)" identifier (argument_list "(puVar3,iVar9)" ( identifier , identifier ))) ;) (expression_statement "FUN_0001b250(puVar3);" (call_expression "FUN_0001b250(puVar3)" identifier (argument_list "(puVar3)" ( identifier ))) ;) (return_statement "return iVar4;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nBignum_conflict bignum_random_in_range(Bignum_conflict lower,Bignum_conflict upper)\n\n{\n  int iVar1;\n  uchar *data;\n  size_t sVar2;\n  Bignum_conflict a;\n  int iVar3;\n  uchar *puVar4;\n  uchar *puVar5;\n  size_t n;\n  byte local_20;\n  \n  iVar1 = *upper * 0x20;\n  iVar3 = iVar1 + -1;\n  if ((-1 < iVar3) && (-1 < (int)upper[(iVar3 >> 5) + 1])) {\n    do {\n      iVar1 = iVar3;\n      iVar3 = iVar1 + -1;\n      if (iVar3 == -1) break;\n    } while (upper[(iVar3 >> 5) + 1] >> ((byte)iVar3 & 0x1f) == 0);\n  }\n  iVar3 = iVar1 + 7;\n  if (-1 < iVar1) {\n    iVar3 = iVar1;\n  }\n  iVar1 = iVar1 % 8;\n  n = ((iVar3 >> 3) + 1) - (uint)(iVar1 == 0);\n  data = (uchar *)safemalloc(n,1);\n  sVar2 = 0;\n  if (-1 < (int)n) {\n    sVar2 = n;\n  }\n  while( true ) {\n    puVar4 = data;\n    if (0 < (int)n) {\n      do {\n        iVar3 = random_byte();\n        puVar5 = puVar4 + 1;\n        *puVar4 = (uchar)iVar3;\n        puVar4 = puVar5;\n      } while (data + n != puVar5);\n    }\n    if (iVar1 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar1 & 0x1f));\n      data[sVar2 - 1] = data[sVar2 - 1] & local_20;\n    }\n    a = bignum_from_bytes(data,n);\n    iVar3 = bignum_cmp(a,lower);\n    if ((-1 < iVar3) && (iVar3 = bignum_cmp(a,upper), iVar3 < 1)) break;\n    if (a != (Bignum_conflict)0x0) {\n      freebn(a);\n    }\n  }\n  smemclr(data,n);\n  safefree(data);\n  return a;\n}\n\n" comment comment (function_definition "Bignum_conflict bignum_random_in_range(Bignum_conflict lower,Bignum_conflict upper)\n\n{\n  int iVar1;\n  uchar *data;\n  size_t sVar2;\n  Bignum_conflict a;\n  int iVar3;\n  uchar *puVar4;\n  uchar *puVar5;\n  size_t n;\n  byte local_20;\n  \n  iVar1 = *upper * 0x20;\n  iVar3 = iVar1 + -1;\n  if ((-1 < iVar3) && (-1 < (int)upper[(iVar3 >> 5) + 1])) {\n    do {\n      iVar1 = iVar3;\n      iVar3 = iVar1 + -1;\n      if (iVar3 == -1) break;\n    } while (upper[(iVar3 >> 5) + 1] >> ((byte)iVar3 & 0x1f) == 0);\n  }\n  iVar3 = iVar1 + 7;\n  if (-1 < iVar1) {\n    iVar3 = iVar1;\n  }\n  iVar1 = iVar1 % 8;\n  n = ((iVar3 >> 3) + 1) - (uint)(iVar1 == 0);\n  data = (uchar *)safemalloc(n,1);\n  sVar2 = 0;\n  if (-1 < (int)n) {\n    sVar2 = n;\n  }\n  while( true ) {\n    puVar4 = data;\n    if (0 < (int)n) {\n      do {\n        iVar3 = random_byte();\n        puVar5 = puVar4 + 1;\n        *puVar4 = (uchar)iVar3;\n        puVar4 = puVar5;\n      } while (data + n != puVar5);\n    }\n    if (iVar1 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar1 & 0x1f));\n      data[sVar2 - 1] = data[sVar2 - 1] & local_20;\n    }\n    a = bignum_from_bytes(data,n);\n    iVar3 = bignum_cmp(a,lower);\n    if ((-1 < iVar3) && (iVar3 = bignum_cmp(a,upper), iVar3 < 1)) break;\n    if (a != (Bignum_conflict)0x0) {\n      freebn(a);\n    }\n  }\n  smemclr(data,n);\n  safefree(data);\n  return a;\n}" type_identifier (function_declarator "bignum_random_in_range(Bignum_conflict lower,Bignum_conflict upper)" identifier (parameter_list "(Bignum_conflict lower,Bignum_conflict upper)" ( (parameter_declaration "Bignum_conflict lower" type_identifier identifier) , (parameter_declaration "Bignum_conflict upper" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  uchar *data;\n  size_t sVar2;\n  Bignum_conflict a;\n  int iVar3;\n  uchar *puVar4;\n  uchar *puVar5;\n  size_t n;\n  byte local_20;\n  \n  iVar1 = *upper * 0x20;\n  iVar3 = iVar1 + -1;\n  if ((-1 < iVar3) && (-1 < (int)upper[(iVar3 >> 5) + 1])) {\n    do {\n      iVar1 = iVar3;\n      iVar3 = iVar1 + -1;\n      if (iVar3 == -1) break;\n    } while (upper[(iVar3 >> 5) + 1] >> ((byte)iVar3 & 0x1f) == 0);\n  }\n  iVar3 = iVar1 + 7;\n  if (-1 < iVar1) {\n    iVar3 = iVar1;\n  }\n  iVar1 = iVar1 % 8;\n  n = ((iVar3 >> 3) + 1) - (uint)(iVar1 == 0);\n  data = (uchar *)safemalloc(n,1);\n  sVar2 = 0;\n  if (-1 < (int)n) {\n    sVar2 = n;\n  }\n  while( true ) {\n    puVar4 = data;\n    if (0 < (int)n) {\n      do {\n        iVar3 = random_byte();\n        puVar5 = puVar4 + 1;\n        *puVar4 = (uchar)iVar3;\n        puVar4 = puVar5;\n      } while (data + n != puVar5);\n    }\n    if (iVar1 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar1 & 0x1f));\n      data[sVar2 - 1] = data[sVar2 - 1] & local_20;\n    }\n    a = bignum_from_bytes(data,n);\n    iVar3 = bignum_cmp(a,lower);\n    if ((-1 < iVar3) && (iVar3 = bignum_cmp(a,upper), iVar3 < 1)) break;\n    if (a != (Bignum_conflict)0x0) {\n      freebn(a);\n    }\n  }\n  smemclr(data,n);\n  safefree(data);\n  return a;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uchar *data;" type_identifier (pointer_declarator "*data" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "Bignum_conflict a;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "uchar *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "uchar *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "size_t n;" primitive_type identifier ;) (declaration "byte local_20;" type_identifier identifier ;) (expression_statement "iVar1 = *upper * 0x20;" (assignment_expression "iVar1 = *upper * 0x20" identifier = (binary_expression "*upper * 0x20" (pointer_expression "*upper" * identifier) * number_literal)) ;) (expression_statement "iVar3 = iVar1 + -1;" (assignment_expression "iVar3 = iVar1 + -1" identifier = (binary_expression "iVar1 + -1" identifier + number_literal)) ;) (if_statement "if ((-1 < iVar3) && (-1 < (int)upper[(iVar3 >> 5) + 1])) {\n    do {\n      iVar1 = iVar3;\n      iVar3 = iVar1 + -1;\n      if (iVar3 == -1) break;\n    } while (upper[(iVar3 >> 5) + 1] >> ((byte)iVar3 & 0x1f) == 0);\n  }" if (parenthesized_expression "((-1 < iVar3) && (-1 < (int)upper[(iVar3 >> 5) + 1]))" ( (binary_expression "(-1 < iVar3) && (-1 < (int)upper[(iVar3 >> 5) + 1])" (parenthesized_expression "(-1 < iVar3)" ( (binary_expression "-1 < iVar3" number_literal < identifier) )) && (parenthesized_expression "(-1 < (int)upper[(iVar3 >> 5) + 1])" ( (binary_expression "-1 < (int)upper[(iVar3 >> 5) + 1]" number_literal < (cast_expression "(int)upper[(iVar3 >> 5) + 1]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "upper[(iVar3 >> 5) + 1]" identifier [ (binary_expression "(iVar3 >> 5) + 1" (parenthesized_expression "(iVar3 >> 5)" ( (binary_expression "iVar3 >> 5" identifier >> number_literal) )) + number_literal) ]))) ))) )) (compound_statement "{\n    do {\n      iVar1 = iVar3;\n      iVar3 = iVar1 + -1;\n      if (iVar3 == -1) break;\n    } while (upper[(iVar3 >> 5) + 1] >> ((byte)iVar3 & 0x1f) == 0);\n  }" { (do_statement "do {\n      iVar1 = iVar3;\n      iVar3 = iVar1 + -1;\n      if (iVar3 == -1) break;\n    } while (upper[(iVar3 >> 5) + 1] >> ((byte)iVar3 & 0x1f) == 0);" do (compound_statement "{\n      iVar1 = iVar3;\n      iVar3 = iVar1 + -1;\n      if (iVar3 == -1) break;\n    }" { (expression_statement "iVar1 = iVar3;" (assignment_expression "iVar1 = iVar3" identifier = identifier) ;) (expression_statement "iVar3 = iVar1 + -1;" (assignment_expression "iVar3 = iVar1 + -1" identifier = (binary_expression "iVar1 + -1" identifier + number_literal)) ;) (if_statement "if (iVar3 == -1) break;" if (parenthesized_expression "(iVar3 == -1)" ( (binary_expression "iVar3 == -1" identifier == number_literal) )) (break_statement "break;" break ;)) }) while (parenthesized_expression "(upper[(iVar3 >> 5) + 1] >> ((byte)iVar3 & 0x1f) == 0)" ( (binary_expression "upper[(iVar3 >> 5) + 1] >> ((byte)iVar3 & 0x1f) == 0" (binary_expression "upper[(iVar3 >> 5) + 1] >> ((byte)iVar3 & 0x1f)" (subscript_expression "upper[(iVar3 >> 5) + 1]" identifier [ (binary_expression "(iVar3 >> 5) + 1" (parenthesized_expression "(iVar3 >> 5)" ( (binary_expression "iVar3 >> 5" identifier >> number_literal) )) + number_literal) ]) >> (parenthesized_expression "((byte)iVar3 & 0x1f)" ( (binary_expression "(byte)iVar3 & 0x1f" (cast_expression "(byte)iVar3" ( (type_descriptor "byte" type_identifier) ) identifier) & number_literal) ))) == number_literal) )) ;) })) (expression_statement "iVar3 = iVar1 + 7;" (assignment_expression "iVar3 = iVar1 + 7" identifier = (binary_expression "iVar1 + 7" identifier + number_literal)) ;) (if_statement "if (-1 < iVar1) {\n    iVar3 = iVar1;\n  }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n    iVar3 = iVar1;\n  }" { (expression_statement "iVar3 = iVar1;" (assignment_expression "iVar3 = iVar1" identifier = identifier) ;) })) (expression_statement "iVar1 = iVar1 % 8;" (assignment_expression "iVar1 = iVar1 % 8" identifier = (binary_expression "iVar1 % 8" identifier % number_literal)) ;) (expression_statement "n = ((iVar3 >> 3) + 1) - (uint)(iVar1 == 0);" (assignment_expression "n = ((iVar3 >> 3) + 1) - (uint)(iVar1 == 0)" identifier = (binary_expression "((iVar3 >> 3) + 1) - (uint)(iVar1 == 0)" (parenthesized_expression "((iVar3 >> 3) + 1)" ( (binary_expression "(iVar3 >> 3) + 1" (parenthesized_expression "(iVar3 >> 3)" ( (binary_expression "iVar3 >> 3" identifier >> number_literal) )) + number_literal) )) - (call_expression "(uint)(iVar1 == 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) ))))) ;) (expression_statement "data = (uchar *)safemalloc(n,1);" (assignment_expression "data = (uchar *)safemalloc(n,1)" identifier = (cast_expression "(uchar *)safemalloc(n,1)" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc(n,1)" identifier (argument_list "(n,1)" ( identifier , number_literal ))))) ;) (expression_statement "sVar2 = 0;" (assignment_expression "sVar2 = 0" identifier = number_literal) ;) (if_statement "if (-1 < (int)n) {\n    sVar2 = n;\n  }" if (parenthesized_expression "(-1 < (int)n)" ( (binary_expression "-1 < (int)n" number_literal < (cast_expression "(int)n" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n    sVar2 = n;\n  }" { (expression_statement "sVar2 = n;" (assignment_expression "sVar2 = n" identifier = identifier) ;) })) (while_statement "while( true ) {\n    puVar4 = data;\n    if (0 < (int)n) {\n      do {\n        iVar3 = random_byte();\n        puVar5 = puVar4 + 1;\n        *puVar4 = (uchar)iVar3;\n        puVar4 = puVar5;\n      } while (data + n != puVar5);\n    }\n    if (iVar1 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar1 & 0x1f));\n      data[sVar2 - 1] = data[sVar2 - 1] & local_20;\n    }\n    a = bignum_from_bytes(data,n);\n    iVar3 = bignum_cmp(a,lower);\n    if ((-1 < iVar3) && (iVar3 = bignum_cmp(a,upper), iVar3 < 1)) break;\n    if (a != (Bignum_conflict)0x0) {\n      freebn(a);\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    puVar4 = data;\n    if (0 < (int)n) {\n      do {\n        iVar3 = random_byte();\n        puVar5 = puVar4 + 1;\n        *puVar4 = (uchar)iVar3;\n        puVar4 = puVar5;\n      } while (data + n != puVar5);\n    }\n    if (iVar1 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar1 & 0x1f));\n      data[sVar2 - 1] = data[sVar2 - 1] & local_20;\n    }\n    a = bignum_from_bytes(data,n);\n    iVar3 = bignum_cmp(a,lower);\n    if ((-1 < iVar3) && (iVar3 = bignum_cmp(a,upper), iVar3 < 1)) break;\n    if (a != (Bignum_conflict)0x0) {\n      freebn(a);\n    }\n  }" { (expression_statement "puVar4 = data;" (assignment_expression "puVar4 = data" identifier = identifier) ;) (if_statement "if (0 < (int)n) {\n      do {\n        iVar3 = random_byte();\n        puVar5 = puVar4 + 1;\n        *puVar4 = (uchar)iVar3;\n        puVar4 = puVar5;\n      } while (data + n != puVar5);\n    }" if (parenthesized_expression "(0 < (int)n)" ( (binary_expression "0 < (int)n" number_literal < (cast_expression "(int)n" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n      do {\n        iVar3 = random_byte();\n        puVar5 = puVar4 + 1;\n        *puVar4 = (uchar)iVar3;\n        puVar4 = puVar5;\n      } while (data + n != puVar5);\n    }" { (do_statement "do {\n        iVar3 = random_byte();\n        puVar5 = puVar4 + 1;\n        *puVar4 = (uchar)iVar3;\n        puVar4 = puVar5;\n      } while (data + n != puVar5);" do (compound_statement "{\n        iVar3 = random_byte();\n        puVar5 = puVar4 + 1;\n        *puVar4 = (uchar)iVar3;\n        puVar4 = puVar5;\n      }" { (expression_statement "iVar3 = random_byte();" (assignment_expression "iVar3 = random_byte()" identifier = (call_expression "random_byte()" identifier (argument_list "()" ( )))) ;) (expression_statement "puVar5 = puVar4 + 1;" (assignment_expression "puVar5 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (expression_statement "*puVar4 = (uchar)iVar3;" (assignment_expression "*puVar4 = (uchar)iVar3" (pointer_expression "*puVar4" * identifier) = (cast_expression "(uchar)iVar3" ( (type_descriptor "uchar" type_identifier) ) identifier)) ;) (expression_statement "puVar4 = puVar5;" (assignment_expression "puVar4 = puVar5" identifier = identifier) ;) }) while (parenthesized_expression "(data + n != puVar5)" ( (binary_expression "data + n != puVar5" (binary_expression "data + n" identifier + identifier) != identifier) )) ;) })) (if_statement "if (iVar1 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar1 & 0x1f));\n      data[sVar2 - 1] = data[sVar2 - 1] & local_20;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      local_20 = (byte)(0xff >> (8U - (char)iVar1 & 0x1f));\n      data[sVar2 - 1] = data[sVar2 - 1] & local_20;\n    }" { (expression_statement "local_20 = (byte)(0xff >> (8U - (char)iVar1 & 0x1f));" (assignment_expression "local_20 = (byte)(0xff >> (8U - (char)iVar1 & 0x1f))" identifier = (call_expression "(byte)(0xff >> (8U - (char)iVar1 & 0x1f))" (parenthesized_expression "(byte)" ( identifier )) (argument_list "(0xff >> (8U - (char)iVar1 & 0x1f))" ( (binary_expression "0xff >> (8U - (char)iVar1 & 0x1f)" number_literal >> (parenthesized_expression "(8U - (char)iVar1 & 0x1f)" ( (binary_expression "8U - (char)iVar1 & 0x1f" (binary_expression "8U - (char)iVar1" number_literal - (cast_expression "(char)iVar1" ( (type_descriptor "char" primitive_type) ) identifier)) & number_literal) ))) )))) ;) (expression_statement "data[sVar2 - 1] = data[sVar2 - 1] & local_20;" (assignment_expression "data[sVar2 - 1] = data[sVar2 - 1] & local_20" (subscript_expression "data[sVar2 - 1]" identifier [ (binary_expression "sVar2 - 1" identifier - number_literal) ]) = (binary_expression "data[sVar2 - 1] & local_20" (subscript_expression "data[sVar2 - 1]" identifier [ (binary_expression "sVar2 - 1" identifier - number_literal) ]) & identifier)) ;) })) (expression_statement "a = bignum_from_bytes(data,n);" (assignment_expression "a = bignum_from_bytes(data,n)" identifier = (call_expression "bignum_from_bytes(data,n)" identifier (argument_list "(data,n)" ( identifier , identifier )))) ;) (expression_statement "iVar3 = bignum_cmp(a,lower);" (assignment_expression "iVar3 = bignum_cmp(a,lower)" identifier = (call_expression "bignum_cmp(a,lower)" identifier (argument_list "(a,lower)" ( identifier , identifier )))) ;) (if_statement "if ((-1 < iVar3) && (iVar3 = bignum_cmp(a,upper), iVar3 < 1)) break;" if (parenthesized_expression "((-1 < iVar3) && (iVar3 = bignum_cmp(a,upper), iVar3 < 1))" ( (binary_expression "(-1 < iVar3) && (iVar3 = bignum_cmp(a,upper), iVar3 < 1)" (parenthesized_expression "(-1 < iVar3)" ( (binary_expression "-1 < iVar3" number_literal < identifier) )) && (parenthesized_expression "(iVar3 = bignum_cmp(a,upper), iVar3 < 1)" ( (comma_expression "iVar3 = bignum_cmp(a,upper), iVar3 < 1" (assignment_expression "iVar3 = bignum_cmp(a,upper)" identifier = (call_expression "bignum_cmp(a,upper)" identifier (argument_list "(a,upper)" ( identifier , identifier )))) , (binary_expression "iVar3 < 1" identifier < number_literal)) ))) )) (break_statement "break;" break ;)) (if_statement "if (a != (Bignum_conflict)0x0) {\n      freebn(a);\n    }" if (parenthesized_expression "(a != (Bignum_conflict)0x0)" ( (binary_expression "a != (Bignum_conflict)0x0" identifier != (cast_expression "(Bignum_conflict)0x0" ( (type_descriptor "Bignum_conflict" type_identifier) ) number_literal)) )) (compound_statement "{\n      freebn(a);\n    }" { (expression_statement "freebn(a);" (call_expression "freebn(a)" identifier (argument_list "(a)" ( identifier ))) ;) })) })) (expression_statement "smemclr(data,n);" (call_expression "smemclr(data,n)" identifier (argument_list "(data,n)" ( identifier , identifier ))) ;) (expression_statement "safefree(data);" (call_expression "safefree(data)" identifier (argument_list "(data)" ( identifier ))) ;) (return_statement "return a;" return identifier ;) })))
(translation_unit "int FUN_000461c0(undefined4 param_1,int *param_2)\n\n{\n  undefined1 uVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  undefined1 *puVar7;\n  undefined1 *puVar8;\n  int iVar9;\n  byte local_20;\n  \n  iVar2 = *param_2 * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  iVar6 = iVar2 + 7;\n  if (-1 < iVar2) {\n    iVar6 = iVar2;\n  }\n  iVar2 = iVar2 % 8;\n  iVar9 = ((iVar6 >> 3) + 1) - (uint)(iVar2 == 0);\n  puVar3 = (undefined1 *)FUN_0001a9c0(iVar9,1);\n  iVar6 = 0;\n  if (-1 < iVar9) {\n    iVar6 = iVar9;\n  }\n  while( true ) {\n    puVar7 = puVar3;\n    if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }\n    if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }\n    iVar4 = FUN_00045bd0(puVar3,iVar9);\n    iVar5 = FUN_000460c0(iVar4,param_1);\n    if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;\n    if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }\n  }\n  FUN_0001b330(puVar3,iVar9);\n  FUN_0001b250(puVar3);\n  return iVar4;\n}\n\n" (function_definition "int FUN_000461c0(undefined4 param_1,int *param_2)\n\n{\n  undefined1 uVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  undefined1 *puVar7;\n  undefined1 *puVar8;\n  int iVar9;\n  byte local_20;\n  \n  iVar2 = *param_2 * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  iVar6 = iVar2 + 7;\n  if (-1 < iVar2) {\n    iVar6 = iVar2;\n  }\n  iVar2 = iVar2 % 8;\n  iVar9 = ((iVar6 >> 3) + 1) - (uint)(iVar2 == 0);\n  puVar3 = (undefined1 *)FUN_0001a9c0(iVar9,1);\n  iVar6 = 0;\n  if (-1 < iVar9) {\n    iVar6 = iVar9;\n  }\n  while( true ) {\n    puVar7 = puVar3;\n    if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }\n    if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }\n    iVar4 = FUN_00045bd0(puVar3,iVar9);\n    iVar5 = FUN_000460c0(iVar4,param_1);\n    if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;\n    if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }\n  }\n  FUN_0001b330(puVar3,iVar9);\n  FUN_0001b250(puVar3);\n  return iVar4;\n}" primitive_type (function_declarator "FUN_000461c0(undefined4 param_1,int *param_2)" identifier (parameter_list "(undefined4 param_1,int *param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  undefined1 uVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  undefined1 *puVar7;\n  undefined1 *puVar8;\n  int iVar9;\n  byte local_20;\n  \n  iVar2 = *param_2 * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  iVar6 = iVar2 + 7;\n  if (-1 < iVar2) {\n    iVar6 = iVar2;\n  }\n  iVar2 = iVar2 % 8;\n  iVar9 = ((iVar6 >> 3) + 1) - (uint)(iVar2 == 0);\n  puVar3 = (undefined1 *)FUN_0001a9c0(iVar9,1);\n  iVar6 = 0;\n  if (-1 < iVar9) {\n    iVar6 = iVar9;\n  }\n  while( true ) {\n    puVar7 = puVar3;\n    if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }\n    if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }\n    iVar4 = FUN_00045bd0(puVar3,iVar9);\n    iVar5 = FUN_000460c0(iVar4,param_1);\n    if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;\n    if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }\n  }\n  FUN_0001b330(puVar3,iVar9);\n  FUN_0001b250(puVar3);\n  return iVar4;\n}" { (declaration "undefined1 uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined1 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "undefined1 *puVar7;" type_identifier (pointer_declarator "*puVar7" * identifier) ;) (declaration "undefined1 *puVar8;" type_identifier (pointer_declarator "*puVar8" * identifier) ;) (declaration "int iVar9;" primitive_type identifier ;) (declaration "byte local_20;" type_identifier identifier ;) (expression_statement "iVar2 = *param_2 * 0x20;" (assignment_expression "iVar2 = *param_2 * 0x20" identifier = (binary_expression "*param_2 * 0x20" (pointer_expression "*param_2" * identifier) * number_literal)) ;) (expression_statement "iVar6 = iVar2 + -1;" (assignment_expression "iVar6 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (if_statement "if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }" if (parenthesized_expression "((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1]))" ( (binary_expression "(-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])" (parenthesized_expression "(-1 < iVar6)" ( (binary_expression "-1 < iVar6" number_literal < identifier) )) && (parenthesized_expression "(-1 < param_2[(iVar6 >> 5) + 1])" ( (binary_expression "-1 < param_2[(iVar6 >> 5) + 1]" number_literal < (subscript_expression "param_2[(iVar6 >> 5) + 1]" identifier [ (binary_expression "(iVar6 >> 5) + 1" (parenthesized_expression "(iVar6 >> 5)" ( (binary_expression "iVar6 >> 5" identifier >> number_literal) )) + number_literal) ])) ))) )) (compound_statement "{\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }" { (do_statement "do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);" do (compound_statement "{\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    }" { (expression_statement "iVar2 = iVar6;" (assignment_expression "iVar2 = iVar6" identifier = identifier) ;) (expression_statement "iVar6 = iVar2 + -1;" (assignment_expression "iVar6 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (if_statement "if (iVar6 == -1) break;" if (parenthesized_expression "(iVar6 == -1)" ( (binary_expression "iVar6 == -1" identifier == number_literal) )) (break_statement "break;" break ;)) }) while (parenthesized_expression "((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0)" ( (binary_expression "(uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0" (binary_expression "(uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f)" (cast_expression "(uint)param_2[(iVar6 >> 5) + 1]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_2[(iVar6 >> 5) + 1]" identifier [ (binary_expression "(iVar6 >> 5) + 1" (parenthesized_expression "(iVar6 >> 5)" ( (binary_expression "iVar6 >> 5" identifier >> number_literal) )) + number_literal) ])) >> (parenthesized_expression "((byte)iVar6 & 0x1f)" ( (binary_expression "(byte)iVar6 & 0x1f" (cast_expression "(byte)iVar6" ( (type_descriptor "byte" type_identifier) ) identifier) & number_literal) ))) == number_literal) )) ;) })) (expression_statement "iVar6 = iVar2 + 7;" (assignment_expression "iVar6 = iVar2 + 7" identifier = (binary_expression "iVar2 + 7" identifier + number_literal)) ;) (if_statement "if (-1 < iVar2) {\n    iVar6 = iVar2;\n  }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n    iVar6 = iVar2;\n  }" { (expression_statement "iVar6 = iVar2;" (assignment_expression "iVar6 = iVar2" identifier = identifier) ;) })) (expression_statement "iVar2 = iVar2 % 8;" (assignment_expression "iVar2 = iVar2 % 8" identifier = (binary_expression "iVar2 % 8" identifier % number_literal)) ;) (expression_statement "iVar9 = ((iVar6 >> 3) + 1) - (uint)(iVar2 == 0);" (assignment_expression "iVar9 = ((iVar6 >> 3) + 1) - (uint)(iVar2 == 0)" identifier = (binary_expression "((iVar6 >> 3) + 1) - (uint)(iVar2 == 0)" (parenthesized_expression "((iVar6 >> 3) + 1)" ( (binary_expression "(iVar6 >> 3) + 1" (parenthesized_expression "(iVar6 >> 3)" ( (binary_expression "iVar6 >> 3" identifier >> number_literal) )) + number_literal) )) - (call_expression "(uint)(iVar2 == 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) ))))) ;) (expression_statement "puVar3 = (undefined1 *)FUN_0001a9c0(iVar9,1);" (assignment_expression "puVar3 = (undefined1 *)FUN_0001a9c0(iVar9,1)" identifier = (cast_expression "(undefined1 *)FUN_0001a9c0(iVar9,1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001a9c0(iVar9,1)" identifier (argument_list "(iVar9,1)" ( identifier , number_literal ))))) ;) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) (if_statement "if (-1 < iVar9) {\n    iVar6 = iVar9;\n  }" if (parenthesized_expression "(-1 < iVar9)" ( (binary_expression "-1 < iVar9" number_literal < identifier) )) (compound_statement "{\n    iVar6 = iVar9;\n  }" { (expression_statement "iVar6 = iVar9;" (assignment_expression "iVar6 = iVar9" identifier = identifier) ;) })) (while_statement "while( true ) {\n    puVar7 = puVar3;\n    if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }\n    if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }\n    iVar4 = FUN_00045bd0(puVar3,iVar9);\n    iVar5 = FUN_000460c0(iVar4,param_1);\n    if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;\n    if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    puVar7 = puVar3;\n    if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }\n    if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }\n    iVar4 = FUN_00045bd0(puVar3,iVar9);\n    iVar5 = FUN_000460c0(iVar4,param_1);\n    if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;\n    if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }\n  }" { (expression_statement "puVar7 = puVar3;" (assignment_expression "puVar7 = puVar3" identifier = identifier) ;) (if_statement "if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }" if (parenthesized_expression "(0 < iVar9)" ( (binary_expression "0 < iVar9" number_literal < identifier) )) (compound_statement "{\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }" { (do_statement "do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);" do (compound_statement "{\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      }" { (expression_statement "uVar1 = FUN_00057c60();" (assignment_expression "uVar1 = FUN_00057c60()" identifier = (call_expression "FUN_00057c60()" identifier (argument_list "()" ( )))) ;) (expression_statement "puVar8 = puVar7 + 1;" (assignment_expression "puVar8 = puVar7 + 1" identifier = (binary_expression "puVar7 + 1" identifier + number_literal)) ;) (expression_statement "*puVar7 = uVar1;" (assignment_expression "*puVar7 = uVar1" (pointer_expression "*puVar7" * identifier) = identifier) ;) (expression_statement "puVar7 = puVar8;" (assignment_expression "puVar7 = puVar8" identifier = identifier) ;) }) while (parenthesized_expression "(puVar3 + iVar9 != puVar8)" ( (binary_expression "puVar3 + iVar9 != puVar8" (binary_expression "puVar3 + iVar9" identifier + identifier) != identifier) )) ;) })) (if_statement "if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }" { (expression_statement "local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));" (assignment_expression "local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f))" identifier = (call_expression "(byte)(0xff >> (8U - (char)iVar2 & 0x1f))" (parenthesized_expression "(byte)" ( identifier )) (argument_list "(0xff >> (8U - (char)iVar2 & 0x1f))" ( (binary_expression "0xff >> (8U - (char)iVar2 & 0x1f)" number_literal >> (parenthesized_expression "(8U - (char)iVar2 & 0x1f)" ( (binary_expression "8U - (char)iVar2 & 0x1f" (binary_expression "8U - (char)iVar2" number_literal - (cast_expression "(char)iVar2" ( (type_descriptor "char" primitive_type) ) identifier)) & number_literal) ))) )))) ;) (expression_statement "puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;" (assignment_expression "puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20" (subscript_expression "puVar3[iVar6 + -1]" identifier [ (binary_expression "iVar6 + -1" identifier + number_literal) ]) = (binary_expression "puVar3[iVar6 + -1] & local_20" (subscript_expression "puVar3[iVar6 + -1]" identifier [ (binary_expression "iVar6 + -1" identifier + number_literal) ]) & identifier)) ;) })) (expression_statement "iVar4 = FUN_00045bd0(puVar3,iVar9);" (assignment_expression "iVar4 = FUN_00045bd0(puVar3,iVar9)" identifier = (call_expression "FUN_00045bd0(puVar3,iVar9)" identifier (argument_list "(puVar3,iVar9)" ( identifier , identifier )))) ;) (expression_statement "iVar5 = FUN_000460c0(iVar4,param_1);" (assignment_expression "iVar5 = FUN_000460c0(iVar4,param_1)" identifier = (call_expression "FUN_000460c0(iVar4,param_1)" identifier (argument_list "(iVar4,param_1)" ( identifier , identifier )))) ;) (if_statement "if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;" if (parenthesized_expression "((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1))" ( (binary_expression "(-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)" (parenthesized_expression "(-1 < iVar5)" ( (binary_expression "-1 < iVar5" number_literal < identifier) )) && (parenthesized_expression "(iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)" ( (comma_expression "iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1" (assignment_expression "iVar5 = FUN_000460c0(iVar4,param_2)" identifier = (call_expression "FUN_000460c0(iVar4,param_2)" identifier (argument_list "(iVar4,param_2)" ( identifier , identifier )))) , (binary_expression "iVar5 < 1" identifier < number_literal)) ))) )) (break_statement "break;" break ;)) (if_statement "if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }" if (parenthesized_expression "(iVar4 != 0)" ( (binary_expression "iVar4 != 0" identifier != number_literal) )) (compound_statement "{\n      FUN_00045740(iVar4);\n    }" { (expression_statement "FUN_00045740(iVar4);" (call_expression "FUN_00045740(iVar4)" identifier (argument_list "(iVar4)" ( identifier ))) ;) })) })) (expression_statement "FUN_0001b330(puVar3,iVar9);" (call_expression "FUN_0001b330(puVar3,iVar9)" identifier (argument_list "(puVar3,iVar9)" ( identifier , identifier ))) ;) (expression_statement "FUN_0001b250(puVar3);" (call_expression "FUN_0001b250(puVar3)" identifier (argument_list "(puVar3)" ( identifier ))) ;) (return_statement "return iVar4;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (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 ;) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * IDENT) * LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < IDENT) )) && (parenthesized_expression ( (binary_expression LIT < (subscript_expression IDENT [ (binary_expression (parenthesized_expression ( (binary_expression IDENT >> LIT) )) + LIT) ])) ))) )) (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (break_statement break ;)) }) while (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ (binary_expression (parenthesized_expression ( (binary_expression IDENT >> LIT) )) + LIT) ])) >> (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) & LIT) ))) == LIT) )) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT % LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT >> LIT) )) + LIT) )) - (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT == LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , LIT ))))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (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 (binary_expression IDENT + IDENT) != IDENT) )) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression LIT >> (parenthesized_expression ( (binary_expression (binary_expression LIT - (cast_expression ( (type_descriptor TYPE) ) IDENT)) & LIT) ))) )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ (binary_expression IDENT + LIT) ]) = (binary_expression (subscript_expression IDENT [ (binary_expression IDENT + LIT) ]) & IDENT)) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < IDENT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) , (binary_expression IDENT < LIT)) ))) )) (break_statement break ;)) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return IDENT ;) })))
(function_definition "int FUN_000461c0(undefined4 param_1,int *param_2)\n\n{\n  undefined1 uVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  undefined1 *puVar7;\n  undefined1 *puVar8;\n  int iVar9;\n  byte local_20;\n  \n  iVar2 = *param_2 * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  iVar6 = iVar2 + 7;\n  if (-1 < iVar2) {\n    iVar6 = iVar2;\n  }\n  iVar2 = iVar2 % 8;\n  iVar9 = ((iVar6 >> 3) + 1) - (uint)(iVar2 == 0);\n  puVar3 = (undefined1 *)FUN_0001a9c0(iVar9,1);\n  iVar6 = 0;\n  if (-1 < iVar9) {\n    iVar6 = iVar9;\n  }\n  while( true ) {\n    puVar7 = puVar3;\n    if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }\n    if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }\n    iVar4 = FUN_00045bd0(puVar3,iVar9);\n    iVar5 = FUN_000460c0(iVar4,param_1);\n    if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;\n    if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }\n  }\n  FUN_0001b330(puVar3,iVar9);\n  FUN_0001b250(puVar3);\n  return iVar4;\n}" (primitive_type "int") (function_declarator "FUN_000461c0(undefined4 param_1,int *param_2)" (identifier "FUN_000461c0") (parameter_list "(undefined4 param_1,int *param_2)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "int *param_2" (primitive_type "int") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")"))) (compound_statement "{\n  undefined1 uVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  int iVar5;\n  int iVar6;\n  undefined1 *puVar7;\n  undefined1 *puVar8;\n  int iVar9;\n  byte local_20;\n  \n  iVar2 = *param_2 * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  iVar6 = iVar2 + 7;\n  if (-1 < iVar2) {\n    iVar6 = iVar2;\n  }\n  iVar2 = iVar2 % 8;\n  iVar9 = ((iVar6 >> 3) + 1) - (uint)(iVar2 == 0);\n  puVar3 = (undefined1 *)FUN_0001a9c0(iVar9,1);\n  iVar6 = 0;\n  if (-1 < iVar9) {\n    iVar6 = iVar9;\n  }\n  while( true ) {\n    puVar7 = puVar3;\n    if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }\n    if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }\n    iVar4 = FUN_00045bd0(puVar3,iVar9);\n    iVar5 = FUN_000460c0(iVar4,param_1);\n    if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;\n    if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }\n  }\n  FUN_0001b330(puVar3,iVar9);\n  FUN_0001b250(puVar3);\n  return iVar4;\n}" ({ "{") (declaration "undefined1 uVar1;" (type_identifier "undefined1") (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined1 *puVar3;" (type_identifier "undefined1") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (declaration "int iVar6;" (primitive_type "int") (identifier "iVar6") (; ";")) (declaration "undefined1 *puVar7;" (type_identifier "undefined1") (pointer_declarator "*puVar7" (* "*") (identifier "puVar7")) (; ";")) (declaration "undefined1 *puVar8;" (type_identifier "undefined1") (pointer_declarator "*puVar8" (* "*") (identifier "puVar8")) (; ";")) (declaration "int iVar9;" (primitive_type "int") (identifier "iVar9") (; ";")) (declaration "byte local_20;" (type_identifier "byte") (identifier "local_20") (; ";")) (expression_statement "iVar2 = *param_2 * 0x20;" (assignment_expression "iVar2 = *param_2 * 0x20" (identifier "iVar2") (= "=") (binary_expression "*param_2 * 0x20" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (* "*") (number_literal "0x20"))) (; ";")) (expression_statement "iVar6 = iVar2 + -1;" (assignment_expression "iVar6 = iVar2 + -1" (identifier "iVar6") (= "=") (binary_expression "iVar2 + -1" (identifier "iVar2") (+ "+") (number_literal "-1"))) (; ";")) (if_statement "if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }" (if "if") (parenthesized_expression "((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1]))" (( "(") (binary_expression "(-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])" (parenthesized_expression "(-1 < iVar6)" (( "(") (binary_expression "-1 < iVar6" (number_literal "-1") (< "<") (identifier "iVar6")) () ")")) (&& "&&") (parenthesized_expression "(-1 < param_2[(iVar6 >> 5) + 1])" (( "(") (binary_expression "-1 < param_2[(iVar6 >> 5) + 1]" (number_literal "-1") (< "<") (subscript_expression "param_2[(iVar6 >> 5) + 1]" (identifier "param_2") ([ "[") (binary_expression "(iVar6 >> 5) + 1" (parenthesized_expression "(iVar6 >> 5)" (( "(") (binary_expression "iVar6 >> 5" (identifier "iVar6") (>> ">>") (number_literal "5")) () ")")) (+ "+") (number_literal "1")) (] "]"))) () ")"))) () ")")) (compound_statement "{\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }" ({ "{") (do_statement "do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);" (do "do") (compound_statement "{\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    }" ({ "{") (expression_statement "iVar2 = iVar6;" (assignment_expression "iVar2 = iVar6" (identifier "iVar2") (= "=") (identifier "iVar6")) (; ";")) (expression_statement "iVar6 = iVar2 + -1;" (assignment_expression "iVar6 = iVar2 + -1" (identifier "iVar6") (= "=") (binary_expression "iVar2 + -1" (identifier "iVar2") (+ "+") (number_literal "-1"))) (; ";")) (if_statement "if (iVar6 == -1) break;" (if "if") (parenthesized_expression "(iVar6 == -1)" (( "(") (binary_expression "iVar6 == -1" (identifier "iVar6") (== "==") (number_literal "-1")) () ")")) (break_statement "break;" (break "break") (; ";"))) (} "}")) (while "while") (parenthesized_expression "((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0)" (( "(") (binary_expression "(uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0" (binary_expression "(uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f)" (cast_expression "(uint)param_2[(iVar6 >> 5) + 1]" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (subscript_expression "param_2[(iVar6 >> 5) + 1]" (identifier "param_2") ([ "[") (binary_expression "(iVar6 >> 5) + 1" (parenthesized_expression "(iVar6 >> 5)" (( "(") (binary_expression "iVar6 >> 5" (identifier "iVar6") (>> ">>") (number_literal "5")) () ")")) (+ "+") (number_literal "1")) (] "]"))) (>> ">>") (parenthesized_expression "((byte)iVar6 & 0x1f)" (( "(") (binary_expression "(byte)iVar6 & 0x1f" (cast_expression "(byte)iVar6" (( "(") (type_descriptor "byte" (type_identifier "byte")) () ")") (identifier "iVar6")) (& "&") (number_literal "0x1f")) () ")"))) (== "==") (number_literal "0")) () ")")) (; ";")) (} "}"))) (expression_statement "iVar6 = iVar2 + 7;" (assignment_expression "iVar6 = iVar2 + 7" (identifier "iVar6") (= "=") (binary_expression "iVar2 + 7" (identifier "iVar2") (+ "+") (number_literal "7"))) (; ";")) (if_statement "if (-1 < iVar2) {\n    iVar6 = iVar2;\n  }" (if "if") (parenthesized_expression "(-1 < iVar2)" (( "(") (binary_expression "-1 < iVar2" (number_literal "-1") (< "<") (identifier "iVar2")) () ")")) (compound_statement "{\n    iVar6 = iVar2;\n  }" ({ "{") (expression_statement "iVar6 = iVar2;" (assignment_expression "iVar6 = iVar2" (identifier "iVar6") (= "=") (identifier "iVar2")) (; ";")) (} "}"))) (expression_statement "iVar2 = iVar2 % 8;" (assignment_expression "iVar2 = iVar2 % 8" (identifier "iVar2") (= "=") (binary_expression "iVar2 % 8" (identifier "iVar2") (% "%") (number_literal "8"))) (; ";")) (expression_statement "iVar9 = ((iVar6 >> 3) + 1) - (uint)(iVar2 == 0);" (assignment_expression "iVar9 = ((iVar6 >> 3) + 1) - (uint)(iVar2 == 0)" (identifier "iVar9") (= "=") (binary_expression "((iVar6 >> 3) + 1) - (uint)(iVar2 == 0)" (parenthesized_expression "((iVar6 >> 3) + 1)" (( "(") (binary_expression "(iVar6 >> 3) + 1" (parenthesized_expression "(iVar6 >> 3)" (( "(") (binary_expression "iVar6 >> 3" (identifier "iVar6") (>> ">>") (number_literal "3")) () ")")) (+ "+") (number_literal "1")) () ")")) (- "-") (call_expression "(uint)(iVar2 == 0)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")"))))) (; ";")) (expression_statement "puVar3 = (undefined1 *)FUN_0001a9c0(iVar9,1);" (assignment_expression "puVar3 = (undefined1 *)FUN_0001a9c0(iVar9,1)" (identifier "puVar3") (= "=") (cast_expression "(undefined1 *)FUN_0001a9c0(iVar9,1)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001a9c0(iVar9,1)" (identifier "FUN_0001a9c0") (argument_list "(iVar9,1)" (( "(") (identifier "iVar9") (, ",") (number_literal "1") () ")"))))) (; ";")) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" (identifier "iVar6") (= "=") (number_literal "0")) (; ";")) (if_statement "if (-1 < iVar9) {\n    iVar6 = iVar9;\n  }" (if "if") (parenthesized_expression "(-1 < iVar9)" (( "(") (binary_expression "-1 < iVar9" (number_literal "-1") (< "<") (identifier "iVar9")) () ")")) (compound_statement "{\n    iVar6 = iVar9;\n  }" ({ "{") (expression_statement "iVar6 = iVar9;" (assignment_expression "iVar6 = iVar9" (identifier "iVar6") (= "=") (identifier "iVar9")) (; ";")) (} "}"))) (while_statement "while( true ) {\n    puVar7 = puVar3;\n    if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }\n    if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }\n    iVar4 = FUN_00045bd0(puVar3,iVar9);\n    iVar5 = FUN_000460c0(iVar4,param_1);\n    if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;\n    if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    puVar7 = puVar3;\n    if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }\n    if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }\n    iVar4 = FUN_00045bd0(puVar3,iVar9);\n    iVar5 = FUN_000460c0(iVar4,param_1);\n    if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;\n    if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }\n  }" ({ "{") (expression_statement "puVar7 = puVar3;" (assignment_expression "puVar7 = puVar3" (identifier "puVar7") (= "=") (identifier "puVar3")) (; ";")) (if_statement "if (0 < iVar9) {\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }" (if "if") (parenthesized_expression "(0 < iVar9)" (( "(") (binary_expression "0 < iVar9" (number_literal "0") (< "<") (identifier "iVar9")) () ")")) (compound_statement "{\n      do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);\n    }" ({ "{") (do_statement "do {\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      } while (puVar3 + iVar9 != puVar8);" (do "do") (compound_statement "{\n        uVar1 = FUN_00057c60();\n        puVar8 = puVar7 + 1;\n        *puVar7 = uVar1;\n        puVar7 = puVar8;\n      }" ({ "{") (expression_statement "uVar1 = FUN_00057c60();" (assignment_expression "uVar1 = FUN_00057c60()" (identifier "uVar1") (= "=") (call_expression "FUN_00057c60()" (identifier "FUN_00057c60") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "puVar8 = puVar7 + 1;" (assignment_expression "puVar8 = puVar7 + 1" (identifier "puVar8") (= "=") (binary_expression "puVar7 + 1" (identifier "puVar7") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "*puVar7 = uVar1;" (assignment_expression "*puVar7 = uVar1" (pointer_expression "*puVar7" (* "*") (identifier "puVar7")) (= "=") (identifier "uVar1")) (; ";")) (expression_statement "puVar7 = puVar8;" (assignment_expression "puVar7 = puVar8" (identifier "puVar7") (= "=") (identifier "puVar8")) (; ";")) (} "}")) (while "while") (parenthesized_expression "(puVar3 + iVar9 != puVar8)" (( "(") (binary_expression "puVar3 + iVar9 != puVar8" (binary_expression "puVar3 + iVar9" (identifier "puVar3") (+ "+") (identifier "iVar9")) (!= "!=") (identifier "puVar8")) () ")")) (; ";")) (} "}"))) (if_statement "if (iVar2 != 0) {\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }" (if "if") (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));\n      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;\n    }" ({ "{") (expression_statement "local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));" (assignment_expression "local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f))" (identifier "local_20") (= "=") (call_expression "(byte)(0xff >> (8U - (char)iVar2 & 0x1f))" (parenthesized_expression "(byte)" (( "(") (identifier "byte") () ")")) (argument_list "(0xff >> (8U - (char)iVar2 & 0x1f))" (( "(") (binary_expression "0xff >> (8U - (char)iVar2 & 0x1f)" (number_literal "0xff") (>> ">>") (parenthesized_expression "(8U - (char)iVar2 & 0x1f)" (( "(") (binary_expression "8U - (char)iVar2 & 0x1f" (binary_expression "8U - (char)iVar2" (number_literal "8U") (- "-") (cast_expression "(char)iVar2" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (identifier "iVar2"))) (& "&") (number_literal "0x1f")) () ")"))) () ")")))) (; ";")) (expression_statement "puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;" (assignment_expression "puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20" (subscript_expression "puVar3[iVar6 + -1]" (identifier "puVar3") ([ "[") (binary_expression "iVar6 + -1" (identifier "iVar6") (+ "+") (number_literal "-1")) (] "]")) (= "=") (binary_expression "puVar3[iVar6 + -1] & local_20" (subscript_expression "puVar3[iVar6 + -1]" (identifier "puVar3") ([ "[") (binary_expression "iVar6 + -1" (identifier "iVar6") (+ "+") (number_literal "-1")) (] "]")) (& "&") (identifier "local_20"))) (; ";")) (} "}"))) (expression_statement "iVar4 = FUN_00045bd0(puVar3,iVar9);" (assignment_expression "iVar4 = FUN_00045bd0(puVar3,iVar9)" (identifier "iVar4") (= "=") (call_expression "FUN_00045bd0(puVar3,iVar9)" (identifier "FUN_00045bd0") (argument_list "(puVar3,iVar9)" (( "(") (identifier "puVar3") (, ",") (identifier "iVar9") () ")")))) (; ";")) (expression_statement "iVar5 = FUN_000460c0(iVar4,param_1);" (assignment_expression "iVar5 = FUN_000460c0(iVar4,param_1)" (identifier "iVar5") (= "=") (call_expression "FUN_000460c0(iVar4,param_1)" (identifier "FUN_000460c0") (argument_list "(iVar4,param_1)" (( "(") (identifier "iVar4") (, ",") (identifier "param_1") () ")")))) (; ";")) (if_statement "if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;" (if "if") (parenthesized_expression "((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1))" (( "(") (binary_expression "(-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)" (parenthesized_expression "(-1 < iVar5)" (( "(") (binary_expression "-1 < iVar5" (number_literal "-1") (< "<") (identifier "iVar5")) () ")")) (&& "&&") (parenthesized_expression "(iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)" (( "(") (comma_expression "iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1" (assignment_expression "iVar5 = FUN_000460c0(iVar4,param_2)" (identifier "iVar5") (= "=") (call_expression "FUN_000460c0(iVar4,param_2)" (identifier "FUN_000460c0") (argument_list "(iVar4,param_2)" (( "(") (identifier "iVar4") (, ",") (identifier "param_2") () ")")))) (, ",") (binary_expression "iVar5 < 1" (identifier "iVar5") (< "<") (number_literal "1"))) () ")"))) () ")")) (break_statement "break;" (break "break") (; ";"))) (if_statement "if (iVar4 != 0) {\n      FUN_00045740(iVar4);\n    }" (if "if") (parenthesized_expression "(iVar4 != 0)" (( "(") (binary_expression "iVar4 != 0" (identifier "iVar4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      FUN_00045740(iVar4);\n    }" ({ "{") (expression_statement "FUN_00045740(iVar4);" (call_expression "FUN_00045740(iVar4)" (identifier "FUN_00045740") (argument_list "(iVar4)" (( "(") (identifier "iVar4") () ")"))) (; ";")) (} "}"))) (} "}"))) (expression_statement "FUN_0001b330(puVar3,iVar9);" (call_expression "FUN_0001b330(puVar3,iVar9)" (identifier "FUN_0001b330") (argument_list "(puVar3,iVar9)" (( "(") (identifier "puVar3") (, ",") (identifier "iVar9") () ")"))) (; ";")) (expression_statement "FUN_0001b250(puVar3);" (call_expression "FUN_0001b250(puVar3)" (identifier "FUN_0001b250") (argument_list "(puVar3)" (( "(") (identifier "puVar3") () ")"))) (; ";")) (return_statement "return iVar4;" (return "return") (identifier "iVar4") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

type_1 function_1(type_1 lower,type_1 upper)

{
  int var_1;
  type_2 *var_6;
  size_t var_9;
  type_1 var_13;
  int var_2;
  type_2 *var_5;
  type_2 *var_8;
  size_t var_7;
  type_3 var_10;
  
  var_1 = *upper * 0x20;
  var_2 = var_1 + -1;
  if ((-1 < var_2) && (-1 < (int)upper[(var_2 >> 5) + 1])) {
    do {
      var_1 = var_2;
      var_2 = var_1 + -1;
      if (var_2 == -1) break;
    } while (upper[(var_2 >> 5) + 1] >> ((type_3)var_2 & 0x1f) == 0);
  }
  var_2 = var_1 + 7;
  if (-1 < var_1) {
    var_2 = var_1;
  }
  var_1 = var_1 % 8;
  var_7 = ((var_2 >> 3) + 1) - (uint)(var_1 == 0);
  var_6 = (type_2 *)var_3(var_7,1);
  var_9 = 0;
  if (-1 < (int)var_7) {
    var_9 = var_7;
  }
  while( true ) {
    var_5 = var_6;
    if (0 < (int)var_7) {
      do {
        var_2 = var_4();
        var_8 = var_5 + 1;
        *var_5 = (type_2)var_2;
        var_5 = var_8;
      } while (var_6 + var_7 != var_8);
    }
    if (var_1 != 0) {
      var_10 = (type_3)(0xff >> (8U - (char)var_1 & 0x1f));
      var_6[var_9 - 1] = var_6[var_9 - 1] & var_10;
    }
    var_13 = var_11(var_6,var_7);
    var_2 = var_12(var_13,lower);
    if ((-1 < var_2) && (var_2 = var_12(var_13,upper), var_2 < 1)) break;
    if (var_13 != (type_1)0x0) {
      var_14(var_13);
    }
  }
  var_15(var_6,var_7);
  var_16(var_6);
  return var_13;
}


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

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

int MASKED(undefined4 param_1,int *param_2)

{
  undefined1 uVar1;
  int iVar2;
  undefined1 *puVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined1 *puVar7;
  undefined1 *puVar8;
  int iVar9;
  byte local_20;
  
  iVar2 = *param_2 * 0x20;
  iVar6 = iVar2 + -1;
  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {
    do {
      iVar2 = iVar6;
      iVar6 = iVar2 + -1;
      if (iVar6 == -1) break;
    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);
  }
  iVar6 = iVar2 + 7;
  if (-1 < iVar2) {
    iVar6 = iVar2;
  }
  iVar2 = iVar2 % 8;
  iVar9 = ((iVar6 >> 3) + 1) - (uint)(iVar2 == 0);
  puVar3 = (undefined1 *)FUN_0001a9c0(iVar9,1);
  iVar6 = 0;
  if (-1 < iVar9) {
    iVar6 = iVar9;
  }
  while( true ) {
    puVar7 = puVar3;
    if (0 < iVar9) {
      do {
        uVar1 = FUN_00057c60();
        puVar8 = puVar7 + 1;
        *puVar7 = uVar1;
        puVar7 = puVar8;
      } while (puVar3 + iVar9 != puVar8);
    }
    if (iVar2 != 0) {
      local_20 = (byte)(0xff >> (8U - (char)iVar2 & 0x1f));
      puVar3[iVar6 + -1] = puVar3[iVar6 + -1] & local_20;
    }
    iVar4 = FUN_00045bd0(puVar3,iVar9);
    iVar5 = FUN_000460c0(iVar4,param_1);
    if ((-1 < iVar5) && (iVar5 = FUN_000460c0(iVar4,param_2), iVar5 < 1)) break;
    if (iVar4 != 0) {
      FUN_00045740(iVar4);
    }
  }
  FUN_0001b330(puVar3,iVar9);
  FUN_0001b250(puVar3);
  return iVar4;
}

