
share_xchannel_message * share_xchannel_add_message(share_xchannel *xc,int type,int len)

{
  share_xchannel_message *psVar1;
  
  psVar1 = (share_xchannel_message *)(*(code *)PTR_safemalloc_000bc1b4)(len + 0x10,1);
  psVar1->data = (uchar *)(psVar1 + 1);
  psVar1->datalen = len;
  psVar1->type = type;
  if (xc->msgtail == (share_xchannel_message *)0x0) {
    xc->msghead = psVar1;
  }
  else {
    xc->msgtail->next = psVar1;
  }
  psVar1->next = (share_xchannel_message *)0x0;
  xc->msgtail = psVar1;
  return psVar1;
}



void share_xchannel_add_message(int param_1,undefined4 param_2,int param_3)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1);
  puVar1[2] = puVar1 + 4;
  puVar1[3] = param_3;
  puVar1[1] = param_2;
  if (*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0) {
    *(undefined4 **)(param_1 + 0x10) = puVar1;
  }
  else {
    **(undefined4 **)(param_1 + 0x14) = puVar1;
  }
  *puVar1 = 0;
  *(undefined4 **)(param_1 + 0x14) = puVar1;
  return;
}


lui gp,0x4
addiu gp,gp,0x2b28
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 s2,a1,zero
or s1,a2,zero
li a1,0x1
addiu a0,a2,0x10
lw t9,-0x7f9c(gp)
jalr t9
_nop
lw gp,0x10(sp)
addiu v1,v0,0x10
sw v1,0x8(v0)
sw s1,0xc(v0)
sw s2,0x4(v0)
lw v1,0x14(s0)
beq v1,zero,0x000816b0
_nop
sw v0,0x0(v1)
sw zero,0x0(v0)
sw v0,0x14(s0)
lw ra,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x28
b 0x00081690
_sw v0,0x10(s0)
(translation_unit "void share_xchannel_add_message(int param_1,undefined4 param_2,int param_3)\n\n{\n  undefined4 *puVar1;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1);\n  puVar1[2] = puVar1 + 4;\n  puVar1[3] = param_3;\n  puVar1[1] = param_2;\n  if (*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0) {\n    *(undefined4 **)(param_1 + 0x10) = puVar1;\n  }\n  else {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }\n  *puVar1 = 0;\n  *(undefined4 **)(param_1 + 0x14) = puVar1;\n  return;\n}\n\n" (function_definition "void share_xchannel_add_message(int param_1,undefined4 param_2,int param_3)\n\n{\n  undefined4 *puVar1;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1);\n  puVar1[2] = puVar1 + 4;\n  puVar1[3] = param_3;\n  puVar1[1] = param_2;\n  if (*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0) {\n    *(undefined4 **)(param_1 + 0x10) = puVar1;\n  }\n  else {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }\n  *puVar1 = 0;\n  *(undefined4 **)(param_1 + 0x14) = puVar1;\n  return;\n}" primitive_type (function_declarator "share_xchannel_add_message(int param_1,undefined4 param_2,int param_3)" identifier (parameter_list "(int param_1,undefined4 param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1);\n  puVar1[2] = puVar1 + 4;\n  puVar1[3] = param_3;\n  puVar1[1] = param_2;\n  if (*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0) {\n    *(undefined4 **)(param_1 + 0x10) = puVar1;\n  }\n  else {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }\n  *puVar1 = 0;\n  *(undefined4 **)(param_1 + 0x14) = puVar1;\n  return;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (expression_statement "puVar1 = (undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1);" (assignment_expression "puVar1 = (undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1)" identifier = (cast_expression "(undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1)" (parenthesized_expression "(*(code *)PTR_safemalloc_000bc1b4)" ( (pointer_expression "*(code *)PTR_safemalloc_000bc1b4" * (cast_expression "(code *)PTR_safemalloc_000bc1b4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_3 + 0x10,1)" ( (binary_expression "param_3 + 0x10" identifier + number_literal) , number_literal ))))) ;) (expression_statement "puVar1[2] = puVar1 + 4;" (assignment_expression "puVar1[2] = puVar1 + 4" (subscript_expression "puVar1[2]" identifier [ number_literal ]) = (binary_expression "puVar1 + 4" identifier + number_literal)) ;) (expression_statement "puVar1[3] = param_3;" (assignment_expression "puVar1[3] = param_3" (subscript_expression "puVar1[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "puVar1[1] = param_2;" (assignment_expression "puVar1[1] = param_2" (subscript_expression "puVar1[1]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0) {\n    *(undefined4 **)(param_1 + 0x10) = puVar1;\n  }\n  else {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }" if (parenthesized_expression "(*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0)" ( (binary_expression "*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0" (pointer_expression "*(undefined4 **)(param_1 + 0x14)" * (cast_expression "(undefined4 **)(param_1 + 0x14)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) == (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    *(undefined4 **)(param_1 + 0x10) = puVar1;\n  }" { (expression_statement "*(undefined4 **)(param_1 + 0x10) = puVar1;" (assignment_expression "*(undefined4 **)(param_1 + 0x10) = puVar1" (pointer_expression "*(undefined4 **)(param_1 + 0x10)" * (cast_expression "(undefined4 **)(param_1 + 0x10)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = identifier) ;) }) (else_clause "else {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }" else (compound_statement "{\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }" { (expression_statement "**(undefined4 **)(param_1 + 0x14) = puVar1;" (assignment_expression "**(undefined4 **)(param_1 + 0x14) = puVar1" (pointer_expression "**(undefined4 **)(param_1 + 0x14)" * (pointer_expression "*(undefined4 **)(param_1 + 0x14)" * (cast_expression "(undefined4 **)(param_1 + 0x14)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) ))))) = identifier) ;) }))) (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" * identifier) = number_literal) ;) (expression_statement "*(undefined4 **)(param_1 + 0x14) = puVar1;" (assignment_expression "*(undefined4 **)(param_1 + 0x14) = puVar1" (pointer_expression "*(undefined4 **)(param_1 + 0x14)" * (cast_expression "(undefined4 **)(param_1 + 0x14)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) = identifier) ;) (return_statement "return;" return ;) })))
(translation_unit "share_xchannel_message * share_xchannel_add_message(share_xchannel *xc,int type,int len)\n\n{\n  share_xchannel_message *psVar1;\n  \n  psVar1 = (share_xchannel_message *)(*(code *)PTR_safemalloc_000bc1b4)(len + 0x10,1);\n  psVar1->data = (uchar *)(psVar1 + 1);\n  psVar1->datalen = len;\n  psVar1->type = type;\n  if (xc->msgtail == (share_xchannel_message *)0x0) {\n    xc->msghead = psVar1;\n  }\n  else {\n    xc->msgtail->next = psVar1;\n  }\n  psVar1->next = (share_xchannel_message *)0x0;\n  xc->msgtail = psVar1;\n  return psVar1;\n}\n\n" (function_definition "share_xchannel_message * share_xchannel_add_message(share_xchannel *xc,int type,int len)\n\n{\n  share_xchannel_message *psVar1;\n  \n  psVar1 = (share_xchannel_message *)(*(code *)PTR_safemalloc_000bc1b4)(len + 0x10,1);\n  psVar1->data = (uchar *)(psVar1 + 1);\n  psVar1->datalen = len;\n  psVar1->type = type;\n  if (xc->msgtail == (share_xchannel_message *)0x0) {\n    xc->msghead = psVar1;\n  }\n  else {\n    xc->msgtail->next = psVar1;\n  }\n  psVar1->next = (share_xchannel_message *)0x0;\n  xc->msgtail = psVar1;\n  return psVar1;\n}" type_identifier (pointer_declarator "* share_xchannel_add_message(share_xchannel *xc,int type,int len)" * (function_declarator "share_xchannel_add_message(share_xchannel *xc,int type,int len)" identifier (parameter_list "(share_xchannel *xc,int type,int len)" ( (parameter_declaration "share_xchannel *xc" type_identifier (pointer_declarator "*xc" * identifier)) , (parameter_declaration "int type" primitive_type identifier) , (parameter_declaration "int len" primitive_type identifier) )))) (compound_statement "{\n  share_xchannel_message *psVar1;\n  \n  psVar1 = (share_xchannel_message *)(*(code *)PTR_safemalloc_000bc1b4)(len + 0x10,1);\n  psVar1->data = (uchar *)(psVar1 + 1);\n  psVar1->datalen = len;\n  psVar1->type = type;\n  if (xc->msgtail == (share_xchannel_message *)0x0) {\n    xc->msghead = psVar1;\n  }\n  else {\n    xc->msgtail->next = psVar1;\n  }\n  psVar1->next = (share_xchannel_message *)0x0;\n  xc->msgtail = psVar1;\n  return psVar1;\n}" { (declaration "share_xchannel_message *psVar1;" type_identifier (pointer_declarator "*psVar1" * identifier) ;) (expression_statement "psVar1 = (share_xchannel_message *)(*(code *)PTR_safemalloc_000bc1b4)(len + 0x10,1);" (assignment_expression "psVar1 = (share_xchannel_message *)(*(code *)PTR_safemalloc_000bc1b4)(len + 0x10,1)" identifier = (cast_expression "(share_xchannel_message *)(*(code *)PTR_safemalloc_000bc1b4)(len + 0x10,1)" ( (type_descriptor "share_xchannel_message *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_safemalloc_000bc1b4)(len + 0x10,1)" (parenthesized_expression "(*(code *)PTR_safemalloc_000bc1b4)" ( (pointer_expression "*(code *)PTR_safemalloc_000bc1b4" * (cast_expression "(code *)PTR_safemalloc_000bc1b4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(len + 0x10,1)" ( (binary_expression "len + 0x10" identifier + number_literal) , number_literal ))))) ;) (expression_statement "psVar1->data = (uchar *)(psVar1 + 1);" (assignment_expression "psVar1->data = (uchar *)(psVar1 + 1)" (field_expression "psVar1->data" identifier -> field_identifier) = (cast_expression "(uchar *)(psVar1 + 1)" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(psVar1 + 1)" ( (binary_expression "psVar1 + 1" identifier + number_literal) )))) ;) (expression_statement "psVar1->datalen = len;" (assignment_expression "psVar1->datalen = len" (field_expression "psVar1->datalen" identifier -> field_identifier) = identifier) ;) (expression_statement "psVar1->type = type;" (assignment_expression "psVar1->type = type" (field_expression "psVar1->type" identifier -> field_identifier) = identifier) ;) (if_statement "if (xc->msgtail == (share_xchannel_message *)0x0) {\n    xc->msghead = psVar1;\n  }\n  else {\n    xc->msgtail->next = psVar1;\n  }" if (parenthesized_expression "(xc->msgtail == (share_xchannel_message *)0x0)" ( (binary_expression "xc->msgtail == (share_xchannel_message *)0x0" (field_expression "xc->msgtail" identifier -> field_identifier) == (cast_expression "(share_xchannel_message *)0x0" ( (type_descriptor "share_xchannel_message *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    xc->msghead = psVar1;\n  }" { (expression_statement "xc->msghead = psVar1;" (assignment_expression "xc->msghead = psVar1" (field_expression "xc->msghead" identifier -> field_identifier) = identifier) ;) }) (else_clause "else {\n    xc->msgtail->next = psVar1;\n  }" else (compound_statement "{\n    xc->msgtail->next = psVar1;\n  }" { (expression_statement "xc->msgtail->next = psVar1;" (assignment_expression "xc->msgtail->next = psVar1" (field_expression "xc->msgtail->next" (field_expression "xc->msgtail" identifier -> field_identifier) -> field_identifier) = identifier) ;) }))) (expression_statement "psVar1->next = (share_xchannel_message *)0x0;" (assignment_expression "psVar1->next = (share_xchannel_message *)0x0" (field_expression "psVar1->next" identifier -> field_identifier) = (cast_expression "(share_xchannel_message *)0x0" ( (type_descriptor "share_xchannel_message *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "xc->msgtail = psVar1;" (assignment_expression "xc->msgtail = psVar1" (field_expression "xc->msgtail" identifier -> field_identifier) = identifier) ;) (return_statement "return psVar1;" return identifier ;) })))
(translation_unit "void share_xchannel_add_message(int param_1,undefined4 param_2,int param_3)\n\n{\n  undefined4 *puVar1;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1);\n  puVar1[2] = puVar1 + 4;\n  puVar1[3] = param_3;\n  puVar1[1] = param_2;\n  if (*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0) {\n    *(undefined4 **)(param_1 + 0x10) = puVar1;\n  }\n  else {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }\n  *puVar1 = 0;\n  *(undefined4 **)(param_1 + 0x14) = puVar1;\n  return;\n}\n\n" (function_definition "void share_xchannel_add_message(int param_1,undefined4 param_2,int param_3)\n\n{\n  undefined4 *puVar1;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1);\n  puVar1[2] = puVar1 + 4;\n  puVar1[3] = param_3;\n  puVar1[1] = param_2;\n  if (*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0) {\n    *(undefined4 **)(param_1 + 0x10) = puVar1;\n  }\n  else {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }\n  *puVar1 = 0;\n  *(undefined4 **)(param_1 + 0x14) = puVar1;\n  return;\n}" primitive_type (function_declarator "share_xchannel_add_message(int param_1,undefined4 param_2,int param_3)" identifier (parameter_list "(int param_1,undefined4 param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1);\n  puVar1[2] = puVar1 + 4;\n  puVar1[3] = param_3;\n  puVar1[1] = param_2;\n  if (*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0) {\n    *(undefined4 **)(param_1 + 0x10) = puVar1;\n  }\n  else {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }\n  *puVar1 = 0;\n  *(undefined4 **)(param_1 + 0x14) = puVar1;\n  return;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (expression_statement "puVar1 = (undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1);" (assignment_expression "puVar1 = (undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1)" identifier = (cast_expression "(undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1)" (parenthesized_expression "(*(code *)PTR_safemalloc_000bc1b4)" ( (pointer_expression "*(code *)PTR_safemalloc_000bc1b4" * (cast_expression "(code *)PTR_safemalloc_000bc1b4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_3 + 0x10,1)" ( (binary_expression "param_3 + 0x10" identifier + number_literal) , number_literal ))))) ;) (expression_statement "puVar1[2] = puVar1 + 4;" (assignment_expression "puVar1[2] = puVar1 + 4" (subscript_expression "puVar1[2]" identifier [ number_literal ]) = (binary_expression "puVar1 + 4" identifier + number_literal)) ;) (expression_statement "puVar1[3] = param_3;" (assignment_expression "puVar1[3] = param_3" (subscript_expression "puVar1[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "puVar1[1] = param_2;" (assignment_expression "puVar1[1] = param_2" (subscript_expression "puVar1[1]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0) {\n    *(undefined4 **)(param_1 + 0x10) = puVar1;\n  }\n  else {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }" if (parenthesized_expression "(*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0)" ( (binary_expression "*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0" (pointer_expression "*(undefined4 **)(param_1 + 0x14)" * (cast_expression "(undefined4 **)(param_1 + 0x14)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) == (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    *(undefined4 **)(param_1 + 0x10) = puVar1;\n  }" { (expression_statement "*(undefined4 **)(param_1 + 0x10) = puVar1;" (assignment_expression "*(undefined4 **)(param_1 + 0x10) = puVar1" (pointer_expression "*(undefined4 **)(param_1 + 0x10)" * (cast_expression "(undefined4 **)(param_1 + 0x10)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = identifier) ;) }) (else_clause "else {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }" else (compound_statement "{\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }" { (expression_statement "**(undefined4 **)(param_1 + 0x14) = puVar1;" (assignment_expression "**(undefined4 **)(param_1 + 0x14) = puVar1" (pointer_expression "**(undefined4 **)(param_1 + 0x14)" * (pointer_expression "*(undefined4 **)(param_1 + 0x14)" * (cast_expression "(undefined4 **)(param_1 + 0x14)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) ))))) = identifier) ;) }))) (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" * identifier) = number_literal) ;) (expression_statement "*(undefined4 **)(param_1 + 0x14) = puVar1;" (assignment_expression "*(undefined4 **)(param_1 + 0x14) = puVar1" (pointer_expression "*(undefined4 **)(param_1 + 0x14)" * (cast_expression "(undefined4 **)(param_1 + 0x14)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) = 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 (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( (binary_expression IDENT + LIT) , LIT ))))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) = IDENT) ;) }))) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (return_statement return ;) })))
(function_definition "void share_xchannel_add_message(int param_1,undefined4 param_2,int param_3)\n\n{\n  undefined4 *puVar1;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1);\n  puVar1[2] = puVar1 + 4;\n  puVar1[3] = param_3;\n  puVar1[1] = param_2;\n  if (*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0) {\n    *(undefined4 **)(param_1 + 0x10) = puVar1;\n  }\n  else {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }\n  *puVar1 = 0;\n  *(undefined4 **)(param_1 + 0x14) = puVar1;\n  return;\n}" (primitive_type "void") (function_declarator "share_xchannel_add_message(int param_1,undefined4 param_2,int param_3)" (identifier "share_xchannel_add_message") (parameter_list "(int param_1,undefined4 param_2,int param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  undefined4 *puVar1;\n  \n  puVar1 = (undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1);\n  puVar1[2] = puVar1 + 4;\n  puVar1[3] = param_3;\n  puVar1[1] = param_2;\n  if (*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0) {\n    *(undefined4 **)(param_1 + 0x10) = puVar1;\n  }\n  else {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }\n  *puVar1 = 0;\n  *(undefined4 **)(param_1 + 0x14) = puVar1;\n  return;\n}" ({ "{") (declaration "undefined4 *puVar1;" (type_identifier "undefined4") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (expression_statement "puVar1 = (undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1);" (assignment_expression "puVar1 = (undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1)" (identifier "puVar1") (= "=") (cast_expression "(undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1)" (parenthesized_expression "(*(code *)PTR_safemalloc_000bc1b4)" (( "(") (pointer_expression "*(code *)PTR_safemalloc_000bc1b4" (* "*") (cast_expression "(code *)PTR_safemalloc_000bc1b4" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_safemalloc_000bc1b4"))) () ")")) (argument_list "(param_3 + 0x10,1)" (( "(") (binary_expression "param_3 + 0x10" (identifier "param_3") (+ "+") (number_literal "0x10")) (, ",") (number_literal "1") () ")"))))) (; ";")) (expression_statement "puVar1[2] = puVar1 + 4;" (assignment_expression "puVar1[2] = puVar1 + 4" (subscript_expression "puVar1[2]" (identifier "puVar1") ([ "[") (number_literal "2") (] "]")) (= "=") (binary_expression "puVar1 + 4" (identifier "puVar1") (+ "+") (number_literal "4"))) (; ";")) (expression_statement "puVar1[3] = param_3;" (assignment_expression "puVar1[3] = param_3" (subscript_expression "puVar1[3]" (identifier "puVar1") ([ "[") (number_literal "3") (] "]")) (= "=") (identifier "param_3")) (; ";")) (expression_statement "puVar1[1] = param_2;" (assignment_expression "puVar1[1] = param_2" (subscript_expression "puVar1[1]" (identifier "puVar1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "param_2")) (; ";")) (if_statement "if (*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0) {\n    *(undefined4 **)(param_1 + 0x10) = puVar1;\n  }\n  else {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }" (if "if") (parenthesized_expression "(*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0)" (( "(") (binary_expression "*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0" (pointer_expression "*(undefined4 **)(param_1 + 0x14)" (* "*") (cast_expression "(undefined4 **)(param_1 + 0x14)" (( "(") (type_descriptor "undefined4 **" (type_identifier "undefined4") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")")))) (== "==") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    *(undefined4 **)(param_1 + 0x10) = puVar1;\n  }" ({ "{") (expression_statement "*(undefined4 **)(param_1 + 0x10) = puVar1;" (assignment_expression "*(undefined4 **)(param_1 + 0x10) = puVar1" (pointer_expression "*(undefined4 **)(param_1 + 0x10)" (* "*") (cast_expression "(undefined4 **)(param_1 + 0x10)" (( "(") (type_descriptor "undefined4 **" (type_identifier "undefined4") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (= "=") (identifier "puVar1")) (; ";")) (} "}")) (else_clause "else {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }" (else "else") (compound_statement "{\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n  }" ({ "{") (expression_statement "**(undefined4 **)(param_1 + 0x14) = puVar1;" (assignment_expression "**(undefined4 **)(param_1 + 0x14) = puVar1" (pointer_expression "**(undefined4 **)(param_1 + 0x14)" (* "*") (pointer_expression "*(undefined4 **)(param_1 + 0x14)" (* "*") (cast_expression "(undefined4 **)(param_1 + 0x14)" (( "(") (type_descriptor "undefined4 **" (type_identifier "undefined4") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")"))))) (= "=") (identifier "puVar1")) (; ";")) (} "}")))) (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(undefined4 **)(param_1 + 0x14) = puVar1;" (assignment_expression "*(undefined4 **)(param_1 + 0x14) = puVar1" (pointer_expression "*(undefined4 **)(param_1 + 0x14)" (* "*") (cast_expression "(undefined4 **)(param_1 + 0x14)" (( "(") (type_descriptor "undefined4 **" (type_identifier "undefined4") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")")))) (= "=") (identifier "puVar1")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

type_1 * function_1(type_2 *xc,int type,int var_1)

{
  type_1 *var_2;
  
  var_2 = (type_1 *)(*(type_3 *)PTR_safemalloc_000bc1b4)(var_1 + 0x10,1);
  var_2->data = (type_4 *)(var_2 + 1);
  var_2->datalen = var_1;
  var_2->type = type;
  if (xc->msgtail == (type_1 *)0x0) {
    xc->msghead = var_2;
  }
  else {
    xc->msgtail->next = var_2;
  }
  var_2->next = (type_1 *)0x0;
  xc->msgtail = var_2;
  return var_2;
}


(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: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (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)) (number_literal)))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator 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: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) right: (identifier)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier))) (return_statement))))

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

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)(*(code *)PTR_safemalloc_000bc1b4)(param_3 + 0x10,1);
  puVar1[2] = puVar1 + 4;
  puVar1[3] = param_3;
  puVar1[1] = param_2;
  if (*(undefined4 **)(param_1 + 0x14) == (undefined4 *)0x0) {
    *(undefined4 **)(param_1 + 0x10) = puVar1;
  }
  else {
    **(undefined4 **)(param_1 + 0x14) = puVar1;
  }
  *puVar1 = 0;
  *(undefined4 **)(param_1 + 0x14) = puVar1;
  return;
}

