// File: /workspace/github_c_makefile_star2_O1/LemonBoy[P]autobahn/xdiff/xdiffi.c
// Function: xdl_recs_cmp
int xdl_recs_cmp(diffdata_t *dd1, long off1, long lim1,
		 diffdata_t *dd2, long off2, long lim2,
		 long *kvdf, long *kvdb, int need_min, xdalgoenv_t *xenv) {
	unsigned long const *ha1 = dd1->ha, *ha2 = dd2->ha;

	/*
	 * Shrink the box by walking through each diagonal snake (SW and NE).
	 */
	for (; off1 < lim1 && off2 < lim2 && ha1[off1] == ha2[off2]; off1++, off2++);
	for (; off1 < lim1 && off2 < lim2 && ha1[lim1 - 1] == ha2[lim2 - 1]; lim1--, lim2--);

	/*
	 * If one dimension is empty, then all records on the other one must
	 * be obviously changed.
	 */
	if (off1 == lim1) {
		char *rchg2 = dd2->rchg;
		long *rindex2 = dd2->rindex;

		for (; off2 < lim2; off2++)
			rchg2[rindex2[off2]] = 1;
	} else if (off2 == lim2) {
		char *rchg1 = dd1->rchg;
		long *rindex1 = dd1->rindex;

		for (; off1 < lim1; off1++)
			rchg1[rindex1[off1]] = 1;
	} else {
		xdpsplit_t spl;
		spl.i1 = spl.i2 = 0;

		/*
		 * Divide ...
		 */
		if (xdl_split(ha1, off1, lim1, ha2, off2, lim2, kvdf, kvdb,
			      need_min, &spl, xenv) < 0) {

			return -1;
		}

		/*
		 * ... et Impera.
		 */
		if (xdl_recs_cmp(dd1, off1, spl.i1, dd2, off2, spl.i2,
				 kvdf, kvdb, spl.min_lo, xenv) < 0 ||
		    xdl_recs_cmp(dd1, spl.i1, lim1, dd2, spl.i2, lim2,
				 kvdf, kvdb, spl.min_hi, xenv) < 0) {

			return -1;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %r9, %rbx
movq %rdx, %r14
movq %rdi, 0x70(%rsp)
movq 0x8(%rdi), %rax
movq %rcx, 0x78(%rsp)
movq 0x8(%rcx), %rcx
movq %rcx, 0x30(%rsp)
cmpq %rdx, %rsi
setge %cl
cmpq %r9, %r8
setge %dl
orb %cl, %dl
jne 0x13c9
movq 0x30(%rsp), %rdx
movq (%rax,%rsi,8), %rcx
cmpq (%rdx,%r8,8), %rcx
jne 0x13c9
incq %rsi
incq %r8
cmpq %r14, %rsi
jge 0x13c9
cmpq %rbx, %r8
jl 0x13af
cmpq %r14, %rsi
setl %cl
cmpq %rbx, %r8
setl %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x13fd
movq 0x30(%rsp), %rdx
movq -0x8(%rax,%r14,8), %rcx
cmpq -0x8(%rdx,%rbx,8), %rcx
jne 0x13fd
decq %r14
decq %rbx
cmpq %r14, %rsi
jge 0x13fd
cmpq %rbx, %r8
jl 0x13e1
cmpq %r14, %rsi
jne 0x142f
xorl %eax, %eax
cmpq %rbx, %r8
jge 0x1d35
movq 0x78(%rsp), %rdx
movq 0x10(%rdx), %rcx
movq 0x18(%rdx), %rdx
movq (%rcx,%r8,8), %rsi
movb $0x1, (%rdx,%rsi)
incq %r8
cmpq %r8, %rbx
jne 0x141a
jmp 0x1d35
cmpq %rbx, %r8
jne 0x1461
xorl %eax, %eax
cmpq %r14, %rsi
jge 0x1d35
movq 0x70(%rsp), %rdx
movq 0x10(%rdx), %rcx
movq 0x18(%rdx), %rdx
movq (%rcx,%rsi,8), %rdi
movb $0x1, (%rdx,%rdi)
incq %rsi
cmpq %rsi, %r14
jne 0x144c
jmp 0x1d35
movq 0x118(%rsp), %rbp
movq 0x110(%rsp), %r11
movq %rsi, %rcx
subq %rbx, %rcx
movq %rcx, 0xa0(%rsp)
movq %r14, %rcx
subq %r8, %rcx
movq %rcx, 0x98(%rsp)
movq %rsi, %rdx
subq %r8, %rdx
movq %r14, %rdi
subq %rbx, %rdi
movq %rdx, %rcx
subq %rdi, %rcx
movq %rcx, 0xa8(%rsp)
movq %rsi, (%r11,%rdx,8)
movq %r14, (%rbp,%rdi,8)
leaq (%rsi,%r8), %rcx
movq %rcx, 0x90(%rsp)
leaq (%r14,%rbx), %rcx
movq %rcx, 0x88(%rsp)
movq 0x30(%rsp), %rcx
leaq -0x8(%rcx), %r9
movq %r9, 0xc0(%rsp)
leaq -0x10(%rcx), %rcx
movq %rcx, 0xb0(%rsp)
leaq -0x10(%rax), %rcx
movq %rcx, 0xb8(%rsp)
movl $0x1, %r9d
movq $0x0, 0x10(%rsp)
movq %rcx, 0x20(%rsp)
movq %rcx, 0x28(%rsp)
movq $0x0, 0x8(%rsp)
movq %rdx, %r15
movq %rdx, 0xd0(%rsp)
movq %rdi, 0x40(%rsp)
movq %rdi, 0xc8(%rsp)
movq %rdi, 0x38(%rsp)
cmpq 0xa0(%rsp), %r15
jle 0x1548
movq $-0x1, -0x10(%r11,%r15,8)
decq %r15
jmp 0x154b
incq %r15
cmpq 0x98(%rsp), %rdx
movq %r9, 0x18(%rsp)
jge 0x1568
movq $-0x1, 0x10(%r11,%rdx,8)
incq %rdx
jmp 0x156b
decq %rdx
xorl %r10d, %r10d
movq %r15, (%rsp)
movq %rdx, 0x58(%rsp)
cmpq %r15, %rdx
jl 0x1660
movq 0x58(%rsp), %r15
movq %r15, %r9
negq %r9
leaq (,%r15,8), %rcx
movq 0x30(%rsp), %rdx
subq %rcx, %rdx
xorl %r10d, %r10d
movq -0x8(%r11,%r15,8), %rcx
movq 0x8(%r11,%r15,8), %rdi
leaq 0x1(%rcx), %rbp
cmpq %rdi, %rcx
cmovlq %rdi, %rbp
movq %rbp, %r12
subq %r15, %r12
movq %rbp, %r13
cmpq %r14, %rbp
jge 0x1600
cmpq %rbx, %r12
jge 0x1600
movq %rbp, %r11
movq (%rax,%r11,8), %rcx
cmpq (%rdx,%r11,8), %rcx
jne 0x15f1
leaq 0x1(%r11), %r13
cmpq %r14, %r13
jge 0x15eb
leaq (%r11,%r9), %rcx
incq %rcx
movq %r13, %r11
cmpq %rbx, %rcx
jl 0x15c9
leaq (%r9,%r13), %r12
jmp 0x15f8
leaq (%r9,%r11), %r12
movq %r11, %r13
movq 0x110(%rsp), %r11
movq %r13, %rcx
subq %rbp, %rcx
movq 0x128(%rsp), %rdi
cmpq 0x8(%rdi), %rcx
movl $0x1, %ecx
cmovgl %ecx, %r10d
movq %r13, (%r11,%r15,8)
testb $0x1, 0xa8(%rsp)
movq 0x118(%rsp), %rbp
je 0x164a
cmpq %r15, 0x40(%rsp)
jg 0x164a
cmpq 0x38(%rsp), %r15
jg 0x164a
cmpq %r13, (%rbp,%r15,8)
jle 0x17b7
addq $-0x2, %r15
addq $0x2, %r9
addq $0x10, %rdx
cmpq (%rsp), %r15
jge 0x159e
movq 0x40(%rsp), %rdx
cmpq 0xa0(%rsp), %rdx
jle 0x1683
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
movq %rcx, -0x10(%rbp,%rdx,8)
decq %rdx
jmp 0x1686
incq %rdx
movq 0x38(%rsp), %r15
cmpq 0x98(%rsp), %r15
jge 0x16a9
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
movq %rcx, 0x10(%rbp,%r15,8)
incq %r15
jmp 0x16ac
decq %r15
movq %rdx, 0x40(%rsp)
cmpq %rdx, %r15
movq %r15, 0x38(%rsp)
jl 0x1797
movq %r15, %r9
negq %r9
leaq (,%r15,8), %rcx
movq 0xc0(%rsp), %rdx
subq %rcx, %rdx
movq -0x8(%rbp,%r15,8), %rcx
movq 0x8(%rbp,%r15,8), %rdi
leaq -0x1(%rdi), %rbp
cmpq %rdi, %rcx
cmovlq %rcx, %rbp
movq %rbp, %r12
subq %r15, %r12
movq %rbp, %r13
cmpq %rsi, %rbp
jle 0x173b
cmpq %r8, %r12
jle 0x173b
movq %rbp, %r11
movq -0x8(%rax,%r11,8), %rcx
cmpq (%rdx,%r11,8), %rcx
jne 0x172c
leaq -0x1(%r11), %r13
cmpq %rsi, %r13
jle 0x1726
leaq (%r11,%r9), %rcx
decq %rcx
movq %r13, %r11
cmpq %r8, %rcx
jg 0x1703
leaq (%r9,%r13), %r12
jmp 0x1733
leaq (%r9,%r11), %r12
movq %r11, %r13
movq 0x110(%rsp), %r11
subq %r13, %rbp
movq 0x128(%rsp), %rcx
cmpq 0x8(%rcx), %rbp
movl $0x1, %ecx
cmovgl %ecx, %r10d
movq 0x118(%rsp), %rbp
movq %r13, (%rbp,%r15,8)
cmpq 0x58(%rsp), %r15
jg 0x1780
movq 0xa8(%rsp), %rcx
andl $0x1, %ecx
jne 0x1780
cmpq %r15, (%rsp)
jg 0x1780
cmpq (%r11,%r15,8), %r13
jle 0x17b7
addq $-0x2, %r15
addq $0x2, %r9
addq $0x10, %rdx
cmpq 0x40(%rsp), %r15
jge 0x16d8
movl $0x4, %edx
cmpl $0x0, 0x120(%rsp)
je 0x17fe
movq 0x10(%rsp), %r12
movq 0x8(%rsp), %r13
movq 0x18(%rsp), %r9
jmp 0x17da
movl $0x1, %ecx
movq %rcx, 0x20(%rsp)
movl $0x1, %ecx
movq %rcx, 0x28(%rsp)
movq 0x18(%rsp), %r9
movq %r9, 0x48(%rsp)
movl $0x1, %edx
movq (%rsp), %r15
testb $0x3, %dl
jne 0x1cc0
incq %r9
movq %r12, 0x10(%rsp)
movq %r13, 0x8(%rsp)
movq 0x58(%rsp), %rdx
jmp 0x1530
testl %r10d, %r10d
movq 0x18(%rsp), %r9
movq (%rsp), %r15
je 0x1837
movq 0x128(%rsp), %rcx
cmpq 0x10(%rcx), %r9
jle 0x1837
movq 0x58(%rsp), %rdx
cmpq %r15, %rdx
jge 0x1985
movq 0x10(%rsp), %r12
movq 0x8(%rsp), %r13
jmp 0x1b22
movq 0x10(%rsp), %r12
movq 0x8(%rsp), %r13
movq 0x128(%rsp), %rcx
cmpq (%rcx), %r9
jge 0x1852
xorl %edx, %edx
jmp 0x17de
movq $-0x1, %r12
movq $-0x1, %r13
cmpq %r15, 0x58(%rsp)
jl 0x18b0
movq 0x58(%rsp), %r9
movq %r9, %rdx
negq %rdx
movq $-0x1, %r10
movq (%r11,%r9,8), %rcx
cmpq %r14, %rcx
cmovgeq %r14, %rcx
addq %rdx, %rcx
cmpq %rcx, %rbx
cmovlq %rbx, %rcx
leaq (%r9,%rcx,2), %r12
addq %r9, %rcx
cmpq %r12, %r10
cmovgq %r10, %r12
cmovlq %rcx, %r13
addq $-0x2, %r9
addq $0x2, %rdx
movq %r12, %r10
cmpq %r15, %r9
jge 0x1879
movabsq $0x7fffffffffffffff, %rdx # imm = 0x7FFFFFFFFFFFFFFF
movq %rdx, %r9
movq 0x40(%rsp), %r11
cmpq %r11, 0x38(%rsp)
jl 0x1916
movq 0x38(%rsp), %r15
movq %r15, %r10
negq %r10
movabsq $0x7fffffffffffffff, %r9 # imm = 0x7FFFFFFFFFFFFFFF
movq %r9, %rdx
movq (%rbp,%r15,8), %rcx
cmpq %rsi, %rcx
cmovleq %rsi, %rcx
addq %r10, %rcx
cmpq %rcx, %r8
cmovgq %r8, %rcx
leaq (%r15,%rcx,2), %rdi
addq %r15, %rcx
cmpq %r9, %rdi
cmovlq %rdi, %r9
cmovlq %rcx, %rdx
addq $-0x2, %r15
addq $0x2, %r10
cmpq %r11, %r15
jge 0x18e1
movq 0x88(%rsp), %rcx
subq %r9, %rcx
movq %r12, %rdi
subq 0x90(%rsp), %rdi
cmpq %rdi, %rcx
jge 0x1949
subq %r13, %r12
movl $0x1, %ecx
movq %rcx, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
jmp 0x1965
subq %rdx, %r9
movq $0x0, 0x28(%rsp)
movl $0x1, %ecx
movq %rcx, 0x20(%rsp)
movq %r9, %r12
movq %rdx, %r13
movq 0x18(%rsp), %r9
movq %r9, 0x48(%rsp)
movl $0x1, %edx
movq (%rsp), %r15
movq 0x110(%rsp), %r11
jmp 0x17de
leaq (,%r9,4), %r10
leaq (,%rdx,8), %rcx
movq 0xb0(%rsp), %r12
subq %rcx, %r12
xorl %r13d, %r13d
movq %rdx, %rbp
movq %r10, 0x68(%rsp)
movq %rbp, %rcx
movq 0xd0(%rsp), %rdx
subq %rdx, %rcx
negq %rcx
movq %rbp, %rdi
subq %rdx, %rdi
cmovgq %rcx, %rdi
movq (%r11,%rbp,8), %rdx
movq %rdx, %r9
subq %rbp, %r9
movq %rdx, %r15
subq 0x90(%rsp), %r15
addq %rdi, %r15
addq %r9, %r15
cmpq %r10, %r15
setg %cl
cmpq %r13, %r15
setg %dil
andb %cl, %dil
cmpb $0x1, %dil
jne 0x1ab8
cmpq %rbx, %r9
jge 0x1ab8
cmpq %r14, %rdx
jge 0x1ab8
movq 0x128(%rsp), %rcx
movq 0x8(%rcx), %r11
leaq (%r11,%rsi), %rcx
cmpq %rdx, %rcx
jg 0x1a8f
leaq (%r11,%r8), %rcx
cmpq %r9, %rcx
jg 0x1a8f
movq -0x8(%rax,%rdx,8), %rcx
movq 0x30(%rsp), %rdi
cmpq -0x8(%rdi,%r9,8), %rcx
jne 0x1a8f
movq %r13, 0x50(%rsp)
movq %r12, 0x60(%rsp)
leaq (%r12,%rdx,8), %r12
movq 0xb8(%rsp), %rcx
leaq (%rcx,%rdx,8), %r10
movl $0x1, %edi
subq %r11, %rdi
xorl %ecx, %ecx
cmpq %rcx, %rdi
je 0x1a99
movq (%r10,%rcx,8), %r11
leaq -0x1(%rcx), %r13
cmpq (%r12,%rcx,8), %r11
movq %r13, %rcx
je 0x1a60
movq 0x110(%rsp), %r11
movq 0x68(%rsp), %r10
movq 0x60(%rsp), %r12
movq 0x50(%rsp), %r13
jmp 0x1ab8
movq 0x110(%rsp), %r11
jmp 0x1ab8
movq %r9, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %r15, %r13
movq 0x110(%rsp), %r11
movq 0x68(%rsp), %r10
movq 0x60(%rsp), %r12
addq $-0x2, %rbp
addq $0x10, %r12
movq (%rsp), %r15
cmpq %r15, %rbp
jge 0x19ab
testq %r13, %r13
jle 0x1b0b
movl $0x1, %ecx
movq %rcx, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x10(%rsp), %r12
movq 0x8(%rsp), %r13
movq 0x18(%rsp), %r9
movq %r9, 0x48(%rsp)
movl $0x1, %edx
movq 0x118(%rsp), %rbp
jmp 0x17de
movq 0x10(%rsp), %r12
movq 0x8(%rsp), %r13
movq 0x118(%rsp), %rbp
movq 0x18(%rsp), %r9
movq 0x38(%rsp), %rdx
cmpq 0x40(%rsp), %rdx
jl 0x1841
leaq (,%r9,4), %rcx
movq %rcx, 0x68(%rsp)
leaq (,%rdx,8), %rcx
movq 0x30(%rsp), %r10
subq %rcx, %r10
movq $0x0, 0x80(%rsp)
movq %rdx, %r9
movq %r9, %rcx
movq 0xc8(%rsp), %rdi
subq %rdi, %rcx
negq %rcx
movq %r9, %rdx
subq %rdi, %rdx
cmovgq %rcx, %rdx
movq (%rbp,%r9,8), %rcx
cmpq %rsi, %rcx
jle 0x1c7c
movq %rcx, %rbp
subq %r9, %rbp
addq 0x88(%rsp), %rdx
movq %rcx, 0x60(%rsp)
addq %rbp, %rcx
subq %rcx, %rdx
cmpq 0x68(%rsp), %rdx
jle 0x1c4d
cmpq 0x80(%rsp), %rdx
jle 0x1c4d
movq %r10, 0x50(%rsp)
movq 0x128(%rsp), %rcx
movq 0x8(%rcx), %r11
movq %r14, %rcx
subq %r11, %rcx
movq 0x60(%rsp), %r15
cmpq %rcx, %r15
setg %cl
cmpq %r8, %rbp
setle %dil
movq %rbx, %r10
subq %r11, %r10
cmpq %r10, %rbp
setg %r10b
orb %cl, %r10b
orb %dil, %r10b
jne 0x1c67
movq (%rax,%r15,8), %rcx
movq 0x30(%rsp), %rdi
cmpq (%rdi,%rbp,8), %rcx
movq 0x50(%rsp), %r10
jne 0x1c45
leaq (%rax,%r15,8), %rcx
movq %rcx, 0x10(%rsp)
leaq (%r10,%r15,8), %rcx
movq %rcx, 0x8(%rsp)
movl $0x1, %r10d
cmpq %r10, %r11
je 0x1c57
movq 0x10(%rsp), %rcx
movq (%rcx,%r10,8), %rdi
leaq 0x1(%r10), %rcx
movq 0x8(%rsp), %r15
cmpq (%r15,%r10,8), %rdi
movq %rcx, %r10
je 0x1c23
jmp 0x1c67
movq 0x110(%rsp), %r11
movq 0x118(%rsp), %rbp
jmp 0x1c7c
movq %rbp, %r12
movq 0x60(%rsp), %r13
movq %rdx, 0x80(%rsp)
movq 0x110(%rsp), %r11
movq 0x118(%rsp), %rbp
movq 0x50(%rsp), %r10
addq $-0x2, %r9
addq $0x10, %r10
cmpq 0x40(%rsp), %r9
jge 0x1b5e
cmpq $0x0, 0x80(%rsp)
jle 0x1cb2
movq $0x0, 0x28(%rsp)
movl $0x1, %ecx
movq %rcx, 0x20(%rsp)
jmp 0x17cb
movq 0x18(%rsp), %r9
movq (%rsp), %r15
jmp 0x1841
cmpq $0x0, 0x48(%rsp)
js 0x1d30
movq 0x70(%rsp), %rdi
movq %r13, %rdx
movq 0x78(%rsp), %rcx
movq %r12, %r9
pushq 0x128(%rsp)
pushq 0x30(%rsp)
pushq %rbp
pushq %r11
callq 0x136c
movq 0x130(%rsp), %r10
addq $0x20, %rsp
testl %eax, %eax
js 0x1d30
movq 0x70(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rdx
movq 0x78(%rsp), %rcx
movq %r12, %r8
movq %rbx, %r9
pushq 0x128(%rsp)
pushq 0x28(%rsp)
pushq %rbp
pushq %r10
callq 0x136c
addq $0x20, %rsp
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jns 0x1d35
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq