// File: /workspace/github_c_makefile_star2_O3/lh3[P]fermi2/correct.c
// Function: kmer_lookup
static inline int kmer_lookup(int k, int suf_len, uint64_t kmer[2], fmc_hash_t **h, kmercache_t *cache)
{
	int absent, i = (kmer[0]>>(k>>1<<1)&3) < 2? 0 : 1;
	khint_t kh, kc;
	longcell_t x, *p;

	x.suf = kmer[i] & ((1<<(suf_len<<1)) - 1);
	x.x = kmer[i] >> (suf_len<<1) << 28;
	x.missing = 0; // This line suppresses a gcc warning. It has no effect.
	kc = kh_put(kache, cache, x, &absent);
	p = &kh_key(cache, kc);
	if (absent) {
		fmc_hash_t *g = h[x.suf];
		kh = kh_get(fmc, g, x.x);
		if (kh == kh_end(g)) p->missing = 1;
		else p->missing = 0, p->x = kh_key(g, kh);
	}
	if (fmc_verbose >= 6) {
		int i, which = (kmer[0]>>(k>>1<<1)&3) < 2? 0 : 1;
		int val = p->missing? -1 : fmc_cell_get_val(p->x, !which);
		fprintf(stderr, "?? ");
		for (i = k-1; i >= 0; --i) fputc("ACGT"[kmer[0]>>2*i&3], stderr); fprintf(stderr, " - ");
		for (i = k-1; i >= 0; --i) fputc("ACGT"[kmer[1]>>2*i&3], stderr);
		fprintf(stderr, " - [%c] %lx", "+-"[which], (long)kmer[which]);
		if (p->missing) fprintf(stderr, " - NOHIT\n");
		else fprintf(stderr, " - %c%d\n", "ACGTN"[fmc_cell_get_b1(val)], fmc_cell_get_q1(val));
	}
	return p->missing? -1 : fmc_cell_get_val(p->x, !i);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %rbx
movq (%rdx), %r9
movl %edi, 0x4(%rsp)
movl %edi, %ecx
andb $-0x2, %cl
movl $0x2, %edi
shlq %cl, %rdi
xorl %eax, %eax
movq %r9, 0x30(%rsp)
movq %rdi, 0x20(%rsp)
testq %rdi, %r9
setne %al
leal (%rsi,%rsi), %ecx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
shll %cl, %ebp
movq %r8, %r12
movq %rdx, 0x28(%rsp)
movq (%rdx,%rax,8), %r14
notl %ebp
andl %r14d, %ebp
shrq %cl, %r14
movl (%r8), %esi
movl %esi, %eax
shrl $0x2, %eax
movl %esi, %ecx
shrl %ecx
addl %eax, %ecx
cmpl %ecx, 0x8(%r8)
jb 0xaed0
movl 0x4(%r12), %eax
addl %eax, %eax
cmpl %eax, %esi
jbe 0xaeb8
decl %esi
jmp 0xaeba
incl %esi
movq %r12, %rdi
callq 0xb742
movl (%r12), %esi
movl %esi, %edx
testl %eax, %eax
js 0xb096
movq %r14, %r11
shlq $0x1c, %r11
leal -0x1(%rsi), %edi
movq %rbp, %r8
shldq $0x24, %r11, %r8
movq %r8, %rcx
shlq $0x20, %rcx
notq %rcx
addq %r8, %rcx
movq %rcx, %rdx
shrq $0x16, %rdx
xorq %rcx, %rdx
movq %rdx, %rcx
shlq $0xd, %rcx
notq %rcx
addq %rdx, %rcx
movq %rcx, %rdx
shrq $0x8, %rdx
xorq %rcx, %rdx
leaq (%rdx,%rdx,8), %rcx
movq %rcx, %rdx
shrq $0xf, %rdx
xorq %rcx, %rdx
movq %rdx, %rcx
shlq $0x1b, %rcx
notq %rcx
addq %rdx, %rcx
movq %rcx, %r10
shrq $0x1f, %r10
xorl %ecx, %r10d
andl %edi, %r10d
movq 0x10(%r12), %r9
movl %r10d, %ecx
shrl $0x4, %ecx
movl (%r9,%rcx,4), %edx
leal (%r10,%r10), %ecx
shrl %cl, %edx
testb $0x2, %dl
je 0xaf5a
movl %r10d, %edx
jmp 0xb00e
movq %r11, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
movl $0x1, %r13d
movl %r10d, %r11d
movl %esi, %edx
movl %r11d, %ecx
shrl $0x4, %ecx
movl (%r9,%rcx,4), %ebx
leal (%r11,%r11), %ecx
andl $0x1e, %ecx
movl %ebx, %r14d
shrl %cl, %r14d
testb $0x2, %r14b
jne 0xafe4
testb $0x1, %r14b
jne 0xafb6
movq 0x18(%r12), %r14
movl %r11d, %eax
shlq $0x4, %rax
movq (%r14,%rax), %r15
movq 0x8(%r14,%rax), %rax
shrdq $0x1c, %r15, %rax
cmpq %r8, %rax
je 0xafe4
btl %ecx, %ebx
cmovbl %r11d, %edx
addl %r13d, %r11d
andl %edi, %r11d
incl %r13d
cmpl %r10d, %r11d
jne 0xaf74
movb $0x1, %cl
movl %esi, %edi
cmpl %esi, %edx
movq 0x18(%rsp), %rbx
movq 0x10(%rsp), %r14
movq 0x8(%rsp), %r11
je 0xb000
jmp 0xb00e
shrl %cl, %ebx
testb $0x2, %bl
sete %cl
movl %edx, %edi
movl %r11d, %r10d
movq 0x18(%rsp), %rbx
movq 0x10(%rsp), %r14
movq 0x8(%rsp), %r11
cmpl %esi, %edi
cmovel %r10d, %edi
testb %cl, %cl
cmovnel %r10d, %edi
movl %edi, %edx
movl %edx, %esi
shrl $0x4, %esi
movl (%r9,%rsi,4), %edi
leal (%rdx,%rdx), %ecx
andl $0x1e, %ecx
shrl %cl, %edi
testb $0x2, %dil
jne 0xb05b
movl %edx, %r13d
shlq $0x4, %r13
addq 0x18(%r12), %r13
testb $0x1, %dil
je 0xb19e
movq %rbp, (%r13)
movq %r11, 0x8(%r13)
movl $0x3, %eax
shll %cl, %eax
notl %eax
movq 0x10(%r12), %rcx
andl %eax, (%rcx,%rsi,4)
incl 0x4(%r12)
jmp 0xb096
movq 0x18(%r12), %rax
movl %edx, %edi
shlq $0x4, %rdi
movq %rbp, (%rax,%rdi)
movq %r11, 0x8(%rax,%rdi)
movl $0x3, %eax
shll %cl, %eax
notl %eax
movq 0x10(%r12), %rcx
andl %eax, (%rcx,%rsi,4)
movq 0x4(%r12), %xmm0
pcmpeqd %xmm1, %xmm1
psubd %xmm1, %xmm0
movq %xmm0, 0x4(%r12)
movl %edx, %r13d
shlq $0x4, %r13
addq 0x18(%r12), %r13
movq (%rbx,%rbp,8), %rax
movl (%rax), %edx
testl %edx, %edx
je 0xb16f
leal -0x1(%rdx), %esi
movabsq $0xfffffffff, %rdi      # imm = 0xFFFFFFFFF
andq %r14, %rdi
shlq $0x20, %r14
notq %r14
addq %rdi, %r14
movq %r14, %rcx
shrq $0x16, %rcx
xorq %r14, %rcx
movq %rcx, %r8
shlq $0xd, %r8
notq %r8
addq %rcx, %r8
movq %r8, %rcx
shrq $0x8, %rcx
xorq %r8, %rcx
leaq (%rcx,%rcx,8), %rcx
movq %rcx, %r8
shrq $0xf, %r8
xorq %rcx, %r8
movq %r8, %rcx
shlq $0x1b, %rcx
notq %rcx
addq %r8, %rcx
movq %rcx, %r9
shrq $0x1f, %r9
xorl %ecx, %r9d
andl %esi, %r9d
movq 0x10(%rax), %r10
movl $0x1, %r11d
movl %r9d, %r8d
movl %r8d, %ecx
shrl $0x4, %ecx
movl (%r10,%rcx,4), %ebp
leal (%r8,%r8), %ecx
andl $0x1e, %ecx
movl %ebp, %ebx
shrl %cl, %ebx
testb $0x2, %bl
jne 0xb163
testb $0x1, %bl
jne 0xb153
movq 0x18(%rax), %rbx
movl %r8d, %r14d
movq (%rbx,%r14,8), %rbx
shrq $0x1c, %rbx
cmpq %rdi, %rbx
je 0xb163
addl %r11d, %r8d
andl %esi, %r8d
incl %r11d
cmpl %r9d, %r8d
jne 0xb120
jmp 0xb177
shrl %cl, %ebp
testb $0x3, %bpl
cmovnel %edx, %r8d
jmp 0xb172
xorl %r8d, %r8d
cmpl %edx, %r8d
jne 0xb18a
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
incq %rax
orq %rax, (%r13)
jmp 0xb19e
andb $0x7f, 0x7(%r13)
movq 0x18(%rax), %rax
movl %r8d, %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%r13)
cmpl $0x6, 0x1a02b(%rip)     # 0x251d0
jge 0xb1e4
cmpq $0x0, (%r13)
js 0xb1d0
xorl %edx, %edx
movq 0x20(%rsp), %rax
testq %rax, 0x30(%rsp)
movq 0x8(%r13), %rax
movl $0xe, %ecx
cmovnel %edx, %ecx
shrq %cl, %rax
andl $0x3fff, %eax           # imm = 0x3FFF
jmp 0xb1d5
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %r13, %rdx
movl 0x4(%rsp), %ecx
callq 0x2a38
jmp 0xb1a7