// File: /workspace/github_c_makefile_star2_O3/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, 0x10(%rsp)
movq %rdi, %rbx
testq %rdx, %rdx
je 0x2162a2
movq %r14, %rdi
callq 0xfcc32
testb %al, %al
jne 0x2164eb
movq %r14, 0x8(%rsp)
callq 0x11ac6c
movq %rax, %r14
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x24b800
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x24cd5e
leaq 0x222(%rip), %rsi       # 0x2164f0
leaq 0x2fe(%rip), %rdx       # 0x2165d3
movq %r15, %rdi
callq 0x24cdc6
leaq 0xf3a(%rip), %rsi       # 0x21721e
movq %r15, %rdi
callq 0x24cdd9
movq %r14, %rdi
movq 0x10(%rsp), %rsi
callq 0x11b32c
cmpl $-0x1, %eax
je 0x2163c1
incq 0xe0(%rbx)
xorl %r12d, %r12d
cmpl $0x0, 0xd0(%rbx)
setne %bpl
movq %r14, %rdi
callq 0x11b0a1
movq %rax, %r13
movq %r14, %rdi
callq 0x11b0ca
movq %r15, %rdi
movq %r13, %rsi
movl %eax, %edx
xorl %ecx, %ecx
callq 0x24cee8
testl %eax, %eax
setne %al
orb %bpl, %al
testb $0x1, %al
je 0x21634d
movb %bpl, %r12b
negl %r12d
jmp 0x216395
movq %r15, %rdi
callq 0x24d4b8
movl %eax, %r12d
movq 0x48(%rbx), %rdi
movq 0xe0(%rbx), %r13
callq 0x11b0a1
movq %rax, %rbp
movl %r12d, %edi
callq 0x24d6b8
movq 0x8(%rsp), %rdi
leaq 0x1ad735(%rip), %rsi    # 0x3c3ab4
movq %r13, %rdx
movq %rbp, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %r14, %rdi
callq 0x11b132
movq %r14, %rdi
movq 0x10(%rsp), %rsi
callq 0x11b32c
testl %r12d, %r12d
setne %r13b
cmpl $-0x1, %eax
je 0x2163c4
testl %r12d, %r12d
je 0x216302
jmp 0x2163c4
xorl %r13d, %r13d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x24cee8
testl %eax, %eax
jne 0x21641a
testb %r13b, %r13b
jne 0x21641a
movq %r15, %rdi
callq 0x24d4b8
movl %eax, %ebp
movq 0x48(%rbx), %rdi
callq 0x11b0a1
movq %rax, %r12
movl %ebp, %edi
callq 0x24d6b8
leaq 0x1ad6e6(%rip), %rsi    # 0x3c3ae8
movq 0x8(%rsp), %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpw $0x0, 0xda(%rbx)
je 0x2164c9
testl %r12d, %r12d
je 0x2164c9
cmpw $0x0, 0xdc(%rbx)
je 0x2164c9
movq 0x130(%rbx), %rdi
callq 0x11c144
movq 0x138(%rbx), %rdi
callq 0x11c144
movq 0x168(%rbx), %rdi
callq 0x11c144
movq 0x140(%rbx), %rdi
callq 0x11c144
movq 0x148(%rbx), %rdi
callq 0x11c144
movq 0x150(%rbx), %rdi
callq 0x11c144
movq 0x158(%rbx), %rdi
callq 0x11c144
movq 0x160(%rbx), %rdi
callq 0x11c144
movq 0x170(%rbx), %rdi
callq 0x11c144
movq 0x178(%rbx), %rdi
callq 0x11c144
movq 0x18(%rbx), %rdi
callq 0x11c144
movq 0x20(%rbx), %rdi
callq 0x11c144
movq %r15, %rdi
callq 0x24bd74
movq %r14, %rdi
callq 0x11bdbf
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x82623