// File: /workspace/github_c_makefile_star2_O2/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 $0xc8, %rsp
movq %r9, %rbx
movq %rdx, %r14
movq 0x108(%rsp), %r10
movq 0x100(%rsp), %r12
movq 0x8(%rdi), %rax
movq %rax, (%rsp)
movq 0x8(%rcx), %r9
cmpq %r14, %rsi
jge 0x12b5
cmpq %rbx, %r8
jge 0x12b5
movq (%rsp), %rax
movq (%rax,%rsi,8), %rax
cmpq (%r9,%r8,8), %rax
jne 0x12b5
incq %rsi
incq %r8
jmp 0x128f
decq %r14
decq %rbx
cmpq %r14, %rsi
jge 0x12cf
cmpq %rbx, %r8
jge 0x12cf
movq (%rsp), %rax
movq -0x8(%rax,%r14,8), %rax
cmpq -0x8(%r9,%rbx,8), %rax
je 0x12af
cmpq %r14, %rsi
jne 0x12f2
movq 0x10(%rcx), %rax
movq 0x18(%rcx), %rcx
cmpq %rbx, %r8
jge 0x1926
movq (%rax,%r8,8), %rdx
movb $0x1, (%rcx,%rdx)
incq %r8
jmp 0x12dc
cmpq %rbx, %r8
jne 0x1315
movq 0x10(%rdi), %rax
movq 0x18(%rdi), %rcx
cmpq %r14, %rsi
jge 0x1926
movq (%rax,%rsi,8), %rdx
movb $0x1, (%rcx,%rdx)
incq %rsi
jmp 0x12ff
movq %rsi, %r11
subq %rbx, %r11
movq %r14, %rax
subq %r8, %rax
movq %rax, 0xa0(%rsp)
movq %rsi, %r13
subq %r8, %r13
movq %r14, %rbp
subq %rbx, %rbp
movq %r13, %rax
subq %rbp, %rax
movq %rax, 0xa8(%rsp)
movq %rsi, (%r12,%r13,8)
movq %r14, (%r10,%rbp,8)
leaq (%rsi,%r8), %rax
movq %rax, 0x98(%rsp)
leaq (%r14,%rbx), %rax
movq %rax, 0x90(%rsp)
leaq -0x8(%r9), %rax
movq %rax, 0x80(%rsp)
movq (%rsp), %rax
leaq -0x8(%rax), %rax
movq %rax, 0xb0(%rsp)
pushq $0x1
popq %rax
movq %rax, 0x58(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x50(%rsp)
movq %r13, %rdx
movq %r13, 0x60(%rsp)
movq %r13, 0x38(%rsp)
movq %rbp, 0x20(%rsp)
movq %rbp, 0xc0(%rsp)
movq %rbp, 0x40(%rsp)
movq %rcx, 0x8(%rsp)
movq %rdi, 0xb8(%rsp)
movq %r9, 0x10(%rsp)
movq %r11, 0x88(%rsp)
movq %rsi, 0x68(%rsp)
cmpq %r11, %rdx
jle 0x13e7
orq $-0x1, -0x10(%r12,%rdx,8)
decq %rdx
jmp 0x13ea
incq %rdx
movq 0x38(%rsp), %r13
cmpq 0xa0(%rsp), %r13
jge 0x1404
orq $-0x1, 0x10(%r12,%r13,8)
incq %r13
jmp 0x1407
decq %r13
movq %r13, %r15
negq %r15
leaq (,%r13,8), %rax
movq %r9, %rsi
subq %rax, %rsi
negq %rax
movq %rax, 0x18(%rsp)
xorl %r9d, %r9d
movq %r13, 0x38(%rsp)
pushq $0x1
popq %rdi
movq %rdx, 0x28(%rsp)
cmpq %rdx, %r13
jl 0x14ee
movl %r9d, %r11d
movq %r10, %rdx
movq -0x8(%r12,%r13,8), %rcx
movq %r12, %r10
movq 0x8(%r12,%r13,8), %rdi
leaq 0x1(%rcx), %rax
cmpq %rdi, %rcx
cmovlq %rdi, %rax
movq (%rsp), %rcx
leaq (%rcx,%rax,8), %r9
movq %r15, 0x48(%rsp)
addq %rax, %r15
leaq (%rsi,%rax,8), %rcx
xorl %edi, %edi
leaq (%rax,%rdi), %rbp
cmpq %r14, %rbp
jge 0x1491
leaq (%r15,%rdi), %r12
cmpq %rbx, %r12
jge 0x1491
movq (%r9,%rdi,8), %r12
cmpq (%rcx,%rdi,8), %r12
jne 0x1491
incq %rdi
jmp 0x1470
movq 0x118(%rsp), %r15
cmpq 0x8(%r15), %rdi
pushq $0x1
popq %rdi
movl %r11d, %r9d
cmovgl %edi, %r9d
movq %r10, %r12
movq %rbp, (%r10,%r13,8)
testb $0x1, 0xa8(%rsp)
movq %rdx, %r10
je 0x14d3
cmpq %r13, 0x20(%rsp)
jg 0x14d3
cmpq 0x40(%rsp), %r13
jg 0x14d3
cmpq %rbp, (%r10,%r13,8)
jle 0x1894
addq $-0x2, %r13
movq 0x48(%rsp), %r15
addq $0x2, %r15
addq $0x10, %rsi
movq 0x28(%rsp), %rdx
jmp 0x1433
movq 0x20(%rsp), %rcx
cmpq 0x88(%rsp), %rcx
jle 0x1511
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, -0x10(%r10,%rcx,8)
decq %rcx
jmp 0x1514
incq %rcx
movq %rcx, 0x20(%rsp)
movq 0x68(%rsp), %rsi
movq 0x40(%rsp), %r13
cmpq 0xa0(%rsp), %r13
jge 0x1541
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, 0x10(%r10,%r13,8)
incq %r13
jmp 0x1544
decq %r13
movq %r13, %rdx
negq %rdx
leaq (,%r13,8), %rax
movq 0x80(%rsp), %r11
subq %rax, %r11
negq %rax
movq %rax, 0x78(%rsp)
movq %r13, 0x40(%rsp)
cmpq 0x20(%rsp), %r13
jl 0x15ff
movl %r9d, %r15d
movq -0x8(%r10,%r13,8), %rax
movq 0x8(%r10,%r13,8), %rcx
leaq -0x1(%rcx), %rbp
cmpq %rcx, %rax
cmovlq %rax, %rbp
xorl %r9d, %r9d
leaq (%rdx,%rbp), %rax
cmpq %rsi, %rbp
jle 0x15b5
cmpq %r8, %rax
jle 0x15b5
movq (%rsp), %rcx
movq -0x8(%rcx,%rbp,8), %rcx
cmpq (%r11,%rbp,8), %rcx
jne 0x15b5
decq %rbp
incq %r9
jmp 0x1590
movq 0x118(%rsp), %rcx
cmpq 0x8(%rcx), %r9
movl %r15d, %r9d
cmovgl %edi, %r9d
movq %rbp, (%r10,%r13,8)
testb $0x1, 0xa8(%rsp)
jne 0x15ee
cmpq %r13, 0x28(%rsp)
jg 0x15ee
cmpq 0x38(%rsp), %r13
jg 0x15ee
cmpq (%r12,%r13,8), %rbp
jle 0x18b1
addq $-0x2, %r13
addq $0x2, %rdx
addq $0x10, %r11
jmp 0x156a
cmpl $0x0, 0x110(%rsp)
je 0x161d
movq 0x10(%rsp), %r9
movq 0x28(%rsp), %rdx
movq 0x58(%rsp), %rax
jmp 0x187f
testl %r9d, %r9d
movq 0x10(%rsp), %r9
movq 0x28(%rsp), %rdx
movq 0x118(%rsp), %r15
je 0x1871
movq 0x58(%rsp), %rax
cmpq 0x10(%r15), %rax
jle 0x1871
movq %r12, %rbp
leaq (,%rax,4), %rax
movq %rax, 0x48(%rsp)
movq 0x18(%rsp), %rax
addq 0x80(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %r12
movq $0x0, 0x70(%rsp)
movq 0x60(%rsp), %r9
cmpq %rdx, %r12
jl 0x1748
movq %r12, %rax
subq %r9, %rax
negq %rax
movq %r12, %rdx
subq %r9, %rdx
cmovgq %rax, %rdx
movq (%rbp,%r12,8), %r11
movq %r11, %r13
subq %r12, %r13
subq 0x98(%rsp), %rdx
addq %r11, %rdx
addq %r13, %rdx
cmpq 0x48(%rsp), %rdx
setg %al
cmpq 0x70(%rsp), %rdx
setg %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x1734
cmpq %rbx, %r13
jge 0x1734
cmpq %r14, %r11
jge 0x1734
movq 0x8(%r15), %rax
leaq (%rax,%rsi), %rcx
cmpq %r11, %rcx
jg 0x1734
leaq (%rax,%r8), %rcx
cmpq %r13, %rcx
jg 0x1734
negq %rax
movq 0x18(%rsp), %rcx
leaq (%rcx,%r11,8), %rcx
movq 0xb0(%rsp), %rdi
leaq (%rdi,%r11,8), %rdi
xorl %r9d, %r9d
movq (%rdi,%r9,8), %r15
cmpq (%rcx,%r9,8), %r15
jne 0x1724
decq %r9
cmpq %r9, %rax
jne 0x1703
movq %r13, 0x30(%rsp)
movq %r11, 0x50(%rsp)
movq %rdx, 0x70(%rsp)
movq 0x118(%rsp), %r15
pushq $0x1
popq %rdi
movq 0x60(%rsp), %r9
addq $-0x2, %r12
addq $0x10, 0x18(%rsp)
movq 0x28(%rsp), %rdx
jmp 0x167c
cmpq $0x0, 0x70(%rsp)
jg 0x1a33
movq 0x10(%rsp), %r9
addq %r9, 0x78(%rsp)
movq 0x40(%rsp), %r12
movq $0x0, 0x18(%rsp)
movq 0x8(%rsp), %r13
cmpq 0x20(%rsp), %r12
jl 0x1862
movq %r12, %rax
movq 0xc0(%rsp), %rcx
subq %rcx, %rax
negq %rax
movq %r12, %rdx
subq %rcx, %rdx
cmovgq %rax, %rdx
movq (%r10,%r12,8), %r11
cmpq %rsi, %r11
jle 0x184e
movq %r11, %r13
subq %r12, %r13
addq 0x90(%rsp), %rdx
subq %r11, %rdx
subq %r13, %rdx
cmpq 0x48(%rsp), %rdx
jle 0x1844
cmpq 0x18(%rsp), %rdx
jle 0x1844
movq 0x8(%r15), %rax
movq %r14, %rcx
subq %rax, %rcx
cmpq %rcx, %r11
setg %cl
cmpq %r8, %r13
setle %dil
movq %rbx, %r9
subq %rax, %r9
cmpq %r9, %r13
setg %r9b
orb %cl, %r9b
orb %dil, %r9b
je 0x17fd
movq 0x8(%rsp), %r13
jmp 0x183f
movq (%rsp), %rcx
leaq (%rcx,%r11,8), %rcx
movq 0x78(%rsp), %rdi
leaq (%rdi,%r11,8), %rdi
xorl %r9d, %r9d
movq (%rcx,%r9,8), %r15
cmpq (%rdi,%r9,8), %r15
jne 0x1832
incq %r9
cmpq %r9, %rax
jne 0x1811
movq %r13, 0x30(%rsp)
movq %r11, 0x50(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x8(%rsp), %r13
movq 0x118(%rsp), %r15
pushq $0x1
popq %rdi
jmp 0x1849
movq 0x8(%rsp), %r13
movq 0x10(%rsp), %r9
addq $-0x2, %r12
addq $0x10, 0x78(%rsp)
movq 0x28(%rsp), %rdx
jmp 0x1771
cmpq $0x0, 0x18(%rsp)
jg 0x1a55
movq %rbp, %r12
movq 0x58(%rsp), %rax
cmpq (%r15), %rax
jge 0x193f
incq %rax
movq %rax, 0x58(%rsp)
movq 0x88(%rsp), %r11
jmp 0x13d7
movq 0x48(%rsp), %r9
addq %rbp, %r9
movl %edi, %eax
movq %rax, (%rsp)
movq 0x8(%rsp), %rcx
movq %rdi, %rax
movq 0x68(%rsp), %rsi
jmp 0x18c2
movl %edi, %ecx
movq %rcx, (%rsp)
movq %rax, %r9
movq 0x8(%rsp), %rcx
movq %rdi, %rax
movq %r9, 0x30(%rsp)
movq 0xb8(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rdx
movq 0x118(%rsp), %r15
pushq %r15
pushq %rax
pushq %r10
pushq %r12
movq %r10, %r15
callq 0x125c
addq $0x20, %rsp
testl %eax, %eax
js 0x193a
movq %r13, %rdi
movq %rbp, %rsi
movq %r14, %rdx
movq 0x8(%rsp), %rcx
movq 0x30(%rsp), %r8
movq %rbx, %r9
pushq 0x118(%rsp)
pushq 0x8(%rsp)
pushq %r15
pushq %r12
callq 0x125c
addq $0x20, %rsp
testl %eax, %eax
js 0x193a
xorl %eax, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rax
jmp 0x1928
movq 0x38(%rsp), %r13
movq %r13, %rcx
negq %rcx
pushq $-0x1
popq %r9
movq %r9, %rbp
movabsq $0x7fffffffffffffff, %r11 # imm = 0x7FFFFFFFFFFFFFFF
movq 0x20(%rsp), %r15
movq 0x40(%rsp), %rdi
cmpq %rdx, %r13
jl 0x19a7
movq (%r12,%r13,8), %rax
cmpq %r14, %rax
cmovgeq %r14, %rax
addq %rcx, %rax
cmpq %rax, %rbx
cmovlq %rbx, %rax
leaq (,%rax,2), %rdx
addq %r13, %rdx
addq %r13, %rax
cmpq %rdx, %r9
cmovleq %rdx, %r9
movq 0x28(%rsp), %rdx
cmovlq %rax, %rbp
addq $-0x2, %r13
addq $0x2, %rcx
jmp 0x1965
movq %rdi, %rdx
negq %rdx
movq %r11, %rcx
cmpq %r15, %rdi
jl 0x19ec
movq (%r10,%rdi,8), %rax
cmpq %rsi, %rax
cmovleq %rsi, %rax
addq %rdx, %rax
cmpq %rax, %r8
cmovgq %r8, %rax
movq %rdi, %r13
leaq (%rdi,%rax,2), %rdi
addq %r13, %rax
cmpq %r11, %rdi
cmovlq %rdi, %r11
movq %r13, %rdi
cmovlq %rax, %rcx
addq $-0x2, %rdi
addq $0x2, %rdx
jmp 0x19b0
movq 0x90(%rsp), %rdx
subq %r11, %rdx
movq %r9, %rax
subq 0x98(%rsp), %rax
cmpq %rax, %rdx
jge 0x1a17
subq %rbp, %r9
movq $0x0, (%rsp)
pushq $0x1
popq %rax
jmp 0x1a29
subq %rcx, %r11
pushq $0x1
popq %rax
movq %rax, (%rsp)
xorl %eax, %eax
movq %r11, %r9
movq %rcx, %rbp
movq 0x8(%rsp), %rcx
jmp 0x18c2
movq $0x0, (%rsp)
movq %rbp, %r12
movq 0x8(%rsp), %rcx
movq 0x30(%rsp), %r9
movq %rdi, %rax
movq 0x50(%rsp), %rbp
jmp 0x18c2
movq %rdi, (%rsp)
xorl %eax, %eax
movq %rbp, %r12
movq 0x30(%rsp), %r9
movq 0x50(%rsp), %rbp
movq %r13, %rcx
jmp 0x18c2