// File: /workspace/github_c_makefile_star2_O2/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 0x1cb1ee
movq %r14, %rdi
callq 0x89eb7
testb %al, %al
jne 0x1cb409
movq %r14, 0x8(%rsp)
callq 0xacb84
movq %rax, %r14
xorl %edi, %edi
callq 0x1fb498
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1fc817
leaq 0x22a(%rip), %rsi       # 0x1cb441
leaq 0x2de(%rip), %rdx       # 0x1cb4fc
movq %r15, %rdi
callq 0x1fc87d
leaq 0xf17(%rip), %rsi       # 0x1cc144
movq %r15, %rdi
callq 0x1fc890
xorl %ebp, %ebp
movq %r14, %rdi
movq 0x10(%rsp), %rsi
callq 0xad63c
cmpl $-0x1, %eax
je 0x1cb2ee
testl %ebp, %ebp
jne 0x1cb2ee
incq 0xe0(%rbx)
xorl %ebp, %ebp
cmpl $0x0, 0xd0(%rbx)
setne %r13b
movq %r14, %rdi
callq 0xad1fa
movq %rax, %r12
movq %r14, %rdi
callq 0xad289
movq %r15, %rdi
movq %r12, %rsi
movl %eax, %edx
xorl %ecx, %ecx
callq 0x1fc99f
testl %eax, %eax
setne %al
orb %r13b, %al
testb $0x1, %al
je 0x1cb29e
movb %r13b, %bpl
negl %ebp
jmp 0x1cb2e1
movq %r15, %rdi
callq 0x1fcf59
movl %eax, %ebp
movq 0x48(%rbx), %rdi
movq 0xe0(%rbx), %r12
callq 0xad1fa
movq %rax, %r13
movl %ebp, %edi
callq 0x1fd155
movq 0x8(%rsp), %rdi
leaq 0x198bf6(%rip), %rsi    # 0x363ec4
movq %r12, %rdx
movq %r13, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
movq %r14, %rdi
callq 0xad357
jmp 0x1cb237
pushq $0x1
popq %rcx
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1fc99f
orl %ebp, %eax
jne 0x1cb33a
movq %r15, %rdi
callq 0x1fcf59
movl %eax, %ebp
movq 0x48(%rbx), %rdi
callq 0xad1fa
movq %rax, %r12
movl %ebp, %edi
callq 0x1fd155
leaq 0x198bd3(%rip), %rsi    # 0x363ef8
movq 0x8(%rsp), %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
cmpw $0x0, 0xda(%rbx)
je 0x1cb3e8
testl %ebp, %ebp
je 0x1cb3e8
cmpw $0x0, 0xdc(%rbx)
je 0x1cb3e8
movq 0x130(%rbx), %rdi
callq 0xae662
movq 0x138(%rbx), %rdi
callq 0xae662
movq 0x168(%rbx), %rdi
callq 0xae662
movq 0x140(%rbx), %rdi
callq 0xae662
movq 0x148(%rbx), %rdi
callq 0xae662
movq 0x150(%rbx), %rdi
callq 0xae662
movq 0x158(%rbx), %rdi
callq 0xae662
movq 0x160(%rbx), %rdi
callq 0xae662
movq 0x170(%rbx), %rdi
callq 0xae662
movq 0x178(%rbx), %rdi
callq 0xae662
movq 0x18(%rbx), %rdi
callq 0xae662
movq 0x20(%rbx), %rdi
callq 0xae662
movq %r15, %rdi
callq 0x1fba21
movq %r14, %rdi
callq 0xae103
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x26cb58(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x119bf9(%rip), %rsi    # 0x2e5013
leaq 0x119d9e(%rip), %rdx    # 0x2e51bf
leaq 0x198a77(%rip), %rcx    # 0x363e9f
leaq 0x198a7d(%rip), %r8     # 0x363eac
movl $0x121, %r9d            # imm = 0x121
xorl %eax, %eax
callq 0x17a50
callq 0x17390