
void bufchain_add(bufchain *ch,void *data,int len)

{
  bufchain_granule *pbVar1;
  char *pcVar2;
  char *buf;
  int iVar3;
  size_t n;
  
  if (len == 0) {
    return;
  }
  ch->buffersize = ch->buffersize + len;
  if (0 < len) {
    pbVar1 = ch->tail;
    n = len + 0x10;
    if (pbVar1 != (bufchain_granule *)0x0) {
      pcVar2 = pbVar1->bufend;
      iVar3 = (int)pbVar1->bufmax - (int)pcVar2;
      if (pcVar2 < pbVar1->bufmax) {
        if (len < iVar3) {
          iVar3 = len;
        }
        (*(code *)PTR_memcpy_0006a598)(pcVar2,data);
        len = len - iVar3;
        ch->tail->bufend = ch->tail->bufend + iVar3;
        if (len < 1) {
          return;
        }
      }
      n = len + 0x10;
    }
    if (n < 0x200) {
      n = 0x200;
    }
                    /* WARNING: Subroutine does not return */
    safemalloc(n,1);
  }
  return;
}



void FUN_0001f7f0(undefined4 *param_1,int param_2,int param_3)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  int iVar3;
  uint uVar4;
  
  if (param_3 == 0) {
    return;
  }
  param_1[2] = param_1[2] + param_3;
  if (0 < param_3) {
    puVar1 = (undefined4 *)param_1[1];
    do {
      if (puVar1 != (undefined4 *)0x0) {
        uVar4 = puVar1[2];
        iVar3 = puVar1[3] - uVar4;
        if (uVar4 < (uint)puVar1[3]) {
          if (param_3 < iVar3) {
            iVar3 = param_3;
          }
          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);
          param_3 = param_3 - iVar3;
          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;
          if (param_3 < 1) {
            return;
          }
          param_2 = param_2 + iVar3;
        }
      }
      uVar4 = param_3 + 0x10;
      if (uVar4 < 0x200) {
        uVar4 = 0x200;
      }
      puVar1 = (undefined4 *)safemalloc(uVar4,1);
      puVar2 = (undefined4 *)param_1[1];
      *puVar1 = 0;
      puVar1[2] = puVar1 + 4;
      puVar1[1] = puVar1 + 4;
      puVar1[3] = (int)puVar1 + uVar4;
      if (puVar2 == (undefined4 *)0x0) {
        *param_1 = puVar1;
        param_1[1] = puVar1;
      }
      else {
        *puVar2 = puVar1;
        param_1[1] = puVar1;
      }
    } while( true );
  }
  return;
}


lui gp,0x5
addiu gp,gp,0x2840
addu gp,gp,t9
beq a2,zero,0x0001f918
_nop
lw v0,0x8(a0)
addiu sp,sp,-0x38
addu v0,v0,a2
sw gp,0x10(sp)
sw s5,0x30(sp)
or s5,a0,zero
sw s0,0x1c(sp)
or s0,a2,zero
sw ra,0x34(sp)
sw s4,0x2c(sp)
sw s3,0x28(sp)
sw s2,0x24(sp)
sw s1,0x20(sp)
blez a2,0x0001f8e8
_sw v0,0x8(a0)
lw v0,0x4(a0)
li s4,0x200
lw s3,-0x7f6c(gp)
or s2,a1,zero
beq v0,zero,0x0001f870
_addiu s1,s0,0x10
lw a0,0x8(v0)
lw a2,0xc(v0)
sltu v0,a0,a2
bne v0,zero,0x0001f8b8
_subu a2,a2,a0
addiu s1,s0,0x10
li a1,0x1
sltiu v0,s1,0x200
movn s1,s4,v0
or t9,s3,zero
bal 0x0001f494
_or a0,s1,zero
lw a0,0x4(s5)
addiu v1,v0,0x10
addu s1,v0,s1
lw gp,0x10(sp)
sw zero,0x0(v0)
sw v1,0x8(v0)
sw v1,0x4(v0)
beq a0,zero,0x0001f90c
_sw s1,0xc(v0)
sw v0,0x0(a0)
b 0x0001f850
_sw v0,0x4(s5)
lw t9,-0x7a98(gp)
or a1,s2,zero
slt s1,s0,a2
movn a2,s0,s1
jalr t9
_or s1,a2,zero
lw v1,0x4(s5)
subu s0,s0,s1
lw v0,0x8(v1)
addu v0,v0,s1
bgtz s0,0x0001f920
_sw v0,0x8(v1)
lw ra,0x34(sp)
lw s5,0x30(sp)
lw s4,0x2c(sp)
lw s3,0x28(sp)
lw s2,0x24(sp)
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x38
sw v0,0x0(s5)
b 0x0001f850
_sw v0,0x4(s5)
jr ra
_nop
b 0x0001f86c
_addu s2,s2,s1
(translation_unit "void FUN_0001f7f0(undefined4 *param_1,int param_2,int param_3)\n\n{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  int iVar3;\n  uint uVar4;\n  \n  if (param_3 == 0) {\n    return;\n  }\n  param_1[2] = param_1[2] + param_3;\n  if (0 < param_3) {\n    puVar1 = (undefined4 *)param_1[1];\n    do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );\n  }\n  return;\n}\n\n" (function_definition "void FUN_0001f7f0(undefined4 *param_1,int param_2,int param_3)\n\n{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  int iVar3;\n  uint uVar4;\n  \n  if (param_3 == 0) {\n    return;\n  }\n  param_1[2] = param_1[2] + param_3;\n  if (0 < param_3) {\n    puVar1 = (undefined4 *)param_1[1];\n    do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );\n  }\n  return;\n}" primitive_type (function_declarator "FUN_0001f7f0(undefined4 *param_1,int param_2,int param_3)" identifier (parameter_list "(undefined4 *param_1,int param_2,int param_3)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  int iVar3;\n  uint uVar4;\n  \n  if (param_3 == 0) {\n    return;\n  }\n  param_1[2] = param_1[2] + param_3;\n  if (0 < param_3) {\n    puVar1 = (undefined4 *)param_1[1];\n    do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );\n  }\n  return;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "undefined4 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (if_statement "if (param_3 == 0) {\n    return;\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "param_1[2] = param_1[2] + param_3;" (assignment_expression "param_1[2] = param_1[2] + param_3" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "param_1[2] + param_3" (subscript_expression "param_1[2]" identifier [ number_literal ]) + identifier)) ;) (if_statement "if (0 < param_3) {\n    puVar1 = (undefined4 *)param_1[1];\n    do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );\n  }" if (parenthesized_expression "(0 < param_3)" ( (binary_expression "0 < param_3" number_literal < identifier) )) (compound_statement "{\n    puVar1 = (undefined4 *)param_1[1];\n    do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );\n  }" { (expression_statement "puVar1 = (undefined4 *)param_1[1];" (assignment_expression "puVar1 = (undefined4 *)param_1[1]" identifier = (cast_expression "(undefined4 *)param_1[1]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) ;) (do_statement "do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );" do (compound_statement "{\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    }" { (if_statement "if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }" if (parenthesized_expression "(puVar1 != (undefined4 *)0x0)" ( (binary_expression "puVar1 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }" { (expression_statement "uVar4 = puVar1[2];" (assignment_expression "uVar4 = puVar1[2]" identifier = (subscript_expression "puVar1[2]" identifier [ number_literal ])) ;) (expression_statement "iVar3 = puVar1[3] - uVar4;" (assignment_expression "iVar3 = puVar1[3] - uVar4" identifier = (binary_expression "puVar1[3] - uVar4" (subscript_expression "puVar1[3]" identifier [ number_literal ]) - identifier)) ;) (if_statement "if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }" if (parenthesized_expression "(uVar4 < (uint)puVar1[3])" ( (binary_expression "uVar4 < (uint)puVar1[3]" identifier < (cast_expression "(uint)puVar1[3]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "puVar1[3]" identifier [ number_literal ]))) )) (compound_statement "{\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }" { (if_statement "if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }" if (parenthesized_expression "(param_3 < iVar3)" ( (binary_expression "param_3 < iVar3" identifier < identifier) )) (compound_statement "{\n            iVar3 = param_3;\n          }" { (expression_statement "iVar3 = param_3;" (assignment_expression "iVar3 = param_3" identifier = identifier) ;) })) (expression_statement "(*(code *)PTR_memcpy_0006a598)(uVar4,param_2);" (call_expression "(*(code *)PTR_memcpy_0006a598)(uVar4,param_2)" (parenthesized_expression "(*(code *)PTR_memcpy_0006a598)" ( (pointer_expression "*(code *)PTR_memcpy_0006a598" * (cast_expression "(code *)PTR_memcpy_0006a598" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(uVar4,param_2)" ( identifier , identifier ))) ;) (expression_statement "param_3 = param_3 - iVar3;" (assignment_expression "param_3 = param_3 - iVar3" identifier = (binary_expression "param_3 - iVar3" identifier - identifier)) ;) (expression_statement "*(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;" (assignment_expression "*(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3" (pointer_expression "*(int *)(param_1[1] + 8)" * (cast_expression "(int *)(param_1[1] + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1[1] + 8)" ( (binary_expression "param_1[1] + 8" (subscript_expression "param_1[1]" identifier [ number_literal ]) + number_literal) )))) = (binary_expression "*(int *)(param_1[1] + 8) + iVar3" (pointer_expression "*(int *)(param_1[1] + 8)" * (cast_expression "(int *)(param_1[1] + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1[1] + 8)" ( (binary_expression "param_1[1] + 8" (subscript_expression "param_1[1]" identifier [ number_literal ]) + number_literal) )))) + identifier)) ;) (if_statement "if (param_3 < 1) {\n            return;\n          }" if (parenthesized_expression "(param_3 < 1)" ( (binary_expression "param_3 < 1" identifier < number_literal) )) (compound_statement "{\n            return;\n          }" { (return_statement "return;" return ;) })) (expression_statement "param_2 = param_2 + iVar3;" (assignment_expression "param_2 = param_2 + iVar3" identifier = (binary_expression "param_2 + iVar3" identifier + identifier)) ;) })) })) (expression_statement "uVar4 = param_3 + 0x10;" (assignment_expression "uVar4 = param_3 + 0x10" identifier = (binary_expression "param_3 + 0x10" identifier + number_literal)) ;) (if_statement "if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }" if (parenthesized_expression "(uVar4 < 0x200)" ( (binary_expression "uVar4 < 0x200" identifier < number_literal) )) (compound_statement "{\n        uVar4 = 0x200;\n      }" { (expression_statement "uVar4 = 0x200;" (assignment_expression "uVar4 = 0x200" identifier = number_literal) ;) })) (expression_statement "puVar1 = (undefined4 *)safemalloc(uVar4,1);" (assignment_expression "puVar1 = (undefined4 *)safemalloc(uVar4,1)" identifier = (cast_expression "(undefined4 *)safemalloc(uVar4,1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc(uVar4,1)" identifier (argument_list "(uVar4,1)" ( identifier , number_literal ))))) ;) (expression_statement "puVar2 = (undefined4 *)param_1[1];" (assignment_expression "puVar2 = (undefined4 *)param_1[1]" identifier = (cast_expression "(undefined4 *)param_1[1]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) ;) (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" * identifier) = 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[1] = puVar1 + 4;" (assignment_expression "puVar1[1] = puVar1 + 4" (subscript_expression "puVar1[1]" identifier [ number_literal ]) = (binary_expression "puVar1 + 4" identifier + number_literal)) ;) (expression_statement "puVar1[3] = (int)puVar1 + uVar4;" (assignment_expression "puVar1[3] = (int)puVar1 + uVar4" (subscript_expression "puVar1[3]" identifier [ number_literal ]) = (binary_expression "(int)puVar1 + uVar4" (cast_expression "(int)puVar1" ( (type_descriptor "int" primitive_type) ) identifier) + identifier)) ;) (if_statement "if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }" if (parenthesized_expression "(puVar2 == (undefined4 *)0x0)" ( (binary_expression "puVar2 == (undefined4 *)0x0" identifier == (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }" { (expression_statement "*param_1 = puVar1;" (assignment_expression "*param_1 = puVar1" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "param_1[1] = puVar1;" (assignment_expression "param_1[1] = puVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) }) (else_clause "else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }" else (compound_statement "{\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }" { (expression_statement "*puVar2 = puVar1;" (assignment_expression "*puVar2 = puVar1" (pointer_expression "*puVar2" * identifier) = identifier) ;) (expression_statement "param_1[1] = puVar1;" (assignment_expression "param_1[1] = puVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) }))) }) while (parenthesized_expression "( true )" ( true )) ;) })) (return_statement "return;" return ;) })))
(translation_unit "void bufchain_add(bufchain *ch,void *data,int len)\n\n{\n  bufchain_granule *pbVar1;\n  char *pcVar2;\n  char *buf;\n  int iVar3;\n  size_t n;\n  \n  if (len == 0) {\n    return;\n  }\n  ch->buffersize = ch->buffersize + len;\n  if (0 < len) {\n    pbVar1 = ch->tail;\n    n = len + 0x10;\n    if (pbVar1 != (bufchain_granule *)0x0) {\n      pcVar2 = pbVar1->bufend;\n      iVar3 = (int)pbVar1->bufmax - (int)pcVar2;\n      if (pcVar2 < pbVar1->bufmax) {\n        if (len < iVar3) {\n          iVar3 = len;\n        }\n        (*(code *)PTR_memcpy_0006a598)(pcVar2,data);\n        len = len - iVar3;\n        ch->tail->bufend = ch->tail->bufend + iVar3;\n        if (len < 1) {\n          return;\n        }\n      }\n      n = len + 0x10;\n    }\n    if (n < 0x200) {\n      n = 0x200;\n    }\n                    /* WARNING: Subroutine does not return */\n    safemalloc(n,1);\n  }\n  return;\n}\n\n" (function_definition "void bufchain_add(bufchain *ch,void *data,int len)\n\n{\n  bufchain_granule *pbVar1;\n  char *pcVar2;\n  char *buf;\n  int iVar3;\n  size_t n;\n  \n  if (len == 0) {\n    return;\n  }\n  ch->buffersize = ch->buffersize + len;\n  if (0 < len) {\n    pbVar1 = ch->tail;\n    n = len + 0x10;\n    if (pbVar1 != (bufchain_granule *)0x0) {\n      pcVar2 = pbVar1->bufend;\n      iVar3 = (int)pbVar1->bufmax - (int)pcVar2;\n      if (pcVar2 < pbVar1->bufmax) {\n        if (len < iVar3) {\n          iVar3 = len;\n        }\n        (*(code *)PTR_memcpy_0006a598)(pcVar2,data);\n        len = len - iVar3;\n        ch->tail->bufend = ch->tail->bufend + iVar3;\n        if (len < 1) {\n          return;\n        }\n      }\n      n = len + 0x10;\n    }\n    if (n < 0x200) {\n      n = 0x200;\n    }\n                    /* WARNING: Subroutine does not return */\n    safemalloc(n,1);\n  }\n  return;\n}" primitive_type (function_declarator "bufchain_add(bufchain *ch,void *data,int len)" identifier (parameter_list "(bufchain *ch,void *data,int len)" ( (parameter_declaration "bufchain *ch" type_identifier (pointer_declarator "*ch" * identifier)) , (parameter_declaration "void *data" primitive_type (pointer_declarator "*data" * identifier)) , (parameter_declaration "int len" primitive_type identifier) ))) (compound_statement "{\n  bufchain_granule *pbVar1;\n  char *pcVar2;\n  char *buf;\n  int iVar3;\n  size_t n;\n  \n  if (len == 0) {\n    return;\n  }\n  ch->buffersize = ch->buffersize + len;\n  if (0 < len) {\n    pbVar1 = ch->tail;\n    n = len + 0x10;\n    if (pbVar1 != (bufchain_granule *)0x0) {\n      pcVar2 = pbVar1->bufend;\n      iVar3 = (int)pbVar1->bufmax - (int)pcVar2;\n      if (pcVar2 < pbVar1->bufmax) {\n        if (len < iVar3) {\n          iVar3 = len;\n        }\n        (*(code *)PTR_memcpy_0006a598)(pcVar2,data);\n        len = len - iVar3;\n        ch->tail->bufend = ch->tail->bufend + iVar3;\n        if (len < 1) {\n          return;\n        }\n      }\n      n = len + 0x10;\n    }\n    if (n < 0x200) {\n      n = 0x200;\n    }\n                    /* WARNING: Subroutine does not return */\n    safemalloc(n,1);\n  }\n  return;\n}" { (declaration "bufchain_granule *pbVar1;" type_identifier (pointer_declarator "*pbVar1" * identifier) ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "char *buf;" primitive_type (pointer_declarator "*buf" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "size_t n;" primitive_type identifier ;) (if_statement "if (len == 0) {\n    return;\n  }" if (parenthesized_expression "(len == 0)" ( (binary_expression "len == 0" identifier == number_literal) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "ch->buffersize = ch->buffersize + len;" (assignment_expression "ch->buffersize = ch->buffersize + len" (field_expression "ch->buffersize" identifier -> field_identifier) = (binary_expression "ch->buffersize + len" (field_expression "ch->buffersize" identifier -> field_identifier) + identifier)) ;) (if_statement "if (0 < len) {\n    pbVar1 = ch->tail;\n    n = len + 0x10;\n    if (pbVar1 != (bufchain_granule *)0x0) {\n      pcVar2 = pbVar1->bufend;\n      iVar3 = (int)pbVar1->bufmax - (int)pcVar2;\n      if (pcVar2 < pbVar1->bufmax) {\n        if (len < iVar3) {\n          iVar3 = len;\n        }\n        (*(code *)PTR_memcpy_0006a598)(pcVar2,data);\n        len = len - iVar3;\n        ch->tail->bufend = ch->tail->bufend + iVar3;\n        if (len < 1) {\n          return;\n        }\n      }\n      n = len + 0x10;\n    }\n    if (n < 0x200) {\n      n = 0x200;\n    }\n                    /* WARNING: Subroutine does not return */\n    safemalloc(n,1);\n  }" if (parenthesized_expression "(0 < len)" ( (binary_expression "0 < len" number_literal < identifier) )) (compound_statement "{\n    pbVar1 = ch->tail;\n    n = len + 0x10;\n    if (pbVar1 != (bufchain_granule *)0x0) {\n      pcVar2 = pbVar1->bufend;\n      iVar3 = (int)pbVar1->bufmax - (int)pcVar2;\n      if (pcVar2 < pbVar1->bufmax) {\n        if (len < iVar3) {\n          iVar3 = len;\n        }\n        (*(code *)PTR_memcpy_0006a598)(pcVar2,data);\n        len = len - iVar3;\n        ch->tail->bufend = ch->tail->bufend + iVar3;\n        if (len < 1) {\n          return;\n        }\n      }\n      n = len + 0x10;\n    }\n    if (n < 0x200) {\n      n = 0x200;\n    }\n                    /* WARNING: Subroutine does not return */\n    safemalloc(n,1);\n  }" { (expression_statement "pbVar1 = ch->tail;" (assignment_expression "pbVar1 = ch->tail" identifier = (field_expression "ch->tail" identifier -> field_identifier)) ;) (expression_statement "n = len + 0x10;" (assignment_expression "n = len + 0x10" identifier = (binary_expression "len + 0x10" identifier + number_literal)) ;) (if_statement "if (pbVar1 != (bufchain_granule *)0x0) {\n      pcVar2 = pbVar1->bufend;\n      iVar3 = (int)pbVar1->bufmax - (int)pcVar2;\n      if (pcVar2 < pbVar1->bufmax) {\n        if (len < iVar3) {\n          iVar3 = len;\n        }\n        (*(code *)PTR_memcpy_0006a598)(pcVar2,data);\n        len = len - iVar3;\n        ch->tail->bufend = ch->tail->bufend + iVar3;\n        if (len < 1) {\n          return;\n        }\n      }\n      n = len + 0x10;\n    }" if (parenthesized_expression "(pbVar1 != (bufchain_granule *)0x0)" ( (binary_expression "pbVar1 != (bufchain_granule *)0x0" identifier != (cast_expression "(bufchain_granule *)0x0" ( (type_descriptor "bufchain_granule *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      pcVar2 = pbVar1->bufend;\n      iVar3 = (int)pbVar1->bufmax - (int)pcVar2;\n      if (pcVar2 < pbVar1->bufmax) {\n        if (len < iVar3) {\n          iVar3 = len;\n        }\n        (*(code *)PTR_memcpy_0006a598)(pcVar2,data);\n        len = len - iVar3;\n        ch->tail->bufend = ch->tail->bufend + iVar3;\n        if (len < 1) {\n          return;\n        }\n      }\n      n = len + 0x10;\n    }" { (expression_statement "pcVar2 = pbVar1->bufend;" (assignment_expression "pcVar2 = pbVar1->bufend" identifier = (field_expression "pbVar1->bufend" identifier -> field_identifier)) ;) (expression_statement "iVar3 = (int)pbVar1->bufmax - (int)pcVar2;" (assignment_expression "iVar3 = (int)pbVar1->bufmax - (int)pcVar2" identifier = (binary_expression "(int)pbVar1->bufmax - (int)pcVar2" (cast_expression "(int)pbVar1->bufmax" ( (type_descriptor "int" primitive_type) ) (field_expression "pbVar1->bufmax" identifier -> field_identifier)) - (cast_expression "(int)pcVar2" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (if_statement "if (pcVar2 < pbVar1->bufmax) {\n        if (len < iVar3) {\n          iVar3 = len;\n        }\n        (*(code *)PTR_memcpy_0006a598)(pcVar2,data);\n        len = len - iVar3;\n        ch->tail->bufend = ch->tail->bufend + iVar3;\n        if (len < 1) {\n          return;\n        }\n      }" if (parenthesized_expression "(pcVar2 < pbVar1->bufmax)" ( (binary_expression "pcVar2 < pbVar1->bufmax" identifier < (field_expression "pbVar1->bufmax" identifier -> field_identifier)) )) (compound_statement "{\n        if (len < iVar3) {\n          iVar3 = len;\n        }\n        (*(code *)PTR_memcpy_0006a598)(pcVar2,data);\n        len = len - iVar3;\n        ch->tail->bufend = ch->tail->bufend + iVar3;\n        if (len < 1) {\n          return;\n        }\n      }" { (if_statement "if (len < iVar3) {\n          iVar3 = len;\n        }" if (parenthesized_expression "(len < iVar3)" ( (binary_expression "len < iVar3" identifier < identifier) )) (compound_statement "{\n          iVar3 = len;\n        }" { (expression_statement "iVar3 = len;" (assignment_expression "iVar3 = len" identifier = identifier) ;) })) (expression_statement "(*(code *)PTR_memcpy_0006a598)(pcVar2,data);" (call_expression "(*(code *)PTR_memcpy_0006a598)(pcVar2,data)" (parenthesized_expression "(*(code *)PTR_memcpy_0006a598)" ( (pointer_expression "*(code *)PTR_memcpy_0006a598" * (cast_expression "(code *)PTR_memcpy_0006a598" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar2,data)" ( identifier , identifier ))) ;) (expression_statement "len = len - iVar3;" (assignment_expression "len = len - iVar3" identifier = (binary_expression "len - iVar3" identifier - identifier)) ;) (expression_statement "ch->tail->bufend = ch->tail->bufend + iVar3;" (assignment_expression "ch->tail->bufend = ch->tail->bufend + iVar3" (field_expression "ch->tail->bufend" (field_expression "ch->tail" identifier -> field_identifier) -> field_identifier) = (binary_expression "ch->tail->bufend + iVar3" (field_expression "ch->tail->bufend" (field_expression "ch->tail" identifier -> field_identifier) -> field_identifier) + identifier)) ;) (if_statement "if (len < 1) {\n          return;\n        }" if (parenthesized_expression "(len < 1)" ( (binary_expression "len < 1" identifier < number_literal) )) (compound_statement "{\n          return;\n        }" { (return_statement "return;" return ;) })) })) (expression_statement "n = len + 0x10;" (assignment_expression "n = len + 0x10" identifier = (binary_expression "len + 0x10" identifier + number_literal)) ;) })) (if_statement "if (n < 0x200) {\n      n = 0x200;\n    }" if (parenthesized_expression "(n < 0x200)" ( (binary_expression "n < 0x200" identifier < number_literal) )) (compound_statement "{\n      n = 0x200;\n    }" { (expression_statement "n = 0x200;" (assignment_expression "n = 0x200" identifier = number_literal) ;) })) comment (expression_statement "safemalloc(n,1);" (call_expression "safemalloc(n,1)" identifier (argument_list "(n,1)" ( identifier , number_literal ))) ;) })) (return_statement "return;" return ;) })))
(translation_unit "void FUN_0001f7f0(undefined4 *param_1,int param_2,int param_3)\n\n{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  int iVar3;\n  uint uVar4;\n  \n  if (param_3 == 0) {\n    return;\n  }\n  param_1[2] = param_1[2] + param_3;\n  if (0 < param_3) {\n    puVar1 = (undefined4 *)param_1[1];\n    do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );\n  }\n  return;\n}\n\n" (function_definition "void FUN_0001f7f0(undefined4 *param_1,int param_2,int param_3)\n\n{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  int iVar3;\n  uint uVar4;\n  \n  if (param_3 == 0) {\n    return;\n  }\n  param_1[2] = param_1[2] + param_3;\n  if (0 < param_3) {\n    puVar1 = (undefined4 *)param_1[1];\n    do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );\n  }\n  return;\n}" primitive_type (function_declarator "FUN_0001f7f0(undefined4 *param_1,int param_2,int param_3)" identifier (parameter_list "(undefined4 *param_1,int param_2,int param_3)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  int iVar3;\n  uint uVar4;\n  \n  if (param_3 == 0) {\n    return;\n  }\n  param_1[2] = param_1[2] + param_3;\n  if (0 < param_3) {\n    puVar1 = (undefined4 *)param_1[1];\n    do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );\n  }\n  return;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "undefined4 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (if_statement "if (param_3 == 0) {\n    return;\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "param_1[2] = param_1[2] + param_3;" (assignment_expression "param_1[2] = param_1[2] + param_3" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "param_1[2] + param_3" (subscript_expression "param_1[2]" identifier [ number_literal ]) + identifier)) ;) (if_statement "if (0 < param_3) {\n    puVar1 = (undefined4 *)param_1[1];\n    do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );\n  }" if (parenthesized_expression "(0 < param_3)" ( (binary_expression "0 < param_3" number_literal < identifier) )) (compound_statement "{\n    puVar1 = (undefined4 *)param_1[1];\n    do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );\n  }" { (expression_statement "puVar1 = (undefined4 *)param_1[1];" (assignment_expression "puVar1 = (undefined4 *)param_1[1]" identifier = (cast_expression "(undefined4 *)param_1[1]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) ;) (do_statement "do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );" do (compound_statement "{\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    }" { (if_statement "if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }" if (parenthesized_expression "(puVar1 != (undefined4 *)0x0)" ( (binary_expression "puVar1 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }" { (expression_statement "uVar4 = puVar1[2];" (assignment_expression "uVar4 = puVar1[2]" identifier = (subscript_expression "puVar1[2]" identifier [ number_literal ])) ;) (expression_statement "iVar3 = puVar1[3] - uVar4;" (assignment_expression "iVar3 = puVar1[3] - uVar4" identifier = (binary_expression "puVar1[3] - uVar4" (subscript_expression "puVar1[3]" identifier [ number_literal ]) - identifier)) ;) (if_statement "if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }" if (parenthesized_expression "(uVar4 < (uint)puVar1[3])" ( (binary_expression "uVar4 < (uint)puVar1[3]" identifier < (cast_expression "(uint)puVar1[3]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "puVar1[3]" identifier [ number_literal ]))) )) (compound_statement "{\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }" { (if_statement "if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }" if (parenthesized_expression "(param_3 < iVar3)" ( (binary_expression "param_3 < iVar3" identifier < identifier) )) (compound_statement "{\n            iVar3 = param_3;\n          }" { (expression_statement "iVar3 = param_3;" (assignment_expression "iVar3 = param_3" identifier = identifier) ;) })) (expression_statement "(*(code *)PTR_memcpy_0006a598)(uVar4,param_2);" (call_expression "(*(code *)PTR_memcpy_0006a598)(uVar4,param_2)" (parenthesized_expression "(*(code *)PTR_memcpy_0006a598)" ( (pointer_expression "*(code *)PTR_memcpy_0006a598" * (cast_expression "(code *)PTR_memcpy_0006a598" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(uVar4,param_2)" ( identifier , identifier ))) ;) (expression_statement "param_3 = param_3 - iVar3;" (assignment_expression "param_3 = param_3 - iVar3" identifier = (binary_expression "param_3 - iVar3" identifier - identifier)) ;) (expression_statement "*(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;" (assignment_expression "*(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3" (pointer_expression "*(int *)(param_1[1] + 8)" * (cast_expression "(int *)(param_1[1] + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1[1] + 8)" ( (binary_expression "param_1[1] + 8" (subscript_expression "param_1[1]" identifier [ number_literal ]) + number_literal) )))) = (binary_expression "*(int *)(param_1[1] + 8) + iVar3" (pointer_expression "*(int *)(param_1[1] + 8)" * (cast_expression "(int *)(param_1[1] + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1[1] + 8)" ( (binary_expression "param_1[1] + 8" (subscript_expression "param_1[1]" identifier [ number_literal ]) + number_literal) )))) + identifier)) ;) (if_statement "if (param_3 < 1) {\n            return;\n          }" if (parenthesized_expression "(param_3 < 1)" ( (binary_expression "param_3 < 1" identifier < number_literal) )) (compound_statement "{\n            return;\n          }" { (return_statement "return;" return ;) })) (expression_statement "param_2 = param_2 + iVar3;" (assignment_expression "param_2 = param_2 + iVar3" identifier = (binary_expression "param_2 + iVar3" identifier + identifier)) ;) })) })) (expression_statement "uVar4 = param_3 + 0x10;" (assignment_expression "uVar4 = param_3 + 0x10" identifier = (binary_expression "param_3 + 0x10" identifier + number_literal)) ;) (if_statement "if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }" if (parenthesized_expression "(uVar4 < 0x200)" ( (binary_expression "uVar4 < 0x200" identifier < number_literal) )) (compound_statement "{\n        uVar4 = 0x200;\n      }" { (expression_statement "uVar4 = 0x200;" (assignment_expression "uVar4 = 0x200" identifier = number_literal) ;) })) (expression_statement "puVar1 = (undefined4 *)safemalloc(uVar4,1);" (assignment_expression "puVar1 = (undefined4 *)safemalloc(uVar4,1)" identifier = (cast_expression "(undefined4 *)safemalloc(uVar4,1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc(uVar4,1)" identifier (argument_list "(uVar4,1)" ( identifier , number_literal ))))) ;) (expression_statement "puVar2 = (undefined4 *)param_1[1];" (assignment_expression "puVar2 = (undefined4 *)param_1[1]" identifier = (cast_expression "(undefined4 *)param_1[1]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) ;) (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" * identifier) = 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[1] = puVar1 + 4;" (assignment_expression "puVar1[1] = puVar1 + 4" (subscript_expression "puVar1[1]" identifier [ number_literal ]) = (binary_expression "puVar1 + 4" identifier + number_literal)) ;) (expression_statement "puVar1[3] = (int)puVar1 + uVar4;" (assignment_expression "puVar1[3] = (int)puVar1 + uVar4" (subscript_expression "puVar1[3]" identifier [ number_literal ]) = (binary_expression "(int)puVar1 + uVar4" (cast_expression "(int)puVar1" ( (type_descriptor "int" primitive_type) ) identifier) + identifier)) ;) (if_statement "if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }" if (parenthesized_expression "(puVar2 == (undefined4 *)0x0)" ( (binary_expression "puVar2 == (undefined4 *)0x0" identifier == (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }" { (expression_statement "*param_1 = puVar1;" (assignment_expression "*param_1 = puVar1" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "param_1[1] = puVar1;" (assignment_expression "param_1[1] = puVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) }) (else_clause "else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }" else (compound_statement "{\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }" { (expression_statement "*puVar2 = puVar1;" (assignment_expression "*puVar2 = puVar1" (pointer_expression "*puVar2" * identifier) = identifier) ;) (expression_statement "param_1[1] = puVar1;" (assignment_expression "param_1[1] = puVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) }))) }) while (parenthesized_expression "( true )" ( true )) ;) })) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return ;) })) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (subscript_expression IDENT [ LIT ]) + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (do_statement do (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ]))) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , IDENT ))) ;) (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 (subscript_expression IDENT [ LIT ]) + LIT) )))) = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) + LIT) )))) + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) })) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , LIT ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) }))) }) while (parenthesized_expression ( BOOL )) ;) })) (return_statement return ;) })))
(function_definition "void FUN_0001f7f0(undefined4 *param_1,int param_2,int param_3)\n\n{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  int iVar3;\n  uint uVar4;\n  \n  if (param_3 == 0) {\n    return;\n  }\n  param_1[2] = param_1[2] + param_3;\n  if (0 < param_3) {\n    puVar1 = (undefined4 *)param_1[1];\n    do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );\n  }\n  return;\n}" (primitive_type "void") (function_declarator "FUN_0001f7f0(undefined4 *param_1,int param_2,int param_3)" (identifier "FUN_0001f7f0") (parameter_list "(undefined4 *param_1,int param_2,int param_3)" (( "(") (parameter_declaration "undefined4 *param_1" (type_identifier "undefined4") (pointer_declarator "*param_1" (* "*") (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  undefined4 *puVar1;\n  undefined4 *puVar2;\n  int iVar3;\n  uint uVar4;\n  \n  if (param_3 == 0) {\n    return;\n  }\n  param_1[2] = param_1[2] + param_3;\n  if (0 < param_3) {\n    puVar1 = (undefined4 *)param_1[1];\n    do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );\n  }\n  return;\n}" ({ "{") (declaration "undefined4 *puVar1;" (type_identifier "undefined4") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "undefined4 *puVar2;" (type_identifier "undefined4") (pointer_declarator "*puVar2" (* "*") (identifier "puVar2")) (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (if_statement "if (param_3 == 0) {\n    return;\n  }" (if "if") (parenthesized_expression "(param_3 == 0)" (( "(") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    return;\n  }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "param_1[2] = param_1[2] + param_3;" (assignment_expression "param_1[2] = param_1[2] + param_3" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (binary_expression "param_1[2] + param_3" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (+ "+") (identifier "param_3"))) (; ";")) (if_statement "if (0 < param_3) {\n    puVar1 = (undefined4 *)param_1[1];\n    do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );\n  }" (if "if") (parenthesized_expression "(0 < param_3)" (( "(") (binary_expression "0 < param_3" (number_literal "0") (< "<") (identifier "param_3")) () ")")) (compound_statement "{\n    puVar1 = (undefined4 *)param_1[1];\n    do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );\n  }" ({ "{") (expression_statement "puVar1 = (undefined4 *)param_1[1];" (assignment_expression "puVar1 = (undefined4 *)param_1[1]" (identifier "puVar1") (= "=") (cast_expression "(undefined4 *)param_1[1]" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")))) (; ";")) (do_statement "do {\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    } while( true );" (do "do") (compound_statement "{\n      if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }\n      uVar4 = param_3 + 0x10;\n      if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }\n      puVar1 = (undefined4 *)safemalloc(uVar4,1);\n      puVar2 = (undefined4 *)param_1[1];\n      *puVar1 = 0;\n      puVar1[2] = puVar1 + 4;\n      puVar1[1] = puVar1 + 4;\n      puVar1[3] = (int)puVar1 + uVar4;\n      if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }\n    }" ({ "{") (if_statement "if (puVar1 != (undefined4 *)0x0) {\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }" (if "if") (parenthesized_expression "(puVar1 != (undefined4 *)0x0)" (( "(") (binary_expression "puVar1 != (undefined4 *)0x0" (identifier "puVar1") (!= "!=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        uVar4 = puVar1[2];\n        iVar3 = puVar1[3] - uVar4;\n        if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }\n      }" ({ "{") (expression_statement "uVar4 = puVar1[2];" (assignment_expression "uVar4 = puVar1[2]" (identifier "uVar4") (= "=") (subscript_expression "puVar1[2]" (identifier "puVar1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (expression_statement "iVar3 = puVar1[3] - uVar4;" (assignment_expression "iVar3 = puVar1[3] - uVar4" (identifier "iVar3") (= "=") (binary_expression "puVar1[3] - uVar4" (subscript_expression "puVar1[3]" (identifier "puVar1") ([ "[") (number_literal "3") (] "]")) (- "-") (identifier "uVar4"))) (; ";")) (if_statement "if (uVar4 < (uint)puVar1[3]) {\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }" (if "if") (parenthesized_expression "(uVar4 < (uint)puVar1[3])" (( "(") (binary_expression "uVar4 < (uint)puVar1[3]" (identifier "uVar4") (< "<") (cast_expression "(uint)puVar1[3]" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (subscript_expression "puVar1[3]" (identifier "puVar1") ([ "[") (number_literal "3") (] "]")))) () ")")) (compound_statement "{\n          if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }\n          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);\n          param_3 = param_3 - iVar3;\n          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;\n          if (param_3 < 1) {\n            return;\n          }\n          param_2 = param_2 + iVar3;\n        }" ({ "{") (if_statement "if (param_3 < iVar3) {\n            iVar3 = param_3;\n          }" (if "if") (parenthesized_expression "(param_3 < iVar3)" (( "(") (binary_expression "param_3 < iVar3" (identifier "param_3") (< "<") (identifier "iVar3")) () ")")) (compound_statement "{\n            iVar3 = param_3;\n          }" ({ "{") (expression_statement "iVar3 = param_3;" (assignment_expression "iVar3 = param_3" (identifier "iVar3") (= "=") (identifier "param_3")) (; ";")) (} "}"))) (expression_statement "(*(code *)PTR_memcpy_0006a598)(uVar4,param_2);" (call_expression "(*(code *)PTR_memcpy_0006a598)(uVar4,param_2)" (parenthesized_expression "(*(code *)PTR_memcpy_0006a598)" (( "(") (pointer_expression "*(code *)PTR_memcpy_0006a598" (* "*") (cast_expression "(code *)PTR_memcpy_0006a598" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_memcpy_0006a598"))) () ")")) (argument_list "(uVar4,param_2)" (( "(") (identifier "uVar4") (, ",") (identifier "param_2") () ")"))) (; ";")) (expression_statement "param_3 = param_3 - iVar3;" (assignment_expression "param_3 = param_3 - iVar3" (identifier "param_3") (= "=") (binary_expression "param_3 - iVar3" (identifier "param_3") (- "-") (identifier "iVar3"))) (; ";")) (expression_statement "*(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;" (assignment_expression "*(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3" (pointer_expression "*(int *)(param_1[1] + 8)" (* "*") (cast_expression "(int *)(param_1[1] + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1[1] + 8)" (( "(") (binary_expression "param_1[1] + 8" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (+ "+") (number_literal "8")) () ")")))) (= "=") (binary_expression "*(int *)(param_1[1] + 8) + iVar3" (pointer_expression "*(int *)(param_1[1] + 8)" (* "*") (cast_expression "(int *)(param_1[1] + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1[1] + 8)" (( "(") (binary_expression "param_1[1] + 8" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (+ "+") (number_literal "8")) () ")")))) (+ "+") (identifier "iVar3"))) (; ";")) (if_statement "if (param_3 < 1) {\n            return;\n          }" (if "if") (parenthesized_expression "(param_3 < 1)" (( "(") (binary_expression "param_3 < 1" (identifier "param_3") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n            return;\n          }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "param_2 = param_2 + iVar3;" (assignment_expression "param_2 = param_2 + iVar3" (identifier "param_2") (= "=") (binary_expression "param_2 + iVar3" (identifier "param_2") (+ "+") (identifier "iVar3"))) (; ";")) (} "}"))) (} "}"))) (expression_statement "uVar4 = param_3 + 0x10;" (assignment_expression "uVar4 = param_3 + 0x10" (identifier "uVar4") (= "=") (binary_expression "param_3 + 0x10" (identifier "param_3") (+ "+") (number_literal "0x10"))) (; ";")) (if_statement "if (uVar4 < 0x200) {\n        uVar4 = 0x200;\n      }" (if "if") (parenthesized_expression "(uVar4 < 0x200)" (( "(") (binary_expression "uVar4 < 0x200" (identifier "uVar4") (< "<") (number_literal "0x200")) () ")")) (compound_statement "{\n        uVar4 = 0x200;\n      }" ({ "{") (expression_statement "uVar4 = 0x200;" (assignment_expression "uVar4 = 0x200" (identifier "uVar4") (= "=") (number_literal "0x200")) (; ";")) (} "}"))) (expression_statement "puVar1 = (undefined4 *)safemalloc(uVar4,1);" (assignment_expression "puVar1 = (undefined4 *)safemalloc(uVar4,1)" (identifier "puVar1") (= "=") (cast_expression "(undefined4 *)safemalloc(uVar4,1)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "safemalloc(uVar4,1)" (identifier "safemalloc") (argument_list "(uVar4,1)" (( "(") (identifier "uVar4") (, ",") (number_literal "1") () ")"))))) (; ";")) (expression_statement "puVar2 = (undefined4 *)param_1[1];" (assignment_expression "puVar2 = (undefined4 *)param_1[1]" (identifier "puVar2") (= "=") (cast_expression "(undefined4 *)param_1[1]" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")))) (; ";")) (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (= "=") (number_literal "0")) (; ";")) (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[1] = puVar1 + 4;" (assignment_expression "puVar1[1] = puVar1 + 4" (subscript_expression "puVar1[1]" (identifier "puVar1") ([ "[") (number_literal "1") (] "]")) (= "=") (binary_expression "puVar1 + 4" (identifier "puVar1") (+ "+") (number_literal "4"))) (; ";")) (expression_statement "puVar1[3] = (int)puVar1 + uVar4;" (assignment_expression "puVar1[3] = (int)puVar1 + uVar4" (subscript_expression "puVar1[3]" (identifier "puVar1") ([ "[") (number_literal "3") (] "]")) (= "=") (binary_expression "(int)puVar1 + uVar4" (cast_expression "(int)puVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "puVar1")) (+ "+") (identifier "uVar4"))) (; ";")) (if_statement "if (puVar2 == (undefined4 *)0x0) {\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }\n      else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }" (if "if") (parenthesized_expression "(puVar2 == (undefined4 *)0x0)" (( "(") (binary_expression "puVar2 == (undefined4 *)0x0" (identifier "puVar2") (== "==") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        *param_1 = puVar1;\n        param_1[1] = puVar1;\n      }" ({ "{") (expression_statement "*param_1 = puVar1;" (assignment_expression "*param_1 = puVar1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "puVar1")) (; ";")) (expression_statement "param_1[1] = puVar1;" (assignment_expression "param_1[1] = puVar1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "puVar1")) (; ";")) (} "}")) (else_clause "else {\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }" (else "else") (compound_statement "{\n        *puVar2 = puVar1;\n        param_1[1] = puVar1;\n      }" ({ "{") (expression_statement "*puVar2 = puVar1;" (assignment_expression "*puVar2 = puVar1" (pointer_expression "*puVar2" (* "*") (identifier "puVar2")) (= "=") (identifier "puVar1")) (; ";")) (expression_statement "param_1[1] = puVar1;" (assignment_expression "param_1[1] = puVar1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "puVar1")) (; ";")) (} "}")))) (} "}")) (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (; ";")) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))
(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: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))))) (do_statement body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier)) value: (subscript_expression argument: (identifier) index: (number_literal))))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (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 (identifier) (identifier)))) (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: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))))) right: (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))))) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (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: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) 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: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))))))) condition: (parenthesized_expression (true))))) (return_statement))))

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

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  int iVar3;
  uint uVar4;
  
  if (param_3 == 0) {
    return;
  }
  param_1[2] = param_1[2] + param_3;
  if (0 < param_3) {
    puVar1 = (undefined4 *)param_1[1];
    do {
      if (puVar1 != (undefined4 *)0x0) {
        uVar4 = puVar1[2];
        iVar3 = puVar1[3] - uVar4;
        if (uVar4 < (uint)puVar1[3]) {
          if (param_3 < iVar3) {
            iVar3 = param_3;
          }
          (*(code *)PTR_memcpy_0006a598)(uVar4,param_2);
          param_3 = param_3 - iVar3;
          *(int *)(param_1[1] + 8) = *(int *)(param_1[1] + 8) + iVar3;
          if (param_3 < 1) {
            return;
          }
          param_2 = param_2 + iVar3;
        }
      }
      uVar4 = param_3 + 0x10;
      if (uVar4 < 0x200) {
        uVar4 = 0x200;
      }
      puVar1 = (undefined4 *)safemalloc(uVar4,1);
      puVar2 = (undefined4 *)param_1[1];
      *puVar1 = 0;
      puVar1[2] = puVar1 + 4;
      puVar1[1] = puVar1 + 4;
      puVar1[3] = (int)puVar1 + uVar4;
      if (puVar2 == (undefined4 *)0x0) {
        *param_1 = puVar1;
        param_1[1] = puVar1;
      }
      else {
        *puVar2 = puVar1;
        param_1[1] = puVar1;
      }
    } while( true );
  }
  return;
}

