// File: /workspace/github_c_makefile_star2_O1/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, 0x30(%rsp)
movq (%rdx), %rbx
movl %edi, 0x14(%rsp)
movl %edi, %ecx
andb $-0x2, %cl
movl $0x2, %r14d
shlq %cl, %r14
xorl %eax, %eax
testq %r14, %rbx
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), %r15
notl %ebp
andl %r15d, %ebp
shrq %cl, %r15
movl (%r8), %esi
movl %esi, %eax
shrl $0x2, %eax
movl %esi, %ecx
shrl %ecx
addl %eax, %ecx
cmpl %ecx, 0x8(%r8)
jb 0xa9f0
movl 0x4(%r12), %eax
addl %eax, %eax
cmpl %eax, %esi
jbe 0xa9de
decl %esi
jmp 0xa9e0
incl %esi
movq %r12, %rdi
callq 0xb278
testl %eax, %eax
js 0xaaf4
movq %r15, %r13
shlq $0x1c, %r13
movl (%r12), %eax
leal -0x1(%rax), %r8d
movq %rbp, %r9
shldq $0x24, %r13, %r9
movq %r9, %rcx
shlq $0x20, %rcx
notq %rcx
addq %r9, %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, %rdx
shrq $0x1f, %rdx
xorl %ecx, %edx
andl %r8d, %edx
movq 0x10(%r12), %rdi
movl %edx, %ecx
shrl $0x4, %ecx
movl (%rdi,%rcx,4), %r10d
leal (%rdx,%rdx), %ecx
shrl %cl, %r10d
testb $0x2, %r10b
jne 0xab3c
movq %r13, 0x18(%rsp)
movq %r14, (%rsp)
movq %rbx, 0x20(%rsp)
movl $0x1, %r13d
movl %edx, %r11d
movq %rax, 0x8(%rsp)
movl %eax, %r10d
movl %r11d, %ecx
shrl $0x4, %ecx
movl (%rdi,%rcx,4), %ebx
leal (%r11,%r11), %ecx
andl $0x1e, %ecx
movl %ebx, %r14d
shrl %cl, %r14d
testb $0x2, %r14b
jne 0xaafd
testb $0x1, %r14b
jne 0xaada
movq 0x18(%r12), %r14
movl %r11d, %esi
shlq $0x4, %rsi
movq (%r14,%rsi), %rax
movq 0x8(%r14,%rsi), %rsi
shrdq $0x1c, %rax, %rsi
cmpq %r9, %rsi
je 0xaafd
btl %ecx, %ebx
cmovbl %r11d, %r10d
addl %r13d, %r11d
andl %r8d, %r11d
incl %r13d
movl %r10d, %ecx
cmpl %edx, %r11d
jne 0xaa99
jmp 0xab04
movl (%r12), %edx
jmp 0xabb8
movq 0x8(%rsp), %rax
movl %eax, %ecx
movl %ecx, %edx
movq 0x8(%rsp), %rsi
cmpl %esi, %ecx
movq 0x20(%rsp), %rbx
movq (%rsp), %r14
movq 0x18(%rsp), %r13
jne 0xab3c
movl %r11d, %eax
shrl $0x4, %eax
movl (%rdi,%rax,4), %eax
leal (%r11,%r11), %ecx
shrl %cl, %eax
cmpl %esi, %r10d
cmovel %r11d, %r10d
testb $0x2, %al
cmovel %r11d, %r10d
movl %r10d, %edx
movl %edx, %esi
shrl $0x4, %esi
movl (%rdi,%rsi,4), %r8d
leal (%rdx,%rdx), %ecx
andl $0x1e, %ecx
shrl %cl, %r8d
testb $0x2, %r8b
jne 0xab89
movb $0x1, %dil
testb $0x1, %r8b
je 0xabba
movq 0x18(%r12), %rax
movl %edx, %edi
shlq $0x4, %rdi
movq %rbp, (%rax,%rdi)
movq %r13, 0x8(%rax,%rdi)
movl $0x3, %eax
shll %cl, %eax
notl %eax
movq 0x10(%r12), %rcx
andl %eax, (%rcx,%rsi,4)
incl 0x4(%r12)
jmp 0xabb8
movq 0x18(%r12), %rax
movl %edx, %edi
shlq $0x4, %rdi
movq %rbp, (%rax,%rdi)
movq %r13, 0x8(%rax,%rdi)
movl $0x3, %eax
shll %cl, %eax
notl %eax
movq 0x10(%r12), %rcx
andl %eax, (%rcx,%rsi,4)
incl 0x4(%r12)
incl 0x8(%r12)
xorl %edi, %edi
movl %edx, %r13d
shlq $0x4, %r13
addq 0x18(%r12), %r13
testb %dil, %dil
jne 0xacf0
movq 0x30(%rsp), %rax
movq (%rax,%rbp,8), %rax
movl (%rax), %edx
testl %edx, %edx
je 0xacb6
movq %r14, (%rsp)
movq %rbx, %r12
leal -0x1(%rdx), %esi
movabsq $0xfffffffff, %rdi      # imm = 0xFFFFFFFFF
andq %r15, %rdi
shlq $0x20, %r15
notq %r15
addq %rdi, %r15
movq %r15, %rcx
shrq $0x16, %rcx
xorq %r15, %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, %r14d
shrl %cl, %r14d
testb $0x2, %r14b
jne 0xaca3
testb $0x1, %r14b
jne 0xac90
movq 0x18(%rax), %rbx
movl %r8d, %r14d
movq (%rbx,%r14,8), %rbx
shrq $0x1c, %rbx
cmpq %rdi, %rbx
je 0xaca3
addl %r11d, %r8d
andl %esi, %r8d
incl %r11d
cmpl %r9d, %r8d
jne 0xac59
movl %edx, %r8d
jmp 0xacad
shrl %cl, %ebp
testb $0x3, %bpl
cmovnel %edx, %r8d
movq %r12, %rbx
movq (%rsp), %r14
jmp 0xacb9
xorl %r8d, %r8d
movq (%r13), %rcx
cmpl %edx, %r8d
jne 0xacd8
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
incq %rax
orq %rax, %rcx
movq %rcx, (%r13)
jmp 0xacf0
btrq $0x3f, %rcx
movq %rcx, (%r13)
movq 0x18(%rax), %rax
movl %r8d, %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%r13)
cmpl $0x6, 0x194d9(%rip)     # 0x241d0
jge 0xad2f
cmpq $0x0, (%r13)
js 0xad1b
xorl %edx, %edx
testq %r14, %rbx
movq 0x8(%r13), %rax
movl $0xe, %ecx
cmovnel %edx, %ecx
shrq %cl, %rax
andl $0x3fff, %eax           # imm = 0x3FFF
jmp 0xad20
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 %r14, %rsi
movq %r13, %rdx
movl 0x14(%rsp), %ecx
callq 0x2a96
jmp 0xacf9