
mp_bitcnt_t __gmpz_scan1(mpz_srcptr u,mp_bitcnt_t starting_bit)

{
  mp_limb_t *pmVar1;
  long lVar2;
  mp_bitcnt_t mVar3;
  ulong *puVar4;
  ulong uVar5;
  ulong uVar6;
  ulong uVar7;
  
  uVar6 = (ulong)u->_mp_size;
  uVar7 = starting_bit >> 6;
  lVar2 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);
  if (lVar2 <= (long)uVar7) {
    mVar3 = 0xffffffffffffffff;
    if ((long)uVar6 < 0) {
      mVar3 = starting_bit;
    }
    return mVar3;
  }
  pmVar1 = u->_mp_d;
  puVar4 = pmVar1 + uVar7;
  uVar5 = *puVar4;
  if (starting_bit == 0) goto LAB_00123df2;
  if ((long)uVar6 < 0) {
    do {
      if (uVar7 == 0) {
        if (uVar5 == 0) goto LAB_00123dea;
        uVar5 = uVar5 - 1;
        break;
      }
      uVar7 = uVar7 - 1;
    } while (pmVar1[uVar7] == 0);
    uVar5 = uVar5 | (1L << ((byte)starting_bit & 0x3f)) - 1U;
    while (uVar5 == 0xffffffffffffffff) {
      if (pmVar1 + lVar2 + -1 == puVar4) {
        return lVar2 * 0x40;
      }
      puVar4 = puVar4 + 1;
      uVar5 = *puVar4;
    }
    uVar5 = ~uVar5;
  }
  else {
    uVar5 = uVar5 & -1L << ((byte)starting_bit & 0x3f);
    if (uVar5 == 0) {
      if (pmVar1 + lVar2 + -1 == puVar4) {
        return 0xffffffffffffffff;
      }
LAB_00123dea:
      do {
        uVar5 = puVar4[1];
        puVar4 = puVar4 + 1;
LAB_00123df2:
      } while (uVar5 == 0);
    }
  }
  lVar2 = 0;
  if (uVar5 != 0) {
    for (; (uVar5 >> lVar2 & 1) == 0; lVar2 = lVar2 + 1) {
    }
  }
  return (long)(int)lVar2 + ((long)puVar4 - (long)pmVar1 >> 3) * 0x40;
}



ulong __gmpz_scan1(long param_1,ulong param_2)

{
  ulong *puVar1;
  long lVar2;
  long lVar3;
  ulong *puVar4;
  ulong uVar5;
  ulong uVar6;
  ulong uVar7;
  
  uVar6 = (ulong)*(int *)(param_1 + 4);
  uVar7 = param_2 >> 6;
  lVar3 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);
  if (lVar3 <= (long)uVar7) {
    uVar7 = 0xffffffffffffffff;
    if ((long)uVar6 < 0) {
      uVar7 = param_2;
    }
    return uVar7;
  }
  lVar2 = *(long *)(param_1 + 8);
  puVar4 = (ulong *)(lVar2 + uVar7 * 8);
  uVar5 = *puVar4;
  if (param_2 == 0) goto LAB_00123df2;
  puVar1 = (ulong *)(lVar2 + -8 + lVar3 * 8);
  if ((long)uVar6 < 0) {
    do {
      if (uVar7 == 0) {
        if (uVar5 == 0) goto LAB_00123dea;
        uVar5 = uVar5 - 1;
        break;
      }
      uVar7 = uVar7 - 1;
    } while (*(long *)(lVar2 + uVar7 * 8) == 0);
    uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;
    while (uVar5 == 0xffffffffffffffff) {
      if (puVar1 == puVar4) {
        return lVar3 * 0x40;
      }
      puVar4 = puVar4 + 1;
      uVar5 = *puVar4;
    }
    uVar5 = ~uVar5;
  }
  else {
    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);
    if (uVar5 == 0) {
      if (puVar1 == puVar4) {
        return 0xffffffffffffffff;
      }
LAB_00123dea:
      do {
        uVar5 = puVar4[1];
        puVar4 = puVar4 + 1;
LAB_00123df2:
      } while (uVar5 == 0);
    }
  }
  lVar3 = 0;
  if (uVar5 != 0) {
    for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {
    }
  }
  return (long)(int)lVar3 + ((long)puVar4 - lVar2 >> 3) * 0x40;
}


MOVSXD R9,dword ptr [RDI + 0x4]
MOV R10,RSI
SHR R10,0x6
MOV RDX,R9
MOV R8,R10
SAR RDX,0x3f
MOV RAX,RDX
XOR RAX,R9
SUB RAX,RDX
CMP RAX,R10
JLE 0x00123e60
MOV R11,qword ptr [RDI + 0x8]
LEA RDX,[R11 + R10*0x8]
MOV RDI,qword ptr [RDX]
TEST RSI,RSI
JZ 0x00123df2
LEA R10,[R11 + RAX*0x8 + -0x8]
TEST R9,R9
JS 0x00123e1b
MOV RAX,-0x1
MOV ECX,ESI
MOV R9,RAX
SHL R9,CL
AND RDI,R9
JNZ 0x00123df7
CMP R10,RDX
JZ 0x00123e0b
MOV RDI,qword ptr [RDX + 0x8]
ADD RDX,0x8
TEST RDI,RDI
JZ 0x00123dea
SUB RDX,R11
SAR RDX,0x3
BSF RAX,RDI
SHL RDX,0x6
CDQE
ADD RAX,RDX
RET
SUB R8,0x1
CMP qword ptr [R11 + R8*0x8],0x0
JNZ 0x00123e29
TEST R8,R8
JNZ 0x00123e10
TEST RDI,RDI
JZ 0x00123dea
SUB RDI,0x1
MOV R8D,0x1
MOV ECX,ESI
SHL R8,CL
SUB R8,0x1
OR RDI,R8
CMP RDI,-0x1
JZ 0x00123e55
JMP 0x00123e70
ADD RDX,0x8
MOV RDI,qword ptr [RDX]
CMP RDI,-0x1
JNZ 0x00123e70
CMP R10,RDX
JNZ 0x00123e48
SHL RAX,0x6
RET
TEST R9,R9
MOV RAX,-0x1
CMOVS RAX,RSI
RET
NOT RDI
JMP 0x00123df7
(translation_unit "ulong __gmpz_scan1(long param_1,ulong param_2)\n\n{\n  ulong *puVar1;\n  long lVar2;\n  long lVar3;\n  ulong *puVar4;\n  ulong uVar5;\n  ulong uVar6;\n  ulong uVar7;\n  \n  uVar6 = (ulong)*(int *)(param_1 + 4);\n  uVar7 = param_2 >> 6;\n  lVar3 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);\n  if (lVar3 <= (long)uVar7) {\n    uVar7 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }\n    return uVar7;\n  }\n  lVar2 = *(long *)(param_1 + 8);\n  puVar4 = (ulong *)(lVar2 + uVar7 * 8);\n  uVar5 = *puVar4;\n  if (param_2 == 0) goto LAB_00123df2;\n  puVar1 = (ulong *)(lVar2 + -8 + lVar3 * 8);\n  if ((long)uVar6 < 0) {\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);\n    uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }\n  else {\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }\n  lVar3 = 0;\n  if (uVar5 != 0) {\n    for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }\n  }\n  return (long)(int)lVar3 + ((long)puVar4 - lVar2 >> 3) * 0x40;\n}\n\n" (function_definition "ulong __gmpz_scan1(long param_1,ulong param_2)\n\n{\n  ulong *puVar1;\n  long lVar2;\n  long lVar3;\n  ulong *puVar4;\n  ulong uVar5;\n  ulong uVar6;\n  ulong uVar7;\n  \n  uVar6 = (ulong)*(int *)(param_1 + 4);\n  uVar7 = param_2 >> 6;\n  lVar3 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);\n  if (lVar3 <= (long)uVar7) {\n    uVar7 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }\n    return uVar7;\n  }\n  lVar2 = *(long *)(param_1 + 8);\n  puVar4 = (ulong *)(lVar2 + uVar7 * 8);\n  uVar5 = *puVar4;\n  if (param_2 == 0) goto LAB_00123df2;\n  puVar1 = (ulong *)(lVar2 + -8 + lVar3 * 8);\n  if ((long)uVar6 < 0) {\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);\n    uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }\n  else {\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }\n  lVar3 = 0;\n  if (uVar5 != 0) {\n    for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }\n  }\n  return (long)(int)lVar3 + ((long)puVar4 - lVar2 >> 3) * 0x40;\n}" type_identifier (function_declarator "__gmpz_scan1(long param_1,ulong param_2)" identifier (parameter_list "(long param_1,ulong param_2)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "ulong param_2" type_identifier identifier) ))) (compound_statement "{\n  ulong *puVar1;\n  long lVar2;\n  long lVar3;\n  ulong *puVar4;\n  ulong uVar5;\n  ulong uVar6;\n  ulong uVar7;\n  \n  uVar6 = (ulong)*(int *)(param_1 + 4);\n  uVar7 = param_2 >> 6;\n  lVar3 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);\n  if (lVar3 <= (long)uVar7) {\n    uVar7 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }\n    return uVar7;\n  }\n  lVar2 = *(long *)(param_1 + 8);\n  puVar4 = (ulong *)(lVar2 + uVar7 * 8);\n  uVar5 = *puVar4;\n  if (param_2 == 0) goto LAB_00123df2;\n  puVar1 = (ulong *)(lVar2 + -8 + lVar3 * 8);\n  if ((long)uVar6 < 0) {\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);\n    uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }\n  else {\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }\n  lVar3 = 0;\n  if (uVar5 != 0) {\n    for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }\n  }\n  return (long)(int)lVar3 + ((long)puVar4 - lVar2 >> 3) * 0x40;\n}" { (declaration "ulong *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "ulong *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "ulong uVar5;" type_identifier identifier ;) (declaration "ulong uVar6;" type_identifier identifier ;) (declaration "ulong uVar7;" type_identifier identifier ;) (expression_statement "uVar6 = (ulong)*(int *)(param_1 + 4);" (assignment_expression "uVar6 = (ulong)*(int *)(param_1 + 4)" identifier = (binary_expression "(ulong)*(int *)(param_1 + 4)" (parenthesized_expression "(ulong)" ( identifier )) * (cast_expression "(int *)(param_1 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) ))))) ;) (expression_statement "uVar7 = param_2 >> 6;" (assignment_expression "uVar7 = param_2 >> 6" identifier = (binary_expression "param_2 >> 6" identifier >> number_literal)) ;) (expression_statement "lVar3 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);" (assignment_expression "lVar3 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f)" identifier = (binary_expression "((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f)" (parenthesized_expression "((long)uVar6 >> 0x3f ^ uVar6)" ( (binary_expression "(long)uVar6 >> 0x3f ^ uVar6" (binary_expression "(long)uVar6 >> 0x3f" (cast_expression "(long)uVar6" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) >> number_literal) ^ identifier) )) - (parenthesized_expression "((long)uVar6 >> 0x3f)" ( (binary_expression "(long)uVar6 >> 0x3f" (cast_expression "(long)uVar6" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) >> number_literal) )))) ;) (if_statement "if (lVar3 <= (long)uVar7) {\n    uVar7 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }\n    return uVar7;\n  }" if (parenthesized_expression "(lVar3 <= (long)uVar7)" ( (binary_expression "lVar3 <= (long)uVar7" identifier <= (cast_expression "(long)uVar7" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )) (compound_statement "{\n    uVar7 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }\n    return uVar7;\n  }" { (expression_statement "uVar7 = 0xffffffffffffffff;" (assignment_expression "uVar7 = 0xffffffffffffffff" identifier = number_literal) ;) (if_statement "if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }" if (parenthesized_expression "((long)uVar6 < 0)" ( (binary_expression "(long)uVar6 < 0" (cast_expression "(long)uVar6" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) < number_literal) )) (compound_statement "{\n      uVar7 = param_2;\n    }" { (expression_statement "uVar7 = param_2;" (assignment_expression "uVar7 = param_2" identifier = identifier) ;) })) (return_statement "return uVar7;" return identifier ;) })) (expression_statement "lVar2 = *(long *)(param_1 + 8);" (assignment_expression "lVar2 = *(long *)(param_1 + 8)" identifier = (pointer_expression "*(long *)(param_1 + 8)" * (cast_expression "(long *)(param_1 + 8)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (expression_statement "puVar4 = (ulong *)(lVar2 + uVar7 * 8);" (assignment_expression "puVar4 = (ulong *)(lVar2 + uVar7 * 8)" identifier = (cast_expression "(ulong *)(lVar2 + uVar7 * 8)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar2 + uVar7 * 8)" ( (binary_expression "lVar2 + uVar7 * 8" identifier + (binary_expression "uVar7 * 8" identifier * number_literal)) )))) ;) (expression_statement "uVar5 = *puVar4;" (assignment_expression "uVar5 = *puVar4" identifier = (pointer_expression "*puVar4" * identifier)) ;) (if_statement "if (param_2 == 0) goto LAB_00123df2;" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (goto_statement "goto LAB_00123df2;" goto statement_identifier ;)) (expression_statement "puVar1 = (ulong *)(lVar2 + -8 + lVar3 * 8);" (assignment_expression "puVar1 = (ulong *)(lVar2 + -8 + lVar3 * 8)" identifier = (cast_expression "(ulong *)(lVar2 + -8 + lVar3 * 8)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar2 + -8 + lVar3 * 8)" ( (binary_expression "lVar2 + -8 + lVar3 * 8" (binary_expression "lVar2 + -8" identifier + number_literal) + (binary_expression "lVar3 * 8" identifier * number_literal)) )))) ;) (if_statement "if ((long)uVar6 < 0) {\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);\n    uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }\n  else {\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }" if (parenthesized_expression "((long)uVar6 < 0)" ( (binary_expression "(long)uVar6 < 0" (cast_expression "(long)uVar6" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) < number_literal) )) (compound_statement "{\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);\n    uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }" { (do_statement "do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);" do (compound_statement "{\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    }" { (if_statement "if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }" if (parenthesized_expression "(uVar7 == 0)" ( (binary_expression "uVar7 == 0" identifier == number_literal) )) (compound_statement "{\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }" { (if_statement "if (uVar5 == 0) goto LAB_00123dea;" if (parenthesized_expression "(uVar5 == 0)" ( (binary_expression "uVar5 == 0" identifier == number_literal) )) (goto_statement "goto LAB_00123dea;" goto statement_identifier ;)) (expression_statement "uVar5 = uVar5 - 1;" (assignment_expression "uVar5 = uVar5 - 1" identifier = (binary_expression "uVar5 - 1" identifier - number_literal)) ;) (break_statement "break;" break ;) })) (expression_statement "uVar7 = uVar7 - 1;" (assignment_expression "uVar7 = uVar7 - 1" identifier = (binary_expression "uVar7 - 1" identifier - number_literal)) ;) }) while (parenthesized_expression "(*(long *)(lVar2 + uVar7 * 8) == 0)" ( (binary_expression "*(long *)(lVar2 + uVar7 * 8) == 0" (pointer_expression "*(long *)(lVar2 + uVar7 * 8)" * (cast_expression "(long *)(lVar2 + uVar7 * 8)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar2 + uVar7 * 8)" ( (binary_expression "lVar2 + uVar7 * 8" identifier + (binary_expression "uVar7 * 8" identifier * number_literal)) )))) == number_literal) )) ;) (expression_statement "uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;" (assignment_expression "uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U" identifier = (binary_expression "uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U" identifier | (binary_expression "(1L << ((byte)param_2 & 0x3f)) - 1U" (parenthesized_expression "(1L << ((byte)param_2 & 0x3f))" ( (binary_expression "1L << ((byte)param_2 & 0x3f)" number_literal << (parenthesized_expression "((byte)param_2 & 0x3f)" ( (binary_expression "(byte)param_2 & 0x3f" (cast_expression "(byte)param_2" ( (type_descriptor "byte" type_identifier) ) identifier) & number_literal) ))) )) - number_literal))) ;) (while_statement "while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }" while (parenthesized_expression "(uVar5 == 0xffffffffffffffff)" ( (binary_expression "uVar5 == 0xffffffffffffffff" identifier == number_literal) )) (compound_statement "{\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }" { (if_statement "if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }" if (parenthesized_expression "(puVar1 == puVar4)" ( (binary_expression "puVar1 == puVar4" identifier == identifier) )) (compound_statement "{\n        return lVar3 * 0x40;\n      }" { (return_statement "return lVar3 * 0x40;" return (binary_expression "lVar3 * 0x40" identifier * number_literal) ;) })) (expression_statement "puVar4 = puVar4 + 1;" (assignment_expression "puVar4 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (expression_statement "uVar5 = *puVar4;" (assignment_expression "uVar5 = *puVar4" identifier = (pointer_expression "*puVar4" * identifier)) ;) })) (expression_statement "uVar5 = ~uVar5;" (assignment_expression "uVar5 = ~uVar5" identifier = (unary_expression "~uVar5" ~ identifier)) ;) }) (else_clause "else {\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }" else (compound_statement "{\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }" { (expression_statement "uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);" (assignment_expression "uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f)" identifier = (binary_expression "uVar5 & -1L << ((byte)param_2 & 0x3f)" identifier & (binary_expression "-1L << ((byte)param_2 & 0x3f)" number_literal << (parenthesized_expression "((byte)param_2 & 0x3f)" ( (binary_expression "(byte)param_2 & 0x3f" (cast_expression "(byte)param_2" ( (type_descriptor "byte" type_identifier) ) identifier) & number_literal) ))))) ;) (if_statement "if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }" if (parenthesized_expression "(uVar5 == 0)" ( (binary_expression "uVar5 == 0" identifier == number_literal) )) (compound_statement "{\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }" { (if_statement "if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }" if (parenthesized_expression "(puVar1 == puVar4)" ( (binary_expression "puVar1 == puVar4" identifier == identifier) )) (compound_statement "{\n        return 0xffffffffffffffff;\n      }" { (return_statement "return 0xffffffffffffffff;" return number_literal ;) })) (labeled_statement "LAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);" statement_identifier : (do_statement "do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);" do (compound_statement "{\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      }" { (expression_statement "uVar5 = puVar4[1];" (assignment_expression "uVar5 = puVar4[1]" identifier = (subscript_expression "puVar4[1]" identifier [ number_literal ])) ;) (expression_statement "puVar4 = puVar4 + 1;" (assignment_expression "puVar4 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (labeled_statement "LAB_00123df2:" statement_identifier : (expression_statement "" ;)) }) while (parenthesized_expression "(uVar5 == 0)" ( (binary_expression "uVar5 == 0" identifier == number_literal) )) ;)) })) }))) (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) (if_statement "if (uVar5 != 0) {\n    for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }\n  }" if (parenthesized_expression "(uVar5 != 0)" ( (binary_expression "uVar5 != 0" identifier != number_literal) )) (compound_statement "{\n    for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }\n  }" { (for_statement "for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }" for ( ; (binary_expression "(uVar5 >> lVar3 & 1) == 0" (parenthesized_expression "(uVar5 >> lVar3 & 1)" ( (binary_expression "uVar5 >> lVar3 & 1" (binary_expression "uVar5 >> lVar3" identifier >> identifier) & number_literal) )) == number_literal) ; (assignment_expression "lVar3 = lVar3 + 1" identifier = (binary_expression "lVar3 + 1" identifier + number_literal)) ) (compound_statement "{\n    }" { })) })) (return_statement "return (long)(int)lVar3 + ((long)puVar4 - lVar2 >> 3) * 0x40;" return (binary_expression "(long)(int)lVar3 + ((long)puVar4 - lVar2 >> 3) * 0x40" (cast_expression "(long)(int)lVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (cast_expression "(int)lVar3" ( (type_descriptor "int" primitive_type) ) identifier)) + (binary_expression "((long)puVar4 - lVar2 >> 3) * 0x40" (parenthesized_expression "((long)puVar4 - lVar2 >> 3)" ( (binary_expression "(long)puVar4 - lVar2 >> 3" (binary_expression "(long)puVar4 - lVar2" (cast_expression "(long)puVar4" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - identifier) >> number_literal) )) * number_literal)) ;) })))
(translation_unit "mp_bitcnt_t __gmpz_scan1(mpz_srcptr u,mp_bitcnt_t starting_bit)\n\n{\n  mp_limb_t *pmVar1;\n  long lVar2;\n  mp_bitcnt_t mVar3;\n  ulong *puVar4;\n  ulong uVar5;\n  ulong uVar6;\n  ulong uVar7;\n  \n  uVar6 = (ulong)u->_mp_size;\n  uVar7 = starting_bit >> 6;\n  lVar2 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);\n  if (lVar2 <= (long)uVar7) {\n    mVar3 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      mVar3 = starting_bit;\n    }\n    return mVar3;\n  }\n  pmVar1 = u->_mp_d;\n  puVar4 = pmVar1 + uVar7;\n  uVar5 = *puVar4;\n  if (starting_bit == 0) goto LAB_00123df2;\n  if ((long)uVar6 < 0) {\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (pmVar1[uVar7] == 0);\n    uVar5 = uVar5 | (1L << ((byte)starting_bit & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (pmVar1 + lVar2 + -1 == puVar4) {\n        return lVar2 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }\n  else {\n    uVar5 = uVar5 & -1L << ((byte)starting_bit & 0x3f);\n    if (uVar5 == 0) {\n      if (pmVar1 + lVar2 + -1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }\n  lVar2 = 0;\n  if (uVar5 != 0) {\n    for (; (uVar5 >> lVar2 & 1) == 0; lVar2 = lVar2 + 1) {\n    }\n  }\n  return (long)(int)lVar2 + ((long)puVar4 - (long)pmVar1 >> 3) * 0x40;\n}\n\n" (function_definition "mp_bitcnt_t __gmpz_scan1(mpz_srcptr u,mp_bitcnt_t starting_bit)\n\n{\n  mp_limb_t *pmVar1;\n  long lVar2;\n  mp_bitcnt_t mVar3;\n  ulong *puVar4;\n  ulong uVar5;\n  ulong uVar6;\n  ulong uVar7;\n  \n  uVar6 = (ulong)u->_mp_size;\n  uVar7 = starting_bit >> 6;\n  lVar2 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);\n  if (lVar2 <= (long)uVar7) {\n    mVar3 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      mVar3 = starting_bit;\n    }\n    return mVar3;\n  }\n  pmVar1 = u->_mp_d;\n  puVar4 = pmVar1 + uVar7;\n  uVar5 = *puVar4;\n  if (starting_bit == 0) goto LAB_00123df2;\n  if ((long)uVar6 < 0) {\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (pmVar1[uVar7] == 0);\n    uVar5 = uVar5 | (1L << ((byte)starting_bit & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (pmVar1 + lVar2 + -1 == puVar4) {\n        return lVar2 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }\n  else {\n    uVar5 = uVar5 & -1L << ((byte)starting_bit & 0x3f);\n    if (uVar5 == 0) {\n      if (pmVar1 + lVar2 + -1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }\n  lVar2 = 0;\n  if (uVar5 != 0) {\n    for (; (uVar5 >> lVar2 & 1) == 0; lVar2 = lVar2 + 1) {\n    }\n  }\n  return (long)(int)lVar2 + ((long)puVar4 - (long)pmVar1 >> 3) * 0x40;\n}" type_identifier (function_declarator "__gmpz_scan1(mpz_srcptr u,mp_bitcnt_t starting_bit)" identifier (parameter_list "(mpz_srcptr u,mp_bitcnt_t starting_bit)" ( (parameter_declaration "mpz_srcptr u" type_identifier identifier) , (parameter_declaration "mp_bitcnt_t starting_bit" type_identifier identifier) ))) (compound_statement "{\n  mp_limb_t *pmVar1;\n  long lVar2;\n  mp_bitcnt_t mVar3;\n  ulong *puVar4;\n  ulong uVar5;\n  ulong uVar6;\n  ulong uVar7;\n  \n  uVar6 = (ulong)u->_mp_size;\n  uVar7 = starting_bit >> 6;\n  lVar2 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);\n  if (lVar2 <= (long)uVar7) {\n    mVar3 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      mVar3 = starting_bit;\n    }\n    return mVar3;\n  }\n  pmVar1 = u->_mp_d;\n  puVar4 = pmVar1 + uVar7;\n  uVar5 = *puVar4;\n  if (starting_bit == 0) goto LAB_00123df2;\n  if ((long)uVar6 < 0) {\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (pmVar1[uVar7] == 0);\n    uVar5 = uVar5 | (1L << ((byte)starting_bit & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (pmVar1 + lVar2 + -1 == puVar4) {\n        return lVar2 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }\n  else {\n    uVar5 = uVar5 & -1L << ((byte)starting_bit & 0x3f);\n    if (uVar5 == 0) {\n      if (pmVar1 + lVar2 + -1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }\n  lVar2 = 0;\n  if (uVar5 != 0) {\n    for (; (uVar5 >> lVar2 & 1) == 0; lVar2 = lVar2 + 1) {\n    }\n  }\n  return (long)(int)lVar2 + ((long)puVar4 - (long)pmVar1 >> 3) * 0x40;\n}" { (declaration "mp_limb_t *pmVar1;" type_identifier (pointer_declarator "*pmVar1" * identifier) ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "mp_bitcnt_t mVar3;" type_identifier identifier ;) (declaration "ulong *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "ulong uVar5;" type_identifier identifier ;) (declaration "ulong uVar6;" type_identifier identifier ;) (declaration "ulong uVar7;" type_identifier identifier ;) (expression_statement "uVar6 = (ulong)u->_mp_size;" (assignment_expression "uVar6 = (ulong)u->_mp_size" identifier = (cast_expression "(ulong)u->_mp_size" ( (type_descriptor "ulong" type_identifier) ) (field_expression "u->_mp_size" identifier -> field_identifier))) ;) (expression_statement "uVar7 = starting_bit >> 6;" (assignment_expression "uVar7 = starting_bit >> 6" identifier = (binary_expression "starting_bit >> 6" identifier >> number_literal)) ;) (expression_statement "lVar2 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);" (assignment_expression "lVar2 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f)" identifier = (binary_expression "((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f)" (parenthesized_expression "((long)uVar6 >> 0x3f ^ uVar6)" ( (binary_expression "(long)uVar6 >> 0x3f ^ uVar6" (binary_expression "(long)uVar6 >> 0x3f" (cast_expression "(long)uVar6" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) >> number_literal) ^ identifier) )) - (parenthesized_expression "((long)uVar6 >> 0x3f)" ( (binary_expression "(long)uVar6 >> 0x3f" (cast_expression "(long)uVar6" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) >> number_literal) )))) ;) (if_statement "if (lVar2 <= (long)uVar7) {\n    mVar3 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      mVar3 = starting_bit;\n    }\n    return mVar3;\n  }" if (parenthesized_expression "(lVar2 <= (long)uVar7)" ( (binary_expression "lVar2 <= (long)uVar7" identifier <= (cast_expression "(long)uVar7" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )) (compound_statement "{\n    mVar3 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      mVar3 = starting_bit;\n    }\n    return mVar3;\n  }" { (expression_statement "mVar3 = 0xffffffffffffffff;" (assignment_expression "mVar3 = 0xffffffffffffffff" identifier = number_literal) ;) (if_statement "if ((long)uVar6 < 0) {\n      mVar3 = starting_bit;\n    }" if (parenthesized_expression "((long)uVar6 < 0)" ( (binary_expression "(long)uVar6 < 0" (cast_expression "(long)uVar6" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) < number_literal) )) (compound_statement "{\n      mVar3 = starting_bit;\n    }" { (expression_statement "mVar3 = starting_bit;" (assignment_expression "mVar3 = starting_bit" identifier = identifier) ;) })) (return_statement "return mVar3;" return identifier ;) })) (expression_statement "pmVar1 = u->_mp_d;" (assignment_expression "pmVar1 = u->_mp_d" identifier = (field_expression "u->_mp_d" identifier -> field_identifier)) ;) (expression_statement "puVar4 = pmVar1 + uVar7;" (assignment_expression "puVar4 = pmVar1 + uVar7" identifier = (binary_expression "pmVar1 + uVar7" identifier + identifier)) ;) (expression_statement "uVar5 = *puVar4;" (assignment_expression "uVar5 = *puVar4" identifier = (pointer_expression "*puVar4" * identifier)) ;) (if_statement "if (starting_bit == 0) goto LAB_00123df2;" if (parenthesized_expression "(starting_bit == 0)" ( (binary_expression "starting_bit == 0" identifier == number_literal) )) (goto_statement "goto LAB_00123df2;" goto statement_identifier ;)) (if_statement "if ((long)uVar6 < 0) {\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (pmVar1[uVar7] == 0);\n    uVar5 = uVar5 | (1L << ((byte)starting_bit & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (pmVar1 + lVar2 + -1 == puVar4) {\n        return lVar2 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }\n  else {\n    uVar5 = uVar5 & -1L << ((byte)starting_bit & 0x3f);\n    if (uVar5 == 0) {\n      if (pmVar1 + lVar2 + -1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }" if (parenthesized_expression "((long)uVar6 < 0)" ( (binary_expression "(long)uVar6 < 0" (cast_expression "(long)uVar6" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) < number_literal) )) (compound_statement "{\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (pmVar1[uVar7] == 0);\n    uVar5 = uVar5 | (1L << ((byte)starting_bit & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (pmVar1 + lVar2 + -1 == puVar4) {\n        return lVar2 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }" { (do_statement "do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (pmVar1[uVar7] == 0);" do (compound_statement "{\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    }" { (if_statement "if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }" if (parenthesized_expression "(uVar7 == 0)" ( (binary_expression "uVar7 == 0" identifier == number_literal) )) (compound_statement "{\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }" { (if_statement "if (uVar5 == 0) goto LAB_00123dea;" if (parenthesized_expression "(uVar5 == 0)" ( (binary_expression "uVar5 == 0" identifier == number_literal) )) (goto_statement "goto LAB_00123dea;" goto statement_identifier ;)) (expression_statement "uVar5 = uVar5 - 1;" (assignment_expression "uVar5 = uVar5 - 1" identifier = (binary_expression "uVar5 - 1" identifier - number_literal)) ;) (break_statement "break;" break ;) })) (expression_statement "uVar7 = uVar7 - 1;" (assignment_expression "uVar7 = uVar7 - 1" identifier = (binary_expression "uVar7 - 1" identifier - number_literal)) ;) }) while (parenthesized_expression "(pmVar1[uVar7] == 0)" ( (binary_expression "pmVar1[uVar7] == 0" (subscript_expression "pmVar1[uVar7]" identifier [ identifier ]) == number_literal) )) ;) (expression_statement "uVar5 = uVar5 | (1L << ((byte)starting_bit & 0x3f)) - 1U;" (assignment_expression "uVar5 = uVar5 | (1L << ((byte)starting_bit & 0x3f)) - 1U" identifier = (binary_expression "uVar5 | (1L << ((byte)starting_bit & 0x3f)) - 1U" identifier | (binary_expression "(1L << ((byte)starting_bit & 0x3f)) - 1U" (parenthesized_expression "(1L << ((byte)starting_bit & 0x3f))" ( (binary_expression "1L << ((byte)starting_bit & 0x3f)" number_literal << (parenthesized_expression "((byte)starting_bit & 0x3f)" ( (binary_expression "(byte)starting_bit & 0x3f" (cast_expression "(byte)starting_bit" ( (type_descriptor "byte" type_identifier) ) identifier) & number_literal) ))) )) - number_literal))) ;) (while_statement "while (uVar5 == 0xffffffffffffffff) {\n      if (pmVar1 + lVar2 + -1 == puVar4) {\n        return lVar2 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }" while (parenthesized_expression "(uVar5 == 0xffffffffffffffff)" ( (binary_expression "uVar5 == 0xffffffffffffffff" identifier == number_literal) )) (compound_statement "{\n      if (pmVar1 + lVar2 + -1 == puVar4) {\n        return lVar2 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }" { (if_statement "if (pmVar1 + lVar2 + -1 == puVar4) {\n        return lVar2 * 0x40;\n      }" if (parenthesized_expression "(pmVar1 + lVar2 + -1 == puVar4)" ( (binary_expression "pmVar1 + lVar2 + -1 == puVar4" (binary_expression "pmVar1 + lVar2 + -1" (binary_expression "pmVar1 + lVar2" identifier + identifier) + number_literal) == identifier) )) (compound_statement "{\n        return lVar2 * 0x40;\n      }" { (return_statement "return lVar2 * 0x40;" return (binary_expression "lVar2 * 0x40" identifier * number_literal) ;) })) (expression_statement "puVar4 = puVar4 + 1;" (assignment_expression "puVar4 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (expression_statement "uVar5 = *puVar4;" (assignment_expression "uVar5 = *puVar4" identifier = (pointer_expression "*puVar4" * identifier)) ;) })) (expression_statement "uVar5 = ~uVar5;" (assignment_expression "uVar5 = ~uVar5" identifier = (unary_expression "~uVar5" ~ identifier)) ;) }) (else_clause "else {\n    uVar5 = uVar5 & -1L << ((byte)starting_bit & 0x3f);\n    if (uVar5 == 0) {\n      if (pmVar1 + lVar2 + -1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }" else (compound_statement "{\n    uVar5 = uVar5 & -1L << ((byte)starting_bit & 0x3f);\n    if (uVar5 == 0) {\n      if (pmVar1 + lVar2 + -1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }" { (expression_statement "uVar5 = uVar5 & -1L << ((byte)starting_bit & 0x3f);" (assignment_expression "uVar5 = uVar5 & -1L << ((byte)starting_bit & 0x3f)" identifier = (binary_expression "uVar5 & -1L << ((byte)starting_bit & 0x3f)" identifier & (binary_expression "-1L << ((byte)starting_bit & 0x3f)" number_literal << (parenthesized_expression "((byte)starting_bit & 0x3f)" ( (binary_expression "(byte)starting_bit & 0x3f" (cast_expression "(byte)starting_bit" ( (type_descriptor "byte" type_identifier) ) identifier) & number_literal) ))))) ;) (if_statement "if (uVar5 == 0) {\n      if (pmVar1 + lVar2 + -1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }" if (parenthesized_expression "(uVar5 == 0)" ( (binary_expression "uVar5 == 0" identifier == number_literal) )) (compound_statement "{\n      if (pmVar1 + lVar2 + -1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }" { (if_statement "if (pmVar1 + lVar2 + -1 == puVar4) {\n        return 0xffffffffffffffff;\n      }" if (parenthesized_expression "(pmVar1 + lVar2 + -1 == puVar4)" ( (binary_expression "pmVar1 + lVar2 + -1 == puVar4" (binary_expression "pmVar1 + lVar2 + -1" (binary_expression "pmVar1 + lVar2" identifier + identifier) + number_literal) == identifier) )) (compound_statement "{\n        return 0xffffffffffffffff;\n      }" { (return_statement "return 0xffffffffffffffff;" return number_literal ;) })) (labeled_statement "LAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);" statement_identifier : (do_statement "do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);" do (compound_statement "{\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      }" { (expression_statement "uVar5 = puVar4[1];" (assignment_expression "uVar5 = puVar4[1]" identifier = (subscript_expression "puVar4[1]" identifier [ number_literal ])) ;) (expression_statement "puVar4 = puVar4 + 1;" (assignment_expression "puVar4 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (labeled_statement "LAB_00123df2:" statement_identifier : (expression_statement "" ;)) }) while (parenthesized_expression "(uVar5 == 0)" ( (binary_expression "uVar5 == 0" identifier == number_literal) )) ;)) })) }))) (expression_statement "lVar2 = 0;" (assignment_expression "lVar2 = 0" identifier = number_literal) ;) (if_statement "if (uVar5 != 0) {\n    for (; (uVar5 >> lVar2 & 1) == 0; lVar2 = lVar2 + 1) {\n    }\n  }" if (parenthesized_expression "(uVar5 != 0)" ( (binary_expression "uVar5 != 0" identifier != number_literal) )) (compound_statement "{\n    for (; (uVar5 >> lVar2 & 1) == 0; lVar2 = lVar2 + 1) {\n    }\n  }" { (for_statement "for (; (uVar5 >> lVar2 & 1) == 0; lVar2 = lVar2 + 1) {\n    }" for ( ; (binary_expression "(uVar5 >> lVar2 & 1) == 0" (parenthesized_expression "(uVar5 >> lVar2 & 1)" ( (binary_expression "uVar5 >> lVar2 & 1" (binary_expression "uVar5 >> lVar2" identifier >> identifier) & number_literal) )) == number_literal) ; (assignment_expression "lVar2 = lVar2 + 1" identifier = (binary_expression "lVar2 + 1" identifier + number_literal)) ) (compound_statement "{\n    }" { })) })) (return_statement "return (long)(int)lVar2 + ((long)puVar4 - (long)pmVar1 >> 3) * 0x40;" return (binary_expression "(long)(int)lVar2 + ((long)puVar4 - (long)pmVar1 >> 3) * 0x40" (cast_expression "(long)(int)lVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (cast_expression "(int)lVar2" ( (type_descriptor "int" primitive_type) ) identifier)) + (binary_expression "((long)puVar4 - (long)pmVar1 >> 3) * 0x40" (parenthesized_expression "((long)puVar4 - (long)pmVar1 >> 3)" ( (binary_expression "(long)puVar4 - (long)pmVar1 >> 3" (binary_expression "(long)puVar4 - (long)pmVar1" (cast_expression "(long)puVar4" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - (cast_expression "(long)pmVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) >> number_literal) )) * number_literal)) ;) })))
(translation_unit "ulong __gmpz_scan1(long param_1,ulong param_2)\n\n{\n  ulong *puVar1;\n  long lVar2;\n  long lVar3;\n  ulong *puVar4;\n  ulong uVar5;\n  ulong uVar6;\n  ulong uVar7;\n  \n  uVar6 = (ulong)*(int *)(param_1 + 4);\n  uVar7 = param_2 >> 6;\n  lVar3 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);\n  if (lVar3 <= (long)uVar7) {\n    uVar7 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }\n    return uVar7;\n  }\n  lVar2 = *(long *)(param_1 + 8);\n  puVar4 = (ulong *)(lVar2 + uVar7 * 8);\n  uVar5 = *puVar4;\n  if (param_2 == 0) goto LAB_00123df2;\n  puVar1 = (ulong *)(lVar2 + -8 + lVar3 * 8);\n  if ((long)uVar6 < 0) {\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);\n    uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }\n  else {\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }\n  lVar3 = 0;\n  if (uVar5 != 0) {\n    for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }\n  }\n  return (long)(int)lVar3 + ((long)puVar4 - lVar2 >> 3) * 0x40;\n}\n\n" (function_definition "ulong __gmpz_scan1(long param_1,ulong param_2)\n\n{\n  ulong *puVar1;\n  long lVar2;\n  long lVar3;\n  ulong *puVar4;\n  ulong uVar5;\n  ulong uVar6;\n  ulong uVar7;\n  \n  uVar6 = (ulong)*(int *)(param_1 + 4);\n  uVar7 = param_2 >> 6;\n  lVar3 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);\n  if (lVar3 <= (long)uVar7) {\n    uVar7 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }\n    return uVar7;\n  }\n  lVar2 = *(long *)(param_1 + 8);\n  puVar4 = (ulong *)(lVar2 + uVar7 * 8);\n  uVar5 = *puVar4;\n  if (param_2 == 0) goto LAB_00123df2;\n  puVar1 = (ulong *)(lVar2 + -8 + lVar3 * 8);\n  if ((long)uVar6 < 0) {\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);\n    uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }\n  else {\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }\n  lVar3 = 0;\n  if (uVar5 != 0) {\n    for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }\n  }\n  return (long)(int)lVar3 + ((long)puVar4 - lVar2 >> 3) * 0x40;\n}" type_identifier (function_declarator "__gmpz_scan1(long param_1,ulong param_2)" identifier (parameter_list "(long param_1,ulong param_2)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "ulong param_2" type_identifier identifier) ))) (compound_statement "{\n  ulong *puVar1;\n  long lVar2;\n  long lVar3;\n  ulong *puVar4;\n  ulong uVar5;\n  ulong uVar6;\n  ulong uVar7;\n  \n  uVar6 = (ulong)*(int *)(param_1 + 4);\n  uVar7 = param_2 >> 6;\n  lVar3 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);\n  if (lVar3 <= (long)uVar7) {\n    uVar7 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }\n    return uVar7;\n  }\n  lVar2 = *(long *)(param_1 + 8);\n  puVar4 = (ulong *)(lVar2 + uVar7 * 8);\n  uVar5 = *puVar4;\n  if (param_2 == 0) goto LAB_00123df2;\n  puVar1 = (ulong *)(lVar2 + -8 + lVar3 * 8);\n  if ((long)uVar6 < 0) {\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);\n    uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }\n  else {\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }\n  lVar3 = 0;\n  if (uVar5 != 0) {\n    for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }\n  }\n  return (long)(int)lVar3 + ((long)puVar4 - lVar2 >> 3) * 0x40;\n}" { (declaration "ulong *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "ulong *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "ulong uVar5;" type_identifier identifier ;) (declaration "ulong uVar6;" type_identifier identifier ;) (declaration "ulong uVar7;" type_identifier identifier ;) (expression_statement "uVar6 = (ulong)*(int *)(param_1 + 4);" (assignment_expression "uVar6 = (ulong)*(int *)(param_1 + 4)" identifier = (binary_expression "(ulong)*(int *)(param_1 + 4)" (parenthesized_expression "(ulong)" ( identifier )) * (cast_expression "(int *)(param_1 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) ))))) ;) (expression_statement "uVar7 = param_2 >> 6;" (assignment_expression "uVar7 = param_2 >> 6" identifier = (binary_expression "param_2 >> 6" identifier >> number_literal)) ;) (expression_statement "lVar3 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);" (assignment_expression "lVar3 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f)" identifier = (binary_expression "((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f)" (parenthesized_expression "((long)uVar6 >> 0x3f ^ uVar6)" ( (binary_expression "(long)uVar6 >> 0x3f ^ uVar6" (binary_expression "(long)uVar6 >> 0x3f" (cast_expression "(long)uVar6" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) >> number_literal) ^ identifier) )) - (parenthesized_expression "((long)uVar6 >> 0x3f)" ( (binary_expression "(long)uVar6 >> 0x3f" (cast_expression "(long)uVar6" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) >> number_literal) )))) ;) (if_statement "if (lVar3 <= (long)uVar7) {\n    uVar7 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }\n    return uVar7;\n  }" if (parenthesized_expression "(lVar3 <= (long)uVar7)" ( (binary_expression "lVar3 <= (long)uVar7" identifier <= (cast_expression "(long)uVar7" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )) (compound_statement "{\n    uVar7 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }\n    return uVar7;\n  }" { (expression_statement "uVar7 = 0xffffffffffffffff;" (assignment_expression "uVar7 = 0xffffffffffffffff" identifier = number_literal) ;) (if_statement "if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }" if (parenthesized_expression "((long)uVar6 < 0)" ( (binary_expression "(long)uVar6 < 0" (cast_expression "(long)uVar6" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) < number_literal) )) (compound_statement "{\n      uVar7 = param_2;\n    }" { (expression_statement "uVar7 = param_2;" (assignment_expression "uVar7 = param_2" identifier = identifier) ;) })) (return_statement "return uVar7;" return identifier ;) })) (expression_statement "lVar2 = *(long *)(param_1 + 8);" (assignment_expression "lVar2 = *(long *)(param_1 + 8)" identifier = (pointer_expression "*(long *)(param_1 + 8)" * (cast_expression "(long *)(param_1 + 8)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (expression_statement "puVar4 = (ulong *)(lVar2 + uVar7 * 8);" (assignment_expression "puVar4 = (ulong *)(lVar2 + uVar7 * 8)" identifier = (cast_expression "(ulong *)(lVar2 + uVar7 * 8)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar2 + uVar7 * 8)" ( (binary_expression "lVar2 + uVar7 * 8" identifier + (binary_expression "uVar7 * 8" identifier * number_literal)) )))) ;) (expression_statement "uVar5 = *puVar4;" (assignment_expression "uVar5 = *puVar4" identifier = (pointer_expression "*puVar4" * identifier)) ;) (if_statement "if (param_2 == 0) goto LAB_00123df2;" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (goto_statement "goto LAB_00123df2;" goto statement_identifier ;)) (expression_statement "puVar1 = (ulong *)(lVar2 + -8 + lVar3 * 8);" (assignment_expression "puVar1 = (ulong *)(lVar2 + -8 + lVar3 * 8)" identifier = (cast_expression "(ulong *)(lVar2 + -8 + lVar3 * 8)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar2 + -8 + lVar3 * 8)" ( (binary_expression "lVar2 + -8 + lVar3 * 8" (binary_expression "lVar2 + -8" identifier + number_literal) + (binary_expression "lVar3 * 8" identifier * number_literal)) )))) ;) (if_statement "if ((long)uVar6 < 0) {\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);\n    uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }\n  else {\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }" if (parenthesized_expression "((long)uVar6 < 0)" ( (binary_expression "(long)uVar6 < 0" (cast_expression "(long)uVar6" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) < number_literal) )) (compound_statement "{\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);\n    uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }" { (do_statement "do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);" do (compound_statement "{\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    }" { (if_statement "if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }" if (parenthesized_expression "(uVar7 == 0)" ( (binary_expression "uVar7 == 0" identifier == number_literal) )) (compound_statement "{\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }" { (if_statement "if (uVar5 == 0) goto LAB_00123dea;" if (parenthesized_expression "(uVar5 == 0)" ( (binary_expression "uVar5 == 0" identifier == number_literal) )) (goto_statement "goto LAB_00123dea;" goto statement_identifier ;)) (expression_statement "uVar5 = uVar5 - 1;" (assignment_expression "uVar5 = uVar5 - 1" identifier = (binary_expression "uVar5 - 1" identifier - number_literal)) ;) (break_statement "break;" break ;) })) (expression_statement "uVar7 = uVar7 - 1;" (assignment_expression "uVar7 = uVar7 - 1" identifier = (binary_expression "uVar7 - 1" identifier - number_literal)) ;) }) while (parenthesized_expression "(*(long *)(lVar2 + uVar7 * 8) == 0)" ( (binary_expression "*(long *)(lVar2 + uVar7 * 8) == 0" (pointer_expression "*(long *)(lVar2 + uVar7 * 8)" * (cast_expression "(long *)(lVar2 + uVar7 * 8)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar2 + uVar7 * 8)" ( (binary_expression "lVar2 + uVar7 * 8" identifier + (binary_expression "uVar7 * 8" identifier * number_literal)) )))) == number_literal) )) ;) (expression_statement "uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;" (assignment_expression "uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U" identifier = (binary_expression "uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U" identifier | (binary_expression "(1L << ((byte)param_2 & 0x3f)) - 1U" (parenthesized_expression "(1L << ((byte)param_2 & 0x3f))" ( (binary_expression "1L << ((byte)param_2 & 0x3f)" number_literal << (parenthesized_expression "((byte)param_2 & 0x3f)" ( (binary_expression "(byte)param_2 & 0x3f" (cast_expression "(byte)param_2" ( (type_descriptor "byte" type_identifier) ) identifier) & number_literal) ))) )) - number_literal))) ;) (while_statement "while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }" while (parenthesized_expression "(uVar5 == 0xffffffffffffffff)" ( (binary_expression "uVar5 == 0xffffffffffffffff" identifier == number_literal) )) (compound_statement "{\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }" { (if_statement "if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }" if (parenthesized_expression "(puVar1 == puVar4)" ( (binary_expression "puVar1 == puVar4" identifier == identifier) )) (compound_statement "{\n        return lVar3 * 0x40;\n      }" { (return_statement "return lVar3 * 0x40;" return (binary_expression "lVar3 * 0x40" identifier * number_literal) ;) })) (expression_statement "puVar4 = puVar4 + 1;" (assignment_expression "puVar4 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (expression_statement "uVar5 = *puVar4;" (assignment_expression "uVar5 = *puVar4" identifier = (pointer_expression "*puVar4" * identifier)) ;) })) (expression_statement "uVar5 = ~uVar5;" (assignment_expression "uVar5 = ~uVar5" identifier = (unary_expression "~uVar5" ~ identifier)) ;) }) (else_clause "else {\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }" else (compound_statement "{\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }" { (expression_statement "uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);" (assignment_expression "uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f)" identifier = (binary_expression "uVar5 & -1L << ((byte)param_2 & 0x3f)" identifier & (binary_expression "-1L << ((byte)param_2 & 0x3f)" number_literal << (parenthesized_expression "((byte)param_2 & 0x3f)" ( (binary_expression "(byte)param_2 & 0x3f" (cast_expression "(byte)param_2" ( (type_descriptor "byte" type_identifier) ) identifier) & number_literal) ))))) ;) (if_statement "if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }" if (parenthesized_expression "(uVar5 == 0)" ( (binary_expression "uVar5 == 0" identifier == number_literal) )) (compound_statement "{\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }" { (if_statement "if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }" if (parenthesized_expression "(puVar1 == puVar4)" ( (binary_expression "puVar1 == puVar4" identifier == identifier) )) (compound_statement "{\n        return 0xffffffffffffffff;\n      }" { (return_statement "return 0xffffffffffffffff;" return number_literal ;) })) (labeled_statement "LAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);" statement_identifier : (do_statement "do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);" do (compound_statement "{\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      }" { (expression_statement "uVar5 = puVar4[1];" (assignment_expression "uVar5 = puVar4[1]" identifier = (subscript_expression "puVar4[1]" identifier [ number_literal ])) ;) (expression_statement "puVar4 = puVar4 + 1;" (assignment_expression "puVar4 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (labeled_statement "LAB_00123df2:" statement_identifier : (expression_statement "" ;)) }) while (parenthesized_expression "(uVar5 == 0)" ( (binary_expression "uVar5 == 0" identifier == number_literal) )) ;)) })) }))) (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) (if_statement "if (uVar5 != 0) {\n    for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }\n  }" if (parenthesized_expression "(uVar5 != 0)" ( (binary_expression "uVar5 != 0" identifier != number_literal) )) (compound_statement "{\n    for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }\n  }" { (for_statement "for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }" for ( ; (binary_expression "(uVar5 >> lVar3 & 1) == 0" (parenthesized_expression "(uVar5 >> lVar3 & 1)" ( (binary_expression "uVar5 >> lVar3 & 1" (binary_expression "uVar5 >> lVar3" identifier >> identifier) & number_literal) )) == number_literal) ; (assignment_expression "lVar3 = lVar3 + 1" identifier = (binary_expression "lVar3 + 1" identifier + number_literal)) ) (compound_statement "{\n    }" { })) })) (return_statement "return (long)(int)lVar3 + ((long)puVar4 - lVar2 >> 3) * 0x40;" return (binary_expression "(long)(int)lVar3 + ((long)puVar4 - lVar2 >> 3) * 0x40" (cast_expression "(long)(int)lVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (cast_expression "(int)lVar3" ( (type_descriptor "int" primitive_type) ) identifier)) + (binary_expression "((long)puVar4 - lVar2 >> 3) * 0x40" (parenthesized_expression "((long)puVar4 - lVar2 >> 3)" ( (binary_expression "(long)puVar4 - lVar2 >> 3" (binary_expression "(long)puVar4 - lVar2" (cast_expression "(long)puVar4" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - identifier) >> number_literal) )) * number_literal)) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( IDENT )) * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT >> LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) >> LIT) ^ IDENT) )) - (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) >> LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) + (binary_expression IDENT * LIT)) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) < LIT) )) (compound_statement { (do_statement do (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (break_statement break ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) }) while (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) == LIT) )) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT | (binary_expression (parenthesized_expression ( (binary_expression LIT << (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) & LIT) ))) )) - LIT))) ;) (while_statement while (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (return_statement return (binary_expression IDENT * LIT) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) })) (expression_statement (assignment_expression IDENT = (unary_expression ~ IDENT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT & (binary_expression LIT << (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) & LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (return_statement return LIT ;) })) (labeled_statement statement_identifier : (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (labeled_statement statement_identifier : (expression_statement ;)) }) while (parenthesized_expression ( (binary_expression IDENT == LIT) )) ;)) })) }))) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (for_statement for ( ; (binary_expression (parenthesized_expression ( (binary_expression (binary_expression IDENT >> IDENT) & LIT) )) == LIT) ; (assignment_expression IDENT = (binary_expression IDENT + LIT)) ) (compound_statement { })) })) (return_statement return (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) (cast_expression ( (type_descriptor TYPE) ) IDENT)) + (binary_expression (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) - IDENT) >> LIT) )) * LIT)) ;) })))
(function_definition "ulong __gmpz_scan1(long param_1,ulong param_2)\n\n{\n  ulong *puVar1;\n  long lVar2;\n  long lVar3;\n  ulong *puVar4;\n  ulong uVar5;\n  ulong uVar6;\n  ulong uVar7;\n  \n  uVar6 = (ulong)*(int *)(param_1 + 4);\n  uVar7 = param_2 >> 6;\n  lVar3 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);\n  if (lVar3 <= (long)uVar7) {\n    uVar7 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }\n    return uVar7;\n  }\n  lVar2 = *(long *)(param_1 + 8);\n  puVar4 = (ulong *)(lVar2 + uVar7 * 8);\n  uVar5 = *puVar4;\n  if (param_2 == 0) goto LAB_00123df2;\n  puVar1 = (ulong *)(lVar2 + -8 + lVar3 * 8);\n  if ((long)uVar6 < 0) {\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);\n    uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }\n  else {\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }\n  lVar3 = 0;\n  if (uVar5 != 0) {\n    for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }\n  }\n  return (long)(int)lVar3 + ((long)puVar4 - lVar2 >> 3) * 0x40;\n}" (type_identifier "ulong") (function_declarator "__gmpz_scan1(long param_1,ulong param_2)" (identifier "__gmpz_scan1") (parameter_list "(long param_1,ulong param_2)" (( "(") (parameter_declaration "long param_1" (sized_type_specifier "long" (long "long")) (identifier "param_1")) (, ",") (parameter_declaration "ulong param_2" (type_identifier "ulong") (identifier "param_2")) () ")"))) (compound_statement "{\n  ulong *puVar1;\n  long lVar2;\n  long lVar3;\n  ulong *puVar4;\n  ulong uVar5;\n  ulong uVar6;\n  ulong uVar7;\n  \n  uVar6 = (ulong)*(int *)(param_1 + 4);\n  uVar7 = param_2 >> 6;\n  lVar3 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);\n  if (lVar3 <= (long)uVar7) {\n    uVar7 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }\n    return uVar7;\n  }\n  lVar2 = *(long *)(param_1 + 8);\n  puVar4 = (ulong *)(lVar2 + uVar7 * 8);\n  uVar5 = *puVar4;\n  if (param_2 == 0) goto LAB_00123df2;\n  puVar1 = (ulong *)(lVar2 + -8 + lVar3 * 8);\n  if ((long)uVar6 < 0) {\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);\n    uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }\n  else {\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }\n  lVar3 = 0;\n  if (uVar5 != 0) {\n    for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }\n  }\n  return (long)(int)lVar3 + ((long)puVar4 - lVar2 >> 3) * 0x40;\n}" ({ "{") (declaration "ulong *puVar1;" (type_identifier "ulong") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "long lVar2;" (sized_type_specifier "long" (long "long")) (identifier "lVar2") (; ";")) (declaration "long lVar3;" (sized_type_specifier "long" (long "long")) (identifier "lVar3") (; ";")) (declaration "ulong *puVar4;" (type_identifier "ulong") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (declaration "ulong uVar5;" (type_identifier "ulong") (identifier "uVar5") (; ";")) (declaration "ulong uVar6;" (type_identifier "ulong") (identifier "uVar6") (; ";")) (declaration "ulong uVar7;" (type_identifier "ulong") (identifier "uVar7") (; ";")) (expression_statement "uVar6 = (ulong)*(int *)(param_1 + 4);" (assignment_expression "uVar6 = (ulong)*(int *)(param_1 + 4)" (identifier "uVar6") (= "=") (binary_expression "(ulong)*(int *)(param_1 + 4)" (parenthesized_expression "(ulong)" (( "(") (identifier "ulong") () ")")) (* "*") (cast_expression "(int *)(param_1 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 4)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) () ")"))))) (; ";")) (expression_statement "uVar7 = param_2 >> 6;" (assignment_expression "uVar7 = param_2 >> 6" (identifier "uVar7") (= "=") (binary_expression "param_2 >> 6" (identifier "param_2") (>> ">>") (number_literal "6"))) (; ";")) (expression_statement "lVar3 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);" (assignment_expression "lVar3 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f)" (identifier "lVar3") (= "=") (binary_expression "((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f)" (parenthesized_expression "((long)uVar6 >> 0x3f ^ uVar6)" (( "(") (binary_expression "(long)uVar6 >> 0x3f ^ uVar6" (binary_expression "(long)uVar6 >> 0x3f" (cast_expression "(long)uVar6" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "uVar6")) (>> ">>") (number_literal "0x3f")) (^ "^") (identifier "uVar6")) () ")")) (- "-") (parenthesized_expression "((long)uVar6 >> 0x3f)" (( "(") (binary_expression "(long)uVar6 >> 0x3f" (cast_expression "(long)uVar6" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "uVar6")) (>> ">>") (number_literal "0x3f")) () ")")))) (; ";")) (if_statement "if (lVar3 <= (long)uVar7) {\n    uVar7 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }\n    return uVar7;\n  }" (if "if") (parenthesized_expression "(lVar3 <= (long)uVar7)" (( "(") (binary_expression "lVar3 <= (long)uVar7" (identifier "lVar3") (<= "<=") (cast_expression "(long)uVar7" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "uVar7"))) () ")")) (compound_statement "{\n    uVar7 = 0xffffffffffffffff;\n    if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }\n    return uVar7;\n  }" ({ "{") (expression_statement "uVar7 = 0xffffffffffffffff;" (assignment_expression "uVar7 = 0xffffffffffffffff" (identifier "uVar7") (= "=") (number_literal "0xffffffffffffffff")) (; ";")) (if_statement "if ((long)uVar6 < 0) {\n      uVar7 = param_2;\n    }" (if "if") (parenthesized_expression "((long)uVar6 < 0)" (( "(") (binary_expression "(long)uVar6 < 0" (cast_expression "(long)uVar6" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "uVar6")) (< "<") (number_literal "0")) () ")")) (compound_statement "{\n      uVar7 = param_2;\n    }" ({ "{") (expression_statement "uVar7 = param_2;" (assignment_expression "uVar7 = param_2" (identifier "uVar7") (= "=") (identifier "param_2")) (; ";")) (} "}"))) (return_statement "return uVar7;" (return "return") (identifier "uVar7") (; ";")) (} "}"))) (expression_statement "lVar2 = *(long *)(param_1 + 8);" (assignment_expression "lVar2 = *(long *)(param_1 + 8)" (identifier "lVar2") (= "=") (pointer_expression "*(long *)(param_1 + 8)" (* "*") (cast_expression "(long *)(param_1 + 8)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")"))))) (; ";")) (expression_statement "puVar4 = (ulong *)(lVar2 + uVar7 * 8);" (assignment_expression "puVar4 = (ulong *)(lVar2 + uVar7 * 8)" (identifier "puVar4") (= "=") (cast_expression "(ulong *)(lVar2 + uVar7 * 8)" (( "(") (type_descriptor "ulong *" (type_identifier "ulong") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar2 + uVar7 * 8)" (( "(") (binary_expression "lVar2 + uVar7 * 8" (identifier "lVar2") (+ "+") (binary_expression "uVar7 * 8" (identifier "uVar7") (* "*") (number_literal "8"))) () ")")))) (; ";")) (expression_statement "uVar5 = *puVar4;" (assignment_expression "uVar5 = *puVar4" (identifier "uVar5") (= "=") (pointer_expression "*puVar4" (* "*") (identifier "puVar4"))) (; ";")) (if_statement "if (param_2 == 0) goto LAB_00123df2;" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_00123df2;" (goto "goto") (statement_identifier "LAB_00123df2") (; ";"))) (expression_statement "puVar1 = (ulong *)(lVar2 + -8 + lVar3 * 8);" (assignment_expression "puVar1 = (ulong *)(lVar2 + -8 + lVar3 * 8)" (identifier "puVar1") (= "=") (cast_expression "(ulong *)(lVar2 + -8 + lVar3 * 8)" (( "(") (type_descriptor "ulong *" (type_identifier "ulong") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar2 + -8 + lVar3 * 8)" (( "(") (binary_expression "lVar2 + -8 + lVar3 * 8" (binary_expression "lVar2 + -8" (identifier "lVar2") (+ "+") (number_literal "-8")) (+ "+") (binary_expression "lVar3 * 8" (identifier "lVar3") (* "*") (number_literal "8"))) () ")")))) (; ";")) (if_statement "if ((long)uVar6 < 0) {\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);\n    uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }\n  else {\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }" (if "if") (parenthesized_expression "((long)uVar6 < 0)" (( "(") (binary_expression "(long)uVar6 < 0" (cast_expression "(long)uVar6" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "uVar6")) (< "<") (number_literal "0")) () ")")) (compound_statement "{\n    do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);\n    uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;\n    while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }\n    uVar5 = ~uVar5;\n  }" ({ "{") (do_statement "do {\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    } while (*(long *)(lVar2 + uVar7 * 8) == 0);" (do "do") (compound_statement "{\n      if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }\n      uVar7 = uVar7 - 1;\n    }" ({ "{") (if_statement "if (uVar7 == 0) {\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }" (if "if") (parenthesized_expression "(uVar7 == 0)" (( "(") (binary_expression "uVar7 == 0" (identifier "uVar7") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        if (uVar5 == 0) goto LAB_00123dea;\n        uVar5 = uVar5 - 1;\n        break;\n      }" ({ "{") (if_statement "if (uVar5 == 0) goto LAB_00123dea;" (if "if") (parenthesized_expression "(uVar5 == 0)" (( "(") (binary_expression "uVar5 == 0" (identifier "uVar5") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_00123dea;" (goto "goto") (statement_identifier "LAB_00123dea") (; ";"))) (expression_statement "uVar5 = uVar5 - 1;" (assignment_expression "uVar5 = uVar5 - 1" (identifier "uVar5") (= "=") (binary_expression "uVar5 - 1" (identifier "uVar5") (- "-") (number_literal "1"))) (; ";")) (break_statement "break;" (break "break") (; ";")) (} "}"))) (expression_statement "uVar7 = uVar7 - 1;" (assignment_expression "uVar7 = uVar7 - 1" (identifier "uVar7") (= "=") (binary_expression "uVar7 - 1" (identifier "uVar7") (- "-") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(*(long *)(lVar2 + uVar7 * 8) == 0)" (( "(") (binary_expression "*(long *)(lVar2 + uVar7 * 8) == 0" (pointer_expression "*(long *)(lVar2 + uVar7 * 8)" (* "*") (cast_expression "(long *)(lVar2 + uVar7 * 8)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar2 + uVar7 * 8)" (( "(") (binary_expression "lVar2 + uVar7 * 8" (identifier "lVar2") (+ "+") (binary_expression "uVar7 * 8" (identifier "uVar7") (* "*") (number_literal "8"))) () ")")))) (== "==") (number_literal "0")) () ")")) (; ";")) (expression_statement "uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;" (assignment_expression "uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U" (identifier "uVar5") (= "=") (binary_expression "uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U" (identifier "uVar5") (| "|") (binary_expression "(1L << ((byte)param_2 & 0x3f)) - 1U" (parenthesized_expression "(1L << ((byte)param_2 & 0x3f))" (( "(") (binary_expression "1L << ((byte)param_2 & 0x3f)" (number_literal "1L") (<< "<<") (parenthesized_expression "((byte)param_2 & 0x3f)" (( "(") (binary_expression "(byte)param_2 & 0x3f" (cast_expression "(byte)param_2" (( "(") (type_descriptor "byte" (type_identifier "byte")) () ")") (identifier "param_2")) (& "&") (number_literal "0x3f")) () ")"))) () ")")) (- "-") (number_literal "1U")))) (; ";")) (while_statement "while (uVar5 == 0xffffffffffffffff) {\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }" (while "while") (parenthesized_expression "(uVar5 == 0xffffffffffffffff)" (( "(") (binary_expression "uVar5 == 0xffffffffffffffff" (identifier "uVar5") (== "==") (number_literal "0xffffffffffffffff")) () ")")) (compound_statement "{\n      if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }\n      puVar4 = puVar4 + 1;\n      uVar5 = *puVar4;\n    }" ({ "{") (if_statement "if (puVar1 == puVar4) {\n        return lVar3 * 0x40;\n      }" (if "if") (parenthesized_expression "(puVar1 == puVar4)" (( "(") (binary_expression "puVar1 == puVar4" (identifier "puVar1") (== "==") (identifier "puVar4")) () ")")) (compound_statement "{\n        return lVar3 * 0x40;\n      }" ({ "{") (return_statement "return lVar3 * 0x40;" (return "return") (binary_expression "lVar3 * 0x40" (identifier "lVar3") (* "*") (number_literal "0x40")) (; ";")) (} "}"))) (expression_statement "puVar4 = puVar4 + 1;" (assignment_expression "puVar4 = puVar4 + 1" (identifier "puVar4") (= "=") (binary_expression "puVar4 + 1" (identifier "puVar4") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "uVar5 = *puVar4;" (assignment_expression "uVar5 = *puVar4" (identifier "uVar5") (= "=") (pointer_expression "*puVar4" (* "*") (identifier "puVar4"))) (; ";")) (} "}"))) (expression_statement "uVar5 = ~uVar5;" (assignment_expression "uVar5 = ~uVar5" (identifier "uVar5") (= "=") (unary_expression "~uVar5" (~ "~") (identifier "uVar5"))) (; ";")) (} "}")) (else_clause "else {\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }" (else "else") (compound_statement "{\n    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);\n    if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }\n  }" ({ "{") (expression_statement "uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);" (assignment_expression "uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f)" (identifier "uVar5") (= "=") (binary_expression "uVar5 & -1L << ((byte)param_2 & 0x3f)" (identifier "uVar5") (& "&") (binary_expression "-1L << ((byte)param_2 & 0x3f)" (number_literal "-1L") (<< "<<") (parenthesized_expression "((byte)param_2 & 0x3f)" (( "(") (binary_expression "(byte)param_2 & 0x3f" (cast_expression "(byte)param_2" (( "(") (type_descriptor "byte" (type_identifier "byte")) () ")") (identifier "param_2")) (& "&") (number_literal "0x3f")) () ")"))))) (; ";")) (if_statement "if (uVar5 == 0) {\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }" (if "if") (parenthesized_expression "(uVar5 == 0)" (( "(") (binary_expression "uVar5 == 0" (identifier "uVar5") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }\nLAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);\n    }" ({ "{") (if_statement "if (puVar1 == puVar4) {\n        return 0xffffffffffffffff;\n      }" (if "if") (parenthesized_expression "(puVar1 == puVar4)" (( "(") (binary_expression "puVar1 == puVar4" (identifier "puVar1") (== "==") (identifier "puVar4")) () ")")) (compound_statement "{\n        return 0xffffffffffffffff;\n      }" ({ "{") (return_statement "return 0xffffffffffffffff;" (return "return") (number_literal "0xffffffffffffffff") (; ";")) (} "}"))) (labeled_statement "LAB_00123dea:\n      do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);" (statement_identifier "LAB_00123dea") (: ":") (do_statement "do {\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      } while (uVar5 == 0);" (do "do") (compound_statement "{\n        uVar5 = puVar4[1];\n        puVar4 = puVar4 + 1;\nLAB_00123df2:\n      }" ({ "{") (expression_statement "uVar5 = puVar4[1];" (assignment_expression "uVar5 = puVar4[1]" (identifier "uVar5") (= "=") (subscript_expression "puVar4[1]" (identifier "puVar4") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "puVar4 = puVar4 + 1;" (assignment_expression "puVar4 = puVar4 + 1" (identifier "puVar4") (= "=") (binary_expression "puVar4 + 1" (identifier "puVar4") (+ "+") (number_literal "1"))) (; ";")) (labeled_statement "LAB_00123df2:" (statement_identifier "LAB_00123df2") (: ":") (expression_statement "" (; ""))) (} "}")) (while "while") (parenthesized_expression "(uVar5 == 0)" (( "(") (binary_expression "uVar5 == 0" (identifier "uVar5") (== "==") (number_literal "0")) () ")")) (; ";"))) (} "}"))) (} "}")))) (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" (identifier "lVar3") (= "=") (number_literal "0")) (; ";")) (if_statement "if (uVar5 != 0) {\n    for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }\n  }" (if "if") (parenthesized_expression "(uVar5 != 0)" (( "(") (binary_expression "uVar5 != 0" (identifier "uVar5") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }\n  }" ({ "{") (for_statement "for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {\n    }" (for "for") (( "(") (; ";") (binary_expression "(uVar5 >> lVar3 & 1) == 0" (parenthesized_expression "(uVar5 >> lVar3 & 1)" (( "(") (binary_expression "uVar5 >> lVar3 & 1" (binary_expression "uVar5 >> lVar3" (identifier "uVar5") (>> ">>") (identifier "lVar3")) (& "&") (number_literal "1")) () ")")) (== "==") (number_literal "0")) (; ";") (assignment_expression "lVar3 = lVar3 + 1" (identifier "lVar3") (= "=") (binary_expression "lVar3 + 1" (identifier "lVar3") (+ "+") (number_literal "1"))) () ")") (compound_statement "{\n    }" ({ "{") (} "}"))) (} "}"))) (return_statement "return (long)(int)lVar3 + ((long)puVar4 - lVar2 >> 3) * 0x40;" (return "return") (binary_expression "(long)(int)lVar3 + ((long)puVar4 - lVar2 >> 3) * 0x40" (cast_expression "(long)(int)lVar3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (cast_expression "(int)lVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "lVar3"))) (+ "+") (binary_expression "((long)puVar4 - lVar2 >> 3) * 0x40" (parenthesized_expression "((long)puVar4 - lVar2 >> 3)" (( "(") (binary_expression "(long)puVar4 - lVar2 >> 3" (binary_expression "(long)puVar4 - lVar2" (cast_expression "(long)puVar4" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar4")) (- "-") (identifier "lVar2")) (>> ">>") (number_literal "3")) () ")")) (* "*") (number_literal "0x40"))) (; ";")) (} "}")))

type_1 function_1(type_2 u,type_1 var_1)

{
  type_3 *var_4;
  long var_3;
  type_1 mVar3;
  type_4 *var_7;
  type_4 var_6;
  type_4 var_2;
  type_4 var_5;
  
  var_2 = (type_4)u->_mp_size;
  var_5 = var_1 >> 6;
  var_3 = ((long)var_2 >> 0x3f ^ var_2) - ((long)var_2 >> 0x3f);
  if (var_3 <= (long)var_5) {
    mVar3 = 0xffffffffffffffff;
    if ((long)var_2 < 0) {
      mVar3 = var_1;
    }
    return mVar3;
  }
  var_4 = u->_mp_d;
  var_7 = var_4 + var_5;
  var_6 = *var_7;
  if (var_1 == 0) goto LAB_00123df2;
  if ((long)var_2 < 0) {
    do {
      if (var_5 == 0) {
        if (var_6 == 0) goto LAB_00123dea;
        var_6 = var_6 - 1;
        break;
      }
      var_5 = var_5 - 1;
    } while (var_4[var_5] == 0);
    var_6 = var_6 | (1L << ((type_5)var_1 & 0x3f)) - 1U;
    while (var_6 == 0xffffffffffffffff) {
      if (var_4 + var_3 + -1 == var_7) {
        return var_3 * 0x40;
      }
      var_7 = var_7 + 1;
      var_6 = *var_7;
    }
    var_6 = ~var_6;
  }
  else {
    var_6 = var_6 & -1L << ((type_5)var_1 & 0x3f);
    if (var_6 == 0) {
      if (var_4 + var_3 + -1 == var_7) {
        return 0xffffffffffffffff;
      }
LAB_00123dea:
      do {
        var_6 = var_7[1];
        var_7 = var_7 + 1;
LAB_00123df2:
      } while (var_6 == 0);
    }
  }
  var_3 = 0;
  if (var_6 != 0) {
    for (; (var_6 >> var_3 & 1) == 0; var_3 = var_3 + 1) {
    }
  }
  return (long)(int)var_3 + ((long)var_7 - (long)var_4 >> 3) * 0x40;
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (sized_type_specifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (sized_type_specifier) 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)) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (identifier)) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (number_literal)) right: (identifier))) right: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (binary_expression left: (identifier) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (number_literal))) consequence: (compound_statement (do_statement body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (break_statement))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))))) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (number_literal) right: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)) right: (number_literal))))) right: (number_literal))))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (return_statement (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: (identifier) right: (pointer_expression argument: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (unary_expression argument: (identifier))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (binary_expression left: (number_literal) right: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (return_statement (number_literal)))) (labeled_statement label: (statement_identifier) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (labeled_statement label: (statement_identifier) (expression_statement (MISSING ";")))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (for_statement condition: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (number_literal))) right: (number_literal)) update: (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))) body: (compound_statement)))) (return_statement (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier))) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (identifier)) right: (number_literal))) right: (number_literal)))))))

ulong MASKED(long param_1,ulong param_2)

{
  ulong *puVar1;
  long lVar2;
  long lVar3;
  ulong *puVar4;
  ulong uVar5;
  ulong uVar6;
  ulong uVar7;
  
  uVar6 = (ulong)*(int *)(param_1 + 4);
  uVar7 = param_2 >> 6;
  lVar3 = ((long)uVar6 >> 0x3f ^ uVar6) - ((long)uVar6 >> 0x3f);
  if (lVar3 <= (long)uVar7) {
    uVar7 = 0xffffffffffffffff;
    if ((long)uVar6 < 0) {
      uVar7 = param_2;
    }
    return uVar7;
  }
  lVar2 = *(long *)(param_1 + 8);
  puVar4 = (ulong *)(lVar2 + uVar7 * 8);
  uVar5 = *puVar4;
  if (param_2 == 0) goto LAB_00123df2;
  puVar1 = (ulong *)(lVar2 + -8 + lVar3 * 8);
  if ((long)uVar6 < 0) {
    do {
      if (uVar7 == 0) {
        if (uVar5 == 0) goto LAB_00123dea;
        uVar5 = uVar5 - 1;
        break;
      }
      uVar7 = uVar7 - 1;
    } while (*(long *)(lVar2 + uVar7 * 8) == 0);
    uVar5 = uVar5 | (1L << ((byte)param_2 & 0x3f)) - 1U;
    while (uVar5 == 0xffffffffffffffff) {
      if (puVar1 == puVar4) {
        return lVar3 * 0x40;
      }
      puVar4 = puVar4 + 1;
      uVar5 = *puVar4;
    }
    uVar5 = ~uVar5;
  }
  else {
    uVar5 = uVar5 & -1L << ((byte)param_2 & 0x3f);
    if (uVar5 == 0) {
      if (puVar1 == puVar4) {
        return 0xffffffffffffffff;
      }
LAB_00123dea:
      do {
        uVar5 = puVar4[1];
        puVar4 = puVar4 + 1;
LAB_00123df2:
      } while (uVar5 == 0);
    }
  }
  lVar3 = 0;
  if (uVar5 != 0) {
    for (; (uVar5 >> lVar3 & 1) == 0; lVar3 = lVar3 + 1) {
    }
  }
  return (long)(int)lVar3 + ((long)puVar4 - lVar2 >> 3) * 0x40;
}

