
/* WARNING: Unknown calling convention */

uint tty_baud_to_value(speed_t speed)

{
  ushort uVar1;
  int iVar2;
  ushort *puVar3;
  
  iVar2 = 0;
  puVar3 = (ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + -0xfb4);
  if (speed != 0) {
    do {
      iVar2 = iVar2 + 1;
      if (iVar2 == 0x1f) {
        return 0;
      }
      uVar1 = *puVar3;
      puVar3 = puVar3 + 2;
    } while (uVar1 != speed);
  }
  uVar1 = *(ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + iVar2 * 4 + -0xfb6);
  if (-1 < (short)uVar1) {
    return (uint)uVar1;
  }
  return (uVar1 & 0x7fff) * 200;
}



uint FUN_000f8bb0(uint param_1)

{
  ushort uVar1;
  int iVar2;
  ushort *puVar3;
  
  iVar2 = 0;
  puVar3 = (ushort *)(PTR_FUN_0012a1a8 + -0xfb4);
  if (param_1 != 0) {
    do {
      iVar2 = iVar2 + 1;
      if (iVar2 == 0x1f) {
        return 0;
      }
      uVar1 = *puVar3;
      puVar3 = puVar3 + 2;
    } while (uVar1 != param_1);
  }
  uVar1 = *(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6);
  if (-1 < (short)uVar1) {
    return (uint)uVar1;
  }
  return (uVar1 & 0x7fff) * 200;
}


lui gp,0x4
addiu gp,gp,-0x6a60
addu gp,gp,t9
lw v1,-0x7fa8(gp)
or a1,zero,zero
or v0,zero,zero
li a2,0x1f
bne a1,a0,0x000f8c00
_addiu v1,v1,-0xfb4
lw v1,-0x7fa8(gp)
sll v0,v0,0x2
addiu v1,v1,-0xfb8
addu v0,v1,v0
lhu v0,0x2(v0)
seh v1,v0
bgez v1,0x000f8c24
_li v1,0xc8
andi v0,v0,0x7fff
jr ra
_mul v0,v0,v1
addiu v0,v0,0x1
beq v0,a2,0x000f8c20
_nop
lhu a1,0x0(v1)
bne a1,a0,0x000f8c00
_addiu v1,v1,0x4
b 0x000f8bd8
_lw v1,-0x7fa8(gp)
or v0,zero,zero
jr ra
_nop
(translation_unit "uint FUN_000f8bb0(uint param_1)\n\n{\n  ushort uVar1;\n  int iVar2;\n  ushort *puVar3;\n  \n  iVar2 = 0;\n  puVar3 = (ushort *)(PTR_FUN_0012a1a8 + -0xfb4);\n  if (param_1 != 0) {\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);\n  }\n  uVar1 = *(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6);\n  if (-1 < (short)uVar1) {\n    return (uint)uVar1;\n  }\n  return (uVar1 & 0x7fff) * 200;\n}\n\n" (function_definition "uint FUN_000f8bb0(uint param_1)\n\n{\n  ushort uVar1;\n  int iVar2;\n  ushort *puVar3;\n  \n  iVar2 = 0;\n  puVar3 = (ushort *)(PTR_FUN_0012a1a8 + -0xfb4);\n  if (param_1 != 0) {\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);\n  }\n  uVar1 = *(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6);\n  if (-1 < (short)uVar1) {\n    return (uint)uVar1;\n  }\n  return (uVar1 & 0x7fff) * 200;\n}" type_identifier (function_declarator "FUN_000f8bb0(uint param_1)" identifier (parameter_list "(uint param_1)" ( (parameter_declaration "uint param_1" type_identifier identifier) ))) (compound_statement "{\n  ushort uVar1;\n  int iVar2;\n  ushort *puVar3;\n  \n  iVar2 = 0;\n  puVar3 = (ushort *)(PTR_FUN_0012a1a8 + -0xfb4);\n  if (param_1 != 0) {\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);\n  }\n  uVar1 = *(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6);\n  if (-1 < (short)uVar1) {\n    return (uint)uVar1;\n  }\n  return (uVar1 & 0x7fff) * 200;\n}" { (declaration "ushort uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "ushort *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (expression_statement "puVar3 = (ushort *)(PTR_FUN_0012a1a8 + -0xfb4);" (assignment_expression "puVar3 = (ushort *)(PTR_FUN_0012a1a8 + -0xfb4)" identifier = (cast_expression "(ushort *)(PTR_FUN_0012a1a8 + -0xfb4)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_FUN_0012a1a8 + -0xfb4)" ( (binary_expression "PTR_FUN_0012a1a8 + -0xfb4" identifier + number_literal) )))) ;) (if_statement "if (param_1 != 0) {\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);\n  }" if (parenthesized_expression "(param_1 != 0)" ( (binary_expression "param_1 != 0" identifier != number_literal) )) (compound_statement "{\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);\n  }" { (do_statement "do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);" do (compound_statement "{\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    }" { (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (if_statement "if (iVar2 == 0x1f) {\n        return 0;\n      }" if (parenthesized_expression "(iVar2 == 0x1f)" ( (binary_expression "iVar2 == 0x1f" identifier == number_literal) )) (compound_statement "{\n        return 0;\n      }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "uVar1 = *puVar3;" (assignment_expression "uVar1 = *puVar3" identifier = (pointer_expression "*puVar3" * identifier)) ;) (expression_statement "puVar3 = puVar3 + 2;" (assignment_expression "puVar3 = puVar3 + 2" identifier = (binary_expression "puVar3 + 2" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar1 != param_1)" ( (binary_expression "uVar1 != param_1" identifier != identifier) )) ;) })) (expression_statement "uVar1 = *(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6);" (assignment_expression "uVar1 = *(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6)" identifier = (pointer_expression "*(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6)" * (cast_expression "(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6)" ( (binary_expression "PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6" (binary_expression "PTR_FUN_0012a1a8 + iVar2 * 4" identifier + (binary_expression "iVar2 * 4" identifier * number_literal)) + number_literal) ))))) ;) (if_statement "if (-1 < (short)uVar1) {\n    return (uint)uVar1;\n  }" if (parenthesized_expression "(-1 < (short)uVar1)" ( (binary_expression "-1 < (short)uVar1" number_literal < (cast_expression "(short)uVar1" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier)) )) (compound_statement "{\n    return (uint)uVar1;\n  }" { (return_statement "return (uint)uVar1;" return (cast_expression "(uint)uVar1" ( (type_descriptor "uint" type_identifier) ) identifier) ;) })) (return_statement "return (uVar1 & 0x7fff) * 200;" return (binary_expression "(uVar1 & 0x7fff) * 200" (parenthesized_expression "(uVar1 & 0x7fff)" ( (binary_expression "uVar1 & 0x7fff" identifier & number_literal) )) * number_literal) ;) })))
(translation_unit "/* WARNING: Unknown calling convention */\n\nuint tty_baud_to_value(speed_t speed)\n\n{\n  ushort uVar1;\n  int iVar2;\n  ushort *puVar3;\n  \n  iVar2 = 0;\n  puVar3 = (ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + -0xfb4);\n  if (speed != 0) {\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != speed);\n  }\n  uVar1 = *(ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + iVar2 * 4 + -0xfb6);\n  if (-1 < (short)uVar1) {\n    return (uint)uVar1;\n  }\n  return (uVar1 & 0x7fff) * 200;\n}\n\n" comment (function_definition "uint tty_baud_to_value(speed_t speed)\n\n{\n  ushort uVar1;\n  int iVar2;\n  ushort *puVar3;\n  \n  iVar2 = 0;\n  puVar3 = (ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + -0xfb4);\n  if (speed != 0) {\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != speed);\n  }\n  uVar1 = *(ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + iVar2 * 4 + -0xfb6);\n  if (-1 < (short)uVar1) {\n    return (uint)uVar1;\n  }\n  return (uVar1 & 0x7fff) * 200;\n}" type_identifier (function_declarator "tty_baud_to_value(speed_t speed)" identifier (parameter_list "(speed_t speed)" ( (parameter_declaration "speed_t speed" type_identifier identifier) ))) (compound_statement "{\n  ushort uVar1;\n  int iVar2;\n  ushort *puVar3;\n  \n  iVar2 = 0;\n  puVar3 = (ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + -0xfb4);\n  if (speed != 0) {\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != speed);\n  }\n  uVar1 = *(ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + iVar2 * 4 + -0xfb6);\n  if (-1 < (short)uVar1) {\n    return (uint)uVar1;\n  }\n  return (uVar1 & 0x7fff) * 200;\n}" { (declaration "ushort uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "ushort *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (expression_statement "puVar3 = (ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + -0xfb4);" (assignment_expression "puVar3 = (ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + -0xfb4" identifier = (binary_expression "(ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + -0xfb4" (cast_expression "(ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)" ( (binary_expression "PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P" (binary_expression "PTR_s_<_W_q_v1_HxLJ_" identifier < identifier) & identifier) ))) (ERROR "9__f_l_0012a1a8" number_literal identifier) + number_literal)) (ERROR ")" )) ;) (if_statement "if (speed != 0) {\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != speed);\n  }" if (parenthesized_expression "(speed != 0)" ( (binary_expression "speed != 0" identifier != number_literal) )) (compound_statement "{\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != speed);\n  }" { (do_statement "do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != speed);" do (compound_statement "{\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    }" { (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (if_statement "if (iVar2 == 0x1f) {\n        return 0;\n      }" if (parenthesized_expression "(iVar2 == 0x1f)" ( (binary_expression "iVar2 == 0x1f" identifier == number_literal) )) (compound_statement "{\n        return 0;\n      }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "uVar1 = *puVar3;" (assignment_expression "uVar1 = *puVar3" identifier = (pointer_expression "*puVar3" * identifier)) ;) (expression_statement "puVar3 = puVar3 + 2;" (assignment_expression "puVar3 = puVar3 + 2" identifier = (binary_expression "puVar3 + 2" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar1 != speed)" ( (binary_expression "uVar1 != speed" identifier != identifier) )) ;) })) (expression_statement "uVar1 = *(ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + iVar2 * 4 + -0xfb6);" (assignment_expression "uVar1 = *(ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + iVar2 * 4 + -0xfb6" identifier = (binary_expression "*(ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + iVar2 * 4 + -0xfb6" (binary_expression "*(ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)9__f_l_0012a1a8 + iVar2 * 4" (pointer_expression "*(ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)" * (cast_expression "(ushort *)(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P)" ( (binary_expression "PTR_s_<_W_q_v1_HxLJ_&uD_sa_____P" (binary_expression "PTR_s_<_W_q_v1_HxLJ_" identifier < identifier) & identifier) )))) (ERROR "9__f_l_0012a1a8" number_literal identifier) + (binary_expression "iVar2 * 4" identifier * number_literal)) + number_literal)) (ERROR ")" )) ;) (if_statement "if (-1 < (short)uVar1) {\n    return (uint)uVar1;\n  }" if (parenthesized_expression "(-1 < (short)uVar1)" ( (binary_expression "-1 < (short)uVar1" number_literal < (cast_expression "(short)uVar1" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier)) )) (compound_statement "{\n    return (uint)uVar1;\n  }" { (return_statement "return (uint)uVar1;" return (cast_expression "(uint)uVar1" ( (type_descriptor "uint" type_identifier) ) identifier) ;) })) (return_statement "return (uVar1 & 0x7fff) * 200;" return (binary_expression "(uVar1 & 0x7fff) * 200" (parenthesized_expression "(uVar1 & 0x7fff)" ( (binary_expression "uVar1 & 0x7fff" identifier & number_literal) )) * number_literal) ;) })))
(translation_unit "uint FUN_000f8bb0(uint param_1)\n\n{\n  ushort uVar1;\n  int iVar2;\n  ushort *puVar3;\n  \n  iVar2 = 0;\n  puVar3 = (ushort *)(PTR_FUN_0012a1a8 + -0xfb4);\n  if (param_1 != 0) {\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);\n  }\n  uVar1 = *(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6);\n  if (-1 < (short)uVar1) {\n    return (uint)uVar1;\n  }\n  return (uVar1 & 0x7fff) * 200;\n}\n\n" (function_definition "uint FUN_000f8bb0(uint param_1)\n\n{\n  ushort uVar1;\n  int iVar2;\n  ushort *puVar3;\n  \n  iVar2 = 0;\n  puVar3 = (ushort *)(PTR_FUN_0012a1a8 + -0xfb4);\n  if (param_1 != 0) {\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);\n  }\n  uVar1 = *(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6);\n  if (-1 < (short)uVar1) {\n    return (uint)uVar1;\n  }\n  return (uVar1 & 0x7fff) * 200;\n}" type_identifier (function_declarator "FUN_000f8bb0(uint param_1)" identifier (parameter_list "(uint param_1)" ( (parameter_declaration "uint param_1" type_identifier identifier) ))) (compound_statement "{\n  ushort uVar1;\n  int iVar2;\n  ushort *puVar3;\n  \n  iVar2 = 0;\n  puVar3 = (ushort *)(PTR_FUN_0012a1a8 + -0xfb4);\n  if (param_1 != 0) {\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);\n  }\n  uVar1 = *(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6);\n  if (-1 < (short)uVar1) {\n    return (uint)uVar1;\n  }\n  return (uVar1 & 0x7fff) * 200;\n}" { (declaration "ushort uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "ushort *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (expression_statement "puVar3 = (ushort *)(PTR_FUN_0012a1a8 + -0xfb4);" (assignment_expression "puVar3 = (ushort *)(PTR_FUN_0012a1a8 + -0xfb4)" identifier = (cast_expression "(ushort *)(PTR_FUN_0012a1a8 + -0xfb4)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_FUN_0012a1a8 + -0xfb4)" ( (binary_expression "PTR_FUN_0012a1a8 + -0xfb4" identifier + number_literal) )))) ;) (if_statement "if (param_1 != 0) {\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);\n  }" if (parenthesized_expression "(param_1 != 0)" ( (binary_expression "param_1 != 0" identifier != number_literal) )) (compound_statement "{\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);\n  }" { (do_statement "do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);" do (compound_statement "{\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    }" { (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (if_statement "if (iVar2 == 0x1f) {\n        return 0;\n      }" if (parenthesized_expression "(iVar2 == 0x1f)" ( (binary_expression "iVar2 == 0x1f" identifier == number_literal) )) (compound_statement "{\n        return 0;\n      }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "uVar1 = *puVar3;" (assignment_expression "uVar1 = *puVar3" identifier = (pointer_expression "*puVar3" * identifier)) ;) (expression_statement "puVar3 = puVar3 + 2;" (assignment_expression "puVar3 = puVar3 + 2" identifier = (binary_expression "puVar3 + 2" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar1 != param_1)" ( (binary_expression "uVar1 != param_1" identifier != identifier) )) ;) })) (expression_statement "uVar1 = *(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6);" (assignment_expression "uVar1 = *(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6)" identifier = (pointer_expression "*(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6)" * (cast_expression "(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6)" ( (binary_expression "PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6" (binary_expression "PTR_FUN_0012a1a8 + iVar2 * 4" identifier + (binary_expression "iVar2 * 4" identifier * number_literal)) + number_literal) ))))) ;) (if_statement "if (-1 < (short)uVar1) {\n    return (uint)uVar1;\n  }" if (parenthesized_expression "(-1 < (short)uVar1)" ( (binary_expression "-1 < (short)uVar1" number_literal < (cast_expression "(short)uVar1" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier)) )) (compound_statement "{\n    return (uint)uVar1;\n  }" { (return_statement "return (uint)uVar1;" return (cast_expression "(uint)uVar1" ( (type_descriptor "uint" type_identifier) ) identifier) ;) })) (return_statement "return (uVar1 & 0x7fff) * 200;" return (binary_expression "(uVar1 & 0x7fff) * 200" (parenthesized_expression "(uVar1 & 0x7fff)" ( (binary_expression "uVar1 & 0x7fff" identifier & number_literal) )) * number_literal) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != IDENT) )) ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + (binary_expression IDENT * LIT)) + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < (cast_expression ( (type_descriptor (sized_type_specifier short)) ) IDENT)) )) (compound_statement { (return_statement return (cast_expression ( (type_descriptor TYPE) ) IDENT) ;) })) (return_statement return (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) * LIT) ;) })))
(function_definition "uint FUN_000f8bb0(uint param_1)\n\n{\n  ushort uVar1;\n  int iVar2;\n  ushort *puVar3;\n  \n  iVar2 = 0;\n  puVar3 = (ushort *)(PTR_FUN_0012a1a8 + -0xfb4);\n  if (param_1 != 0) {\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);\n  }\n  uVar1 = *(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6);\n  if (-1 < (short)uVar1) {\n    return (uint)uVar1;\n  }\n  return (uVar1 & 0x7fff) * 200;\n}" (type_identifier "uint") (function_declarator "FUN_000f8bb0(uint param_1)" (identifier "FUN_000f8bb0") (parameter_list "(uint param_1)" (( "(") (parameter_declaration "uint param_1" (type_identifier "uint") (identifier "param_1")) () ")"))) (compound_statement "{\n  ushort uVar1;\n  int iVar2;\n  ushort *puVar3;\n  \n  iVar2 = 0;\n  puVar3 = (ushort *)(PTR_FUN_0012a1a8 + -0xfb4);\n  if (param_1 != 0) {\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);\n  }\n  uVar1 = *(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6);\n  if (-1 < (short)uVar1) {\n    return (uint)uVar1;\n  }\n  return (uVar1 & 0x7fff) * 200;\n}" ({ "{") (declaration "ushort uVar1;" (type_identifier "ushort") (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "ushort *puVar3;" (type_identifier "ushort") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" (identifier "iVar2") (= "=") (number_literal "0")) (; ";")) (expression_statement "puVar3 = (ushort *)(PTR_FUN_0012a1a8 + -0xfb4);" (assignment_expression "puVar3 = (ushort *)(PTR_FUN_0012a1a8 + -0xfb4)" (identifier "puVar3") (= "=") (cast_expression "(ushort *)(PTR_FUN_0012a1a8 + -0xfb4)" (( "(") (type_descriptor "ushort *" (type_identifier "ushort") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(PTR_FUN_0012a1a8 + -0xfb4)" (( "(") (binary_expression "PTR_FUN_0012a1a8 + -0xfb4" (identifier "PTR_FUN_0012a1a8") (+ "+") (number_literal "-0xfb4")) () ")")))) (; ";")) (if_statement "if (param_1 != 0) {\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);\n  }" (if "if") (parenthesized_expression "(param_1 != 0)" (( "(") (binary_expression "param_1 != 0" (identifier "param_1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);\n  }" ({ "{") (do_statement "do {\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    } while (uVar1 != param_1);" (do "do") (compound_statement "{\n      iVar2 = iVar2 + 1;\n      if (iVar2 == 0x1f) {\n        return 0;\n      }\n      uVar1 = *puVar3;\n      puVar3 = puVar3 + 2;\n    }" ({ "{") (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" (identifier "iVar2") (= "=") (binary_expression "iVar2 + 1" (identifier "iVar2") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (iVar2 == 0x1f) {\n        return 0;\n      }" (if "if") (parenthesized_expression "(iVar2 == 0x1f)" (( "(") (binary_expression "iVar2 == 0x1f" (identifier "iVar2") (== "==") (number_literal "0x1f")) () ")")) (compound_statement "{\n        return 0;\n      }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "uVar1 = *puVar3;" (assignment_expression "uVar1 = *puVar3" (identifier "uVar1") (= "=") (pointer_expression "*puVar3" (* "*") (identifier "puVar3"))) (; ";")) (expression_statement "puVar3 = puVar3 + 2;" (assignment_expression "puVar3 = puVar3 + 2" (identifier "puVar3") (= "=") (binary_expression "puVar3 + 2" (identifier "puVar3") (+ "+") (number_literal "2"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(uVar1 != param_1)" (( "(") (binary_expression "uVar1 != param_1" (identifier "uVar1") (!= "!=") (identifier "param_1")) () ")")) (; ";")) (} "}"))) (expression_statement "uVar1 = *(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6);" (assignment_expression "uVar1 = *(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6)" (identifier "uVar1") (= "=") (pointer_expression "*(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6)" (* "*") (cast_expression "(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6)" (( "(") (type_descriptor "ushort *" (type_identifier "ushort") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6)" (( "(") (binary_expression "PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6" (binary_expression "PTR_FUN_0012a1a8 + iVar2 * 4" (identifier "PTR_FUN_0012a1a8") (+ "+") (binary_expression "iVar2 * 4" (identifier "iVar2") (* "*") (number_literal "4"))) (+ "+") (number_literal "-0xfb6")) () ")"))))) (; ";")) (if_statement "if (-1 < (short)uVar1) {\n    return (uint)uVar1;\n  }" (if "if") (parenthesized_expression "(-1 < (short)uVar1)" (( "(") (binary_expression "-1 < (short)uVar1" (number_literal "-1") (< "<") (cast_expression "(short)uVar1" (( "(") (type_descriptor "short" (sized_type_specifier "short" (short "short"))) () ")") (identifier "uVar1"))) () ")")) (compound_statement "{\n    return (uint)uVar1;\n  }" ({ "{") (return_statement "return (uint)uVar1;" (return "return") (cast_expression "(uint)uVar1" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "uVar1")) (; ";")) (} "}"))) (return_statement "return (uVar1 & 0x7fff) * 200;" (return "return") (binary_expression "(uVar1 & 0x7fff) * 200" (parenthesized_expression "(uVar1 & 0x7fff)" (( "(") (binary_expression "uVar1 & 0x7fff" (identifier "uVar1") (& "&") (number_literal "0x7fff")) () ")")) (* "*") (number_literal "200")) (; ";")) (} "}")))

/* WARNING: Unknown calling convention */

type_1 function_1(type_2 var_4)

{
  type_3 var_7;
  int var_5;
  type_3 *var_6;
  
  var_5 = 0;
  var_6 = (type_3 *)(var_1<var_2&var_3)9__f_l_0012a1a8 + -0xfb4);
  if (var_4 != 0) {
    do {
      var_5 = var_5 + 1;
      if (var_5 == 0x1f) {
        return 0;
      }
      var_7 = *var_6;
      var_6 = var_6 + 2;
    } while (var_7 != var_4);
  }
  var_7 = *(type_3 *)(var_1<var_2&var_3)9__f_l_0012a1a8 + var_5 * 4 + -0xfb6);
  if (-1 < (short)var_7) {
    return (type_1)var_7;
  }
  return (var_7 & 0x7fff) * 200;
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)))) consequence: (compound_statement (return_statement (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier))))) (return_statement (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))))))

uint MASKED(uint param_1)

{
  ushort uVar1;
  int iVar2;
  ushort *puVar3;
  
  iVar2 = 0;
  puVar3 = (ushort *)(PTR_FUN_0012a1a8 + -0xfb4);
  if (param_1 != 0) {
    do {
      iVar2 = iVar2 + 1;
      if (iVar2 == 0x1f) {
        return 0;
      }
      uVar1 = *puVar3;
      puVar3 = puVar3 + 2;
    } while (uVar1 != param_1);
  }
  uVar1 = *(ushort *)(PTR_FUN_0012a1a8 + iVar2 * 4 + -0xfb6);
  if (-1 < (short)uVar1) {
    return (uint)uVar1;
  }
  return (uVar1 & 0x7fff) * 200;
}

