// File: /workspace/github_c_makefile_star2_O0/LemonBoy[P]autobahn/xdiff/xhistogram.c
// Function: try_lcs
static int try_lcs(struct histindex *index, struct region *lcs, int b_ptr,
	int line1, int count1, int line2, int count2)
{
	unsigned int b_next = b_ptr + 1;
	struct record *rec = index->records[TABLE_HASH(index, 2, b_ptr)];
	unsigned int as, ae, bs, be, np, rc;
	int should_break;

	for (; rec; rec = rec->next) {
		if (rec->cnt > index->cnt) {
			if (!index->has_common)
				index->has_common = CMP(index, 1, rec->ptr, 2, b_ptr);
			continue;
		}

		as = rec->ptr;
		if (!CMP(index, 1, as, 2, b_ptr))
			continue;

		index->has_common = 1;
		for (;;) {
			should_break = 0;
			np = NEXT_PTR(index, as);
			bs = b_ptr;
			ae = as;
			be = bs;
			rc = rec->cnt;

			while (line1 < as && line2 < bs
				&& CMP(index, 1, as - 1, 2, bs - 1)) {
				as--;
				bs--;
				if (1 < rc)
					rc = XDL_MIN(rc, CNT(index, as));
			}
			while (ae < LINE_END(1) && be < LINE_END(2)
				&& CMP(index, 1, ae + 1, 2, be + 1)) {
				ae++;
				be++;
				if (1 < rc)
					rc = XDL_MIN(rc, CNT(index, ae));
			}

			if (b_next <= be)
				b_next = be + 1;
			if (lcs->end1 - lcs->begin1 < ae - as || rc < index->cnt) {
				lcs->begin1 = as;
				lcs->begin2 = bs;
				lcs->end1 = ae;
				lcs->end2 = be;
				index->cnt = rc;
			}

			if (np == 0)
				break;

			while (np <= ae) {
				np = NEXT_PTR(index, np);
				if (np == 0) {
					should_break = 1;
					break;
				}
			}

			if (should_break)
				break;

			as = np;
		}
	}
	return b_next;
}

// Assembly:
subq $0x78, %rsp
movl 0x80(%rsp), %eax
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movl %edx, 0x64(%rsp)
movl %ecx, 0x60(%rsp)
movl %r8d, 0x5c(%rsp)
movl %r9d, 0x58(%rsp)
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
movq 0x70(%rsp), %rax
movq (%rax), %rax
movq 0x70(%rsp), %rcx
movq 0x70(%rcx), %rcx
movq 0xe8(%rcx), %rcx
movl 0x64(%rsp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rsp)
movq 0x70(%rsp), %rcx
movq 0x70(%rcx), %rcx
movq 0xe8(%rcx), %rcx
movl 0x64(%rsp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x18(%rcx), %rdx
movq 0x70(%rsp), %rcx
movl 0x50(%rcx), %ecx
shrq %cl, %rdx
movq 0x18(%rsp), %rcx
addq %rdx, %rcx
movq %rcx, 0x20(%rsp)
movq 0x70(%rsp), %rcx
movl 0x50(%rcx), %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq 0x20(%rsp), %rcx
subq $0x1, %rdx
andq %rdx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0xb7cd
movq 0x48(%rsp), %rax
movl 0x4(%rax), %eax
movq 0x70(%rsp), %rcx
cmpl 0x68(%rcx), %eax
jbe 0xb421
movq 0x70(%rsp), %rax
cmpl $0x0, 0x6c(%rax)
jne 0xb41c
movq 0x70(%rsp), %rax
movq 0x78(%rax), %rdi
movq 0x70(%rsp), %rax
movq 0x70(%rax), %rax
movq 0x60(%rax), %rax
movq 0x48(%rsp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rsi
movq 0x70(%rsp), %rax
movq 0x70(%rax), %rax
movq 0xe8(%rax), %rax
movl 0x64(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
callq 0xb7e0
movl %eax, %ecx
movq 0x70(%rsp), %rax
movl %ecx, 0x6c(%rax)
jmp 0xb7ba
movq 0x48(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x44(%rsp)
movq 0x70(%rsp), %rax
movq 0x78(%rax), %rdi
movq 0x70(%rsp), %rax
movq 0x70(%rax), %rax
movq 0x60(%rax), %rax
movl 0x44(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rsi
movq 0x70(%rsp), %rax
movq 0x70(%rax), %rax
movq 0xe8(%rax), %rax
movl 0x64(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
callq 0xb7e0
cmpl $0x0, %eax
jne 0xb47c
jmp 0xb7ba
movq 0x70(%rsp), %rax
movl $0x1, 0x6c(%rax)
movl $0x0, 0x2c(%rsp)
movq 0x70(%rsp), %rax
movq 0x48(%rax), %rax
movl 0x44(%rsp), %ecx
movq 0x70(%rsp), %rdx
subl 0x64(%rdx), %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, 0x34(%rsp)
movl 0x64(%rsp), %eax
movl %eax, 0x3c(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x40(%rsp)
movl 0x3c(%rsp), %eax
movl %eax, 0x38(%rsp)
movq 0x48(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x30(%rsp)
movl 0x60(%rsp), %ecx
xorl %eax, %eax
cmpl 0x44(%rsp), %ecx
movb %al, 0x17(%rsp)
jae 0xb547
movl 0x58(%rsp), %ecx
xorl %eax, %eax
cmpl 0x3c(%rsp), %ecx
movb %al, 0x17(%rsp)
jae 0xb547
movq 0x70(%rsp), %rax
movq 0x78(%rax), %rdi
movq 0x70(%rsp), %rax
movq 0x70(%rax), %rax
movq 0x60(%rax), %rax
movl 0x44(%rsp), %ecx
subl $0x1, %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rsi
movq 0x70(%rsp), %rax
movq 0x70(%rax), %rax
movq 0xe8(%rax), %rax
movl 0x3c(%rsp), %ecx
subl $0x1, %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rdx
callq 0xb7e0
cmpl $0x0, %eax
setne %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0xb551
jmp 0xb5cf
movl 0x44(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x44(%rsp)
movl 0x3c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x3c(%rsp)
movl $0x1, %eax
cmpl 0x30(%rsp), %eax
jae 0xb5ca
movl 0x30(%rsp), %eax
movq 0x70(%rsp), %rcx
movq 0x8(%rcx), %rcx
movl 0x44(%rsp), %edx
movq 0x70(%rsp), %rsi
subl 0x64(%rsi), %edx
movl %edx, %edx
movq (%rcx,%rdx,8), %rcx
cmpl 0x4(%rcx), %eax
jae 0xb5a0
movl 0x30(%rsp), %eax
movl %eax, 0x10(%rsp)
jmp 0xb5c2
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x44(%rsp), %ecx
movq 0x70(%rsp), %rdx
subl 0x64(%rdx), %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %eax
movl %eax, 0x10(%rsp)
movl 0x10(%rsp), %eax
movl %eax, 0x30(%rsp)
jmp 0xb4d2
jmp 0xb5d1
movl 0x40(%rsp), %ecx
movl 0x60(%rsp), %edx
addl 0x5c(%rsp), %edx
subl $0x1, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, 0xf(%rsp)
jae 0xb65b
movl 0x38(%rsp), %ecx
movl 0x58(%rsp), %edx
addl 0x80(%rsp), %edx
subl $0x1, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, 0xf(%rsp)
jae 0xb65b
movq 0x70(%rsp), %rax
movq 0x78(%rax), %rdi
movq 0x70(%rsp), %rax
movq 0x70(%rax), %rax
movq 0x60(%rax), %rax
movl 0x40(%rsp), %ecx
addl $0x1, %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rsi
movq 0x70(%rsp), %rax
movq 0x70(%rax), %rax
movq 0xe8(%rax), %rax
movl 0x38(%rsp), %ecx
addl $0x1, %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rdx
callq 0xb7e0
cmpl $0x0, %eax
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0xb665
jmp 0xb6e3
movl 0x40(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x40(%rsp)
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
movl $0x1, %eax
cmpl 0x30(%rsp), %eax
jae 0xb6de
movl 0x30(%rsp), %eax
movq 0x70(%rsp), %rcx
movq 0x8(%rcx), %rcx
movl 0x40(%rsp), %edx
movq 0x70(%rsp), %rsi
subl 0x64(%rsi), %edx
movl %edx, %edx
movq (%rcx,%rdx,8), %rcx
cmpl 0x4(%rcx), %eax
jae 0xb6b4
movl 0x30(%rsp), %eax
movl %eax, 0x8(%rsp)
jmp 0xb6d6
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x40(%rsp), %ecx
movq 0x70(%rsp), %rdx
subl 0x64(%rdx), %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %eax
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0x30(%rsp)
jmp 0xb5d1
movl 0x54(%rsp), %eax
cmpl 0x38(%rsp), %eax
ja 0xb6f8
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
movq 0x68(%rsp), %rax
movl 0x4(%rax), %eax
movq 0x68(%rsp), %rcx
subl (%rcx), %eax
movl 0x40(%rsp), %ecx
subl 0x44(%rsp), %ecx
cmpl %ecx, %eax
jb 0xb721
movl 0x30(%rsp), %eax
movq 0x70(%rsp), %rcx
cmpl 0x68(%rcx), %eax
jae 0xb75c
movl 0x44(%rsp), %ecx
movq 0x68(%rsp), %rax
movl %ecx, (%rax)
movl 0x3c(%rsp), %ecx
movq 0x68(%rsp), %rax
movl %ecx, 0x8(%rax)
movl 0x40(%rsp), %ecx
movq 0x68(%rsp), %rax
movl %ecx, 0x4(%rax)
movl 0x38(%rsp), %ecx
movq 0x68(%rsp), %rax
movl %ecx, 0xc(%rax)
movl 0x30(%rsp), %ecx
movq 0x70(%rsp), %rax
movl %ecx, 0x68(%rax)
cmpl $0x0, 0x34(%rsp)
jne 0xb765
jmp 0xb7b8
jmp 0xb767
movl 0x34(%rsp), %eax
cmpl 0x40(%rsp), %eax
ja 0xb7a2
movq 0x70(%rsp), %rax
movq 0x48(%rax), %rax
movl 0x34(%rsp), %ecx
movq 0x70(%rsp), %rdx
subl 0x64(%rdx), %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, 0x34(%rsp)
cmpl $0x0, 0x34(%rsp)
jne 0xb7a0
movl $0x1, 0x2c(%rsp)
jmp 0xb7a2
jmp 0xb767
cmpl $0x0, 0x2c(%rsp)
je 0xb7ab
jmp 0xb7b8
movl 0x34(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xb488
jmp 0xb7ba
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
jmp 0xb3a0
movl 0x54(%rsp), %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)