
/* DWARF original prototype: int ctrl_find_set(controlbox * b, char * path, int start, controlbox *
   b) */

int ctrl_find_set(controlbox *b,char *path,int start,controlbox *b_1)

{
  undefined4 *puVar1;
  int iVar2;
  int iVar3;
  undefined4 *puVar4;
  controlbox *pcVar5;
  int iVar6;
  
  if ((int)b < 1) {
    return (int)b;
  }
  puVar4 = *(undefined4 **)path;
  pcVar5 = (controlbox *)0x0;
  iVar6 = 0x7fffffff;
  iVar3 = 0;
  while( true ) {
    puVar1 = (undefined4 *)*puVar4;
    puVar4 = puVar4 + 1;
    iVar2 = ctrl_path_compare((char *)start,(char *)*puVar1);
    if (iVar2 == iVar6) {
      return (int)pcVar5;
    }
    if (iVar2 < iVar3) break;
    pcVar5 = (controlbox *)((int)&pcVar5->nctrlsets + 1);
    iVar3 = iVar2;
    if (pcVar5 == b) {
      return (int)pcVar5;
    }
  }
  return (int)pcVar5;
}



int FUN_0002c894(int param_1,undefined4 *param_2,undefined4 param_3)

{
  undefined4 *puVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  
  if (param_1 < 1) {
    return param_1;
  }
  param_2 = (undefined4 *)*param_2;
  iVar4 = 0;
  iVar5 = 0x7fffffff;
  iVar3 = 0;
  while( true ) {
    puVar1 = (undefined4 *)*param_2;
    param_2 = param_2 + 1;
    iVar2 = ctrl_path_compare(param_3,*puVar1);
    if (iVar2 == iVar5) {
      return iVar4;
    }
    if (iVar2 < iVar3) break;
    iVar4 = iVar4 + 1;
    iVar3 = iVar2;
    if (iVar4 == param_1) {
      return iVar4;
    }
  }
  return iVar4;
}


lui gp,0x8
addiu gp,gp,0x27fc
addu gp,gp,t9
blez a0,0x0002c914
_lui t5,0x7fff
addiu sp,sp,-0x20
lw t1,0x0(a1)
lw t9,-0x7d48(gp)
or t4,a2,zero
sw gp,0x10(sp)
or t3,a0,zero
sw ra,0x1c(sp)
or t0,zero,zero
or t2,zero,zero
b 0x0002c8e8
_ori t5,t5,0xffff
bne t0,zero,0x0002c908
_lw ra,0x1c(sp)
addiu t2,t2,0x1
beq t2,t3,0x0002c908
_or t0,v0,zero
lw v0,0x0(t1)
or a0,t4,zero
addiu t1,t1,0x4
bal 0x0002c820
_lw a1,0x0(v0)
bne v0,t5,0x0002c8d4
_slt t0,v0,t0
lw ra,0x1c(sp)
or v0,t2,zero
jr ra
_addiu sp,sp,0x20
jr ra
_or v0,a0,zero
(translation_unit "int FUN_0002c894(int param_1,undefined4 *param_2,undefined4 param_3)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  \n  if (param_1 < 1) {\n    return param_1;\n  }\n  param_2 = (undefined4 *)*param_2;\n  iVar4 = 0;\n  iVar5 = 0x7fffffff;\n  iVar3 = 0;\n  while( true ) {\n    puVar1 = (undefined4 *)*param_2;\n    param_2 = param_2 + 1;\n    iVar2 = ctrl_path_compare(param_3,*puVar1);\n    if (iVar2 == iVar5) {\n      return iVar4;\n    }\n    if (iVar2 < iVar3) break;\n    iVar4 = iVar4 + 1;\n    iVar3 = iVar2;\n    if (iVar4 == param_1) {\n      return iVar4;\n    }\n  }\n  return iVar4;\n}\n\n" (function_definition "int FUN_0002c894(int param_1,undefined4 *param_2,undefined4 param_3)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  \n  if (param_1 < 1) {\n    return param_1;\n  }\n  param_2 = (undefined4 *)*param_2;\n  iVar4 = 0;\n  iVar5 = 0x7fffffff;\n  iVar3 = 0;\n  while( true ) {\n    puVar1 = (undefined4 *)*param_2;\n    param_2 = param_2 + 1;\n    iVar2 = ctrl_path_compare(param_3,*puVar1);\n    if (iVar2 == iVar5) {\n      return iVar4;\n    }\n    if (iVar2 < iVar3) break;\n    iVar4 = iVar4 + 1;\n    iVar3 = iVar2;\n    if (iVar4 == param_1) {\n      return iVar4;\n    }\n  }\n  return iVar4;\n}" primitive_type (function_declarator "FUN_0002c894(int param_1,undefined4 *param_2,undefined4 param_3)" identifier (parameter_list "(int param_1,undefined4 *param_2,undefined4 param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  \n  if (param_1 < 1) {\n    return param_1;\n  }\n  param_2 = (undefined4 *)*param_2;\n  iVar4 = 0;\n  iVar5 = 0x7fffffff;\n  iVar3 = 0;\n  while( true ) {\n    puVar1 = (undefined4 *)*param_2;\n    param_2 = param_2 + 1;\n    iVar2 = ctrl_path_compare(param_3,*puVar1);\n    if (iVar2 == iVar5) {\n      return iVar4;\n    }\n    if (iVar2 < iVar3) break;\n    iVar4 = iVar4 + 1;\n    iVar3 = iVar2;\n    if (iVar4 == param_1) {\n      return iVar4;\n    }\n  }\n  return iVar4;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (if_statement "if (param_1 < 1) {\n    return param_1;\n  }" if (parenthesized_expression "(param_1 < 1)" ( (binary_expression "param_1 < 1" identifier < number_literal) )) (compound_statement "{\n    return param_1;\n  }" { (return_statement "return param_1;" return identifier ;) })) (expression_statement "param_2 = (undefined4 *)*param_2;" (assignment_expression "param_2 = (undefined4 *)*param_2" identifier = (cast_expression "(undefined4 *)*param_2" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) ;) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) (expression_statement "iVar5 = 0x7fffffff;" (assignment_expression "iVar5 = 0x7fffffff" identifier = number_literal) ;) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (while_statement "while( true ) {\n    puVar1 = (undefined4 *)*param_2;\n    param_2 = param_2 + 1;\n    iVar2 = ctrl_path_compare(param_3,*puVar1);\n    if (iVar2 == iVar5) {\n      return iVar4;\n    }\n    if (iVar2 < iVar3) break;\n    iVar4 = iVar4 + 1;\n    iVar3 = iVar2;\n    if (iVar4 == param_1) {\n      return iVar4;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    puVar1 = (undefined4 *)*param_2;\n    param_2 = param_2 + 1;\n    iVar2 = ctrl_path_compare(param_3,*puVar1);\n    if (iVar2 == iVar5) {\n      return iVar4;\n    }\n    if (iVar2 < iVar3) break;\n    iVar4 = iVar4 + 1;\n    iVar3 = iVar2;\n    if (iVar4 == param_1) {\n      return iVar4;\n    }\n  }" { (expression_statement "puVar1 = (undefined4 *)*param_2;" (assignment_expression "puVar1 = (undefined4 *)*param_2" identifier = (cast_expression "(undefined4 *)*param_2" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) ;) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) (expression_statement "iVar2 = ctrl_path_compare(param_3,*puVar1);" (assignment_expression "iVar2 = ctrl_path_compare(param_3,*puVar1)" identifier = (call_expression "ctrl_path_compare(param_3,*puVar1)" identifier (argument_list "(param_3,*puVar1)" ( identifier , (pointer_expression "*puVar1" * identifier) )))) ;) (if_statement "if (iVar2 == iVar5) {\n      return iVar4;\n    }" if (parenthesized_expression "(iVar2 == iVar5)" ( (binary_expression "iVar2 == iVar5" identifier == identifier) )) (compound_statement "{\n      return iVar4;\n    }" { (return_statement "return iVar4;" return identifier ;) })) (if_statement "if (iVar2 < iVar3) break;" if (parenthesized_expression "(iVar2 < iVar3)" ( (binary_expression "iVar2 < iVar3" identifier < identifier) )) (break_statement "break;" break ;)) (expression_statement "iVar4 = iVar4 + 1;" (assignment_expression "iVar4 = iVar4 + 1" identifier = (binary_expression "iVar4 + 1" identifier + number_literal)) ;) (expression_statement "iVar3 = iVar2;" (assignment_expression "iVar3 = iVar2" identifier = identifier) ;) (if_statement "if (iVar4 == param_1) {\n      return iVar4;\n    }" if (parenthesized_expression "(iVar4 == param_1)" ( (binary_expression "iVar4 == param_1" identifier == identifier) )) (compound_statement "{\n      return iVar4;\n    }" { (return_statement "return iVar4;" return identifier ;) })) })) (return_statement "return iVar4;" return identifier ;) })))
(translation_unit "/* DWARF original prototype: int ctrl_find_set(controlbox * b, char * path, int start, controlbox *\n   b) */\n\nint ctrl_find_set(controlbox *b,char *path,int start,controlbox *b_1)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 *puVar4;\n  controlbox *pcVar5;\n  int iVar6;\n  \n  if ((int)b < 1) {\n    return (int)b;\n  }\n  puVar4 = *(undefined4 **)path;\n  pcVar5 = (controlbox *)0x0;\n  iVar6 = 0x7fffffff;\n  iVar3 = 0;\n  while( true ) {\n    puVar1 = (undefined4 *)*puVar4;\n    puVar4 = puVar4 + 1;\n    iVar2 = ctrl_path_compare((char *)start,(char *)*puVar1);\n    if (iVar2 == iVar6) {\n      return (int)pcVar5;\n    }\n    if (iVar2 < iVar3) break;\n    pcVar5 = (controlbox *)((int)&pcVar5->nctrlsets + 1);\n    iVar3 = iVar2;\n    if (pcVar5 == b) {\n      return (int)pcVar5;\n    }\n  }\n  return (int)pcVar5;\n}\n\n" comment (function_definition "int ctrl_find_set(controlbox *b,char *path,int start,controlbox *b_1)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 *puVar4;\n  controlbox *pcVar5;\n  int iVar6;\n  \n  if ((int)b < 1) {\n    return (int)b;\n  }\n  puVar4 = *(undefined4 **)path;\n  pcVar5 = (controlbox *)0x0;\n  iVar6 = 0x7fffffff;\n  iVar3 = 0;\n  while( true ) {\n    puVar1 = (undefined4 *)*puVar4;\n    puVar4 = puVar4 + 1;\n    iVar2 = ctrl_path_compare((char *)start,(char *)*puVar1);\n    if (iVar2 == iVar6) {\n      return (int)pcVar5;\n    }\n    if (iVar2 < iVar3) break;\n    pcVar5 = (controlbox *)((int)&pcVar5->nctrlsets + 1);\n    iVar3 = iVar2;\n    if (pcVar5 == b) {\n      return (int)pcVar5;\n    }\n  }\n  return (int)pcVar5;\n}" primitive_type (function_declarator "ctrl_find_set(controlbox *b,char *path,int start,controlbox *b_1)" identifier (parameter_list "(controlbox *b,char *path,int start,controlbox *b_1)" ( (parameter_declaration "controlbox *b" type_identifier (pointer_declarator "*b" * identifier)) , (parameter_declaration "char *path" primitive_type (pointer_declarator "*path" * identifier)) , (parameter_declaration "int start" primitive_type identifier) , (parameter_declaration "controlbox *b_1" type_identifier (pointer_declarator "*b_1" * identifier)) ))) (compound_statement "{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  undefined4 *puVar4;\n  controlbox *pcVar5;\n  int iVar6;\n  \n  if ((int)b < 1) {\n    return (int)b;\n  }\n  puVar4 = *(undefined4 **)path;\n  pcVar5 = (controlbox *)0x0;\n  iVar6 = 0x7fffffff;\n  iVar3 = 0;\n  while( true ) {\n    puVar1 = (undefined4 *)*puVar4;\n    puVar4 = puVar4 + 1;\n    iVar2 = ctrl_path_compare((char *)start,(char *)*puVar1);\n    if (iVar2 == iVar6) {\n      return (int)pcVar5;\n    }\n    if (iVar2 < iVar3) break;\n    pcVar5 = (controlbox *)((int)&pcVar5->nctrlsets + 1);\n    iVar3 = iVar2;\n    if (pcVar5 == b) {\n      return (int)pcVar5;\n    }\n  }\n  return (int)pcVar5;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined4 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "controlbox *pcVar5;" type_identifier (pointer_declarator "*pcVar5" * identifier) ;) (declaration "int iVar6;" primitive_type identifier ;) (if_statement "if ((int)b < 1) {\n    return (int)b;\n  }" if (parenthesized_expression "((int)b < 1)" ( (binary_expression "(int)b < 1" (cast_expression "(int)b" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (compound_statement "{\n    return (int)b;\n  }" { (return_statement "return (int)b;" return (cast_expression "(int)b" ( (type_descriptor "int" primitive_type) ) identifier) ;) })) (expression_statement "puVar4 = *(undefined4 **)path;" (assignment_expression "puVar4 = *(undefined4 **)path" identifier = (pointer_expression "*(undefined4 **)path" * (cast_expression "(undefined4 **)path" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "pcVar5 = (controlbox *)0x0;" (assignment_expression "pcVar5 = (controlbox *)0x0" identifier = (cast_expression "(controlbox *)0x0" ( (type_descriptor "controlbox *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "iVar6 = 0x7fffffff;" (assignment_expression "iVar6 = 0x7fffffff" identifier = number_literal) ;) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (while_statement "while( true ) {\n    puVar1 = (undefined4 *)*puVar4;\n    puVar4 = puVar4 + 1;\n    iVar2 = ctrl_path_compare((char *)start,(char *)*puVar1);\n    if (iVar2 == iVar6) {\n      return (int)pcVar5;\n    }\n    if (iVar2 < iVar3) break;\n    pcVar5 = (controlbox *)((int)&pcVar5->nctrlsets + 1);\n    iVar3 = iVar2;\n    if (pcVar5 == b) {\n      return (int)pcVar5;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    puVar1 = (undefined4 *)*puVar4;\n    puVar4 = puVar4 + 1;\n    iVar2 = ctrl_path_compare((char *)start,(char *)*puVar1);\n    if (iVar2 == iVar6) {\n      return (int)pcVar5;\n    }\n    if (iVar2 < iVar3) break;\n    pcVar5 = (controlbox *)((int)&pcVar5->nctrlsets + 1);\n    iVar3 = iVar2;\n    if (pcVar5 == b) {\n      return (int)pcVar5;\n    }\n  }" { (expression_statement "puVar1 = (undefined4 *)*puVar4;" (assignment_expression "puVar1 = (undefined4 *)*puVar4" identifier = (cast_expression "(undefined4 *)*puVar4" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*puVar4" * identifier))) ;) (expression_statement "puVar4 = puVar4 + 1;" (assignment_expression "puVar4 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (expression_statement "iVar2 = ctrl_path_compare((char *)start,(char *)*puVar1);" (assignment_expression "iVar2 = ctrl_path_compare((char *)start,(char *)*puVar1)" identifier = (call_expression "ctrl_path_compare((char *)start,(char *)*puVar1)" identifier (argument_list "((char *)start,(char *)*puVar1)" ( (cast_expression "(char *)start" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier) , (cast_expression "(char *)*puVar1" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*puVar1" * identifier)) )))) ;) (if_statement "if (iVar2 == iVar6) {\n      return (int)pcVar5;\n    }" if (parenthesized_expression "(iVar2 == iVar6)" ( (binary_expression "iVar2 == iVar6" identifier == identifier) )) (compound_statement "{\n      return (int)pcVar5;\n    }" { (return_statement "return (int)pcVar5;" return (cast_expression "(int)pcVar5" ( (type_descriptor "int" primitive_type) ) identifier) ;) })) (if_statement "if (iVar2 < iVar3) break;" if (parenthesized_expression "(iVar2 < iVar3)" ( (binary_expression "iVar2 < iVar3" identifier < identifier) )) (break_statement "break;" break ;)) (expression_statement "pcVar5 = (controlbox *)((int)&pcVar5->nctrlsets + 1);" (assignment_expression "pcVar5 = (controlbox *)((int)&pcVar5->nctrlsets + 1)" identifier = (cast_expression "(controlbox *)((int)&pcVar5->nctrlsets + 1)" ( (type_descriptor "controlbox *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)&pcVar5->nctrlsets + 1)" ( (binary_expression "(int)&pcVar5->nctrlsets + 1" (cast_expression "(int)&pcVar5->nctrlsets" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&pcVar5->nctrlsets" & (field_expression "pcVar5->nctrlsets" identifier -> field_identifier))) + number_literal) )))) ;) (expression_statement "iVar3 = iVar2;" (assignment_expression "iVar3 = iVar2" identifier = identifier) ;) (if_statement "if (pcVar5 == b) {\n      return (int)pcVar5;\n    }" if (parenthesized_expression "(pcVar5 == b)" ( (binary_expression "pcVar5 == b" identifier == identifier) )) (compound_statement "{\n      return (int)pcVar5;\n    }" { (return_statement "return (int)pcVar5;" return (cast_expression "(int)pcVar5" ( (type_descriptor "int" primitive_type) ) identifier) ;) })) })) (return_statement "return (int)pcVar5;" return (cast_expression "(int)pcVar5" ( (type_descriptor "int" primitive_type) ) identifier) ;) })))
(translation_unit "int FUN_0002c894(int param_1,undefined4 *param_2,undefined4 param_3)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  \n  if (param_1 < 1) {\n    return param_1;\n  }\n  param_2 = (undefined4 *)*param_2;\n  iVar4 = 0;\n  iVar5 = 0x7fffffff;\n  iVar3 = 0;\n  while( true ) {\n    puVar1 = (undefined4 *)*param_2;\n    param_2 = param_2 + 1;\n    iVar2 = ctrl_path_compare(param_3,*puVar1);\n    if (iVar2 == iVar5) {\n      return iVar4;\n    }\n    if (iVar2 < iVar3) break;\n    iVar4 = iVar4 + 1;\n    iVar3 = iVar2;\n    if (iVar4 == param_1) {\n      return iVar4;\n    }\n  }\n  return iVar4;\n}\n\n" (function_definition "int FUN_0002c894(int param_1,undefined4 *param_2,undefined4 param_3)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  \n  if (param_1 < 1) {\n    return param_1;\n  }\n  param_2 = (undefined4 *)*param_2;\n  iVar4 = 0;\n  iVar5 = 0x7fffffff;\n  iVar3 = 0;\n  while( true ) {\n    puVar1 = (undefined4 *)*param_2;\n    param_2 = param_2 + 1;\n    iVar2 = ctrl_path_compare(param_3,*puVar1);\n    if (iVar2 == iVar5) {\n      return iVar4;\n    }\n    if (iVar2 < iVar3) break;\n    iVar4 = iVar4 + 1;\n    iVar3 = iVar2;\n    if (iVar4 == param_1) {\n      return iVar4;\n    }\n  }\n  return iVar4;\n}" primitive_type (function_declarator "FUN_0002c894(int param_1,undefined4 *param_2,undefined4 param_3)" identifier (parameter_list "(int param_1,undefined4 *param_2,undefined4 param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  \n  if (param_1 < 1) {\n    return param_1;\n  }\n  param_2 = (undefined4 *)*param_2;\n  iVar4 = 0;\n  iVar5 = 0x7fffffff;\n  iVar3 = 0;\n  while( true ) {\n    puVar1 = (undefined4 *)*param_2;\n    param_2 = param_2 + 1;\n    iVar2 = ctrl_path_compare(param_3,*puVar1);\n    if (iVar2 == iVar5) {\n      return iVar4;\n    }\n    if (iVar2 < iVar3) break;\n    iVar4 = iVar4 + 1;\n    iVar3 = iVar2;\n    if (iVar4 == param_1) {\n      return iVar4;\n    }\n  }\n  return iVar4;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (if_statement "if (param_1 < 1) {\n    return param_1;\n  }" if (parenthesized_expression "(param_1 < 1)" ( (binary_expression "param_1 < 1" identifier < number_literal) )) (compound_statement "{\n    return param_1;\n  }" { (return_statement "return param_1;" return identifier ;) })) (expression_statement "param_2 = (undefined4 *)*param_2;" (assignment_expression "param_2 = (undefined4 *)*param_2" identifier = (cast_expression "(undefined4 *)*param_2" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) ;) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) (expression_statement "iVar5 = 0x7fffffff;" (assignment_expression "iVar5 = 0x7fffffff" identifier = number_literal) ;) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (while_statement "while( true ) {\n    puVar1 = (undefined4 *)*param_2;\n    param_2 = param_2 + 1;\n    iVar2 = ctrl_path_compare(param_3,*puVar1);\n    if (iVar2 == iVar5) {\n      return iVar4;\n    }\n    if (iVar2 < iVar3) break;\n    iVar4 = iVar4 + 1;\n    iVar3 = iVar2;\n    if (iVar4 == param_1) {\n      return iVar4;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    puVar1 = (undefined4 *)*param_2;\n    param_2 = param_2 + 1;\n    iVar2 = ctrl_path_compare(param_3,*puVar1);\n    if (iVar2 == iVar5) {\n      return iVar4;\n    }\n    if (iVar2 < iVar3) break;\n    iVar4 = iVar4 + 1;\n    iVar3 = iVar2;\n    if (iVar4 == param_1) {\n      return iVar4;\n    }\n  }" { (expression_statement "puVar1 = (undefined4 *)*param_2;" (assignment_expression "puVar1 = (undefined4 *)*param_2" identifier = (cast_expression "(undefined4 *)*param_2" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) ;) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) (expression_statement "iVar2 = ctrl_path_compare(param_3,*puVar1);" (assignment_expression "iVar2 = ctrl_path_compare(param_3,*puVar1)" identifier = (call_expression "ctrl_path_compare(param_3,*puVar1)" identifier (argument_list "(param_3,*puVar1)" ( identifier , (pointer_expression "*puVar1" * identifier) )))) ;) (if_statement "if (iVar2 == iVar5) {\n      return iVar4;\n    }" if (parenthesized_expression "(iVar2 == iVar5)" ( (binary_expression "iVar2 == iVar5" identifier == identifier) )) (compound_statement "{\n      return iVar4;\n    }" { (return_statement "return iVar4;" return identifier ;) })) (if_statement "if (iVar2 < iVar3) break;" if (parenthesized_expression "(iVar2 < iVar3)" ( (binary_expression "iVar2 < iVar3" identifier < identifier) )) (break_statement "break;" break ;)) (expression_statement "iVar4 = iVar4 + 1;" (assignment_expression "iVar4 = iVar4 + 1" identifier = (binary_expression "iVar4 + 1" identifier + number_literal)) ;) (expression_statement "iVar3 = iVar2;" (assignment_expression "iVar3 = iVar2" identifier = identifier) ;) (if_statement "if (iVar4 == param_1) {\n      return iVar4;\n    }" if (parenthesized_expression "(iVar4 == param_1)" ( (binary_expression "iVar4 == param_1" identifier == identifier) )) (compound_statement "{\n      return iVar4;\n    }" { (return_statement "return iVar4;" return identifier ;) })) })) (return_statement "return iVar4;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (pointer_expression * IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (return_statement return IDENT ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (return_statement return IDENT ;) })) })) (return_statement return IDENT ;) })))
(function_definition "int FUN_0002c894(int param_1,undefined4 *param_2,undefined4 param_3)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  \n  if (param_1 < 1) {\n    return param_1;\n  }\n  param_2 = (undefined4 *)*param_2;\n  iVar4 = 0;\n  iVar5 = 0x7fffffff;\n  iVar3 = 0;\n  while( true ) {\n    puVar1 = (undefined4 *)*param_2;\n    param_2 = param_2 + 1;\n    iVar2 = ctrl_path_compare(param_3,*puVar1);\n    if (iVar2 == iVar5) {\n      return iVar4;\n    }\n    if (iVar2 < iVar3) break;\n    iVar4 = iVar4 + 1;\n    iVar3 = iVar2;\n    if (iVar4 == param_1) {\n      return iVar4;\n    }\n  }\n  return iVar4;\n}" (primitive_type "int") (function_declarator "FUN_0002c894(int param_1,undefined4 *param_2,undefined4 param_3)" (identifier "FUN_0002c894") (parameter_list "(int param_1,undefined4 *param_2,undefined4 param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 *param_2" (type_identifier "undefined4") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) () ")"))) (compound_statement "{\n  undefined4 *puVar1;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  int iVar5;\n  \n  if (param_1 < 1) {\n    return param_1;\n  }\n  param_2 = (undefined4 *)*param_2;\n  iVar4 = 0;\n  iVar5 = 0x7fffffff;\n  iVar3 = 0;\n  while( true ) {\n    puVar1 = (undefined4 *)*param_2;\n    param_2 = param_2 + 1;\n    iVar2 = ctrl_path_compare(param_3,*puVar1);\n    if (iVar2 == iVar5) {\n      return iVar4;\n    }\n    if (iVar2 < iVar3) break;\n    iVar4 = iVar4 + 1;\n    iVar3 = iVar2;\n    if (iVar4 == param_1) {\n      return iVar4;\n    }\n  }\n  return iVar4;\n}" ({ "{") (declaration "undefined4 *puVar1;" (type_identifier "undefined4") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (if_statement "if (param_1 < 1) {\n    return param_1;\n  }" (if "if") (parenthesized_expression "(param_1 < 1)" (( "(") (binary_expression "param_1 < 1" (identifier "param_1") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n    return param_1;\n  }" ({ "{") (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}"))) (expression_statement "param_2 = (undefined4 *)*param_2;" (assignment_expression "param_2 = (undefined4 *)*param_2" (identifier "param_2") (= "=") (cast_expression "(undefined4 *)*param_2" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_2" (* "*") (identifier "param_2")))) (; ";")) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" (identifier "iVar4") (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar5 = 0x7fffffff;" (assignment_expression "iVar5 = 0x7fffffff" (identifier "iVar5") (= "=") (number_literal "0x7fffffff")) (; ";")) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" (identifier "iVar3") (= "=") (number_literal "0")) (; ";")) (while_statement "while( true ) {\n    puVar1 = (undefined4 *)*param_2;\n    param_2 = param_2 + 1;\n    iVar2 = ctrl_path_compare(param_3,*puVar1);\n    if (iVar2 == iVar5) {\n      return iVar4;\n    }\n    if (iVar2 < iVar3) break;\n    iVar4 = iVar4 + 1;\n    iVar3 = iVar2;\n    if (iVar4 == param_1) {\n      return iVar4;\n    }\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    puVar1 = (undefined4 *)*param_2;\n    param_2 = param_2 + 1;\n    iVar2 = ctrl_path_compare(param_3,*puVar1);\n    if (iVar2 == iVar5) {\n      return iVar4;\n    }\n    if (iVar2 < iVar3) break;\n    iVar4 = iVar4 + 1;\n    iVar3 = iVar2;\n    if (iVar4 == param_1) {\n      return iVar4;\n    }\n  }" ({ "{") (expression_statement "puVar1 = (undefined4 *)*param_2;" (assignment_expression "puVar1 = (undefined4 *)*param_2" (identifier "puVar1") (= "=") (cast_expression "(undefined4 *)*param_2" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_2" (* "*") (identifier "param_2")))) (; ";")) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" (identifier "param_2") (= "=") (binary_expression "param_2 + 1" (identifier "param_2") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "iVar2 = ctrl_path_compare(param_3,*puVar1);" (assignment_expression "iVar2 = ctrl_path_compare(param_3,*puVar1)" (identifier "iVar2") (= "=") (call_expression "ctrl_path_compare(param_3,*puVar1)" (identifier "ctrl_path_compare") (argument_list "(param_3,*puVar1)" (( "(") (identifier "param_3") (, ",") (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) () ")")))) (; ";")) (if_statement "if (iVar2 == iVar5) {\n      return iVar4;\n    }" (if "if") (parenthesized_expression "(iVar2 == iVar5)" (( "(") (binary_expression "iVar2 == iVar5" (identifier "iVar2") (== "==") (identifier "iVar5")) () ")")) (compound_statement "{\n      return iVar4;\n    }" ({ "{") (return_statement "return iVar4;" (return "return") (identifier "iVar4") (; ";")) (} "}"))) (if_statement "if (iVar2 < iVar3) break;" (if "if") (parenthesized_expression "(iVar2 < iVar3)" (( "(") (binary_expression "iVar2 < iVar3" (identifier "iVar2") (< "<") (identifier "iVar3")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "iVar4 = iVar4 + 1;" (assignment_expression "iVar4 = iVar4 + 1" (identifier "iVar4") (= "=") (binary_expression "iVar4 + 1" (identifier "iVar4") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "iVar3 = iVar2;" (assignment_expression "iVar3 = iVar2" (identifier "iVar3") (= "=") (identifier "iVar2")) (; ";")) (if_statement "if (iVar4 == param_1) {\n      return iVar4;\n    }" (if "if") (parenthesized_expression "(iVar4 == param_1)" (( "(") (binary_expression "iVar4 == param_1" (identifier "iVar4") (== "==") (identifier "param_1")) () ")")) (compound_statement "{\n      return iVar4;\n    }" ({ "{") (return_statement "return iVar4;" (return "return") (identifier "iVar4") (; ";")) (} "}"))) (} "}"))) (return_statement "return iVar4;" (return "return") (identifier "iVar4") (; ";")) (} "}")))

/* DWARF original prototype: int ctrl_find_set(controlbox * b, char * path, int start, controlbox *
   b) */

int function_1(type_1 *var_7,char *path,int start,type_1 *b_1)

{
  type_2 *puVar1;
  int var_3;
  int var_5;
  type_2 *var_1;
  type_1 *var_6;
  int var_4;
  
  if ((int)var_7 < 1) {
    return (int)var_7;
  }
  var_1 = *(type_2 **)path;
  var_6 = (type_1 *)0x0;
  var_4 = 0x7fffffff;
  var_5 = 0;
  while( true ) {
    puVar1 = (type_2 *)*var_1;
    var_1 = var_1 + 1;
    var_3 = var_2((char *)start,(char *)*puVar1);
    if (var_3 == var_4) {
      return (int)var_6;
    }
    if (var_3 < var_5) break;
    var_6 = (type_1 *)((int)&var_6->nctrlsets + 1);
    var_5 = var_3;
    if (var_6 == var_7) {
      return (int)var_6;
    }
  }
  return (int)var_6;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (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))) (while_statement condition: (parenthesized_expression (true)) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (pointer_expression argument: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (return_statement (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (break_statement)) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (return_statement (identifier)))))) (return_statement (identifier)))))

int MASKED(int param_1,undefined4 *param_2,undefined4 param_3)

{
  undefined4 *puVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  
  if (param_1 < 1) {
    return param_1;
  }
  param_2 = (undefined4 *)*param_2;
  iVar4 = 0;
  iVar5 = 0x7fffffff;
  iVar3 = 0;
  while( true ) {
    puVar1 = (undefined4 *)*param_2;
    param_2 = param_2 + 1;
    iVar2 = ctrl_path_compare(param_3,*puVar1);
    if (iVar2 == iVar5) {
      return iVar4;
    }
    if (iVar2 < iVar3) break;
    iVar4 = iVar4 + 1;
    iVar3 = iVar2;
    if (iVar4 == param_1) {
      return iVar4;
    }
  }
  return iVar4;
}

