// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: addBinding
static enum XML_Error
addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
           const XML_Char *uri, BINDING **bindingsPtr)
{
  static const XML_Char xmlNamespace[] = {
    ASCII_h, ASCII_t, ASCII_t, ASCII_p, ASCII_COLON, ASCII_SLASH, ASCII_SLASH,
    ASCII_w, ASCII_w, ASCII_w, ASCII_PERIOD, ASCII_w, ASCII_3, ASCII_PERIOD,
    ASCII_o, ASCII_r, ASCII_g, ASCII_SLASH, ASCII_X, ASCII_M, ASCII_L, 
    ASCII_SLASH, ASCII_1, ASCII_9, ASCII_9, ASCII_8, ASCII_SLASH,
    ASCII_n, ASCII_a, ASCII_m, ASCII_e, ASCII_s, ASCII_p, ASCII_a, ASCII_c,
    ASCII_e, '\0'
  };
  static const int xmlLen = 
    (int)sizeof(xmlNamespace)/sizeof(XML_Char) - 1;
  static const XML_Char xmlnsNamespace[] = {
    ASCII_h, ASCII_t, ASCII_t, ASCII_p, ASCII_COLON, ASCII_SLASH, ASCII_SLASH,
    ASCII_w, ASCII_w, ASCII_w, ASCII_PERIOD, ASCII_w, ASCII_3, ASCII_PERIOD,
    ASCII_o, ASCII_r, ASCII_g, ASCII_SLASH, ASCII_2, ASCII_0, ASCII_0, 
    ASCII_0, ASCII_SLASH, ASCII_x, ASCII_m, ASCII_l, ASCII_n, ASCII_s, 
    ASCII_SLASH, '\0'
  };
  static const int xmlnsLen = 
    (int)sizeof(xmlnsNamespace)/sizeof(XML_Char) - 1;

  XML_Bool mustBeXML = XML_FALSE;
  XML_Bool isXML = XML_TRUE;
  XML_Bool isXMLNS = XML_TRUE;
  
  BINDING *b;
  int len;

  /* empty URI is only valid for default namespace per XML NS 1.0 (not 1.1) */
  if (*uri == XML_T('\0') && prefix->name)
    return XML_ERROR_UNDECLARING_PREFIX;

  if (prefix->name
      && prefix->name[0] == XML_T(ASCII_x)
      && prefix->name[1] == XML_T(ASCII_m)
      && prefix->name[2] == XML_T(ASCII_l)) {

    /* Not allowed to bind xmlns */
    if (prefix->name[3] == XML_T(ASCII_n)
        && prefix->name[4] == XML_T(ASCII_s)
        && prefix->name[5] == XML_T('\0'))
      return XML_ERROR_RESERVED_PREFIX_XMLNS;

    if (prefix->name[3] == XML_T('\0'))
      mustBeXML = XML_TRUE;
  }

  for (len = 0; uri[len]; len++) {
    if (isXML && (len > xmlLen || uri[len] != xmlNamespace[len]))
      isXML = XML_FALSE;

    if (!mustBeXML && isXMLNS 
        && (len > xmlnsLen || uri[len] != xmlnsNamespace[len]))
      isXMLNS = XML_FALSE;
  }
  isXML = isXML && len == xmlLen;
  isXMLNS = isXMLNS && len == xmlnsLen;

  if (mustBeXML != isXML)
    return mustBeXML ? XML_ERROR_RESERVED_PREFIX_XML
                     : XML_ERROR_RESERVED_NAMESPACE_URI;

  if (isXMLNS)
    return XML_ERROR_RESERVED_NAMESPACE_URI;

  if (namespaceSeparator)
    len++;
  if (freeBindingList) {
    b = freeBindingList;
    if (len > b->uriAlloc) {
      XML_Char *temp = (XML_Char *)REALLOC(b->uri,
                          sizeof(XML_Char) * (len + EXPAND_SPARE));
      if (temp == NULL)
        return XML_ERROR_NO_MEMORY;
      b->uri = temp;
      b->uriAlloc = len + EXPAND_SPARE;
    }
    freeBindingList = b->nextTagBinding;
  }
  else {
    b = (BINDING *)MALLOC(sizeof(BINDING));
    if (!b)
      return XML_ERROR_NO_MEMORY;
    b->uri = (XML_Char *)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE));
    if (!b->uri) {
      FREE(b);
      return XML_ERROR_NO_MEMORY;
    }
    b->uriAlloc = len + EXPAND_SPARE;
  }
  b->uriLen = len;
  memcpy(b->uri, uri, len * sizeof(XML_Char));
  if (namespaceSeparator)
    b->uri[len - 1] = namespaceSeparator;
  b->prefix = prefix;
  b->attId = attId;
  b->prevPrefixBinding = prefix->binding;
  /* NULL binding when default namespace undeclared */
  if (*uri == XML_T('\0') && prefix == &_dtd->defaultPrefix)
    prefix->binding = NULL;
  else
    prefix->binding = b;
  b->nextTagBinding = *bindingsPtr;
  *bindingsPtr = b;
  /* if attId == NULL then we are not starting a namespace scope */
  if (attId && startNamespaceDeclHandler)
    startNamespaceDeclHandler(handlerArg, prefix->name,
                              prefix->binding ? uri : 0);
  return XML_ERROR_NONE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movb (%rcx), %r12b
movq (%rsi), %rcx
testb %r12b, %r12b
je 0x2524a9
movb $0x1, %al
movl $0x28, %ebp
testq %rcx, %rcx
je 0x2523d2
cmpb $0x78, (%rcx)
jne 0x2523d2
cmpb $0x6d, 0x1(%rcx)
jne 0x2523d2
cmpb $0x6c, 0x2(%rcx)
jne 0x2523d2
movzbl 0x3(%rcx), %esi
testl %esi, %esi
je 0x2525e1
cmpl $0x6e, %esi
jne 0x2523d2
cmpb $0x73, 0x4(%rcx)
jne 0x2523d2
cmpb $0x0, 0x5(%rcx)
je 0x2525ef
xorl %ecx, %ecx
movb $0x1, %dil
xorl %esi, %esi
leaq 0x179230(%rip), %r13    # 0x3cb610
leaq 0x1791f9(%rip), %r9     # 0x3cb5e0
movb $0x1, %r10b
testb %r10b, %r10b
je 0x2523fb
cmpq $0x24, %rsi
ja 0x2523fb
cmpb (%rsi,%r9), %r12b
je 0x2523fe
xorl %r10d, %r10d
testb %al, %al
setne %r11b
andb %dil, %r11b
cmpb $0x1, %r11b
jne 0x25241b
cmpq $0x1d, %rsi
ja 0x252419
cmpb (%rsi,%r13), %r12b
je 0x25241b
xorl %eax, %eax
movb 0x1(%rbx,%rsi), %r12b
incq %rsi
testb %r12b, %r12b
jne 0x2523ea
testb %r10b, %r10b
setne %r9b
testb %al, %al
setne %al
cmpl $0x24, %esi
sete %dil
andb %r9b, %dil
cmpb %dil, %cl
jne 0x2524b3
cmpl $0x1d, %esi
sete %cl
movl $0x28, %ebp
testb %cl, %al
jne 0x2524b3
movq %r8, (%rsp)
movq %rdx, 0x10(%rsp)
movl %esi, %r13d
cmpb $0x1, 0x36c(%r14)
sbbq $-0x1, %r13
movq 0x2b8(%r14), %r12
testq %r12, %r12
je 0x2524d7
cmpl 0x2c(%r12), %r13d
jle 0x252517
movq 0x20(%r12), %rdi
leal 0x18(%r13), %ebp
movq %rbp, %rsi
callq *0x20(%r14)
testq %rax, %rax
je 0x2525c7
movq %rax, %rdi
movq %rax, 0x20(%r12)
movl %ebp, 0x2c(%r12)
jmp 0x25251c
movl $0x1c, %ebp
testq %rcx, %rcx
je 0x2524c4
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ecx, %ecx
movb $0x1, %r9b
movl $0x28, %ebp
movb $0x1, %al
xorl %esi, %esi
jmp 0x252434
movl $0x30, %edi
callq *0x18(%r14)
movl $0x1, %ebp
testq %rax, %rax
je 0x2524b3
movq %rax, %r12
leal 0x18(%r13), %edi
movq %rdi, 0x8(%rsp)
callq *0x18(%r14)
movq %rax, 0x20(%r12)
testq %rax, %rax
je 0x2525d5
movq %rax, %rdi
movq 0x8(%rsp), %rax
movl %eax, 0x2c(%r12)
jmp 0x252528
movq 0x20(%r12), %rdi
movq 0x8(%r12), %rax
movq %rax, 0x2b8(%r14)
movl %r13d, 0x28(%r12)
movq %rbx, %rsi
movq %r13, %rdx
callq 0x17660
movb 0x36c(%r14), %al
testb %al, %al
je 0x25254d
movq 0x20(%r12), %rcx
movb %al, -0x1(%rcx,%r13)
movq %r15, (%r12)
movq 0x10(%rsp), %rcx
movq %rcx, 0x18(%r12)
movq 0x8(%r15), %rax
movq %rax, 0x10(%r12)
cmpb $0x0, (%rbx)
jne 0x25257a
movl $0x108, %eax            # imm = 0x108
addq 0x290(%r14), %rax
cmpq %r15, %rax
je 0x2525d1
movq %r12, %rax
movq (%rsp), %rdx
movq %rax, 0x8(%r15)
movq (%rdx), %rax
movq %rax, 0x8(%r12)
movq %r12, (%rdx)
xorl %ebp, %ebp
testq %rcx, %rcx
je 0x2524b3
movq 0xc8(%r14), %rax
testq %rax, %rax
je 0x2524b3
movq 0x8(%r14), %rdi
movq (%r15), %rsi
movq 0x8(%r15), %rcx
testq %rcx, %rcx
cmoveq %rcx, %rbx
movq %rbx, %rdx
callq *%rax
jmp 0x2524b3
movl $0x1, %ebp
jmp 0x2524b3
xorl %eax, %eax
jmp 0x25257d
movq %r12, %rdi
callq *0x28(%r14)
jmp 0x2524b3
movb $0x1, %cl
movl $0x26, %ebp
xorl %edi, %edi
jmp 0x2523d7
movl $0x27, %ebp
jmp 0x2524b3