
/* WARNING: Unknown calling convention */

ushort bignum_mod_short(Bignum_conflict number,ushort modulus)

{
  long lVar1;
  ulong uVar2;
  ulong uVar3;
  
  uVar2 = (ulong)modulus;
  if ((int)*number < 1) {
    uVar3 = 0;
  }
  else {
    lVar1 = (long)(int)*number;
    uVar3 = 0;
    do {
      uVar3 = (uVar3 * (-uVar2 % uVar2) + number[lVar1] % uVar2) % uVar2;
      lVar1 = lVar1 + -1;
    } while (0 < (int)lVar1);
  }
  return (ushort)uVar3;
}



ulong FUN_00132af7(undefined8 *param_1,ushort param_2)

{
  long lVar1;
  ulong uVar2;
  ulong uVar3;
  
  uVar2 = (ulong)param_2;
  if ((int)*param_1 < 1) {
    uVar3 = 0;
  }
  else {
    lVar1 = (long)(int)*param_1;
    uVar3 = 0;
    do {
      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;
      lVar1 = lVar1 + -1;
    } while (0 < (int)lVar1);
  }
  return uVar3;
}


MOVZX ESI,SI
MOV RAX,RSI
NEG RAX
MOV EDX,0x0
DIV RSI
MOV R9,RDX
MOV RCX,qword ptr [RDI]
TEST ECX,ECX
JLE 0x00132b48
MOVSXD RCX,ECX
MOV R8D,0x0
MOV RAX,qword ptr [RDI + RCX*0x8]
MOV EDX,0x0
DIV RSI
MOV RAX,R8
IMUL RAX,R9
ADD RAX,RDX
MOV EDX,0x0
DIV RSI
MOV R8,RDX
SUB RCX,0x1
TEST ECX,ECX
JG 0x00132b1b
MOV EAX,R8D
RET
MOV R8D,0x0
JMP 0x00132b44
(translation_unit "ulong FUN_00132af7(undefined8 *param_1,ushort param_2)\n\n{\n  long lVar1;\n  ulong uVar2;\n  ulong uVar3;\n  \n  uVar2 = (ulong)param_2;\n  if ((int)*param_1 < 1) {\n    uVar3 = 0;\n  }\n  else {\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }\n  return uVar3;\n}\n\n" (function_definition "ulong FUN_00132af7(undefined8 *param_1,ushort param_2)\n\n{\n  long lVar1;\n  ulong uVar2;\n  ulong uVar3;\n  \n  uVar2 = (ulong)param_2;\n  if ((int)*param_1 < 1) {\n    uVar3 = 0;\n  }\n  else {\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }\n  return uVar3;\n}" type_identifier (function_declarator "FUN_00132af7(undefined8 *param_1,ushort param_2)" identifier (parameter_list "(undefined8 *param_1,ushort param_2)" ( (parameter_declaration "undefined8 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "ushort param_2" type_identifier identifier) ))) (compound_statement "{\n  long lVar1;\n  ulong uVar2;\n  ulong uVar3;\n  \n  uVar2 = (ulong)param_2;\n  if ((int)*param_1 < 1) {\n    uVar3 = 0;\n  }\n  else {\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }\n  return uVar3;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "ulong uVar2;" type_identifier identifier ;) (declaration "ulong uVar3;" type_identifier identifier ;) (expression_statement "uVar2 = (ulong)param_2;" (assignment_expression "uVar2 = (ulong)param_2" identifier = (cast_expression "(ulong)param_2" ( (type_descriptor "ulong" type_identifier) ) identifier)) ;) (if_statement "if ((int)*param_1 < 1) {\n    uVar3 = 0;\n  }\n  else {\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }" if (parenthesized_expression "((int)*param_1 < 1)" ( (binary_expression "(int)*param_1 < 1" (cast_expression "(int)*param_1" ( (type_descriptor "int" primitive_type) ) (pointer_expression "*param_1" * identifier)) < number_literal) )) (compound_statement "{\n    uVar3 = 0;\n  }" { (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }" else (compound_statement "{\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }" { (expression_statement "lVar1 = (long)(int)*param_1;" (assignment_expression "lVar1 = (long)(int)*param_1" identifier = (cast_expression "(long)(int)*param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (cast_expression "(int)*param_1" ( (type_descriptor "int" primitive_type) ) (pointer_expression "*param_1" * identifier)))) ;) (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) (do_statement "do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);" do (compound_statement "{\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    }" { (expression_statement "uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;" (assignment_expression "uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2" identifier = (binary_expression "(uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2" (parenthesized_expression "(uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2)" ( (binary_expression "uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2" (binary_expression "uVar3 * (-uVar2 % uVar2)" identifier * (parenthesized_expression "(-uVar2 % uVar2)" ( (binary_expression "-uVar2 % uVar2" (unary_expression "-uVar2" - identifier) % identifier) ))) + (binary_expression "(ulong)param_1[lVar1] % uVar2" (cast_expression "(ulong)param_1[lVar1]" ( (type_descriptor "ulong" type_identifier) ) (subscript_expression "param_1[lVar1]" identifier [ identifier ])) % identifier)) )) % identifier)) ;) (expression_statement "lVar1 = lVar1 + -1;" (assignment_expression "lVar1 = lVar1 + -1" identifier = (binary_expression "lVar1 + -1" identifier + number_literal)) ;) }) while (parenthesized_expression "(0 < (int)lVar1)" ( (binary_expression "0 < (int)lVar1" number_literal < (cast_expression "(int)lVar1" ( (type_descriptor "int" primitive_type) ) identifier)) )) ;) }))) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit "/* WARNING: Unknown calling convention */\n\nushort bignum_mod_short(Bignum_conflict number,ushort modulus)\n\n{\n  long lVar1;\n  ulong uVar2;\n  ulong uVar3;\n  \n  uVar2 = (ulong)modulus;\n  if ((int)*number < 1) {\n    uVar3 = 0;\n  }\n  else {\n    lVar1 = (long)(int)*number;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + number[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }\n  return (ushort)uVar3;\n}\n\n" comment (function_definition "ushort bignum_mod_short(Bignum_conflict number,ushort modulus)\n\n{\n  long lVar1;\n  ulong uVar2;\n  ulong uVar3;\n  \n  uVar2 = (ulong)modulus;\n  if ((int)*number < 1) {\n    uVar3 = 0;\n  }\n  else {\n    lVar1 = (long)(int)*number;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + number[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }\n  return (ushort)uVar3;\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  long lVar1;\n  ulong uVar2;\n  ulong uVar3;\n  \n  uVar2 = (ulong)modulus;\n  if ((int)*number < 1) {\n    uVar3 = 0;\n  }\n  else {\n    lVar1 = (long)(int)*number;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + number[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }\n  return (ushort)uVar3;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "ulong uVar2;" type_identifier identifier ;) (declaration "ulong uVar3;" type_identifier identifier ;) (expression_statement "uVar2 = (ulong)modulus;" (assignment_expression "uVar2 = (ulong)modulus" identifier = (cast_expression "(ulong)modulus" ( (type_descriptor "ulong" type_identifier) ) identifier)) ;) (if_statement "if ((int)*number < 1) {\n    uVar3 = 0;\n  }\n  else {\n    lVar1 = (long)(int)*number;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + number[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }" if (parenthesized_expression "((int)*number < 1)" ( (binary_expression "(int)*number < 1" (cast_expression "(int)*number" ( (type_descriptor "int" primitive_type) ) (pointer_expression "*number" * identifier)) < number_literal) )) (compound_statement "{\n    uVar3 = 0;\n  }" { (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    lVar1 = (long)(int)*number;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + number[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }" else (compound_statement "{\n    lVar1 = (long)(int)*number;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + number[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }" { (expression_statement "lVar1 = (long)(int)*number;" (assignment_expression "lVar1 = (long)(int)*number" identifier = (cast_expression "(long)(int)*number" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (cast_expression "(int)*number" ( (type_descriptor "int" primitive_type) ) (pointer_expression "*number" * identifier)))) ;) (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) (do_statement "do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + number[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);" do (compound_statement "{\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + number[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    }" { (expression_statement "uVar3 = (uVar3 * (-uVar2 % uVar2) + number[lVar1] % uVar2) % uVar2;" (assignment_expression "uVar3 = (uVar3 * (-uVar2 % uVar2) + number[lVar1] % uVar2) % uVar2" identifier = (binary_expression "(uVar3 * (-uVar2 % uVar2) + number[lVar1] % uVar2) % uVar2" (parenthesized_expression "(uVar3 * (-uVar2 % uVar2) + number[lVar1] % uVar2)" ( (binary_expression "uVar3 * (-uVar2 % uVar2) + number[lVar1] % uVar2" (binary_expression "uVar3 * (-uVar2 % uVar2)" identifier * (parenthesized_expression "(-uVar2 % uVar2)" ( (binary_expression "-uVar2 % uVar2" (unary_expression "-uVar2" - identifier) % identifier) ))) + (binary_expression "number[lVar1] % uVar2" (subscript_expression "number[lVar1]" identifier [ identifier ]) % identifier)) )) % identifier)) ;) (expression_statement "lVar1 = lVar1 + -1;" (assignment_expression "lVar1 = lVar1 + -1" identifier = (binary_expression "lVar1 + -1" identifier + number_literal)) ;) }) while (parenthesized_expression "(0 < (int)lVar1)" ( (binary_expression "0 < (int)lVar1" number_literal < (cast_expression "(int)lVar1" ( (type_descriptor "int" primitive_type) ) identifier)) )) ;) }))) (return_statement "return (ushort)uVar3;" return (cast_expression "(ushort)uVar3" ( (type_descriptor "ushort" type_identifier) ) identifier) ;) })))
(translation_unit "ulong FUN_00132af7(undefined8 *param_1,ushort param_2)\n\n{\n  long lVar1;\n  ulong uVar2;\n  ulong uVar3;\n  \n  uVar2 = (ulong)param_2;\n  if ((int)*param_1 < 1) {\n    uVar3 = 0;\n  }\n  else {\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }\n  return uVar3;\n}\n\n" (function_definition "ulong FUN_00132af7(undefined8 *param_1,ushort param_2)\n\n{\n  long lVar1;\n  ulong uVar2;\n  ulong uVar3;\n  \n  uVar2 = (ulong)param_2;\n  if ((int)*param_1 < 1) {\n    uVar3 = 0;\n  }\n  else {\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }\n  return uVar3;\n}" type_identifier (function_declarator "FUN_00132af7(undefined8 *param_1,ushort param_2)" identifier (parameter_list "(undefined8 *param_1,ushort param_2)" ( (parameter_declaration "undefined8 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "ushort param_2" type_identifier identifier) ))) (compound_statement "{\n  long lVar1;\n  ulong uVar2;\n  ulong uVar3;\n  \n  uVar2 = (ulong)param_2;\n  if ((int)*param_1 < 1) {\n    uVar3 = 0;\n  }\n  else {\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }\n  return uVar3;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "ulong uVar2;" type_identifier identifier ;) (declaration "ulong uVar3;" type_identifier identifier ;) (expression_statement "uVar2 = (ulong)param_2;" (assignment_expression "uVar2 = (ulong)param_2" identifier = (cast_expression "(ulong)param_2" ( (type_descriptor "ulong" type_identifier) ) identifier)) ;) (if_statement "if ((int)*param_1 < 1) {\n    uVar3 = 0;\n  }\n  else {\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }" if (parenthesized_expression "((int)*param_1 < 1)" ( (binary_expression "(int)*param_1 < 1" (cast_expression "(int)*param_1" ( (type_descriptor "int" primitive_type) ) (pointer_expression "*param_1" * identifier)) < number_literal) )) (compound_statement "{\n    uVar3 = 0;\n  }" { (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }" else (compound_statement "{\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }" { (expression_statement "lVar1 = (long)(int)*param_1;" (assignment_expression "lVar1 = (long)(int)*param_1" identifier = (cast_expression "(long)(int)*param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (cast_expression "(int)*param_1" ( (type_descriptor "int" primitive_type) ) (pointer_expression "*param_1" * identifier)))) ;) (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) (do_statement "do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);" do (compound_statement "{\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    }" { (expression_statement "uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;" (assignment_expression "uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2" identifier = (binary_expression "(uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2" (parenthesized_expression "(uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2)" ( (binary_expression "uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2" (binary_expression "uVar3 * (-uVar2 % uVar2)" identifier * (parenthesized_expression "(-uVar2 % uVar2)" ( (binary_expression "-uVar2 % uVar2" (unary_expression "-uVar2" - identifier) % identifier) ))) + (binary_expression "(ulong)param_1[lVar1] % uVar2" (cast_expression "(ulong)param_1[lVar1]" ( (type_descriptor "ulong" type_identifier) ) (subscript_expression "param_1[lVar1]" identifier [ identifier ])) % identifier)) )) % identifier)) ;) (expression_statement "lVar1 = lVar1 + -1;" (assignment_expression "lVar1 = lVar1 + -1" identifier = (binary_expression "lVar1 + -1" identifier + number_literal)) ;) }) while (parenthesized_expression "(0 < (int)lVar1)" ( (binary_expression "0 < (int)lVar1" number_literal < (cast_expression "(int)lVar1" ( (type_descriptor "int" primitive_type) ) identifier)) )) ;) }))) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (pointer_expression * IDENT)) < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor (sized_type_specifier long)) ) (cast_expression ( (type_descriptor TYPE) ) (pointer_expression * IDENT)))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression (binary_expression IDENT * (parenthesized_expression ( (binary_expression (unary_expression - IDENT) % IDENT) ))) + (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ IDENT ])) % IDENT)) )) % IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression LIT < (cast_expression ( (type_descriptor TYPE) ) IDENT)) )) ;) }))) (return_statement return IDENT ;) })))
(function_definition "ulong FUN_00132af7(undefined8 *param_1,ushort param_2)\n\n{\n  long lVar1;\n  ulong uVar2;\n  ulong uVar3;\n  \n  uVar2 = (ulong)param_2;\n  if ((int)*param_1 < 1) {\n    uVar3 = 0;\n  }\n  else {\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }\n  return uVar3;\n}" (type_identifier "ulong") (function_declarator "FUN_00132af7(undefined8 *param_1,ushort param_2)" (identifier "FUN_00132af7") (parameter_list "(undefined8 *param_1,ushort param_2)" (( "(") (parameter_declaration "undefined8 *param_1" (type_identifier "undefined8") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "ushort param_2" (type_identifier "ushort") (identifier "param_2")) () ")"))) (compound_statement "{\n  long lVar1;\n  ulong uVar2;\n  ulong uVar3;\n  \n  uVar2 = (ulong)param_2;\n  if ((int)*param_1 < 1) {\n    uVar3 = 0;\n  }\n  else {\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }\n  return uVar3;\n}" ({ "{") (declaration "long lVar1;" (sized_type_specifier "long" (long "long")) (identifier "lVar1") (; ";")) (declaration "ulong uVar2;" (type_identifier "ulong") (identifier "uVar2") (; ";")) (declaration "ulong uVar3;" (type_identifier "ulong") (identifier "uVar3") (; ";")) (expression_statement "uVar2 = (ulong)param_2;" (assignment_expression "uVar2 = (ulong)param_2" (identifier "uVar2") (= "=") (cast_expression "(ulong)param_2" (( "(") (type_descriptor "ulong" (type_identifier "ulong")) () ")") (identifier "param_2"))) (; ";")) (if_statement "if ((int)*param_1 < 1) {\n    uVar3 = 0;\n  }\n  else {\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }" (if "if") (parenthesized_expression "((int)*param_1 < 1)" (( "(") (binary_expression "(int)*param_1 < 1" (cast_expression "(int)*param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (< "<") (number_literal "1")) () ")")) (compound_statement "{\n    uVar3 = 0;\n  }" ({ "{") (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" (identifier "uVar3") (= "=") (number_literal "0")) (; ";")) (} "}")) (else_clause "else {\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }" (else "else") (compound_statement "{\n    lVar1 = (long)(int)*param_1;\n    uVar3 = 0;\n    do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);\n  }" ({ "{") (expression_statement "lVar1 = (long)(int)*param_1;" (assignment_expression "lVar1 = (long)(int)*param_1" (identifier "lVar1") (= "=") (cast_expression "(long)(int)*param_1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (cast_expression "(int)*param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1"))))) (; ";")) (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" (identifier "uVar3") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    } while (0 < (int)lVar1);" (do "do") (compound_statement "{\n      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;\n      lVar1 = lVar1 + -1;\n    }" ({ "{") (expression_statement "uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;" (assignment_expression "uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2" (identifier "uVar3") (= "=") (binary_expression "(uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2" (parenthesized_expression "(uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2)" (( "(") (binary_expression "uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2" (binary_expression "uVar3 * (-uVar2 % uVar2)" (identifier "uVar3") (* "*") (parenthesized_expression "(-uVar2 % uVar2)" (( "(") (binary_expression "-uVar2 % uVar2" (unary_expression "-uVar2" (- "-") (identifier "uVar2")) (% "%") (identifier "uVar2")) () ")"))) (+ "+") (binary_expression "(ulong)param_1[lVar1] % uVar2" (cast_expression "(ulong)param_1[lVar1]" (( "(") (type_descriptor "ulong" (type_identifier "ulong")) () ")") (subscript_expression "param_1[lVar1]" (identifier "param_1") ([ "[") (identifier "lVar1") (] "]"))) (% "%") (identifier "uVar2"))) () ")")) (% "%") (identifier "uVar2"))) (; ";")) (expression_statement "lVar1 = lVar1 + -1;" (assignment_expression "lVar1 = lVar1 + -1" (identifier "lVar1") (= "=") (binary_expression "lVar1 + -1" (identifier "lVar1") (+ "+") (number_literal "-1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(0 < (int)lVar1)" (( "(") (binary_expression "0 < (int)lVar1" (number_literal "0") (< "<") (cast_expression "(int)lVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "lVar1"))) () ")")) (; ";")) (} "}")))) (return_statement "return uVar3;" (return "return") (identifier "uVar3") (; ";")) (} "}")))

/* WARNING: Unknown calling convention */

type_1 function_1(type_2 number,type_1 modulus)

{
  long var_3;
  type_3 var_2;
  type_3 var_1;
  
  var_2 = (type_3)modulus;
  if ((int)*number < 1) {
    var_1 = 0;
  }
  else {
    var_3 = (long)(int)*number;
    var_1 = 0;
    do {
      var_1 = (var_1 * (-var_2 % var_2) + number[var_3] % var_2) % var_2;
      var_3 = var_3 + -1;
    } while (0 < (int)var_3);
  }
  return (type_1)var_1;
}


(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: (sized_type_specifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (pointer_expression argument: (identifier))) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (cast_expression type: (type_descriptor type: (primitive_type)) value: (pointer_expression argument: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (unary_expression argument: (identifier)) right: (identifier)))) right: (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier)) value: (subscript_expression argument: (identifier) index: (identifier))) right: (identifier)))) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (number_literal) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))))))) (return_statement (identifier)))))

ulong MASKED(undefined8 *param_1,ushort param_2)

{
  long lVar1;
  ulong uVar2;
  ulong uVar3;
  
  uVar2 = (ulong)param_2;
  if ((int)*param_1 < 1) {
    uVar3 = 0;
  }
  else {
    lVar1 = (long)(int)*param_1;
    uVar3 = 0;
    do {
      uVar3 = (uVar3 * (-uVar2 % uVar2) + (ulong)param_1[lVar1] % uVar2) % uVar2;
      lVar1 = lVar1 + -1;
    } while (0 < (int)lVar1);
  }
  return uVar3;
}

