// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: setContext
static XML_Bool
setContext(XML_Parser parser, const XML_Char *context)
{
  DTD * const dtd = _dtd;  /* save one level of indirection */
  const XML_Char *s = context;

  while (*context != XML_T('\0')) {
    if (*s == CONTEXT_SEP || *s == XML_T('\0')) {
      ENTITY *e;
      if (!poolAppendChar(&tempPool, XML_T('\0')))
        return XML_FALSE;
      e = (ENTITY *)lookup(&dtd->generalEntities, poolStart(&tempPool), 0);
      if (e)
        e->open = XML_TRUE;
      if (*s != XML_T('\0'))
        s++;
      context = s;
      poolDiscard(&tempPool);
    }
    else if (*s == XML_T(ASCII_EQUALS)) {
      PREFIX *prefix;
      if (poolLength(&tempPool) == 0)
        prefix = &dtd->defaultPrefix;
      else {
        if (!poolAppendChar(&tempPool, XML_T('\0')))
          return XML_FALSE;
        prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&tempPool),
                                  sizeof(PREFIX));
        if (!prefix)
          return XML_FALSE;
        if (prefix->name == poolStart(&tempPool)) {
          prefix->name = poolCopyString(&dtd->pool, prefix->name);
          if (!prefix->name)
            return XML_FALSE;
        }
        poolDiscard(&tempPool);
      }
      for (context = s + 1;
           *context != CONTEXT_SEP && *context != XML_T('\0');
           context++)
        if (!poolAppendChar(&tempPool, *context))
          return XML_FALSE;
      if (!poolAppendChar(&tempPool, XML_T('\0')))
        return XML_FALSE;
      if (addBinding(parser, prefix, NULL, poolStart(&tempPool),
                     &inheritedBindings) != XML_ERROR_NONE)
        return XML_FALSE;
      poolDiscard(&tempPool);
      if (*context != XML_T('\0'))
        ++context;
      s = context;
    }
    else {
      if (!poolAppendChar(&tempPool, *s))
        return XML_FALSE;
      s++;
    }
  }
  return XML_TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r13
movq %rdi, %rbx
movq 0x290(%rdi), %r14
leaq 0x300(%rdi), %r15
leaq 0x78(%r14), %rax
movq %rax, 0x10(%rsp)
leaq 0xa0(%r14), %rax
movq %rax, 0x8(%rsp)
leaq 0x108(%r14), %rax
movq %rax, 0x20(%rsp)
leaq 0x2b0(%rdi), %rax
movq %rax, 0x18(%rsp)
leaq 0x1(%r13), %rbp
movq %r13, %r12
cmpb $0x0, (%r13)
je 0x1fba07
movzbl (%r12), %eax
testl %eax, %eax
je 0x1fb845
cmpl $0x3d, %eax
je 0x1fb8b3
cmpl $0xc, %eax
je 0x1fb845
movq 0x318(%rbx), %rcx
cmpq 0x310(%rbx), %rcx
jne 0x1fb830
movq %r15, %rdi
callq 0x1ff0dd
testb %al, %al
je 0x1fba0c
movb (%r12), %al
movq 0x318(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x318(%rbx)
movb %al, (%rcx)
incq %r12
incq %rbp
jmp 0x1fb7e3
movq 0x318(%rbx), %rax
cmpq 0x310(%rbx), %rax
jne 0x1fb86c
movq %r15, %rdi
callq 0x1ff0dd
testb %al, %al
je 0x1fba0c
movq 0x318(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x318(%rbx)
movb $0x0, (%rax)
movq 0x320(%rbx), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x1ff2cb
testq %rax, %rax
je 0x1fb894
movb $0x1, 0x38(%rax)
cmpb $0x1, (%r12)
sbbq $-0x1, %r12
movq 0x320(%rbx), %rax
movq %rax, 0x318(%rbx)
movq %r12, %r13
jmp 0x1fb7dc
movq 0x318(%rbx), %rax
movq 0x20(%rsp), %r13
cmpq 0x320(%rbx), %rax
je 0x1fb94e
cmpq 0x310(%rbx), %rax
jne 0x1fb8ec
movq %r15, %rdi
callq 0x1ff0dd
testb %al, %al
je 0x1fba0c
movq 0x318(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x318(%rbx)
movb $0x0, (%rax)
movq 0x320(%rbx), %rsi
movq 0x10(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x1ff2cb
testq %rax, %rax
je 0x1fba0c
movq %rax, %r13
movq (%rax), %rsi
movq 0x320(%rbx), %rax
cmpq %rax, %rsi
jne 0x1fb947
movq 0x8(%rsp), %rdi
callq 0x1fbfb6
movq %rax, (%r13)
testq %rax, %rax
je 0x1fba0c
movq 0x320(%rbx), %rax
movq %rax, 0x318(%rbx)
movzbl (%rbp), %eax
testl %eax, %eax
je 0x1fb997
cmpl $0xc, %eax
je 0x1fb997
movq 0x318(%rbx), %rcx
cmpq 0x310(%rbx), %rcx
jne 0x1fb985
movq %r15, %rdi
callq 0x1ff0dd
testb %al, %al
je 0x1fba0c
movb (%rbp), %al
movq 0x318(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x318(%rbx)
movb %al, (%rcx)
incq %rbp
jmp 0x1fb94e
movq 0x318(%rbx), %rax
cmpq 0x310(%rbx), %rax
jne 0x1fb9ba
movq %r15, %rdi
callq 0x1ff0dd
testb %al, %al
je 0x1fba0c
movq 0x318(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x318(%rbx)
movb $0x0, (%rax)
movq 0x320(%rbx), %rcx
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r13, %rsi
xorl %edx, %edx
movq 0x18(%rsp), %r8
callq 0x2019b8
testl %eax, %eax
jne 0x1fba0f
movq 0x320(%rbx), %rax
movq %rax, 0x318(%rbx)
leaq 0x1(%rbp), %r13
cmpb $0x0, (%rbp)
cmoveq %rbp, %r13
jmp 0x1fb7dc
movb $0x1, %r12b
jmp 0x1fba0f
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq