
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

void term_scroll(Terminal *term,int rel,int where)

{
  int iVar1;
  int iVar2;
  
  iVar1 = sblines(term);
  iVar2 = -iVar1;
  if (-1 < rel) {
    if (rel == 0) {
      where = where + term->disptop;
    }
    else {
      where = where - iVar1;
    }
  }
  if (where < iVar2) {
    term->disptop = iVar2;
  }
  else {
    term->disptop = where;
    iVar2 = where;
  }
  if (0 < iVar2) {
    term->disptop = 0;
  }
  update_sbar(term);
  term_update(term);
  return;
}



void term_scroll(int param_1,int param_2,int param_3)

{
  int iVar1;
  int iVar2;
  
  iVar1 = FUN_00044420();
  iVar2 = -iVar1;
  if (-1 < param_2) {
    if (param_2 == 0) {
      param_3 = param_3 + *(int *)(param_1 + 0x10);
    }
    else {
      param_3 = param_3 - iVar1;
    }
  }
  if (param_3 < iVar2) {
    *(int *)(param_1 + 0x10) = iVar2;
  }
  else {
    *(int *)(param_1 + 0x10) = param_3;
    iVar2 = param_3;
  }
  if (0 < iVar2) {
    *(undefined4 *)(param_1 + 0x10) = 0;
  }
  FUN_00044484(param_1);
  term_update(param_1);
  return;
}


lui gp,0x7
addiu gp,gp,-0x3fe8
addu gp,gp,t9
lw t9,-0x7c1c(gp)
addiu sp,sp,-0x28
addiu t9,t9,0x4420
sw gp,0x10(sp)
sw s2,0x20(sp)
or s2,a1,zero
sw s1,0x1c(sp)
or s1,a0,zero
sw s0,0x18(sp)
sw ra,0x24(sp)
bal 0x00044420
_or s0,a2,zero
lw gp,0x10(sp)
bltz s2,0x0005120c
_subu v1,zero,v0
beq s2,zero,0x00051258
_nop
subu s0,s0,v0
slt v0,s0,v1
bne v0,zero,0x0005126c
_nop
sw s0,0x10(s1)
blez s0,0x00051228
_lw t9,-0x7c1c(gp)
sw zero,0x10(s1)
addiu t9,t9,0x4484
bal 0x00044484
_or a0,s1,zero
or a0,s1,zero
lw gp,0x10(sp)
lw ra,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
lw t9,-0x7b30(gp)
b 0x00049830
_addiu sp,sp,0x28
lw v0,0x10(s1)
addu s0,s0,v0
slt v0,s0,v1
beq v0,zero,0x00051218
_nop
sw v1,0x10(s1)
b 0x0005121c
_or s0,v1,zero
(translation_unit "void term_scroll(int param_1,int param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = FUN_00044420();\n  iVar2 = -iVar1;\n  if (-1 < param_2) {\n    if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }\n  }\n  if (param_3 < iVar2) {\n    *(int *)(param_1 + 0x10) = iVar2;\n  }\n  else {\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }\n  if (0 < iVar2) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }\n  FUN_00044484(param_1);\n  term_update(param_1);\n  return;\n}\n\n" (function_definition "void term_scroll(int param_1,int param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = FUN_00044420();\n  iVar2 = -iVar1;\n  if (-1 < param_2) {\n    if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }\n  }\n  if (param_3 < iVar2) {\n    *(int *)(param_1 + 0x10) = iVar2;\n  }\n  else {\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }\n  if (0 < iVar2) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }\n  FUN_00044484(param_1);\n  term_update(param_1);\n  return;\n}" primitive_type (function_declarator "term_scroll(int param_1,int param_2,int param_3)" identifier (parameter_list "(int param_1,int param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = FUN_00044420();\n  iVar2 = -iVar1;\n  if (-1 < param_2) {\n    if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }\n  }\n  if (param_3 < iVar2) {\n    *(int *)(param_1 + 0x10) = iVar2;\n  }\n  else {\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }\n  if (0 < iVar2) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }\n  FUN_00044484(param_1);\n  term_update(param_1);\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "iVar1 = FUN_00044420();" (assignment_expression "iVar1 = FUN_00044420()" identifier = (call_expression "FUN_00044420()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar2 = -iVar1;" (assignment_expression "iVar2 = -iVar1" identifier = (unary_expression "-iVar1" - identifier)) ;) (if_statement "if (-1 < param_2) {\n    if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }\n  }" if (parenthesized_expression "(-1 < param_2)" ( (binary_expression "-1 < param_2" number_literal < identifier) )) (compound_statement "{\n    if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }\n  }" { (if_statement "if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }" { (expression_statement "param_3 = param_3 + *(int *)(param_1 + 0x10);" (assignment_expression "param_3 = param_3 + *(int *)(param_1 + 0x10)" identifier = (binary_expression "param_3 + *(int *)(param_1 + 0x10)" identifier + (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))))) ;) }) (else_clause "else {\n      param_3 = param_3 - iVar1;\n    }" else (compound_statement "{\n      param_3 = param_3 - iVar1;\n    }" { (expression_statement "param_3 = param_3 - iVar1;" (assignment_expression "param_3 = param_3 - iVar1" identifier = (binary_expression "param_3 - iVar1" identifier - identifier)) ;) }))) })) (if_statement "if (param_3 < iVar2) {\n    *(int *)(param_1 + 0x10) = iVar2;\n  }\n  else {\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }" if (parenthesized_expression "(param_3 < iVar2)" ( (binary_expression "param_3 < iVar2" identifier < identifier) )) (compound_statement "{\n    *(int *)(param_1 + 0x10) = iVar2;\n  }" { (expression_statement "*(int *)(param_1 + 0x10) = iVar2;" (assignment_expression "*(int *)(param_1 + 0x10) = iVar2" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = identifier) ;) }) (else_clause "else {\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }" else (compound_statement "{\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }" { (expression_statement "*(int *)(param_1 + 0x10) = param_3;" (assignment_expression "*(int *)(param_1 + 0x10) = param_3" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = identifier) ;) (expression_statement "iVar2 = param_3;" (assignment_expression "iVar2 = param_3" identifier = identifier) ;) }))) (if_statement "if (0 < iVar2) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }" if (parenthesized_expression "(0 < iVar2)" ( (binary_expression "0 < iVar2" number_literal < identifier) )) (compound_statement "{\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }" { (expression_statement "*(undefined4 *)(param_1 + 0x10) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x10) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x10)" * (cast_expression "(undefined4 *)(param_1 + 0x10)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = number_literal) ;) })) (expression_statement "FUN_00044484(param_1);" (call_expression "FUN_00044484(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (expression_statement "term_update(param_1);" (call_expression "term_update(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Enum "anon_enum_32": Some values do not have unique names */\n\nvoid term_scroll(Terminal *term,int rel,int where)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = sblines(term);\n  iVar2 = -iVar1;\n  if (-1 < rel) {\n    if (rel == 0) {\n      where = where + term->disptop;\n    }\n    else {\n      where = where - iVar1;\n    }\n  }\n  if (where < iVar2) {\n    term->disptop = iVar2;\n  }\n  else {\n    term->disptop = where;\n    iVar2 = where;\n  }\n  if (0 < iVar2) {\n    term->disptop = 0;\n  }\n  update_sbar(term);\n  term_update(term);\n  return;\n}\n\n" comment (function_definition "void term_scroll(Terminal *term,int rel,int where)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = sblines(term);\n  iVar2 = -iVar1;\n  if (-1 < rel) {\n    if (rel == 0) {\n      where = where + term->disptop;\n    }\n    else {\n      where = where - iVar1;\n    }\n  }\n  if (where < iVar2) {\n    term->disptop = iVar2;\n  }\n  else {\n    term->disptop = where;\n    iVar2 = where;\n  }\n  if (0 < iVar2) {\n    term->disptop = 0;\n  }\n  update_sbar(term);\n  term_update(term);\n  return;\n}" primitive_type (function_declarator "term_scroll(Terminal *term,int rel,int where)" identifier (parameter_list "(Terminal *term,int rel,int where)" ( (parameter_declaration "Terminal *term" type_identifier (pointer_declarator "*term" * identifier)) , (parameter_declaration "int rel" primitive_type identifier) , (parameter_declaration "int where" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = sblines(term);\n  iVar2 = -iVar1;\n  if (-1 < rel) {\n    if (rel == 0) {\n      where = where + term->disptop;\n    }\n    else {\n      where = where - iVar1;\n    }\n  }\n  if (where < iVar2) {\n    term->disptop = iVar2;\n  }\n  else {\n    term->disptop = where;\n    iVar2 = where;\n  }\n  if (0 < iVar2) {\n    term->disptop = 0;\n  }\n  update_sbar(term);\n  term_update(term);\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "iVar1 = sblines(term);" (assignment_expression "iVar1 = sblines(term)" identifier = (call_expression "sblines(term)" identifier (argument_list "(term)" ( identifier )))) ;) (expression_statement "iVar2 = -iVar1;" (assignment_expression "iVar2 = -iVar1" identifier = (unary_expression "-iVar1" - identifier)) ;) (if_statement "if (-1 < rel) {\n    if (rel == 0) {\n      where = where + term->disptop;\n    }\n    else {\n      where = where - iVar1;\n    }\n  }" if (parenthesized_expression "(-1 < rel)" ( (binary_expression "-1 < rel" number_literal < identifier) )) (compound_statement "{\n    if (rel == 0) {\n      where = where + term->disptop;\n    }\n    else {\n      where = where - iVar1;\n    }\n  }" { (if_statement "if (rel == 0) {\n      where = where + term->disptop;\n    }\n    else {\n      where = where - iVar1;\n    }" if (parenthesized_expression "(rel == 0)" ( (binary_expression "rel == 0" identifier == number_literal) )) (compound_statement "{\n      where = where + term->disptop;\n    }" { (expression_statement "where = where + term->disptop;" (assignment_expression "where = where + term->disptop" identifier = (binary_expression "where + term->disptop" identifier + (field_expression "term->disptop" identifier -> field_identifier))) ;) }) (else_clause "else {\n      where = where - iVar1;\n    }" else (compound_statement "{\n      where = where - iVar1;\n    }" { (expression_statement "where = where - iVar1;" (assignment_expression "where = where - iVar1" identifier = (binary_expression "where - iVar1" identifier - identifier)) ;) }))) })) (if_statement "if (where < iVar2) {\n    term->disptop = iVar2;\n  }\n  else {\n    term->disptop = where;\n    iVar2 = where;\n  }" if (parenthesized_expression "(where < iVar2)" ( (binary_expression "where < iVar2" identifier < identifier) )) (compound_statement "{\n    term->disptop = iVar2;\n  }" { (expression_statement "term->disptop = iVar2;" (assignment_expression "term->disptop = iVar2" (field_expression "term->disptop" identifier -> field_identifier) = identifier) ;) }) (else_clause "else {\n    term->disptop = where;\n    iVar2 = where;\n  }" else (compound_statement "{\n    term->disptop = where;\n    iVar2 = where;\n  }" { (expression_statement "term->disptop = where;" (assignment_expression "term->disptop = where" (field_expression "term->disptop" identifier -> field_identifier) = identifier) ;) (expression_statement "iVar2 = where;" (assignment_expression "iVar2 = where" identifier = identifier) ;) }))) (if_statement "if (0 < iVar2) {\n    term->disptop = 0;\n  }" if (parenthesized_expression "(0 < iVar2)" ( (binary_expression "0 < iVar2" number_literal < identifier) )) (compound_statement "{\n    term->disptop = 0;\n  }" { (expression_statement "term->disptop = 0;" (assignment_expression "term->disptop = 0" (field_expression "term->disptop" identifier -> field_identifier) = number_literal) ;) })) (expression_statement "update_sbar(term);" (call_expression "update_sbar(term)" identifier (argument_list "(term)" ( identifier ))) ;) (expression_statement "term_update(term);" (call_expression "term_update(term)" identifier (argument_list "(term)" ( identifier ))) ;) (return_statement "return;" return ;) })))
(translation_unit "void term_scroll(int param_1,int param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = FUN_00044420();\n  iVar2 = -iVar1;\n  if (-1 < param_2) {\n    if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }\n  }\n  if (param_3 < iVar2) {\n    *(int *)(param_1 + 0x10) = iVar2;\n  }\n  else {\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }\n  if (0 < iVar2) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }\n  FUN_00044484(param_1);\n  term_update(param_1);\n  return;\n}\n\n" (function_definition "void term_scroll(int param_1,int param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = FUN_00044420();\n  iVar2 = -iVar1;\n  if (-1 < param_2) {\n    if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }\n  }\n  if (param_3 < iVar2) {\n    *(int *)(param_1 + 0x10) = iVar2;\n  }\n  else {\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }\n  if (0 < iVar2) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }\n  FUN_00044484(param_1);\n  term_update(param_1);\n  return;\n}" primitive_type (function_declarator "term_scroll(int param_1,int param_2,int param_3)" identifier (parameter_list "(int param_1,int param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = FUN_00044420();\n  iVar2 = -iVar1;\n  if (-1 < param_2) {\n    if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }\n  }\n  if (param_3 < iVar2) {\n    *(int *)(param_1 + 0x10) = iVar2;\n  }\n  else {\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }\n  if (0 < iVar2) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }\n  FUN_00044484(param_1);\n  term_update(param_1);\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "iVar1 = FUN_00044420();" (assignment_expression "iVar1 = FUN_00044420()" identifier = (call_expression "FUN_00044420()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar2 = -iVar1;" (assignment_expression "iVar2 = -iVar1" identifier = (unary_expression "-iVar1" - identifier)) ;) (if_statement "if (-1 < param_2) {\n    if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }\n  }" if (parenthesized_expression "(-1 < param_2)" ( (binary_expression "-1 < param_2" number_literal < identifier) )) (compound_statement "{\n    if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }\n  }" { (if_statement "if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }" { (expression_statement "param_3 = param_3 + *(int *)(param_1 + 0x10);" (assignment_expression "param_3 = param_3 + *(int *)(param_1 + 0x10)" identifier = (binary_expression "param_3 + *(int *)(param_1 + 0x10)" identifier + (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))))) ;) }) (else_clause "else {\n      param_3 = param_3 - iVar1;\n    }" else (compound_statement "{\n      param_3 = param_3 - iVar1;\n    }" { (expression_statement "param_3 = param_3 - iVar1;" (assignment_expression "param_3 = param_3 - iVar1" identifier = (binary_expression "param_3 - iVar1" identifier - identifier)) ;) }))) })) (if_statement "if (param_3 < iVar2) {\n    *(int *)(param_1 + 0x10) = iVar2;\n  }\n  else {\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }" if (parenthesized_expression "(param_3 < iVar2)" ( (binary_expression "param_3 < iVar2" identifier < identifier) )) (compound_statement "{\n    *(int *)(param_1 + 0x10) = iVar2;\n  }" { (expression_statement "*(int *)(param_1 + 0x10) = iVar2;" (assignment_expression "*(int *)(param_1 + 0x10) = iVar2" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = identifier) ;) }) (else_clause "else {\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }" else (compound_statement "{\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }" { (expression_statement "*(int *)(param_1 + 0x10) = param_3;" (assignment_expression "*(int *)(param_1 + 0x10) = param_3" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = identifier) ;) (expression_statement "iVar2 = param_3;" (assignment_expression "iVar2 = param_3" identifier = identifier) ;) }))) (if_statement "if (0 < iVar2) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }" if (parenthesized_expression "(0 < iVar2)" ( (binary_expression "0 < iVar2" number_literal < identifier) )) (compound_statement "{\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }" { (expression_statement "*(undefined4 *)(param_1 + 0x10) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x10) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x10)" * (cast_expression "(undefined4 *)(param_1 + 0x10)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = number_literal) ;) })) (expression_statement "FUN_00044484(param_1);" (call_expression "FUN_00044484(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (expression_statement "term_update(param_1);" (call_expression "term_update(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (unary_expression - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) }))) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return ;) })))
(function_definition "void term_scroll(int param_1,int param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = FUN_00044420();\n  iVar2 = -iVar1;\n  if (-1 < param_2) {\n    if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }\n  }\n  if (param_3 < iVar2) {\n    *(int *)(param_1 + 0x10) = iVar2;\n  }\n  else {\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }\n  if (0 < iVar2) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }\n  FUN_00044484(param_1);\n  term_update(param_1);\n  return;\n}" (primitive_type "void") (function_declarator "term_scroll(int param_1,int param_2,int param_3)" (identifier "term_scroll") (parameter_list "(int param_1,int param_2,int param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  iVar1 = FUN_00044420();\n  iVar2 = -iVar1;\n  if (-1 < param_2) {\n    if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }\n  }\n  if (param_3 < iVar2) {\n    *(int *)(param_1 + 0x10) = iVar2;\n  }\n  else {\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }\n  if (0 < iVar2) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }\n  FUN_00044484(param_1);\n  term_update(param_1);\n  return;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (expression_statement "iVar1 = FUN_00044420();" (assignment_expression "iVar1 = FUN_00044420()" (identifier "iVar1") (= "=") (call_expression "FUN_00044420()" (identifier "FUN_00044420") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "iVar2 = -iVar1;" (assignment_expression "iVar2 = -iVar1" (identifier "iVar2") (= "=") (unary_expression "-iVar1" (- "-") (identifier "iVar1"))) (; ";")) (if_statement "if (-1 < param_2) {\n    if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }\n  }" (if "if") (parenthesized_expression "(-1 < param_2)" (( "(") (binary_expression "-1 < param_2" (number_literal "-1") (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n    if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }\n  }" ({ "{") (if_statement "if (param_2 == 0) {\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }\n    else {\n      param_3 = param_3 - iVar1;\n    }" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      param_3 = param_3 + *(int *)(param_1 + 0x10);\n    }" ({ "{") (expression_statement "param_3 = param_3 + *(int *)(param_1 + 0x10);" (assignment_expression "param_3 = param_3 + *(int *)(param_1 + 0x10)" (identifier "param_3") (= "=") (binary_expression "param_3 + *(int *)(param_1 + 0x10)" (identifier "param_3") (+ "+") (pointer_expression "*(int *)(param_1 + 0x10)" (* "*") (cast_expression "(int *)(param_1 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))))) (; ";")) (} "}")) (else_clause "else {\n      param_3 = param_3 - iVar1;\n    }" (else "else") (compound_statement "{\n      param_3 = param_3 - iVar1;\n    }" ({ "{") (expression_statement "param_3 = param_3 - iVar1;" (assignment_expression "param_3 = param_3 - iVar1" (identifier "param_3") (= "=") (binary_expression "param_3 - iVar1" (identifier "param_3") (- "-") (identifier "iVar1"))) (; ";")) (} "}")))) (} "}"))) (if_statement "if (param_3 < iVar2) {\n    *(int *)(param_1 + 0x10) = iVar2;\n  }\n  else {\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }" (if "if") (parenthesized_expression "(param_3 < iVar2)" (( "(") (binary_expression "param_3 < iVar2" (identifier "param_3") (< "<") (identifier "iVar2")) () ")")) (compound_statement "{\n    *(int *)(param_1 + 0x10) = iVar2;\n  }" ({ "{") (expression_statement "*(int *)(param_1 + 0x10) = iVar2;" (assignment_expression "*(int *)(param_1 + 0x10) = iVar2" (pointer_expression "*(int *)(param_1 + 0x10)" (* "*") (cast_expression "(int *)(param_1 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (= "=") (identifier "iVar2")) (; ";")) (} "}")) (else_clause "else {\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }" (else "else") (compound_statement "{\n    *(int *)(param_1 + 0x10) = param_3;\n    iVar2 = param_3;\n  }" ({ "{") (expression_statement "*(int *)(param_1 + 0x10) = param_3;" (assignment_expression "*(int *)(param_1 + 0x10) = param_3" (pointer_expression "*(int *)(param_1 + 0x10)" (* "*") (cast_expression "(int *)(param_1 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (= "=") (identifier "param_3")) (; ";")) (expression_statement "iVar2 = param_3;" (assignment_expression "iVar2 = param_3" (identifier "iVar2") (= "=") (identifier "param_3")) (; ";")) (} "}")))) (if_statement "if (0 < iVar2) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }" (if "if") (parenthesized_expression "(0 < iVar2)" (( "(") (binary_expression "0 < iVar2" (number_literal "0") (< "<") (identifier "iVar2")) () ")")) (compound_statement "{\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }" ({ "{") (expression_statement "*(undefined4 *)(param_1 + 0x10) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x10) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x10)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x10)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (= "=") (number_literal "0")) (; ";")) (} "}"))) (expression_statement "FUN_00044484(param_1);" (call_expression "FUN_00044484(param_1)" (identifier "FUN_00044484") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (expression_statement "term_update(param_1);" (call_expression "term_update(param_1)" (identifier "term_update") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))
(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: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (unary_expression argument: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement))))

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

{
  int iVar1;
  int iVar2;
  
  iVar1 = FUN_00044420();
  iVar2 = -iVar1;
  if (-1 < param_2) {
    if (param_2 == 0) {
      param_3 = param_3 + *(int *)(param_1 + 0x10);
    }
    else {
      param_3 = param_3 - iVar1;
    }
  }
  if (param_3 < iVar2) {
    *(int *)(param_1 + 0x10) = iVar2;
  }
  else {
    *(int *)(param_1 + 0x10) = param_3;
    iVar2 = param_3;
  }
  if (0 < iVar2) {
    *(undefined4 *)(param_1 + 0x10) = 0;
  }
  FUN_00044484(param_1);
  term_update(param_1);
  return;
}

