
ulong mips16_immed_extend(offsetT val,uint nbits)

{
  uint uVar1;
  uint in_a1;
  uint in_a2;
  
  uVar1 = (1 << (in_a2 & 0x1f)) - 1U & in_a1;
  if ((in_a2 == 0x10) || (in_a2 == 9)) {
    return ((uVar1 << 0x10) >> 0x1b | uVar1 & 0x7e0) << 0x10 | uVar1 & 0x1f;
  }
  if (in_a2 == 0xf) {
    return ((uVar1 << 0x11) >> 0x1c | uVar1 & 0x7f0) << 0x10 | uVar1 & 0xf;
  }
  if (in_a2 != 6) {
    return uVar1;
  }
  return ((uVar1 & 0x1f) << 6 | uVar1 & 0x20) << 0x10;
}



uint FUN_0005942c(undefined4 param_1,uint param_2,uint param_3)

{
  param_2 = (1 << (param_3 & 0x1f)) - 1U & param_2;
  if ((param_3 == 0x10) || (param_3 == 9)) {
    return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;
  }
  if (param_3 == 0xf) {
    return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;
  }
  if (param_3 != 6) {
    return param_2;
  }
  return ((param_2 & 0x1f) << 6 | param_2 & 0x20) << 0x10;
}


li v0,0x1
li v1,0x10
sllv v0,v0,a2
addiu v0,v0,-0x1
beq a2,v1,0x00059468
_and v0,v0,a1
li v1,0x9
beq a2,v1,0x00059468
_li v1,0xf
beq a2,v1,0x00059498
_li v1,0x6
beq a2,v1,0x00059484
_sll v1,v0,0x6
jr ra
_nop
ext v1,v0,0xb,0x5
andi a0,v0,0x7e0
or v1,v1,a0
sll v1,v1,0x10
andi v0,v0,0x1f
jr ra
_or v0,v1,v0
andi v0,v0,0x20
andi v1,v1,0x7c0
or v0,v1,v0
jr ra
_sll v0,v0,0x10
ext v1,v0,0xb,0x4
andi a0,v0,0x7f0
or v1,v1,a0
sll v1,v1,0x10
andi v0,v0,0xf
jr ra
_or v0,v1,v0
(translation_unit "uint FUN_0005942c(undefined4 param_1,uint param_2,uint param_3)\n\n{\n  param_2 = (1 << (param_3 & 0x1f)) - 1U & param_2;\n  if ((param_3 == 0x10) || (param_3 == 9)) {\n    return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;\n  }\n  if (param_3 == 0xf) {\n    return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;\n  }\n  if (param_3 != 6) {\n    return param_2;\n  }\n  return ((param_2 & 0x1f) << 6 | param_2 & 0x20) << 0x10;\n}\n\n" (function_definition "uint FUN_0005942c(undefined4 param_1,uint param_2,uint param_3)\n\n{\n  param_2 = (1 << (param_3 & 0x1f)) - 1U & param_2;\n  if ((param_3 == 0x10) || (param_3 == 9)) {\n    return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;\n  }\n  if (param_3 == 0xf) {\n    return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;\n  }\n  if (param_3 != 6) {\n    return param_2;\n  }\n  return ((param_2 & 0x1f) << 6 | param_2 & 0x20) << 0x10;\n}" type_identifier (function_declarator "FUN_0005942c(undefined4 param_1,uint param_2,uint param_3)" identifier (parameter_list "(undefined4 param_1,uint param_2,uint param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  param_2 = (1 << (param_3 & 0x1f)) - 1U & param_2;\n  if ((param_3 == 0x10) || (param_3 == 9)) {\n    return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;\n  }\n  if (param_3 == 0xf) {\n    return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;\n  }\n  if (param_3 != 6) {\n    return param_2;\n  }\n  return ((param_2 & 0x1f) << 6 | param_2 & 0x20) << 0x10;\n}" { (expression_statement "param_2 = (1 << (param_3 & 0x1f)) - 1U & param_2;" (assignment_expression "param_2 = (1 << (param_3 & 0x1f)) - 1U & param_2" identifier = (binary_expression "(1 << (param_3 & 0x1f)) - 1U & param_2" (binary_expression "(1 << (param_3 & 0x1f)) - 1U" (parenthesized_expression "(1 << (param_3 & 0x1f))" ( (binary_expression "1 << (param_3 & 0x1f)" number_literal << (parenthesized_expression "(param_3 & 0x1f)" ( (binary_expression "param_3 & 0x1f" identifier & number_literal) ))) )) - number_literal) & identifier)) ;) (if_statement "if ((param_3 == 0x10) || (param_3 == 9)) {\n    return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;\n  }" if (parenthesized_expression "((param_3 == 0x10) || (param_3 == 9))" ( (binary_expression "(param_3 == 0x10) || (param_3 == 9)" (parenthesized_expression "(param_3 == 0x10)" ( (binary_expression "param_3 == 0x10" identifier == number_literal) )) || (parenthesized_expression "(param_3 == 9)" ( (binary_expression "param_3 == 9" identifier == number_literal) ))) )) (compound_statement "{\n    return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;\n  }" { (return_statement "return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;" return (binary_expression "((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f" (binary_expression "((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10" (parenthesized_expression "((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0)" ( (binary_expression "(param_2 << 0x10) >> 0x1b | param_2 & 0x7e0" (binary_expression "(param_2 << 0x10) >> 0x1b" (parenthesized_expression "(param_2 << 0x10)" ( (binary_expression "param_2 << 0x10" identifier << number_literal) )) >> number_literal) | (binary_expression "param_2 & 0x7e0" identifier & number_literal)) )) << number_literal) | (binary_expression "param_2 & 0x1f" identifier & number_literal)) ;) })) (if_statement "if (param_3 == 0xf) {\n    return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;\n  }" if (parenthesized_expression "(param_3 == 0xf)" ( (binary_expression "param_3 == 0xf" identifier == number_literal) )) (compound_statement "{\n    return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;\n  }" { (return_statement "return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;" return (binary_expression "((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf" (binary_expression "((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10" (parenthesized_expression "((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0)" ( (binary_expression "(param_2 << 0x11) >> 0x1c | param_2 & 0x7f0" (binary_expression "(param_2 << 0x11) >> 0x1c" (parenthesized_expression "(param_2 << 0x11)" ( (binary_expression "param_2 << 0x11" identifier << number_literal) )) >> number_literal) | (binary_expression "param_2 & 0x7f0" identifier & number_literal)) )) << number_literal) | (binary_expression "param_2 & 0xf" identifier & number_literal)) ;) })) (if_statement "if (param_3 != 6) {\n    return param_2;\n  }" if (parenthesized_expression "(param_3 != 6)" ( (binary_expression "param_3 != 6" identifier != number_literal) )) (compound_statement "{\n    return param_2;\n  }" { (return_statement "return param_2;" return identifier ;) })) (return_statement "return ((param_2 & 0x1f) << 6 | param_2 & 0x20) << 0x10;" return (binary_expression "((param_2 & 0x1f) << 6 | param_2 & 0x20) << 0x10" (parenthesized_expression "((param_2 & 0x1f) << 6 | param_2 & 0x20)" ( (binary_expression "(param_2 & 0x1f) << 6 | param_2 & 0x20" (binary_expression "(param_2 & 0x1f) << 6" (parenthesized_expression "(param_2 & 0x1f)" ( (binary_expression "param_2 & 0x1f" identifier & number_literal) )) << number_literal) | (binary_expression "param_2 & 0x20" identifier & number_literal)) )) << number_literal) ;) })))
(translation_unit "ulong mips16_immed_extend(offsetT val,uint nbits)\n\n{\n  uint uVar1;\n  uint in_a1;\n  uint in_a2;\n  \n  uVar1 = (1 << (in_a2 & 0x1f)) - 1U & in_a1;\n  if ((in_a2 == 0x10) || (in_a2 == 9)) {\n    return ((uVar1 << 0x10) >> 0x1b | uVar1 & 0x7e0) << 0x10 | uVar1 & 0x1f;\n  }\n  if (in_a2 == 0xf) {\n    return ((uVar1 << 0x11) >> 0x1c | uVar1 & 0x7f0) << 0x10 | uVar1 & 0xf;\n  }\n  if (in_a2 != 6) {\n    return uVar1;\n  }\n  return ((uVar1 & 0x1f) << 6 | uVar1 & 0x20) << 0x10;\n}\n\n" (function_definition "ulong mips16_immed_extend(offsetT val,uint nbits)\n\n{\n  uint uVar1;\n  uint in_a1;\n  uint in_a2;\n  \n  uVar1 = (1 << (in_a2 & 0x1f)) - 1U & in_a1;\n  if ((in_a2 == 0x10) || (in_a2 == 9)) {\n    return ((uVar1 << 0x10) >> 0x1b | uVar1 & 0x7e0) << 0x10 | uVar1 & 0x1f;\n  }\n  if (in_a2 == 0xf) {\n    return ((uVar1 << 0x11) >> 0x1c | uVar1 & 0x7f0) << 0x10 | uVar1 & 0xf;\n  }\n  if (in_a2 != 6) {\n    return uVar1;\n  }\n  return ((uVar1 & 0x1f) << 6 | uVar1 & 0x20) << 0x10;\n}" type_identifier (function_declarator "mips16_immed_extend(offsetT val,uint nbits)" identifier (parameter_list "(offsetT val,uint nbits)" ( (parameter_declaration "offsetT val" type_identifier identifier) , (parameter_declaration "uint nbits" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  uint in_a1;\n  uint in_a2;\n  \n  uVar1 = (1 << (in_a2 & 0x1f)) - 1U & in_a1;\n  if ((in_a2 == 0x10) || (in_a2 == 9)) {\n    return ((uVar1 << 0x10) >> 0x1b | uVar1 & 0x7e0) << 0x10 | uVar1 & 0x1f;\n  }\n  if (in_a2 == 0xf) {\n    return ((uVar1 << 0x11) >> 0x1c | uVar1 & 0x7f0) << 0x10 | uVar1 & 0xf;\n  }\n  if (in_a2 != 6) {\n    return uVar1;\n  }\n  return ((uVar1 & 0x1f) << 6 | uVar1 & 0x20) << 0x10;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint in_a1;" type_identifier identifier ;) (declaration "uint in_a2;" type_identifier identifier ;) (expression_statement "uVar1 = (1 << (in_a2 & 0x1f)) - 1U & in_a1;" (assignment_expression "uVar1 = (1 << (in_a2 & 0x1f)) - 1U & in_a1" identifier = (binary_expression "(1 << (in_a2 & 0x1f)) - 1U & in_a1" (binary_expression "(1 << (in_a2 & 0x1f)) - 1U" (parenthesized_expression "(1 << (in_a2 & 0x1f))" ( (binary_expression "1 << (in_a2 & 0x1f)" number_literal << (parenthesized_expression "(in_a2 & 0x1f)" ( (binary_expression "in_a2 & 0x1f" identifier & number_literal) ))) )) - number_literal) & identifier)) ;) (if_statement "if ((in_a2 == 0x10) || (in_a2 == 9)) {\n    return ((uVar1 << 0x10) >> 0x1b | uVar1 & 0x7e0) << 0x10 | uVar1 & 0x1f;\n  }" if (parenthesized_expression "((in_a2 == 0x10) || (in_a2 == 9))" ( (binary_expression "(in_a2 == 0x10) || (in_a2 == 9)" (parenthesized_expression "(in_a2 == 0x10)" ( (binary_expression "in_a2 == 0x10" identifier == number_literal) )) || (parenthesized_expression "(in_a2 == 9)" ( (binary_expression "in_a2 == 9" identifier == number_literal) ))) )) (compound_statement "{\n    return ((uVar1 << 0x10) >> 0x1b | uVar1 & 0x7e0) << 0x10 | uVar1 & 0x1f;\n  }" { (return_statement "return ((uVar1 << 0x10) >> 0x1b | uVar1 & 0x7e0) << 0x10 | uVar1 & 0x1f;" return (binary_expression "((uVar1 << 0x10) >> 0x1b | uVar1 & 0x7e0) << 0x10 | uVar1 & 0x1f" (binary_expression "((uVar1 << 0x10) >> 0x1b | uVar1 & 0x7e0) << 0x10" (parenthesized_expression "((uVar1 << 0x10) >> 0x1b | uVar1 & 0x7e0)" ( (binary_expression "(uVar1 << 0x10) >> 0x1b | uVar1 & 0x7e0" (binary_expression "(uVar1 << 0x10) >> 0x1b" (parenthesized_expression "(uVar1 << 0x10)" ( (binary_expression "uVar1 << 0x10" identifier << number_literal) )) >> number_literal) | (binary_expression "uVar1 & 0x7e0" identifier & number_literal)) )) << number_literal) | (binary_expression "uVar1 & 0x1f" identifier & number_literal)) ;) })) (if_statement "if (in_a2 == 0xf) {\n    return ((uVar1 << 0x11) >> 0x1c | uVar1 & 0x7f0) << 0x10 | uVar1 & 0xf;\n  }" if (parenthesized_expression "(in_a2 == 0xf)" ( (binary_expression "in_a2 == 0xf" identifier == number_literal) )) (compound_statement "{\n    return ((uVar1 << 0x11) >> 0x1c | uVar1 & 0x7f0) << 0x10 | uVar1 & 0xf;\n  }" { (return_statement "return ((uVar1 << 0x11) >> 0x1c | uVar1 & 0x7f0) << 0x10 | uVar1 & 0xf;" return (binary_expression "((uVar1 << 0x11) >> 0x1c | uVar1 & 0x7f0) << 0x10 | uVar1 & 0xf" (binary_expression "((uVar1 << 0x11) >> 0x1c | uVar1 & 0x7f0) << 0x10" (parenthesized_expression "((uVar1 << 0x11) >> 0x1c | uVar1 & 0x7f0)" ( (binary_expression "(uVar1 << 0x11) >> 0x1c | uVar1 & 0x7f0" (binary_expression "(uVar1 << 0x11) >> 0x1c" (parenthesized_expression "(uVar1 << 0x11)" ( (binary_expression "uVar1 << 0x11" identifier << number_literal) )) >> number_literal) | (binary_expression "uVar1 & 0x7f0" identifier & number_literal)) )) << number_literal) | (binary_expression "uVar1 & 0xf" identifier & number_literal)) ;) })) (if_statement "if (in_a2 != 6) {\n    return uVar1;\n  }" if (parenthesized_expression "(in_a2 != 6)" ( (binary_expression "in_a2 != 6" identifier != number_literal) )) (compound_statement "{\n    return uVar1;\n  }" { (return_statement "return uVar1;" return identifier ;) })) (return_statement "return ((uVar1 & 0x1f) << 6 | uVar1 & 0x20) << 0x10;" return (binary_expression "((uVar1 & 0x1f) << 6 | uVar1 & 0x20) << 0x10" (parenthesized_expression "((uVar1 & 0x1f) << 6 | uVar1 & 0x20)" ( (binary_expression "(uVar1 & 0x1f) << 6 | uVar1 & 0x20" (binary_expression "(uVar1 & 0x1f) << 6" (parenthesized_expression "(uVar1 & 0x1f)" ( (binary_expression "uVar1 & 0x1f" identifier & number_literal) )) << number_literal) | (binary_expression "uVar1 & 0x20" identifier & number_literal)) )) << number_literal) ;) })))
(translation_unit "uint FUN_0005942c(undefined4 param_1,uint param_2,uint param_3)\n\n{\n  param_2 = (1 << (param_3 & 0x1f)) - 1U & param_2;\n  if ((param_3 == 0x10) || (param_3 == 9)) {\n    return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;\n  }\n  if (param_3 == 0xf) {\n    return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;\n  }\n  if (param_3 != 6) {\n    return param_2;\n  }\n  return ((param_2 & 0x1f) << 6 | param_2 & 0x20) << 0x10;\n}\n\n" (function_definition "uint FUN_0005942c(undefined4 param_1,uint param_2,uint param_3)\n\n{\n  param_2 = (1 << (param_3 & 0x1f)) - 1U & param_2;\n  if ((param_3 == 0x10) || (param_3 == 9)) {\n    return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;\n  }\n  if (param_3 == 0xf) {\n    return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;\n  }\n  if (param_3 != 6) {\n    return param_2;\n  }\n  return ((param_2 & 0x1f) << 6 | param_2 & 0x20) << 0x10;\n}" type_identifier (function_declarator "FUN_0005942c(undefined4 param_1,uint param_2,uint param_3)" identifier (parameter_list "(undefined4 param_1,uint param_2,uint param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  param_2 = (1 << (param_3 & 0x1f)) - 1U & param_2;\n  if ((param_3 == 0x10) || (param_3 == 9)) {\n    return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;\n  }\n  if (param_3 == 0xf) {\n    return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;\n  }\n  if (param_3 != 6) {\n    return param_2;\n  }\n  return ((param_2 & 0x1f) << 6 | param_2 & 0x20) << 0x10;\n}" { (expression_statement "param_2 = (1 << (param_3 & 0x1f)) - 1U & param_2;" (assignment_expression "param_2 = (1 << (param_3 & 0x1f)) - 1U & param_2" identifier = (binary_expression "(1 << (param_3 & 0x1f)) - 1U & param_2" (binary_expression "(1 << (param_3 & 0x1f)) - 1U" (parenthesized_expression "(1 << (param_3 & 0x1f))" ( (binary_expression "1 << (param_3 & 0x1f)" number_literal << (parenthesized_expression "(param_3 & 0x1f)" ( (binary_expression "param_3 & 0x1f" identifier & number_literal) ))) )) - number_literal) & identifier)) ;) (if_statement "if ((param_3 == 0x10) || (param_3 == 9)) {\n    return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;\n  }" if (parenthesized_expression "((param_3 == 0x10) || (param_3 == 9))" ( (binary_expression "(param_3 == 0x10) || (param_3 == 9)" (parenthesized_expression "(param_3 == 0x10)" ( (binary_expression "param_3 == 0x10" identifier == number_literal) )) || (parenthesized_expression "(param_3 == 9)" ( (binary_expression "param_3 == 9" identifier == number_literal) ))) )) (compound_statement "{\n    return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;\n  }" { (return_statement "return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;" return (binary_expression "((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f" (binary_expression "((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10" (parenthesized_expression "((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0)" ( (binary_expression "(param_2 << 0x10) >> 0x1b | param_2 & 0x7e0" (binary_expression "(param_2 << 0x10) >> 0x1b" (parenthesized_expression "(param_2 << 0x10)" ( (binary_expression "param_2 << 0x10" identifier << number_literal) )) >> number_literal) | (binary_expression "param_2 & 0x7e0" identifier & number_literal)) )) << number_literal) | (binary_expression "param_2 & 0x1f" identifier & number_literal)) ;) })) (if_statement "if (param_3 == 0xf) {\n    return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;\n  }" if (parenthesized_expression "(param_3 == 0xf)" ( (binary_expression "param_3 == 0xf" identifier == number_literal) )) (compound_statement "{\n    return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;\n  }" { (return_statement "return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;" return (binary_expression "((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf" (binary_expression "((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10" (parenthesized_expression "((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0)" ( (binary_expression "(param_2 << 0x11) >> 0x1c | param_2 & 0x7f0" (binary_expression "(param_2 << 0x11) >> 0x1c" (parenthesized_expression "(param_2 << 0x11)" ( (binary_expression "param_2 << 0x11" identifier << number_literal) )) >> number_literal) | (binary_expression "param_2 & 0x7f0" identifier & number_literal)) )) << number_literal) | (binary_expression "param_2 & 0xf" identifier & number_literal)) ;) })) (if_statement "if (param_3 != 6) {\n    return param_2;\n  }" if (parenthesized_expression "(param_3 != 6)" ( (binary_expression "param_3 != 6" identifier != number_literal) )) (compound_statement "{\n    return param_2;\n  }" { (return_statement "return param_2;" return identifier ;) })) (return_statement "return ((param_2 & 0x1f) << 6 | param_2 & 0x20) << 0x10;" return (binary_expression "((param_2 & 0x1f) << 6 | param_2 & 0x20) << 0x10" (parenthesized_expression "((param_2 & 0x1f) << 6 | param_2 & 0x20)" ( (binary_expression "(param_2 & 0x1f) << 6 | param_2 & 0x20" (binary_expression "(param_2 & 0x1f) << 6" (parenthesized_expression "(param_2 & 0x1f)" ( (binary_expression "param_2 & 0x1f" identifier & number_literal) )) << number_literal) | (binary_expression "param_2 & 0x20" identifier & number_literal)) )) << number_literal) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression (parenthesized_expression ( (binary_expression LIT << (parenthesized_expression ( (binary_expression IDENT & LIT) ))) )) - LIT) & IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) || (parenthesized_expression ( (binary_expression IDENT == LIT) ))) )) (compound_statement { (return_statement return (binary_expression (binary_expression (parenthesized_expression ( (binary_expression (binary_expression (parenthesized_expression ( (binary_expression IDENT << LIT) )) >> LIT) | (binary_expression IDENT & LIT)) )) << LIT) | (binary_expression IDENT & LIT)) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return (binary_expression (binary_expression (parenthesized_expression ( (binary_expression (binary_expression (parenthesized_expression ( (binary_expression IDENT << LIT) )) >> LIT) | (binary_expression IDENT & LIT)) )) << LIT) | (binary_expression IDENT & LIT)) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (return_statement return IDENT ;) })) (return_statement return (binary_expression (parenthesized_expression ( (binary_expression (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) << LIT) | (binary_expression IDENT & LIT)) )) << LIT) ;) })))
(function_definition "uint FUN_0005942c(undefined4 param_1,uint param_2,uint param_3)\n\n{\n  param_2 = (1 << (param_3 & 0x1f)) - 1U & param_2;\n  if ((param_3 == 0x10) || (param_3 == 9)) {\n    return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;\n  }\n  if (param_3 == 0xf) {\n    return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;\n  }\n  if (param_3 != 6) {\n    return param_2;\n  }\n  return ((param_2 & 0x1f) << 6 | param_2 & 0x20) << 0x10;\n}" (type_identifier "uint") (function_declarator "FUN_0005942c(undefined4 param_1,uint param_2,uint param_3)" (identifier "FUN_0005942c") (parameter_list "(undefined4 param_1,uint param_2,uint param_3)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) () ")"))) (compound_statement "{\n  param_2 = (1 << (param_3 & 0x1f)) - 1U & param_2;\n  if ((param_3 == 0x10) || (param_3 == 9)) {\n    return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;\n  }\n  if (param_3 == 0xf) {\n    return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;\n  }\n  if (param_3 != 6) {\n    return param_2;\n  }\n  return ((param_2 & 0x1f) << 6 | param_2 & 0x20) << 0x10;\n}" ({ "{") (expression_statement "param_2 = (1 << (param_3 & 0x1f)) - 1U & param_2;" (assignment_expression "param_2 = (1 << (param_3 & 0x1f)) - 1U & param_2" (identifier "param_2") (= "=") (binary_expression "(1 << (param_3 & 0x1f)) - 1U & param_2" (binary_expression "(1 << (param_3 & 0x1f)) - 1U" (parenthesized_expression "(1 << (param_3 & 0x1f))" (( "(") (binary_expression "1 << (param_3 & 0x1f)" (number_literal "1") (<< "<<") (parenthesized_expression "(param_3 & 0x1f)" (( "(") (binary_expression "param_3 & 0x1f" (identifier "param_3") (& "&") (number_literal "0x1f")) () ")"))) () ")")) (- "-") (number_literal "1U")) (& "&") (identifier "param_2"))) (; ";")) (if_statement "if ((param_3 == 0x10) || (param_3 == 9)) {\n    return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;\n  }" (if "if") (parenthesized_expression "((param_3 == 0x10) || (param_3 == 9))" (( "(") (binary_expression "(param_3 == 0x10) || (param_3 == 9)" (parenthesized_expression "(param_3 == 0x10)" (( "(") (binary_expression "param_3 == 0x10" (identifier "param_3") (== "==") (number_literal "0x10")) () ")")) (|| "||") (parenthesized_expression "(param_3 == 9)" (( "(") (binary_expression "param_3 == 9" (identifier "param_3") (== "==") (number_literal "9")) () ")"))) () ")")) (compound_statement "{\n    return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;\n  }" ({ "{") (return_statement "return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;" (return "return") (binary_expression "((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f" (binary_expression "((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10" (parenthesized_expression "((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0)" (( "(") (binary_expression "(param_2 << 0x10) >> 0x1b | param_2 & 0x7e0" (binary_expression "(param_2 << 0x10) >> 0x1b" (parenthesized_expression "(param_2 << 0x10)" (( "(") (binary_expression "param_2 << 0x10" (identifier "param_2") (<< "<<") (number_literal "0x10")) () ")")) (>> ">>") (number_literal "0x1b")) (| "|") (binary_expression "param_2 & 0x7e0" (identifier "param_2") (& "&") (number_literal "0x7e0"))) () ")")) (<< "<<") (number_literal "0x10")) (| "|") (binary_expression "param_2 & 0x1f" (identifier "param_2") (& "&") (number_literal "0x1f"))) (; ";")) (} "}"))) (if_statement "if (param_3 == 0xf) {\n    return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;\n  }" (if "if") (parenthesized_expression "(param_3 == 0xf)" (( "(") (binary_expression "param_3 == 0xf" (identifier "param_3") (== "==") (number_literal "0xf")) () ")")) (compound_statement "{\n    return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;\n  }" ({ "{") (return_statement "return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;" (return "return") (binary_expression "((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf" (binary_expression "((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10" (parenthesized_expression "((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0)" (( "(") (binary_expression "(param_2 << 0x11) >> 0x1c | param_2 & 0x7f0" (binary_expression "(param_2 << 0x11) >> 0x1c" (parenthesized_expression "(param_2 << 0x11)" (( "(") (binary_expression "param_2 << 0x11" (identifier "param_2") (<< "<<") (number_literal "0x11")) () ")")) (>> ">>") (number_literal "0x1c")) (| "|") (binary_expression "param_2 & 0x7f0" (identifier "param_2") (& "&") (number_literal "0x7f0"))) () ")")) (<< "<<") (number_literal "0x10")) (| "|") (binary_expression "param_2 & 0xf" (identifier "param_2") (& "&") (number_literal "0xf"))) (; ";")) (} "}"))) (if_statement "if (param_3 != 6) {\n    return param_2;\n  }" (if "if") (parenthesized_expression "(param_3 != 6)" (( "(") (binary_expression "param_3 != 6" (identifier "param_3") (!= "!=") (number_literal "6")) () ")")) (compound_statement "{\n    return param_2;\n  }" ({ "{") (return_statement "return param_2;" (return "return") (identifier "param_2") (; ";")) (} "}"))) (return_statement "return ((param_2 & 0x1f) << 6 | param_2 & 0x20) << 0x10;" (return "return") (binary_expression "((param_2 & 0x1f) << 6 | param_2 & 0x20) << 0x10" (parenthesized_expression "((param_2 & 0x1f) << 6 | param_2 & 0x20)" (( "(") (binary_expression "(param_2 & 0x1f) << 6 | param_2 & 0x20" (binary_expression "(param_2 & 0x1f) << 6" (parenthesized_expression "(param_2 & 0x1f)" (( "(") (binary_expression "param_2 & 0x1f" (identifier "param_2") (& "&") (number_literal "0x1f")) () ")")) (<< "<<") (number_literal "6")) (| "|") (binary_expression "param_2 & 0x20" (identifier "param_2") (& "&") (number_literal "0x20"))) () ")")) (<< "<<") (number_literal "0x10")) (; ";")) (} "}")))
(translation_unit (function_definition type: (type_identifier) 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: (type_identifier) declarator: (identifier)))) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (number_literal) right: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal)) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) consequence: (compound_statement (return_statement (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal)) right: (binary_expression left: (identifier) right: (number_literal)))) right: (number_literal)) right: (binary_expression left: (identifier) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal)) right: (binary_expression left: (identifier) right: (number_literal)))) right: (number_literal)) right: (binary_expression left: (identifier) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (identifier)))) (return_statement (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal)) right: (binary_expression left: (identifier) right: (number_literal)))) right: (number_literal))))))

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

{
  param_2 = (1 << (param_3 & 0x1f)) - 1U & param_2;
  if ((param_3 == 0x10) || (param_3 == 9)) {
    return ((param_2 << 0x10) >> 0x1b | param_2 & 0x7e0) << 0x10 | param_2 & 0x1f;
  }
  if (param_3 == 0xf) {
    return ((param_2 << 0x11) >> 0x1c | param_2 & 0x7f0) << 0x10 | param_2 & 0xf;
  }
  if (param_3 != 6) {
    return param_2;
  }
  return ((param_2 & 0x1f) << 6 | param_2 & 0x20) << 0x10;
}

