// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
movq %r8, 0x48(%rsp)
movb $0x0, 0x47(%rsp)
movb $0x1, 0x46(%rsp)
movb $0x1, 0x45(%rsp)
movq 0x50(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x380141
movq 0x60(%rsp), %rax
cmpq $0x0, (%rax)
je 0x380141
movl $0x1c, 0x74(%rsp)
jmp 0x3805bb
movq 0x60(%rsp), %rax
cmpq $0x0, (%rax)
je 0x3801da
movq 0x60(%rsp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x78, %eax
jne 0x3801da
movq 0x60(%rsp), %rax
movq (%rax), %rax
movsbl 0x1(%rax), %eax
cmpl $0x6d, %eax
jne 0x3801da
movq 0x60(%rsp), %rax
movq (%rax), %rax
movsbl 0x2(%rax), %eax
cmpl $0x6c, %eax
jne 0x3801da
movq 0x60(%rsp), %rax
movq (%rax), %rax
movsbl 0x3(%rax), %eax
cmpl $0x6e, %eax
jne 0x3801c2
movq 0x60(%rsp), %rax
movq (%rax), %rax
movsbl 0x4(%rax), %eax
cmpl $0x73, %eax
jne 0x3801c2
movq 0x60(%rsp), %rax
movq (%rax), %rax
movsbl 0x5(%rax), %eax
cmpl $0x0, %eax
jne 0x3801c2
movl $0x27, 0x74(%rsp)
jmp 0x3805bb
movq 0x60(%rsp), %rax
movq (%rax), %rax
movsbl 0x3(%rax), %eax
cmpl $0x0, %eax
jne 0x3801d8
movb $0x1, 0x47(%rsp)
jmp 0x3801da
movl $0x0, 0x34(%rsp)
movq 0x50(%rsp), %rax
movslq 0x34(%rsp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x38027f
movzbl 0x46(%rsp), %eax
cmpl $0x0, %eax
je 0x38022e
cmpl $0x24, 0x34(%rsp)
jg 0x380229
movq 0x50(%rsp), %rax
movslq 0x34(%rsp), %rcx
movsbl (%rax,%rcx), %eax
movslq 0x34(%rsp), %rdx
leaq 0x21e41f(%rip), %rcx    # 0x59e640
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0x38022e
movb $0x0, 0x46(%rsp)
cmpb $0x0, 0x47(%rsp)
jne 0x38026d
movzbl 0x45(%rsp), %eax
cmpl $0x0, %eax
je 0x38026d
cmpl $0x1d, 0x34(%rsp)
jg 0x380268
movq 0x50(%rsp), %rax
movslq 0x34(%rsp), %rcx
movsbl (%rax,%rcx), %eax
movslq 0x34(%rsp), %rdx
leaq 0x21e410(%rip), %rcx    # 0x59e670
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0x38026d
movb $0x0, 0x45(%rsp)
jmp 0x38026f
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x3801e2
movzbl 0x46(%rsp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x27(%rsp)
je 0x38029b
cmpl $0x24, 0x34(%rsp)
sete %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movb %al, 0x46(%rsp)
movzbl 0x45(%rsp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x26(%rsp)
je 0x3802c4
cmpl $0x1d, 0x34(%rsp)
sete %al
movb %al, 0x26(%rsp)
movb 0x26(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movb %al, 0x45(%rsp)
movzbl 0x47(%rsp), %eax
movzbl 0x46(%rsp), %ecx
cmpl %ecx, %eax
je 0x3802fd
movzbl 0x47(%rsp), %edx
movl $0x28, %eax
movl $0x26, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, 0x74(%rsp)
jmp 0x3805bb
cmpb $0x0, 0x45(%rsp)
je 0x380311
movl $0x28, 0x74(%rsp)
jmp 0x3805bb
movq 0x68(%rsp), %rax
cmpb $0x0, 0x36c(%rax)
je 0x38032a
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
movq 0x68(%rsp), %rax
cmpq $0x0, 0x2b8(%rax)
je 0x3803cf
movq 0x68(%rsp), %rax
movq 0x2b8(%rax), %rax
movq %rax, 0x38(%rsp)
movl 0x34(%rsp), %eax
movq 0x38(%rsp), %rcx
cmpl 0x2c(%rcx), %eax
jle 0x3803b5
movq 0x68(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x38(%rsp), %rcx
movq 0x20(%rcx), %rdi
movl 0x34(%rsp), %ecx
addl $0x18, %ecx
movslq %ecx, %rsi
shlq $0x0, %rsi
callq *%rax
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x380398
movl $0x1, 0x74(%rsp)
jmp 0x3805bb
movq 0x28(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x20(%rax)
movl 0x34(%rsp), %ecx
addl $0x18, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x2c(%rax)
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x2b8(%rax)
jmp 0x380453
movq 0x68(%rsp), %rax
movl $0x30, %edi
callq *0x18(%rax)
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0x3803f6
movl $0x1, 0x74(%rsp)
jmp 0x3805bb
movq 0x68(%rsp), %rax
movq 0x18(%rax), %rax
movl 0x34(%rsp), %ecx
addl $0x18, %ecx
movslq %ecx, %rdi
shlq $0x0, %rdi
callq *%rax
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x38(%rsp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x380444
movq 0x68(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x38(%rsp), %rdi
callq *%rax
movl $0x1, 0x74(%rsp)
jmp 0x3805bb
movl 0x34(%rsp), %ecx
addl $0x18, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x2c(%rax)
movl 0x34(%rsp), %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x28(%rax)
movq 0x38(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x50(%rsp), %rsi
movslq 0x34(%rsp), %rdx
shlq $0x0, %rdx
callq 0x19610
movq 0x68(%rsp), %rax
cmpb $0x0, 0x36c(%rax)
je 0x3804aa
movq 0x68(%rsp), %rax
movb 0x36c(%rax), %dl
movq 0x38(%rsp), %rax
movq 0x20(%rax), %rax
movl 0x34(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq 0x60(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, (%rax)
movq 0x58(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x50(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x380510
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
movq 0x290(%rcx), %rcx
addq $0x108, %rcx            # imm = 0x108
cmpq %rcx, %rax
jne 0x380510
movq 0x60(%rsp), %rax
movq $0x0, 0x8(%rax)
jmp 0x38051e
movq 0x38(%rsp), %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x48(%rsp), %rax
movq (%rax), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x38(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, (%rax)
cmpq $0x0, 0x58(%rsp)
je 0x3805b3
movq 0x68(%rsp), %rax
cmpq $0x0, 0xc8(%rax)
je 0x3805b3
movq 0x68(%rsp), %rax
movq 0xc8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x380596
movq 0x50(%rsp), %rax
movq %rax, (%rsp)
jmp 0x38059e
xorl %eax, %eax
movq %rax, (%rsp)
jmp 0x38059e
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdi
movq (%rsp), %rdx
callq *%rax
movl $0x0, 0x74(%rsp)
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)