// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: lookup
static NAMED *
lookup(HASH_TABLE *table, KEY name, size_t createSize)
{
  size_t i;
  if (table->size == 0) {
    size_t tsize;
    if (!createSize)
      return NULL;
    table->power = INIT_POWER;
    /* table->size is a power of 2 */
    table->size = (size_t)1 << INIT_POWER;
    tsize = table->size * sizeof(NAMED *);
    table->v = (NAMED **)table->mem->malloc_fcn(tsize);
    if (!table->v) {
      table->size = 0;
      return NULL;
    }
    memset(table->v, 0, tsize);
    i = hash(name) & ((unsigned long)table->size - 1);
  }
  else {
    unsigned long h = hash(name);
    unsigned long mask = (unsigned long)table->size - 1;
    unsigned char step = 0;
    i = h & mask;
    while (table->v[i]) {
      if (keyeq(name, table->v[i]->name))
        return table->v[i];
      if (!step)
        step = PROBE_STEP(h, mask, table->power);
      i < step ? (i += table->size - step) : (i -= step);
    }
    if (!createSize)
      return NULL;

    /* check for overflow (table is half full) */
    if (table->used >> (table->power - 1)) {
      unsigned char newPower = table->power + 1;
      size_t newSize = (size_t)1 << newPower;
      unsigned long newMask = (unsigned long)newSize - 1;
      size_t tsize = newSize * sizeof(NAMED *);
      NAMED **newV = (NAMED **)table->mem->malloc_fcn(tsize);
      if (!newV)
        return NULL;
      memset(newV, 0, tsize);
      for (i = 0; i < table->size; i++)
        if (table->v[i]) {
          unsigned long newHash = hash(table->v[i]->name);
          size_t j = newHash & newMask;
          step = 0;
          while (newV[j]) {
            if (!step)
              step = PROBE_STEP(newHash, newMask, newPower);
            j < step ? (j += newSize - step) : (j -= step);
          }
          newV[j] = table->v[i];
        }
      table->mem->free_fcn(table->v);
      table->v = newV;
      table->power = newPower;
      table->size = newSize;
      i = h & newMask;
      step = 0;
      while (table->v[i]) {
        if (!step)
          step = PROBE_STEP(h, newMask, newPower);
        i < step ? (i += newSize - step) : (i -= step);
      }
    }
  }
  table->v[i] = (NAMED *)table->mem->malloc_fcn(createSize);
  if (!table->v[i])
    return NULL;
  memset(table->v[i], 0, createSize);
  table->v[i]->name = name;
  (table->used)++;
  return table->v[i];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %rdx
testq %rdx, %rdx
je 0x24fa1d
movb (%r14), %sil
testb %sil, %sil
je 0x24fa94
leaq 0x1(%r14), %rax
xorl %r15d, %r15d
movl %esi, %ecx
imulq $0xf4243, %r15, %rdi    # imm = 0xF4243
movzbl %cl, %r15d
xorq %rdi, %r15
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x24fa04
jmp 0x24fa97
testq %r12, %r12
je 0x24fcf6
movb $0x6, 0x8(%rbx)
movq $0x40, 0x10(%rbx)
movq 0x20(%rbx), %rax
movl $0x200, %edi            # imm = 0x200
callq *(%rax)
movq %rax, (%rbx)
testq %rax, %rax
je 0x24fcee
movq %r12, 0x8(%rsp)
xorl %r15d, %r15d
movl $0x200, %edx            # imm = 0x200
movq %rax, %rdi
xorl %esi, %esi
callq 0x173a0
movb (%r14), %cl
testb %cl, %cl
je 0x24fa85
leaq 0x1(%r14), %rax
xorl %r15d, %r15d
imulq $0xf4243, %r15, %rdx    # imm = 0xF4243
movzbl %cl, %r15d
xorq %rdx, %r15
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x24fa6e
movq 0x10(%rbx), %rbp
decq %rbp
andq %r15, %rbp
jmp 0x24fcaf
xorl %r15d, %r15d
movq %r12, 0x8(%rsp)
leaq -0x1(%rdx), %rdi
movq %r15, %rbp
andq %rdi, %rbp
movq (%rbx), %r8
movq (%r8,%rbp,8), %rax
testq %rax, %rax
je 0x24fb26
movq %rdx, %r10
negq %r10
andq %r15, %r10
shrq $0x2, %rdi
xorl %r11d, %r11d
movq (%rax), %rcx
cmpb (%rcx), %sil
jne 0x24faee
movl $0x1, %r12d
movl %esi, %r13d
testb %r13b, %r13b
je 0x24fcf8
movb (%r14,%r12), %r13b
leaq 0x1(%r12), %r9
cmpb (%rcx,%r12), %r13b
movq %r9, %r12
je 0x24fad3
testb %r11b, %r11b
jne 0x24fb0a
movl 0x8(%rbx), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addl %eax, %ecx
movq %r10, %r11
shrq %cl, %r11
andl %edi, %r11d
orb $0x1, %r11b
movzbl %r11b, %eax
subq %rax, %rbp
movl $0x0, %eax
cmovbq %rdx, %rax
addq %rax, %rbp
movq (%r8,%rbp,8), %rax
testq %rax, %rax
jne 0x24fac2
cmpq $0x0, 0x8(%rsp)
je 0x24fcf6
movq 0x18(%rbx), %rax
movl 0x8(%rbx), %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
addl %edx, %ecx
shrq %cl, %rax
testq %rax, %rax
je 0x24fcaf
incb %dl
movl $0x1, %r13d
movl %edx, %ecx
shlq %cl, %r13
movl $0x8, %ebp
movq %rdx, 0x10(%rsp)
shlq %cl, %rbp
movq 0x20(%rbx), %rax
movq %rbp, %rdi
callq *(%rax)
testq %rax, %rax
je 0x24fcf6
movq %rax, %r12
leaq -0x1(%r13), %rax
movq %rax, (%rsp)
movq %r12, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x173a0
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x24fc46
movzbl 0x10(%rsp), %ecx
movq %r13, %rdx
negq %rdx
decl %ecx
movq (%rsp), %rsi
shrq $0x2, %rsi
xorl %edi, %edi
movq (%rbx), %r8
movq (%r8,%rdi,8), %r8
testq %r8, %r8
je 0x24fc3a
movq (%r8), %r9
movb (%r9), %r11b
testb %r11b, %r11b
je 0x24fbec
incq %r9
xorl %r10d, %r10d
imulq $0xf4243, %r10, %rbp    # imm = 0xF4243
movzbl %r11b, %r10d
xorq %rbp, %r10
movb (%r9), %r11b
incq %r9
testb %r11b, %r11b
jne 0x24fbd1
jmp 0x24fbef
xorl %r10d, %r10d
movq %r10, %r9
andq (%rsp), %r9
cmpq $0x0, (%r12,%r9,8)
je 0x24fc36
andq %rdx, %r10
shrq %cl, %r10
andl %esi, %r10d
orb $0x1, %r10b
xorl %r11d, %r11d
movzbl %r10b, %r10d
testb %r11b, %r11b
movzbl %r11b, %r11d
cmovel %r10d, %r11d
movzbl %r11b, %ebp
subq %rbp, %r9
movl $0x0, %ebp
cmovbq %r13, %rbp
addq %rbp, %r9
cmpq $0x0, (%r12,%r9,8)
jne 0x24fc11
movq %r8, (%r12,%r9,8)
incq %rdi
cmpq %rax, %rdi
jne 0x24fbb4
movq (%rbx), %rdi
movq 0x20(%rbx), %rax
callq *0x10(%rax)
movq %r12, (%rbx)
movq 0x10(%rsp), %rcx
movb %cl, 0x8(%rbx)
movq %r13, 0x10(%rbx)
movq (%rsp), %rdx
movq %rdx, %rbp
andq %r15, %rbp
cmpq $0x0, (%r12,%rbp,8)
je 0x24fcaf
movq %r13, %rax
negq %rax
andq %rax, %r15
decb %cl
shrq %cl, %r15
shrl $0x2, %edx
andl %edx, %r15d
orb $0x1, %r15b
xorl %eax, %eax
movzbl %r15b, %ecx
testb %al, %al
movzbl %al, %eax
cmovel %ecx, %eax
movzbl %al, %edx
subq %rdx, %rbp
movl $0x0, %edx
cmovbq %r13, %rdx
addq %rdx, %rbp
cmpq $0x0, (%r12,%rbp,8)
jne 0x24fc8e
movq 0x20(%rbx), %rax
movq 0x8(%rsp), %r15
movq %r15, %rdi
callq *(%rax)
movq (%rbx), %rcx
movq %rax, (%rcx,%rbp,8)
movq (%rbx), %rax
movq (%rax,%rbp,8), %rdi
testq %rdi, %rdi
je 0x24fcf6
xorl %esi, %esi
movq %r15, %rdx
callq 0x173a0
movq (%rbx), %rax
movq (%rax,%rbp,8), %rcx
movq %r14, (%rcx)
incq 0x18(%rbx)
movq (%rax,%rbp,8), %rax
jmp 0x24fcf8
movq $0x0, 0x10(%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq