
/* DWARF original prototype: void resize_buffer(buffer * b, size_t newlen, buffer * b) */

void resize_buffer(buffer *b,size_t newlen,buffer *b_1)

{
  int iVar1;
  void *pvVar2;
  buffer *pbVar3;
  
  if (b_1 <= (buffer *)b->allocated) {
    return;
  }
  pbVar3 = (buffer *)((int)b->allocated << 1);
  pvVar2 = *(void **)newlen;
  if (b_1 < pbVar3) {
    iVar1 = (*(code *)PTR_realloc_0003f464)(pvVar2,pbVar3);
    if (iVar1 != 0) {
      b->allocated = (size_t)pbVar3;
      *(int *)newlen = iVar1;
      return;
    }
    pvVar2 = *(void **)newlen;
  }
  if (-1 < (int)b_1) {
    pvVar2 = xrealloc(pvVar2,(size_t)b_1);
    b->allocated = (size_t)b_1;
    *(void **)newlen = pvVar2;
    return;
  }
                    /* WARNING: Subroutine does not return */
  xalloc_die();
}



void FUN_0001c774(uint *param_1,int *param_2,uint param_3)

{
  int iVar1;
  uint uVar2;
  
  if (param_3 <= *param_1) {
    return;
  }
  uVar2 = *param_1 << 1;
  iVar1 = *param_2;
  if (param_3 < uVar2) {
    iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);
    if (iVar1 != 0) {
      *param_1 = uVar2;
      *param_2 = iVar1;
      return;
    }
    iVar1 = *param_2;
  }
  if (-1 < (int)param_3) {
    iVar1 = xrealloc(iVar1,param_3);
    *param_1 = param_3;
    *param_2 = iVar1;
    return;
  }
                    /* WARNING: Subroutine does not return */
  xalloc_die(iVar1);
}


lui gp,0x3
addiu gp,gp,-0x5634
addu gp,gp,t9
lw v0,0x0(a0)
sltu v1,v0,a2
beq v1,zero,0x0001c838
_nop
addiu sp,sp,-0x30
sw s1,0x20(sp)
sll s1,v0,0x1
sw gp,0x10(sp)
sltu v0,a2,s1
sw s3,0x28(sp)
sw s2,0x24(sp)
or s3,a1,zero
sw s0,0x1c(sp)
or s2,a0,zero
sw ra,0x2c(sp)
or s0,a2,zero
bne v0,zero,0x0001c7fc
_lw a0,0x0(a1)
bltz s0,0x0001c848
_lw t9,-0x7ef8(gp)
bal 0x000287ec
_or a1,s0,zero
lw ra,0x2c(sp)
lw s1,0x20(sp)
sw s0,0x0(s2)
sw v0,0x0(s3)
lw s2,0x24(sp)
lw s3,0x28(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x30
lw t9,-0x7cdc(gp)
jalr t9
_or a1,s1,zero
beq v0,zero,0x0001c840
_lw gp,0x10(sp)
lw ra,0x2c(sp)
or s0,s1,zero
lw s1,0x20(sp)
sw s0,0x0(s2)
sw v0,0x0(s3)
lw s2,0x24(sp)
lw s3,0x28(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x30
jr ra
_nop
b 0x0001c7c8
_lw a0,0x0(s3)
lw t9,-0x7ef0(gp)
bal 0x00028b50
_nop
(translation_unit "void FUN_0001c774(uint *param_1,int *param_2,uint param_3)\n\n{\n  int iVar1;\n  uint uVar2;\n  \n  if (param_3 <= *param_1) {\n    return;\n  }\n  uVar2 = *param_1 << 1;\n  iVar1 = *param_2;\n  if (param_3 < uVar2) {\n    iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);\n    if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }\n    iVar1 = *param_2;\n  }\n  if (-1 < (int)param_3) {\n    iVar1 = xrealloc(iVar1,param_3);\n    *param_1 = param_3;\n    *param_2 = iVar1;\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  xalloc_die(iVar1);\n}\n\n" (function_definition "void FUN_0001c774(uint *param_1,int *param_2,uint param_3)\n\n{\n  int iVar1;\n  uint uVar2;\n  \n  if (param_3 <= *param_1) {\n    return;\n  }\n  uVar2 = *param_1 << 1;\n  iVar1 = *param_2;\n  if (param_3 < uVar2) {\n    iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);\n    if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }\n    iVar1 = *param_2;\n  }\n  if (-1 < (int)param_3) {\n    iVar1 = xrealloc(iVar1,param_3);\n    *param_1 = param_3;\n    *param_2 = iVar1;\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  xalloc_die(iVar1);\n}" primitive_type (function_declarator "FUN_0001c774(uint *param_1,int *param_2,uint param_3)" identifier (parameter_list "(uint *param_1,int *param_2,uint param_3)" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  \n  if (param_3 <= *param_1) {\n    return;\n  }\n  uVar2 = *param_1 << 1;\n  iVar1 = *param_2;\n  if (param_3 < uVar2) {\n    iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);\n    if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }\n    iVar1 = *param_2;\n  }\n  if (-1 < (int)param_3) {\n    iVar1 = xrealloc(iVar1,param_3);\n    *param_1 = param_3;\n    *param_2 = iVar1;\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  xalloc_die(iVar1);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (if_statement "if (param_3 <= *param_1) {\n    return;\n  }" if (parenthesized_expression "(param_3 <= *param_1)" ( (binary_expression "param_3 <= *param_1" identifier <= (pointer_expression "*param_1" * identifier)) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "uVar2 = *param_1 << 1;" (assignment_expression "uVar2 = *param_1 << 1" identifier = (binary_expression "*param_1 << 1" (pointer_expression "*param_1" * identifier) << number_literal)) ;) (expression_statement "iVar1 = *param_2;" (assignment_expression "iVar1 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (if_statement "if (param_3 < uVar2) {\n    iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);\n    if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }\n    iVar1 = *param_2;\n  }" if (parenthesized_expression "(param_3 < uVar2)" ( (binary_expression "param_3 < uVar2" identifier < identifier) )) (compound_statement "{\n    iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);\n    if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }\n    iVar1 = *param_2;\n  }" { (expression_statement "iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);" (assignment_expression "iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2)" identifier = (call_expression "(*(code *)PTR_realloc_0003f464)(iVar1,uVar2)" (parenthesized_expression "(*(code *)PTR_realloc_0003f464)" ( (pointer_expression "*(code *)PTR_realloc_0003f464" * (cast_expression "(code *)PTR_realloc_0003f464" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1,uVar2)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }" { (expression_statement "*param_1 = uVar2;" (assignment_expression "*param_1 = uVar2" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "*param_2 = iVar1;" (assignment_expression "*param_2 = iVar1" (pointer_expression "*param_2" * identifier) = identifier) ;) (return_statement "return;" return ;) })) (expression_statement "iVar1 = *param_2;" (assignment_expression "iVar1 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) })) (if_statement "if (-1 < (int)param_3) {\n    iVar1 = xrealloc(iVar1,param_3);\n    *param_1 = param_3;\n    *param_2 = iVar1;\n    return;\n  }" if (parenthesized_expression "(-1 < (int)param_3)" ( (binary_expression "-1 < (int)param_3" number_literal < (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n    iVar1 = xrealloc(iVar1,param_3);\n    *param_1 = param_3;\n    *param_2 = iVar1;\n    return;\n  }" { (expression_statement "iVar1 = xrealloc(iVar1,param_3);" (assignment_expression "iVar1 = xrealloc(iVar1,param_3)" identifier = (call_expression "xrealloc(iVar1,param_3)" identifier (argument_list "(iVar1,param_3)" ( identifier , identifier )))) ;) (expression_statement "*param_1 = param_3;" (assignment_expression "*param_1 = param_3" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "*param_2 = iVar1;" (assignment_expression "*param_2 = iVar1" (pointer_expression "*param_2" * identifier) = identifier) ;) (return_statement "return;" return ;) })) comment (expression_statement "xalloc_die(iVar1);" (call_expression "xalloc_die(iVar1)" identifier (argument_list "(iVar1)" ( identifier ))) ;) })))
(translation_unit "/* DWARF original prototype: void resize_buffer(buffer * b, size_t newlen, buffer * b) */\n\nvoid resize_buffer(buffer *b,size_t newlen,buffer *b_1)\n\n{\n  int iVar1;\n  void *pvVar2;\n  buffer *pbVar3;\n  \n  if (b_1 <= (buffer *)b->allocated) {\n    return;\n  }\n  pbVar3 = (buffer *)((int)b->allocated << 1);\n  pvVar2 = *(void **)newlen;\n  if (b_1 < pbVar3) {\n    iVar1 = (*(code *)PTR_realloc_0003f464)(pvVar2,pbVar3);\n    if (iVar1 != 0) {\n      b->allocated = (size_t)pbVar3;\n      *(int *)newlen = iVar1;\n      return;\n    }\n    pvVar2 = *(void **)newlen;\n  }\n  if (-1 < (int)b_1) {\n    pvVar2 = xrealloc(pvVar2,(size_t)b_1);\n    b->allocated = (size_t)b_1;\n    *(void **)newlen = pvVar2;\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  xalloc_die();\n}\n\n" comment (function_definition "void resize_buffer(buffer *b,size_t newlen,buffer *b_1)\n\n{\n  int iVar1;\n  void *pvVar2;\n  buffer *pbVar3;\n  \n  if (b_1 <= (buffer *)b->allocated) {\n    return;\n  }\n  pbVar3 = (buffer *)((int)b->allocated << 1);\n  pvVar2 = *(void **)newlen;\n  if (b_1 < pbVar3) {\n    iVar1 = (*(code *)PTR_realloc_0003f464)(pvVar2,pbVar3);\n    if (iVar1 != 0) {\n      b->allocated = (size_t)pbVar3;\n      *(int *)newlen = iVar1;\n      return;\n    }\n    pvVar2 = *(void **)newlen;\n  }\n  if (-1 < (int)b_1) {\n    pvVar2 = xrealloc(pvVar2,(size_t)b_1);\n    b->allocated = (size_t)b_1;\n    *(void **)newlen = pvVar2;\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  xalloc_die();\n}" primitive_type (function_declarator "resize_buffer(buffer *b,size_t newlen,buffer *b_1)" identifier (parameter_list "(buffer *b,size_t newlen,buffer *b_1)" ( (parameter_declaration "buffer *b" type_identifier (pointer_declarator "*b" * identifier)) , (parameter_declaration "size_t newlen" primitive_type identifier) , (parameter_declaration "buffer *b_1" type_identifier (pointer_declarator "*b_1" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  void *pvVar2;\n  buffer *pbVar3;\n  \n  if (b_1 <= (buffer *)b->allocated) {\n    return;\n  }\n  pbVar3 = (buffer *)((int)b->allocated << 1);\n  pvVar2 = *(void **)newlen;\n  if (b_1 < pbVar3) {\n    iVar1 = (*(code *)PTR_realloc_0003f464)(pvVar2,pbVar3);\n    if (iVar1 != 0) {\n      b->allocated = (size_t)pbVar3;\n      *(int *)newlen = iVar1;\n      return;\n    }\n    pvVar2 = *(void **)newlen;\n  }\n  if (-1 < (int)b_1) {\n    pvVar2 = xrealloc(pvVar2,(size_t)b_1);\n    b->allocated = (size_t)b_1;\n    *(void **)newlen = pvVar2;\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  xalloc_die();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "void *pvVar2;" primitive_type (pointer_declarator "*pvVar2" * identifier) ;) (declaration "buffer *pbVar3;" type_identifier (pointer_declarator "*pbVar3" * identifier) ;) (if_statement "if (b_1 <= (buffer *)b->allocated) {\n    return;\n  }" if (parenthesized_expression "(b_1 <= (buffer *)b->allocated)" ( (binary_expression "b_1 <= (buffer *)b->allocated" identifier <= (cast_expression "(buffer *)b->allocated" ( (type_descriptor "buffer *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "b->allocated" identifier -> field_identifier))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "pbVar3 = (buffer *)((int)b->allocated << 1);" (assignment_expression "pbVar3 = (buffer *)((int)b->allocated << 1)" identifier = (cast_expression "(buffer *)((int)b->allocated << 1)" ( (type_descriptor "buffer *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)b->allocated << 1)" ( (binary_expression "(int)b->allocated << 1" (cast_expression "(int)b->allocated" ( (type_descriptor "int" primitive_type) ) (field_expression "b->allocated" identifier -> field_identifier)) << number_literal) )))) ;) (expression_statement "pvVar2 = *(void **)newlen;" (assignment_expression "pvVar2 = *(void **)newlen" identifier = (pointer_expression "*(void **)newlen" * (cast_expression "(void **)newlen" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (if_statement "if (b_1 < pbVar3) {\n    iVar1 = (*(code *)PTR_realloc_0003f464)(pvVar2,pbVar3);\n    if (iVar1 != 0) {\n      b->allocated = (size_t)pbVar3;\n      *(int *)newlen = iVar1;\n      return;\n    }\n    pvVar2 = *(void **)newlen;\n  }" if (parenthesized_expression "(b_1 < pbVar3)" ( (binary_expression "b_1 < pbVar3" identifier < identifier) )) (compound_statement "{\n    iVar1 = (*(code *)PTR_realloc_0003f464)(pvVar2,pbVar3);\n    if (iVar1 != 0) {\n      b->allocated = (size_t)pbVar3;\n      *(int *)newlen = iVar1;\n      return;\n    }\n    pvVar2 = *(void **)newlen;\n  }" { (expression_statement "iVar1 = (*(code *)PTR_realloc_0003f464)(pvVar2,pbVar3);" (assignment_expression "iVar1 = (*(code *)PTR_realloc_0003f464)(pvVar2,pbVar3)" identifier = (call_expression "(*(code *)PTR_realloc_0003f464)(pvVar2,pbVar3)" (parenthesized_expression "(*(code *)PTR_realloc_0003f464)" ( (pointer_expression "*(code *)PTR_realloc_0003f464" * (cast_expression "(code *)PTR_realloc_0003f464" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pvVar2,pbVar3)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n      b->allocated = (size_t)pbVar3;\n      *(int *)newlen = iVar1;\n      return;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      b->allocated = (size_t)pbVar3;\n      *(int *)newlen = iVar1;\n      return;\n    }" { (expression_statement "b->allocated = (size_t)pbVar3;" (assignment_expression "b->allocated = (size_t)pbVar3" (field_expression "b->allocated" identifier -> field_identifier) = (cast_expression "(size_t)pbVar3" ( (type_descriptor "size_t" primitive_type) ) identifier)) ;) (expression_statement "*(int *)newlen = iVar1;" (assignment_expression "*(int *)newlen = iVar1" (pointer_expression "*(int *)newlen" * (cast_expression "(int *)newlen" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) = identifier) ;) (return_statement "return;" return ;) })) (expression_statement "pvVar2 = *(void **)newlen;" (assignment_expression "pvVar2 = *(void **)newlen" identifier = (pointer_expression "*(void **)newlen" * (cast_expression "(void **)newlen" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) })) (if_statement "if (-1 < (int)b_1) {\n    pvVar2 = xrealloc(pvVar2,(size_t)b_1);\n    b->allocated = (size_t)b_1;\n    *(void **)newlen = pvVar2;\n    return;\n  }" if (parenthesized_expression "(-1 < (int)b_1)" ( (binary_expression "-1 < (int)b_1" number_literal < (cast_expression "(int)b_1" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n    pvVar2 = xrealloc(pvVar2,(size_t)b_1);\n    b->allocated = (size_t)b_1;\n    *(void **)newlen = pvVar2;\n    return;\n  }" { (expression_statement "pvVar2 = xrealloc(pvVar2,(size_t)b_1);" (assignment_expression "pvVar2 = xrealloc(pvVar2,(size_t)b_1)" identifier = (call_expression "xrealloc(pvVar2,(size_t)b_1)" identifier (argument_list "(pvVar2,(size_t)b_1)" ( identifier , (cast_expression "(size_t)b_1" ( (type_descriptor "size_t" primitive_type) ) identifier) )))) ;) (expression_statement "b->allocated = (size_t)b_1;" (assignment_expression "b->allocated = (size_t)b_1" (field_expression "b->allocated" identifier -> field_identifier) = (cast_expression "(size_t)b_1" ( (type_descriptor "size_t" primitive_type) ) identifier)) ;) (expression_statement "*(void **)newlen = pvVar2;" (assignment_expression "*(void **)newlen = pvVar2" (pointer_expression "*(void **)newlen" * (cast_expression "(void **)newlen" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = identifier) ;) (return_statement "return;" return ;) })) comment (expression_statement "xalloc_die();" (call_expression "xalloc_die()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "void FUN_0001c774(uint *param_1,int *param_2,uint param_3)\n\n{\n  int iVar1;\n  uint uVar2;\n  \n  if (param_3 <= *param_1) {\n    return;\n  }\n  uVar2 = *param_1 << 1;\n  iVar1 = *param_2;\n  if (param_3 < uVar2) {\n    iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);\n    if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }\n    iVar1 = *param_2;\n  }\n  if (-1 < (int)param_3) {\n    iVar1 = xrealloc(iVar1,param_3);\n    *param_1 = param_3;\n    *param_2 = iVar1;\n    return;\n  }\n                    \n  xalloc_die(iVar1);\n}\n\n" (function_definition "void FUN_0001c774(uint *param_1,int *param_2,uint param_3)\n\n{\n  int iVar1;\n  uint uVar2;\n  \n  if (param_3 <= *param_1) {\n    return;\n  }\n  uVar2 = *param_1 << 1;\n  iVar1 = *param_2;\n  if (param_3 < uVar2) {\n    iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);\n    if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }\n    iVar1 = *param_2;\n  }\n  if (-1 < (int)param_3) {\n    iVar1 = xrealloc(iVar1,param_3);\n    *param_1 = param_3;\n    *param_2 = iVar1;\n    return;\n  }\n                    \n  xalloc_die(iVar1);\n}" primitive_type (function_declarator "FUN_0001c774(uint *param_1,int *param_2,uint param_3)" identifier (parameter_list "(uint *param_1,int *param_2,uint param_3)" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  \n  if (param_3 <= *param_1) {\n    return;\n  }\n  uVar2 = *param_1 << 1;\n  iVar1 = *param_2;\n  if (param_3 < uVar2) {\n    iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);\n    if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }\n    iVar1 = *param_2;\n  }\n  if (-1 < (int)param_3) {\n    iVar1 = xrealloc(iVar1,param_3);\n    *param_1 = param_3;\n    *param_2 = iVar1;\n    return;\n  }\n                    \n  xalloc_die(iVar1);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (if_statement "if (param_3 <= *param_1) {\n    return;\n  }" if (parenthesized_expression "(param_3 <= *param_1)" ( (binary_expression "param_3 <= *param_1" identifier <= (pointer_expression "*param_1" * identifier)) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "uVar2 = *param_1 << 1;" (assignment_expression "uVar2 = *param_1 << 1" identifier = (binary_expression "*param_1 << 1" (pointer_expression "*param_1" * identifier) << number_literal)) ;) (expression_statement "iVar1 = *param_2;" (assignment_expression "iVar1 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (if_statement "if (param_3 < uVar2) {\n    iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);\n    if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }\n    iVar1 = *param_2;\n  }" if (parenthesized_expression "(param_3 < uVar2)" ( (binary_expression "param_3 < uVar2" identifier < identifier) )) (compound_statement "{\n    iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);\n    if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }\n    iVar1 = *param_2;\n  }" { (expression_statement "iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);" (assignment_expression "iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2)" identifier = (call_expression "(*(code *)PTR_realloc_0003f464)(iVar1,uVar2)" (parenthesized_expression "(*(code *)PTR_realloc_0003f464)" ( (pointer_expression "*(code *)PTR_realloc_0003f464" * (cast_expression "(code *)PTR_realloc_0003f464" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar1,uVar2)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }" { (expression_statement "*param_1 = uVar2;" (assignment_expression "*param_1 = uVar2" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "*param_2 = iVar1;" (assignment_expression "*param_2 = iVar1" (pointer_expression "*param_2" * identifier) = identifier) ;) (return_statement "return;" return ;) })) (expression_statement "iVar1 = *param_2;" (assignment_expression "iVar1 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) })) (if_statement "if (-1 < (int)param_3) {\n    iVar1 = xrealloc(iVar1,param_3);\n    *param_1 = param_3;\n    *param_2 = iVar1;\n    return;\n  }" if (parenthesized_expression "(-1 < (int)param_3)" ( (binary_expression "-1 < (int)param_3" number_literal < (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n    iVar1 = xrealloc(iVar1,param_3);\n    *param_1 = param_3;\n    *param_2 = iVar1;\n    return;\n  }" { (expression_statement "iVar1 = xrealloc(iVar1,param_3);" (assignment_expression "iVar1 = xrealloc(iVar1,param_3)" identifier = (call_expression "xrealloc(iVar1,param_3)" identifier (argument_list "(iVar1,param_3)" ( identifier , identifier )))) ;) (expression_statement "*param_1 = param_3;" (assignment_expression "*param_1 = param_3" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "*param_2 = iVar1;" (assignment_expression "*param_2 = iVar1" (pointer_expression "*param_2" * identifier) = identifier) ;) (return_statement "return;" return ;) })) (expression_statement "xalloc_die(iVar1);" (call_expression "xalloc_die(iVar1)" identifier (argument_list "(iVar1)" ( identifier ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= (pointer_expression * IDENT)) )) (compound_statement { (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * IDENT) << LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) })) (if_statement if (parenthesized_expression ( (binary_expression LIT < (cast_expression ( (type_descriptor TYPE) ) IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (return_statement return ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })))
(function_definition "void FUN_0001c774(uint *param_1,int *param_2,uint param_3)\n\n{\n  int iVar1;\n  uint uVar2;\n  \n  if (param_3 <= *param_1) {\n    return;\n  }\n  uVar2 = *param_1 << 1;\n  iVar1 = *param_2;\n  if (param_3 < uVar2) {\n    iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);\n    if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }\n    iVar1 = *param_2;\n  }\n  if (-1 < (int)param_3) {\n    iVar1 = xrealloc(iVar1,param_3);\n    *param_1 = param_3;\n    *param_2 = iVar1;\n    return;\n  }\n                    \n  xalloc_die(iVar1);\n}" (primitive_type "void") (function_declarator "FUN_0001c774(uint *param_1,int *param_2,uint param_3)" (identifier "FUN_0001c774") (parameter_list "(uint *param_1,int *param_2,uint param_3)" (( "(") (parameter_declaration "uint *param_1" (type_identifier "uint") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int *param_2" (primitive_type "int") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) () ")"))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  \n  if (param_3 <= *param_1) {\n    return;\n  }\n  uVar2 = *param_1 << 1;\n  iVar1 = *param_2;\n  if (param_3 < uVar2) {\n    iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);\n    if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }\n    iVar1 = *param_2;\n  }\n  if (-1 < (int)param_3) {\n    iVar1 = xrealloc(iVar1,param_3);\n    *param_1 = param_3;\n    *param_2 = iVar1;\n    return;\n  }\n                    \n  xalloc_die(iVar1);\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (if_statement "if (param_3 <= *param_1) {\n    return;\n  }" (if "if") (parenthesized_expression "(param_3 <= *param_1)" (( "(") (binary_expression "param_3 <= *param_1" (identifier "param_3") (<= "<=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) () ")")) (compound_statement "{\n    return;\n  }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "uVar2 = *param_1 << 1;" (assignment_expression "uVar2 = *param_1 << 1" (identifier "uVar2") (= "=") (binary_expression "*param_1 << 1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (<< "<<") (number_literal "1"))) (; ";")) (expression_statement "iVar1 = *param_2;" (assignment_expression "iVar1 = *param_2" (identifier "iVar1") (= "=") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (; ";")) (if_statement "if (param_3 < uVar2) {\n    iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);\n    if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }\n    iVar1 = *param_2;\n  }" (if "if") (parenthesized_expression "(param_3 < uVar2)" (( "(") (binary_expression "param_3 < uVar2" (identifier "param_3") (< "<") (identifier "uVar2")) () ")")) (compound_statement "{\n    iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);\n    if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }\n    iVar1 = *param_2;\n  }" ({ "{") (expression_statement "iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);" (assignment_expression "iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2)" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_realloc_0003f464)(iVar1,uVar2)" (parenthesized_expression "(*(code *)PTR_realloc_0003f464)" (( "(") (pointer_expression "*(code *)PTR_realloc_0003f464" (* "*") (cast_expression "(code *)PTR_realloc_0003f464" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_realloc_0003f464"))) () ")")) (argument_list "(iVar1,uVar2)" (( "(") (identifier "iVar1") (, ",") (identifier "uVar2") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      *param_1 = uVar2;\n      *param_2 = iVar1;\n      return;\n    }" ({ "{") (expression_statement "*param_1 = uVar2;" (assignment_expression "*param_1 = uVar2" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "uVar2")) (; ";")) (expression_statement "*param_2 = iVar1;" (assignment_expression "*param_2 = iVar1" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "iVar1")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "iVar1 = *param_2;" (assignment_expression "iVar1 = *param_2" (identifier "iVar1") (= "=") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (; ";")) (} "}"))) (if_statement "if (-1 < (int)param_3) {\n    iVar1 = xrealloc(iVar1,param_3);\n    *param_1 = param_3;\n    *param_2 = iVar1;\n    return;\n  }" (if "if") (parenthesized_expression "(-1 < (int)param_3)" (( "(") (binary_expression "-1 < (int)param_3" (number_literal "-1") (< "<") (cast_expression "(int)param_3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_3"))) () ")")) (compound_statement "{\n    iVar1 = xrealloc(iVar1,param_3);\n    *param_1 = param_3;\n    *param_2 = iVar1;\n    return;\n  }" ({ "{") (expression_statement "iVar1 = xrealloc(iVar1,param_3);" (assignment_expression "iVar1 = xrealloc(iVar1,param_3)" (identifier "iVar1") (= "=") (call_expression "xrealloc(iVar1,param_3)" (identifier "xrealloc") (argument_list "(iVar1,param_3)" (( "(") (identifier "iVar1") (, ",") (identifier "param_3") () ")")))) (; ";")) (expression_statement "*param_1 = param_3;" (assignment_expression "*param_1 = param_3" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "param_3")) (; ";")) (expression_statement "*param_2 = iVar1;" (assignment_expression "*param_2 = iVar1" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "iVar1")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "xalloc_die(iVar1);" (call_expression "xalloc_die(iVar1)" (identifier "xalloc_die") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))) (; ";")) (} "}")))

/* DWARF original prototype: void resize_buffer(buffer * b, size_t newlen, buffer * b) */

void function_1(type_1 *b,size_t newlen,type_1 *var_1)

{
  int var_3;
  void *pvVar2;
  type_1 *var_2;
  
  if (var_1 <= (type_1 *)b->allocated) {
    return;
  }
  var_2 = (type_1 *)((int)b->allocated << 1);
  pvVar2 = *(void **)newlen;
  if (var_1 < var_2) {
    var_3 = (*(type_2 *)PTR_realloc_0003f464)(pvVar2,var_2);
    if (var_3 != 0) {
      b->allocated = (size_t)var_2;
      *(int *)newlen = var_3;
      return;
    }
    pvVar2 = *(void **)newlen;
  }
  if (-1 < (int)var_1) {
    pvVar2 = var_4(pvVar2,(size_t)var_1);
    b->allocated = (size_t)var_1;
    *(void **)newlen = pvVar2;
    return;
  }
                    /* WARNING: Subroutine does not return */
  var_5();
}


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

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

{
  int iVar1;
  uint uVar2;
  
  if (param_3 <= *param_1) {
    return;
  }
  uVar2 = *param_1 << 1;
  iVar1 = *param_2;
  if (param_3 < uVar2) {
    iVar1 = (*(code *)PTR_realloc_0003f464)(iVar1,uVar2);
    if (iVar1 != 0) {
      *param_1 = uVar2;
      *param_2 = iVar1;
      return;
    }
    iVar1 = *param_2;
  }
  if (-1 < (int)param_3) {
    iVar1 = xrealloc(iVar1,param_3);
    *param_1 = param_3;
    *param_2 = iVar1;
    return;
  }
                    /* WARNING: Subroutine does not return */
  xalloc_die(iVar1);
}

