// File: /workspace/github_c_makefile_star2_O0/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 %r14
pushq %rbx
subq $0xb8, %rsp
movq 0xe8(%rsp), %rax
movl 0xe0(%rsp), %eax
movq 0xd8(%rsp), %rax
movq 0xd0(%rsp), %rax
movq %rdi, 0xa8(%rsp)
movq %rsi, 0xa0(%rsp)
movq %rdx, 0x98(%rsp)
movq %rcx, 0x90(%rsp)
movq %r8, 0x88(%rsp)
movq %r9, 0x80(%rsp)
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x78(%rsp)
movq 0x90(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x70(%rsp)
movq 0xa0(%rsp), %rcx
xorl %eax, %eax
cmpq 0x98(%rsp), %rcx
movb %al, 0x37(%rsp)
jge 0x1324
movq 0x88(%rsp), %rcx
xorl %eax, %eax
cmpq 0x80(%rsp), %rcx
movb %al, 0x37(%rsp)
jge 0x1324
movq 0x78(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x70(%rsp), %rcx
movq 0x88(%rsp), %rdx
cmpq (%rcx,%rdx,8), %rax
sete %al
movb %al, 0x37(%rsp)
movb 0x37(%rsp), %al
testb $0x1, %al
jne 0x132e
jmp 0x135d
jmp 0x1330
movq 0xa0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xa0(%rsp)
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
jmp 0x12cb
jmp 0x135f
movq 0xa0(%rsp), %rcx
xorl %eax, %eax
cmpq 0x98(%rsp), %rcx
movb %al, 0x36(%rsp)
jge 0x13c0
movq 0x88(%rsp), %rcx
xorl %eax, %eax
cmpq 0x80(%rsp), %rcx
movb %al, 0x36(%rsp)
jge 0x13c0
movq 0x78(%rsp), %rax
movq 0x98(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movq 0x70(%rsp), %rcx
movq 0x80(%rsp), %rdx
subq $0x1, %rdx
cmpq (%rcx,%rdx,8), %rax
sete %al
movb %al, 0x36(%rsp)
movb 0x36(%rsp), %al
testb $0x1, %al
jne 0x13ca
jmp 0x13f9
jmp 0x13cc
movq 0x98(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x98(%rsp)
movq 0x80(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x80(%rsp)
jmp 0x135f
movq 0xa0(%rsp), %rax
cmpq 0x98(%rsp), %rax
jne 0x1474
movq 0x90(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x68(%rsp)
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x60(%rsp)
movq 0x88(%rsp), %rax
cmpq 0x80(%rsp), %rax
jge 0x146f
movq 0x68(%rsp), %rax
movq 0x60(%rsp), %rcx
movq 0x88(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movb $0x1, (%rax,%rcx)
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
jmp 0x142d
jmp 0x165c
movq 0x88(%rsp), %rax
cmpq 0x80(%rsp), %rax
jne 0x14ef
movq 0xa8(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0xa0(%rsp), %rax
cmpq 0x98(%rsp), %rax
jge 0x14ea
movq 0x58(%rsp), %rax
movq 0x50(%rsp), %rcx
movq 0xa0(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movb $0x1, (%rax,%rcx)
movq 0xa0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xa0(%rsp)
jmp 0x14a8
jmp 0x165a
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x78(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq 0x70(%rsp), %rcx
movq 0x88(%rsp), %r8
movq 0x80(%rsp), %r9
movq 0xd0(%rsp), %r14
movq 0xd8(%rsp), %rbx
movl 0xe0(%rsp), %r11d
movq 0xe8(%rsp), %rax
leaq 0x38(%rsp), %r10
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movl %r11d, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x1680
cmpq $0x0, %rax
jge 0x1583
movl $0xffffffff, 0xb4(%rsp) # imm = 0xFFFFFFFF
jmp 0x1667
movq 0xa8(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x90(%rsp), %rcx
movq 0x88(%rsp), %r8
movq 0x40(%rsp), %r9
movq 0xd0(%rsp), %rbx
movq 0xd8(%rsp), %r11
movl 0x48(%rsp), %r10d
movq 0xe8(%rsp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x1250
cmpl $0x0, %eax
jl 0x164b
movq 0xa8(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq 0x90(%rsp), %rcx
movq 0x40(%rsp), %r8
movq 0x80(%rsp), %r9
movq 0xd0(%rsp), %rbx
movq 0xd8(%rsp), %r11
movl 0x4c(%rsp), %r10d
movq 0xe8(%rsp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x1250
cmpl $0x0, %eax
jge 0x1658
movl $0xffffffff, 0xb4(%rsp) # imm = 0xFFFFFFFF
jmp 0x1667
jmp 0x165a
jmp 0x165c
movl $0x0, 0xb4(%rsp)
movl 0xb4(%rsp), %eax
addq $0xb8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)