// File: /workspace/github_c_makefile_star2_O2/nimble-code[P]Uno/Src/uno_intervals.c
// Function: merge_bounds
int
merge_bounds(ArBound *a, ArBound *b)	/* rewrite a as (a/\b)  FIX! */
{	/* returns 1 if nothing   changed */
	/* returns 0 if something changed */

	if (debug>1)
	{	printf("merge_bounds\n");
		explain_bound("a:", a, ZT);
		explain_bound("b:", b, ZT);
	}
	uno_assert(!(a->bounds & UNK), "merging unknown a");
	uno_assert(!(b->bounds & UNK), "merging unknown b");
	uno_assert(!(b->bounds & DUP), "merging dup b");

	if (a->bounds & DUP)
	{	if (debug>1) printf("	a was dup, now unknown\n");
		a->bounds |= UNK;	/* fixable dups were resolved before we got here */
		return 0;
	}

	if (first_inside_second(a, b))
	{	if (debug>1) printf("	a inside b\n");
		return 1;
	}
	if (first_inside_second(b, a))
	{	if (debug>1) printf("	b inside a\n");
		copy_bound(a, b);
		return 0;
	}

	and_bounds(a, b);

	if (debug>1)
	{	printf("result of AND:\n");
		explain_bound("a:", a, ZT);
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movzwl 0x18(%rdi), %eax
xorl %edi, %edi
testb $0x4, %al
sete %dil
leaq 0x15193(%rip), %rsi     # 0x2eed7
callq 0x1225f
movzwl 0x18(%r14), %eax
xorl %edi, %edi
testb $0x4, %al
sete %dil
leaq 0x1518c(%rip), %rsi     # 0x2eee9
callq 0x1225f
movzwl 0x18(%r14), %eax
xorl %edi, %edi
testb $0x20, %al
sete %dil
leaq 0x15185(%rip), %rsi     # 0x2eefb
callq 0x1225f
movzwl 0x18(%rbx), %eax
testb $0x20, %al
jne 0x19d97
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19a79
testl %eax, %eax
je 0x19da8
pushq $0x1
popq %rax
jmp 0x19da0
orl $0x4, %eax
movw %ax, 0x18(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
movq %rbx, %rsi
callq 0x19a79
testl %eax, %eax
je 0x19dd9
movups (%r14), %xmm0
movups %xmm0, (%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
movzwl 0x18(%r14), %eax
movw %ax, 0x18(%rbx)
movq 0x1c(%r14), %rax
movq %rax, 0x1c(%rbx)
jmp 0x19d9e
movq %rbx, %rdi
callq 0x19b14
movq %r14, %rdi
callq 0x19b14
movzwl 0x18(%rbx), %eax
movzwl %ax, %ecx
testb $0x40, %cl
jne 0x19e5a
movzwl 0x18(%r14), %edx
testb $0x40, %dl
jne 0x19e5a
andl %edx, %ecx
testb $0x1, %cl
je 0x19e12
movl 0x1c(%r14), %ecx
cmpl 0x1c(%rbx), %ecx
jge 0x19e12
movl %ecx, 0x1c(%rbx)
movl %eax, %ecx
andl %edx, %ecx
testb $0x2, %cl
je 0x19e27
movl 0x20(%r14), %ecx
cmpl 0x20(%rbx), %ecx
jle 0x19e27
movl %ecx, 0x20(%rbx)
testb $0x1, %al
jne 0x19e3e
andl $0x1, %edx
je 0x19e3e
orl $0x1, %eax
movw %ax, 0x18(%rbx)
movl 0x1c(%r14), %ecx
movl %ecx, 0x1c(%rbx)
testb $0x2, %al
jne 0x19f85
testb $0x2, 0x18(%r14)
je 0x19f85
orl $0x2, %eax
movl 0x20(%r14), %ecx
jmp 0x19ed4
testb $0x40, %al
je 0x19e65
testb $0x40, 0x18(%r14)
jne 0x19ebb
testb $0x40, %cl
jne 0x19e71
testb $0x40, 0x18(%r14)
jne 0x19edc
testb $0x40, %al
je 0x19f85
testb $0x40, 0x18(%r14)
jne 0x19f85
andl $-0x41, %ecx
movw %cx, 0x18(%rbx)
movl 0x18(%r14), %eax
notl %eax
testb $0x3, %al
jne 0x19f1a
movl 0x20(%r14), %eax
cmpl 0x20(%rbx), %eax
jge 0x19f4c
movl 0x1c(%r14), %edx
cmpl 0x1c(%rbx), %edx
jle 0x19f55
orl $0x4, %ecx
jmp 0x19f83
movl 0x1c(%r14), %ecx
cmpl 0x1c(%rbx), %ecx
jle 0x19ec7
movl %ecx, 0x1c(%rbx)
movl 0x20(%r14), %ecx
cmpl 0x20(%rbx), %ecx
jge 0x19f85
movl %ecx, 0x20(%rbx)
jmp 0x19f85
movl %ecx, %edx
notl %edx
testb $0x3, %dl
jne 0x19f01
movl 0x1c(%rbx), %esi
movl 0x1c(%r14), %ecx
movl 0x20(%r14), %edx
cmpl %edx, 0x20(%rbx)
jge 0x19f33
cmpl %ecx, %esi
jg 0x19f47
movl %edx, 0x1c(%rbx)
jmp 0x19f85
testb $0x1, %cl
jne 0x19f3e
testb $0x2, %cl
je 0x19f85
movl 0x20(%rbx), %ecx
cmpl 0x20(%r14), %ecx
jl 0x19f47
movl 0x1c(%r14), %ecx
jmp 0x19ed4
testb $0x1, %cl
jne 0x19f5a
testb $0x2, %cl
je 0x19f83
movl 0x20(%rbx), %eax
cmpl 0x20(%r14), %eax
jl 0x19f63
movl 0x1c(%r14), %eax
jmp 0x19f55
cmpl %ecx, %esi
jg 0x19ed4
andq $0x0, 0x1c(%rbx)
jmp 0x19f85
movl 0x1c(%rbx), %ecx
cmpl 0x1c(%r14), %ecx
jle 0x19f6c
orl $0x4, %eax
jmp 0x19f85
movl 0x1c(%r14), %eax
cmpl %eax, 0x1c(%rbx)
jle 0x19f75
movl %eax, 0x20(%rbx)
jmp 0x19f83
movl 0x1c(%rbx), %eax
cmpl 0x1c(%r14), %eax
jle 0x19f7c
orl $0x4, %ecx
movw %cx, 0x18(%rbx)
jmp 0x19f83
movl 0x20(%r14), %ecx
movl %ecx, 0x1c(%rbx)
jmp 0x19f85
andq $0x0, 0x1c(%rbx)
jmp 0x19f83
movl 0x20(%r14), %eax
movl %eax, 0x1c(%rbx)
movl %ecx, %eax
andl $0xffe7, %eax           # imm = 0xFFE7
movw %ax, 0x18(%rbx)
movq %rbx, %rdi
callq 0x19b14
jmp 0x19d9e
nop