// File: /workspace/github_c_makefile_star2_O0/LemonBoy[P]autobahn/xdiff/xpatience.c
// Function: walk_common_sequence
static int walk_common_sequence(struct hashmap *map, struct entry *first,
		int line1, int count1, int line2, int count2)
{
	int end1 = line1 + count1, end2 = line2 + count2;
	int next1, next2;

	for (;;) {
		/* Try to grow the line ranges of common lines */
		if (first) {
			next1 = first->line1;
			next2 = first->line2;
			while (next1 > line1 && next2 > line2 &&
					match(map, next1 - 1, next2 - 1)) {
				next1--;
				next2--;
			}
		} else {
			next1 = end1;
			next2 = end2;
		}
		while (line1 < next1 && line2 < next2 &&
				match(map, line1, line2)) {
			line1++;
			line2++;
		}

		/* Recurse */
		if (next1 > line1 || next2 > line2) {
			struct hashmap submap;

			memset(&submap, 0, sizeof(submap));
			if (patience_diff(map->file1, map->file2,
					map->xpp, map->env,
					line1, next1 - line1,
					line2, next2 - line2))
				return -1;
		}

		if (!first)
			return 0;

		while (first->next &&
				first->next->line1 == first->line1 + 1 &&
				first->next->line2 == first->line2 + 1)
			first = first->next;

		line1 = first->line1 + 1;
		line2 = first->line2 + 1;

		first = first->next;
	}
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x88(%rsp)
movq %rsi, 0x80(%rsp)
movl %edx, 0x7c(%rsp)
movl %ecx, 0x78(%rsp)
movl %r8d, 0x74(%rsp)
movl %r9d, 0x70(%rsp)
movl 0x7c(%rsp), %eax
addl 0x78(%rsp), %eax
movl %eax, 0x6c(%rsp)
movl 0x74(%rsp), %eax
addl 0x70(%rsp), %eax
movl %eax, 0x68(%rsp)
cmpq $0x0, 0x80(%rsp)
je 0x4029
movq 0x80(%rsp), %rax
movq 0x8(%rax), %rax
movl %eax, 0x64(%rsp)
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rax
movl %eax, 0x60(%rsp)
movl 0x64(%rsp), %ecx
xorl %eax, %eax
cmpl 0x7c(%rsp), %ecx
movb %al, 0x17(%rsp)
jle 0x4005
movl 0x60(%rsp), %ecx
xorl %eax, %eax
cmpl 0x74(%rsp), %ecx
movb %al, 0x17(%rsp)
jle 0x4005
movq 0x88(%rsp), %rdi
movl 0x64(%rsp), %esi
subl $0x1, %esi
movl 0x60(%rsp), %edx
subl $0x1, %edx
callq 0x45e0
cmpl $0x0, %eax
setne %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x400f
jmp 0x4027
movl 0x64(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x64(%rsp)
movl 0x60(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x60(%rsp)
jmp 0x3fc0
jmp 0x4039
movl 0x6c(%rsp), %eax
movl %eax, 0x64(%rsp)
movl 0x68(%rsp), %eax
movl %eax, 0x60(%rsp)
jmp 0x403b
movl 0x7c(%rsp), %ecx
xorl %eax, %eax
cmpl 0x64(%rsp), %ecx
movb %al, 0x16(%rsp)
jge 0x407a
movl 0x74(%rsp), %ecx
xorl %eax, %eax
cmpl 0x60(%rsp), %ecx
movb %al, 0x16(%rsp)
jge 0x407a
movq 0x88(%rsp), %rdi
movl 0x7c(%rsp), %esi
movl 0x74(%rsp), %edx
callq 0x45e0
cmpl $0x0, %eax
setne %al
movb %al, 0x16(%rsp)
movb 0x16(%rsp), %al
testb $0x1, %al
jne 0x4084
jmp 0x409c
movl 0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7c(%rsp)
movl 0x74(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x74(%rsp)
jmp 0x403b
movl 0x64(%rsp), %eax
cmpl 0x7c(%rsp), %eax
jg 0x40b4
movl 0x60(%rsp), %eax
cmpl 0x74(%rsp), %eax
jle 0x4135
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x1090
movq 0x88(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x88(%rsp), %rax
movq 0x30(%rax), %rsi
movq 0x88(%rsp), %rax
movq 0x40(%rax), %rdx
movq 0x88(%rsp), %rax
movq 0x38(%rax), %rcx
movl 0x7c(%rsp), %r8d
movl 0x64(%rsp), %r9d
subl 0x7c(%rsp), %r9d
movl 0x74(%rsp), %r10d
movl 0x60(%rsp), %eax
subl 0x74(%rsp), %eax
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x39e0
cmpl $0x0, %eax
je 0x4133
movl $0xffffffff, 0x94(%rsp) # imm = 0xFFFFFFFF
jmp 0x4220
jmp 0x4135
cmpq $0x0, 0x80(%rsp)
jne 0x4150
movl $0x0, 0x94(%rsp)
jmp 0x4220
jmp 0x4152
movq 0x80(%rsp), %rcx
xorl %eax, %eax
cmpq $0x0, 0x18(%rcx)
movb %al, 0x15(%rsp)
je 0x41bc
movq 0x80(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rcx
movq 0x80(%rsp), %rax
movq 0x8(%rax), %rdx
addq $0x1, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0x15(%rsp)
jne 0x41bc
movq 0x80(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movq 0x80(%rsp), %rcx
movq 0x10(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
sete %al
movb %al, 0x15(%rsp)
movb 0x15(%rsp), %al
testb $0x1, %al
jne 0x41c6
jmp 0x41df
movq 0x80(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x80(%rsp)
jmp 0x4152
movq 0x80(%rsp), %rax
movq 0x8(%rax), %rax
addq $0x1, %rax
movl %eax, 0x7c(%rsp)
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rax
addq $0x1, %rax
movl %eax, 0x74(%rsp)
movq 0x80(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x80(%rsp)
jmp 0x3f91
movl 0x94(%rsp), %eax
addq $0x98, %rsp
retq
nop