// File: /workspace/github_c_makefile_star2_O2/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 $0x28, %rsp
movq %rcx, %rbx
movq %rdi, %r11
movb (%rcx), %al
movq (%rsi), %r9
pushq $0x28
popq %rbp
testb %al, %al
je 0x201a1a
movb $0x1, %cl
testq %r9, %r9
je 0x201a28
cmpb $0x78, (%r9)
jne 0x201a28
cmpb $0x6d, 0x1(%r9)
jne 0x201a28
cmpb $0x6c, 0x2(%r9)
jne 0x201a28
movzbl 0x3(%r9), %edi
testl %edi, %edi
je 0x201c58
cmpl $0x6e, %edi
jne 0x201a28
cmpb $0x73, 0x4(%r9)
jne 0x201a28
cmpb $0x0, 0x5(%r9)
jne 0x201a28
pushq $0x27
jmp 0x201aab
testq %r9, %r9
je 0x201a26
pushq $0x1c
jmp 0x201aab
movb $0x1, %cl
xorl %r15d, %r15d
movb $0x1, %dil
xorl %r13d, %r13d
leaq 0x169fe8(%rip), %r12    # 0x36ba20
leaq 0x169fb1(%rip), %r9     # 0x36b9f0
movb $0x1, %r14b
testb %al, %al
je 0x201a84
testb %dil, %dil
je 0x201a58
cmpq $0x24, %r13
ja 0x201a58
cmpb (%r13,%r9), %al
je 0x201a5a
xorl %edi, %edi
testb %r14b, %r14b
setne %r10b
andb %cl, %r10b
cmpb $0x1, %r10b
jne 0x201a7a
cmpq $0x1d, %r13
ja 0x201a77
cmpb (%r13,%r12), %al
je 0x201a7a
xorl %r14d, %r14d
movb 0x1(%rbx,%r13), %al
incq %r13
jmp 0x201a42
testb %dil, %dil
setne %al
cmpq $0x24, %r13
sete %cl
andb %al, %cl
cmpb %cl, %r15b
jne 0x201aac
testb %r14b, %r14b
setne %al
cmpq $0x1d, %r13
sete %cl
testb %cl, %al
je 0x201abd
pushq $0x28
popq %rbp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r8, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, 0x20(%rsp)
movb 0x36c(%r11), %r15b
cmpb $0x1, %r15b
movq %r13, %r14
sbbq $-0x1, %r14
movq 0x2b8(%r11), %r12
testq %r12, %r12
je 0x201b2b
cmpl 0x2c(%r12), %r14d
jle 0x201b7f
movq 0x20(%r12), %rdi
cmpb $0x1, %r15b
sbbq $-0x1, %r13
addq $0x18, %r13
movl %r13d, %esi
movq %r11, %r15
callq *0x20(%r11)
testq %rax, %rax
je 0x201c3d
movq %rax, %rdi
movq %rax, 0x20(%r12)
movl %r13d, 0x2c(%r12)
movq %r15, %r11
jmp 0x201b84
pushq $0x30
popq %rdi
movq %r11, 0x8(%rsp)
callq *0x18(%r11)
pushq $0x1
popq %rbp
testq %rax, %rax
je 0x201aac
movq %rax, %r12
cmpb $0x1, %r15b
sbbq $-0x1, %r13
addq $0x18, %r13
movl %r13d, %edi
movq 0x8(%rsp), %rax
callq *0x18(%rax)
movq %rax, 0x20(%r12)
testq %rax, %rax
je 0x201c48
movq %rax, %rdi
movl %r13d, 0x2c(%r12)
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r13
jmp 0x201b98
movq 0x20(%r12), %rdi
movq 0x8(%r12), %rax
movq %rax, 0x2b8(%r11)
movq %r11, %r13
movq 0x10(%rsp), %r15
movl %r14d, 0x28(%r12)
movl %r14d, %ebp
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x17630
movb 0x36c(%r13), %al
testb %al, %al
movq %r13, %rdx
je 0x201bc2
movq 0x20(%r12), %rcx
movb %al, -0x1(%rcx,%rbp)
movq 0x20(%rsp), %rcx
movq %rcx, (%r12)
movq %r15, 0x18(%r12)
movq 0x8(%rcx), %rax
movq %rax, 0x10(%r12)
cmpb $0x0, (%rbx)
jne 0x201bef
movl $0x108, %eax            # imm = 0x108
addq 0x290(%rdx), %rax
cmpq %rcx, %rax
je 0x201c44
movq %r12, %rax
movq %rax, 0x8(%rcx)
movq 0x18(%rsp), %rsi
movq (%rsi), %rax
movq %rax, 0x8(%r12)
movq %r12, (%rsi)
xorl %ebp, %ebp
testq %r15, %r15
je 0x201aac
movq 0xc8(%rdx), %rax
testq %rax, %rax
je 0x201aac
movq 0x8(%rdx), %rdi
movq (%rcx), %rsi
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
cmoveq %rcx, %rbx
movq %rbx, %rdx
callq *%rax
jmp 0x201aac
pushq $0x1
jmp 0x201aab
xorl %eax, %eax
jmp 0x201bf2
movq %r12, %rdi
movq 0x8(%rsp), %rax
callq *0x28(%rax)
jmp 0x201aac
movb $0x1, %r15b
pushq $0x26
popq %rbp
xorl %ecx, %ecx
jmp 0x201a2b