
void bufchain_consume(bufchain *ch,int len)

{
  bufchain_granule *ptr;
  bufchain_granule *pbVar1;
  int iVar2;
  long lVar3;
  
  if (ch->buffersize < len) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");
  }
  if (0 < len) {
    ptr = ch->head;
    while( true ) {
      if (ptr == (bufchain_granule *)0x0) {
                    /* WARNING: Subroutine does not return */
        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");
      }
      lVar3 = (long)ptr->bufend - (long)ptr->bufpos;
      if (len < lVar3) break;
      pbVar1 = ptr->next;
      ch->head = pbVar1;
      if (pbVar1 == (bufchain_granule *)0x0) {
        ch->tail = (bufchain_granule *)0x0;
      }
      safefree(ptr);
      iVar2 = (int)lVar3;
      ch->buffersize = ch->buffersize - iVar2;
      len = len - iVar2;
      if (len < 1) {
        return;
      }
      ptr = ch->head;
    }
    ptr->bufpos = ptr->bufpos + len;
    ch->buffersize = ch->buffersize - len;
  }
  return;
}



void FUN_0010dc5c(long *param_1,int param_2)

{
  long *plVar1;
  long lVar2;
  int iVar3;
  long lVar4;
  
  if ((int)param_1[2] < param_2) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");
  }
  if (0 < param_2) {
    plVar1 = (long *)*param_1;
    while( true ) {
      if (plVar1 == (long *)0x0) {
                    /* WARNING: Subroutine does not return */
        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");
      }
      lVar4 = plVar1[2] - plVar1[1];
      if (param_2 < lVar4) break;
      lVar2 = *plVar1;
      *param_1 = lVar2;
      if (lVar2 == 0) {
        param_1[1] = 0;
      }
      FUN_0010db2f();
      iVar3 = (int)lVar4;
      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;
      param_2 = param_2 - iVar3;
      if (param_2 < 1) {
        return;
      }
      plVar1 = (long *)*param_1;
    }
    plVar1[1] = plVar1[1] + (long)param_2;
    *(int *)(param_1 + 2) = (int)param_1[2] - param_2;
  }
  return;
}


PUSH R12
PUSH RBP
PUSH RBX
CMP dword ptr [RDI + 0x10],ESI
JL 0x0010dc99
MOV R12,RDI
MOV EBP,ESI
TEST ESI,ESI
JLE 0x0010dd0a
MOV RDI,qword ptr [RDI]
TEST RDI,RDI
JNZ 0x0010dcda
LEA RCX,[0x130850]
MOV EDX,0x2c7
LEA RSI,[0x13aade]
LEA RDI,[0x130916]
CALL 0x001041f0
LEA RCX,[0x130850]
MOV EDX,0x2c4
LEA RSI,[0x13aade]
LEA RDI,[0x1308e1]
CALL 0x001041f0
MOV qword ptr [R12 + 0x8],0x0
CALL 0x0010db2f
SUB dword ptr [R12 + 0x10],EBX
SUB EBP,EBX
TEST EBP,EBP
JLE 0x0010dd0a
MOV RDI,qword ptr [R12]
TEST RDI,RDI
JZ 0x0010dc7a
MOV RAX,qword ptr [RDI + 0x8]
MOV RBX,qword ptr [RDI + 0x10]
SUB RBX,RAX
MOVSXD RDX,EBP
CMP RDX,RBX
JL 0x0010dcfb
MOV RAX,qword ptr [RDI]
MOV qword ptr [R12],RAX
TEST RAX,RAX
JNZ 0x0010dcc1
JMP 0x0010dcb8
MOVSXD RDX,EBP
ADD RAX,RDX
MOV qword ptr [RDI + 0x8],RAX
SUB dword ptr [R12 + 0x10],EBP
POP RBX
POP RBP
POP R12
RET
(translation_unit "void FUN_0010dc5c(long *param_1,int param_2)\n\n{\n  long *plVar1;\n  long lVar2;\n  int iVar3;\n  long lVar4;\n  \n  if ((int)param_1[2] < param_2) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }\n  if (0 < param_2) {\n    plVar1 = (long *)*param_1;\n    while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }\n    plVar1[1] = plVar1[1] + (long)param_2;\n    *(int *)(param_1 + 2) = (int)param_1[2] - param_2;\n  }\n  return;\n}\n\n" (function_definition "void FUN_0010dc5c(long *param_1,int param_2)\n\n{\n  long *plVar1;\n  long lVar2;\n  int iVar3;\n  long lVar4;\n  \n  if ((int)param_1[2] < param_2) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }\n  if (0 < param_2) {\n    plVar1 = (long *)*param_1;\n    while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }\n    plVar1[1] = plVar1[1] + (long)param_2;\n    *(int *)(param_1 + 2) = (int)param_1[2] - param_2;\n  }\n  return;\n}" primitive_type (function_declarator "FUN_0010dc5c(long *param_1,int param_2)" identifier (parameter_list "(long *param_1,int param_2)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  long *plVar1;\n  long lVar2;\n  int iVar3;\n  long lVar4;\n  \n  if ((int)param_1[2] < param_2) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }\n  if (0 < param_2) {\n    plVar1 = (long *)*param_1;\n    while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }\n    plVar1[1] = plVar1[1] + (long)param_2;\n    *(int *)(param_1 + 2) = (int)param_1[2] - param_2;\n  }\n  return;\n}" { (declaration "long *plVar1;" (sized_type_specifier "long" long) (pointer_declarator "*plVar1" * identifier) ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (if_statement "if ((int)param_1[2] < param_2) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }" if (parenthesized_expression "((int)param_1[2] < param_2)" ( (binary_expression "(int)param_1[2] < param_2" (cast_expression "(int)param_1[2]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }" { comment (expression_statement "__assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");" (call_expression "__assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume")" identifier (argument_list "("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume")" ( (string_literal ""ch->buffersize >= len"" " string_content ") , (string_literal ""misc.c"" " string_content ") , number_literal , (string_literal ""bufchain_consume"" " string_content ") ))) ;) })) (if_statement "if (0 < param_2) {\n    plVar1 = (long *)*param_1;\n    while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }\n    plVar1[1] = plVar1[1] + (long)param_2;\n    *(int *)(param_1 + 2) = (int)param_1[2] - param_2;\n  }" if (parenthesized_expression "(0 < param_2)" ( (binary_expression "0 < param_2" number_literal < identifier) )) (compound_statement "{\n    plVar1 = (long *)*param_1;\n    while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }\n    plVar1[1] = plVar1[1] + (long)param_2;\n    *(int *)(param_1 + 2) = (int)param_1[2] - param_2;\n  }" { (expression_statement "plVar1 = (long *)*param_1;" (assignment_expression "plVar1 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (while_statement "while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      if (plVar1 == (long *)0x0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }" { (if_statement "if (plVar1 == (long *)0x0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }" if (parenthesized_expression "(plVar1 == (long *)0x0)" ( (binary_expression "plVar1 == (long *)0x0" identifier == (cast_expression "(long *)0x0" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }" { comment (expression_statement "__assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");" (call_expression "__assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume")" identifier (argument_list "("ch->head != NULL","misc.c",0x2c7,"bufchain_consume")" ( (string_literal ""ch->head != NULL"" " string_content ") , (string_literal ""misc.c"" " string_content ") , number_literal , (string_literal ""bufchain_consume"" " string_content ") ))) ;) })) (expression_statement "lVar4 = plVar1[2] - plVar1[1];" (assignment_expression "lVar4 = plVar1[2] - plVar1[1]" identifier = (binary_expression "plVar1[2] - plVar1[1]" (subscript_expression "plVar1[2]" identifier [ number_literal ]) - (subscript_expression "plVar1[1]" identifier [ number_literal ]))) ;) (if_statement "if (param_2 < lVar4) break;" if (parenthesized_expression "(param_2 < lVar4)" ( (binary_expression "param_2 < lVar4" identifier < identifier) )) (break_statement "break;" break ;)) (expression_statement "lVar2 = *plVar1;" (assignment_expression "lVar2 = *plVar1" identifier = (pointer_expression "*plVar1" * identifier)) ;) (expression_statement "*param_1 = lVar2;" (assignment_expression "*param_1 = lVar2" (pointer_expression "*param_1" * identifier) = identifier) ;) (if_statement "if (lVar2 == 0) {\n        param_1[1] = 0;\n      }" if (parenthesized_expression "(lVar2 == 0)" ( (binary_expression "lVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        param_1[1] = 0;\n      }" { (expression_statement "param_1[1] = 0;" (assignment_expression "param_1[1] = 0" (subscript_expression "param_1[1]" identifier [ number_literal ]) = number_literal) ;) })) (expression_statement "FUN_0010db2f();" (call_expression "FUN_0010db2f()" identifier (argument_list "()" ( ))) ;) (expression_statement "iVar3 = (int)lVar4;" (assignment_expression "iVar3 = (int)lVar4" identifier = (cast_expression "(int)lVar4" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "*(int *)(param_1 + 2) = (int)param_1[2] - iVar3;" (assignment_expression "*(int *)(param_1 + 2) = (int)param_1[2] - iVar3" (pointer_expression "*(int *)(param_1 + 2)" * (cast_expression "(int *)(param_1 + 2)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 2)" ( (binary_expression "param_1 + 2" identifier + number_literal) )))) = (binary_expression "(int)param_1[2] - iVar3" (cast_expression "(int)param_1[2]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) - identifier)) ;) (expression_statement "param_2 = param_2 - iVar3;" (assignment_expression "param_2 = param_2 - iVar3" identifier = (binary_expression "param_2 - iVar3" identifier - identifier)) ;) (if_statement "if (param_2 < 1) {\n        return;\n      }" if (parenthesized_expression "(param_2 < 1)" ( (binary_expression "param_2 < 1" identifier < number_literal) )) (compound_statement "{\n        return;\n      }" { (return_statement "return;" return ;) })) (expression_statement "plVar1 = (long *)*param_1;" (assignment_expression "plVar1 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) })) (expression_statement "plVar1[1] = plVar1[1] + (long)param_2;" (assignment_expression "plVar1[1] = plVar1[1] + (long)param_2" (subscript_expression "plVar1[1]" identifier [ number_literal ]) = (binary_expression "plVar1[1] + (long)param_2" (subscript_expression "plVar1[1]" identifier [ number_literal ]) + (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) ;) (expression_statement "*(int *)(param_1 + 2) = (int)param_1[2] - param_2;" (assignment_expression "*(int *)(param_1 + 2) = (int)param_1[2] - param_2" (pointer_expression "*(int *)(param_1 + 2)" * (cast_expression "(int *)(param_1 + 2)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 2)" ( (binary_expression "param_1 + 2" identifier + number_literal) )))) = (binary_expression "(int)param_1[2] - param_2" (cast_expression "(int)param_1[2]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) - identifier)) ;) })) (return_statement "return;" return ;) })))
(translation_unit "void bufchain_consume(bufchain *ch,int len)\n\n{\n  bufchain_granule *ptr;\n  bufchain_granule *pbVar1;\n  int iVar2;\n  long lVar3;\n  \n  if (ch->buffersize < len) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }\n  if (0 < len) {\n    ptr = ch->head;\n    while( true ) {\n      if (ptr == (bufchain_granule *)0x0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar3 = (long)ptr->bufend - (long)ptr->bufpos;\n      if (len < lVar3) break;\n      pbVar1 = ptr->next;\n      ch->head = pbVar1;\n      if (pbVar1 == (bufchain_granule *)0x0) {\n        ch->tail = (bufchain_granule *)0x0;\n      }\n      safefree(ptr);\n      iVar2 = (int)lVar3;\n      ch->buffersize = ch->buffersize - iVar2;\n      len = len - iVar2;\n      if (len < 1) {\n        return;\n      }\n      ptr = ch->head;\n    }\n    ptr->bufpos = ptr->bufpos + len;\n    ch->buffersize = ch->buffersize - len;\n  }\n  return;\n}\n\n" (function_definition "void bufchain_consume(bufchain *ch,int len)\n\n{\n  bufchain_granule *ptr;\n  bufchain_granule *pbVar1;\n  int iVar2;\n  long lVar3;\n  \n  if (ch->buffersize < len) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }\n  if (0 < len) {\n    ptr = ch->head;\n    while( true ) {\n      if (ptr == (bufchain_granule *)0x0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar3 = (long)ptr->bufend - (long)ptr->bufpos;\n      if (len < lVar3) break;\n      pbVar1 = ptr->next;\n      ch->head = pbVar1;\n      if (pbVar1 == (bufchain_granule *)0x0) {\n        ch->tail = (bufchain_granule *)0x0;\n      }\n      safefree(ptr);\n      iVar2 = (int)lVar3;\n      ch->buffersize = ch->buffersize - iVar2;\n      len = len - iVar2;\n      if (len < 1) {\n        return;\n      }\n      ptr = ch->head;\n    }\n    ptr->bufpos = ptr->bufpos + len;\n    ch->buffersize = ch->buffersize - len;\n  }\n  return;\n}" primitive_type (function_declarator "bufchain_consume(bufchain *ch,int len)" identifier (parameter_list "(bufchain *ch,int len)" ( (parameter_declaration "bufchain *ch" type_identifier (pointer_declarator "*ch" * identifier)) , (parameter_declaration "int len" primitive_type identifier) ))) (compound_statement "{\n  bufchain_granule *ptr;\n  bufchain_granule *pbVar1;\n  int iVar2;\n  long lVar3;\n  \n  if (ch->buffersize < len) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }\n  if (0 < len) {\n    ptr = ch->head;\n    while( true ) {\n      if (ptr == (bufchain_granule *)0x0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar3 = (long)ptr->bufend - (long)ptr->bufpos;\n      if (len < lVar3) break;\n      pbVar1 = ptr->next;\n      ch->head = pbVar1;\n      if (pbVar1 == (bufchain_granule *)0x0) {\n        ch->tail = (bufchain_granule *)0x0;\n      }\n      safefree(ptr);\n      iVar2 = (int)lVar3;\n      ch->buffersize = ch->buffersize - iVar2;\n      len = len - iVar2;\n      if (len < 1) {\n        return;\n      }\n      ptr = ch->head;\n    }\n    ptr->bufpos = ptr->bufpos + len;\n    ch->buffersize = ch->buffersize - len;\n  }\n  return;\n}" { (declaration "bufchain_granule *ptr;" type_identifier (pointer_declarator "*ptr" * identifier) ;) (declaration "bufchain_granule *pbVar1;" type_identifier (pointer_declarator "*pbVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (if_statement "if (ch->buffersize < len) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }" if (parenthesized_expression "(ch->buffersize < len)" ( (binary_expression "ch->buffersize < len" (field_expression "ch->buffersize" identifier -> field_identifier) < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }" { comment (expression_statement "__assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");" (call_expression "__assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume")" identifier (argument_list "("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume")" ( (string_literal ""ch->buffersize >= len"" " string_content ") , (string_literal ""misc.c"" " string_content ") , number_literal , (string_literal ""bufchain_consume"" " string_content ") ))) ;) })) (if_statement "if (0 < len) {\n    ptr = ch->head;\n    while( true ) {\n      if (ptr == (bufchain_granule *)0x0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar3 = (long)ptr->bufend - (long)ptr->bufpos;\n      if (len < lVar3) break;\n      pbVar1 = ptr->next;\n      ch->head = pbVar1;\n      if (pbVar1 == (bufchain_granule *)0x0) {\n        ch->tail = (bufchain_granule *)0x0;\n      }\n      safefree(ptr);\n      iVar2 = (int)lVar3;\n      ch->buffersize = ch->buffersize - iVar2;\n      len = len - iVar2;\n      if (len < 1) {\n        return;\n      }\n      ptr = ch->head;\n    }\n    ptr->bufpos = ptr->bufpos + len;\n    ch->buffersize = ch->buffersize - len;\n  }" if (parenthesized_expression "(0 < len)" ( (binary_expression "0 < len" number_literal < identifier) )) (compound_statement "{\n    ptr = ch->head;\n    while( true ) {\n      if (ptr == (bufchain_granule *)0x0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar3 = (long)ptr->bufend - (long)ptr->bufpos;\n      if (len < lVar3) break;\n      pbVar1 = ptr->next;\n      ch->head = pbVar1;\n      if (pbVar1 == (bufchain_granule *)0x0) {\n        ch->tail = (bufchain_granule *)0x0;\n      }\n      safefree(ptr);\n      iVar2 = (int)lVar3;\n      ch->buffersize = ch->buffersize - iVar2;\n      len = len - iVar2;\n      if (len < 1) {\n        return;\n      }\n      ptr = ch->head;\n    }\n    ptr->bufpos = ptr->bufpos + len;\n    ch->buffersize = ch->buffersize - len;\n  }" { (expression_statement "ptr = ch->head;" (assignment_expression "ptr = ch->head" identifier = (field_expression "ch->head" identifier -> field_identifier)) ;) (while_statement "while( true ) {\n      if (ptr == (bufchain_granule *)0x0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar3 = (long)ptr->bufend - (long)ptr->bufpos;\n      if (len < lVar3) break;\n      pbVar1 = ptr->next;\n      ch->head = pbVar1;\n      if (pbVar1 == (bufchain_granule *)0x0) {\n        ch->tail = (bufchain_granule *)0x0;\n      }\n      safefree(ptr);\n      iVar2 = (int)lVar3;\n      ch->buffersize = ch->buffersize - iVar2;\n      len = len - iVar2;\n      if (len < 1) {\n        return;\n      }\n      ptr = ch->head;\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      if (ptr == (bufchain_granule *)0x0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar3 = (long)ptr->bufend - (long)ptr->bufpos;\n      if (len < lVar3) break;\n      pbVar1 = ptr->next;\n      ch->head = pbVar1;\n      if (pbVar1 == (bufchain_granule *)0x0) {\n        ch->tail = (bufchain_granule *)0x0;\n      }\n      safefree(ptr);\n      iVar2 = (int)lVar3;\n      ch->buffersize = ch->buffersize - iVar2;\n      len = len - iVar2;\n      if (len < 1) {\n        return;\n      }\n      ptr = ch->head;\n    }" { (if_statement "if (ptr == (bufchain_granule *)0x0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }" if (parenthesized_expression "(ptr == (bufchain_granule *)0x0)" ( (binary_expression "ptr == (bufchain_granule *)0x0" identifier == (cast_expression "(bufchain_granule *)0x0" ( (type_descriptor "bufchain_granule *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }" { comment (expression_statement "__assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");" (call_expression "__assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume")" identifier (argument_list "("ch->head != NULL","misc.c",0x2c7,"bufchain_consume")" ( (string_literal ""ch->head != NULL"" " string_content ") , (string_literal ""misc.c"" " string_content ") , number_literal , (string_literal ""bufchain_consume"" " string_content ") ))) ;) })) (expression_statement "lVar3 = (long)ptr->bufend - (long)ptr->bufpos;" (assignment_expression "lVar3 = (long)ptr->bufend - (long)ptr->bufpos" identifier = (binary_expression "(long)ptr->bufend - (long)ptr->bufpos" (cast_expression "(long)ptr->bufend" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (field_expression "ptr->bufend" identifier -> field_identifier)) - (cast_expression "(long)ptr->bufpos" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (field_expression "ptr->bufpos" identifier -> field_identifier)))) ;) (if_statement "if (len < lVar3) break;" if (parenthesized_expression "(len < lVar3)" ( (binary_expression "len < lVar3" identifier < identifier) )) (break_statement "break;" break ;)) (expression_statement "pbVar1 = ptr->next;" (assignment_expression "pbVar1 = ptr->next" identifier = (field_expression "ptr->next" identifier -> field_identifier)) ;) (expression_statement "ch->head = pbVar1;" (assignment_expression "ch->head = pbVar1" (field_expression "ch->head" identifier -> field_identifier) = identifier) ;) (if_statement "if (pbVar1 == (bufchain_granule *)0x0) {\n        ch->tail = (bufchain_granule *)0x0;\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        ch->tail = (bufchain_granule *)0x0;\n      }" { (expression_statement "ch->tail = (bufchain_granule *)0x0;" (assignment_expression "ch->tail = (bufchain_granule *)0x0" (field_expression "ch->tail" identifier -> field_identifier) = (cast_expression "(bufchain_granule *)0x0" ( (type_descriptor "bufchain_granule *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) })) (expression_statement "safefree(ptr);" (call_expression "safefree(ptr)" identifier (argument_list "(ptr)" ( identifier ))) ;) (expression_statement "iVar2 = (int)lVar3;" (assignment_expression "iVar2 = (int)lVar3" identifier = (cast_expression "(int)lVar3" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "ch->buffersize = ch->buffersize - iVar2;" (assignment_expression "ch->buffersize = ch->buffersize - iVar2" (field_expression "ch->buffersize" identifier -> field_identifier) = (binary_expression "ch->buffersize - iVar2" (field_expression "ch->buffersize" identifier -> field_identifier) - identifier)) ;) (expression_statement "len = len - iVar2;" (assignment_expression "len = len - iVar2" identifier = (binary_expression "len - iVar2" 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 "ptr = ch->head;" (assignment_expression "ptr = ch->head" identifier = (field_expression "ch->head" identifier -> field_identifier)) ;) })) (expression_statement "ptr->bufpos = ptr->bufpos + len;" (assignment_expression "ptr->bufpos = ptr->bufpos + len" (field_expression "ptr->bufpos" identifier -> field_identifier) = (binary_expression "ptr->bufpos + len" (field_expression "ptr->bufpos" identifier -> field_identifier) + identifier)) ;) (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)) ;) })) (return_statement "return;" return ;) })))
(translation_unit "void FUN_0010dc5c(long *param_1,int param_2)\n\n{\n  long *plVar1;\n  long lVar2;\n  int iVar3;\n  long lVar4;\n  \n  if ((int)param_1[2] < param_2) {\n                    \n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }\n  if (0 < param_2) {\n    plVar1 = (long *)*param_1;\n    while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }\n    plVar1[1] = plVar1[1] + (long)param_2;\n    *(int *)(param_1 + 2) = (int)param_1[2] - param_2;\n  }\n  return;\n}\n\n" (function_definition "void FUN_0010dc5c(long *param_1,int param_2)\n\n{\n  long *plVar1;\n  long lVar2;\n  int iVar3;\n  long lVar4;\n  \n  if ((int)param_1[2] < param_2) {\n                    \n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }\n  if (0 < param_2) {\n    plVar1 = (long *)*param_1;\n    while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }\n    plVar1[1] = plVar1[1] + (long)param_2;\n    *(int *)(param_1 + 2) = (int)param_1[2] - param_2;\n  }\n  return;\n}" primitive_type (function_declarator "FUN_0010dc5c(long *param_1,int param_2)" identifier (parameter_list "(long *param_1,int param_2)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  long *plVar1;\n  long lVar2;\n  int iVar3;\n  long lVar4;\n  \n  if ((int)param_1[2] < param_2) {\n                    \n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }\n  if (0 < param_2) {\n    plVar1 = (long *)*param_1;\n    while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }\n    plVar1[1] = plVar1[1] + (long)param_2;\n    *(int *)(param_1 + 2) = (int)param_1[2] - param_2;\n  }\n  return;\n}" { (declaration "long *plVar1;" (sized_type_specifier "long" long) (pointer_declarator "*plVar1" * identifier) ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (if_statement "if ((int)param_1[2] < param_2) {\n                    \n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }" if (parenthesized_expression "((int)param_1[2] < param_2)" ( (binary_expression "(int)param_1[2] < param_2" (cast_expression "(int)param_1[2]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) < identifier) )) (compound_statement "{\n                    \n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }" { (expression_statement "__assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");" (call_expression "__assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume")" identifier (argument_list "("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume")" ( (string_literal ""ch->buffersize >= len"" " string_content ") , (string_literal ""misc.c"" " string_content ") , number_literal , (string_literal ""bufchain_consume"" " string_content ") ))) ;) })) (if_statement "if (0 < param_2) {\n    plVar1 = (long *)*param_1;\n    while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }\n    plVar1[1] = plVar1[1] + (long)param_2;\n    *(int *)(param_1 + 2) = (int)param_1[2] - param_2;\n  }" if (parenthesized_expression "(0 < param_2)" ( (binary_expression "0 < param_2" number_literal < identifier) )) (compound_statement "{\n    plVar1 = (long *)*param_1;\n    while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }\n    plVar1[1] = plVar1[1] + (long)param_2;\n    *(int *)(param_1 + 2) = (int)param_1[2] - param_2;\n  }" { (expression_statement "plVar1 = (long *)*param_1;" (assignment_expression "plVar1 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (while_statement "while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      if (plVar1 == (long *)0x0) {\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }" { (if_statement "if (plVar1 == (long *)0x0) {\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }" if (parenthesized_expression "(plVar1 == (long *)0x0)" ( (binary_expression "plVar1 == (long *)0x0" identifier == (cast_expression "(long *)0x0" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }" { (expression_statement "__assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");" (call_expression "__assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume")" identifier (argument_list "("ch->head != NULL","misc.c",0x2c7,"bufchain_consume")" ( (string_literal ""ch->head != NULL"" " string_content ") , (string_literal ""misc.c"" " string_content ") , number_literal , (string_literal ""bufchain_consume"" " string_content ") ))) ;) })) (expression_statement "lVar4 = plVar1[2] - plVar1[1];" (assignment_expression "lVar4 = plVar1[2] - plVar1[1]" identifier = (binary_expression "plVar1[2] - plVar1[1]" (subscript_expression "plVar1[2]" identifier [ number_literal ]) - (subscript_expression "plVar1[1]" identifier [ number_literal ]))) ;) (if_statement "if (param_2 < lVar4) break;" if (parenthesized_expression "(param_2 < lVar4)" ( (binary_expression "param_2 < lVar4" identifier < identifier) )) (break_statement "break;" break ;)) (expression_statement "lVar2 = *plVar1;" (assignment_expression "lVar2 = *plVar1" identifier = (pointer_expression "*plVar1" * identifier)) ;) (expression_statement "*param_1 = lVar2;" (assignment_expression "*param_1 = lVar2" (pointer_expression "*param_1" * identifier) = identifier) ;) (if_statement "if (lVar2 == 0) {\n        param_1[1] = 0;\n      }" if (parenthesized_expression "(lVar2 == 0)" ( (binary_expression "lVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        param_1[1] = 0;\n      }" { (expression_statement "param_1[1] = 0;" (assignment_expression "param_1[1] = 0" (subscript_expression "param_1[1]" identifier [ number_literal ]) = number_literal) ;) })) (expression_statement "FUN_0010db2f();" (call_expression "FUN_0010db2f()" identifier (argument_list "()" ( ))) ;) (expression_statement "iVar3 = (int)lVar4;" (assignment_expression "iVar3 = (int)lVar4" identifier = (cast_expression "(int)lVar4" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "*(int *)(param_1 + 2) = (int)param_1[2] - iVar3;" (assignment_expression "*(int *)(param_1 + 2) = (int)param_1[2] - iVar3" (pointer_expression "*(int *)(param_1 + 2)" * (cast_expression "(int *)(param_1 + 2)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 2)" ( (binary_expression "param_1 + 2" identifier + number_literal) )))) = (binary_expression "(int)param_1[2] - iVar3" (cast_expression "(int)param_1[2]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) - identifier)) ;) (expression_statement "param_2 = param_2 - iVar3;" (assignment_expression "param_2 = param_2 - iVar3" identifier = (binary_expression "param_2 - iVar3" identifier - identifier)) ;) (if_statement "if (param_2 < 1) {\n        return;\n      }" if (parenthesized_expression "(param_2 < 1)" ( (binary_expression "param_2 < 1" identifier < number_literal) )) (compound_statement "{\n        return;\n      }" { (return_statement "return;" return ;) })) (expression_statement "plVar1 = (long *)*param_1;" (assignment_expression "plVar1 = (long *)*param_1" identifier = (cast_expression "(long *)*param_1" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) })) (expression_statement "plVar1[1] = plVar1[1] + (long)param_2;" (assignment_expression "plVar1[1] = plVar1[1] + (long)param_2" (subscript_expression "plVar1[1]" identifier [ number_literal ]) = (binary_expression "plVar1[1] + (long)param_2" (subscript_expression "plVar1[1]" identifier [ number_literal ]) + (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) ;) (expression_statement "*(int *)(param_1 + 2) = (int)param_1[2] - param_2;" (assignment_expression "*(int *)(param_1 + 2) = (int)param_1[2] - param_2" (pointer_expression "*(int *)(param_1 + 2)" * (cast_expression "(int *)(param_1 + 2)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 2)" ( (binary_expression "param_1 + 2" identifier + number_literal) )))) = (binary_expression "(int)param_1[2] - param_2" (cast_expression "(int)param_1[2]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) - identifier)) ;) })) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration (sized_type_specifier long) (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) - (subscript_expression IDENT [ LIT ]))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) - IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) })) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (subscript_expression IDENT [ LIT ]) + (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) - IDENT)) ;) })) (return_statement return ;) })))
(function_definition "void FUN_0010dc5c(long *param_1,int param_2)\n\n{\n  long *plVar1;\n  long lVar2;\n  int iVar3;\n  long lVar4;\n  \n  if ((int)param_1[2] < param_2) {\n                    \n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }\n  if (0 < param_2) {\n    plVar1 = (long *)*param_1;\n    while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }\n    plVar1[1] = plVar1[1] + (long)param_2;\n    *(int *)(param_1 + 2) = (int)param_1[2] - param_2;\n  }\n  return;\n}" (primitive_type "void") (function_declarator "FUN_0010dc5c(long *param_1,int param_2)" (identifier "FUN_0010dc5c") (parameter_list "(long *param_1,int param_2)" (( "(") (parameter_declaration "long *param_1" (sized_type_specifier "long" (long "long")) (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  long *plVar1;\n  long lVar2;\n  int iVar3;\n  long lVar4;\n  \n  if ((int)param_1[2] < param_2) {\n                    \n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }\n  if (0 < param_2) {\n    plVar1 = (long *)*param_1;\n    while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }\n    plVar1[1] = plVar1[1] + (long)param_2;\n    *(int *)(param_1 + 2) = (int)param_1[2] - param_2;\n  }\n  return;\n}" ({ "{") (declaration "long *plVar1;" (sized_type_specifier "long" (long "long")) (pointer_declarator "*plVar1" (* "*") (identifier "plVar1")) (; ";")) (declaration "long lVar2;" (sized_type_specifier "long" (long "long")) (identifier "lVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "long lVar4;" (sized_type_specifier "long" (long "long")) (identifier "lVar4") (; ";")) (if_statement "if ((int)param_1[2] < param_2) {\n                    \n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }" (if "if") (parenthesized_expression "((int)param_1[2] < param_2)" (( "(") (binary_expression "(int)param_1[2] < param_2" (cast_expression "(int)param_1[2]" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n                    \n    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");\n  }" ({ "{") (expression_statement "__assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");" (call_expression "__assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume")" (identifier "__assert_fail") (argument_list "("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume")" (( "(") (string_literal ""ch->buffersize >= len"" (" """) (string_content "ch->buffersize >= len") (" """)) (, ",") (string_literal ""misc.c"" (" """) (string_content "misc.c") (" """)) (, ",") (number_literal "0x2c4") (, ",") (string_literal ""bufchain_consume"" (" """) (string_content "bufchain_consume") (" """)) () ")"))) (; ";")) (} "}"))) (if_statement "if (0 < param_2) {\n    plVar1 = (long *)*param_1;\n    while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }\n    plVar1[1] = plVar1[1] + (long)param_2;\n    *(int *)(param_1 + 2) = (int)param_1[2] - param_2;\n  }" (if "if") (parenthesized_expression "(0 < param_2)" (( "(") (binary_expression "0 < param_2" (number_literal "0") (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n    plVar1 = (long *)*param_1;\n    while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }\n    plVar1[1] = plVar1[1] + (long)param_2;\n    *(int *)(param_1 + 2) = (int)param_1[2] - param_2;\n  }" ({ "{") (expression_statement "plVar1 = (long *)*param_1;" (assignment_expression "plVar1 = (long *)*param_1" (identifier "plVar1") (= "=") (cast_expression "(long *)*param_1" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (while_statement "while( true ) {\n      if (plVar1 == (long *)0x0) {\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n      if (plVar1 == (long *)0x0) {\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }\n      lVar4 = plVar1[2] - plVar1[1];\n      if (param_2 < lVar4) break;\n      lVar2 = *plVar1;\n      *param_1 = lVar2;\n      if (lVar2 == 0) {\n        param_1[1] = 0;\n      }\n      FUN_0010db2f();\n      iVar3 = (int)lVar4;\n      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;\n      param_2 = param_2 - iVar3;\n      if (param_2 < 1) {\n        return;\n      }\n      plVar1 = (long *)*param_1;\n    }" ({ "{") (if_statement "if (plVar1 == (long *)0x0) {\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }" (if "if") (parenthesized_expression "(plVar1 == (long *)0x0)" (( "(") (binary_expression "plVar1 == (long *)0x0" (identifier "plVar1") (== "==") (cast_expression "(long *)0x0" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n                    \n        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");\n      }" ({ "{") (expression_statement "__assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");" (call_expression "__assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume")" (identifier "__assert_fail") (argument_list "("ch->head != NULL","misc.c",0x2c7,"bufchain_consume")" (( "(") (string_literal ""ch->head != NULL"" (" """) (string_content "ch->head != NULL") (" """)) (, ",") (string_literal ""misc.c"" (" """) (string_content "misc.c") (" """)) (, ",") (number_literal "0x2c7") (, ",") (string_literal ""bufchain_consume"" (" """) (string_content "bufchain_consume") (" """)) () ")"))) (; ";")) (} "}"))) (expression_statement "lVar4 = plVar1[2] - plVar1[1];" (assignment_expression "lVar4 = plVar1[2] - plVar1[1]" (identifier "lVar4") (= "=") (binary_expression "plVar1[2] - plVar1[1]" (subscript_expression "plVar1[2]" (identifier "plVar1") ([ "[") (number_literal "2") (] "]")) (- "-") (subscript_expression "plVar1[1]" (identifier "plVar1") ([ "[") (number_literal "1") (] "]")))) (; ";")) (if_statement "if (param_2 < lVar4) break;" (if "if") (parenthesized_expression "(param_2 < lVar4)" (( "(") (binary_expression "param_2 < lVar4" (identifier "param_2") (< "<") (identifier "lVar4")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "lVar2 = *plVar1;" (assignment_expression "lVar2 = *plVar1" (identifier "lVar2") (= "=") (pointer_expression "*plVar1" (* "*") (identifier "plVar1"))) (; ";")) (expression_statement "*param_1 = lVar2;" (assignment_expression "*param_1 = lVar2" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "lVar2")) (; ";")) (if_statement "if (lVar2 == 0) {\n        param_1[1] = 0;\n      }" (if "if") (parenthesized_expression "(lVar2 == 0)" (( "(") (binary_expression "lVar2 == 0" (identifier "lVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        param_1[1] = 0;\n      }" ({ "{") (expression_statement "param_1[1] = 0;" (assignment_expression "param_1[1] = 0" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (number_literal "0")) (; ";")) (} "}"))) (expression_statement "FUN_0010db2f();" (call_expression "FUN_0010db2f()" (identifier "FUN_0010db2f") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "iVar3 = (int)lVar4;" (assignment_expression "iVar3 = (int)lVar4" (identifier "iVar3") (= "=") (cast_expression "(int)lVar4" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "lVar4"))) (; ";")) (expression_statement "*(int *)(param_1 + 2) = (int)param_1[2] - iVar3;" (assignment_expression "*(int *)(param_1 + 2) = (int)param_1[2] - iVar3" (pointer_expression "*(int *)(param_1 + 2)" (* "*") (cast_expression "(int *)(param_1 + 2)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 2)" (( "(") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2")) () ")")))) (= "=") (binary_expression "(int)param_1[2] - iVar3" (cast_expression "(int)param_1[2]" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (- "-") (identifier "iVar3"))) (; ";")) (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"))) (; ";")) (if_statement "if (param_2 < 1) {\n        return;\n      }" (if "if") (parenthesized_expression "(param_2 < 1)" (( "(") (binary_expression "param_2 < 1" (identifier "param_2") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n        return;\n      }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "plVar1 = (long *)*param_1;" (assignment_expression "plVar1 = (long *)*param_1" (identifier "plVar1") (= "=") (cast_expression "(long *)*param_1" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}"))) (expression_statement "plVar1[1] = plVar1[1] + (long)param_2;" (assignment_expression "plVar1[1] = plVar1[1] + (long)param_2" (subscript_expression "plVar1[1]" (identifier "plVar1") ([ "[") (number_literal "1") (] "]")) (= "=") (binary_expression "plVar1[1] + (long)param_2" (subscript_expression "plVar1[1]" (identifier "plVar1") ([ "[") (number_literal "1") (] "]")) (+ "+") (cast_expression "(long)param_2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_2")))) (; ";")) (expression_statement "*(int *)(param_1 + 2) = (int)param_1[2] - param_2;" (assignment_expression "*(int *)(param_1 + 2) = (int)param_1[2] - param_2" (pointer_expression "*(int *)(param_1 + 2)" (* "*") (cast_expression "(int *)(param_1 + 2)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 2)" (( "(") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2")) () ")")))) (= "=") (binary_expression "(int)param_1[2] - param_2" (cast_expression "(int)param_1[2]" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (- "-") (identifier "param_2"))) (; ";")) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

void function_1(type_1 *ch,int var_1)

{
  type_2 *var_3;
  type_2 *var_5;
  int var_7;
  long var_4;
  
  if (ch->buffersize < var_1) {
                    /* WARNING: Subroutine does not return */
    var_2("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");
  }
  if (0 < var_1) {
    var_3 = ch->head;
    while( true ) {
      if (var_3 == (type_2 *)0x0) {
                    /* WARNING: Subroutine does not return */
        var_2("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");
      }
      var_4 = (long)var_3->bufend - (long)var_3->bufpos;
      if (var_1 < var_4) break;
      var_5 = var_3->next;
      ch->head = var_5;
      if (var_5 == (type_2 *)0x0) {
        ch->tail = (type_2 *)0x0;
      }
      var_6(var_3);
      var_7 = (int)var_4;
      ch->buffersize = ch->buffersize - var_7;
      var_1 = var_1 - var_7;
      if (var_1 < 1) {
        return;
      }
      var_3 = ch->head;
    }
    var_3->bufpos = var_3->bufpos + var_1;
    ch->buffersize = ch->buffersize - var_1;
  }
  return;
}


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

void MASKED(long *param_1,int param_2)

{
  long *plVar1;
  long lVar2;
  int iVar3;
  long lVar4;
  
  if ((int)param_1[2] < param_2) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("ch->buffersize >= len","misc.c",0x2c4,"bufchain_consume");
  }
  if (0 < param_2) {
    plVar1 = (long *)*param_1;
    while( true ) {
      if (plVar1 == (long *)0x0) {
                    /* WARNING: Subroutine does not return */
        __assert_fail("ch->head != NULL","misc.c",0x2c7,"bufchain_consume");
      }
      lVar4 = plVar1[2] - plVar1[1];
      if (param_2 < lVar4) break;
      lVar2 = *plVar1;
      *param_1 = lVar2;
      if (lVar2 == 0) {
        param_1[1] = 0;
      }
      FUN_0010db2f();
      iVar3 = (int)lVar4;
      *(int *)(param_1 + 2) = (int)param_1[2] - iVar3;
      param_2 = param_2 - iVar3;
      if (param_2 < 1) {
        return;
      }
      plVar1 = (long *)*param_1;
    }
    plVar1[1] = plVar1[1] + (long)param_2;
    *(int *)(param_1 + 2) = (int)param_1[2] - param_2;
  }
  return;
}

