
int32 pstm_montgomery_calc_normalization(pstm_int *a,pstm_int *b)

{
  pstm_digit *ppVar1;
  int32 iVar2;
  uint uVar3;
  int iVar4;
  uint uVar5;
  pstm_digit *ppVar6;
  uint uVar7;
  uint uVar8;
  
  iVar4 = b->used;
  if (iVar4 != 0) {
    uVar8 = 0x20;
    uVar5 = b->dp[iVar4 + -1];
    uVar7 = (iVar4 + -1) * 0x20;
    uVar3 = uVar7;
    if (uVar5 != 0) {
      do {
        uVar5 = uVar5 >> 1;
        uVar3 = uVar3 + 1;
      } while (uVar5 != 0);
      uVar8 = uVar3 & 0x8000001f;
      if ((int)uVar8 < 0) {
        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;
        if (uVar8 == 0) {
          uVar8 = 0x20;
        }
      }
      else if (uVar8 == 0) {
        uVar8 = 0x20;
      }
    }
    if (1 < iVar4) {
      iVar4 = uVar8 - 1;
      iVar2 = pstm_2expt(a,uVar8 + uVar7 + -1);
      if (iVar2 != 0) {
        return iVar2;
      }
      goto LAB_0004e984;
    }
  }
  ppVar6 = a->dp;
  a->sign = 0;
  a->used = 0;
  if (0 < a->alloc) {
    iVar4 = 0;
    ppVar1 = ppVar6;
    do {
      *ppVar1 = 0;
      iVar4 = iVar4 + 1;
      ppVar1 = ppVar1 + 1;
    } while (iVar4 < a->alloc);
  }
  iVar4 = 0;
  *ppVar6 = 1;
  a->used = 1;
LAB_0004e984:
  while ((iVar2 = pstm_mul_2(a,a), iVar2 == 0 &&
         ((iVar2 = pstm_cmp_mag(a,b), iVar2 == -1 || (iVar2 = s_pstm_sub(a,b,a), iVar2 == 0))))) {
    iVar4 = iVar4 + 1;
    if (iVar4 == 0x20) {
      return 0;
    }
  }
  return -8;
}



int pstm_montgomery_calc_normalization(undefined4 *param_1,int *param_2)

{
  undefined4 *puVar1;
  uint uVar2;
  int iVar3;
  uint uVar4;
  undefined4 *puVar5;
  uint uVar6;
  int iVar7;
  uint uVar8;
  
  iVar3 = *param_2;
  if (iVar3 != 0) {
    uVar8 = 0x20;
    uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);
    uVar6 = (iVar3 + -1) * 0x20;
    uVar2 = uVar6;
    if (uVar4 != 0) {
      do {
        uVar4 = uVar4 >> 1;
        uVar2 = uVar2 + 1;
      } while (uVar4 != 0);
      uVar8 = uVar2 & 0x8000001f;
      if ((int)uVar8 < 0) {
        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;
        if (uVar8 == 0) {
          uVar8 = 0x20;
        }
      }
      else if (uVar8 == 0) {
        uVar8 = 0x20;
      }
    }
    if (1 < iVar3) {
      iVar7 = uVar8 - 1;
      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);
      if (iVar3 != 0) {
        return iVar3;
      }
      goto LAB_0004e984;
    }
  }
  puVar5 = (undefined4 *)param_1[3];
  param_1[2] = 0;
  *param_1 = 0;
  if (0 < (int)param_1[1]) {
    iVar3 = 0;
    puVar1 = puVar5;
    do {
      *puVar1 = 0;
      iVar3 = iVar3 + 1;
      puVar1 = puVar1 + 1;
    } while (iVar3 < (int)param_1[1]);
  }
  iVar7 = 0;
  *puVar5 = 1;
  *param_1 = 1;
LAB_0004e984:
  while ((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&
         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||
          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))) {
    iVar7 = iVar7 + 1;
    if (iVar7 == 0x20) {
      return 0;
    }
  }
  return -8;
}


lui gp,0xe
addiu gp,gp,0x3874
addu gp,gp,t9
addiu sp,sp,-0x40
lw v1,0x0(a1)
sw gp,0x10(sp)
sw s2,0x20(sp)
or s2,a1,zero
sw s1,0x1c(sp)
or s1,a0,zero
sw ra,0x3c(sp)
sw s8,0x38(sp)
sw s7,0x34(sp)
sw s6,0x30(sp)
sw s5,0x2c(sp)
sw s4,0x28(sp)
sw s3,0x24(sp)
bne v1,zero,0x0004e9d4
_sw s0,0x18(sp)
lw v0,0x4(s1)
lw a1,0xc(s1)
sw zero,0x8(s1)
blez v0,0x0004e960
_sw zero,0x0(s1)
or v1,zero,zero
or v0,a1,zero
addiu v0,v0,0x4
sw zero,-0x4(v0)
lw a0,0x4(s1)
addiu v1,v1,0x1
slt a0,v1,a0
bne a0,zero,0x0004e948
_addiu v0,v0,0x4
li v0,0x1
or s0,zero,zero
sw v0,0x0(a1)
sw v0,0x0(s1)
lw s8,-0x7b24(gp)
li s7,-0x1
lw s6,-0x7b34(gp)
li s5,0x20
lw s4,-0x7b28(gp)
or a1,s1,zero
or t9,s8,zero
bal 0x0004e4c4
_or a0,s1,zero
beq v0,zero,0x0004ea84
_or s3,v0,zero
lw ra,0x3c(sp)
li s3,-0x8
lw s8,0x38(sp)
or v0,s3,zero
lw s7,0x34(sp)
lw s6,0x30(sp)
lw s5,0x2c(sp)
lw s4,0x28(sp)
lw s3,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x40
lw a0,0xc(a1)
sll v0,v1,0x2
addiu a1,v1,-0x1
li s0,0x20
addu v0,a0,v0
lw a0,-0x4(v0)
beq a0,zero,0x0004ea24
_sll a1,a1,0x5
or v0,a1,zero
srl a0,a0,0x1
bne a0,zero,0x0004e9f8
_addiu v0,v0,0x1
lui a0,0x8000
addiu a0,a0,0x1f
and v0,v0,a0
bltz v0,0x0004eaf0
_nop
bne v0,zero,0x0004ea24
_or s0,v0,zero
li s0,0x20
slti v1,v1,0x2
bne v1,zero,0x0004e928
_addu a1,s0,a1
lw t9,-0x7b20(gp)
or a0,s1,zero
addiu a1,a1,-0x1
bal 0x0004e3dc
_addiu s0,s0,-0x1
lw gp,0x10(sp)
beq v0,zero,0x0004e970
_or s3,v0,zero
lw ra,0x3c(sp)
or v0,s3,zero
lw s8,0x38(sp)
lw s7,0x34(sp)
lw s6,0x30(sp)
lw s5,0x2c(sp)
lw s4,0x28(sp)
lw s3,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x40
or a1,s2,zero
or t9,s6,zero
bal 0x0004dc24
_or a0,s1,zero
beq v0,s7,0x0004eab4
_or a2,s1,zero
or a1,s2,zero
or t9,s4,zero
bal 0x0004e5cc
_or a0,s1,zero
bne v0,zero,0x0004e9a0
_lw ra,0x3c(sp)
addiu s0,s0,0x1
bne s0,s5,0x0004e984
_lw ra,0x3c(sp)
or v0,s3,zero
lw s8,0x38(sp)
lw s7,0x34(sp)
lw s6,0x30(sp)
lw s5,0x2c(sp)
lw s4,0x28(sp)
lw s3,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x40
addiu v0,v0,-0x1
li a0,-0x20
or v0,v0,a0
addiu v0,v0,0x1
bne v0,zero,0x0004ea24
_or s0,v0,zero
b 0x0004ea24
_li s0,0x20
(translation_unit "int pstm_montgomery_calc_normalization(undefined4 *param_1,int *param_2)\n\n{\n  undefined4 *puVar1;\n  uint uVar2;\n  int iVar3;\n  uint uVar4;\n  undefined4 *puVar5;\n  uint uVar6;\n  int iVar7;\n  uint uVar8;\n  \n  iVar3 = *param_2;\n  if (iVar3 != 0) {\n    uVar8 = 0x20;\n    uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);\n    uVar6 = (iVar3 + -1) * 0x20;\n    uVar2 = uVar6;\n    if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }\n  }\n  puVar5 = (undefined4 *)param_1[3];\n  param_1[2] = 0;\n  *param_1 = 0;\n  if (0 < (int)param_1[1]) {\n    iVar3 = 0;\n    puVar1 = puVar5;\n    do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);\n  }\n  iVar7 = 0;\n  *puVar5 = 1;\n  *param_1 = 1;\nLAB_0004e984:\n  while ((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))) {\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }\n  return -8;\n}\n\n" (function_definition "int pstm_montgomery_calc_normalization(undefined4 *param_1,int *param_2)\n\n{\n  undefined4 *puVar1;\n  uint uVar2;\n  int iVar3;\n  uint uVar4;\n  undefined4 *puVar5;\n  uint uVar6;\n  int iVar7;\n  uint uVar8;\n  \n  iVar3 = *param_2;\n  if (iVar3 != 0) {\n    uVar8 = 0x20;\n    uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);\n    uVar6 = (iVar3 + -1) * 0x20;\n    uVar2 = uVar6;\n    if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }\n  }\n  puVar5 = (undefined4 *)param_1[3];\n  param_1[2] = 0;\n  *param_1 = 0;\n  if (0 < (int)param_1[1]) {\n    iVar3 = 0;\n    puVar1 = puVar5;\n    do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);\n  }\n  iVar7 = 0;\n  *puVar5 = 1;\n  *param_1 = 1;\nLAB_0004e984:\n  while ((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))) {\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }\n  return -8;\n}" primitive_type (function_declarator "pstm_montgomery_calc_normalization(undefined4 *param_1,int *param_2)" identifier (parameter_list "(undefined4 *param_1,int *param_2)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  undefined4 *puVar1;\n  uint uVar2;\n  int iVar3;\n  uint uVar4;\n  undefined4 *puVar5;\n  uint uVar6;\n  int iVar7;\n  uint uVar8;\n  \n  iVar3 = *param_2;\n  if (iVar3 != 0) {\n    uVar8 = 0x20;\n    uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);\n    uVar6 = (iVar3 + -1) * 0x20;\n    uVar2 = uVar6;\n    if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }\n  }\n  puVar5 = (undefined4 *)param_1[3];\n  param_1[2] = 0;\n  *param_1 = 0;\n  if (0 < (int)param_1[1]) {\n    iVar3 = 0;\n    puVar1 = puVar5;\n    do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);\n  }\n  iVar7 = 0;\n  *puVar5 = 1;\n  *param_1 = 1;\nLAB_0004e984:\n  while ((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))) {\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }\n  return -8;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "undefined4 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "uint uVar6;" type_identifier identifier ;) (declaration "int iVar7;" primitive_type identifier ;) (declaration "uint uVar8;" type_identifier identifier ;) (expression_statement "iVar3 = *param_2;" (assignment_expression "iVar3 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (if_statement "if (iVar3 != 0) {\n    uVar8 = 0x20;\n    uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);\n    uVar6 = (iVar3 + -1) * 0x20;\n    uVar2 = uVar6;\n    if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }\n  }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n    uVar8 = 0x20;\n    uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);\n    uVar6 = (iVar3 + -1) * 0x20;\n    uVar2 = uVar6;\n    if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }\n  }" { (expression_statement "uVar8 = 0x20;" (assignment_expression "uVar8 = 0x20" identifier = number_literal) ;) (expression_statement "uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);" (assignment_expression "uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4)" identifier = (pointer_expression "*(uint *)(param_2[3] + iVar3 * 4 + -4)" * (cast_expression "(uint *)(param_2[3] + iVar3 * 4 + -4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2[3] + iVar3 * 4 + -4)" ( (binary_expression "param_2[3] + iVar3 * 4 + -4" (binary_expression "param_2[3] + iVar3 * 4" (subscript_expression "param_2[3]" identifier [ number_literal ]) + (binary_expression "iVar3 * 4" identifier * number_literal)) + number_literal) ))))) ;) (expression_statement "uVar6 = (iVar3 + -1) * 0x20;" (assignment_expression "uVar6 = (iVar3 + -1) * 0x20" identifier = (binary_expression "(iVar3 + -1) * 0x20" (parenthesized_expression "(iVar3 + -1)" ( (binary_expression "iVar3 + -1" identifier + number_literal) )) * number_literal)) ;) (expression_statement "uVar2 = uVar6;" (assignment_expression "uVar2 = uVar6" identifier = identifier) ;) (if_statement "if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }" if (parenthesized_expression "(uVar4 != 0)" ( (binary_expression "uVar4 != 0" identifier != number_literal) )) (compound_statement "{\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }" { (do_statement "do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);" do (compound_statement "{\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      }" { (expression_statement "uVar4 = uVar4 >> 1;" (assignment_expression "uVar4 = uVar4 >> 1" identifier = (binary_expression "uVar4 >> 1" identifier >> number_literal)) ;) (expression_statement "uVar2 = uVar2 + 1;" (assignment_expression "uVar2 = uVar2 + 1" identifier = (binary_expression "uVar2 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar4 != 0)" ( (binary_expression "uVar4 != 0" identifier != number_literal) )) ;) (expression_statement "uVar8 = uVar2 & 0x8000001f;" (assignment_expression "uVar8 = uVar2 & 0x8000001f" identifier = (binary_expression "uVar2 & 0x8000001f" identifier & number_literal)) ;) (if_statement "if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }" if (parenthesized_expression "((int)uVar8 < 0)" ( (binary_expression "(int)uVar8 < 0" (cast_expression "(int)uVar8" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (compound_statement "{\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }" { (expression_statement "uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;" (assignment_expression "uVar8 = (uVar8 - 1 | 0xffffffe0) + 1" identifier = (binary_expression "(uVar8 - 1 | 0xffffffe0) + 1" (parenthesized_expression "(uVar8 - 1 | 0xffffffe0)" ( (binary_expression "uVar8 - 1 | 0xffffffe0" (binary_expression "uVar8 - 1" identifier - number_literal) | number_literal) )) + number_literal)) ;) (if_statement "if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }" if (parenthesized_expression "(uVar8 == 0)" ( (binary_expression "uVar8 == 0" identifier == number_literal) )) (compound_statement "{\n          uVar8 = 0x20;\n        }" { (expression_statement "uVar8 = 0x20;" (assignment_expression "uVar8 = 0x20" identifier = number_literal) ;) })) }) (else_clause "else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }" else (if_statement "if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }" if (parenthesized_expression "(uVar8 == 0)" ( (binary_expression "uVar8 == 0" identifier == number_literal) )) (compound_statement "{\n        uVar8 = 0x20;\n      }" { (expression_statement "uVar8 = 0x20;" (assignment_expression "uVar8 = 0x20" identifier = number_literal) ;) })))) })) (if_statement "if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }" if (parenthesized_expression "(1 < iVar3)" ( (binary_expression "1 < iVar3" number_literal < identifier) )) (compound_statement "{\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }" { (expression_statement "iVar7 = uVar8 - 1;" (assignment_expression "iVar7 = uVar8 - 1" identifier = (binary_expression "uVar8 - 1" identifier - number_literal)) ;) (expression_statement "iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);" (assignment_expression "iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1)" identifier = (call_expression "pstm_2expt(param_1,uVar8 + uVar6 + -1)" identifier (argument_list "(param_1,uVar8 + uVar6 + -1)" ( identifier , (binary_expression "uVar8 + uVar6 + -1" (binary_expression "uVar8 + uVar6" identifier + identifier) + number_literal) )))) ;) (if_statement "if (iVar3 != 0) {\n        return iVar3;\n      }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n        return iVar3;\n      }" { (return_statement "return iVar3;" return identifier ;) })) (goto_statement "goto LAB_0004e984;" goto statement_identifier ;) })) })) (expression_statement "puVar5 = (undefined4 *)param_1[3];" (assignment_expression "puVar5 = (undefined4 *)param_1[3]" identifier = (cast_expression "(undefined4 *)param_1[3]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[3]" identifier [ number_literal ]))) ;) (expression_statement "param_1[2] = 0;" (assignment_expression "param_1[2] = 0" (subscript_expression "param_1[2]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "*param_1 = 0;" (assignment_expression "*param_1 = 0" (pointer_expression "*param_1" * identifier) = number_literal) ;) (if_statement "if (0 < (int)param_1[1]) {\n    iVar3 = 0;\n    puVar1 = puVar5;\n    do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);\n  }" if (parenthesized_expression "(0 < (int)param_1[1])" ( (binary_expression "0 < (int)param_1[1]" number_literal < (cast_expression "(int)param_1[1]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) )) (compound_statement "{\n    iVar3 = 0;\n    puVar1 = puVar5;\n    do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);\n  }" { (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (expression_statement "puVar1 = puVar5;" (assignment_expression "puVar1 = puVar5" identifier = identifier) ;) (do_statement "do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);" do (compound_statement "{\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    }" { (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" * identifier) = number_literal) ;) (expression_statement "iVar3 = iVar3 + 1;" (assignment_expression "iVar3 = iVar3 + 1" identifier = (binary_expression "iVar3 + 1" identifier + number_literal)) ;) (expression_statement "puVar1 = puVar1 + 1;" (assignment_expression "puVar1 = puVar1 + 1" identifier = (binary_expression "puVar1 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar3 < (int)param_1[1])" ( (binary_expression "iVar3 < (int)param_1[1]" identifier < (cast_expression "(int)param_1[1]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) )) ;) })) (expression_statement "iVar7 = 0;" (assignment_expression "iVar7 = 0" identifier = number_literal) ;) (expression_statement "*puVar5 = 1;" (assignment_expression "*puVar5 = 1" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (expression_statement "*param_1 = 1;" (assignment_expression "*param_1 = 1" (pointer_expression "*param_1" * identifier) = number_literal) ;) (labeled_statement "LAB_0004e984:\n  while ((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))) {\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }" statement_identifier : (while_statement "while ((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))) {\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }" while (parenthesized_expression "((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)))))" ( (parenthesized_expression "(iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))" ( (comma_expression "iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)))" (assignment_expression "iVar3 = pstm_mul_2(param_1,param_1)" identifier = (call_expression "pstm_mul_2(param_1,param_1)" identifier (argument_list "(param_1,param_1)" ( identifier , identifier )))) , (binary_expression "iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)))" (binary_expression "iVar3 == 0" identifier == number_literal) && (parenthesized_expression "((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)))" ( (parenthesized_expression "(iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))" ( (comma_expression "iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)" (assignment_expression "iVar3 = pstm_cmp_mag(param_1,param_2)" identifier = (call_expression "pstm_cmp_mag(param_1,param_2)" identifier (argument_list "(param_1,param_2)" ( identifier , identifier )))) , (binary_expression "iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)" (binary_expression "iVar3 == -1" identifier == number_literal) || (parenthesized_expression "(iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)" ( (comma_expression "iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0" (assignment_expression "iVar3 = s_pstm_sub(param_1,param_2,param_1)" identifier = (call_expression "s_pstm_sub(param_1,param_2,param_1)" identifier (argument_list "(param_1,param_2,param_1)" ( identifier , identifier , identifier )))) , (binary_expression "iVar3 == 0" identifier == number_literal)) )))) )) )))) )) )) (compound_statement "{\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }" { (expression_statement "iVar7 = iVar7 + 1;" (assignment_expression "iVar7 = iVar7 + 1" identifier = (binary_expression "iVar7 + 1" identifier + number_literal)) ;) (if_statement "if (iVar7 == 0x20) {\n      return 0;\n    }" if (parenthesized_expression "(iVar7 == 0x20)" ( (binary_expression "iVar7 == 0x20" identifier == number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) }))) (return_statement "return -8;" return number_literal ;) })))
(translation_unit "int32 pstm_montgomery_calc_normalization(pstm_int *a,pstm_int *b)\n\n{\n  pstm_digit *ppVar1;\n  int32 iVar2;\n  uint uVar3;\n  int iVar4;\n  uint uVar5;\n  pstm_digit *ppVar6;\n  uint uVar7;\n  uint uVar8;\n  \n  iVar4 = b->used;\n  if (iVar4 != 0) {\n    uVar8 = 0x20;\n    uVar5 = b->dp[iVar4 + -1];\n    uVar7 = (iVar4 + -1) * 0x20;\n    uVar3 = uVar7;\n    if (uVar5 != 0) {\n      do {\n        uVar5 = uVar5 >> 1;\n        uVar3 = uVar3 + 1;\n      } while (uVar5 != 0);\n      uVar8 = uVar3 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar4) {\n      iVar4 = uVar8 - 1;\n      iVar2 = pstm_2expt(a,uVar8 + uVar7 + -1);\n      if (iVar2 != 0) {\n        return iVar2;\n      }\n      goto LAB_0004e984;\n    }\n  }\n  ppVar6 = a->dp;\n  a->sign = 0;\n  a->used = 0;\n  if (0 < a->alloc) {\n    iVar4 = 0;\n    ppVar1 = ppVar6;\n    do {\n      *ppVar1 = 0;\n      iVar4 = iVar4 + 1;\n      ppVar1 = ppVar1 + 1;\n    } while (iVar4 < a->alloc);\n  }\n  iVar4 = 0;\n  *ppVar6 = 1;\n  a->used = 1;\nLAB_0004e984:\n  while ((iVar2 = pstm_mul_2(a,a), iVar2 == 0 &&\n         ((iVar2 = pstm_cmp_mag(a,b), iVar2 == -1 || (iVar2 = s_pstm_sub(a,b,a), iVar2 == 0))))) {\n    iVar4 = iVar4 + 1;\n    if (iVar4 == 0x20) {\n      return 0;\n    }\n  }\n  return -8;\n}\n\n" (function_definition "int32 pstm_montgomery_calc_normalization(pstm_int *a,pstm_int *b)\n\n{\n  pstm_digit *ppVar1;\n  int32 iVar2;\n  uint uVar3;\n  int iVar4;\n  uint uVar5;\n  pstm_digit *ppVar6;\n  uint uVar7;\n  uint uVar8;\n  \n  iVar4 = b->used;\n  if (iVar4 != 0) {\n    uVar8 = 0x20;\n    uVar5 = b->dp[iVar4 + -1];\n    uVar7 = (iVar4 + -1) * 0x20;\n    uVar3 = uVar7;\n    if (uVar5 != 0) {\n      do {\n        uVar5 = uVar5 >> 1;\n        uVar3 = uVar3 + 1;\n      } while (uVar5 != 0);\n      uVar8 = uVar3 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar4) {\n      iVar4 = uVar8 - 1;\n      iVar2 = pstm_2expt(a,uVar8 + uVar7 + -1);\n      if (iVar2 != 0) {\n        return iVar2;\n      }\n      goto LAB_0004e984;\n    }\n  }\n  ppVar6 = a->dp;\n  a->sign = 0;\n  a->used = 0;\n  if (0 < a->alloc) {\n    iVar4 = 0;\n    ppVar1 = ppVar6;\n    do {\n      *ppVar1 = 0;\n      iVar4 = iVar4 + 1;\n      ppVar1 = ppVar1 + 1;\n    } while (iVar4 < a->alloc);\n  }\n  iVar4 = 0;\n  *ppVar6 = 1;\n  a->used = 1;\nLAB_0004e984:\n  while ((iVar2 = pstm_mul_2(a,a), iVar2 == 0 &&\n         ((iVar2 = pstm_cmp_mag(a,b), iVar2 == -1 || (iVar2 = s_pstm_sub(a,b,a), iVar2 == 0))))) {\n    iVar4 = iVar4 + 1;\n    if (iVar4 == 0x20) {\n      return 0;\n    }\n  }\n  return -8;\n}" type_identifier (function_declarator "pstm_montgomery_calc_normalization(pstm_int *a,pstm_int *b)" identifier (parameter_list "(pstm_int *a,pstm_int *b)" ( (parameter_declaration "pstm_int *a" type_identifier (pointer_declarator "*a" * identifier)) , (parameter_declaration "pstm_int *b" type_identifier (pointer_declarator "*b" * identifier)) ))) (compound_statement "{\n  pstm_digit *ppVar1;\n  int32 iVar2;\n  uint uVar3;\n  int iVar4;\n  uint uVar5;\n  pstm_digit *ppVar6;\n  uint uVar7;\n  uint uVar8;\n  \n  iVar4 = b->used;\n  if (iVar4 != 0) {\n    uVar8 = 0x20;\n    uVar5 = b->dp[iVar4 + -1];\n    uVar7 = (iVar4 + -1) * 0x20;\n    uVar3 = uVar7;\n    if (uVar5 != 0) {\n      do {\n        uVar5 = uVar5 >> 1;\n        uVar3 = uVar3 + 1;\n      } while (uVar5 != 0);\n      uVar8 = uVar3 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar4) {\n      iVar4 = uVar8 - 1;\n      iVar2 = pstm_2expt(a,uVar8 + uVar7 + -1);\n      if (iVar2 != 0) {\n        return iVar2;\n      }\n      goto LAB_0004e984;\n    }\n  }\n  ppVar6 = a->dp;\n  a->sign = 0;\n  a->used = 0;\n  if (0 < a->alloc) {\n    iVar4 = 0;\n    ppVar1 = ppVar6;\n    do {\n      *ppVar1 = 0;\n      iVar4 = iVar4 + 1;\n      ppVar1 = ppVar1 + 1;\n    } while (iVar4 < a->alloc);\n  }\n  iVar4 = 0;\n  *ppVar6 = 1;\n  a->used = 1;\nLAB_0004e984:\n  while ((iVar2 = pstm_mul_2(a,a), iVar2 == 0 &&\n         ((iVar2 = pstm_cmp_mag(a,b), iVar2 == -1 || (iVar2 = s_pstm_sub(a,b,a), iVar2 == 0))))) {\n    iVar4 = iVar4 + 1;\n    if (iVar4 == 0x20) {\n      return 0;\n    }\n  }\n  return -8;\n}" { (declaration "pstm_digit *ppVar1;" type_identifier (pointer_declarator "*ppVar1" * identifier) ;) (declaration "int32 iVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "uint uVar5;" type_identifier identifier ;) (declaration "pstm_digit *ppVar6;" type_identifier (pointer_declarator "*ppVar6" * identifier) ;) (declaration "uint uVar7;" type_identifier identifier ;) (declaration "uint uVar8;" type_identifier identifier ;) (expression_statement "iVar4 = b->used;" (assignment_expression "iVar4 = b->used" identifier = (field_expression "b->used" identifier -> field_identifier)) ;) (if_statement "if (iVar4 != 0) {\n    uVar8 = 0x20;\n    uVar5 = b->dp[iVar4 + -1];\n    uVar7 = (iVar4 + -1) * 0x20;\n    uVar3 = uVar7;\n    if (uVar5 != 0) {\n      do {\n        uVar5 = uVar5 >> 1;\n        uVar3 = uVar3 + 1;\n      } while (uVar5 != 0);\n      uVar8 = uVar3 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar4) {\n      iVar4 = uVar8 - 1;\n      iVar2 = pstm_2expt(a,uVar8 + uVar7 + -1);\n      if (iVar2 != 0) {\n        return iVar2;\n      }\n      goto LAB_0004e984;\n    }\n  }" if (parenthesized_expression "(iVar4 != 0)" ( (binary_expression "iVar4 != 0" identifier != number_literal) )) (compound_statement "{\n    uVar8 = 0x20;\n    uVar5 = b->dp[iVar4 + -1];\n    uVar7 = (iVar4 + -1) * 0x20;\n    uVar3 = uVar7;\n    if (uVar5 != 0) {\n      do {\n        uVar5 = uVar5 >> 1;\n        uVar3 = uVar3 + 1;\n      } while (uVar5 != 0);\n      uVar8 = uVar3 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar4) {\n      iVar4 = uVar8 - 1;\n      iVar2 = pstm_2expt(a,uVar8 + uVar7 + -1);\n      if (iVar2 != 0) {\n        return iVar2;\n      }\n      goto LAB_0004e984;\n    }\n  }" { (expression_statement "uVar8 = 0x20;" (assignment_expression "uVar8 = 0x20" identifier = number_literal) ;) (expression_statement "uVar5 = b->dp[iVar4 + -1];" (assignment_expression "uVar5 = b->dp[iVar4 + -1]" identifier = (subscript_expression "b->dp[iVar4 + -1]" (field_expression "b->dp" identifier -> field_identifier) [ (binary_expression "iVar4 + -1" identifier + number_literal) ])) ;) (expression_statement "uVar7 = (iVar4 + -1) * 0x20;" (assignment_expression "uVar7 = (iVar4 + -1) * 0x20" identifier = (binary_expression "(iVar4 + -1) * 0x20" (parenthesized_expression "(iVar4 + -1)" ( (binary_expression "iVar4 + -1" identifier + number_literal) )) * number_literal)) ;) (expression_statement "uVar3 = uVar7;" (assignment_expression "uVar3 = uVar7" identifier = identifier) ;) (if_statement "if (uVar5 != 0) {\n      do {\n        uVar5 = uVar5 >> 1;\n        uVar3 = uVar3 + 1;\n      } while (uVar5 != 0);\n      uVar8 = uVar3 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }" if (parenthesized_expression "(uVar5 != 0)" ( (binary_expression "uVar5 != 0" identifier != number_literal) )) (compound_statement "{\n      do {\n        uVar5 = uVar5 >> 1;\n        uVar3 = uVar3 + 1;\n      } while (uVar5 != 0);\n      uVar8 = uVar3 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }" { (do_statement "do {\n        uVar5 = uVar5 >> 1;\n        uVar3 = uVar3 + 1;\n      } while (uVar5 != 0);" do (compound_statement "{\n        uVar5 = uVar5 >> 1;\n        uVar3 = uVar3 + 1;\n      }" { (expression_statement "uVar5 = uVar5 >> 1;" (assignment_expression "uVar5 = uVar5 >> 1" identifier = (binary_expression "uVar5 >> 1" identifier >> number_literal)) ;) (expression_statement "uVar3 = uVar3 + 1;" (assignment_expression "uVar3 = uVar3 + 1" identifier = (binary_expression "uVar3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar5 != 0)" ( (binary_expression "uVar5 != 0" identifier != number_literal) )) ;) (expression_statement "uVar8 = uVar3 & 0x8000001f;" (assignment_expression "uVar8 = uVar3 & 0x8000001f" identifier = (binary_expression "uVar3 & 0x8000001f" identifier & number_literal)) ;) (if_statement "if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }" if (parenthesized_expression "((int)uVar8 < 0)" ( (binary_expression "(int)uVar8 < 0" (cast_expression "(int)uVar8" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (compound_statement "{\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }" { (expression_statement "uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;" (assignment_expression "uVar8 = (uVar8 - 1 | 0xffffffe0) + 1" identifier = (binary_expression "(uVar8 - 1 | 0xffffffe0) + 1" (parenthesized_expression "(uVar8 - 1 | 0xffffffe0)" ( (binary_expression "uVar8 - 1 | 0xffffffe0" (binary_expression "uVar8 - 1" identifier - number_literal) | number_literal) )) + number_literal)) ;) (if_statement "if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }" if (parenthesized_expression "(uVar8 == 0)" ( (binary_expression "uVar8 == 0" identifier == number_literal) )) (compound_statement "{\n          uVar8 = 0x20;\n        }" { (expression_statement "uVar8 = 0x20;" (assignment_expression "uVar8 = 0x20" identifier = number_literal) ;) })) }) (else_clause "else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }" else (if_statement "if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }" if (parenthesized_expression "(uVar8 == 0)" ( (binary_expression "uVar8 == 0" identifier == number_literal) )) (compound_statement "{\n        uVar8 = 0x20;\n      }" { (expression_statement "uVar8 = 0x20;" (assignment_expression "uVar8 = 0x20" identifier = number_literal) ;) })))) })) (if_statement "if (1 < iVar4) {\n      iVar4 = uVar8 - 1;\n      iVar2 = pstm_2expt(a,uVar8 + uVar7 + -1);\n      if (iVar2 != 0) {\n        return iVar2;\n      }\n      goto LAB_0004e984;\n    }" if (parenthesized_expression "(1 < iVar4)" ( (binary_expression "1 < iVar4" number_literal < identifier) )) (compound_statement "{\n      iVar4 = uVar8 - 1;\n      iVar2 = pstm_2expt(a,uVar8 + uVar7 + -1);\n      if (iVar2 != 0) {\n        return iVar2;\n      }\n      goto LAB_0004e984;\n    }" { (expression_statement "iVar4 = uVar8 - 1;" (assignment_expression "iVar4 = uVar8 - 1" identifier = (binary_expression "uVar8 - 1" identifier - number_literal)) ;) (expression_statement "iVar2 = pstm_2expt(a,uVar8 + uVar7 + -1);" (assignment_expression "iVar2 = pstm_2expt(a,uVar8 + uVar7 + -1)" identifier = (call_expression "pstm_2expt(a,uVar8 + uVar7 + -1)" identifier (argument_list "(a,uVar8 + uVar7 + -1)" ( identifier , (binary_expression "uVar8 + uVar7 + -1" (binary_expression "uVar8 + uVar7" identifier + identifier) + number_literal) )))) ;) (if_statement "if (iVar2 != 0) {\n        return iVar2;\n      }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n        return iVar2;\n      }" { (return_statement "return iVar2;" return identifier ;) })) (goto_statement "goto LAB_0004e984;" goto statement_identifier ;) })) })) (expression_statement "ppVar6 = a->dp;" (assignment_expression "ppVar6 = a->dp" identifier = (field_expression "a->dp" identifier -> field_identifier)) ;) (expression_statement "a->sign = 0;" (assignment_expression "a->sign = 0" (field_expression "a->sign" identifier -> field_identifier) = number_literal) ;) (expression_statement "a->used = 0;" (assignment_expression "a->used = 0" (field_expression "a->used" identifier -> field_identifier) = number_literal) ;) (if_statement "if (0 < a->alloc) {\n    iVar4 = 0;\n    ppVar1 = ppVar6;\n    do {\n      *ppVar1 = 0;\n      iVar4 = iVar4 + 1;\n      ppVar1 = ppVar1 + 1;\n    } while (iVar4 < a->alloc);\n  }" if (parenthesized_expression "(0 < a->alloc)" ( (binary_expression "0 < a->alloc" number_literal < (field_expression "a->alloc" identifier -> field_identifier)) )) (compound_statement "{\n    iVar4 = 0;\n    ppVar1 = ppVar6;\n    do {\n      *ppVar1 = 0;\n      iVar4 = iVar4 + 1;\n      ppVar1 = ppVar1 + 1;\n    } while (iVar4 < a->alloc);\n  }" { (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) (expression_statement "ppVar1 = ppVar6;" (assignment_expression "ppVar1 = ppVar6" identifier = identifier) ;) (do_statement "do {\n      *ppVar1 = 0;\n      iVar4 = iVar4 + 1;\n      ppVar1 = ppVar1 + 1;\n    } while (iVar4 < a->alloc);" do (compound_statement "{\n      *ppVar1 = 0;\n      iVar4 = iVar4 + 1;\n      ppVar1 = ppVar1 + 1;\n    }" { (expression_statement "*ppVar1 = 0;" (assignment_expression "*ppVar1 = 0" (pointer_expression "*ppVar1" * identifier) = number_literal) ;) (expression_statement "iVar4 = iVar4 + 1;" (assignment_expression "iVar4 = iVar4 + 1" identifier = (binary_expression "iVar4 + 1" identifier + number_literal)) ;) (expression_statement "ppVar1 = ppVar1 + 1;" (assignment_expression "ppVar1 = ppVar1 + 1" identifier = (binary_expression "ppVar1 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar4 < a->alloc)" ( (binary_expression "iVar4 < a->alloc" identifier < (field_expression "a->alloc" identifier -> field_identifier)) )) ;) })) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) (expression_statement "*ppVar6 = 1;" (assignment_expression "*ppVar6 = 1" (pointer_expression "*ppVar6" * identifier) = number_literal) ;) (expression_statement "a->used = 1;" (assignment_expression "a->used = 1" (field_expression "a->used" identifier -> field_identifier) = number_literal) ;) (labeled_statement "LAB_0004e984:\n  while ((iVar2 = pstm_mul_2(a,a), iVar2 == 0 &&\n         ((iVar2 = pstm_cmp_mag(a,b), iVar2 == -1 || (iVar2 = s_pstm_sub(a,b,a), iVar2 == 0))))) {\n    iVar4 = iVar4 + 1;\n    if (iVar4 == 0x20) {\n      return 0;\n    }\n  }" statement_identifier : (while_statement "while ((iVar2 = pstm_mul_2(a,a), iVar2 == 0 &&\n         ((iVar2 = pstm_cmp_mag(a,b), iVar2 == -1 || (iVar2 = s_pstm_sub(a,b,a), iVar2 == 0))))) {\n    iVar4 = iVar4 + 1;\n    if (iVar4 == 0x20) {\n      return 0;\n    }\n  }" while (parenthesized_expression "((iVar2 = pstm_mul_2(a,a), iVar2 == 0 &&\n         ((iVar2 = pstm_cmp_mag(a,b), iVar2 == -1 || (iVar2 = s_pstm_sub(a,b,a), iVar2 == 0)))))" ( (parenthesized_expression "(iVar2 = pstm_mul_2(a,a), iVar2 == 0 &&\n         ((iVar2 = pstm_cmp_mag(a,b), iVar2 == -1 || (iVar2 = s_pstm_sub(a,b,a), iVar2 == 0))))" ( (comma_expression "iVar2 = pstm_mul_2(a,a), iVar2 == 0 &&\n         ((iVar2 = pstm_cmp_mag(a,b), iVar2 == -1 || (iVar2 = s_pstm_sub(a,b,a), iVar2 == 0)))" (assignment_expression "iVar2 = pstm_mul_2(a,a)" identifier = (call_expression "pstm_mul_2(a,a)" identifier (argument_list "(a,a)" ( identifier , identifier )))) , (binary_expression "iVar2 == 0 &&\n         ((iVar2 = pstm_cmp_mag(a,b), iVar2 == -1 || (iVar2 = s_pstm_sub(a,b,a), iVar2 == 0)))" (binary_expression "iVar2 == 0" identifier == number_literal) && (parenthesized_expression "((iVar2 = pstm_cmp_mag(a,b), iVar2 == -1 || (iVar2 = s_pstm_sub(a,b,a), iVar2 == 0)))" ( (parenthesized_expression "(iVar2 = pstm_cmp_mag(a,b), iVar2 == -1 || (iVar2 = s_pstm_sub(a,b,a), iVar2 == 0))" ( (comma_expression "iVar2 = pstm_cmp_mag(a,b), iVar2 == -1 || (iVar2 = s_pstm_sub(a,b,a), iVar2 == 0)" (assignment_expression "iVar2 = pstm_cmp_mag(a,b)" identifier = (call_expression "pstm_cmp_mag(a,b)" identifier (argument_list "(a,b)" ( identifier , identifier )))) , (binary_expression "iVar2 == -1 || (iVar2 = s_pstm_sub(a,b,a), iVar2 == 0)" (binary_expression "iVar2 == -1" identifier == number_literal) || (parenthesized_expression "(iVar2 = s_pstm_sub(a,b,a), iVar2 == 0)" ( (comma_expression "iVar2 = s_pstm_sub(a,b,a), iVar2 == 0" (assignment_expression "iVar2 = s_pstm_sub(a,b,a)" identifier = (call_expression "s_pstm_sub(a,b,a)" identifier (argument_list "(a,b,a)" ( identifier , identifier , identifier )))) , (binary_expression "iVar2 == 0" identifier == number_literal)) )))) )) )))) )) )) (compound_statement "{\n    iVar4 = iVar4 + 1;\n    if (iVar4 == 0x20) {\n      return 0;\n    }\n  }" { (expression_statement "iVar4 = iVar4 + 1;" (assignment_expression "iVar4 = iVar4 + 1" identifier = (binary_expression "iVar4 + 1" identifier + number_literal)) ;) (if_statement "if (iVar4 == 0x20) {\n      return 0;\n    }" if (parenthesized_expression "(iVar4 == 0x20)" ( (binary_expression "iVar4 == 0x20" identifier == number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) }))) (return_statement "return -8;" return number_literal ;) })))
(translation_unit "int pstm_montgomery_calc_normalization(undefined4 *param_1,int *param_2)\n\n{\n  undefined4 *puVar1;\n  uint uVar2;\n  int iVar3;\n  uint uVar4;\n  undefined4 *puVar5;\n  uint uVar6;\n  int iVar7;\n  uint uVar8;\n  \n  iVar3 = *param_2;\n  if (iVar3 != 0) {\n    uVar8 = 0x20;\n    uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);\n    uVar6 = (iVar3 + -1) * 0x20;\n    uVar2 = uVar6;\n    if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }\n  }\n  puVar5 = (undefined4 *)param_1[3];\n  param_1[2] = 0;\n  *param_1 = 0;\n  if (0 < (int)param_1[1]) {\n    iVar3 = 0;\n    puVar1 = puVar5;\n    do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);\n  }\n  iVar7 = 0;\n  *puVar5 = 1;\n  *param_1 = 1;\nLAB_0004e984:\n  while ((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))) {\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }\n  return -8;\n}\n\n" (function_definition "int pstm_montgomery_calc_normalization(undefined4 *param_1,int *param_2)\n\n{\n  undefined4 *puVar1;\n  uint uVar2;\n  int iVar3;\n  uint uVar4;\n  undefined4 *puVar5;\n  uint uVar6;\n  int iVar7;\n  uint uVar8;\n  \n  iVar3 = *param_2;\n  if (iVar3 != 0) {\n    uVar8 = 0x20;\n    uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);\n    uVar6 = (iVar3 + -1) * 0x20;\n    uVar2 = uVar6;\n    if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }\n  }\n  puVar5 = (undefined4 *)param_1[3];\n  param_1[2] = 0;\n  *param_1 = 0;\n  if (0 < (int)param_1[1]) {\n    iVar3 = 0;\n    puVar1 = puVar5;\n    do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);\n  }\n  iVar7 = 0;\n  *puVar5 = 1;\n  *param_1 = 1;\nLAB_0004e984:\n  while ((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))) {\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }\n  return -8;\n}" primitive_type (function_declarator "pstm_montgomery_calc_normalization(undefined4 *param_1,int *param_2)" identifier (parameter_list "(undefined4 *param_1,int *param_2)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  undefined4 *puVar1;\n  uint uVar2;\n  int iVar3;\n  uint uVar4;\n  undefined4 *puVar5;\n  uint uVar6;\n  int iVar7;\n  uint uVar8;\n  \n  iVar3 = *param_2;\n  if (iVar3 != 0) {\n    uVar8 = 0x20;\n    uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);\n    uVar6 = (iVar3 + -1) * 0x20;\n    uVar2 = uVar6;\n    if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }\n  }\n  puVar5 = (undefined4 *)param_1[3];\n  param_1[2] = 0;\n  *param_1 = 0;\n  if (0 < (int)param_1[1]) {\n    iVar3 = 0;\n    puVar1 = puVar5;\n    do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);\n  }\n  iVar7 = 0;\n  *puVar5 = 1;\n  *param_1 = 1;\nLAB_0004e984:\n  while ((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))) {\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }\n  return -8;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "undefined4 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "uint uVar6;" type_identifier identifier ;) (declaration "int iVar7;" primitive_type identifier ;) (declaration "uint uVar8;" type_identifier identifier ;) (expression_statement "iVar3 = *param_2;" (assignment_expression "iVar3 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (if_statement "if (iVar3 != 0) {\n    uVar8 = 0x20;\n    uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);\n    uVar6 = (iVar3 + -1) * 0x20;\n    uVar2 = uVar6;\n    if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }\n  }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n    uVar8 = 0x20;\n    uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);\n    uVar6 = (iVar3 + -1) * 0x20;\n    uVar2 = uVar6;\n    if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }\n  }" { (expression_statement "uVar8 = 0x20;" (assignment_expression "uVar8 = 0x20" identifier = number_literal) ;) (expression_statement "uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);" (assignment_expression "uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4)" identifier = (pointer_expression "*(uint *)(param_2[3] + iVar3 * 4 + -4)" * (cast_expression "(uint *)(param_2[3] + iVar3 * 4 + -4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2[3] + iVar3 * 4 + -4)" ( (binary_expression "param_2[3] + iVar3 * 4 + -4" (binary_expression "param_2[3] + iVar3 * 4" (subscript_expression "param_2[3]" identifier [ number_literal ]) + (binary_expression "iVar3 * 4" identifier * number_literal)) + number_literal) ))))) ;) (expression_statement "uVar6 = (iVar3 + -1) * 0x20;" (assignment_expression "uVar6 = (iVar3 + -1) * 0x20" identifier = (binary_expression "(iVar3 + -1) * 0x20" (parenthesized_expression "(iVar3 + -1)" ( (binary_expression "iVar3 + -1" identifier + number_literal) )) * number_literal)) ;) (expression_statement "uVar2 = uVar6;" (assignment_expression "uVar2 = uVar6" identifier = identifier) ;) (if_statement "if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }" if (parenthesized_expression "(uVar4 != 0)" ( (binary_expression "uVar4 != 0" identifier != number_literal) )) (compound_statement "{\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }" { (do_statement "do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);" do (compound_statement "{\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      }" { (expression_statement "uVar4 = uVar4 >> 1;" (assignment_expression "uVar4 = uVar4 >> 1" identifier = (binary_expression "uVar4 >> 1" identifier >> number_literal)) ;) (expression_statement "uVar2 = uVar2 + 1;" (assignment_expression "uVar2 = uVar2 + 1" identifier = (binary_expression "uVar2 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar4 != 0)" ( (binary_expression "uVar4 != 0" identifier != number_literal) )) ;) (expression_statement "uVar8 = uVar2 & 0x8000001f;" (assignment_expression "uVar8 = uVar2 & 0x8000001f" identifier = (binary_expression "uVar2 & 0x8000001f" identifier & number_literal)) ;) (if_statement "if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }" if (parenthesized_expression "((int)uVar8 < 0)" ( (binary_expression "(int)uVar8 < 0" (cast_expression "(int)uVar8" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (compound_statement "{\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }" { (expression_statement "uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;" (assignment_expression "uVar8 = (uVar8 - 1 | 0xffffffe0) + 1" identifier = (binary_expression "(uVar8 - 1 | 0xffffffe0) + 1" (parenthesized_expression "(uVar8 - 1 | 0xffffffe0)" ( (binary_expression "uVar8 - 1 | 0xffffffe0" (binary_expression "uVar8 - 1" identifier - number_literal) | number_literal) )) + number_literal)) ;) (if_statement "if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }" if (parenthesized_expression "(uVar8 == 0)" ( (binary_expression "uVar8 == 0" identifier == number_literal) )) (compound_statement "{\n          uVar8 = 0x20;\n        }" { (expression_statement "uVar8 = 0x20;" (assignment_expression "uVar8 = 0x20" identifier = number_literal) ;) })) }) (else_clause "else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }" else (if_statement "if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }" if (parenthesized_expression "(uVar8 == 0)" ( (binary_expression "uVar8 == 0" identifier == number_literal) )) (compound_statement "{\n        uVar8 = 0x20;\n      }" { (expression_statement "uVar8 = 0x20;" (assignment_expression "uVar8 = 0x20" identifier = number_literal) ;) })))) })) (if_statement "if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }" if (parenthesized_expression "(1 < iVar3)" ( (binary_expression "1 < iVar3" number_literal < identifier) )) (compound_statement "{\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }" { (expression_statement "iVar7 = uVar8 - 1;" (assignment_expression "iVar7 = uVar8 - 1" identifier = (binary_expression "uVar8 - 1" identifier - number_literal)) ;) (expression_statement "iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);" (assignment_expression "iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1)" identifier = (call_expression "pstm_2expt(param_1,uVar8 + uVar6 + -1)" identifier (argument_list "(param_1,uVar8 + uVar6 + -1)" ( identifier , (binary_expression "uVar8 + uVar6 + -1" (binary_expression "uVar8 + uVar6" identifier + identifier) + number_literal) )))) ;) (if_statement "if (iVar3 != 0) {\n        return iVar3;\n      }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n        return iVar3;\n      }" { (return_statement "return iVar3;" return identifier ;) })) (goto_statement "goto LAB_0004e984;" goto statement_identifier ;) })) })) (expression_statement "puVar5 = (undefined4 *)param_1[3];" (assignment_expression "puVar5 = (undefined4 *)param_1[3]" identifier = (cast_expression "(undefined4 *)param_1[3]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[3]" identifier [ number_literal ]))) ;) (expression_statement "param_1[2] = 0;" (assignment_expression "param_1[2] = 0" (subscript_expression "param_1[2]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "*param_1 = 0;" (assignment_expression "*param_1 = 0" (pointer_expression "*param_1" * identifier) = number_literal) ;) (if_statement "if (0 < (int)param_1[1]) {\n    iVar3 = 0;\n    puVar1 = puVar5;\n    do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);\n  }" if (parenthesized_expression "(0 < (int)param_1[1])" ( (binary_expression "0 < (int)param_1[1]" number_literal < (cast_expression "(int)param_1[1]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) )) (compound_statement "{\n    iVar3 = 0;\n    puVar1 = puVar5;\n    do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);\n  }" { (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (expression_statement "puVar1 = puVar5;" (assignment_expression "puVar1 = puVar5" identifier = identifier) ;) (do_statement "do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);" do (compound_statement "{\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    }" { (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" * identifier) = number_literal) ;) (expression_statement "iVar3 = iVar3 + 1;" (assignment_expression "iVar3 = iVar3 + 1" identifier = (binary_expression "iVar3 + 1" identifier + number_literal)) ;) (expression_statement "puVar1 = puVar1 + 1;" (assignment_expression "puVar1 = puVar1 + 1" identifier = (binary_expression "puVar1 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar3 < (int)param_1[1])" ( (binary_expression "iVar3 < (int)param_1[1]" identifier < (cast_expression "(int)param_1[1]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) )) ;) })) (expression_statement "iVar7 = 0;" (assignment_expression "iVar7 = 0" identifier = number_literal) ;) (expression_statement "*puVar5 = 1;" (assignment_expression "*puVar5 = 1" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (expression_statement "*param_1 = 1;" (assignment_expression "*param_1 = 1" (pointer_expression "*param_1" * identifier) = number_literal) ;) (labeled_statement "LAB_0004e984:\n  while ((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))) {\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }" statement_identifier : (while_statement "while ((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))) {\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }" while (parenthesized_expression "((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)))))" ( (parenthesized_expression "(iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))" ( (comma_expression "iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)))" (assignment_expression "iVar3 = pstm_mul_2(param_1,param_1)" identifier = (call_expression "pstm_mul_2(param_1,param_1)" identifier (argument_list "(param_1,param_1)" ( identifier , identifier )))) , (binary_expression "iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)))" (binary_expression "iVar3 == 0" identifier == number_literal) && (parenthesized_expression "((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)))" ( (parenthesized_expression "(iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))" ( (comma_expression "iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)" (assignment_expression "iVar3 = pstm_cmp_mag(param_1,param_2)" identifier = (call_expression "pstm_cmp_mag(param_1,param_2)" identifier (argument_list "(param_1,param_2)" ( identifier , identifier )))) , (binary_expression "iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)" (binary_expression "iVar3 == -1" identifier == number_literal) || (parenthesized_expression "(iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)" ( (comma_expression "iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0" (assignment_expression "iVar3 = s_pstm_sub(param_1,param_2,param_1)" identifier = (call_expression "s_pstm_sub(param_1,param_2,param_1)" identifier (argument_list "(param_1,param_2,param_1)" ( identifier , identifier , identifier )))) , (binary_expression "iVar3 == 0" identifier == number_literal)) )))) )) )))) )) )) (compound_statement "{\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }" { (expression_statement "iVar7 = iVar7 + 1;" (assignment_expression "iVar7 = iVar7 + 1" identifier = (binary_expression "iVar7 + 1" identifier + number_literal)) ;) (if_statement "if (iVar7 == 0x20) {\n      return 0;\n    }" if (parenthesized_expression "(iVar7 == 0x20)" ( (binary_expression "iVar7 == 0x20" identifier == number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) }))) (return_statement "return -8;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (subscript_expression IDENT [ LIT ]) + (binary_expression IDENT * LIT)) + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression IDENT + LIT) )) * LIT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT >> LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != LIT) )) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT & LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression (binary_expression IDENT - LIT) | LIT) )) + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) })) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) })))) })) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (binary_expression (binary_expression IDENT + IDENT) + LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (return_statement return IDENT ;) })) (goto_statement goto statement_identifier ;) })) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ]))) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT < (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ]))) )) ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (labeled_statement statement_identifier : (while_statement while (parenthesized_expression ( (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) , (binary_expression (binary_expression IDENT == LIT) && (parenthesized_expression ( (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) , (binary_expression (binary_expression IDENT == LIT) || (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT )))) , (binary_expression IDENT == LIT)) )))) )) )))) )) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) }))) (return_statement return LIT ;) })))
(function_definition "int pstm_montgomery_calc_normalization(undefined4 *param_1,int *param_2)\n\n{\n  undefined4 *puVar1;\n  uint uVar2;\n  int iVar3;\n  uint uVar4;\n  undefined4 *puVar5;\n  uint uVar6;\n  int iVar7;\n  uint uVar8;\n  \n  iVar3 = *param_2;\n  if (iVar3 != 0) {\n    uVar8 = 0x20;\n    uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);\n    uVar6 = (iVar3 + -1) * 0x20;\n    uVar2 = uVar6;\n    if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }\n  }\n  puVar5 = (undefined4 *)param_1[3];\n  param_1[2] = 0;\n  *param_1 = 0;\n  if (0 < (int)param_1[1]) {\n    iVar3 = 0;\n    puVar1 = puVar5;\n    do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);\n  }\n  iVar7 = 0;\n  *puVar5 = 1;\n  *param_1 = 1;\nLAB_0004e984:\n  while ((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))) {\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }\n  return -8;\n}" (primitive_type "int") (function_declarator "pstm_montgomery_calc_normalization(undefined4 *param_1,int *param_2)" (identifier "pstm_montgomery_calc_normalization") (parameter_list "(undefined4 *param_1,int *param_2)" (( "(") (parameter_declaration "undefined4 *param_1" (type_identifier "undefined4") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int *param_2" (primitive_type "int") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")"))) (compound_statement "{\n  undefined4 *puVar1;\n  uint uVar2;\n  int iVar3;\n  uint uVar4;\n  undefined4 *puVar5;\n  uint uVar6;\n  int iVar7;\n  uint uVar8;\n  \n  iVar3 = *param_2;\n  if (iVar3 != 0) {\n    uVar8 = 0x20;\n    uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);\n    uVar6 = (iVar3 + -1) * 0x20;\n    uVar2 = uVar6;\n    if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }\n  }\n  puVar5 = (undefined4 *)param_1[3];\n  param_1[2] = 0;\n  *param_1 = 0;\n  if (0 < (int)param_1[1]) {\n    iVar3 = 0;\n    puVar1 = puVar5;\n    do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);\n  }\n  iVar7 = 0;\n  *puVar5 = 1;\n  *param_1 = 1;\nLAB_0004e984:\n  while ((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))) {\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }\n  return -8;\n}" ({ "{") (declaration "undefined4 *puVar1;" (type_identifier "undefined4") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (declaration "undefined4 *puVar5;" (type_identifier "undefined4") (pointer_declarator "*puVar5" (* "*") (identifier "puVar5")) (; ";")) (declaration "uint uVar6;" (type_identifier "uint") (identifier "uVar6") (; ";")) (declaration "int iVar7;" (primitive_type "int") (identifier "iVar7") (; ";")) (declaration "uint uVar8;" (type_identifier "uint") (identifier "uVar8") (; ";")) (expression_statement "iVar3 = *param_2;" (assignment_expression "iVar3 = *param_2" (identifier "iVar3") (= "=") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (; ";")) (if_statement "if (iVar3 != 0) {\n    uVar8 = 0x20;\n    uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);\n    uVar6 = (iVar3 + -1) * 0x20;\n    uVar2 = uVar6;\n    if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }\n  }" (if "if") (parenthesized_expression "(iVar3 != 0)" (( "(") (binary_expression "iVar3 != 0" (identifier "iVar3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    uVar8 = 0x20;\n    uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);\n    uVar6 = (iVar3 + -1) * 0x20;\n    uVar2 = uVar6;\n    if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }\n    if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }\n  }" ({ "{") (expression_statement "uVar8 = 0x20;" (assignment_expression "uVar8 = 0x20" (identifier "uVar8") (= "=") (number_literal "0x20")) (; ";")) (expression_statement "uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);" (assignment_expression "uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4)" (identifier "uVar4") (= "=") (pointer_expression "*(uint *)(param_2[3] + iVar3 * 4 + -4)" (* "*") (cast_expression "(uint *)(param_2[3] + iVar3 * 4 + -4)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_2[3] + iVar3 * 4 + -4)" (( "(") (binary_expression "param_2[3] + iVar3 * 4 + -4" (binary_expression "param_2[3] + iVar3 * 4" (subscript_expression "param_2[3]" (identifier "param_2") ([ "[") (number_literal "3") (] "]")) (+ "+") (binary_expression "iVar3 * 4" (identifier "iVar3") (* "*") (number_literal "4"))) (+ "+") (number_literal "-4")) () ")"))))) (; ";")) (expression_statement "uVar6 = (iVar3 + -1) * 0x20;" (assignment_expression "uVar6 = (iVar3 + -1) * 0x20" (identifier "uVar6") (= "=") (binary_expression "(iVar3 + -1) * 0x20" (parenthesized_expression "(iVar3 + -1)" (( "(") (binary_expression "iVar3 + -1" (identifier "iVar3") (+ "+") (number_literal "-1")) () ")")) (* "*") (number_literal "0x20"))) (; ";")) (expression_statement "uVar2 = uVar6;" (assignment_expression "uVar2 = uVar6" (identifier "uVar2") (= "=") (identifier "uVar6")) (; ";")) (if_statement "if (uVar4 != 0) {\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }" (if "if") (parenthesized_expression "(uVar4 != 0)" (( "(") (binary_expression "uVar4 != 0" (identifier "uVar4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);\n      uVar8 = uVar2 & 0x8000001f;\n      if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }\n    }" ({ "{") (do_statement "do {\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      } while (uVar4 != 0);" (do "do") (compound_statement "{\n        uVar4 = uVar4 >> 1;\n        uVar2 = uVar2 + 1;\n      }" ({ "{") (expression_statement "uVar4 = uVar4 >> 1;" (assignment_expression "uVar4 = uVar4 >> 1" (identifier "uVar4") (= "=") (binary_expression "uVar4 >> 1" (identifier "uVar4") (>> ">>") (number_literal "1"))) (; ";")) (expression_statement "uVar2 = uVar2 + 1;" (assignment_expression "uVar2 = uVar2 + 1" (identifier "uVar2") (= "=") (binary_expression "uVar2 + 1" (identifier "uVar2") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(uVar4 != 0)" (( "(") (binary_expression "uVar4 != 0" (identifier "uVar4") (!= "!=") (number_literal "0")) () ")")) (; ";")) (expression_statement "uVar8 = uVar2 & 0x8000001f;" (assignment_expression "uVar8 = uVar2 & 0x8000001f" (identifier "uVar8") (= "=") (binary_expression "uVar2 & 0x8000001f" (identifier "uVar2") (& "&") (number_literal "0x8000001f"))) (; ";")) (if_statement "if ((int)uVar8 < 0) {\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }\n      else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }" (if "if") (parenthesized_expression "((int)uVar8 < 0)" (( "(") (binary_expression "(int)uVar8 < 0" (cast_expression "(int)uVar8" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar8")) (< "<") (number_literal "0")) () ")")) (compound_statement "{\n        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;\n        if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }\n      }" ({ "{") (expression_statement "uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;" (assignment_expression "uVar8 = (uVar8 - 1 | 0xffffffe0) + 1" (identifier "uVar8") (= "=") (binary_expression "(uVar8 - 1 | 0xffffffe0) + 1" (parenthesized_expression "(uVar8 - 1 | 0xffffffe0)" (( "(") (binary_expression "uVar8 - 1 | 0xffffffe0" (binary_expression "uVar8 - 1" (identifier "uVar8") (- "-") (number_literal "1")) (| "|") (number_literal "0xffffffe0")) () ")")) (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (uVar8 == 0) {\n          uVar8 = 0x20;\n        }" (if "if") (parenthesized_expression "(uVar8 == 0)" (( "(") (binary_expression "uVar8 == 0" (identifier "uVar8") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n          uVar8 = 0x20;\n        }" ({ "{") (expression_statement "uVar8 = 0x20;" (assignment_expression "uVar8 = 0x20" (identifier "uVar8") (= "=") (number_literal "0x20")) (; ";")) (} "}"))) (} "}")) (else_clause "else if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }" (else "else") (if_statement "if (uVar8 == 0) {\n        uVar8 = 0x20;\n      }" (if "if") (parenthesized_expression "(uVar8 == 0)" (( "(") (binary_expression "uVar8 == 0" (identifier "uVar8") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        uVar8 = 0x20;\n      }" ({ "{") (expression_statement "uVar8 = 0x20;" (assignment_expression "uVar8 = 0x20" (identifier "uVar8") (= "=") (number_literal "0x20")) (; ";")) (} "}"))))) (} "}"))) (if_statement "if (1 < iVar3) {\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }" (if "if") (parenthesized_expression "(1 < iVar3)" (( "(") (binary_expression "1 < iVar3" (number_literal "1") (< "<") (identifier "iVar3")) () ")")) (compound_statement "{\n      iVar7 = uVar8 - 1;\n      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);\n      if (iVar3 != 0) {\n        return iVar3;\n      }\n      goto LAB_0004e984;\n    }" ({ "{") (expression_statement "iVar7 = uVar8 - 1;" (assignment_expression "iVar7 = uVar8 - 1" (identifier "iVar7") (= "=") (binary_expression "uVar8 - 1" (identifier "uVar8") (- "-") (number_literal "1"))) (; ";")) (expression_statement "iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);" (assignment_expression "iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1)" (identifier "iVar3") (= "=") (call_expression "pstm_2expt(param_1,uVar8 + uVar6 + -1)" (identifier "pstm_2expt") (argument_list "(param_1,uVar8 + uVar6 + -1)" (( "(") (identifier "param_1") (, ",") (binary_expression "uVar8 + uVar6 + -1" (binary_expression "uVar8 + uVar6" (identifier "uVar8") (+ "+") (identifier "uVar6")) (+ "+") (number_literal "-1")) () ")")))) (; ";")) (if_statement "if (iVar3 != 0) {\n        return iVar3;\n      }" (if "if") (parenthesized_expression "(iVar3 != 0)" (( "(") (binary_expression "iVar3 != 0" (identifier "iVar3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        return iVar3;\n      }" ({ "{") (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}"))) (goto_statement "goto LAB_0004e984;" (goto "goto") (statement_identifier "LAB_0004e984") (; ";")) (} "}"))) (} "}"))) (expression_statement "puVar5 = (undefined4 *)param_1[3];" (assignment_expression "puVar5 = (undefined4 *)param_1[3]" (identifier "puVar5") (= "=") (cast_expression "(undefined4 *)param_1[3]" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]")))) (; ";")) (expression_statement "param_1[2] = 0;" (assignment_expression "param_1[2] = 0" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "*param_1 = 0;" (assignment_expression "*param_1 = 0" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (number_literal "0")) (; ";")) (if_statement "if (0 < (int)param_1[1]) {\n    iVar3 = 0;\n    puVar1 = puVar5;\n    do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);\n  }" (if "if") (parenthesized_expression "(0 < (int)param_1[1])" (( "(") (binary_expression "0 < (int)param_1[1]" (number_literal "0") (< "<") (cast_expression "(int)param_1[1]" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")))) () ")")) (compound_statement "{\n    iVar3 = 0;\n    puVar1 = puVar5;\n    do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);\n  }" ({ "{") (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" (identifier "iVar3") (= "=") (number_literal "0")) (; ";")) (expression_statement "puVar1 = puVar5;" (assignment_expression "puVar1 = puVar5" (identifier "puVar1") (= "=") (identifier "puVar5")) (; ";")) (do_statement "do {\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    } while (iVar3 < (int)param_1[1]);" (do "do") (compound_statement "{\n      *puVar1 = 0;\n      iVar3 = iVar3 + 1;\n      puVar1 = puVar1 + 1;\n    }" ({ "{") (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar3 = iVar3 + 1;" (assignment_expression "iVar3 = iVar3 + 1" (identifier "iVar3") (= "=") (binary_expression "iVar3 + 1" (identifier "iVar3") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "puVar1 = puVar1 + 1;" (assignment_expression "puVar1 = puVar1 + 1" (identifier "puVar1") (= "=") (binary_expression "puVar1 + 1" (identifier "puVar1") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(iVar3 < (int)param_1[1])" (( "(") (binary_expression "iVar3 < (int)param_1[1]" (identifier "iVar3") (< "<") (cast_expression "(int)param_1[1]" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")))) () ")")) (; ";")) (} "}"))) (expression_statement "iVar7 = 0;" (assignment_expression "iVar7 = 0" (identifier "iVar7") (= "=") (number_literal "0")) (; ";")) (expression_statement "*puVar5 = 1;" (assignment_expression "*puVar5 = 1" (pointer_expression "*puVar5" (* "*") (identifier "puVar5")) (= "=") (number_literal "1")) (; ";")) (expression_statement "*param_1 = 1;" (assignment_expression "*param_1 = 1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (number_literal "1")) (; ";")) (labeled_statement "LAB_0004e984:\n  while ((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))) {\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }" (statement_identifier "LAB_0004e984") (: ":") (while_statement "while ((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))) {\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }" (while "while") (parenthesized_expression "((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)))))" (( "(") (parenthesized_expression "(iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))" (( "(") (comma_expression "iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)))" (assignment_expression "iVar3 = pstm_mul_2(param_1,param_1)" (identifier "iVar3") (= "=") (call_expression "pstm_mul_2(param_1,param_1)" (identifier "pstm_mul_2") (argument_list "(param_1,param_1)" (( "(") (identifier "param_1") (, ",") (identifier "param_1") () ")")))) (, ",") (binary_expression "iVar3 == 0 &&\n         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)))" (binary_expression "iVar3 == 0" (identifier "iVar3") (== "==") (number_literal "0")) (&& "&&") (parenthesized_expression "((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)))" (( "(") (parenthesized_expression "(iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))" (( "(") (comma_expression "iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)" (assignment_expression "iVar3 = pstm_cmp_mag(param_1,param_2)" (identifier "iVar3") (= "=") (call_expression "pstm_cmp_mag(param_1,param_2)" (identifier "pstm_cmp_mag") (argument_list "(param_1,param_2)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") () ")")))) (, ",") (binary_expression "iVar3 == -1 ||\n          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)" (binary_expression "iVar3 == -1" (identifier "iVar3") (== "==") (number_literal "-1")) (|| "||") (parenthesized_expression "(iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0)" (( "(") (comma_expression "iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0" (assignment_expression "iVar3 = s_pstm_sub(param_1,param_2,param_1)" (identifier "iVar3") (= "=") (call_expression "s_pstm_sub(param_1,param_2,param_1)" (identifier "s_pstm_sub") (argument_list "(param_1,param_2,param_1)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_1") () ")")))) (, ",") (binary_expression "iVar3 == 0" (identifier "iVar3") (== "==") (number_literal "0"))) () ")")))) () ")")) () ")")))) () ")")) () ")")) (compound_statement "{\n    iVar7 = iVar7 + 1;\n    if (iVar7 == 0x20) {\n      return 0;\n    }\n  }" ({ "{") (expression_statement "iVar7 = iVar7 + 1;" (assignment_expression "iVar7 = iVar7 + 1" (identifier "iVar7") (= "=") (binary_expression "iVar7 + 1" (identifier "iVar7") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (iVar7 == 0x20) {\n      return 0;\n    }" (if "if") (parenthesized_expression "(iVar7 == 0x20)" (( "(") (binary_expression "iVar7 == 0x20" (identifier "iVar7") (== "==") (number_literal "0x20")) () ")")) (compound_statement "{\n      return 0;\n    }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (} "}")))) (return_statement "return -8;" (return "return") (number_literal "-8") (; ";")) (} "}")))

type_1 function_1(type_2 *a,type_2 *b)

{
  type_3 *var_8;
  type_1 var_7;
  type_4 var_3;
  int var_1;
  type_4 var_2;
  type_3 *ppVar6;
  type_4 var_6;
  type_4 var_4;
  
  var_1 = b->used;
  if (var_1 != 0) {
    var_4 = 0x20;
    var_2 = b->dp[var_1 + -1];
    var_6 = (var_1 + -1) * 0x20;
    var_3 = var_6;
    if (var_2 != 0) {
      do {
        var_2 = var_2 >> 1;
        var_3 = var_3 + 1;
      } while (var_2 != 0);
      var_4 = var_3 & 0x8000001f;
      if ((int)var_4 < 0) {
        var_4 = (var_4 - 1 | 0xffffffe0) + 1;
        if (var_4 == 0) {
          var_4 = 0x20;
        }
      }
      else if (var_4 == 0) {
        var_4 = 0x20;
      }
    }
    if (1 < var_1) {
      var_1 = var_4 - 1;
      var_7 = var_5(a,var_4 + var_6 + -1);
      if (var_7 != 0) {
        return var_7;
      }
      goto LAB_0004e984;
    }
  }
  ppVar6 = a->dp;
  a->sign = 0;
  a->used = 0;
  if (0 < a->alloc) {
    var_1 = 0;
    var_8 = ppVar6;
    do {
      *var_8 = 0;
      var_1 = var_1 + 1;
      var_8 = var_8 + 1;
    } while (var_1 < a->alloc);
  }
  var_1 = 0;
  *ppVar6 = 1;
  a->used = 1;
LAB_0004e984:
  while ((var_7 = var_9(a,a), var_7 == 0 &&
         ((var_7 = var_10(a,b), var_7 == -1 || (var_7 = var_11(a,b,a), var_7 == 0))))) {
    var_1 = var_1 + 1;
    if (var_1 == 0x20) {
      return 0;
    }
  }
  return -8;
}


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

int MASKED(undefined4 *param_1,int *param_2)

{
  undefined4 *puVar1;
  uint uVar2;
  int iVar3;
  uint uVar4;
  undefined4 *puVar5;
  uint uVar6;
  int iVar7;
  uint uVar8;
  
  iVar3 = *param_2;
  if (iVar3 != 0) {
    uVar8 = 0x20;
    uVar4 = *(uint *)(param_2[3] + iVar3 * 4 + -4);
    uVar6 = (iVar3 + -1) * 0x20;
    uVar2 = uVar6;
    if (uVar4 != 0) {
      do {
        uVar4 = uVar4 >> 1;
        uVar2 = uVar2 + 1;
      } while (uVar4 != 0);
      uVar8 = uVar2 & 0x8000001f;
      if ((int)uVar8 < 0) {
        uVar8 = (uVar8 - 1 | 0xffffffe0) + 1;
        if (uVar8 == 0) {
          uVar8 = 0x20;
        }
      }
      else if (uVar8 == 0) {
        uVar8 = 0x20;
      }
    }
    if (1 < iVar3) {
      iVar7 = uVar8 - 1;
      iVar3 = pstm_2expt(param_1,uVar8 + uVar6 + -1);
      if (iVar3 != 0) {
        return iVar3;
      }
      goto LAB_0004e984;
    }
  }
  puVar5 = (undefined4 *)param_1[3];
  param_1[2] = 0;
  *param_1 = 0;
  if (0 < (int)param_1[1]) {
    iVar3 = 0;
    puVar1 = puVar5;
    do {
      *puVar1 = 0;
      iVar3 = iVar3 + 1;
      puVar1 = puVar1 + 1;
    } while (iVar3 < (int)param_1[1]);
  }
  iVar7 = 0;
  *puVar5 = 1;
  *param_1 = 1;
LAB_0004e984:
  while ((iVar3 = pstm_mul_2(param_1,param_1), iVar3 == 0 &&
         ((iVar3 = pstm_cmp_mag(param_1,param_2), iVar3 == -1 ||
          (iVar3 = s_pstm_sub(param_1,param_2,param_1), iVar3 == 0))))) {
    iVar7 = iVar7 + 1;
    if (iVar7 == 0x20) {
      return 0;
    }
  }
  return -8;
}

