
int serial_send(void *handle,char *buf,int len)

{
  int iVar1;
  Serial serial;
  
  if (-1 < *(int *)((int)handle + 4)) {
    (*(code *)PTR_bufchain_add_000bd22c)((int)handle + 0x10);
    serial_try_write((Serial)handle);
    iVar1 = (*(code *)PTR_bufchain_size_000bd230)((int)handle + 0x10);
    return iVar1;
  }
  return 0;
}



undefined4 FUN_00081e78(int param_1)

{
  undefined4 uVar1;
  
  if (-1 < *(int *)(param_1 + 4)) {
    (*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);
    FUN_00081ac8(param_1);
    uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);
    return uVar1;
  }
  return 0;
}


lui gp,0x4
addiu gp,gp,0x3358
addu gp,gp,t9
lw v0,0x4(a0)
bltz v0,0x00081efc
_lw t9,-0x7fa4(gp)
addiu sp,sp,-0x28
sw ra,0x24(sp)
sw s1,0x20(sp)
sw s0,0x1c(sp)
sw gp,0x10(sp)
or s0,a0,zero
addiu s1,a0,0x10
or a0,s1,zero
jalr t9
_nop
lw gp,0x10(sp)
or a0,s0,zero
lw t9,-0x7fc8(gp)
addiu t9,t9,0x1ac8
bal 0x00081ac8
_nop
lw gp,0x10(sp)
or a0,s1,zero
lw t9,-0x7fa0(gp)
jalr t9
_nop
lw gp,0x10(sp)
lw ra,0x24(sp)
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x28
jr ra
_or v0,zero,zero
(translation_unit "undefined4 FUN_00081e78(int param_1)\n\n{\n  undefined4 uVar1;\n  \n  if (-1 < *(int *)(param_1 + 4)) {\n    (*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);\n    FUN_00081ac8(param_1);\n    uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);\n    return uVar1;\n  }\n  return 0;\n}\n\n" (function_definition "undefined4 FUN_00081e78(int param_1)\n\n{\n  undefined4 uVar1;\n  \n  if (-1 < *(int *)(param_1 + 4)) {\n    (*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);\n    FUN_00081ac8(param_1);\n    uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);\n    return uVar1;\n  }\n  return 0;\n}" type_identifier (function_declarator "FUN_00081e78(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  undefined4 uVar1;\n  \n  if (-1 < *(int *)(param_1 + 4)) {\n    (*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);\n    FUN_00081ac8(param_1);\n    uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);\n    return uVar1;\n  }\n  return 0;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (if_statement "if (-1 < *(int *)(param_1 + 4)) {\n    (*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);\n    FUN_00081ac8(param_1);\n    uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);\n    return uVar1;\n  }" if (parenthesized_expression "(-1 < *(int *)(param_1 + 4))" ( (binary_expression "-1 < *(int *)(param_1 + 4)" number_literal < (pointer_expression "*(int *)(param_1 + 4)" * (cast_expression "(int *)(param_1 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) ))))) )) (compound_statement "{\n    (*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);\n    FUN_00081ac8(param_1);\n    uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);\n    return uVar1;\n  }" { (expression_statement "(*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);" (call_expression "(*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10)" (parenthesized_expression "(*(code *)PTR_bufchain_add_000bd22c)" ( (pointer_expression "*(code *)PTR_bufchain_add_000bd22c" * (cast_expression "(code *)PTR_bufchain_add_000bd22c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))) ;) (expression_statement "FUN_00081ac8(param_1);" (call_expression "FUN_00081ac8(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (expression_statement "uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);" (assignment_expression "uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10)" identifier = (call_expression "(*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10)" (parenthesized_expression "(*(code *)PTR_bufchain_size_000bd230)" ( (pointer_expression "*(code *)PTR_bufchain_size_000bd230" * (cast_expression "(code *)PTR_bufchain_size_000bd230" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) ;) (return_statement "return uVar1;" return identifier ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "int serial_send(void *handle,char *buf,int len)\n\n{\n  int iVar1;\n  Serial serial;\n  \n  if (-1 < *(int *)((int)handle + 4)) {\n    (*(code *)PTR_bufchain_add_000bd22c)((int)handle + 0x10);\n    serial_try_write((Serial)handle);\n    iVar1 = (*(code *)PTR_bufchain_size_000bd230)((int)handle + 0x10);\n    return iVar1;\n  }\n  return 0;\n}\n\n" (function_definition "int serial_send(void *handle,char *buf,int len)\n\n{\n  int iVar1;\n  Serial serial;\n  \n  if (-1 < *(int *)((int)handle + 4)) {\n    (*(code *)PTR_bufchain_add_000bd22c)((int)handle + 0x10);\n    serial_try_write((Serial)handle);\n    iVar1 = (*(code *)PTR_bufchain_size_000bd230)((int)handle + 0x10);\n    return iVar1;\n  }\n  return 0;\n}" primitive_type (function_declarator "serial_send(void *handle,char *buf,int len)" identifier (parameter_list "(void *handle,char *buf,int len)" ( (parameter_declaration "void *handle" primitive_type (pointer_declarator "*handle" * identifier)) , (parameter_declaration "char *buf" primitive_type (pointer_declarator "*buf" * identifier)) , (parameter_declaration "int len" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  Serial serial;\n  \n  if (-1 < *(int *)((int)handle + 4)) {\n    (*(code *)PTR_bufchain_add_000bd22c)((int)handle + 0x10);\n    serial_try_write((Serial)handle);\n    iVar1 = (*(code *)PTR_bufchain_size_000bd230)((int)handle + 0x10);\n    return iVar1;\n  }\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "Serial serial;" type_identifier identifier ;) (if_statement "if (-1 < *(int *)((int)handle + 4)) {\n    (*(code *)PTR_bufchain_add_000bd22c)((int)handle + 0x10);\n    serial_try_write((Serial)handle);\n    iVar1 = (*(code *)PTR_bufchain_size_000bd230)((int)handle + 0x10);\n    return iVar1;\n  }" if (parenthesized_expression "(-1 < *(int *)((int)handle + 4))" ( (binary_expression "-1 < *(int *)((int)handle + 4)" number_literal < (pointer_expression "*(int *)((int)handle + 4)" * (cast_expression "(int *)((int)handle + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)handle + 4)" ( (binary_expression "(int)handle + 4" (cast_expression "(int)handle" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) )) (compound_statement "{\n    (*(code *)PTR_bufchain_add_000bd22c)((int)handle + 0x10);\n    serial_try_write((Serial)handle);\n    iVar1 = (*(code *)PTR_bufchain_size_000bd230)((int)handle + 0x10);\n    return iVar1;\n  }" { (expression_statement "(*(code *)PTR_bufchain_add_000bd22c)((int)handle + 0x10);" (call_expression "(*(code *)PTR_bufchain_add_000bd22c)((int)handle + 0x10)" (parenthesized_expression "(*(code *)PTR_bufchain_add_000bd22c)" ( (pointer_expression "*(code *)PTR_bufchain_add_000bd22c" * (cast_expression "(code *)PTR_bufchain_add_000bd22c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "((int)handle + 0x10)" ( (binary_expression "(int)handle + 0x10" (cast_expression "(int)handle" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))) ;) (expression_statement "serial_try_write((Serial)handle);" (call_expression "serial_try_write((Serial)handle)" identifier (argument_list "((Serial)handle)" ( (cast_expression "(Serial)handle" ( (type_descriptor "Serial" type_identifier) ) identifier) ))) ;) (expression_statement "iVar1 = (*(code *)PTR_bufchain_size_000bd230)((int)handle + 0x10);" (assignment_expression "iVar1 = (*(code *)PTR_bufchain_size_000bd230)((int)handle + 0x10)" identifier = (call_expression "(*(code *)PTR_bufchain_size_000bd230)((int)handle + 0x10)" (parenthesized_expression "(*(code *)PTR_bufchain_size_000bd230)" ( (pointer_expression "*(code *)PTR_bufchain_size_000bd230" * (cast_expression "(code *)PTR_bufchain_size_000bd230" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "((int)handle + 0x10)" ( (binary_expression "(int)handle + 0x10" (cast_expression "(int)handle" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) (return_statement "return iVar1;" return identifier ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "undefined4 FUN_00081e78(int param_1)\n\n{\n  undefined4 uVar1;\n  \n  if (-1 < *(int *)(param_1 + 4)) {\n    (*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);\n    FUN_00081ac8(param_1);\n    uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);\n    return uVar1;\n  }\n  return 0;\n}\n\n" (function_definition "undefined4 FUN_00081e78(int param_1)\n\n{\n  undefined4 uVar1;\n  \n  if (-1 < *(int *)(param_1 + 4)) {\n    (*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);\n    FUN_00081ac8(param_1);\n    uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);\n    return uVar1;\n  }\n  return 0;\n}" type_identifier (function_declarator "FUN_00081e78(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  undefined4 uVar1;\n  \n  if (-1 < *(int *)(param_1 + 4)) {\n    (*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);\n    FUN_00081ac8(param_1);\n    uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);\n    return uVar1;\n  }\n  return 0;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (if_statement "if (-1 < *(int *)(param_1 + 4)) {\n    (*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);\n    FUN_00081ac8(param_1);\n    uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);\n    return uVar1;\n  }" if (parenthesized_expression "(-1 < *(int *)(param_1 + 4))" ( (binary_expression "-1 < *(int *)(param_1 + 4)" number_literal < (pointer_expression "*(int *)(param_1 + 4)" * (cast_expression "(int *)(param_1 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) ))))) )) (compound_statement "{\n    (*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);\n    FUN_00081ac8(param_1);\n    uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);\n    return uVar1;\n  }" { (expression_statement "(*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);" (call_expression "(*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10)" (parenthesized_expression "(*(code *)PTR_bufchain_add_000bd22c)" ( (pointer_expression "*(code *)PTR_bufchain_add_000bd22c" * (cast_expression "(code *)PTR_bufchain_add_000bd22c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))) ;) (expression_statement "FUN_00081ac8(param_1);" (call_expression "FUN_00081ac8(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (expression_statement "uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);" (assignment_expression "uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10)" identifier = (call_expression "(*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10)" (parenthesized_expression "(*(code *)PTR_bufchain_size_000bd230)" ( (pointer_expression "*(code *)PTR_bufchain_size_000bd230" * (cast_expression "(code *)PTR_bufchain_size_000bd230" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) ;) (return_statement "return uVar1;" return identifier ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( (binary_expression IDENT + LIT) ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( (binary_expression IDENT + LIT) )))) ;) (return_statement return IDENT ;) })) (return_statement return LIT ;) })))
(function_definition "undefined4 FUN_00081e78(int param_1)\n\n{\n  undefined4 uVar1;\n  \n  if (-1 < *(int *)(param_1 + 4)) {\n    (*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);\n    FUN_00081ac8(param_1);\n    uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);\n    return uVar1;\n  }\n  return 0;\n}" (type_identifier "undefined4") (function_declarator "FUN_00081e78(int param_1)" (identifier "FUN_00081e78") (parameter_list "(int param_1)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) () ")"))) (compound_statement "{\n  undefined4 uVar1;\n  \n  if (-1 < *(int *)(param_1 + 4)) {\n    (*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);\n    FUN_00081ac8(param_1);\n    uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);\n    return uVar1;\n  }\n  return 0;\n}" ({ "{") (declaration "undefined4 uVar1;" (type_identifier "undefined4") (identifier "uVar1") (; ";")) (if_statement "if (-1 < *(int *)(param_1 + 4)) {\n    (*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);\n    FUN_00081ac8(param_1);\n    uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);\n    return uVar1;\n  }" (if "if") (parenthesized_expression "(-1 < *(int *)(param_1 + 4))" (( "(") (binary_expression "-1 < *(int *)(param_1 + 4)" (number_literal "-1") (< "<") (pointer_expression "*(int *)(param_1 + 4)" (* "*") (cast_expression "(int *)(param_1 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 4)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) () ")"))))) () ")")) (compound_statement "{\n    (*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);\n    FUN_00081ac8(param_1);\n    uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);\n    return uVar1;\n  }" ({ "{") (expression_statement "(*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);" (call_expression "(*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10)" (parenthesized_expression "(*(code *)PTR_bufchain_add_000bd22c)" (( "(") (pointer_expression "*(code *)PTR_bufchain_add_000bd22c" (* "*") (cast_expression "(code *)PTR_bufchain_add_000bd22c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_bufchain_add_000bd22c"))) () ")")) (argument_list "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")"))) (; ";")) (expression_statement "FUN_00081ac8(param_1);" (call_expression "FUN_00081ac8(param_1)" (identifier "FUN_00081ac8") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (expression_statement "uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);" (assignment_expression "uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10)" (identifier "uVar1") (= "=") (call_expression "(*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10)" (parenthesized_expression "(*(code *)PTR_bufchain_size_000bd230)" (( "(") (pointer_expression "*(code *)PTR_bufchain_size_000bd230" (* "*") (cast_expression "(code *)PTR_bufchain_size_000bd230" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_bufchain_size_000bd230"))) () ")")) (argument_list "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (; ";")) (return_statement "return uVar1;" (return "return") (identifier "uVar1") (; ";")) (} "}"))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

int function_1(void *handle,char *buf,int len)

{
  int iVar1;
  type_1 serial;
  
  if (-1 < *(int *)((int)handle + 4)) {
    (*(type_2 *)PTR_bufchain_add_000bd22c)((int)handle + 0x10);
    var_1((type_1)handle);
    iVar1 = (*(type_2 *)PTR_bufchain_size_000bd230)((int)handle + 0x10);
    return iVar1;
  }
  return 0;
}


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

undefined4 MASKED(int param_1)

{
  undefined4 uVar1;
  
  if (-1 < *(int *)(param_1 + 4)) {
    (*(code *)PTR_bufchain_add_000bd22c)(param_1 + 0x10);
    FUN_00081ac8(param_1);
    uVar1 = (*(code *)PTR_bufchain_size_000bd230)(param_1 + 0x10);
    return uVar1;
  }
  return 0;
}

