
void strbuf_catfv(strbuf *buf,char *fmt,__va_list_tag *ap)

{
  char cVar1;
  char *pcVar2;
  long lVar3;
  byte bVar4;
  
  bVar4 = 0;
  pcVar2 = dupvprintf_inner(buf->s,buf->len,&buf->size,fmt,ap);
  buf->s = pcVar2;
  lVar3 = -1;
  pcVar2 = pcVar2 + buf->len;
  do {
    if (lVar3 == 0) break;
    lVar3 = lVar3 + -1;
    cVar1 = *pcVar2;
    pcVar2 = pcVar2 + (ulong)bVar4 * -2 + 1;
  } while (cVar1 != '\0');
  buf->len = buf->len + -1 + ~(uint)lVar3;
  return;
}



void FUN_001216c2(long *param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  long lVar2;
  long lVar3;
  char *pcVar4;
  byte bVar5;
  
  bVar5 = 0;
  lVar2 = FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3);
  *param_1 = lVar2;
  lVar3 = -1;
  pcVar4 = (char *)(lVar2 + (int)param_1[1]);
  do {
    if (lVar3 == 0) break;
    lVar3 = lVar3 + -1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;
  } while (cVar1 != '\0');
  *(uint *)(param_1 + 1) = (int)param_1[1] + -1 + ~(uint)lVar3;
  return;
}


PUSH RBX
MOV RBX,RDI
MOV RCX,RSI
MOV R8,RDX
LEA RDX,[RDI + 0xc]
MOV ESI,dword ptr [RDI + 0x8]
MOV RDI,qword ptr [RDI]
CALL 0x00121428
MOV qword ptr [RBX],RAX
MOV EDX,dword ptr [RBX + 0x8]
MOVSXD RCX,EDX
LEA RDI,[RAX + RCX*0x1]
MOV RCX,-0x1
MOV EAX,0x0
SCASB.REPNE RDI
MOV RSI,RCX
NOT RSI
LEA EAX,[RDX + RSI*0x1 + -0x1]
MOV dword ptr [RBX + 0x8],EAX
POP RBX
RET
(translation_unit "void FUN_001216c2(long *param_1,undefined8 param_2,undefined8 param_3)\n\n{\n  char cVar1;\n  long lVar2;\n  long lVar3;\n  char *pcVar4;\n  byte bVar5;\n  \n  bVar5 = 0;\n  lVar2 = FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3);\n  *param_1 = lVar2;\n  lVar3 = -1;\n  pcVar4 = (char *)(lVar2 + (int)param_1[1]);\n  do {\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar4;\n    pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;\n  } while (cVar1 != '\0');\n  *(uint *)(param_1 + 1) = (int)param_1[1] + -1 + ~(uint)lVar3;\n  return;\n}\n\n" (function_definition "void FUN_001216c2(long *param_1,undefined8 param_2,undefined8 param_3)\n\n{\n  char cVar1;\n  long lVar2;\n  long lVar3;\n  char *pcVar4;\n  byte bVar5;\n  \n  bVar5 = 0;\n  lVar2 = FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3);\n  *param_1 = lVar2;\n  lVar3 = -1;\n  pcVar4 = (char *)(lVar2 + (int)param_1[1]);\n  do {\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar4;\n    pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;\n  } while (cVar1 != '\0');\n  *(uint *)(param_1 + 1) = (int)param_1[1] + -1 + ~(uint)lVar3;\n  return;\n}" primitive_type (function_declarator "FUN_001216c2(long *param_1,undefined8 param_2,undefined8 param_3)" identifier (parameter_list "(long *param_1,undefined8 param_2,undefined8 param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined8 param_2" type_identifier identifier) , (parameter_declaration "undefined8 param_3" type_identifier identifier) ))) (compound_statement "{\n  char cVar1;\n  long lVar2;\n  long lVar3;\n  char *pcVar4;\n  byte bVar5;\n  \n  bVar5 = 0;\n  lVar2 = FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3);\n  *param_1 = lVar2;\n  lVar3 = -1;\n  pcVar4 = (char *)(lVar2 + (int)param_1[1]);\n  do {\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar4;\n    pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;\n  } while (cVar1 != '\0');\n  *(uint *)(param_1 + 1) = (int)param_1[1] + -1 + ~(uint)lVar3;\n  return;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "byte bVar5;" type_identifier identifier ;) (expression_statement "bVar5 = 0;" (assignment_expression "bVar5 = 0" identifier = number_literal) ;) (expression_statement "lVar2 = FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3);" (assignment_expression "lVar2 = FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3)" identifier = (call_expression "FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3)" identifier (argument_list "(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3)" ( (pointer_expression "*param_1" * identifier) , (cast_expression "(int)param_1[1]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) , (binary_expression "(long)param_1 + 0xc" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) , identifier , identifier )))) ;) (expression_statement "*param_1 = lVar2;" (assignment_expression "*param_1 = lVar2" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "lVar3 = -1;" (assignment_expression "lVar3 = -1" identifier = number_literal) ;) (expression_statement "pcVar4 = (char *)(lVar2 + (int)param_1[1]);" (assignment_expression "pcVar4 = (char *)(lVar2 + (int)param_1[1])" identifier = (cast_expression "(char *)(lVar2 + (int)param_1[1])" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar2 + (int)param_1[1])" ( (binary_expression "lVar2 + (int)param_1[1]" identifier + (cast_expression "(int)param_1[1]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) )))) ;) (do_statement "do {\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar4;\n    pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;\n  } while (cVar1 != '\0');" do (compound_statement "{\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar4;\n    pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;\n  }" { (if_statement "if (lVar3 == 0) break;" if (parenthesized_expression "(lVar3 == 0)" ( (binary_expression "lVar3 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "lVar3 = lVar3 + -1;" (assignment_expression "lVar3 = lVar3 + -1" identifier = (binary_expression "lVar3 + -1" identifier + number_literal)) ;) (expression_statement "cVar1 = *pcVar4;" (assignment_expression "cVar1 = *pcVar4" identifier = (pointer_expression "*pcVar4" * identifier)) ;) (expression_statement "pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;" (assignment_expression "pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1" identifier = (binary_expression "pcVar4 + (ulong)bVar5 * -2 + 1" (binary_expression "pcVar4 + (ulong)bVar5 * -2" identifier + (binary_expression "(ulong)bVar5 * -2" (cast_expression "(ulong)bVar5" ( (type_descriptor "ulong" type_identifier) ) identifier) * number_literal)) + number_literal)) ;) }) while (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) ;) (expression_statement "*(uint *)(param_1 + 1) = (int)param_1[1] + -1 + ~(uint)lVar3;" (assignment_expression "*(uint *)(param_1 + 1) = (int)param_1[1] + -1 + ~(uint)lVar3" (pointer_expression "*(uint *)(param_1 + 1)" * (cast_expression "(uint *)(param_1 + 1)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 1)" ( (binary_expression "param_1 + 1" identifier + number_literal) )))) = (binary_expression "(int)param_1[1] + -1 + ~(uint)lVar3" (binary_expression "(int)param_1[1] + -1" (cast_expression "(int)param_1[1]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) + number_literal) + (unary_expression "~(uint)lVar3" ~ (cast_expression "(uint)lVar3" ( (type_descriptor "uint" type_identifier) ) identifier)))) ;) (return_statement "return;" return ;) })))
(translation_unit "void strbuf_catfv(strbuf *buf,char *fmt,__va_list_tag *ap)\n\n{\n  char cVar1;\n  char *pcVar2;\n  long lVar3;\n  byte bVar4;\n  \n  bVar4 = 0;\n  pcVar2 = dupvprintf_inner(buf->s,buf->len,&buf->size,fmt,ap);\n  buf->s = pcVar2;\n  lVar3 = -1;\n  pcVar2 = pcVar2 + buf->len;\n  do {\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar2;\n    pcVar2 = pcVar2 + (ulong)bVar4 * -2 + 1;\n  } while (cVar1 != '\0');\n  buf->len = buf->len + -1 + ~(uint)lVar3;\n  return;\n}\n\n" (function_definition "void strbuf_catfv(strbuf *buf,char *fmt,__va_list_tag *ap)\n\n{\n  char cVar1;\n  char *pcVar2;\n  long lVar3;\n  byte bVar4;\n  \n  bVar4 = 0;\n  pcVar2 = dupvprintf_inner(buf->s,buf->len,&buf->size,fmt,ap);\n  buf->s = pcVar2;\n  lVar3 = -1;\n  pcVar2 = pcVar2 + buf->len;\n  do {\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar2;\n    pcVar2 = pcVar2 + (ulong)bVar4 * -2 + 1;\n  } while (cVar1 != '\0');\n  buf->len = buf->len + -1 + ~(uint)lVar3;\n  return;\n}" primitive_type (function_declarator "strbuf_catfv(strbuf *buf,char *fmt,__va_list_tag *ap)" identifier (parameter_list "(strbuf *buf,char *fmt,__va_list_tag *ap)" ( (parameter_declaration "strbuf *buf" type_identifier (pointer_declarator "*buf" * identifier)) , (parameter_declaration "char *fmt" primitive_type (pointer_declarator "*fmt" * identifier)) , (parameter_declaration "__va_list_tag *ap" type_identifier (pointer_declarator "*ap" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  char *pcVar2;\n  long lVar3;\n  byte bVar4;\n  \n  bVar4 = 0;\n  pcVar2 = dupvprintf_inner(buf->s,buf->len,&buf->size,fmt,ap);\n  buf->s = pcVar2;\n  lVar3 = -1;\n  pcVar2 = pcVar2 + buf->len;\n  do {\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar2;\n    pcVar2 = pcVar2 + (ulong)bVar4 * -2 + 1;\n  } while (cVar1 != '\0');\n  buf->len = buf->len + -1 + ~(uint)lVar3;\n  return;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "byte bVar4;" type_identifier identifier ;) (expression_statement "bVar4 = 0;" (assignment_expression "bVar4 = 0" identifier = number_literal) ;) (expression_statement "pcVar2 = dupvprintf_inner(buf->s,buf->len,&buf->size,fmt,ap);" (assignment_expression "pcVar2 = dupvprintf_inner(buf->s,buf->len,&buf->size,fmt,ap)" identifier = (call_expression "dupvprintf_inner(buf->s,buf->len,&buf->size,fmt,ap)" identifier (argument_list "(buf->s,buf->len,&buf->size,fmt,ap)" ( (field_expression "buf->s" identifier -> field_identifier) , (field_expression "buf->len" identifier -> field_identifier) , (pointer_expression "&buf->size" & (field_expression "buf->size" identifier -> field_identifier)) , identifier , identifier )))) ;) (expression_statement "buf->s = pcVar2;" (assignment_expression "buf->s = pcVar2" (field_expression "buf->s" identifier -> field_identifier) = identifier) ;) (expression_statement "lVar3 = -1;" (assignment_expression "lVar3 = -1" identifier = number_literal) ;) (expression_statement "pcVar2 = pcVar2 + buf->len;" (assignment_expression "pcVar2 = pcVar2 + buf->len" identifier = (binary_expression "pcVar2 + buf->len" identifier + (field_expression "buf->len" identifier -> field_identifier))) ;) (do_statement "do {\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar2;\n    pcVar2 = pcVar2 + (ulong)bVar4 * -2 + 1;\n  } while (cVar1 != '\0');" do (compound_statement "{\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar2;\n    pcVar2 = pcVar2 + (ulong)bVar4 * -2 + 1;\n  }" { (if_statement "if (lVar3 == 0) break;" if (parenthesized_expression "(lVar3 == 0)" ( (binary_expression "lVar3 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "lVar3 = lVar3 + -1;" (assignment_expression "lVar3 = lVar3 + -1" identifier = (binary_expression "lVar3 + -1" identifier + number_literal)) ;) (expression_statement "cVar1 = *pcVar2;" (assignment_expression "cVar1 = *pcVar2" identifier = (pointer_expression "*pcVar2" * identifier)) ;) (expression_statement "pcVar2 = pcVar2 + (ulong)bVar4 * -2 + 1;" (assignment_expression "pcVar2 = pcVar2 + (ulong)bVar4 * -2 + 1" identifier = (binary_expression "pcVar2 + (ulong)bVar4 * -2 + 1" (binary_expression "pcVar2 + (ulong)bVar4 * -2" identifier + (binary_expression "(ulong)bVar4 * -2" (cast_expression "(ulong)bVar4" ( (type_descriptor "ulong" type_identifier) ) identifier) * number_literal)) + number_literal)) ;) }) while (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) ;) (expression_statement "buf->len = buf->len + -1 + ~(uint)lVar3;" (assignment_expression "buf->len = buf->len + -1 + ~(uint)lVar3" (field_expression "buf->len" identifier -> field_identifier) = (binary_expression "buf->len + -1 + ~(uint)lVar3" (binary_expression "buf->len + -1" (field_expression "buf->len" identifier -> field_identifier) + number_literal) + (unary_expression "~(uint)lVar3" ~ (cast_expression "(uint)lVar3" ( (type_descriptor "uint" type_identifier) ) identifier)))) ;) (return_statement "return;" return ;) })))
(translation_unit "void FUN_001216c2(long *param_1,undefined8 param_2,undefined8 param_3)\n\n{\n  char cVar1;\n  long lVar2;\n  long lVar3;\n  char *pcVar4;\n  byte bVar5;\n  \n  bVar5 = 0;\n  lVar2 = FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3);\n  *param_1 = lVar2;\n  lVar3 = -1;\n  pcVar4 = (char *)(lVar2 + (int)param_1[1]);\n  do {\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar4;\n    pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;\n  } while (cVar1 != '\0');\n  *(uint *)(param_1 + 1) = (int)param_1[1] + -1 + ~(uint)lVar3;\n  return;\n}\n\n" (function_definition "void FUN_001216c2(long *param_1,undefined8 param_2,undefined8 param_3)\n\n{\n  char cVar1;\n  long lVar2;\n  long lVar3;\n  char *pcVar4;\n  byte bVar5;\n  \n  bVar5 = 0;\n  lVar2 = FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3);\n  *param_1 = lVar2;\n  lVar3 = -1;\n  pcVar4 = (char *)(lVar2 + (int)param_1[1]);\n  do {\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar4;\n    pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;\n  } while (cVar1 != '\0');\n  *(uint *)(param_1 + 1) = (int)param_1[1] + -1 + ~(uint)lVar3;\n  return;\n}" primitive_type (function_declarator "FUN_001216c2(long *param_1,undefined8 param_2,undefined8 param_3)" identifier (parameter_list "(long *param_1,undefined8 param_2,undefined8 param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined8 param_2" type_identifier identifier) , (parameter_declaration "undefined8 param_3" type_identifier identifier) ))) (compound_statement "{\n  char cVar1;\n  long lVar2;\n  long lVar3;\n  char *pcVar4;\n  byte bVar5;\n  \n  bVar5 = 0;\n  lVar2 = FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3);\n  *param_1 = lVar2;\n  lVar3 = -1;\n  pcVar4 = (char *)(lVar2 + (int)param_1[1]);\n  do {\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar4;\n    pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;\n  } while (cVar1 != '\0');\n  *(uint *)(param_1 + 1) = (int)param_1[1] + -1 + ~(uint)lVar3;\n  return;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "byte bVar5;" type_identifier identifier ;) (expression_statement "bVar5 = 0;" (assignment_expression "bVar5 = 0" identifier = number_literal) ;) (expression_statement "lVar2 = FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3);" (assignment_expression "lVar2 = FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3)" identifier = (call_expression "FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3)" identifier (argument_list "(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3)" ( (pointer_expression "*param_1" * identifier) , (cast_expression "(int)param_1[1]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) , (binary_expression "(long)param_1 + 0xc" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) , identifier , identifier )))) ;) (expression_statement "*param_1 = lVar2;" (assignment_expression "*param_1 = lVar2" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "lVar3 = -1;" (assignment_expression "lVar3 = -1" identifier = number_literal) ;) (expression_statement "pcVar4 = (char *)(lVar2 + (int)param_1[1]);" (assignment_expression "pcVar4 = (char *)(lVar2 + (int)param_1[1])" identifier = (cast_expression "(char *)(lVar2 + (int)param_1[1])" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar2 + (int)param_1[1])" ( (binary_expression "lVar2 + (int)param_1[1]" identifier + (cast_expression "(int)param_1[1]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) )))) ;) (do_statement "do {\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar4;\n    pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;\n  } while (cVar1 != '\0');" do (compound_statement "{\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar4;\n    pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;\n  }" { (if_statement "if (lVar3 == 0) break;" if (parenthesized_expression "(lVar3 == 0)" ( (binary_expression "lVar3 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "lVar3 = lVar3 + -1;" (assignment_expression "lVar3 = lVar3 + -1" identifier = (binary_expression "lVar3 + -1" identifier + number_literal)) ;) (expression_statement "cVar1 = *pcVar4;" (assignment_expression "cVar1 = *pcVar4" identifier = (pointer_expression "*pcVar4" * identifier)) ;) (expression_statement "pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;" (assignment_expression "pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1" identifier = (binary_expression "pcVar4 + (ulong)bVar5 * -2 + 1" (binary_expression "pcVar4 + (ulong)bVar5 * -2" identifier + (binary_expression "(ulong)bVar5 * -2" (cast_expression "(ulong)bVar5" ( (type_descriptor "ulong" type_identifier) ) identifier) * number_literal)) + number_literal)) ;) }) while (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) ;) (expression_statement "*(uint *)(param_1 + 1) = (int)param_1[1] + -1 + ~(uint)lVar3;" (assignment_expression "*(uint *)(param_1 + 1) = (int)param_1[1] + -1 + ~(uint)lVar3" (pointer_expression "*(uint *)(param_1 + 1)" * (cast_expression "(uint *)(param_1 + 1)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 1)" ( (binary_expression "param_1 + 1" identifier + number_literal) )))) = (binary_expression "(int)param_1[1] + -1 + ~(uint)lVar3" (binary_expression "(int)param_1[1] + -1" (cast_expression "(int)param_1[1]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) + number_literal) + (unary_expression "~(uint)lVar3" ~ (cast_expression "(uint)lVar3" ( (type_descriptor "uint" type_identifier) ) 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) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) , (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) , (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + LIT) , IDENT , IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ]))) )))) ;) (do_statement do (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT + (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) * LIT)) + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != (char_literal ' escape_sequence ')) )) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) + LIT) + (unary_expression ~ (cast_expression ( (type_descriptor TYPE) ) IDENT)))) ;) (return_statement return ;) })))
(function_definition "void FUN_001216c2(long *param_1,undefined8 param_2,undefined8 param_3)\n\n{\n  char cVar1;\n  long lVar2;\n  long lVar3;\n  char *pcVar4;\n  byte bVar5;\n  \n  bVar5 = 0;\n  lVar2 = FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3);\n  *param_1 = lVar2;\n  lVar3 = -1;\n  pcVar4 = (char *)(lVar2 + (int)param_1[1]);\n  do {\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar4;\n    pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;\n  } while (cVar1 != '\0');\n  *(uint *)(param_1 + 1) = (int)param_1[1] + -1 + ~(uint)lVar3;\n  return;\n}" (primitive_type "void") (function_declarator "FUN_001216c2(long *param_1,undefined8 param_2,undefined8 param_3)" (identifier "FUN_001216c2") (parameter_list "(long *param_1,undefined8 param_2,undefined8 param_3)" (( "(") (parameter_declaration "long *param_1" (sized_type_specifier "long" (long "long")) (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined8 param_2" (type_identifier "undefined8") (identifier "param_2")) (, ",") (parameter_declaration "undefined8 param_3" (type_identifier "undefined8") (identifier "param_3")) () ")"))) (compound_statement "{\n  char cVar1;\n  long lVar2;\n  long lVar3;\n  char *pcVar4;\n  byte bVar5;\n  \n  bVar5 = 0;\n  lVar2 = FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3);\n  *param_1 = lVar2;\n  lVar3 = -1;\n  pcVar4 = (char *)(lVar2 + (int)param_1[1]);\n  do {\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar4;\n    pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;\n  } while (cVar1 != '\0');\n  *(uint *)(param_1 + 1) = (int)param_1[1] + -1 + ~(uint)lVar3;\n  return;\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "long lVar2;" (sized_type_specifier "long" (long "long")) (identifier "lVar2") (; ";")) (declaration "long lVar3;" (sized_type_specifier "long" (long "long")) (identifier "lVar3") (; ";")) (declaration "char *pcVar4;" (primitive_type "char") (pointer_declarator "*pcVar4" (* "*") (identifier "pcVar4")) (; ";")) (declaration "byte bVar5;" (type_identifier "byte") (identifier "bVar5") (; ";")) (expression_statement "bVar5 = 0;" (assignment_expression "bVar5 = 0" (identifier "bVar5") (= "=") (number_literal "0")) (; ";")) (expression_statement "lVar2 = FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3);" (assignment_expression "lVar2 = FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3)" (identifier "lVar2") (= "=") (call_expression "FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3)" (identifier "FUN_00121428") (argument_list "(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3)" (( "(") (pointer_expression "*param_1" (* "*") (identifier "param_1")) (, ",") (cast_expression "(int)param_1[1]" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (, ",") (binary_expression "(long)param_1 + 0xc" (cast_expression "(long)param_1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_1")) (+ "+") (number_literal "0xc")) (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")")))) (; ";")) (expression_statement "*param_1 = lVar2;" (assignment_expression "*param_1 = lVar2" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "lVar2")) (; ";")) (expression_statement "lVar3 = -1;" (assignment_expression "lVar3 = -1" (identifier "lVar3") (= "=") (number_literal "-1")) (; ";")) (expression_statement "pcVar4 = (char *)(lVar2 + (int)param_1[1]);" (assignment_expression "pcVar4 = (char *)(lVar2 + (int)param_1[1])" (identifier "pcVar4") (= "=") (cast_expression "(char *)(lVar2 + (int)param_1[1])" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar2 + (int)param_1[1])" (( "(") (binary_expression "lVar2 + (int)param_1[1]" (identifier "lVar2") (+ "+") (cast_expression "(int)param_1[1]" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")))) () ")")))) (; ";")) (do_statement "do {\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar4;\n    pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;\n  } while (cVar1 != '\0');" (do "do") (compound_statement "{\n    if (lVar3 == 0) break;\n    lVar3 = lVar3 + -1;\n    cVar1 = *pcVar4;\n    pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;\n  }" ({ "{") (if_statement "if (lVar3 == 0) break;" (if "if") (parenthesized_expression "(lVar3 == 0)" (( "(") (binary_expression "lVar3 == 0" (identifier "lVar3") (== "==") (number_literal "0")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "lVar3 = lVar3 + -1;" (assignment_expression "lVar3 = lVar3 + -1" (identifier "lVar3") (= "=") (binary_expression "lVar3 + -1" (identifier "lVar3") (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "cVar1 = *pcVar4;" (assignment_expression "cVar1 = *pcVar4" (identifier "cVar1") (= "=") (pointer_expression "*pcVar4" (* "*") (identifier "pcVar4"))) (; ";")) (expression_statement "pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;" (assignment_expression "pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1" (identifier "pcVar4") (= "=") (binary_expression "pcVar4 + (ulong)bVar5 * -2 + 1" (binary_expression "pcVar4 + (ulong)bVar5 * -2" (identifier "pcVar4") (+ "+") (binary_expression "(ulong)bVar5 * -2" (cast_expression "(ulong)bVar5" (( "(") (type_descriptor "ulong" (type_identifier "ulong")) () ")") (identifier "bVar5")) (* "*") (number_literal "-2"))) (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(cVar1 != '\0')" (( "(") (binary_expression "cVar1 != '\0'" (identifier "cVar1") (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (; ";")) (expression_statement "*(uint *)(param_1 + 1) = (int)param_1[1] + -1 + ~(uint)lVar3;" (assignment_expression "*(uint *)(param_1 + 1) = (int)param_1[1] + -1 + ~(uint)lVar3" (pointer_expression "*(uint *)(param_1 + 1)" (* "*") (cast_expression "(uint *)(param_1 + 1)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 1)" (( "(") (binary_expression "param_1 + 1" (identifier "param_1") (+ "+") (number_literal "1")) () ")")))) (= "=") (binary_expression "(int)param_1[1] + -1 + ~(uint)lVar3" (binary_expression "(int)param_1[1] + -1" (cast_expression "(int)param_1[1]" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (+ "+") (number_literal "-1")) (+ "+") (unary_expression "~(uint)lVar3" (~ "~") (cast_expression "(uint)lVar3" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "lVar3"))))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

void function_1(type_1 *buf,char *fmt,type_2 *ap)

{
  char var_4;
  char *var_2;
  long var_3;
  type_3 bVar4;
  
  bVar4 = 0;
  var_2 = var_1(buf->s,buf->len,&buf->size,fmt,ap);
  buf->s = var_2;
  var_3 = -1;
  var_2 = var_2 + buf->len;
  do {
    if (var_3 == 0) break;
    var_3 = var_3 + -1;
    var_4 = *var_2;
    var_2 = var_2 + (type_4)bVar4 * -2 + 1;
  } while (var_4 != '\0');
  buf->len = buf->len + -1 + ~(type_5)var_3;
  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: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)) (cast_expression type: (type_descriptor type: (primitive_type)) value: (subscript_expression argument: (identifier) index: (number_literal))) (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (number_literal)) (identifier) (identifier))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (subscript_expression argument: (identifier) index: (number_literal)))))))) (do_statement body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (break_statement)) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)) right: (number_literal))) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence))))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (binary_expression left: (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (subscript_expression argument: (identifier) index: (number_literal))) right: (number_literal)) right: (unary_expression argument: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)))))) (return_statement))))

void MASKED(long *param_1,undefined8 param_2,undefined8 param_3)

{
  char cVar1;
  long lVar2;
  long lVar3;
  char *pcVar4;
  byte bVar5;
  
  bVar5 = 0;
  lVar2 = FUN_00121428(*param_1,(int)param_1[1],(long)param_1 + 0xc,param_2,param_3);
  *param_1 = lVar2;
  lVar3 = -1;
  pcVar4 = (char *)(lVar2 + (int)param_1[1]);
  do {
    if (lVar3 == 0) break;
    lVar3 = lVar3 + -1;
    cVar1 = *pcVar4;
    pcVar4 = pcVar4 + (ulong)bVar5 * -2 + 1;
  } while (cVar1 != '\0');
  *(uint *)(param_1 + 1) = (int)param_1[1] + -1 + ~(uint)lVar3;
  return;
}

