// File: /workspace/github_c_makefile_star2_O1/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
cmpb $0x0, (%rcx)
je 0x25aa3a
movq (%r15), %rcx
movb $0x1, %r10b
movl $0x28, %ebp
xorl %eax, %eax
testq %rcx, %rcx
je 0x25aa4b
cmpb $0x78, (%rcx)
jne 0x25aa33
cmpb $0x6d, 0x1(%rcx)
jne 0x25aa33
cmpb $0x6c, 0x2(%rcx)
jne 0x25aa33
movzbl 0x3(%rcx), %esi
testl %esi, %esi
je 0x25ac19
cmpl $0x6e, %esi
jne 0x25aa33
cmpb $0x73, 0x4(%rcx)
jne 0x25aa2a
cmpb $0x0, 0x5(%rcx)
je 0x25ac4a
testb %sil, %sil
je 0x25ac19
xorl %ecx, %ecx
movb $0x1, %sil
jmp 0x25aa50
movl $0x1c, %ebp
cmpq $0x0, (%r15)
jne 0x25ac39
jmp 0x25a9e6
movb $0x1, %sil
xorl %ecx, %ecx
movb (%rbx), %r9b
movb $0x1, %dil
testb %r9b, %r9b
je 0x25aabe
movb $0x1, %dil
xorl %eax, %eax
leaq 0x17a2c9(%rip), %r12    # 0x3d4d30
leaq 0x17a292(%rip), %r13    # 0x3d4d00
movb $0x1, %r10b
testb %r10b, %r10b
je 0x25aa85
cmpq $0x24, %rax
ja 0x25aa82
cmpb (%rax,%r13), %r9b
je 0x25aa85
xorl %r10d, %r10d
testb %dil, %dil
setne %r11b
andb %sil, %r11b
cmpb $0x1, %r11b
jne 0x25aaa3
cmpq $0x1d, %rax
ja 0x25aaa1
cmpb (%rax,%r12), %r9b
je 0x25aaa3
xorl %edi, %edi
movb 0x1(%rbx,%rax), %r9b
incq %rax
testb %r9b, %r9b
jne 0x25aa71
testb %r10b, %r10b
setne %r10b
testb %dil, %dil
setne %dil
cmpl $0x24, %eax
sete %sil
andb %r10b, %sil
cmpb %sil, %cl
jne 0x25ac39
cmpl $0x1d, %eax
sete %cl
movl $0x28, %ebp
testb %cl, %dil
jne 0x25ac39
movq %r8, (%rsp)
movq %rdx, 0x10(%rsp)
movl %eax, %r13d
cmpb $0x1, 0x36c(%r14)
sbbq $-0x1, %r13
movq 0x2b8(%r14), %r12
testq %r12, %r12
je 0x25ab41
cmpl 0x2c(%r12), %r13d
jle 0x25ab33
movq 0x20(%r12), %rdi
leal 0x18(%r13), %ebp
movq %rbp, %rsi
callq *0x20(%r14)
testq %rax, %rax
je 0x25ac27
movq %rax, 0x20(%r12)
movl %ebp, 0x2c(%r12)
movq 0x8(%r12), %rax
movq %rax, 0x2b8(%r14)
jmp 0x25ab80
movl $0x30, %edi
callq *0x18(%r14)
movl $0x1, %ebp
testq %rax, %rax
je 0x25ac39
movq %rax, %r12
leal 0x18(%r13), %edi
movq %rdi, 0x8(%rsp)
callq *0x18(%r14)
movq %rax, 0x20(%r12)
testq %rax, %rax
je 0x25ac32
movq 0x8(%rsp), %rax
movl %eax, 0x2c(%r12)
movl %r13d, 0x28(%r12)
movq 0x20(%r12), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x17660
movb 0x36c(%r14), %al
testb %al, %al
je 0x25abaa
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 0x25abd7
movl $0x108, %eax            # imm = 0x108
addq 0x290(%r14), %rax
cmpq %r15, %rax
je 0x25ac2e
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 0x25ac39
movq 0xc8(%r14), %rax
testq %rax, %rax
je 0x25ac39
movq 0x8(%r14), %rdi
movq (%r15), %rsi
movq 0x8(%r15), %rcx
testq %rcx, %rcx
cmoveq %rcx, %rbx
movq %rbx, %rdx
callq *%rax
jmp 0x25ac39
movb $0x1, %cl
movl $0x26, %ebp
xorl %esi, %esi
jmp 0x25aa50
movl $0x1, %ebp
jmp 0x25ac39
xorl %eax, %eax
jmp 0x25abda
movq %r12, %rdi
callq *0x28(%r14)
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x27, %ebp
jmp 0x25ac39