// File: /workspace/github_c_makefile_star2_O0/nimble-code[P]Uno/Src/uno_intervals.c
// Function: check_bounds
int
check_bounds(ArBound *b, int x, treenode *nn)	/* is bound within interval 0..x-1 ? */
{	char buf[512];
	int result = 1;

	if (b->bounds & DUP)
	{	if (!b->dup)
		{	if (debug>1) printf("dup not set\n");
			return 1;
		}
		b = b->dup;	/* one step only */
	}

	if (unsatisfiable(b))
	{	if (debug) explain_bound("unsatisfiable", b, nn);
		return 1;	/* no run can get here, so this is no error */
	}
	if (!(b->bounds&NEG))
	{	if ((b->bounds&LB) && b->lb < 0)
		{	result = 0;
			sprintf(buf, "array index can be negative (%d)", b->lb);
		}
		if ((b->bounds&UB) && b->ub > x)
		{	result = 0;
			sprintf(buf, "array index can exceed upper-bound (%d>%d), var",
				b->ub-1, x-1);
		}
	} else
	{	result = 0;
		uno_assert((b->bounds & UB) && (b->bounds & LB), "negated non-interval");
		if (b->lb == b->ub - 1)
		{	sprintf(buf, "array index can be unequal to %d", b->lb);
			if (debug)
				printf("	dubious: <%s>\n", buf);
			result = 1;	/* dubious report */
		} else
			sprintf(buf, "array index can be <%d or >=%d", b->lb, b->ub);
	}

	if (result == 0)
	{	size_nok++;
		if (nn)
			uno_warn(buf, nn, b->s);
		else if (debug)
			printf("<<%s>>\n", buf);
	}  else
	{	size_ok++;
		if (debug>1) printf(" satisfied..\n");
	}

	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x1, -0x224(%rbp)
movq -0x10(%rbp), %rax
movswl 0x18(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x2e89a
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x2e88e
cmpl $0x1, 0x6830e(%rip)     # 0x96b80
jle 0x2e882
leaq 0x18337(%rip), %rdi     # 0x46bb2
movb $0x0, %al
callq 0x30f0
movl $0x1, -0x4(%rbp)
jmp 0x2eadc
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2e450
cmpl $0x0, %eax
je 0x2e8d1
cmpl $0x0, 0x682d1(%rip)     # 0x96b80
je 0x2e8c5
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq 0x18043(%rip), %rdi     # 0x46903
callq 0x2b960
movl $0x1, -0x4(%rbp)
jmp 0x2eadc
movq -0x10(%rbp), %rax
movswl 0x18(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x2e975
movq -0x10(%rbp), %rax
movswl 0x18(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x2e925
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jge 0x2e925
movl $0x0, -0x224(%rbp)
leaq -0x220(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x20(%rax), %edx
leaq 0x182a1(%rip), %rsi     # 0x46bbf
movb $0x0, %al
callq 0x3220
movq -0x10(%rbp), %rax
movswl 0x18(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2e970
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
cmpl -0x14(%rbp), %eax
jle 0x2e970
movl $0x0, -0x224(%rbp)
leaq -0x220(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %edx
subl $0x1, %edx
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
leaq 0x18277(%rip), %rsi     # 0x46be0
movb $0x0, %al
callq 0x3220
jmp 0x2ea45
movl $0x0, -0x224(%rbp)
movq -0x10(%rbp), %rax
movswl 0x18(%rax), %ecx
andl $0x1, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x225(%rbp)
je 0x2e9ae
movq -0x10(%rbp), %rax
movswl 0x18(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x225(%rbp)
movb -0x225(%rbp), %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x18250(%rip), %rsi     # 0x46c10
callq 0x1fde0
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movq -0x10(%rbp), %rcx
movl 0x1c(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x2ea20
leaq -0x220(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x20(%rax), %edx
leaq 0x18236(%rip), %rsi     # 0x46c25
movb $0x0, %al
callq 0x3220
cmpl $0x0, 0x68183(%rip)     # 0x96b80
je 0x2ea14
leaq -0x220(%rbp), %rsi
leaq 0x18239(%rip), %rdi     # 0x46c46
movb $0x0, %al
callq 0x30f0
movl $0x1, -0x224(%rbp)
jmp 0x2ea43
leaq -0x220(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x20(%rax), %edx
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %ecx
leaq 0x1821a(%rip), %rsi     # 0x46c56
movb $0x0, %al
callq 0x3220
jmp 0x2ea45
cmpl $0x0, -0x224(%rbp)
jne 0x2eaa5
leaq 0x680df(%rip), %rax     # 0x96b34
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x680d3(%rip), %rax     # 0x96b34
movl %ecx, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x2ea83
leaq -0x220(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
callq 0x1fe80
jmp 0x2eaa3
cmpl $0x0, 0x680f6(%rip)     # 0x96b80
je 0x2eaa1
leaq -0x220(%rbp), %rsi
leaq 0x1207e(%rip), %rdi     # 0x40b18
movb $0x0, %al
callq 0x30f0
jmp 0x2eaa3
jmp 0x2ead3
leaq 0x68084(%rip), %rax     # 0x96b30
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x68078(%rip), %rax     # 0x96b30
movl %ecx, (%rax)
cmpl $0x1, 0x680bf(%rip)     # 0x96b80
jle 0x2ead1
leaq 0x181ab(%rip), %rdi     # 0x46c75
movb $0x0, %al
callq 0x30f0
jmp 0x2ead3
movl -0x224(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopl (%rax,%rax)