
size_t readback_bytes(mime_state *state,char *buffer,size_t bufsize,char *bytes,size_t numbytes,
                     char *trail)

{
  char *pcVar1;
  uint uVar2;
  mimestate mVar3;
  
  mVar3 = state->state;
  if (mVar3 < numbytes) {
    uVar2 = numbytes - mVar3;
    pcVar1 = bytes + mVar3;
  }
  else {
    uVar2 = (*(code *)PTR_strlen_000a6ea8)(trail);
    if (uVar2 <= mVar3 - numbytes) {
      return 0;
    }
    uVar2 = (numbytes - mVar3) + uVar2;
    pcVar1 = trail + (mVar3 - numbytes);
  }
  if (bufsize < uVar2) {
    uVar2 = bufsize;
  }
  (*(code *)PTR_memcpy_000a6eec)(buffer,pcVar1,uVar2);
  state->state = state->state + uVar2;
  return uVar2;
}



uint FUN_0006dee0(uint *param_1,undefined4 param_2,uint param_3,int param_4,uint param_5,int param_6
                 )

{
  uint uVar1;
  uint uVar2;
  
  uVar2 = *param_1;
  if (uVar2 < param_5) {
    uVar1 = param_5 - uVar2;
    param_4 = param_4 + uVar2;
  }
  else {
    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);
    if (uVar1 <= uVar2 - param_5) {
      return 0;
    }
    uVar1 = (param_5 - uVar2) + uVar1;
    param_4 = param_6 + (uVar2 - param_5);
  }
  if (param_3 < uVar1) {
    uVar1 = param_3;
  }
  (*(code *)PTR_memcpy_000a6eec)(param_2,param_4,uVar1);
  *param_1 = *param_1 + uVar1;
  return uVar1;
}


lui gp,0x4
addiu gp,gp,0x230
addu gp,gp,t9
addiu sp,sp,-0x30
sw s1,0x20(sp)
sw s0,0x1c(sp)
sw gp,0x10(sp)
sw s3,0x28(sp)
or s3,a1,zero
sw s2,0x24(sp)
sw ra,0x2c(sp)
lw s0,0x40(sp)
lw s1,0x0(a0)
sltu v0,s1,s0
beq v0,zero,0x0006df6c
_or s2,a0,zero
subu s0,s0,s1
addu a1,a3,s1
sltu v0,a2,s0
lw t9,-0x7224(gp)
movn s0,a2,v0
or a0,s3,zero
jalr t9
_or a2,s0,zero
lw v0,0x0(s2)
lw ra,0x2c(sp)
lw s3,0x28(sp)
addu v0,v0,s0
lw s1,0x20(sp)
sw v0,0x0(s2)
or v0,s0,zero
lw s2,0x24(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x30
lw t9,-0x7268(gp)
lw a0,0x44(sp)
jalr t9
_sw a2,0x38(sp)
subu a1,s1,s0
sltu v1,a1,v0
beq v1,zero,0x0006dfa4
_lw gp,0x10(sp)
lw v1,0x44(sp)
subu s0,s0,s1
lw a2,0x38(sp)
addu s0,s0,v0
b 0x0006df28
_addu a1,v1,a1
lw ra,0x2c(sp)
or s0,zero,zero
lw s3,0x28(sp)
or v0,s0,zero
lw s2,0x24(sp)
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x30
(translation_unit "uint FUN_0006dee0(uint *param_1,undefined4 param_2,uint param_3,int param_4,uint param_5,int param_6\n                 )\n\n{\n  uint uVar1;\n  uint uVar2;\n  \n  uVar2 = *param_1;\n  if (uVar2 < param_5) {\n    uVar1 = param_5 - uVar2;\n    param_4 = param_4 + uVar2;\n  }\n  else {\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }\n  if (param_3 < uVar1) {\n    uVar1 = param_3;\n  }\n  (*(code *)PTR_memcpy_000a6eec)(param_2,param_4,uVar1);\n  *param_1 = *param_1 + uVar1;\n  return uVar1;\n}\n\n" (function_definition "uint FUN_0006dee0(uint *param_1,undefined4 param_2,uint param_3,int param_4,uint param_5,int param_6\n                 )\n\n{\n  uint uVar1;\n  uint uVar2;\n  \n  uVar2 = *param_1;\n  if (uVar2 < param_5) {\n    uVar1 = param_5 - uVar2;\n    param_4 = param_4 + uVar2;\n  }\n  else {\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }\n  if (param_3 < uVar1) {\n    uVar1 = param_3;\n  }\n  (*(code *)PTR_memcpy_000a6eec)(param_2,param_4,uVar1);\n  *param_1 = *param_1 + uVar1;\n  return uVar1;\n}" type_identifier (function_declarator "FUN_0006dee0(uint *param_1,undefined4 param_2,uint param_3,int param_4,uint param_5,int param_6\n                 )" identifier (parameter_list "(uint *param_1,undefined4 param_2,uint param_3,int param_4,uint param_5,int param_6\n                 )" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "int param_4" primitive_type identifier) , (parameter_declaration "uint param_5" type_identifier identifier) , (parameter_declaration "int param_6" primitive_type identifier) ))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  \n  uVar2 = *param_1;\n  if (uVar2 < param_5) {\n    uVar1 = param_5 - uVar2;\n    param_4 = param_4 + uVar2;\n  }\n  else {\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }\n  if (param_3 < uVar1) {\n    uVar1 = param_3;\n  }\n  (*(code *)PTR_memcpy_000a6eec)(param_2,param_4,uVar1);\n  *param_1 = *param_1 + uVar1;\n  return uVar1;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (expression_statement "uVar2 = *param_1;" (assignment_expression "uVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if (uVar2 < param_5) {\n    uVar1 = param_5 - uVar2;\n    param_4 = param_4 + uVar2;\n  }\n  else {\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }" if (parenthesized_expression "(uVar2 < param_5)" ( (binary_expression "uVar2 < param_5" identifier < identifier) )) (compound_statement "{\n    uVar1 = param_5 - uVar2;\n    param_4 = param_4 + uVar2;\n  }" { (expression_statement "uVar1 = param_5 - uVar2;" (assignment_expression "uVar1 = param_5 - uVar2" identifier = (binary_expression "param_5 - uVar2" identifier - identifier)) ;) (expression_statement "param_4 = param_4 + uVar2;" (assignment_expression "param_4 = param_4 + uVar2" identifier = (binary_expression "param_4 + uVar2" identifier + identifier)) ;) }) (else_clause "else {\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }" else (compound_statement "{\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }" { (expression_statement "uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);" (assignment_expression "uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6)" identifier = (call_expression "(*(code *)PTR_strlen_000a6ea8)(param_6)" (parenthesized_expression "(*(code *)PTR_strlen_000a6ea8)" ( (pointer_expression "*(code *)PTR_strlen_000a6ea8" * (cast_expression "(code *)PTR_strlen_000a6ea8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_6)" ( identifier )))) ;) (if_statement "if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }" if (parenthesized_expression "(uVar1 <= uVar2 - param_5)" ( (binary_expression "uVar1 <= uVar2 - param_5" identifier <= (binary_expression "uVar2 - param_5" identifier - identifier)) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "uVar1 = (param_5 - uVar2) + uVar1;" (assignment_expression "uVar1 = (param_5 - uVar2) + uVar1" identifier = (binary_expression "(param_5 - uVar2) + uVar1" (parenthesized_expression "(param_5 - uVar2)" ( (binary_expression "param_5 - uVar2" identifier - identifier) )) + identifier)) ;) (expression_statement "param_4 = param_6 + (uVar2 - param_5);" (assignment_expression "param_4 = param_6 + (uVar2 - param_5)" identifier = (binary_expression "param_6 + (uVar2 - param_5)" identifier + (parenthesized_expression "(uVar2 - param_5)" ( (binary_expression "uVar2 - param_5" identifier - identifier) )))) ;) }))) (if_statement "if (param_3 < uVar1) {\n    uVar1 = param_3;\n  }" if (parenthesized_expression "(param_3 < uVar1)" ( (binary_expression "param_3 < uVar1" identifier < identifier) )) (compound_statement "{\n    uVar1 = param_3;\n  }" { (expression_statement "uVar1 = param_3;" (assignment_expression "uVar1 = param_3" identifier = identifier) ;) })) (expression_statement "(*(code *)PTR_memcpy_000a6eec)(param_2,param_4,uVar1);" (call_expression "(*(code *)PTR_memcpy_000a6eec)(param_2,param_4,uVar1)" (parenthesized_expression "(*(code *)PTR_memcpy_000a6eec)" ( (pointer_expression "*(code *)PTR_memcpy_000a6eec" * (cast_expression "(code *)PTR_memcpy_000a6eec" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_2,param_4,uVar1)" ( identifier , identifier , identifier ))) ;) (expression_statement "*param_1 = *param_1 + uVar1;" (assignment_expression "*param_1 = *param_1 + uVar1" (pointer_expression "*param_1" * identifier) = (binary_expression "*param_1 + uVar1" (pointer_expression "*param_1" * identifier) + identifier)) ;) (return_statement "return uVar1;" return identifier ;) })))
(translation_unit "size_t readback_bytes(mime_state *state,char *buffer,size_t bufsize,char *bytes,size_t numbytes,\n                     char *trail)\n\n{\n  char *pcVar1;\n  uint uVar2;\n  mimestate mVar3;\n  \n  mVar3 = state->state;\n  if (mVar3 < numbytes) {\n    uVar2 = numbytes - mVar3;\n    pcVar1 = bytes + mVar3;\n  }\n  else {\n    uVar2 = (*(code *)PTR_strlen_000a6ea8)(trail);\n    if (uVar2 <= mVar3 - numbytes) {\n      return 0;\n    }\n    uVar2 = (numbytes - mVar3) + uVar2;\n    pcVar1 = trail + (mVar3 - numbytes);\n  }\n  if (bufsize < uVar2) {\n    uVar2 = bufsize;\n  }\n  (*(code *)PTR_memcpy_000a6eec)(buffer,pcVar1,uVar2);\n  state->state = state->state + uVar2;\n  return uVar2;\n}\n\n" (function_definition "size_t readback_bytes(mime_state *state,char *buffer,size_t bufsize,char *bytes,size_t numbytes,\n                     char *trail)\n\n{\n  char *pcVar1;\n  uint uVar2;\n  mimestate mVar3;\n  \n  mVar3 = state->state;\n  if (mVar3 < numbytes) {\n    uVar2 = numbytes - mVar3;\n    pcVar1 = bytes + mVar3;\n  }\n  else {\n    uVar2 = (*(code *)PTR_strlen_000a6ea8)(trail);\n    if (uVar2 <= mVar3 - numbytes) {\n      return 0;\n    }\n    uVar2 = (numbytes - mVar3) + uVar2;\n    pcVar1 = trail + (mVar3 - numbytes);\n  }\n  if (bufsize < uVar2) {\n    uVar2 = bufsize;\n  }\n  (*(code *)PTR_memcpy_000a6eec)(buffer,pcVar1,uVar2);\n  state->state = state->state + uVar2;\n  return uVar2;\n}" primitive_type (function_declarator "readback_bytes(mime_state *state,char *buffer,size_t bufsize,char *bytes,size_t numbytes,\n                     char *trail)" identifier (parameter_list "(mime_state *state,char *buffer,size_t bufsize,char *bytes,size_t numbytes,\n                     char *trail)" ( (parameter_declaration "mime_state *state" type_identifier (pointer_declarator "*state" * identifier)) , (parameter_declaration "char *buffer" primitive_type (pointer_declarator "*buffer" * identifier)) , (parameter_declaration "size_t bufsize" primitive_type identifier) , (parameter_declaration "char *bytes" primitive_type (pointer_declarator "*bytes" * identifier)) , (parameter_declaration "size_t numbytes" primitive_type identifier) , (parameter_declaration "char *trail" primitive_type (pointer_declarator "*trail" * identifier)) ))) (compound_statement "{\n  char *pcVar1;\n  uint uVar2;\n  mimestate mVar3;\n  \n  mVar3 = state->state;\n  if (mVar3 < numbytes) {\n    uVar2 = numbytes - mVar3;\n    pcVar1 = bytes + mVar3;\n  }\n  else {\n    uVar2 = (*(code *)PTR_strlen_000a6ea8)(trail);\n    if (uVar2 <= mVar3 - numbytes) {\n      return 0;\n    }\n    uVar2 = (numbytes - mVar3) + uVar2;\n    pcVar1 = trail + (mVar3 - numbytes);\n  }\n  if (bufsize < uVar2) {\n    uVar2 = bufsize;\n  }\n  (*(code *)PTR_memcpy_000a6eec)(buffer,pcVar1,uVar2);\n  state->state = state->state + uVar2;\n  return uVar2;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "mimestate mVar3;" type_identifier identifier ;) (expression_statement "mVar3 = state->state;" (assignment_expression "mVar3 = state->state" identifier = (field_expression "state->state" identifier -> field_identifier)) ;) (if_statement "if (mVar3 < numbytes) {\n    uVar2 = numbytes - mVar3;\n    pcVar1 = bytes + mVar3;\n  }\n  else {\n    uVar2 = (*(code *)PTR_strlen_000a6ea8)(trail);\n    if (uVar2 <= mVar3 - numbytes) {\n      return 0;\n    }\n    uVar2 = (numbytes - mVar3) + uVar2;\n    pcVar1 = trail + (mVar3 - numbytes);\n  }" if (parenthesized_expression "(mVar3 < numbytes)" ( (binary_expression "mVar3 < numbytes" identifier < identifier) )) (compound_statement "{\n    uVar2 = numbytes - mVar3;\n    pcVar1 = bytes + mVar3;\n  }" { (expression_statement "uVar2 = numbytes - mVar3;" (assignment_expression "uVar2 = numbytes - mVar3" identifier = (binary_expression "numbytes - mVar3" identifier - identifier)) ;) (expression_statement "pcVar1 = bytes + mVar3;" (assignment_expression "pcVar1 = bytes + mVar3" identifier = (binary_expression "bytes + mVar3" identifier + identifier)) ;) }) (else_clause "else {\n    uVar2 = (*(code *)PTR_strlen_000a6ea8)(trail);\n    if (uVar2 <= mVar3 - numbytes) {\n      return 0;\n    }\n    uVar2 = (numbytes - mVar3) + uVar2;\n    pcVar1 = trail + (mVar3 - numbytes);\n  }" else (compound_statement "{\n    uVar2 = (*(code *)PTR_strlen_000a6ea8)(trail);\n    if (uVar2 <= mVar3 - numbytes) {\n      return 0;\n    }\n    uVar2 = (numbytes - mVar3) + uVar2;\n    pcVar1 = trail + (mVar3 - numbytes);\n  }" { (expression_statement "uVar2 = (*(code *)PTR_strlen_000a6ea8)(trail);" (assignment_expression "uVar2 = (*(code *)PTR_strlen_000a6ea8)(trail)" identifier = (call_expression "(*(code *)PTR_strlen_000a6ea8)(trail)" (parenthesized_expression "(*(code *)PTR_strlen_000a6ea8)" ( (pointer_expression "*(code *)PTR_strlen_000a6ea8" * (cast_expression "(code *)PTR_strlen_000a6ea8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(trail)" ( identifier )))) ;) (if_statement "if (uVar2 <= mVar3 - numbytes) {\n      return 0;\n    }" if (parenthesized_expression "(uVar2 <= mVar3 - numbytes)" ( (binary_expression "uVar2 <= mVar3 - numbytes" identifier <= (binary_expression "mVar3 - numbytes" identifier - identifier)) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "uVar2 = (numbytes - mVar3) + uVar2;" (assignment_expression "uVar2 = (numbytes - mVar3) + uVar2" identifier = (binary_expression "(numbytes - mVar3) + uVar2" (parenthesized_expression "(numbytes - mVar3)" ( (binary_expression "numbytes - mVar3" identifier - identifier) )) + identifier)) ;) (expression_statement "pcVar1 = trail + (mVar3 - numbytes);" (assignment_expression "pcVar1 = trail + (mVar3 - numbytes)" identifier = (binary_expression "trail + (mVar3 - numbytes)" identifier + (parenthesized_expression "(mVar3 - numbytes)" ( (binary_expression "mVar3 - numbytes" identifier - identifier) )))) ;) }))) (if_statement "if (bufsize < uVar2) {\n    uVar2 = bufsize;\n  }" if (parenthesized_expression "(bufsize < uVar2)" ( (binary_expression "bufsize < uVar2" identifier < identifier) )) (compound_statement "{\n    uVar2 = bufsize;\n  }" { (expression_statement "uVar2 = bufsize;" (assignment_expression "uVar2 = bufsize" identifier = identifier) ;) })) (expression_statement "(*(code *)PTR_memcpy_000a6eec)(buffer,pcVar1,uVar2);" (call_expression "(*(code *)PTR_memcpy_000a6eec)(buffer,pcVar1,uVar2)" (parenthesized_expression "(*(code *)PTR_memcpy_000a6eec)" ( (pointer_expression "*(code *)PTR_memcpy_000a6eec" * (cast_expression "(code *)PTR_memcpy_000a6eec" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(buffer,pcVar1,uVar2)" ( identifier , identifier , identifier ))) ;) (expression_statement "state->state = state->state + uVar2;" (assignment_expression "state->state = state->state + uVar2" (field_expression "state->state" identifier -> field_identifier) = (binary_expression "state->state + uVar2" (field_expression "state->state" identifier -> field_identifier) + identifier)) ;) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit "uint FUN_0006dee0(uint *param_1,undefined4 param_2,uint param_3,int param_4,uint param_5,int param_6\n                 )\n\n{\n  uint uVar1;\n  uint uVar2;\n  \n  uVar2 = *param_1;\n  if (uVar2 < param_5) {\n    uVar1 = param_5 - uVar2;\n    param_4 = param_4 + uVar2;\n  }\n  else {\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }\n  if (param_3 < uVar1) {\n    uVar1 = param_3;\n  }\n  (*(code *)PTR_memcpy_000a6eec)(param_2,param_4,uVar1);\n  *param_1 = *param_1 + uVar1;\n  return uVar1;\n}\n\n" (function_definition "uint FUN_0006dee0(uint *param_1,undefined4 param_2,uint param_3,int param_4,uint param_5,int param_6\n                 )\n\n{\n  uint uVar1;\n  uint uVar2;\n  \n  uVar2 = *param_1;\n  if (uVar2 < param_5) {\n    uVar1 = param_5 - uVar2;\n    param_4 = param_4 + uVar2;\n  }\n  else {\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }\n  if (param_3 < uVar1) {\n    uVar1 = param_3;\n  }\n  (*(code *)PTR_memcpy_000a6eec)(param_2,param_4,uVar1);\n  *param_1 = *param_1 + uVar1;\n  return uVar1;\n}" type_identifier (function_declarator "FUN_0006dee0(uint *param_1,undefined4 param_2,uint param_3,int param_4,uint param_5,int param_6\n                 )" identifier (parameter_list "(uint *param_1,undefined4 param_2,uint param_3,int param_4,uint param_5,int param_6\n                 )" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "int param_4" primitive_type identifier) , (parameter_declaration "uint param_5" type_identifier identifier) , (parameter_declaration "int param_6" primitive_type identifier) ))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  \n  uVar2 = *param_1;\n  if (uVar2 < param_5) {\n    uVar1 = param_5 - uVar2;\n    param_4 = param_4 + uVar2;\n  }\n  else {\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }\n  if (param_3 < uVar1) {\n    uVar1 = param_3;\n  }\n  (*(code *)PTR_memcpy_000a6eec)(param_2,param_4,uVar1);\n  *param_1 = *param_1 + uVar1;\n  return uVar1;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (expression_statement "uVar2 = *param_1;" (assignment_expression "uVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if (uVar2 < param_5) {\n    uVar1 = param_5 - uVar2;\n    param_4 = param_4 + uVar2;\n  }\n  else {\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }" if (parenthesized_expression "(uVar2 < param_5)" ( (binary_expression "uVar2 < param_5" identifier < identifier) )) (compound_statement "{\n    uVar1 = param_5 - uVar2;\n    param_4 = param_4 + uVar2;\n  }" { (expression_statement "uVar1 = param_5 - uVar2;" (assignment_expression "uVar1 = param_5 - uVar2" identifier = (binary_expression "param_5 - uVar2" identifier - identifier)) ;) (expression_statement "param_4 = param_4 + uVar2;" (assignment_expression "param_4 = param_4 + uVar2" identifier = (binary_expression "param_4 + uVar2" identifier + identifier)) ;) }) (else_clause "else {\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }" else (compound_statement "{\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }" { (expression_statement "uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);" (assignment_expression "uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6)" identifier = (call_expression "(*(code *)PTR_strlen_000a6ea8)(param_6)" (parenthesized_expression "(*(code *)PTR_strlen_000a6ea8)" ( (pointer_expression "*(code *)PTR_strlen_000a6ea8" * (cast_expression "(code *)PTR_strlen_000a6ea8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_6)" ( identifier )))) ;) (if_statement "if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }" if (parenthesized_expression "(uVar1 <= uVar2 - param_5)" ( (binary_expression "uVar1 <= uVar2 - param_5" identifier <= (binary_expression "uVar2 - param_5" identifier - identifier)) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "uVar1 = (param_5 - uVar2) + uVar1;" (assignment_expression "uVar1 = (param_5 - uVar2) + uVar1" identifier = (binary_expression "(param_5 - uVar2) + uVar1" (parenthesized_expression "(param_5 - uVar2)" ( (binary_expression "param_5 - uVar2" identifier - identifier) )) + identifier)) ;) (expression_statement "param_4 = param_6 + (uVar2 - param_5);" (assignment_expression "param_4 = param_6 + (uVar2 - param_5)" identifier = (binary_expression "param_6 + (uVar2 - param_5)" identifier + (parenthesized_expression "(uVar2 - param_5)" ( (binary_expression "uVar2 - param_5" identifier - identifier) )))) ;) }))) (if_statement "if (param_3 < uVar1) {\n    uVar1 = param_3;\n  }" if (parenthesized_expression "(param_3 < uVar1)" ( (binary_expression "param_3 < uVar1" identifier < identifier) )) (compound_statement "{\n    uVar1 = param_3;\n  }" { (expression_statement "uVar1 = param_3;" (assignment_expression "uVar1 = param_3" identifier = identifier) ;) })) (expression_statement "(*(code *)PTR_memcpy_000a6eec)(param_2,param_4,uVar1);" (call_expression "(*(code *)PTR_memcpy_000a6eec)(param_2,param_4,uVar1)" (parenthesized_expression "(*(code *)PTR_memcpy_000a6eec)" ( (pointer_expression "*(code *)PTR_memcpy_000a6eec" * (cast_expression "(code *)PTR_memcpy_000a6eec" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_2,param_4,uVar1)" ( identifier , identifier , identifier ))) ;) (expression_statement "*param_1 = *param_1 + uVar1;" (assignment_expression "*param_1 = *param_1 + uVar1" (pointer_expression "*param_1" * identifier) = (binary_expression "*param_1 + uVar1" (pointer_expression "*param_1" * identifier) + identifier)) ;) (return_statement "return uVar1;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= (binary_expression IDENT - IDENT)) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression IDENT - IDENT) )) + IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + (parenthesized_expression ( (binary_expression IDENT - IDENT) )))) ;) }))) (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 , IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression (pointer_expression * IDENT) + IDENT)) ;) (return_statement return IDENT ;) })))
(function_definition "uint FUN_0006dee0(uint *param_1,undefined4 param_2,uint param_3,int param_4,uint param_5,int param_6\n                 )\n\n{\n  uint uVar1;\n  uint uVar2;\n  \n  uVar2 = *param_1;\n  if (uVar2 < param_5) {\n    uVar1 = param_5 - uVar2;\n    param_4 = param_4 + uVar2;\n  }\n  else {\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }\n  if (param_3 < uVar1) {\n    uVar1 = param_3;\n  }\n  (*(code *)PTR_memcpy_000a6eec)(param_2,param_4,uVar1);\n  *param_1 = *param_1 + uVar1;\n  return uVar1;\n}" (type_identifier "uint") (function_declarator "FUN_0006dee0(uint *param_1,undefined4 param_2,uint param_3,int param_4,uint param_5,int param_6\n                 )" (identifier "FUN_0006dee0") (parameter_list "(uint *param_1,undefined4 param_2,uint param_3,int param_4,uint param_5,int param_6\n                 )" (( "(") (parameter_declaration "uint *param_1" (type_identifier "uint") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) (, ",") (parameter_declaration "int param_4" (primitive_type "int") (identifier "param_4")) (, ",") (parameter_declaration "uint param_5" (type_identifier "uint") (identifier "param_5")) (, ",") (parameter_declaration "int param_6" (primitive_type "int") (identifier "param_6")) () ")"))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  \n  uVar2 = *param_1;\n  if (uVar2 < param_5) {\n    uVar1 = param_5 - uVar2;\n    param_4 = param_4 + uVar2;\n  }\n  else {\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }\n  if (param_3 < uVar1) {\n    uVar1 = param_3;\n  }\n  (*(code *)PTR_memcpy_000a6eec)(param_2,param_4,uVar1);\n  *param_1 = *param_1 + uVar1;\n  return uVar1;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (expression_statement "uVar2 = *param_1;" (assignment_expression "uVar2 = *param_1" (identifier "uVar2") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (if_statement "if (uVar2 < param_5) {\n    uVar1 = param_5 - uVar2;\n    param_4 = param_4 + uVar2;\n  }\n  else {\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }" (if "if") (parenthesized_expression "(uVar2 < param_5)" (( "(") (binary_expression "uVar2 < param_5" (identifier "uVar2") (< "<") (identifier "param_5")) () ")")) (compound_statement "{\n    uVar1 = param_5 - uVar2;\n    param_4 = param_4 + uVar2;\n  }" ({ "{") (expression_statement "uVar1 = param_5 - uVar2;" (assignment_expression "uVar1 = param_5 - uVar2" (identifier "uVar1") (= "=") (binary_expression "param_5 - uVar2" (identifier "param_5") (- "-") (identifier "uVar2"))) (; ";")) (expression_statement "param_4 = param_4 + uVar2;" (assignment_expression "param_4 = param_4 + uVar2" (identifier "param_4") (= "=") (binary_expression "param_4 + uVar2" (identifier "param_4") (+ "+") (identifier "uVar2"))) (; ";")) (} "}")) (else_clause "else {\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }" (else "else") (compound_statement "{\n    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);\n    if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }\n    uVar1 = (param_5 - uVar2) + uVar1;\n    param_4 = param_6 + (uVar2 - param_5);\n  }" ({ "{") (expression_statement "uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);" (assignment_expression "uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6)" (identifier "uVar1") (= "=") (call_expression "(*(code *)PTR_strlen_000a6ea8)(param_6)" (parenthesized_expression "(*(code *)PTR_strlen_000a6ea8)" (( "(") (pointer_expression "*(code *)PTR_strlen_000a6ea8" (* "*") (cast_expression "(code *)PTR_strlen_000a6ea8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_strlen_000a6ea8"))) () ")")) (argument_list "(param_6)" (( "(") (identifier "param_6") () ")")))) (; ";")) (if_statement "if (uVar1 <= uVar2 - param_5) {\n      return 0;\n    }" (if "if") (parenthesized_expression "(uVar1 <= uVar2 - param_5)" (( "(") (binary_expression "uVar1 <= uVar2 - param_5" (identifier "uVar1") (<= "<=") (binary_expression "uVar2 - param_5" (identifier "uVar2") (- "-") (identifier "param_5"))) () ")")) (compound_statement "{\n      return 0;\n    }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "uVar1 = (param_5 - uVar2) + uVar1;" (assignment_expression "uVar1 = (param_5 - uVar2) + uVar1" (identifier "uVar1") (= "=") (binary_expression "(param_5 - uVar2) + uVar1" (parenthesized_expression "(param_5 - uVar2)" (( "(") (binary_expression "param_5 - uVar2" (identifier "param_5") (- "-") (identifier "uVar2")) () ")")) (+ "+") (identifier "uVar1"))) (; ";")) (expression_statement "param_4 = param_6 + (uVar2 - param_5);" (assignment_expression "param_4 = param_6 + (uVar2 - param_5)" (identifier "param_4") (= "=") (binary_expression "param_6 + (uVar2 - param_5)" (identifier "param_6") (+ "+") (parenthesized_expression "(uVar2 - param_5)" (( "(") (binary_expression "uVar2 - param_5" (identifier "uVar2") (- "-") (identifier "param_5")) () ")")))) (; ";")) (} "}")))) (if_statement "if (param_3 < uVar1) {\n    uVar1 = param_3;\n  }" (if "if") (parenthesized_expression "(param_3 < uVar1)" (( "(") (binary_expression "param_3 < uVar1" (identifier "param_3") (< "<") (identifier "uVar1")) () ")")) (compound_statement "{\n    uVar1 = param_3;\n  }" ({ "{") (expression_statement "uVar1 = param_3;" (assignment_expression "uVar1 = param_3" (identifier "uVar1") (= "=") (identifier "param_3")) (; ";")) (} "}"))) (expression_statement "(*(code *)PTR_memcpy_000a6eec)(param_2,param_4,uVar1);" (call_expression "(*(code *)PTR_memcpy_000a6eec)(param_2,param_4,uVar1)" (parenthesized_expression "(*(code *)PTR_memcpy_000a6eec)" (( "(") (pointer_expression "*(code *)PTR_memcpy_000a6eec" (* "*") (cast_expression "(code *)PTR_memcpy_000a6eec" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_memcpy_000a6eec"))) () ")")) (argument_list "(param_2,param_4,uVar1)" (( "(") (identifier "param_2") (, ",") (identifier "param_4") (, ",") (identifier "uVar1") () ")"))) (; ";")) (expression_statement "*param_1 = *param_1 + uVar1;" (assignment_expression "*param_1 = *param_1 + uVar1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (binary_expression "*param_1 + uVar1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (identifier "uVar1"))) (; ";")) (return_statement "return uVar1;" (return "return") (identifier "uVar1") (; ";")) (} "}")))

size_t function_1(type_1 *state,char *buffer,size_t var_6,char *var_3,size_t var_2,
                     char *var_5)

{
  char *pcVar1;
  type_2 var_4;
  type_3 var_1;
  
  var_1 = state->state;
  if (var_1 < var_2) {
    var_4 = var_2 - var_1;
    pcVar1 = var_3 + var_1;
  }
  else {
    var_4 = (*(type_4 *)PTR_strlen_000a6ea8)(var_5);
    if (var_4 <= var_1 - var_2) {
      return 0;
    }
    var_4 = (var_2 - var_1) + var_4;
    pcVar1 = var_5 + (var_1 - var_2);
  }
  if (var_6 < var_4) {
    var_4 = var_6;
  }
  (*(type_4 *)PTR_memcpy_000a6eec)(buffer,pcVar1,var_4);
  state->state = state->state + var_4;
  return var_4;
}


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

uint MASKED(uint *param_1,undefined4 param_2,uint param_3,int param_4,uint param_5,int param_6
                 )

{
  uint uVar1;
  uint uVar2;
  
  uVar2 = *param_1;
  if (uVar2 < param_5) {
    uVar1 = param_5 - uVar2;
    param_4 = param_4 + uVar2;
  }
  else {
    uVar1 = (*(code *)PTR_strlen_000a6ea8)(param_6);
    if (uVar1 <= uVar2 - param_5) {
      return 0;
    }
    uVar1 = (param_5 - uVar2) + uVar1;
    param_4 = param_6 + (uVar2 - param_5);
  }
  if (param_3 < uVar1) {
    uVar1 = param_3;
  }
  (*(code *)PTR_memcpy_000a6eec)(param_2,param_4,uVar1);
  *param_1 = *param_1 + uVar1;
  return uVar1;
}

