// File: /workspace/github_c_makefile_star2_O0/lh3[P]fermi2/diff.c
// Function: contrast_core
static void contrast_core(const rld_t *eqry, const rld_t *eref, uint64_t *sub, int min_k, int max_k, int min_occ, int suf_len, int suf)
{
	rldintv_v stack[2], tstack;
	rldintv_t ik[2], ok[2][6];
	const rld_t *e[2];
	int i, c;

	e[0] = eref; e[1] = eqry;
	kv_init(tstack); // temporary stack
	for (i = 0; i < 2; ++i) {
		kv_init(stack[i]);
		ik[i] = descend(e[i], suf_len, suf);
		ik[i].info = suf_len;
	}
	if (ik[0].x[2] == 0 || ik[1].x[2] < min_occ) return;
	kv_push(rldintv_t, stack[0], ik[0]);
	kv_push(rldintv_t, stack[1], ik[1]);
	while (stack[0].n) { // stack[0] and stack[1] are always of the same size
		ik[0] = kv_pop(stack[0]);
		ik[1] = kv_pop(stack[1]); // it is always true that ik[1].x[2] >= min_occ
		if (ik[0].x[2] == 0) collect_tips(e[1], min_k, min_occ, sub, &ik[1], &tstack);
		else if (ik[1].info >= max_k) continue;
		else {
			rld_extend(e[0], &ik[0], ok[0], 1);
			rld_extend(e[1], &ik[1], ok[1], 1);
			for (c = 1; c <= 4; ++c) {
				if (ok[1][c].x[2] < min_occ) continue;
				ok[1][c].info = ik[1].info + 1;
				kv_push(rldintv_t, stack[0], ok[0][c]);
				kv_push(rldintv_t, stack[1], ok[1][c]);
			}
		}
	}
	free(stack[0].a); free(stack[1].a); free(tstack.a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x250(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x248(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x78(%rbp)
movq $0x0, -0x68(%rbp)
movl $0x0, -0x254(%rbp)
cmpl $0x2, -0x254(%rbp)
jge 0x558a
movslq -0x254(%rbp), %rcx
leaq -0x60(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
movslq -0x254(%rbp), %rcx
leaq -0x60(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq $0x0, (%rax)
movslq -0x254(%rbp), %rcx
leaq -0x60(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x10(%rax)
movslq -0x254(%rbp), %rcx
leaq -0xc0(%rbp), %rax
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x280(%rbp)
movslq -0x254(%rbp), %rax
movq -0x250(%rbp,%rax,8), %rsi
movl 0x10(%rbp), %edx
movl 0x18(%rbp), %ecx
leaq -0x278(%rbp), %rdi
callq 0x59f0
movq -0x280(%rbp), %rax
movq -0x278(%rbp), %rcx
movq %rcx, (%rax)
movq -0x270(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x268(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x260(%rbp), %rcx
movq %rcx, 0x18(%rax)
movslq 0x10(%rbp), %rcx
movslq -0x254(%rbp), %rdx
leaq -0xc0(%rbp), %rax
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
movl -0x254(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x254(%rbp)
jmp 0x5490
cmpq $0x0, -0xb0(%rbp)
je 0x55a4
movq -0x90(%rbp), %rax
movslq -0x24(%rbp), %rcx
cmpq %rcx, %rax
jae 0x55a9
jmp 0x59e1
jmp 0x55ab
movq -0x60(%rbp), %rax
cmpq -0x58(%rbp), %rax
jne 0x55fa
cmpq $0x0, -0x58(%rbp)
je 0x55cc
movq -0x58(%rbp), %rax
shlq %rax
movq %rax, -0x288(%rbp)
jmp 0x55da
movl $0x2, %eax
movq %rax, -0x288(%rbp)
jmp 0x55da
movq -0x288(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
shlq $0x5, %rsi
callq 0x2270
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x60(%rbp)
shlq $0x5, %rcx
addq %rcx, %rax
movq -0xc0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xb8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xb0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0xa8(%rbp), %rcx
movq %rcx, 0x18(%rax)
jmp 0x5641
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x5690
cmpq $0x0, -0x40(%rbp)
je 0x5662
movq -0x40(%rbp), %rax
shlq %rax
movq %rax, -0x290(%rbp)
jmp 0x5670
movl $0x2, %eax
movq %rax, -0x290(%rbp)
jmp 0x5670
movq -0x290(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
shlq $0x5, %rsi
callq 0x2270
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x48(%rbp)
shlq $0x5, %rcx
addq %rcx, %rax
movq -0xa0(%rbp), %rcx
movq %rcx, (%rax)
movq -0x98(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x90(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x88(%rbp), %rcx
movq %rcx, 0x18(%rax)
jmp 0x56d7
cmpq $0x0, -0x60(%rbp)
je 0x59c6
movq -0x50(%rbp), %rax
movq -0x60(%rbp), %rcx
addq $-0x1, %rcx
movq %rcx, -0x60(%rbp)
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0xc0(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xb8(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0xb0(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
addq $-0x1, %rcx
movq %rcx, -0x48(%rbp)
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0xa0(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x98(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0x90(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, -0xb0(%rbp)
jne 0x579a
movq -0x248(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x24(%rbp), %edx
movq -0x18(%rbp), %rcx
leaq -0xc0(%rbp), %r8
addq $0x20, %r8
leaq -0x78(%rbp), %r9
callq 0x5ad0
jmp 0x59c1
movq -0x88(%rbp), %rax
movslq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jb 0x57af
jmp 0x56d7
movq -0x250(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0x240(%rbp), %rdx
movl $0x1, %ecx
callq 0x49a0
movq -0x248(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
addq $0x20, %rsi
leaq -0x240(%rbp), %rdx
addq $0xc0, %rdx
movl $0x1, %ecx
callq 0x49a0
movl $0x1, -0x258(%rbp)
cmpl $0x4, -0x258(%rbp)
jg 0x59bd
leaq -0x240(%rbp), %rax
addq $0xc0, %rax
movslq -0x258(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movslq -0x24(%rbp), %rcx
cmpq %rcx, %rax
jae 0x583c
jmp 0x59a9
movq -0x88(%rbp), %rcx
addq $0x1, %rcx
leaq -0x240(%rbp), %rax
addq $0xc0, %rax
movslq -0x258(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
movq -0x60(%rbp), %rax
cmpq -0x58(%rbp), %rax
jne 0x58b5
cmpq $0x0, -0x58(%rbp)
je 0x5887
movq -0x58(%rbp), %rax
shlq %rax
movq %rax, -0x298(%rbp)
jmp 0x5895
movl $0x2, %eax
movq %rax, -0x298(%rbp)
jmp 0x5895
movq -0x298(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
shlq $0x5, %rsi
callq 0x2270
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x60(%rbp)
shlq $0x5, %rcx
addq %rcx, %rax
leaq -0x240(%rbp), %rcx
movslq -0x258(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
jmp 0x5904
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x5953
cmpq $0x0, -0x40(%rbp)
je 0x5925
movq -0x40(%rbp), %rax
shlq %rax
movq %rax, -0x2a0(%rbp)
jmp 0x5933
movl $0x2, %eax
movq %rax, -0x2a0(%rbp)
jmp 0x5933
movq -0x2a0(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
shlq $0x5, %rsi
callq 0x2270
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x48(%rbp)
shlq $0x5, %rcx
addq %rcx, %rax
leaq -0x240(%rbp), %rcx
addq $0xc0, %rcx
movslq -0x258(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
jmp 0x59a9
movl -0x258(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x258(%rbp)
jmp 0x5802
jmp 0x59bf
jmp 0x59c1
jmp 0x56d7
movq -0x50(%rbp), %rdi
callq 0x2040
movq -0x38(%rbp), %rdi
callq 0x2040
movq -0x68(%rbp), %rdi
callq 0x2040
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
nopw (%rax,%rax)