// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/mgth/mg_xmlparser.c
// Function: mg_xmlparser
int mg_xmlparser(ParseStruct *parsestruct_ptr, GtFile * fp_xmlfile,
                 GtError * err)
{
  int had_err = 0;

  /* Expat XML-Error setzen */
  enum XML_Error error;

  /* Puffer zum zeilenweisen Einlesen des XML-Files, XML_Parser
     deklarieren */
  GtStr *buf;
  XML_Parser parser;

  /* Check Umgebungsvariablen */
  gt_error_check(err);

  /* Puffer-String anlegen */
  buf = gt_str_new();

  /* XML-Parser wird initialisiert */
  parser = XML_ParserCreate(NULL);
  /* Die Struktur parsestruct wird als UserData gesetzt */
  XML_SetUserData(parser, parsestruct_ptr);
  /* Start- und Endelement Handler werden gesetzt */
  XML_SetElementHandler(parser, startElement, endElement);
  /* Text-Handler setzen */
  XML_SetCharacterDataHandler(parser, textElement);

  while ((gt_str_read_next_line_generic(buf, fp_xmlfile) != EOF) && !had_err)
  {
    PARSESTRUCT(xml_linenumber)++;
    if (PARSESTRUCT(had_err))
    {
      had_err = -1;
    }

    if ((XML_Parse(parser, gt_str_get(buf), gt_str_length(buf), false) ==
         XML_STATUS_ERROR) && !had_err)
    {
      error = XML_GetErrorCode(parser);
      gt_error_set(err,
                "an error occurred parsing line "GT_WU" of file \"%s\": %s",
                PARSESTRUCT(xml_linenumber), gt_str_get(PARSESTRUCT(xmlfile)),
                XML_ErrorString(error));

      had_err = -1;
    }
    /* reset line buffer */
    gt_str_reset(buf);
  }

  /* finish parsing */
  if ((XML_Parse(parser, NULL, 0, true) == XML_STATUS_ERROR) && !had_err)
  {
    error = XML_GetErrorCode(parser);
    gt_error_set(err,
              "an error occurred while finishing the parsing of file\
               \"%s\": %s",
              gt_str_get(PARSESTRUCT(xmlfile)), XML_ErrorString(error));

    had_err = -1;
  }

  if (PARSESTRUCT(xml_tag_flag) && !(!had_err) && PARSESTRUCT(giexp_flag))
  {
    gt_str_array_delete(MATRIXSTRUCT(hit_gi_nr));
    gt_str_array_delete(MATRIXSTRUCT(hit_num));
    gt_str_array_delete(MATRIXSTRUCT(hit_dna));
    gt_str_array_delete(MATRIXSTRUCT(hit_gi_def));
    gt_str_array_delete(MATRIXSTRUCT(hit_acc));
    gt_str_array_delete(MATRIXSTRUCT(fasta_row));
    gt_str_array_delete(MATRIXSTRUCT(hit_from));
    gt_str_array_delete(MATRIXSTRUCT(hit_to));
    gt_str_array_delete(MATRIXSTRUCT(hsp_qseq));
    gt_str_array_delete(MATRIXSTRUCT(hsp_hseq));
    gt_str_array_delete(PARSESTRUCT(query_frame_tmp));
    gt_str_array_delete(PARSESTRUCT(hit_frame_tmp));
  }

  /* Freigeben des XML-Parser und loeschen des Puffer-Strings */
  XML_ParserFree(parser);
  gt_str_delete(buf);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %rbp
movq %rdi, %rbx
testq %rdx, %rdx
je 0x21ffe0
movq %r14, %rdi
callq 0x101a9a
testb %al, %al
jne 0x22022c
movq %r14, 0x10(%rsp)
callq 0x1208f8
movq %rax, %r14
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x253188
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x25481c
leaq 0x225(%rip), %rsi       # 0x220231
leaq 0x301(%rip), %rdx       # 0x220314
movq %r15, %rdi
callq 0x254885
leaq 0xf3d(%rip), %rsi       # 0x220f5f
movq %r15, 0x8(%rsp)
movq %r15, %rdi
callq 0x254898
movq %r14, %rdi
movq %rbp, %rsi
callq 0x121005
cmpl $-0x1, %eax
je 0x2200fc
xorl %r12d, %r12d
incq 0xe0(%rbx)
xorl %eax, %eax
cmpl 0xd0(%rbx), %eax
movl $0x0, %eax
sbbl %eax, %eax
orl %eax, %r12d
movq %r14, %rdi
callq 0x120d23
movq %rax, %r13
movq %r14, %rdi
callq 0x120d4c
movq 0x8(%rsp), %rdi
movq %r13, %rsi
movl %eax, %edx
xorl %ecx, %ecx
callq 0x2549a7
orl %r12d, %eax
jne 0x2200d2
movq 0x8(%rsp), %rdi
callq 0x254f79
movl %eax, %r12d
movq 0x48(%rbx), %rdi
movq 0xe0(%rbx), %r13
callq 0x120d23
movq %rax, %r15
movl %r12d, %edi
callq 0x25517b
movq 0x10(%rsp), %rdi
leaq 0x1ad120(%rip), %rsi    # 0x3cd1dc
movq %r13, %rdx
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %r14, %rdi
callq 0x120db4
movq %r14, %rdi
movq %rbp, %rsi
callq 0x121005
testl %r12d, %r12d
setne %r15b
cmpl $-0x1, %eax
je 0x2200ff
testl %r12d, %r12d
je 0x220046
jmp 0x2200ff
xorl %r15d, %r15d
movq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x2549a7
testl %eax, %eax
jne 0x220159
testb %r15b, %r15b
jne 0x220159
movq 0x8(%rsp), %rdi
callq 0x254f79
movl %eax, %ebp
movq 0x48(%rbx), %rdi
callq 0x120d23
movq %rax, %r15
movl %ebp, %edi
callq 0x25517b
leaq 0x1ad0cf(%rip), %rsi    # 0x3cd210
movq 0x10(%rsp), %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1019cf
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpw $0x0, 0xda(%rbx)
je 0x220208
testl %r12d, %r12d
je 0x220208
cmpw $0x0, 0xdc(%rbx)
je 0x220208
movq 0x130(%rbx), %rdi
callq 0x121e8b
movq 0x138(%rbx), %rdi
callq 0x121e8b
movq 0x168(%rbx), %rdi
callq 0x121e8b
movq 0x140(%rbx), %rdi
callq 0x121e8b
movq 0x148(%rbx), %rdi
callq 0x121e8b
movq 0x150(%rbx), %rdi
callq 0x121e8b
movq 0x158(%rbx), %rdi
callq 0x121e8b
movq 0x160(%rbx), %rdi
callq 0x121e8b
movq 0x170(%rbx), %rdi
callq 0x121e8b
movq 0x178(%rbx), %rdi
callq 0x121e8b
movq 0x18(%rbx), %rdi
callq 0x121e8b
movq 0x20(%rbx), %rdi
callq 0x121e8b
movq 0x8(%rsp), %rdi
callq 0x253721
movq %r14, %rdi
callq 0x121b03
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x84710