
/* WARNING: Unknown calling convention */

uint sizeof_leb128(valueT value,int sign)

{
  ulonglong uVar1;
  ulonglong uVar2;
  uint uVar3;
  
  if (sign != 0) {
    uVar3 = sizeof_leb128(value,(int)value);
    return uVar3;
  }
  do {
    uVar3 = (uint)value;
    uVar2 = value & 0x7f00000000;
    uVar1 = value >> 7;
    value = value >> 7;
    sign = sign + 1;
  } while ((int)(uVar1 >> 0x20) != 0 || (uVar3 >> 7 != 0 || uVar2 != 0));
  return sign;
}



int FUN_00031b10(uint param_1,uint param_2,int param_3)

{
  int iVar1;
  
  if (param_3 != 0) {
    iVar1 = FUN_0002d310();
    return iVar1;
  }
  do {
    param_1 = param_1 >> 7 | param_2 << 0x19;
    param_2 = param_2 >> 7;
    param_3 = param_3 + 1;
  } while (param_2 != 0 || param_1 != 0);
  return param_3;
}


PUSH ESI
PUSH EBX
MOV ECX,dword ptr [ESP + 0x14]
MOV EAX,dword ptr [ESP + 0xc]
MOV EDX,dword ptr [ESP + 0x10]
TEST ECX,ECX
JZ 0x00031b30
POP EBX
POP ESI
JMP 0x0002d310
SHRD EAX,EDX,0x7
SHR EDX,0x7
ADD ECX,0x1
MOV ESI,EDX
OR ESI,EAX
JNZ 0x00031b30
MOV EAX,ECX
POP EBX
POP ESI
RET
(translation_unit "int FUN_00031b10(uint param_1,uint param_2,int param_3)\n\n{\n  int iVar1;\n  \n  if (param_3 != 0) {\n    iVar1 = FUN_0002d310();\n    return iVar1;\n  }\n  do {\n    param_1 = param_1 >> 7 | param_2 << 0x19;\n    param_2 = param_2 >> 7;\n    param_3 = param_3 + 1;\n  } while (param_2 != 0 || param_1 != 0);\n  return param_3;\n}\n\n" (function_definition "int FUN_00031b10(uint param_1,uint param_2,int param_3)\n\n{\n  int iVar1;\n  \n  if (param_3 != 0) {\n    iVar1 = FUN_0002d310();\n    return iVar1;\n  }\n  do {\n    param_1 = param_1 >> 7 | param_2 << 0x19;\n    param_2 = param_2 >> 7;\n    param_3 = param_3 + 1;\n  } while (param_2 != 0 || param_1 != 0);\n  return param_3;\n}" primitive_type (function_declarator "FUN_00031b10(uint param_1,uint param_2,int param_3)" identifier (parameter_list "(uint param_1,uint param_2,int param_3)" ( (parameter_declaration "uint param_1" type_identifier identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  if (param_3 != 0) {\n    iVar1 = FUN_0002d310();\n    return iVar1;\n  }\n  do {\n    param_1 = param_1 >> 7 | param_2 << 0x19;\n    param_2 = param_2 >> 7;\n    param_3 = param_3 + 1;\n  } while (param_2 != 0 || param_1 != 0);\n  return param_3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if (param_3 != 0) {\n    iVar1 = FUN_0002d310();\n    return iVar1;\n  }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n    iVar1 = FUN_0002d310();\n    return iVar1;\n  }" { (expression_statement "iVar1 = FUN_0002d310();" (assignment_expression "iVar1 = FUN_0002d310()" identifier = (call_expression "FUN_0002d310()" identifier (argument_list "()" ( )))) ;) (return_statement "return iVar1;" return identifier ;) })) (do_statement "do {\n    param_1 = param_1 >> 7 | param_2 << 0x19;\n    param_2 = param_2 >> 7;\n    param_3 = param_3 + 1;\n  } while (param_2 != 0 || param_1 != 0);" do (compound_statement "{\n    param_1 = param_1 >> 7 | param_2 << 0x19;\n    param_2 = param_2 >> 7;\n    param_3 = param_3 + 1;\n  }" { (expression_statement "param_1 = param_1 >> 7 | param_2 << 0x19;" (assignment_expression "param_1 = param_1 >> 7 | param_2 << 0x19" identifier = (binary_expression "param_1 >> 7 | param_2 << 0x19" (binary_expression "param_1 >> 7" identifier >> number_literal) | (binary_expression "param_2 << 0x19" identifier << number_literal))) ;) (expression_statement "param_2 = param_2 >> 7;" (assignment_expression "param_2 = param_2 >> 7" identifier = (binary_expression "param_2 >> 7" identifier >> number_literal)) ;) (expression_statement "param_3 = param_3 + 1;" (assignment_expression "param_3 = param_3 + 1" identifier = (binary_expression "param_3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(param_2 != 0 || param_1 != 0)" ( (binary_expression "param_2 != 0 || param_1 != 0" (binary_expression "param_2 != 0" identifier != number_literal) || (binary_expression "param_1 != 0" identifier != number_literal)) )) ;) (return_statement "return param_3;" return identifier ;) })))
(translation_unit "/* WARNING: Unknown calling convention */\n\nuint sizeof_leb128(valueT value,int sign)\n\n{\n  ulonglong uVar1;\n  ulonglong uVar2;\n  uint uVar3;\n  \n  if (sign != 0) {\n    uVar3 = sizeof_leb128(value,(int)value);\n    return uVar3;\n  }\n  do {\n    uVar3 = (uint)value;\n    uVar2 = value & 0x7f00000000;\n    uVar1 = value >> 7;\n    value = value >> 7;\n    sign = sign + 1;\n  } while ((int)(uVar1 >> 0x20) != 0 || (uVar3 >> 7 != 0 || uVar2 != 0));\n  return sign;\n}\n\n" comment (function_definition "uint sizeof_leb128(valueT value,int sign)\n\n{\n  ulonglong uVar1;\n  ulonglong uVar2;\n  uint uVar3;\n  \n  if (sign != 0) {\n    uVar3 = sizeof_leb128(value,(int)value);\n    return uVar3;\n  }\n  do {\n    uVar3 = (uint)value;\n    uVar2 = value & 0x7f00000000;\n    uVar1 = value >> 7;\n    value = value >> 7;\n    sign = sign + 1;\n  } while ((int)(uVar1 >> 0x20) != 0 || (uVar3 >> 7 != 0 || uVar2 != 0));\n  return sign;\n}" type_identifier (function_declarator "sizeof_leb128(valueT value,int sign)" identifier (parameter_list "(valueT value,int sign)" ( (parameter_declaration "valueT value" type_identifier identifier) , (parameter_declaration "int sign" primitive_type identifier) ))) (compound_statement "{\n  ulonglong uVar1;\n  ulonglong uVar2;\n  uint uVar3;\n  \n  if (sign != 0) {\n    uVar3 = sizeof_leb128(value,(int)value);\n    return uVar3;\n  }\n  do {\n    uVar3 = (uint)value;\n    uVar2 = value & 0x7f00000000;\n    uVar1 = value >> 7;\n    value = value >> 7;\n    sign = sign + 1;\n  } while ((int)(uVar1 >> 0x20) != 0 || (uVar3 >> 7 != 0 || uVar2 != 0));\n  return sign;\n}" { (declaration "ulonglong uVar1;" type_identifier identifier ;) (declaration "ulonglong uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (if_statement "if (sign != 0) {\n    uVar3 = sizeof_leb128(value,(int)value);\n    return uVar3;\n  }" if (parenthesized_expression "(sign != 0)" ( (binary_expression "sign != 0" identifier != number_literal) )) (compound_statement "{\n    uVar3 = sizeof_leb128(value,(int)value);\n    return uVar3;\n  }" { (expression_statement "uVar3 = sizeof_leb128(value,(int)value);" (assignment_expression "uVar3 = sizeof_leb128(value,(int)value)" identifier = (call_expression "sizeof_leb128(value,(int)value)" identifier (argument_list "(value,(int)value)" ( identifier , (cast_expression "(int)value" ( (type_descriptor "int" primitive_type) ) identifier) )))) ;) (return_statement "return uVar3;" return identifier ;) })) (do_statement "do {\n    uVar3 = (uint)value;\n    uVar2 = value & 0x7f00000000;\n    uVar1 = value >> 7;\n    value = value >> 7;\n    sign = sign + 1;\n  } while ((int)(uVar1 >> 0x20) != 0 || (uVar3 >> 7 != 0 || uVar2 != 0));" do (compound_statement "{\n    uVar3 = (uint)value;\n    uVar2 = value & 0x7f00000000;\n    uVar1 = value >> 7;\n    value = value >> 7;\n    sign = sign + 1;\n  }" { (expression_statement "uVar3 = (uint)value;" (assignment_expression "uVar3 = (uint)value" identifier = (cast_expression "(uint)value" ( (type_descriptor "uint" type_identifier) ) identifier)) ;) (expression_statement "uVar2 = value & 0x7f00000000;" (assignment_expression "uVar2 = value & 0x7f00000000" identifier = (binary_expression "value & 0x7f00000000" identifier & number_literal)) ;) (expression_statement "uVar1 = value >> 7;" (assignment_expression "uVar1 = value >> 7" identifier = (binary_expression "value >> 7" identifier >> number_literal)) ;) (expression_statement "value = value >> 7;" (assignment_expression "value = value >> 7" identifier = (binary_expression "value >> 7" identifier >> number_literal)) ;) (expression_statement "sign = sign + 1;" (assignment_expression "sign = sign + 1" identifier = (binary_expression "sign + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "((int)(uVar1 >> 0x20) != 0 || (uVar3 >> 7 != 0 || uVar2 != 0))" ( (binary_expression "(int)(uVar1 >> 0x20) != 0 || (uVar3 >> 7 != 0 || uVar2 != 0)" (binary_expression "(int)(uVar1 >> 0x20) != 0" (cast_expression "(int)(uVar1 >> 0x20)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(uVar1 >> 0x20)" ( (binary_expression "uVar1 >> 0x20" identifier >> number_literal) ))) != number_literal) || (parenthesized_expression "(uVar3 >> 7 != 0 || uVar2 != 0)" ( (binary_expression "uVar3 >> 7 != 0 || uVar2 != 0" (binary_expression "uVar3 >> 7 != 0" (binary_expression "uVar3 >> 7" identifier >> number_literal) != number_literal) || (binary_expression "uVar2 != 0" identifier != number_literal)) ))) )) ;) (return_statement "return sign;" return identifier ;) })))
(translation_unit "int FUN_00031b10(uint param_1,uint param_2,int param_3)\n\n{\n  int iVar1;\n  \n  if (param_3 != 0) {\n    iVar1 = FUN_0002d310();\n    return iVar1;\n  }\n  do {\n    param_1 = param_1 >> 7 | param_2 << 0x19;\n    param_2 = param_2 >> 7;\n    param_3 = param_3 + 1;\n  } while (param_2 != 0 || param_1 != 0);\n  return param_3;\n}\n\n" (function_definition "int FUN_00031b10(uint param_1,uint param_2,int param_3)\n\n{\n  int iVar1;\n  \n  if (param_3 != 0) {\n    iVar1 = FUN_0002d310();\n    return iVar1;\n  }\n  do {\n    param_1 = param_1 >> 7 | param_2 << 0x19;\n    param_2 = param_2 >> 7;\n    param_3 = param_3 + 1;\n  } while (param_2 != 0 || param_1 != 0);\n  return param_3;\n}" primitive_type (function_declarator "FUN_00031b10(uint param_1,uint param_2,int param_3)" identifier (parameter_list "(uint param_1,uint param_2,int param_3)" ( (parameter_declaration "uint param_1" type_identifier identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  if (param_3 != 0) {\n    iVar1 = FUN_0002d310();\n    return iVar1;\n  }\n  do {\n    param_1 = param_1 >> 7 | param_2 << 0x19;\n    param_2 = param_2 >> 7;\n    param_3 = param_3 + 1;\n  } while (param_2 != 0 || param_1 != 0);\n  return param_3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if (param_3 != 0) {\n    iVar1 = FUN_0002d310();\n    return iVar1;\n  }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n    iVar1 = FUN_0002d310();\n    return iVar1;\n  }" { (expression_statement "iVar1 = FUN_0002d310();" (assignment_expression "iVar1 = FUN_0002d310()" identifier = (call_expression "FUN_0002d310()" identifier (argument_list "()" ( )))) ;) (return_statement "return iVar1;" return identifier ;) })) (do_statement "do {\n    param_1 = param_1 >> 7 | param_2 << 0x19;\n    param_2 = param_2 >> 7;\n    param_3 = param_3 + 1;\n  } while (param_2 != 0 || param_1 != 0);" do (compound_statement "{\n    param_1 = param_1 >> 7 | param_2 << 0x19;\n    param_2 = param_2 >> 7;\n    param_3 = param_3 + 1;\n  }" { (expression_statement "param_1 = param_1 >> 7 | param_2 << 0x19;" (assignment_expression "param_1 = param_1 >> 7 | param_2 << 0x19" identifier = (binary_expression "param_1 >> 7 | param_2 << 0x19" (binary_expression "param_1 >> 7" identifier >> number_literal) | (binary_expression "param_2 << 0x19" identifier << number_literal))) ;) (expression_statement "param_2 = param_2 >> 7;" (assignment_expression "param_2 = param_2 >> 7" identifier = (binary_expression "param_2 >> 7" identifier >> number_literal)) ;) (expression_statement "param_3 = param_3 + 1;" (assignment_expression "param_3 = param_3 + 1" identifier = (binary_expression "param_3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(param_2 != 0 || param_1 != 0)" ( (binary_expression "param_2 != 0 || param_1 != 0" (binary_expression "param_2 != 0" identifier != number_literal) || (binary_expression "param_1 != 0" identifier != number_literal)) )) ;) (return_statement "return param_3;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (return_statement return IDENT ;) })) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT >> LIT) | (binary_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 (binary_expression IDENT != LIT) || (binary_expression IDENT != LIT)) )) ;) (return_statement return IDENT ;) })))
(function_definition "int FUN_00031b10(uint param_1,uint param_2,int param_3)\n\n{\n  int iVar1;\n  \n  if (param_3 != 0) {\n    iVar1 = FUN_0002d310();\n    return iVar1;\n  }\n  do {\n    param_1 = param_1 >> 7 | param_2 << 0x19;\n    param_2 = param_2 >> 7;\n    param_3 = param_3 + 1;\n  } while (param_2 != 0 || param_1 != 0);\n  return param_3;\n}" (primitive_type "int") (function_declarator "FUN_00031b10(uint param_1,uint param_2,int param_3)" (identifier "FUN_00031b10") (parameter_list "(uint param_1,uint param_2,int param_3)" (( "(") (parameter_declaration "uint param_1" (type_identifier "uint") (identifier "param_1")) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  int iVar1;\n  \n  if (param_3 != 0) {\n    iVar1 = FUN_0002d310();\n    return iVar1;\n  }\n  do {\n    param_1 = param_1 >> 7 | param_2 << 0x19;\n    param_2 = param_2 >> 7;\n    param_3 = param_3 + 1;\n  } while (param_2 != 0 || param_1 != 0);\n  return param_3;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (if_statement "if (param_3 != 0) {\n    iVar1 = FUN_0002d310();\n    return iVar1;\n  }" (if "if") (parenthesized_expression "(param_3 != 0)" (( "(") (binary_expression "param_3 != 0" (identifier "param_3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    iVar1 = FUN_0002d310();\n    return iVar1;\n  }" ({ "{") (expression_statement "iVar1 = FUN_0002d310();" (assignment_expression "iVar1 = FUN_0002d310()" (identifier "iVar1") (= "=") (call_expression "FUN_0002d310()" (identifier "FUN_0002d310") (argument_list "()" (( "(") () ")")))) (; ";")) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (do_statement "do {\n    param_1 = param_1 >> 7 | param_2 << 0x19;\n    param_2 = param_2 >> 7;\n    param_3 = param_3 + 1;\n  } while (param_2 != 0 || param_1 != 0);" (do "do") (compound_statement "{\n    param_1 = param_1 >> 7 | param_2 << 0x19;\n    param_2 = param_2 >> 7;\n    param_3 = param_3 + 1;\n  }" ({ "{") (expression_statement "param_1 = param_1 >> 7 | param_2 << 0x19;" (assignment_expression "param_1 = param_1 >> 7 | param_2 << 0x19" (identifier "param_1") (= "=") (binary_expression "param_1 >> 7 | param_2 << 0x19" (binary_expression "param_1 >> 7" (identifier "param_1") (>> ">>") (number_literal "7")) (| "|") (binary_expression "param_2 << 0x19" (identifier "param_2") (<< "<<") (number_literal "0x19")))) (; ";")) (expression_statement "param_2 = param_2 >> 7;" (assignment_expression "param_2 = param_2 >> 7" (identifier "param_2") (= "=") (binary_expression "param_2 >> 7" (identifier "param_2") (>> ">>") (number_literal "7"))) (; ";")) (expression_statement "param_3 = param_3 + 1;" (assignment_expression "param_3 = param_3 + 1" (identifier "param_3") (= "=") (binary_expression "param_3 + 1" (identifier "param_3") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(param_2 != 0 || param_1 != 0)" (( "(") (binary_expression "param_2 != 0 || param_1 != 0" (binary_expression "param_2 != 0" (identifier "param_2") (!= "!=") (number_literal "0")) (|| "||") (binary_expression "param_1 != 0" (identifier "param_1") (!= "!=") (number_literal "0"))) () ")")) (; ";")) (return_statement "return param_3;" (return "return") (identifier "param_3") (; ";")) (} "}")))

/* WARNING: Unknown calling convention */

type_1 function_1(type_2 var_2,int var_1)

{
  type_3 var_3;
  type_3 var_5;
  type_1 var_4;
  
  if (var_1 != 0) {
    var_4 = function_1(var_2,(int)var_2);
    return var_4;
  }
  do {
    var_4 = (type_1)var_2;
    var_5 = var_2 & 0x7f00000000;
    var_3 = var_2 >> 7;
    var_2 = var_2 >> 7;
    var_1 = var_1 + 1;
  } while ((int)(var_3 >> 0x20) != 0 || (var_4 >> 7 != 0 || var_5 != 0));
  return var_1;
}


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

int MASKED(uint param_1,uint param_2,int param_3)

{
  int iVar1;
  
  if (param_3 != 0) {
    iVar1 = FUN_0002d310();
    return iVar1;
  }
  do {
    param_1 = param_1 >> 7 | param_2 << 0x19;
    param_2 = param_2 >> 7;
    param_3 = param_3 + 1;
  } while (param_2 != 0 || param_1 != 0);
  return param_3;
}

