// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: getContext
static const XML_Char *
getContext(XML_Parser parser)
{
  DTD * const dtd = _dtd;  /* save one level of indirection */
  HASH_TABLE_ITER iter;
  XML_Bool needSep = XML_FALSE;

  if (dtd->defaultPrefix.binding) {
    int i;
    int len;
    if (!poolAppendChar(&tempPool, XML_T(ASCII_EQUALS)))
      return NULL;
    len = dtd->defaultPrefix.binding->uriLen;
    if (namespaceSeparator)
      len--;
    for (i = 0; i < len; i++)
      if (!poolAppendChar(&tempPool, dtd->defaultPrefix.binding->uri[i]))
        return NULL;
    needSep = XML_TRUE;
  }

  hashTableIterInit(&iter, &(dtd->prefixes));
  for (;;) {
    int i;
    int len;
    const XML_Char *s;
    PREFIX *prefix = (PREFIX *)hashTableIterNext(&iter);
    if (!prefix)
      break;
    if (!prefix->binding)
      continue;
    if (needSep && !poolAppendChar(&tempPool, CONTEXT_SEP))
      return NULL;
    for (s = prefix->name; *s; s++)
      if (!poolAppendChar(&tempPool, *s))
        return NULL;
    if (!poolAppendChar(&tempPool, XML_T(ASCII_EQUALS)))
      return NULL;
    len = prefix->binding->uriLen;
    if (namespaceSeparator)
      len--;
    for (i = 0; i < len; i++)
      if (!poolAppendChar(&tempPool, prefix->binding->uri[i]))
        return NULL;
    needSep = XML_TRUE;
  }


  hashTableIterInit(&iter, &(dtd->generalEntities));
  for (;;) {
    const XML_Char *s;
    ENTITY *e = (ENTITY *)hashTableIterNext(&iter);
    if (!e)
      break;
    if (!e->open)
      continue;
    if (needSep && !poolAppendChar(&tempPool, CONTEXT_SEP))
      return NULL;
    for (s = e->name; *s; s++)
      if (!poolAppendChar(&tempPool, *s))
        return 0;
    needSep = XML_TRUE;
  }

  if (!poolAppendChar(&tempPool, XML_T('\0')))
    return NULL;
  return tempPool.start;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x290(%rdi), %r12
cmpq $0x0, 0x110(%r12)
sete %al
movl %eax, 0x10(%rsp)
je 0x250f7c
leaq 0x300(%rbx), %r15
movq 0x318(%rbx), %rax
cmpq 0x310(%rbx), %rax
jne 0x250f03
movq %r15, %rdi
callq 0x24f7dc
testb %al, %al
je 0x251206
movq 0x318(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x318(%rbx)
movb $0x3d, (%rax)
movq 0x110(%r12), %rax
cmpb $0x1, 0x36c(%rbx)
movl 0x28(%rax), %eax
adcl $-0x1, %eax
testl %eax, %eax
jle 0x250f7c
movl %eax, %r13d
xorl %r14d, %r14d
movq 0x318(%rbx), %rax
cmpq 0x310(%rbx), %rax
jne 0x250f57
movq %r15, %rdi
callq 0x24f7dc
testb %al, %al
je 0x251206
movq 0x318(%rbx), %rax
movq 0x110(%r12), %rcx
movq 0x20(%rcx), %rcx
movb (%rcx,%r14), %cl
leaq 0x1(%rax), %rdx
movq %rdx, 0x318(%rbx)
movb %cl, (%rax)
incq %r14
cmpq %r14, %r13
jne 0x250f30
movq 0x78(%r12), %r13
movq 0x88(%r12), %rax
leaq (,%rax,8), %rbp
addq %r13, %rbp
leaq 0x300(%rbx), %rdi
xorl %r14d, %r14d
movl 0x10(%rsp), %ecx
cmpq %rbp, %r13
je 0x25110c
movq (%r13), %r15
addq $0x8, %r13
testq %r15, %r15
je 0x250fa2
cmpq $0x0, 0x8(%r15)
je 0x250fa2
testb $0x1, %cl
movq %rdi, 0x8(%rsp)
jne 0x251000
movq 0x318(%rbx), %rax
cmpq 0x310(%rbx), %rax
jne 0x250ff2
callq 0x24f7dc
testb %al, %al
je 0x251209
movq 0x318(%rbx), %rax
movq 0x8(%rsp), %rdi
leaq 0x1(%rax), %rcx
movq %rcx, 0x318(%rbx)
movb $0xc, (%rax)
movq (%r15), %r14
movb (%r14), %al
testb %al, %al
je 0x251051
incq %r14
movq 0x318(%rbx), %rcx
cmpq 0x310(%rbx), %rcx
jne 0x25103a
callq 0x24f7dc
testb %al, %al
je 0x251206
movb -0x1(%r14), %al
movq 0x318(%rbx), %rcx
movq 0x8(%rsp), %rdi
leaq 0x1(%rcx), %rdx
movq %rdx, 0x318(%rbx)
movb %al, (%rcx)
movb (%r14), %al
incq %r14
testb %al, %al
jne 0x25100d
movq 0x318(%rbx), %rax
cmpq 0x310(%rbx), %rax
movl $0x0, %r14d
jne 0x251080
callq 0x24f7dc
testb %al, %al
je 0x251209
movq 0x318(%rbx), %rax
movq 0x8(%rsp), %rdi
leaq 0x1(%rax), %rcx
movq %rcx, 0x318(%rbx)
movb $0x3d, (%rax)
movq 0x8(%r15), %rax
movl 0x28(%rax), %eax
cmpb $0x1, 0x36c(%rbx)
adcl $-0x1, %eax
xorl %ecx, %ecx
testl %eax, %eax
jle 0x250fa2
movl %eax, %esi
xorl %r14d, %r14d
movq %rsi, 0x10(%rsp)
movq 0x318(%rbx), %rax
cmpq 0x310(%rbx), %rax
jne 0x2510e1
callq 0x24f7dc
testb %al, %al
je 0x251206
movq 0x318(%rbx), %rax
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x8(%r15), %rcx
movq 0x20(%rcx), %rcx
movb (%rcx,%r14), %cl
leaq 0x1(%rax), %rdx
movq %rdx, 0x318(%rbx)
movb %cl, (%rax)
incq %r14
xorl %ecx, %ecx
cmpq %r14, %rsi
jne 0x2510b3
xorl %r14d, %r14d
jmp 0x250fa2
movq (%r12), %r15
movq 0x10(%r12), %rax
leaq (%r15,%rax,8), %r12
xorl %r14d, %r14d
cmpq %r12, %r15
je 0x2511cf
movq (%r15), %r13
addq $0x8, %r15
testq %r13, %r13
je 0x25111c
cmpb $0x0, 0x38(%r13)
je 0x25111c
testb $0x1, %cl
jne 0x251175
movq 0x318(%rbx), %rax
cmpq 0x310(%rbx), %rax
jne 0x251167
movq %rdi, %rbp
callq 0x24f7dc
testb %al, %al
je 0x251209
movq 0x318(%rbx), %rax
movq %rbp, %rdi
leaq 0x1(%rax), %rcx
movq %rcx, 0x318(%rbx)
movb $0xc, (%rax)
movq (%r13), %r13
movb (%r13), %al
xorl %ecx, %ecx
testb %al, %al
je 0x25111c
incq %r13
movq 0x318(%rbx), %rcx
cmpq 0x310(%rbx), %rcx
jne 0x2511b0
movq %rdi, %rbp
callq 0x24f7dc
testb %al, %al
je 0x251209
movb -0x1(%r13), %al
movq 0x318(%rbx), %rcx
movq %rbp, %rdi
leaq 0x1(%rcx), %rdx
movq %rdx, 0x318(%rbx)
movb %al, (%rcx)
movb (%r13), %al
incq %r13
xorl %ecx, %ecx
testb %al, %al
jne 0x251186
jmp 0x25111c
movq 0x318(%rbx), %rax
cmpq 0x310(%rbx), %rax
jne 0x2511ef
callq 0x24f7dc
testb %al, %al
je 0x251206
movq 0x318(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x318(%rbx)
movb $0x0, (%rax)
movq 0x320(%rbx), %r14
jmp 0x251209
xorl %r14d, %r14d
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq