
/* WARNING: Unknown calling convention */

int fts5Dequote(char *z)

{
  char cVar1;
  int iVar2;
  long lVar3;
  char cVar4;
  
  cVar4 = *z;
  if (*z == '[') {
    cVar4 = ']';
  }
  lVar3 = 0;
  iVar2 = 1;
  do {
    cVar1 = z[iVar2];
    if (cVar1 == '\0') {
LAB_001346ca:
      z[(int)lVar3] = '\0';
      return iVar2;
    }
    if (cVar1 == cVar4) {
      if (z[(long)iVar2 + 1] != cVar4) {
        iVar2 = iVar2 + 1;
        goto LAB_001346ca;
      }
      iVar2 = iVar2 + 2;
      z[lVar3] = cVar4;
    }
    else {
      iVar2 = iVar2 + 1;
      z[lVar3] = cVar1;
    }
    lVar3 = lVar3 + 1;
  } while( true );
}



int FUN_001346aa(char *param_1)

{
  char cVar1;
  int iVar2;
  long lVar3;
  char cVar4;
  
  cVar4 = *param_1;
  if (*param_1 == '[') {
    cVar4 = ']';
  }
  lVar3 = 0;
  iVar2 = 1;
  do {
    cVar1 = param_1[iVar2];
    if (cVar1 == '\0') {
LAB_001346ca:
      param_1[(int)lVar3] = '\0';
      return iVar2;
    }
    if (cVar1 == cVar4) {
      if (param_1[(long)iVar2 + 1] != cVar4) {
        iVar2 = iVar2 + 1;
        goto LAB_001346ca;
      }
      iVar2 = iVar2 + 2;
      param_1[lVar3] = cVar4;
    }
    else {
      iVar2 = iVar2 + 1;
      param_1[lVar3] = cVar1;
    }
    lVar3 = lVar3 + 1;
  } while( true );
}


MOVZX R8D,byte ptr [RDI]
CMP R8B,0x5b
MOV EAX,0x5d
CMOVZ R8D,EAX
MOV EDX,0x0
MOV EAX,0x1
JMP 0x001346dd
ADD EAX,0x1
MOVSXD R9,R9D
MOV byte ptr [RDI + R9*0x1],0x0
RET
ADD EAX,0x1
MOV byte ptr [RDI + RDX*0x1],CL
ADD RDX,0x1
MOV R9D,EDX
MOVSXD RSI,EAX
MOVZX ECX,byte ptr [RDI + RSI*0x1]
TEST CL,CL
JZ 0x001346ca
CMP CL,R8B
JNZ 0x001346d3
CMP byte ptr [RDI + RSI*0x1 + 0x1],R8B
JNZ 0x001346c7
ADD EAX,0x2
MOV byte ptr [RDI + RDX*0x1],R8B
JMP 0x001346d9
(translation_unit "int FUN_001346aa(char *param_1)\n\n{\n  char cVar1;\n  int iVar2;\n  long lVar3;\n  char cVar4;\n  \n  cVar4 = *param_1;\n  if (*param_1 == '[') {\n    cVar4 = ']';\n  }\n  lVar3 = 0;\n  iVar2 = 1;\n  do {\n    cVar1 = param_1[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  } while( true );\n}\n\n" (function_definition "int FUN_001346aa(char *param_1)\n\n{\n  char cVar1;\n  int iVar2;\n  long lVar3;\n  char cVar4;\n  \n  cVar4 = *param_1;\n  if (*param_1 == '[') {\n    cVar4 = ']';\n  }\n  lVar3 = 0;\n  iVar2 = 1;\n  do {\n    cVar1 = param_1[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  } while( true );\n}" primitive_type (function_declarator "FUN_001346aa(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  long lVar3;\n  char cVar4;\n  \n  cVar4 = *param_1;\n  if (*param_1 == '[') {\n    cVar4 = ']';\n  }\n  lVar3 = 0;\n  iVar2 = 1;\n  do {\n    cVar1 = param_1[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  } while( true );\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "char cVar4;" primitive_type identifier ;) (expression_statement "cVar4 = *param_1;" (assignment_expression "cVar4 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if (*param_1 == '[') {\n    cVar4 = ']';\n  }" if (parenthesized_expression "(*param_1 == '[')" ( (binary_expression "*param_1 == '['" (pointer_expression "*param_1" * identifier) == (char_literal "'['" ' character ')) )) (compound_statement "{\n    cVar4 = ']';\n  }" { (expression_statement "cVar4 = ']';" (assignment_expression "cVar4 = ']'" identifier = (char_literal "']'" ' character ')) ;) })) (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) (expression_statement "iVar2 = 1;" (assignment_expression "iVar2 = 1" identifier = number_literal) ;) (do_statement "do {\n    cVar1 = param_1[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  } while( true );" do (compound_statement "{\n    cVar1 = param_1[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  }" { (expression_statement "cVar1 = param_1[iVar2];" (assignment_expression "cVar1 = param_1[iVar2]" identifier = (subscript_expression "param_1[iVar2]" identifier [ identifier ])) ;) (if_statement "if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }" if (parenthesized_expression "(cVar1 == '\0')" ( (binary_expression "cVar1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }" { (labeled_statement "LAB_001346ca:\n      param_1[(int)lVar3] = '\0';" statement_identifier : (expression_statement "param_1[(int)lVar3] = '\0';" (assignment_expression "param_1[(int)lVar3] = '\0'" (subscript_expression "param_1[(int)lVar3]" identifier [ (cast_expression "(int)lVar3" ( (type_descriptor "int" primitive_type) ) identifier) ]) = (char_literal "'\0'" ' escape_sequence ')) ;)) (return_statement "return iVar2;" return identifier ;) })) (if_statement "if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }" if (parenthesized_expression "(cVar1 == cVar4)" ( (binary_expression "cVar1 == cVar4" identifier == identifier) )) (compound_statement "{\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }" { (if_statement "if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }" if (parenthesized_expression "(param_1[(long)iVar2 + 1] != cVar4)" ( (binary_expression "param_1[(long)iVar2 + 1] != cVar4" (subscript_expression "param_1[(long)iVar2 + 1]" identifier [ (binary_expression "(long)iVar2 + 1" (cast_expression "(long)iVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) ]) != identifier) )) (compound_statement "{\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }" { (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (goto_statement "goto LAB_001346ca;" goto statement_identifier ;) })) (expression_statement "iVar2 = iVar2 + 2;" (assignment_expression "iVar2 = iVar2 + 2" identifier = (binary_expression "iVar2 + 2" identifier + number_literal)) ;) (expression_statement "param_1[lVar3] = cVar4;" (assignment_expression "param_1[lVar3] = cVar4" (subscript_expression "param_1[lVar3]" identifier [ identifier ]) = identifier) ;) }) (else_clause "else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }" else (compound_statement "{\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }" { (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (expression_statement "param_1[lVar3] = cVar1;" (assignment_expression "param_1[lVar3] = cVar1" (subscript_expression "param_1[lVar3]" identifier [ identifier ]) = identifier) ;) }))) (expression_statement "lVar3 = lVar3 + 1;" (assignment_expression "lVar3 = lVar3 + 1" identifier = (binary_expression "lVar3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "/* WARNING: Unknown calling convention */\n\nint fts5Dequote(char *z)\n\n{\n  char cVar1;\n  int iVar2;\n  long lVar3;\n  char cVar4;\n  \n  cVar4 = *z;\n  if (*z == '[') {\n    cVar4 = ']';\n  }\n  lVar3 = 0;\n  iVar2 = 1;\n  do {\n    cVar1 = z[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      z[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (z[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      z[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      z[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  } while( true );\n}\n\n" comment (function_definition "int fts5Dequote(char *z)\n\n{\n  char cVar1;\n  int iVar2;\n  long lVar3;\n  char cVar4;\n  \n  cVar4 = *z;\n  if (*z == '[') {\n    cVar4 = ']';\n  }\n  lVar3 = 0;\n  iVar2 = 1;\n  do {\n    cVar1 = z[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      z[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (z[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      z[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      z[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  } while( true );\n}" primitive_type (function_declarator "fts5Dequote(char *z)" identifier (parameter_list "(char *z)" ( (parameter_declaration "char *z" primitive_type (pointer_declarator "*z" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  long lVar3;\n  char cVar4;\n  \n  cVar4 = *z;\n  if (*z == '[') {\n    cVar4 = ']';\n  }\n  lVar3 = 0;\n  iVar2 = 1;\n  do {\n    cVar1 = z[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      z[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (z[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      z[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      z[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  } while( true );\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "char cVar4;" primitive_type identifier ;) (expression_statement "cVar4 = *z;" (assignment_expression "cVar4 = *z" identifier = (pointer_expression "*z" * identifier)) ;) (if_statement "if (*z == '[') {\n    cVar4 = ']';\n  }" if (parenthesized_expression "(*z == '[')" ( (binary_expression "*z == '['" (pointer_expression "*z" * identifier) == (char_literal "'['" ' character ')) )) (compound_statement "{\n    cVar4 = ']';\n  }" { (expression_statement "cVar4 = ']';" (assignment_expression "cVar4 = ']'" identifier = (char_literal "']'" ' character ')) ;) })) (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) (expression_statement "iVar2 = 1;" (assignment_expression "iVar2 = 1" identifier = number_literal) ;) (do_statement "do {\n    cVar1 = z[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      z[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (z[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      z[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      z[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  } while( true );" do (compound_statement "{\n    cVar1 = z[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      z[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (z[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      z[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      z[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  }" { (expression_statement "cVar1 = z[iVar2];" (assignment_expression "cVar1 = z[iVar2]" identifier = (subscript_expression "z[iVar2]" identifier [ identifier ])) ;) (if_statement "if (cVar1 == '\0') {\nLAB_001346ca:\n      z[(int)lVar3] = '\0';\n      return iVar2;\n    }" if (parenthesized_expression "(cVar1 == '\0')" ( (binary_expression "cVar1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\nLAB_001346ca:\n      z[(int)lVar3] = '\0';\n      return iVar2;\n    }" { (labeled_statement "LAB_001346ca:\n      z[(int)lVar3] = '\0';" statement_identifier : (expression_statement "z[(int)lVar3] = '\0';" (assignment_expression "z[(int)lVar3] = '\0'" (subscript_expression "z[(int)lVar3]" identifier [ (cast_expression "(int)lVar3" ( (type_descriptor "int" primitive_type) ) identifier) ]) = (char_literal "'\0'" ' escape_sequence ')) ;)) (return_statement "return iVar2;" return identifier ;) })) (if_statement "if (cVar1 == cVar4) {\n      if (z[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      z[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      z[lVar3] = cVar1;\n    }" if (parenthesized_expression "(cVar1 == cVar4)" ( (binary_expression "cVar1 == cVar4" identifier == identifier) )) (compound_statement "{\n      if (z[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      z[lVar3] = cVar4;\n    }" { (if_statement "if (z[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }" if (parenthesized_expression "(z[(long)iVar2 + 1] != cVar4)" ( (binary_expression "z[(long)iVar2 + 1] != cVar4" (subscript_expression "z[(long)iVar2 + 1]" identifier [ (binary_expression "(long)iVar2 + 1" (cast_expression "(long)iVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) ]) != identifier) )) (compound_statement "{\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }" { (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (goto_statement "goto LAB_001346ca;" goto statement_identifier ;) })) (expression_statement "iVar2 = iVar2 + 2;" (assignment_expression "iVar2 = iVar2 + 2" identifier = (binary_expression "iVar2 + 2" identifier + number_literal)) ;) (expression_statement "z[lVar3] = cVar4;" (assignment_expression "z[lVar3] = cVar4" (subscript_expression "z[lVar3]" identifier [ identifier ]) = identifier) ;) }) (else_clause "else {\n      iVar2 = iVar2 + 1;\n      z[lVar3] = cVar1;\n    }" else (compound_statement "{\n      iVar2 = iVar2 + 1;\n      z[lVar3] = cVar1;\n    }" { (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (expression_statement "z[lVar3] = cVar1;" (assignment_expression "z[lVar3] = cVar1" (subscript_expression "z[lVar3]" identifier [ identifier ]) = identifier) ;) }))) (expression_statement "lVar3 = lVar3 + 1;" (assignment_expression "lVar3 = lVar3 + 1" identifier = (binary_expression "lVar3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "int FUN_001346aa(char *param_1)\n\n{\n  char cVar1;\n  int iVar2;\n  long lVar3;\n  char cVar4;\n  \n  cVar4 = *param_1;\n  if (*param_1 == '[') {\n    cVar4 = ']';\n  }\n  lVar3 = 0;\n  iVar2 = 1;\n  do {\n    cVar1 = param_1[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  } while( true );\n}\n\n" (function_definition "int FUN_001346aa(char *param_1)\n\n{\n  char cVar1;\n  int iVar2;\n  long lVar3;\n  char cVar4;\n  \n  cVar4 = *param_1;\n  if (*param_1 == '[') {\n    cVar4 = ']';\n  }\n  lVar3 = 0;\n  iVar2 = 1;\n  do {\n    cVar1 = param_1[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  } while( true );\n}" primitive_type (function_declarator "FUN_001346aa(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  long lVar3;\n  char cVar4;\n  \n  cVar4 = *param_1;\n  if (*param_1 == '[') {\n    cVar4 = ']';\n  }\n  lVar3 = 0;\n  iVar2 = 1;\n  do {\n    cVar1 = param_1[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  } while( true );\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "char cVar4;" primitive_type identifier ;) (expression_statement "cVar4 = *param_1;" (assignment_expression "cVar4 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if (*param_1 == '[') {\n    cVar4 = ']';\n  }" if (parenthesized_expression "(*param_1 == '[')" ( (binary_expression "*param_1 == '['" (pointer_expression "*param_1" * identifier) == (char_literal "'['" ' character ')) )) (compound_statement "{\n    cVar4 = ']';\n  }" { (expression_statement "cVar4 = ']';" (assignment_expression "cVar4 = ']'" identifier = (char_literal "']'" ' character ')) ;) })) (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) (expression_statement "iVar2 = 1;" (assignment_expression "iVar2 = 1" identifier = number_literal) ;) (do_statement "do {\n    cVar1 = param_1[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  } while( true );" do (compound_statement "{\n    cVar1 = param_1[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  }" { (expression_statement "cVar1 = param_1[iVar2];" (assignment_expression "cVar1 = param_1[iVar2]" identifier = (subscript_expression "param_1[iVar2]" identifier [ identifier ])) ;) (if_statement "if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }" if (parenthesized_expression "(cVar1 == '\0')" ( (binary_expression "cVar1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }" { (labeled_statement "LAB_001346ca:\n      param_1[(int)lVar3] = '\0';" statement_identifier : (expression_statement "param_1[(int)lVar3] = '\0';" (assignment_expression "param_1[(int)lVar3] = '\0'" (subscript_expression "param_1[(int)lVar3]" identifier [ (cast_expression "(int)lVar3" ( (type_descriptor "int" primitive_type) ) identifier) ]) = (char_literal "'\0'" ' escape_sequence ')) ;)) (return_statement "return iVar2;" return identifier ;) })) (if_statement "if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }" if (parenthesized_expression "(cVar1 == cVar4)" ( (binary_expression "cVar1 == cVar4" identifier == identifier) )) (compound_statement "{\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }" { (if_statement "if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }" if (parenthesized_expression "(param_1[(long)iVar2 + 1] != cVar4)" ( (binary_expression "param_1[(long)iVar2 + 1] != cVar4" (subscript_expression "param_1[(long)iVar2 + 1]" identifier [ (binary_expression "(long)iVar2 + 1" (cast_expression "(long)iVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + number_literal) ]) != identifier) )) (compound_statement "{\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }" { (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (goto_statement "goto LAB_001346ca;" goto statement_identifier ;) })) (expression_statement "iVar2 = iVar2 + 2;" (assignment_expression "iVar2 = iVar2 + 2" identifier = (binary_expression "iVar2 + 2" identifier + number_literal)) ;) (expression_statement "param_1[lVar3] = cVar4;" (assignment_expression "param_1[lVar3] = cVar4" (subscript_expression "param_1[lVar3]" identifier [ identifier ]) = identifier) ;) }) (else_clause "else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }" else (compound_statement "{\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }" { (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" identifier = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (expression_statement "param_1[lVar3] = cVar1;" (assignment_expression "param_1[lVar3] = cVar1" (subscript_expression "param_1[lVar3]" identifier [ identifier ]) = identifier) ;) }))) (expression_statement "lVar3 = lVar3 + 1;" (assignment_expression "lVar3 = lVar3 + 1" identifier = (binary_expression "lVar3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == (char_literal ' character ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (char_literal ' character ')) ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ IDENT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (char_literal ' escape_sequence ')) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression (subscript_expression IDENT [ (cast_expression ( (type_descriptor TYPE) ) IDENT) ]) = (char_literal ' escape_sequence ')) ;)) (return_statement return IDENT ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + LIT) ]) != IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ IDENT ]) = IDENT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ IDENT ]) = IDENT) ;) }))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( BOOL )) ;) })))
(function_definition "int FUN_001346aa(char *param_1)\n\n{\n  char cVar1;\n  int iVar2;\n  long lVar3;\n  char cVar4;\n  \n  cVar4 = *param_1;\n  if (*param_1 == '[') {\n    cVar4 = ']';\n  }\n  lVar3 = 0;\n  iVar2 = 1;\n  do {\n    cVar1 = param_1[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  } while( true );\n}" (primitive_type "int") (function_declarator "FUN_001346aa(char *param_1)" (identifier "FUN_001346aa") (parameter_list "(char *param_1)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  long lVar3;\n  char cVar4;\n  \n  cVar4 = *param_1;\n  if (*param_1 == '[') {\n    cVar4 = ']';\n  }\n  lVar3 = 0;\n  iVar2 = 1;\n  do {\n    cVar1 = param_1[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  } while( true );\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "long lVar3;" (sized_type_specifier "long" (long "long")) (identifier "lVar3") (; ";")) (declaration "char cVar4;" (primitive_type "char") (identifier "cVar4") (; ";")) (expression_statement "cVar4 = *param_1;" (assignment_expression "cVar4 = *param_1" (identifier "cVar4") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (if_statement "if (*param_1 == '[') {\n    cVar4 = ']';\n  }" (if "if") (parenthesized_expression "(*param_1 == '[')" (( "(") (binary_expression "*param_1 == '['" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (== "==") (char_literal "'['" (' "'") (character "[") (' "'"))) () ")")) (compound_statement "{\n    cVar4 = ']';\n  }" ({ "{") (expression_statement "cVar4 = ']';" (assignment_expression "cVar4 = ']'" (identifier "cVar4") (= "=") (char_literal "']'" (' "'") (character "]") (' "'"))) (; ";")) (} "}"))) (expression_statement "lVar3 = 0;" (assignment_expression "lVar3 = 0" (identifier "lVar3") (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar2 = 1;" (assignment_expression "iVar2 = 1" (identifier "iVar2") (= "=") (number_literal "1")) (; ";")) (do_statement "do {\n    cVar1 = param_1[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  } while( true );" (do "do") (compound_statement "{\n    cVar1 = param_1[iVar2];\n    if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }\n    if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }\n    lVar3 = lVar3 + 1;\n  }" ({ "{") (expression_statement "cVar1 = param_1[iVar2];" (assignment_expression "cVar1 = param_1[iVar2]" (identifier "cVar1") (= "=") (subscript_expression "param_1[iVar2]" (identifier "param_1") ([ "[") (identifier "iVar2") (] "]"))) (; ";")) (if_statement "if (cVar1 == '\0') {\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }" (if "if") (parenthesized_expression "(cVar1 == '\0')" (( "(") (binary_expression "cVar1 == '\0'" (identifier "cVar1") (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\nLAB_001346ca:\n      param_1[(int)lVar3] = '\0';\n      return iVar2;\n    }" ({ "{") (labeled_statement "LAB_001346ca:\n      param_1[(int)lVar3] = '\0';" (statement_identifier "LAB_001346ca") (: ":") (expression_statement "param_1[(int)lVar3] = '\0';" (assignment_expression "param_1[(int)lVar3] = '\0'" (subscript_expression "param_1[(int)lVar3]" (identifier "param_1") ([ "[") (cast_expression "(int)lVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "lVar3")) (] "]")) (= "=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) (; ";"))) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (if_statement "if (cVar1 == cVar4) {\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }\n    else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }" (if "if") (parenthesized_expression "(cVar1 == cVar4)" (( "(") (binary_expression "cVar1 == cVar4" (identifier "cVar1") (== "==") (identifier "cVar4")) () ")")) (compound_statement "{\n      if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }\n      iVar2 = iVar2 + 2;\n      param_1[lVar3] = cVar4;\n    }" ({ "{") (if_statement "if (param_1[(long)iVar2 + 1] != cVar4) {\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }" (if "if") (parenthesized_expression "(param_1[(long)iVar2 + 1] != cVar4)" (( "(") (binary_expression "param_1[(long)iVar2 + 1] != cVar4" (subscript_expression "param_1[(long)iVar2 + 1]" (identifier "param_1") ([ "[") (binary_expression "(long)iVar2 + 1" (cast_expression "(long)iVar2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "iVar2")) (+ "+") (number_literal "1")) (] "]")) (!= "!=") (identifier "cVar4")) () ")")) (compound_statement "{\n        iVar2 = iVar2 + 1;\n        goto LAB_001346ca;\n      }" ({ "{") (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" (identifier "iVar2") (= "=") (binary_expression "iVar2 + 1" (identifier "iVar2") (+ "+") (number_literal "1"))) (; ";")) (goto_statement "goto LAB_001346ca;" (goto "goto") (statement_identifier "LAB_001346ca") (; ";")) (} "}"))) (expression_statement "iVar2 = iVar2 + 2;" (assignment_expression "iVar2 = iVar2 + 2" (identifier "iVar2") (= "=") (binary_expression "iVar2 + 2" (identifier "iVar2") (+ "+") (number_literal "2"))) (; ";")) (expression_statement "param_1[lVar3] = cVar4;" (assignment_expression "param_1[lVar3] = cVar4" (subscript_expression "param_1[lVar3]" (identifier "param_1") ([ "[") (identifier "lVar3") (] "]")) (= "=") (identifier "cVar4")) (; ";")) (} "}")) (else_clause "else {\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }" (else "else") (compound_statement "{\n      iVar2 = iVar2 + 1;\n      param_1[lVar3] = cVar1;\n    }" ({ "{") (expression_statement "iVar2 = iVar2 + 1;" (assignment_expression "iVar2 = iVar2 + 1" (identifier "iVar2") (= "=") (binary_expression "iVar2 + 1" (identifier "iVar2") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "param_1[lVar3] = cVar1;" (assignment_expression "param_1[lVar3] = cVar1" (subscript_expression "param_1[lVar3]" (identifier "param_1") ([ "[") (identifier "lVar3") (] "]")) (= "=") (identifier "cVar1")) (; ";")) (} "}")))) (expression_statement "lVar3 = lVar3 + 1;" (assignment_expression "lVar3 = lVar3 + 1" (identifier "lVar3") (= "=") (binary_expression "lVar3 + 1" (identifier "lVar3") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (; ";")) (} "}")))

/* WARNING: Unknown calling convention */

int function_1(char *z)

{
  char var_1;
  int var_3;
  long var_4;
  char var_2;
  
  var_2 = *z;
  if (*z == '[') {
    var_2 = ']';
  }
  var_4 = 0;
  var_3 = 1;
  do {
    var_1 = z[var_3];
    if (var_1 == '\0') {
LAB_001346ca:
      z[(int)var_4] = '\0';
      return var_3;
    }
    if (var_1 == var_2) {
      if (z[(long)var_3 + 1] != var_2) {
        var_3 = var_3 + 1;
        goto LAB_001346ca;
      }
      var_3 = var_3 + 2;
      z[var_4] = var_2;
    }
    else {
      var_3 = var_3 + 1;
      z[var_4] = var_1;
    }
    var_4 = var_4 + 1;
  } while( true );
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (char_literal (character)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (char_literal (character)))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence)))) consequence: (compound_statement (labeled_statement label: (statement_identifier) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier))) right: (char_literal (escape_sequence))))) (return_statement (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (number_literal))) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (goto_statement label: (statement_identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (identifier)) right: (identifier)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (identifier)) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (true))))))

int MASKED(char *param_1)

{
  char cVar1;
  int iVar2;
  long lVar3;
  char cVar4;
  
  cVar4 = *param_1;
  if (*param_1 == '[') {
    cVar4 = ']';
  }
  lVar3 = 0;
  iVar2 = 1;
  do {
    cVar1 = param_1[iVar2];
    if (cVar1 == '\0') {
LAB_001346ca:
      param_1[(int)lVar3] = '\0';
      return iVar2;
    }
    if (cVar1 == cVar4) {
      if (param_1[(long)iVar2 + 1] != cVar4) {
        iVar2 = iVar2 + 1;
        goto LAB_001346ca;
      }
      iVar2 = iVar2 + 2;
      param_1[lVar3] = cVar4;
    }
    else {
      iVar2 = iVar2 + 1;
      param_1[lVar3] = cVar1;
    }
    lVar3 = lVar3 + 1;
  } while( true );
}

