// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %rdx
testq %rdx, %rdx
je 0x257ae9
movb (%r14), %sil
testb %sil, %sil
je 0x257b5d
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 0x257ad0
jmp 0x257b60
testq %r12, %r12
je 0x257d9f
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 0x257d97
xorl %r15d, %r15d
movl $0x200, %edx            # imm = 0x200
movq %rax, %rdi
xorl %esi, %esi
callq 0x173a0
movb (%r14), %cl
testb %cl, %cl
je 0x257b4c
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 0x257b35
movq 0x10(%rbx), %r13
decq %r13
andq %r15, %r13
movb $0x1, %al
jmp 0x257da1
xorl %r15d, %r15d
movq %r12, (%rsp)
leaq -0x1(%rdx), %rdi
movq %r15, %r13
andq %rdi, %r13
movq (%rbx), %r8
movq (%r8,%r13,8), %rax
testq %rax, %rax
je 0x257bed
movq %rdx, %r10
negq %r10
andq %r15, %r10
shrq $0x2, %rdi
xorl %r11d, %r11d
movq (%rax), %rcx
cmpb (%rcx), %sil
jne 0x257bb5
movl $0x1, %r12d
movl %esi, %ebp
testb %bpl, %bpl
je 0x257d8b
movb (%r14,%r12), %bpl
leaq 0x1(%r12), %r9
cmpb (%rcx,%r12), %bpl
movq %r9, %r12
je 0x257b9a
testb %r11b, %r11b
jne 0x257bd1
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, %r13
movl $0x0, %eax
cmovbq %rdx, %rax
addq %rax, %r13
movq (%r8,%r13,8), %rax
testq %rax, %rax
jne 0x257b8a
movq (%rsp), %r12
testq %r12, %r12
je 0x257d93
movq 0x18(%rbx), %rax
movl 0x8(%rbx), %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
addl %edx, %ecx
shrq %cl, %rax
testq %rax, %rax
je 0x257da7
incb %dl
movl $0x1, %ebp
movl %edx, %ecx
shlq %cl, %rbp
movl $0x8, %edi
movq %rdx, 0x18(%rsp)
shlq %cl, %rdi
movq 0x20(%rbx), %rax
movq %rdi, 0x20(%rsp)
callq *(%rax)
testq %rax, %rax
setne %cl
je 0x257dad
movq %rax, %r12
movq %rcx, 0x10(%rsp)
leaq -0x1(%rbp), %rax
movq %rax, 0x8(%rsp)
movq %r12, %rdi
xorl %esi, %esi
movq 0x20(%rsp), %rdx
callq 0x173a0
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x257d1d
movzbl 0x18(%rsp), %ecx
movq %rbp, %rdx
negq %rdx
decl %ecx
movq 0x8(%rsp), %rsi
shrq $0x2, %rsi
xorl %edi, %edi
movq (%rbx), %r8
movq (%r8,%rdi,8), %r8
testq %r8, %r8
je 0x257d11
movq (%r8), %r9
movb (%r9), %r11b
testb %r11b, %r11b
je 0x257cc1
incq %r9
xorl %r10d, %r10d
imulq $0xf4243, %r10, %r13    # imm = 0xF4243
movzbl %r11b, %r10d
xorq %r13, %r10
movb (%r9), %r11b
incq %r9
testb %r11b, %r11b
jne 0x257ca6
jmp 0x257cc4
xorl %r10d, %r10d
movq %r10, %r9
andq 0x8(%rsp), %r9
cmpq $0x0, (%r12,%r9,8)
je 0x257d0d
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, %r13d
subq %r13, %r9
movl $0x0, %r13d
cmovbq %rbp, %r13
addq %r13, %r9
cmpq $0x0, (%r12,%r9,8)
jne 0x257ce7
movq %r8, (%r12,%r9,8)
incq %rdi
cmpq %rax, %rdi
jne 0x257c89
movq (%rbx), %rdi
movq 0x20(%rbx), %rax
callq *0x10(%rax)
movq %r12, (%rbx)
movq 0x18(%rsp), %rcx
movb %cl, 0x8(%rbx)
movq %rbp, 0x10(%rbx)
movq 0x8(%rsp), %rdx
movq %rdx, %r13
andq %r15, %r13
cmpq $0x0, (%r12,%r13,8)
je 0x257db1
movq %rbp, %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
xorl %edx, %edx
testb %dl, %dl
movzbl %dl, %edx
cmovel %ecx, %edx
movzbl %dl, %esi
subq %rsi, %r13
movl $0x0, %esi
cmovbq %rbp, %rsi
addq %rsi, %r13
cmpq $0x0, (%r12,%r13,8)
jne 0x257d68
jmp 0x257db3
xorl %ecx, %ecx
movq (%rsp), %r12
jmp 0x257dbc
xorl %ecx, %ecx
jmp 0x257da9
movq $0x0, 0x10(%rbx)
xorl %eax, %eax
testb %al, %al
jne 0x257dc0
jmp 0x257dfa
movb $0x1, %cl
xorl %eax, %eax
jmp 0x257dbc
xorl %eax, %eax
jmp 0x257d8d
xorl %eax, %eax
movq (%rsp), %r12
movq 0x10(%rsp), %rcx
testb %cl, %cl
je 0x257dfc
movq 0x20(%rbx), %rax
movq %r12, %rdi
callq *(%rax)
movq (%rbx), %rcx
movq %rax, (%rcx,%r13,8)
movq (%rbx), %rax
movq (%rax,%r13,8), %rdi
testq %rdi, %rdi
je 0x257dfa
xorl %esi, %esi
movq %r12, %rdx
callq 0x173a0
movq (%rbx), %rax
movq (%rax,%r13,8), %rcx
movq %r14, (%rcx)
incq 0x18(%rbx)
movq (%rax,%r13,8), %rax
jmp 0x257dfc
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq