// File: /workspace/github_c_makefile_star2_O0/LemonBoy[P]autobahn/xdiff/xprepare.c
// Function: xdl_clean_mmatch
static int xdl_clean_mmatch(char const *dis, long i, long s, long e) {
	long r, rdis0, rpdis0, rdis1, rpdis1;

	/*
	 * Limits the window the is examined during the similar-lines
	 * scan. The loops below stops when dis[i - r] == 1 (line that
	 * has no match), but there are corner cases where the loop
	 * proceed all the way to the extremities by causing huge
	 * performance penalties in case of big files.
	 */
	if (i - s > XDL_SIMSCAN_WINDOW)
		s = i - XDL_SIMSCAN_WINDOW;
	if (e - i > XDL_SIMSCAN_WINDOW)
		e = i + XDL_SIMSCAN_WINDOW;

	/*
	 * Scans the lines before 'i' to find a run of lines that either
	 * have no match (dis[j] == 0) or have multiple matches (dis[j] > 1).
	 * Note that we always call this function with dis[i] > 1, so the
	 * current line (i) is already a multimatch line.
	 */
	for (r = 1, rdis0 = 0, rpdis0 = 1; (i - r) >= s; r++) {
		if (!dis[i - r])
			rdis0++;
		else if (dis[i - r] == 2)
			rpdis0++;
		else
			break;
	}
	/*
	 * If the run before the line 'i' found only multimatch lines, we
	 * return 0 and hence we don't make the current line (i) discarded.
	 * We want to discard multimatch lines only when they appear in the
	 * middle of runs with nomatch lines (dis[j] == 0).
	 */
	if (rdis0 == 0)
		return 0;
	for (r = 1, rdis1 = 0, rpdis1 = 1; (i + r) <= e; r++) {
		if (!dis[i + r])
			rdis1++;
		else if (dis[i + r] == 2)
			rpdis1++;
		else
			break;
	}
	/*
	 * If the run after the line 'i' found only multimatch lines, we
	 * return 0 and hence we don't make the current line (i) discarded.
	 */
	if (rdis1 == 0)
		return 0;
	rdis1 += rdis0;
	rpdis1 += rpdis0;

	return rpdis1 * XDL_KPDIS_RUN < (rpdis1 + rdis1);
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movq %rdx, -0x20(%rsp)
movq %rcx, -0x28(%rsp)
movq -0x18(%rsp), %rax
subq -0x20(%rsp), %rax
cmpq $0x64, %rax
jle 0x6ab2
movq -0x18(%rsp), %rax
subq $0x64, %rax
movq %rax, -0x20(%rsp)
movq -0x28(%rsp), %rax
subq -0x18(%rsp), %rax
cmpq $0x64, %rax
jle 0x6ad0
movq -0x18(%rsp), %rax
addq $0x64, %rax
movq %rax, -0x28(%rsp)
movq $0x1, -0x30(%rsp)
movq $0x0, -0x38(%rsp)
movq $0x1, -0x40(%rsp)
movq -0x18(%rsp), %rax
subq -0x30(%rsp), %rax
cmpq -0x20(%rsp), %rax
jl 0x6b5f
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
subq -0x30(%rsp), %rcx
cmpb $0x0, (%rax,%rcx)
jne 0x6b21
movq -0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rsp)
jmp 0x6b4d
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
subq -0x30(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2, %eax
jne 0x6b49
movq -0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rsp)
jmp 0x6b4b
jmp 0x6b5f
jmp 0x6b4d
jmp 0x6b4f
movq -0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rsp)
jmp 0x6aeb
cmpq $0x0, -0x38(%rsp)
jne 0x6b74
movl $0x0, -0x4(%rsp)
jmp 0x6c55
movq $0x1, -0x30(%rsp)
movq $0x0, -0x48(%rsp)
movq $0x1, -0x50(%rsp)
movq -0x18(%rsp), %rax
addq -0x30(%rsp), %rax
cmpq -0x28(%rsp), %rax
jg 0x6c03
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
addq -0x30(%rsp), %rcx
cmpb $0x0, (%rax,%rcx)
jne 0x6bc5
movq -0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rsp)
jmp 0x6bf1
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
addq -0x30(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2, %eax
jne 0x6bed
movq -0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rsp)
jmp 0x6bef
jmp 0x6c03
jmp 0x6bf1
jmp 0x6bf3
movq -0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rsp)
jmp 0x6b8f
cmpq $0x0, -0x48(%rsp)
jne 0x6c15
movl $0x0, -0x4(%rsp)
jmp 0x6c55
movq -0x38(%rsp), %rax
addq -0x48(%rsp), %rax
movq %rax, -0x48(%rsp)
movq -0x40(%rsp), %rax
addq -0x50(%rsp), %rax
movq %rax, -0x50(%rsp)
movq -0x50(%rsp), %rax
shlq $0x2, %rax
movq -0x50(%rsp), %rcx
addq -0x48(%rsp), %rcx
cmpq %rcx, %rax
setl %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopw (%rax,%rax)