
int bn_clz(BignumInt x)

{
  int iVar1;
  int iVar2;
  
  iVar2 = 5;
  iVar1 = 0x10;
  do {
    if (x >> (0x20U - iVar1 & 0x1f) == 0) {
      iVar1 = FUN_0006d444(x << iVar1);
      return iVar1;
    }
    iVar2 = iVar2 + -1;
    iVar1 = iVar1 >> 1;
  } while (iVar2 != 0);
  return 0;
}



int FUN_0006d430(uint param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  iVar3 = 5;
  iVar1 = 0;
  iVar2 = 0x10;
  do {
    if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {
      param_1 = param_1 << iVar2;
      iVar1 = iVar1 + iVar2;
    }
    iVar3 = iVar3 + -1;
    iVar2 = iVar2 >> 1;
  } while (iVar3 != 0);
  return iVar1;
}


li a2,0x5
or v0,zero,zero
li v1,0x10
b 0x0006d450
_li a3,0x20
addiu a2,a2,-0x1
beq a2,zero,0x0006d46c
_sra v1,v1,0x1
subu a1,a3,v1
srlv a1,a0,a1
bne a1,zero,0x0006d444
_nop
sllv a0,a0,v1
b 0x0006d444
_addu v0,v0,v1
jr ra
_nop
(translation_unit "int FUN_0006d430(uint param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = 5;\n  iVar1 = 0;\n  iVar2 = 0x10;\n  do {\n    if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }\n    iVar3 = iVar3 + -1;\n    iVar2 = iVar2 >> 1;\n  } while (iVar3 != 0);\n  return iVar1;\n}\n\n" (function_definition "int FUN_0006d430(uint param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = 5;\n  iVar1 = 0;\n  iVar2 = 0x10;\n  do {\n    if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }\n    iVar3 = iVar3 + -1;\n    iVar2 = iVar2 >> 1;\n  } while (iVar3 != 0);\n  return iVar1;\n}" primitive_type (function_declarator "FUN_0006d430(uint param_1)" identifier (parameter_list "(uint param_1)" ( (parameter_declaration "uint param_1" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = 5;\n  iVar1 = 0;\n  iVar2 = 0x10;\n  do {\n    if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }\n    iVar3 = iVar3 + -1;\n    iVar2 = iVar2 >> 1;\n  } while (iVar3 != 0);\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "iVar3 = 5;" (assignment_expression "iVar3 = 5" identifier = number_literal) ;) (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" identifier = number_literal) ;) (expression_statement "iVar2 = 0x10;" (assignment_expression "iVar2 = 0x10" identifier = number_literal) ;) (do_statement "do {\n    if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }\n    iVar3 = iVar3 + -1;\n    iVar2 = iVar2 >> 1;\n  } while (iVar3 != 0);" do (compound_statement "{\n    if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }\n    iVar3 = iVar3 + -1;\n    iVar2 = iVar2 >> 1;\n  }" { (if_statement "if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }" if (parenthesized_expression "(param_1 >> (0x20U - iVar2 & 0x1f) == 0)" ( (binary_expression "param_1 >> (0x20U - iVar2 & 0x1f) == 0" (binary_expression "param_1 >> (0x20U - iVar2 & 0x1f)" identifier >> (parenthesized_expression "(0x20U - iVar2 & 0x1f)" ( (binary_expression "0x20U - iVar2 & 0x1f" (binary_expression "0x20U - iVar2" number_literal - identifier) & number_literal) ))) == number_literal) )) (compound_statement "{\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }" { (expression_statement "param_1 = param_1 << iVar2;" (assignment_expression "param_1 = param_1 << iVar2" identifier = (binary_expression "param_1 << iVar2" identifier << identifier)) ;) (expression_statement "iVar1 = iVar1 + iVar2;" (assignment_expression "iVar1 = iVar1 + iVar2" identifier = (binary_expression "iVar1 + iVar2" identifier + identifier)) ;) })) (expression_statement "iVar3 = iVar3 + -1;" (assignment_expression "iVar3 = iVar3 + -1" identifier = (binary_expression "iVar3 + -1" identifier + number_literal)) ;) (expression_statement "iVar2 = iVar2 >> 1;" (assignment_expression "iVar2 = iVar2 >> 1" identifier = (binary_expression "iVar2 >> 1" identifier >> number_literal)) ;) }) while (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) ;) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "int bn_clz(BignumInt x)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar2 = 5;\n  iVar1 = 0x10;\n  do {\n    if (x >> (0x20U - iVar1 & 0x1f) == 0) {\n      iVar1 = FUN_0006d444(x << iVar1);\n      return iVar1;\n    }\n    iVar2 = iVar2 + -1;\n    iVar1 = iVar1 >> 1;\n  } while (iVar2 != 0);\n  return 0;\n}\n\n" (function_definition "int bn_clz(BignumInt x)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar2 = 5;\n  iVar1 = 0x10;\n  do {\n    if (x >> (0x20U - iVar1 & 0x1f) == 0) {\n      iVar1 = FUN_0006d444(x << iVar1);\n      return iVar1;\n    }\n    iVar2 = iVar2 + -1;\n    iVar1 = iVar1 >> 1;\n  } while (iVar2 != 0);\n  return 0;\n}" primitive_type (function_declarator "bn_clz(BignumInt x)" identifier (parameter_list "(BignumInt x)" ( (parameter_declaration "BignumInt x" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  iVar2 = 5;\n  iVar1 = 0x10;\n  do {\n    if (x >> (0x20U - iVar1 & 0x1f) == 0) {\n      iVar1 = FUN_0006d444(x << iVar1);\n      return iVar1;\n    }\n    iVar2 = iVar2 + -1;\n    iVar1 = iVar1 >> 1;\n  } while (iVar2 != 0);\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "iVar2 = 5;" (assignment_expression "iVar2 = 5" identifier = number_literal) ;) (expression_statement "iVar1 = 0x10;" (assignment_expression "iVar1 = 0x10" identifier = number_literal) ;) (do_statement "do {\n    if (x >> (0x20U - iVar1 & 0x1f) == 0) {\n      iVar1 = FUN_0006d444(x << iVar1);\n      return iVar1;\n    }\n    iVar2 = iVar2 + -1;\n    iVar1 = iVar1 >> 1;\n  } while (iVar2 != 0);" do (compound_statement "{\n    if (x >> (0x20U - iVar1 & 0x1f) == 0) {\n      iVar1 = FUN_0006d444(x << iVar1);\n      return iVar1;\n    }\n    iVar2 = iVar2 + -1;\n    iVar1 = iVar1 >> 1;\n  }" { (if_statement "if (x >> (0x20U - iVar1 & 0x1f) == 0) {\n      iVar1 = FUN_0006d444(x << iVar1);\n      return iVar1;\n    }" if (parenthesized_expression "(x >> (0x20U - iVar1 & 0x1f) == 0)" ( (binary_expression "x >> (0x20U - iVar1 & 0x1f) == 0" (binary_expression "x >> (0x20U - iVar1 & 0x1f)" identifier >> (parenthesized_expression "(0x20U - iVar1 & 0x1f)" ( (binary_expression "0x20U - iVar1 & 0x1f" (binary_expression "0x20U - iVar1" number_literal - identifier) & number_literal) ))) == number_literal) )) (compound_statement "{\n      iVar1 = FUN_0006d444(x << iVar1);\n      return iVar1;\n    }" { (expression_statement "iVar1 = FUN_0006d444(x << iVar1);" (assignment_expression "iVar1 = FUN_0006d444(x << iVar1)" identifier = (call_expression "FUN_0006d444(x << iVar1)" identifier (argument_list "(x << iVar1)" ( (binary_expression "x << iVar1" identifier << identifier) )))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "iVar2 = iVar2 + -1;" (assignment_expression "iVar2 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (expression_statement "iVar1 = iVar1 >> 1;" (assignment_expression "iVar1 = iVar1 >> 1" identifier = (binary_expression "iVar1 >> 1" identifier >> number_literal)) ;) }) while (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "int FUN_0006d430(uint param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = 5;\n  iVar1 = 0;\n  iVar2 = 0x10;\n  do {\n    if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }\n    iVar3 = iVar3 + -1;\n    iVar2 = iVar2 >> 1;\n  } while (iVar3 != 0);\n  return iVar1;\n}\n\n" (function_definition "int FUN_0006d430(uint param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = 5;\n  iVar1 = 0;\n  iVar2 = 0x10;\n  do {\n    if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }\n    iVar3 = iVar3 + -1;\n    iVar2 = iVar2 >> 1;\n  } while (iVar3 != 0);\n  return iVar1;\n}" primitive_type (function_declarator "FUN_0006d430(uint param_1)" identifier (parameter_list "(uint param_1)" ( (parameter_declaration "uint param_1" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = 5;\n  iVar1 = 0;\n  iVar2 = 0x10;\n  do {\n    if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }\n    iVar3 = iVar3 + -1;\n    iVar2 = iVar2 >> 1;\n  } while (iVar3 != 0);\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "iVar3 = 5;" (assignment_expression "iVar3 = 5" identifier = number_literal) ;) (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" identifier = number_literal) ;) (expression_statement "iVar2 = 0x10;" (assignment_expression "iVar2 = 0x10" identifier = number_literal) ;) (do_statement "do {\n    if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }\n    iVar3 = iVar3 + -1;\n    iVar2 = iVar2 >> 1;\n  } while (iVar3 != 0);" do (compound_statement "{\n    if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }\n    iVar3 = iVar3 + -1;\n    iVar2 = iVar2 >> 1;\n  }" { (if_statement "if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }" if (parenthesized_expression "(param_1 >> (0x20U - iVar2 & 0x1f) == 0)" ( (binary_expression "param_1 >> (0x20U - iVar2 & 0x1f) == 0" (binary_expression "param_1 >> (0x20U - iVar2 & 0x1f)" identifier >> (parenthesized_expression "(0x20U - iVar2 & 0x1f)" ( (binary_expression "0x20U - iVar2 & 0x1f" (binary_expression "0x20U - iVar2" number_literal - identifier) & number_literal) ))) == number_literal) )) (compound_statement "{\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }" { (expression_statement "param_1 = param_1 << iVar2;" (assignment_expression "param_1 = param_1 << iVar2" identifier = (binary_expression "param_1 << iVar2" identifier << identifier)) ;) (expression_statement "iVar1 = iVar1 + iVar2;" (assignment_expression "iVar1 = iVar1 + iVar2" identifier = (binary_expression "iVar1 + iVar2" identifier + identifier)) ;) })) (expression_statement "iVar3 = iVar3 + -1;" (assignment_expression "iVar3 = iVar3 + -1" identifier = (binary_expression "iVar3 + -1" identifier + number_literal)) ;) (expression_statement "iVar2 = iVar2 >> 1;" (assignment_expression "iVar2 = iVar2 >> 1" identifier = (binary_expression "iVar2 >> 1" identifier >> number_literal)) ;) }) while (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) ;) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (binary_expression IDENT >> (parenthesized_expression ( (binary_expression (binary_expression LIT - IDENT) & LIT) ))) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT << IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) })) (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) )) ;) (return_statement return IDENT ;) })))
(function_definition "int FUN_0006d430(uint param_1)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = 5;\n  iVar1 = 0;\n  iVar2 = 0x10;\n  do {\n    if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }\n    iVar3 = iVar3 + -1;\n    iVar2 = iVar2 >> 1;\n  } while (iVar3 != 0);\n  return iVar1;\n}" (primitive_type "int") (function_declarator "FUN_0006d430(uint param_1)" (identifier "FUN_0006d430") (parameter_list "(uint param_1)" (( "(") (parameter_declaration "uint param_1" (type_identifier "uint") (identifier "param_1")) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  iVar3 = 5;\n  iVar1 = 0;\n  iVar2 = 0x10;\n  do {\n    if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }\n    iVar3 = iVar3 + -1;\n    iVar2 = iVar2 >> 1;\n  } while (iVar3 != 0);\n  return iVar1;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (expression_statement "iVar3 = 5;" (assignment_expression "iVar3 = 5" (identifier "iVar3") (= "=") (number_literal "5")) (; ";")) (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" (identifier "iVar1") (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar2 = 0x10;" (assignment_expression "iVar2 = 0x10" (identifier "iVar2") (= "=") (number_literal "0x10")) (; ";")) (do_statement "do {\n    if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }\n    iVar3 = iVar3 + -1;\n    iVar2 = iVar2 >> 1;\n  } while (iVar3 != 0);" (do "do") (compound_statement "{\n    if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }\n    iVar3 = iVar3 + -1;\n    iVar2 = iVar2 >> 1;\n  }" ({ "{") (if_statement "if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }" (if "if") (parenthesized_expression "(param_1 >> (0x20U - iVar2 & 0x1f) == 0)" (( "(") (binary_expression "param_1 >> (0x20U - iVar2 & 0x1f) == 0" (binary_expression "param_1 >> (0x20U - iVar2 & 0x1f)" (identifier "param_1") (>> ">>") (parenthesized_expression "(0x20U - iVar2 & 0x1f)" (( "(") (binary_expression "0x20U - iVar2 & 0x1f" (binary_expression "0x20U - iVar2" (number_literal "0x20U") (- "-") (identifier "iVar2")) (& "&") (number_literal "0x1f")) () ")"))) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      param_1 = param_1 << iVar2;\n      iVar1 = iVar1 + iVar2;\n    }" ({ "{") (expression_statement "param_1 = param_1 << iVar2;" (assignment_expression "param_1 = param_1 << iVar2" (identifier "param_1") (= "=") (binary_expression "param_1 << iVar2" (identifier "param_1") (<< "<<") (identifier "iVar2"))) (; ";")) (expression_statement "iVar1 = iVar1 + iVar2;" (assignment_expression "iVar1 = iVar1 + iVar2" (identifier "iVar1") (= "=") (binary_expression "iVar1 + iVar2" (identifier "iVar1") (+ "+") (identifier "iVar2"))) (; ";")) (} "}"))) (expression_statement "iVar3 = iVar3 + -1;" (assignment_expression "iVar3 = iVar3 + -1" (identifier "iVar3") (= "=") (binary_expression "iVar3 + -1" (identifier "iVar3") (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "iVar2 = iVar2 >> 1;" (assignment_expression "iVar2 = iVar2 >> 1" (identifier "iVar2") (= "=") (binary_expression "iVar2 >> 1" (identifier "iVar2") (>> ">>") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(iVar3 != 0)" (( "(") (binary_expression "iVar3 != 0" (identifier "iVar3") (!= "!=") (number_literal "0")) () ")")) (; ";")) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}")))

int function_1(type_1 var_1)

{
  int var_2;
  int var_4;
  
  var_4 = 5;
  var_2 = 0x10;
  do {
    if (var_1 >> (0x20U - var_2 & 0x1f) == 0) {
      var_2 = var_3(var_1 << var_2);
      return var_2;
    }
    var_4 = var_4 + -1;
    var_2 = var_2 >> 1;
  } while (var_4 != 0);
  return 0;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (do_statement body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (binary_expression left: (number_literal) right: (identifier)) right: (number_literal)))) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))) (return_statement (identifier)))))

int MASKED(uint param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  iVar3 = 5;
  iVar1 = 0;
  iVar2 = 0x10;
  do {
    if (param_1 >> (0x20U - iVar2 & 0x1f) == 0) {
      param_1 = param_1 << iVar2;
      iVar1 = iVar1 + iVar2;
    }
    iVar3 = iVar3 + -1;
    iVar2 = iVar2 >> 1;
  } while (iVar3 != 0);
  return iVar1;
}

