
/* WARNING: Unknown calling convention */

ushort bignum_mod_short(Bignum_conflict number,ushort modulus)

{
  uint uVar1;
  Bignum_conflict pBVar2;
  undefined2 in_register_00000014;
  ulong mod;
  uint uVar3;
  uint uVar4;
  
  uVar3 = CONCAT22(in_register_00000014,modulus);
  if (uVar3 == 0) {
    trap(7);
  }
  if (0 < (int)*number) {
    uVar1 = 0;
    pBVar2 = number + *number;
    do {
      uVar4 = *pBVar2;
      pBVar2 = pBVar2 + -1;
      if (uVar3 == 0) {
        trap(7);
      }
      if (uVar3 == 0) {
        trap(7);
      }
      uVar1 = ((-uVar3 % uVar3) * uVar1 + uVar4 % uVar3) % uVar3;
    } while (number != pBVar2);
    return (ushort)uVar1;
  }
  return 0;
}



uint bignum_mod_short(uint *param_1,uint param_2)

{
  uint uVar1;
  uint *puVar2;
  uint uVar3;
  
  if (param_2 == 0) {
    trap(7);
  }
  if (0 < (int)*param_1) {
    uVar1 = 0;
    puVar2 = param_1 + *param_1;
    do {
      uVar3 = *puVar2;
      puVar2 = puVar2 + -1;
      if (param_2 == 0) {
        trap(7);
      }
      if (param_2 == 0) {
        trap(7);
      }
      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;
    } while (param_1 != puVar2);
    return uVar1 & 0xffff;
  }
  return 0;
}


subu a3,zero,a1
lw v1,0x0(a0)
teq a1,zero
divu a3,a1
blez v1,0x00028cbc
_mfhi a3
sll v1,v1,0x2
or v0,zero,zero
addu v1,a0,v1
lw a2,0x0(v1)
addiu v1,v1,-0x4
teq a1,zero
divu a2,a1
mfhi a2
mul t0,a3,v0
addu v0,t0,a2
teq a1,zero
divu v0,a1
bne a0,v1,0x00028c88
_mfhi v0
jr ra
_andi v0,v0,0xffff
jr ra
_or v0,zero,zero
(translation_unit "uint bignum_mod_short(uint *param_1,uint param_2)\n\n{\n  uint uVar1;\n  uint *puVar2;\n  uint uVar3;\n  \n  if (param_2 == 0) {\n    trap(7);\n  }\n  if (0 < (int)*param_1) {\n    uVar1 = 0;\n    puVar2 = param_1 + *param_1;\n    do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);\n    return uVar1 & 0xffff;\n  }\n  return 0;\n}\n\n" (function_definition "uint bignum_mod_short(uint *param_1,uint param_2)\n\n{\n  uint uVar1;\n  uint *puVar2;\n  uint uVar3;\n  \n  if (param_2 == 0) {\n    trap(7);\n  }\n  if (0 < (int)*param_1) {\n    uVar1 = 0;\n    puVar2 = param_1 + *param_1;\n    do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);\n    return uVar1 & 0xffff;\n  }\n  return 0;\n}" type_identifier (function_declarator "bignum_mod_short(uint *param_1,uint param_2)" identifier (parameter_list "(uint *param_1,uint param_2)" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  uint *puVar2;\n  uint uVar3;\n  \n  if (param_2 == 0) {\n    trap(7);\n  }\n  if (0 < (int)*param_1) {\n    uVar1 = 0;\n    puVar2 = param_1 + *param_1;\n    do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);\n    return uVar1 & 0xffff;\n  }\n  return 0;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (if_statement "if (param_2 == 0) {\n    trap(7);\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    trap(7);\n  }" { (expression_statement "trap(7);" (call_expression "trap(7)" identifier (argument_list "(7)" ( number_literal ))) ;) })) (if_statement "if (0 < (int)*param_1) {\n    uVar1 = 0;\n    puVar2 = param_1 + *param_1;\n    do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);\n    return uVar1 & 0xffff;\n  }" if (parenthesized_expression "(0 < (int)*param_1)" ( (binary_expression "0 < (int)*param_1" number_literal < (cast_expression "(int)*param_1" ( (type_descriptor "int" primitive_type) ) (pointer_expression "*param_1" * identifier))) )) (compound_statement "{\n    uVar1 = 0;\n    puVar2 = param_1 + *param_1;\n    do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);\n    return uVar1 & 0xffff;\n  }" { (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) (expression_statement "puVar2 = param_1 + *param_1;" (assignment_expression "puVar2 = param_1 + *param_1" identifier = (binary_expression "param_1 + *param_1" identifier + (pointer_expression "*param_1" * identifier))) ;) (do_statement "do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);" do (compound_statement "{\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    }" { (expression_statement "uVar3 = *puVar2;" (assignment_expression "uVar3 = *puVar2" identifier = (pointer_expression "*puVar2" * identifier)) ;) (expression_statement "puVar2 = puVar2 + -1;" (assignment_expression "puVar2 = puVar2 + -1" identifier = (binary_expression "puVar2 + -1" identifier + number_literal)) ;) (if_statement "if (param_2 == 0) {\n        trap(7);\n      }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n        trap(7);\n      }" { (expression_statement "trap(7);" (call_expression "trap(7)" identifier (argument_list "(7)" ( number_literal ))) ;) })) (if_statement "if (param_2 == 0) {\n        trap(7);\n      }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n        trap(7);\n      }" { (expression_statement "trap(7);" (call_expression "trap(7)" identifier (argument_list "(7)" ( number_literal ))) ;) })) (expression_statement "uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;" (assignment_expression "uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2" identifier = (binary_expression "((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2" (parenthesized_expression "((-param_2 % param_2) * uVar1 + uVar3 % param_2)" ( (binary_expression "(-param_2 % param_2) * uVar1 + uVar3 % param_2" (binary_expression "(-param_2 % param_2) * uVar1" (parenthesized_expression "(-param_2 % param_2)" ( (binary_expression "-param_2 % param_2" (unary_expression "-param_2" - identifier) % identifier) )) * identifier) + (binary_expression "uVar3 % param_2" identifier % identifier)) )) % identifier)) ;) }) while (parenthesized_expression "(param_1 != puVar2)" ( (binary_expression "param_1 != puVar2" identifier != identifier) )) ;) (return_statement "return uVar1 & 0xffff;" return (binary_expression "uVar1 & 0xffff" identifier & number_literal) ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "/* WARNING: Unknown calling convention */\n\nushort bignum_mod_short(Bignum_conflict number,ushort modulus)\n\n{\n  uint uVar1;\n  Bignum_conflict pBVar2;\n  undefined2 in_register_00000014;\n  ulong mod;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar3 = CONCAT22(in_register_00000014,modulus);\n  if (uVar3 == 0) {\n    trap(7);\n  }\n  if (0 < (int)*number) {\n    uVar1 = 0;\n    pBVar2 = number + *number;\n    do {\n      uVar4 = *pBVar2;\n      pBVar2 = pBVar2 + -1;\n      if (uVar3 == 0) {\n        trap(7);\n      }\n      if (uVar3 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-uVar3 % uVar3) * uVar1 + uVar4 % uVar3) % uVar3;\n    } while (number != pBVar2);\n    return (ushort)uVar1;\n  }\n  return 0;\n}\n\n" comment (function_definition "ushort bignum_mod_short(Bignum_conflict number,ushort modulus)\n\n{\n  uint uVar1;\n  Bignum_conflict pBVar2;\n  undefined2 in_register_00000014;\n  ulong mod;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar3 = CONCAT22(in_register_00000014,modulus);\n  if (uVar3 == 0) {\n    trap(7);\n  }\n  if (0 < (int)*number) {\n    uVar1 = 0;\n    pBVar2 = number + *number;\n    do {\n      uVar4 = *pBVar2;\n      pBVar2 = pBVar2 + -1;\n      if (uVar3 == 0) {\n        trap(7);\n      }\n      if (uVar3 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-uVar3 % uVar3) * uVar1 + uVar4 % uVar3) % uVar3;\n    } while (number != pBVar2);\n    return (ushort)uVar1;\n  }\n  return 0;\n}" type_identifier (function_declarator "bignum_mod_short(Bignum_conflict number,ushort modulus)" identifier (parameter_list "(Bignum_conflict number,ushort modulus)" ( (parameter_declaration "Bignum_conflict number" type_identifier identifier) , (parameter_declaration "ushort modulus" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  Bignum_conflict pBVar2;\n  undefined2 in_register_00000014;\n  ulong mod;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar3 = CONCAT22(in_register_00000014,modulus);\n  if (uVar3 == 0) {\n    trap(7);\n  }\n  if (0 < (int)*number) {\n    uVar1 = 0;\n    pBVar2 = number + *number;\n    do {\n      uVar4 = *pBVar2;\n      pBVar2 = pBVar2 + -1;\n      if (uVar3 == 0) {\n        trap(7);\n      }\n      if (uVar3 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-uVar3 % uVar3) * uVar1 + uVar4 % uVar3) % uVar3;\n    } while (number != pBVar2);\n    return (ushort)uVar1;\n  }\n  return 0;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "Bignum_conflict pBVar2;" type_identifier identifier ;) (declaration "undefined2 in_register_00000014;" type_identifier identifier ;) (declaration "ulong mod;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "uVar3 = CONCAT22(in_register_00000014,modulus);" (assignment_expression "uVar3 = CONCAT22(in_register_00000014,modulus)" identifier = (call_expression "CONCAT22(in_register_00000014,modulus)" identifier (argument_list "(in_register_00000014,modulus)" ( identifier , identifier )))) ;) (if_statement "if (uVar3 == 0) {\n    trap(7);\n  }" if (parenthesized_expression "(uVar3 == 0)" ( (binary_expression "uVar3 == 0" identifier == number_literal) )) (compound_statement "{\n    trap(7);\n  }" { (expression_statement "trap(7);" (call_expression "trap(7)" identifier (argument_list "(7)" ( number_literal ))) ;) })) (if_statement "if (0 < (int)*number) {\n    uVar1 = 0;\n    pBVar2 = number + *number;\n    do {\n      uVar4 = *pBVar2;\n      pBVar2 = pBVar2 + -1;\n      if (uVar3 == 0) {\n        trap(7);\n      }\n      if (uVar3 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-uVar3 % uVar3) * uVar1 + uVar4 % uVar3) % uVar3;\n    } while (number != pBVar2);\n    return (ushort)uVar1;\n  }" if (parenthesized_expression "(0 < (int)*number)" ( (binary_expression "0 < (int)*number" number_literal < (cast_expression "(int)*number" ( (type_descriptor "int" primitive_type) ) (pointer_expression "*number" * identifier))) )) (compound_statement "{\n    uVar1 = 0;\n    pBVar2 = number + *number;\n    do {\n      uVar4 = *pBVar2;\n      pBVar2 = pBVar2 + -1;\n      if (uVar3 == 0) {\n        trap(7);\n      }\n      if (uVar3 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-uVar3 % uVar3) * uVar1 + uVar4 % uVar3) % uVar3;\n    } while (number != pBVar2);\n    return (ushort)uVar1;\n  }" { (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) (expression_statement "pBVar2 = number + *number;" (assignment_expression "pBVar2 = number + *number" identifier = (binary_expression "number + *number" identifier + (pointer_expression "*number" * identifier))) ;) (do_statement "do {\n      uVar4 = *pBVar2;\n      pBVar2 = pBVar2 + -1;\n      if (uVar3 == 0) {\n        trap(7);\n      }\n      if (uVar3 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-uVar3 % uVar3) * uVar1 + uVar4 % uVar3) % uVar3;\n    } while (number != pBVar2);" do (compound_statement "{\n      uVar4 = *pBVar2;\n      pBVar2 = pBVar2 + -1;\n      if (uVar3 == 0) {\n        trap(7);\n      }\n      if (uVar3 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-uVar3 % uVar3) * uVar1 + uVar4 % uVar3) % uVar3;\n    }" { (expression_statement "uVar4 = *pBVar2;" (assignment_expression "uVar4 = *pBVar2" identifier = (pointer_expression "*pBVar2" * identifier)) ;) (expression_statement "pBVar2 = pBVar2 + -1;" (assignment_expression "pBVar2 = pBVar2 + -1" identifier = (binary_expression "pBVar2 + -1" identifier + number_literal)) ;) (if_statement "if (uVar3 == 0) {\n        trap(7);\n      }" if (parenthesized_expression "(uVar3 == 0)" ( (binary_expression "uVar3 == 0" identifier == number_literal) )) (compound_statement "{\n        trap(7);\n      }" { (expression_statement "trap(7);" (call_expression "trap(7)" identifier (argument_list "(7)" ( number_literal ))) ;) })) (if_statement "if (uVar3 == 0) {\n        trap(7);\n      }" if (parenthesized_expression "(uVar3 == 0)" ( (binary_expression "uVar3 == 0" identifier == number_literal) )) (compound_statement "{\n        trap(7);\n      }" { (expression_statement "trap(7);" (call_expression "trap(7)" identifier (argument_list "(7)" ( number_literal ))) ;) })) (expression_statement "uVar1 = ((-uVar3 % uVar3) * uVar1 + uVar4 % uVar3) % uVar3;" (assignment_expression "uVar1 = ((-uVar3 % uVar3) * uVar1 + uVar4 % uVar3) % uVar3" identifier = (binary_expression "((-uVar3 % uVar3) * uVar1 + uVar4 % uVar3) % uVar3" (parenthesized_expression "((-uVar3 % uVar3) * uVar1 + uVar4 % uVar3)" ( (binary_expression "(-uVar3 % uVar3) * uVar1 + uVar4 % uVar3" (binary_expression "(-uVar3 % uVar3) * uVar1" (parenthesized_expression "(-uVar3 % uVar3)" ( (binary_expression "-uVar3 % uVar3" (unary_expression "-uVar3" - identifier) % identifier) )) * identifier) + (binary_expression "uVar4 % uVar3" identifier % identifier)) )) % identifier)) ;) }) while (parenthesized_expression "(number != pBVar2)" ( (binary_expression "number != pBVar2" identifier != identifier) )) ;) (return_statement "return (ushort)uVar1;" return (cast_expression "(ushort)uVar1" ( (type_descriptor "ushort" type_identifier) ) identifier) ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "uint bignum_mod_short(uint *param_1,uint param_2)\n\n{\n  uint uVar1;\n  uint *puVar2;\n  uint uVar3;\n  \n  if (param_2 == 0) {\n    trap(7);\n  }\n  if (0 < (int)*param_1) {\n    uVar1 = 0;\n    puVar2 = param_1 + *param_1;\n    do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);\n    return uVar1 & 0xffff;\n  }\n  return 0;\n}\n\n" (function_definition "uint bignum_mod_short(uint *param_1,uint param_2)\n\n{\n  uint uVar1;\n  uint *puVar2;\n  uint uVar3;\n  \n  if (param_2 == 0) {\n    trap(7);\n  }\n  if (0 < (int)*param_1) {\n    uVar1 = 0;\n    puVar2 = param_1 + *param_1;\n    do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);\n    return uVar1 & 0xffff;\n  }\n  return 0;\n}" type_identifier (function_declarator "bignum_mod_short(uint *param_1,uint param_2)" identifier (parameter_list "(uint *param_1,uint param_2)" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  uint *puVar2;\n  uint uVar3;\n  \n  if (param_2 == 0) {\n    trap(7);\n  }\n  if (0 < (int)*param_1) {\n    uVar1 = 0;\n    puVar2 = param_1 + *param_1;\n    do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);\n    return uVar1 & 0xffff;\n  }\n  return 0;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (if_statement "if (param_2 == 0) {\n    trap(7);\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    trap(7);\n  }" { (expression_statement "trap(7);" (call_expression "trap(7)" identifier (argument_list "(7)" ( number_literal ))) ;) })) (if_statement "if (0 < (int)*param_1) {\n    uVar1 = 0;\n    puVar2 = param_1 + *param_1;\n    do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);\n    return uVar1 & 0xffff;\n  }" if (parenthesized_expression "(0 < (int)*param_1)" ( (binary_expression "0 < (int)*param_1" number_literal < (cast_expression "(int)*param_1" ( (type_descriptor "int" primitive_type) ) (pointer_expression "*param_1" * identifier))) )) (compound_statement "{\n    uVar1 = 0;\n    puVar2 = param_1 + *param_1;\n    do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);\n    return uVar1 & 0xffff;\n  }" { (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) (expression_statement "puVar2 = param_1 + *param_1;" (assignment_expression "puVar2 = param_1 + *param_1" identifier = (binary_expression "param_1 + *param_1" identifier + (pointer_expression "*param_1" * identifier))) ;) (do_statement "do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);" do (compound_statement "{\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    }" { (expression_statement "uVar3 = *puVar2;" (assignment_expression "uVar3 = *puVar2" identifier = (pointer_expression "*puVar2" * identifier)) ;) (expression_statement "puVar2 = puVar2 + -1;" (assignment_expression "puVar2 = puVar2 + -1" identifier = (binary_expression "puVar2 + -1" identifier + number_literal)) ;) (if_statement "if (param_2 == 0) {\n        trap(7);\n      }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n        trap(7);\n      }" { (expression_statement "trap(7);" (call_expression "trap(7)" identifier (argument_list "(7)" ( number_literal ))) ;) })) (if_statement "if (param_2 == 0) {\n        trap(7);\n      }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n        trap(7);\n      }" { (expression_statement "trap(7);" (call_expression "trap(7)" identifier (argument_list "(7)" ( number_literal ))) ;) })) (expression_statement "uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;" (assignment_expression "uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2" identifier = (binary_expression "((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2" (parenthesized_expression "((-param_2 % param_2) * uVar1 + uVar3 % param_2)" ( (binary_expression "(-param_2 % param_2) * uVar1 + uVar3 % param_2" (binary_expression "(-param_2 % param_2) * uVar1" (parenthesized_expression "(-param_2 % param_2)" ( (binary_expression "-param_2 % param_2" (unary_expression "-param_2" - identifier) % identifier) )) * identifier) + (binary_expression "uVar3 % param_2" identifier % identifier)) )) % identifier)) ;) }) while (parenthesized_expression "(param_1 != puVar2)" ( (binary_expression "param_1 != puVar2" identifier != identifier) )) ;) (return_statement "return uVar1 & 0xffff;" return (binary_expression "uVar1 & 0xffff" identifier & number_literal) ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( LIT ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression LIT < (cast_expression ( (type_descriptor TYPE) ) (pointer_expression * IDENT))) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + (pointer_expression * IDENT))) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( LIT ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( LIT ))) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression (binary_expression (parenthesized_expression ( (binary_expression (unary_expression - IDENT) % IDENT) )) * IDENT) + (binary_expression IDENT % IDENT)) )) % IDENT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != IDENT) )) ;) (return_statement return (binary_expression IDENT & LIT) ;) })) (return_statement return LIT ;) })))
(function_definition "uint bignum_mod_short(uint *param_1,uint param_2)\n\n{\n  uint uVar1;\n  uint *puVar2;\n  uint uVar3;\n  \n  if (param_2 == 0) {\n    trap(7);\n  }\n  if (0 < (int)*param_1) {\n    uVar1 = 0;\n    puVar2 = param_1 + *param_1;\n    do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);\n    return uVar1 & 0xffff;\n  }\n  return 0;\n}" (type_identifier "uint") (function_declarator "bignum_mod_short(uint *param_1,uint param_2)" (identifier "bignum_mod_short") (parameter_list "(uint *param_1,uint param_2)" (( "(") (parameter_declaration "uint *param_1" (type_identifier "uint") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) () ")"))) (compound_statement "{\n  uint uVar1;\n  uint *puVar2;\n  uint uVar3;\n  \n  if (param_2 == 0) {\n    trap(7);\n  }\n  if (0 < (int)*param_1) {\n    uVar1 = 0;\n    puVar2 = param_1 + *param_1;\n    do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);\n    return uVar1 & 0xffff;\n  }\n  return 0;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "uint *puVar2;" (type_identifier "uint") (pointer_declarator "*puVar2" (* "*") (identifier "puVar2")) (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (if_statement "if (param_2 == 0) {\n    trap(7);\n  }" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    trap(7);\n  }" ({ "{") (expression_statement "trap(7);" (call_expression "trap(7)" (identifier "trap") (argument_list "(7)" (( "(") (number_literal "7") () ")"))) (; ";")) (} "}"))) (if_statement "if (0 < (int)*param_1) {\n    uVar1 = 0;\n    puVar2 = param_1 + *param_1;\n    do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);\n    return uVar1 & 0xffff;\n  }" (if "if") (parenthesized_expression "(0 < (int)*param_1)" (( "(") (binary_expression "0 < (int)*param_1" (number_literal "0") (< "<") (cast_expression "(int)*param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) () ")")) (compound_statement "{\n    uVar1 = 0;\n    puVar2 = param_1 + *param_1;\n    do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);\n    return uVar1 & 0xffff;\n  }" ({ "{") (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" (identifier "uVar1") (= "=") (number_literal "0")) (; ";")) (expression_statement "puVar2 = param_1 + *param_1;" (assignment_expression "puVar2 = param_1 + *param_1" (identifier "puVar2") (= "=") (binary_expression "param_1 + *param_1" (identifier "param_1") (+ "+") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (do_statement "do {\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    } while (param_1 != puVar2);" (do "do") (compound_statement "{\n      uVar3 = *puVar2;\n      puVar2 = puVar2 + -1;\n      if (param_2 == 0) {\n        trap(7);\n      }\n      if (param_2 == 0) {\n        trap(7);\n      }\n      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;\n    }" ({ "{") (expression_statement "uVar3 = *puVar2;" (assignment_expression "uVar3 = *puVar2" (identifier "uVar3") (= "=") (pointer_expression "*puVar2" (* "*") (identifier "puVar2"))) (; ";")) (expression_statement "puVar2 = puVar2 + -1;" (assignment_expression "puVar2 = puVar2 + -1" (identifier "puVar2") (= "=") (binary_expression "puVar2 + -1" (identifier "puVar2") (+ "+") (number_literal "-1"))) (; ";")) (if_statement "if (param_2 == 0) {\n        trap(7);\n      }" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        trap(7);\n      }" ({ "{") (expression_statement "trap(7);" (call_expression "trap(7)" (identifier "trap") (argument_list "(7)" (( "(") (number_literal "7") () ")"))) (; ";")) (} "}"))) (if_statement "if (param_2 == 0) {\n        trap(7);\n      }" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        trap(7);\n      }" ({ "{") (expression_statement "trap(7);" (call_expression "trap(7)" (identifier "trap") (argument_list "(7)" (( "(") (number_literal "7") () ")"))) (; ";")) (} "}"))) (expression_statement "uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;" (assignment_expression "uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2" (identifier "uVar1") (= "=") (binary_expression "((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2" (parenthesized_expression "((-param_2 % param_2) * uVar1 + uVar3 % param_2)" (( "(") (binary_expression "(-param_2 % param_2) * uVar1 + uVar3 % param_2" (binary_expression "(-param_2 % param_2) * uVar1" (parenthesized_expression "(-param_2 % param_2)" (( "(") (binary_expression "-param_2 % param_2" (unary_expression "-param_2" (- "-") (identifier "param_2")) (% "%") (identifier "param_2")) () ")")) (* "*") (identifier "uVar1")) (+ "+") (binary_expression "uVar3 % param_2" (identifier "uVar3") (% "%") (identifier "param_2"))) () ")")) (% "%") (identifier "param_2"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(param_1 != puVar2)" (( "(") (binary_expression "param_1 != puVar2" (identifier "param_1") (!= "!=") (identifier "puVar2")) () ")")) (; ";")) (return_statement "return uVar1 & 0xffff;" (return "return") (binary_expression "uVar1 & 0xffff" (identifier "uVar1") (& "&") (number_literal "0xffff")) (; ";")) (} "}"))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))
(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (pointer_expression argument: (identifier))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (pointer_expression argument: (identifier))))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (unary_expression argument: (identifier)) right: (identifier))) right: (identifier)) right: (binary_expression left: (identifier) right: (identifier)))) right: (identifier))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))) (return_statement (binary_expression left: (identifier) right: (number_literal))))) (return_statement (number_literal)))))

uint MASKED(uint *param_1,uint param_2)

{
  uint uVar1;
  uint *puVar2;
  uint uVar3;
  
  if (param_2 == 0) {
    trap(7);
  }
  if (0 < (int)*param_1) {
    uVar1 = 0;
    puVar2 = param_1 + *param_1;
    do {
      uVar3 = *puVar2;
      puVar2 = puVar2 + -1;
      if (param_2 == 0) {
        trap(7);
      }
      if (param_2 == 0) {
        trap(7);
      }
      uVar1 = ((-param_2 % param_2) * uVar1 + uVar3 % param_2) % param_2;
    } while (param_1 != puVar2);
    return uVar1 & 0xffff;
  }
  return 0;
}

