// File: /workspace/github_c_makefile_star2_O2/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 $0x48, %rsp
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %r15
testq %r15, %r15
je 0x1ff375
movq %r14, %rdi
callq 0x202067
movq %rax, %rbp
leaq -0x1(%r15), %rdx
movq %rax, %r12
andq %rdx, %r12
movq (%rbx), %rsi
movq %r15, %rdi
negq %rdi
andq %rax, %rdi
shrq $0x2, %rdx
xorl %r9d, %r9d
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movq (%rsi,%r12,8), %rax
testq %rax, %rax
je 0x1ff40a
movq (%rax), %rcx
xorl %r10d, %r10d
movb (%r14,%r10), %r11b
cmpb (%rcx,%r10), %r11b
jne 0x1ff348
testb %r11b, %r11b
je 0x1ff3fb
incq %r10
jmp 0x1ff330
testb %r9b, %r9b
jne 0x1ff360
movl 0x8(%rbx), %ecx
addl %r8d, %ecx
movq %rdi, %r9
shrq %cl, %r9
andl %edx, %r9d
orb $0x1, %r9b
movzbl %r9b, %eax
subq %rax, %r12
movl $0x0, %eax
cmovbq %r15, %rax
addq %rax, %r12
jmp 0x1ff31d
testq %r13, %r13
je 0x1ff3f9
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 0x1ff3f4
movl $0x200, %edx            # imm = 0x200
movq %rax, %rdi
xorl %esi, %esi
callq 0x17380
movq %r14, %rdi
callq 0x202067
movq 0x10(%rbx), %r12
decq %r12
andq %rax, %r12
movq 0x20(%rbx), %rax
movq %r13, %rdi
callq *(%rax)
movq (%rbx), %rcx
movq %rax, (%rcx,%r12,8)
movq (%rbx), %rax
movq (%rax,%r12,8), %rdi
testq %rdi, %rdi
je 0x1ff3f9
xorl %esi, %esi
movq %r13, %rdx
callq 0x17380
movq (%rbx), %rax
movq (%rax,%r12,8), %rcx
movq %r14, (%rcx)
incq 0x18(%rbx)
movq (%rax,%r12,8), %rax
jmp 0x1ff3fb
andq $0x0, 0x10(%rbx)
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r13, %r13
je 0x1ff3f9
movq %rbp, 0x30(%rsp)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq 0x18(%rbx), %rax
movl 0x8(%rbx), %ebp
addl %ebp, %ecx
shrq %cl, %rax
testq %rax, %rax
je 0x1ff3ba
movq %r13, 0x28(%rsp)
incb %bpl
pushq $0x1
popq %r15
movl %ebp, %ecx
shlq %cl, %r15
pushq $0x8
popq %r12
shlq %cl, %r12
movq 0x20(%rbx), %rax
movq %r12, %rdi
callq *(%rax)
testq %rax, %rax
je 0x1ff3f9
movq %rax, %r13
movq %r12, %rdx
leaq -0x1(%r15), %r12
movq %rax, %rdi
xorl %esi, %esi
callq 0x17380
xorl %ecx, %ecx
movq 0x10(%rbx), %rax
movq %rax, 0x38(%rsp)
movq %r15, %rax
negq %rax
movq %rax, 0x18(%rsp)
movq %rbp, 0x20(%rsp)
movzbl %bpl, %eax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
addl %edx, %eax
movq %rax, 0x8(%rsp)
movq %r12, %rax
shrq $0x2, %rax
movq %rax, 0x10(%rsp)
cmpq 0x38(%rsp), %rcx
je 0x1ff511
movq (%rbx), %rax
movq (%rax,%rcx,8), %rbp
testq %rbp, %rbp
je 0x1ff50c
movq %rcx, 0x40(%rsp)
movq (%rbp), %rdi
callq 0x202067
movq %rax, %rdx
andq %r12, %rdx
andq 0x18(%rsp), %rax
movq 0x8(%rsp), %rcx
shrq %cl, %rax
movq 0x10(%rsp), %rcx
andl %eax, %ecx
orb $0x1, %cl
xorl %eax, %eax
movzbl %cl, %ecx
cmpq $0x0, (%r13,%rdx,8)
je 0x1ff502
testb %al, %al
movzbl %al, %eax
cmovel %ecx, %eax
movzbl %al, %esi
subq %rsi, %rdx
movl $0x0, %esi
cmovbq %r15, %rsi
addq %rsi, %rdx
jmp 0x1ff4de
movq %rbp, (%r13,%rdx,8)
movq 0x40(%rsp), %rcx
incq %rcx
jmp 0x1ff49b
movq (%rbx), %rdi
movq 0x20(%rbx), %rax
callq *0x10(%rax)
movq %r13, (%rbx)
movq 0x20(%rsp), %rax
movb %al, 0x8(%rbx)
movq %r15, 0x10(%rbx)
movq 0x30(%rsp), %rax
andq %rax, %r12
movq 0x18(%rsp), %rdx
andq %rax, %rdx
movq 0x8(%rsp), %rcx
shrq %cl, %rdx
movq 0x10(%rsp), %rcx
andl %edx, %ecx
orb $0x1, %cl
xorl %eax, %eax
movzbl %cl, %ecx
cmpq $0x0, (%r13,%r12,8)
je 0x1ff575
testb %al, %al
movzbl %al, %eax
cmovel %ecx, %eax
movzbl %al, %edx
subq %rdx, %r12
movl $0x0, %edx
cmovbq %r15, %rdx
addq %rdx, %r12
jmp 0x1ff551
movq 0x28(%rsp), %r13
jmp 0x1ff3ba