
/* 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);
  iVar1 = -iVar1;
  if (rel < 0) {
    iVar2 = 0;
  }
  else {
    iVar2 = iVar1;
    if (rel == 0) {
      iVar2 = term->disptop;
    }
  }
  if (iVar1 <= iVar2 + where) {
    iVar1 = iVar2 + where;
  }
  term->disptop = iVar1;
  if (0 < iVar1) {
    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_00047f94();
  iVar1 = -iVar1;
  if (param_2 < 0) {
    iVar2 = 0;
  }
  else {
    iVar2 = iVar1;
    if (param_2 == 0) {
      iVar2 = *(int *)(param_1 + 0x10);
    }
  }
  if (iVar1 <= iVar2 + param_3) {
    iVar1 = iVar2 + param_3;
  }
  *(int *)(param_1 + 0x10) = iVar1;
  if (0 < iVar1) {
    *(undefined4 *)(param_1 + 0x10) = 0;
  }
  FUN_00048000(param_1);
  term_update(param_1);
  return;
}


lui gp,0x7
addiu gp,gp,0x204
addu gp,gp,t9
addiu sp,sp,-0x28
sw ra,0x24(sp)
sw s2,0x20(sp)
sw s1,0x1c(sp)
sw s0,0x18(sp)
sw gp,0x10(sp)
or s0,a0,zero
or s1,a1,zero
or s2,a2,zero
lw t9,-0x7cd0(gp)
addiu t9,t9,0x7f94
bal 0x00047f94
_nop
lw gp,0x10(sp)
bltz s1,0x00055030
_subu v0,zero,v0
beq s1,zero,0x00055028
_nop
b 0x00055034
_or a2,v0,zero
b 0x00055034
_lw a2,0x10(s0)
or a2,zero,zero
addu a2,a2,s2
slt v1,a2,v0
movz v0,a2,v1
blez v0,0x0005504c
_sw v0,0x10(s0)
sw zero,0x10(s0)
or a0,s0,zero
lw t9,-0x7bb0(gp)
addiu t9,t9,-0x8000
bal 0x00048000
_nop
lw gp,0x10(sp)
or a0,s0,zero
lw t9,-0x7b68(gp)
bal 0x0004d5d4
_nop
lw gp,0x10(sp)
lw ra,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x28
(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_00047f94();\n  iVar1 = -iVar1;\n  if (param_2 < 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }\n  if (iVar1 <= iVar2 + param_3) {\n    iVar1 = iVar2 + param_3;\n  }\n  *(int *)(param_1 + 0x10) = iVar1;\n  if (0 < iVar1) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }\n  FUN_00048000(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_00047f94();\n  iVar1 = -iVar1;\n  if (param_2 < 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }\n  if (iVar1 <= iVar2 + param_3) {\n    iVar1 = iVar2 + param_3;\n  }\n  *(int *)(param_1 + 0x10) = iVar1;\n  if (0 < iVar1) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }\n  FUN_00048000(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_00047f94();\n  iVar1 = -iVar1;\n  if (param_2 < 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }\n  if (iVar1 <= iVar2 + param_3) {\n    iVar1 = iVar2 + param_3;\n  }\n  *(int *)(param_1 + 0x10) = iVar1;\n  if (0 < iVar1) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }\n  FUN_00048000(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_00047f94();" (assignment_expression "iVar1 = FUN_00047f94()" identifier = (call_expression "FUN_00047f94()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = -iVar1;" (assignment_expression "iVar1 = -iVar1" identifier = (unary_expression "-iVar1" - identifier)) ;) (if_statement "if (param_2 < 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }" if (parenthesized_expression "(param_2 < 0)" ( (binary_expression "param_2 < 0" identifier < number_literal) )) (compound_statement "{\n    iVar2 = 0;\n  }" { (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }" else (compound_statement "{\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }" { (expression_statement "iVar2 = iVar1;" (assignment_expression "iVar2 = iVar1" identifier = identifier) ;) (if_statement "if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar2 = *(int *)(param_1 + 0x10);\n    }" { (expression_statement "iVar2 = *(int *)(param_1 + 0x10);" (assignment_expression "iVar2 = *(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) ))))) ;) })) }))) (if_statement "if (iVar1 <= iVar2 + param_3) {\n    iVar1 = iVar2 + param_3;\n  }" if (parenthesized_expression "(iVar1 <= iVar2 + param_3)" ( (binary_expression "iVar1 <= iVar2 + param_3" identifier <= (binary_expression "iVar2 + param_3" identifier + identifier)) )) (compound_statement "{\n    iVar1 = iVar2 + param_3;\n  }" { (expression_statement "iVar1 = iVar2 + param_3;" (assignment_expression "iVar1 = iVar2 + param_3" identifier = (binary_expression "iVar2 + param_3" identifier + identifier)) ;) })) (expression_statement "*(int *)(param_1 + 0x10) = iVar1;" (assignment_expression "*(int *)(param_1 + 0x10) = iVar1" (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) ;) (if_statement "if (0 < iVar1) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }" if (parenthesized_expression "(0 < iVar1)" ( (binary_expression "0 < iVar1" 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_00048000(param_1);" (call_expression "FUN_00048000(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  iVar1 = -iVar1;\n  if (rel < 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar2 = iVar1;\n    if (rel == 0) {\n      iVar2 = term->disptop;\n    }\n  }\n  if (iVar1 <= iVar2 + where) {\n    iVar1 = iVar2 + where;\n  }\n  term->disptop = iVar1;\n  if (0 < iVar1) {\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  iVar1 = -iVar1;\n  if (rel < 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar2 = iVar1;\n    if (rel == 0) {\n      iVar2 = term->disptop;\n    }\n  }\n  if (iVar1 <= iVar2 + where) {\n    iVar1 = iVar2 + where;\n  }\n  term->disptop = iVar1;\n  if (0 < iVar1) {\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  iVar1 = -iVar1;\n  if (rel < 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar2 = iVar1;\n    if (rel == 0) {\n      iVar2 = term->disptop;\n    }\n  }\n  if (iVar1 <= iVar2 + where) {\n    iVar1 = iVar2 + where;\n  }\n  term->disptop = iVar1;\n  if (0 < iVar1) {\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 "iVar1 = -iVar1;" (assignment_expression "iVar1 = -iVar1" identifier = (unary_expression "-iVar1" - identifier)) ;) (if_statement "if (rel < 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar2 = iVar1;\n    if (rel == 0) {\n      iVar2 = term->disptop;\n    }\n  }" if (parenthesized_expression "(rel < 0)" ( (binary_expression "rel < 0" identifier < number_literal) )) (compound_statement "{\n    iVar2 = 0;\n  }" { (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    iVar2 = iVar1;\n    if (rel == 0) {\n      iVar2 = term->disptop;\n    }\n  }" else (compound_statement "{\n    iVar2 = iVar1;\n    if (rel == 0) {\n      iVar2 = term->disptop;\n    }\n  }" { (expression_statement "iVar2 = iVar1;" (assignment_expression "iVar2 = iVar1" identifier = identifier) ;) (if_statement "if (rel == 0) {\n      iVar2 = term->disptop;\n    }" if (parenthesized_expression "(rel == 0)" ( (binary_expression "rel == 0" identifier == number_literal) )) (compound_statement "{\n      iVar2 = term->disptop;\n    }" { (expression_statement "iVar2 = term->disptop;" (assignment_expression "iVar2 = term->disptop" identifier = (field_expression "term->disptop" identifier -> field_identifier)) ;) })) }))) (if_statement "if (iVar1 <= iVar2 + where) {\n    iVar1 = iVar2 + where;\n  }" if (parenthesized_expression "(iVar1 <= iVar2 + where)" ( (binary_expression "iVar1 <= iVar2 + where" identifier <= (binary_expression "iVar2 + where" identifier + identifier)) )) (compound_statement "{\n    iVar1 = iVar2 + where;\n  }" { (expression_statement "iVar1 = iVar2 + where;" (assignment_expression "iVar1 = iVar2 + where" identifier = (binary_expression "iVar2 + where" identifier + identifier)) ;) })) (expression_statement "term->disptop = iVar1;" (assignment_expression "term->disptop = iVar1" (field_expression "term->disptop" identifier -> field_identifier) = identifier) ;) (if_statement "if (0 < iVar1) {\n    term->disptop = 0;\n  }" if (parenthesized_expression "(0 < iVar1)" ( (binary_expression "0 < iVar1" 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_00047f94();\n  iVar1 = -iVar1;\n  if (param_2 < 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }\n  if (iVar1 <= iVar2 + param_3) {\n    iVar1 = iVar2 + param_3;\n  }\n  *(int *)(param_1 + 0x10) = iVar1;\n  if (0 < iVar1) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }\n  FUN_00048000(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_00047f94();\n  iVar1 = -iVar1;\n  if (param_2 < 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }\n  if (iVar1 <= iVar2 + param_3) {\n    iVar1 = iVar2 + param_3;\n  }\n  *(int *)(param_1 + 0x10) = iVar1;\n  if (0 < iVar1) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }\n  FUN_00048000(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_00047f94();\n  iVar1 = -iVar1;\n  if (param_2 < 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }\n  if (iVar1 <= iVar2 + param_3) {\n    iVar1 = iVar2 + param_3;\n  }\n  *(int *)(param_1 + 0x10) = iVar1;\n  if (0 < iVar1) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }\n  FUN_00048000(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_00047f94();" (assignment_expression "iVar1 = FUN_00047f94()" identifier = (call_expression "FUN_00047f94()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = -iVar1;" (assignment_expression "iVar1 = -iVar1" identifier = (unary_expression "-iVar1" - identifier)) ;) (if_statement "if (param_2 < 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }" if (parenthesized_expression "(param_2 < 0)" ( (binary_expression "param_2 < 0" identifier < number_literal) )) (compound_statement "{\n    iVar2 = 0;\n  }" { (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }" else (compound_statement "{\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }" { (expression_statement "iVar2 = iVar1;" (assignment_expression "iVar2 = iVar1" identifier = identifier) ;) (if_statement "if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar2 = *(int *)(param_1 + 0x10);\n    }" { (expression_statement "iVar2 = *(int *)(param_1 + 0x10);" (assignment_expression "iVar2 = *(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) ))))) ;) })) }))) (if_statement "if (iVar1 <= iVar2 + param_3) {\n    iVar1 = iVar2 + param_3;\n  }" if (parenthesized_expression "(iVar1 <= iVar2 + param_3)" ( (binary_expression "iVar1 <= iVar2 + param_3" identifier <= (binary_expression "iVar2 + param_3" identifier + identifier)) )) (compound_statement "{\n    iVar1 = iVar2 + param_3;\n  }" { (expression_statement "iVar1 = iVar2 + param_3;" (assignment_expression "iVar1 = iVar2 + param_3" identifier = (binary_expression "iVar2 + param_3" identifier + identifier)) ;) })) (expression_statement "*(int *)(param_1 + 0x10) = iVar1;" (assignment_expression "*(int *)(param_1 + 0x10) = iVar1" (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) ;) (if_statement "if (0 < iVar1) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }" if (parenthesized_expression "(0 < iVar1)" ( (binary_expression "0 < iVar1" 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_00048000(param_1);" (call_expression "FUN_00048000(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 IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) })) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= (binary_expression IDENT + IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = 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_00047f94();\n  iVar1 = -iVar1;\n  if (param_2 < 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }\n  if (iVar1 <= iVar2 + param_3) {\n    iVar1 = iVar2 + param_3;\n  }\n  *(int *)(param_1 + 0x10) = iVar1;\n  if (0 < iVar1) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }\n  FUN_00048000(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_00047f94();\n  iVar1 = -iVar1;\n  if (param_2 < 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }\n  if (iVar1 <= iVar2 + param_3) {\n    iVar1 = iVar2 + param_3;\n  }\n  *(int *)(param_1 + 0x10) = iVar1;\n  if (0 < iVar1) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }\n  FUN_00048000(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_00047f94();" (assignment_expression "iVar1 = FUN_00047f94()" (identifier "iVar1") (= "=") (call_expression "FUN_00047f94()" (identifier "FUN_00047f94") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "iVar1 = -iVar1;" (assignment_expression "iVar1 = -iVar1" (identifier "iVar1") (= "=") (unary_expression "-iVar1" (- "-") (identifier "iVar1"))) (; ";")) (if_statement "if (param_2 < 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }" (if "if") (parenthesized_expression "(param_2 < 0)" (( "(") (binary_expression "param_2 < 0" (identifier "param_2") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n    iVar2 = 0;\n  }" ({ "{") (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" (identifier "iVar2") (= "=") (number_literal "0")) (; ";")) (} "}")) (else_clause "else {\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }" (else "else") (compound_statement "{\n    iVar2 = iVar1;\n    if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }\n  }" ({ "{") (expression_statement "iVar2 = iVar1;" (assignment_expression "iVar2 = iVar1" (identifier "iVar2") (= "=") (identifier "iVar1")) (; ";")) (if_statement "if (param_2 == 0) {\n      iVar2 = *(int *)(param_1 + 0x10);\n    }" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      iVar2 = *(int *)(param_1 + 0x10);\n    }" ({ "{") (expression_statement "iVar2 = *(int *)(param_1 + 0x10);" (assignment_expression "iVar2 = *(int *)(param_1 + 0x10)" (identifier "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")) () ")"))))) (; ";")) (} "}"))) (} "}")))) (if_statement "if (iVar1 <= iVar2 + param_3) {\n    iVar1 = iVar2 + param_3;\n  }" (if "if") (parenthesized_expression "(iVar1 <= iVar2 + param_3)" (( "(") (binary_expression "iVar1 <= iVar2 + param_3" (identifier "iVar1") (<= "<=") (binary_expression "iVar2 + param_3" (identifier "iVar2") (+ "+") (identifier "param_3"))) () ")")) (compound_statement "{\n    iVar1 = iVar2 + param_3;\n  }" ({ "{") (expression_statement "iVar1 = iVar2 + param_3;" (assignment_expression "iVar1 = iVar2 + param_3" (identifier "iVar1") (= "=") (binary_expression "iVar2 + param_3" (identifier "iVar2") (+ "+") (identifier "param_3"))) (; ";")) (} "}"))) (expression_statement "*(int *)(param_1 + 0x10) = iVar1;" (assignment_expression "*(int *)(param_1 + 0x10) = iVar1" (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 "iVar1")) (; ";")) (if_statement "if (0 < iVar1) {\n    *(undefined4 *)(param_1 + 0x10) = 0;\n  }" (if "if") (parenthesized_expression "(0 < iVar1)" (( "(") (binary_expression "0 < iVar1" (number_literal "0") (< "<") (identifier "iVar1")) () ")")) (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_00048000(param_1);" (call_expression "FUN_00048000(param_1)" (identifier "FUN_00048000") (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: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_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)))))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))))) (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))) (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_00047f94();
  iVar1 = -iVar1;
  if (param_2 < 0) {
    iVar2 = 0;
  }
  else {
    iVar2 = iVar1;
    if (param_2 == 0) {
      iVar2 = *(int *)(param_1 + 0x10);
    }
  }
  if (iVar1 <= iVar2 + param_3) {
    iVar1 = iVar2 + param_3;
  }
  *(int *)(param_1 + 0x10) = iVar1;
  if (0 < iVar1) {
    *(undefined4 *)(param_1 + 0x10) = 0;
  }
  FUN_00048000(param_1);
  term_update(param_1);
  return;
}

