// File: /workspace/github_c_makefile_star2_O0/nimble-code[P]Uno/Src/uno_bounds.c
// Function: ana_aio_ix
static void
ana_aio_ix(State *s, treenode *tn)
{	treenode	*nn = s->n;
	treenode	*n;
	symentry_t	*v;
	ArBound		*b;
	int		x = -2;

	if (tn->lnode->hdr.type != TN_IDENT	/* basename is not simple */
	||  tn->hdr.type != TN_INDEX)		/* decls are handled elsewhere */
		return;

	if (debug>1)
	{	printf("uno: ana_aio for %s\t(stmnt %s)\tbase:",
			tn->lnode->syment->nme->str, x_stmnt(nn));
		print_recur(tn->lnode, stdout);
		printf("\tindex: ");
		print_recur(tn->rnode, stdout);
		printf("\n");
	}

	size_seen++;
	if (has_node_type(tn->rnode, (int) TN_DEREF))
	{	if (debug>1) printf("	cannot handle\n");
		size_deref++;
		return;
	}

	if (!(n = find_size(tn->lnode->syment, nn)))	/* assign */
	{	if (debug>1) printf("	no bound\n");
		size_notfound++;
		return;
	}

	if (has_node_type(tn->rnode, (int) TN_IDENT))
	{	if (!(v = simple_node_type(tn->rnode)))	/* assignment */
		{	if (debug>1) printf("	not simple\n");
			size_outofscope++;
		} else
		{	size_is_simple++;
			if (debug>1) printf("	simple\n");

			nogood = 0;
			x = eval_const_expr(n, ZT);
			if (nogood)
			{	if (debug>1)
				printf("\tsimple bound, but no simple size\n");
				size_outofscope++;
			} else
			{	simple_checked++;

				if (debug>1)
				{	printf("\tsimple bound for %s\t(stmnt %s)\tbase:",
						tn->lnode->syment->nme->str, x_stmnt(nn));
					print_recur(tn->lnode, stdout);
					printf("\tindex: ");
					print_recur(tn->rnode, stdout);
					printf("\n");
					if (!boundstack->curbounds)
						printf("	no known bounds\n");
				}

				for (b = boundstack->curbounds; b; b = b->nxt)
				{	if (debug>1) explain_bound("Known:", b, nn);
					if (b->s == v && !(b->bounds & UNK))
					{	/* the value of v has to be >= 0 and <= x */
						simple_known++;	/* should equal simple_checked */
						check_bounds(b, x, nn);
						break;
					}
				}
				if (debug>1)
				{	if (!b)
					{	printf("simple check for %s, but no known bound\n", v->nme->str);
						for (b = boundstack->curbounds; b; b = b->nxt)
							explain_bound("knew:", b, nn);
				}	}
			}
		}
	} else
	{	char *p = "";
		x = eval_cond(tn->rnode, n);
		if (x == 1)	/* satisfied */
		{	if (debug>1) printf("	satisfied.\n");
			size_ok++;
			return;
		}
		if (x == -1)	/* equal to bound */
		{	/* likely used to find end of array */
			p ="possible ";
			x = 0;
		}
		if (x == 0)	/* not satisfied */
		{	if (!v_reported(tn))
			{	fprintf(stdout, "uno: %s:%4d %sarray indexing error '%s",
					tn->hdr.fnm,
					tn->hdr.line, p,
					x_stmnt(tn->lnode));
				fprintf(stdout, "[%s]'", x_stmnt(tn->rnode));
				fprintf(stdout, " (array-size: %s)\n", x_stmnt(n));
				size_nok++;
			}
			return;
		} /* else cannot tell */

		if (debug>1) printf("	cannot tell (x=%d)\n", x);

		size_dunno++;
	} /* else cannot tell */
	if (debug>1)
	{	printf("uno: %s:%4d bound-check %s",
			tn->hdr.fnm,
			tn->hdr.line,
			x_stmnt(tn->lnode));
		printf("[ %s", x_stmnt(tn->rnode));
		printf(" < %s ? ]\n", x_stmnt(n));	/* within bound? */
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movl $0xfffffffe, -0x34(%rbp) # imm = 0xFFFFFFFE
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
cmpl $0x2d, 0x1c(%rax)
jne 0x2bfed
movq -0x10(%rbp), %rax
cmpl $0x24, 0x1c(%rax)
je 0x2bff2
jmp 0x2c590
cmpl $0x1, 0x6ab5f(%rip)     # 0x96b58
jle 0x2c07f
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4ec0
movq -0x48(%rbp), %rsi
movq %rax, %rdx
leaq 0x1a715(%rip), %rdi     # 0x46743
movb $0x0, %al
callq 0x30f0
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
movq 0x21f8c(%rip), %rax     # 0x4dfd0
movq (%rax), %rsi
callq 0x1f900
leaq 0x1a715(%rip), %rdi     # 0x46768
movb $0x0, %al
callq 0x30f0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq 0x21f67(%rip), %rax     # 0x4dfd0
movq (%rax), %rsi
callq 0x1f900
leaq 0x186c7(%rip), %rdi     # 0x4473f
movb $0x0, %al
callq 0x30f0
movl 0x6aa8b(%rip), %eax     # 0x96b10
addl $0x1, %eax
movl %eax, 0x6aa82(%rip)     # 0x96b10
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movl $0x26, %esi
callq 0x2b460
cmpl $0x0, %eax
je 0x2c0d0
cmpl $0x1, 0x6aaac(%rip)     # 0x96b58
jle 0x2c0bc
leaq 0x1a6bc(%rip), %rdi     # 0x46771
movb $0x0, %al
callq 0x30f0
movl 0x6aa5a(%rip), %eax     # 0x96b1c
addl $0x1, %eax
movl %eax, 0x6aa51(%rip)     # 0x96b1c
jmp 0x2c590
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x38(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x2d020
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x2c11a
cmpl $0x1, 0x6aa62(%rip)     # 0x96b58
jle 0x2c106
leaq 0x1a682(%rip), %rdi     # 0x46781
movb $0x0, %al
callq 0x30f0
movl 0x6aa08(%rip), %eax     # 0x96b14
addl $0x1, %eax
movl %eax, 0x6a9ff(%rip)     # 0x96b14
jmp 0x2c590
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movl $0x2d, %esi
callq 0x2b460
cmpl $0x0, %eax
je 0x2c392
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x2d1e0
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x2c177
cmpl $0x1, 0x6aa05(%rip)     # 0x96b58
jle 0x2c163
leaq 0x1a630(%rip), %rdi     # 0x4678c
movb $0x0, %al
callq 0x30f0
movl 0x6a9b7(%rip), %eax     # 0x96b20
addl $0x1, %eax
movl %eax, 0x6a9ae(%rip)     # 0x96b20
jmp 0x2c38d
movl 0x6a9bb(%rip), %eax     # 0x96b38
addl $0x1, %eax
movl %eax, 0x6a9b2(%rip)     # 0x96b38
cmpl $0x1, 0x6a9cb(%rip)     # 0x96b58
jle 0x2c19d
leaq 0x1a603(%rip), %rdi     # 0x46799
movb $0x0, %al
callq 0x30f0
movl $0x0, 0x6a951(%rip)     # 0x96af8
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2b4f0
movl %eax, -0x34(%rbp)
cmpl $0x0, 0x6a93a(%rip)     # 0x96af8
je 0x2c1eb
cmpl $0x1, 0x6a991(%rip)     # 0x96b58
jle 0x2c1d7
leaq 0x1a5d2(%rip), %rdi     # 0x467a2
movb $0x0, %al
callq 0x30f0
movl 0x6a943(%rip), %eax     # 0x96b20
addl $0x1, %eax
movl %eax, 0x6a93a(%rip)     # 0x96b20
jmp 0x2c38b
movl 0x6a937(%rip), %eax     # 0x96b28
addl $0x1, %eax
movl %eax, 0x6a92e(%rip)     # 0x96b28
cmpl $0x1, 0x6a957(%rip)     # 0x96b58
jle 0x2c2a4
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4ec0
movq -0x50(%rbp), %rsi
movq %rax, %rdx
leaq 0x1a58f(%rip), %rdi     # 0x467c5
movb $0x0, %al
callq 0x30f0
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
movq 0x21d84(%rip), %rax     # 0x4dfd0
movq (%rax), %rsi
callq 0x1f900
leaq 0x1a50d(%rip), %rdi     # 0x46768
movb $0x0, %al
callq 0x30f0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq 0x21d5f(%rip), %rax     # 0x4dfd0
movq (%rax), %rsi
callq 0x1f900
leaq 0x184bf(%rip), %rdi     # 0x4473f
movb $0x0, %al
callq 0x30f0
movq 0x6a8da(%rip), %rax     # 0x96b68
cmpq $0x0, (%rax)
jne 0x2c2a2
leaq 0x1a550(%rip), %rdi     # 0x467eb
movb $0x0, %al
callq 0x30f0
jmp 0x2c2a4
movq 0x6a8bd(%rip), %rax     # 0x96b68
movq (%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x2c324
cmpl $0x1, 0x6a898(%rip)     # 0x96b58
jle 0x2c2d6
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x1a52c(%rip), %rdi     # 0x467fd
callq 0x2b960
movq -0x30(%rbp), %rax
movq (%rax), %rax
cmpq -0x28(%rbp), %rax
jne 0x2c314
movq -0x30(%rbp), %rax
movswl 0x18(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x2c314
movl 0x6a833(%rip), %eax     # 0x96b2c
addl $0x1, %eax
movl %eax, 0x6a82a(%rip)     # 0x96b2c
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x2e830
jmp 0x2c324
jmp 0x2c316
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x2c2b2
cmpl $0x1, 0x6a82d(%rip)     # 0x96b58
jle 0x2c389
cmpq $0x0, -0x30(%rbp)
jne 0x2c387
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0x1a4bd(%rip), %rdi     # 0x46804
movb $0x0, %al
callq 0x30f0
movq 0x6a813(%rip), %rax     # 0x96b68
movq (%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x2c385
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x1a4bb(%rip), %rdi     # 0x4682d
callq 0x2b960
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x2c35c
jmp 0x2c387
jmp 0x2c389
jmp 0x2c38b
jmp 0x2c38d
jmp 0x2c508
leaq 0x8a1c(%rip), %rax      # 0x34db5
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x2d220
movl %eax, -0x34(%rbp)
cmpl $0x1, -0x34(%rbp)
jne 0x2c3e2
cmpl $0x1, 0x6a79a(%rip)     # 0x96b58
jle 0x2c3ce
leaq 0x1a46c(%rip), %rdi     # 0x46833
movb $0x0, %al
callq 0x30f0
movl 0x6a75c(%rip), %eax     # 0x96b30
addl $0x1, %eax
movl %eax, 0x6a753(%rip)     # 0x96b30
jmp 0x2c590
cmpl $-0x1, -0x34(%rbp)
jne 0x2c3fa
leaq 0x1a451(%rip), %rax     # 0x46840
movq %rax, -0x40(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x2c4df
movq -0x10(%rbp), %rdi
callq 0x2b8f0
cmpl $0x0, %eax
jne 0x2c4da
movq 0x21bb3(%rip), %rax     # 0x4dfd0
movq (%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x4ec0
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rdx
movl -0x6c(%rbp), %ecx
movq -0x68(%rbp), %r8
movq %rax, %r9
leaq 0x1a3e2(%rip), %rsi     # 0x4684a
movb $0x0, %al
callq 0x3170
movq 0x21b5a(%rip), %rax     # 0x4dfd0
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x4ec0
movq -0x60(%rbp), %rdi
movq %rax, %rdx
leaq 0x1a3d9(%rip), %rsi     # 0x46871
movb $0x0, %al
callq 0x3170
movq 0x21b2a(%rip), %rax     # 0x4dfd0
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4ec0
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x1a3b3(%rip), %rsi     # 0x46877
movb $0x0, %al
callq 0x3170
movl 0x6a663(%rip), %eax     # 0x96b34
addl $0x1, %eax
movl %eax, 0x6a65a(%rip)     # 0x96b34
jmp 0x2c590
cmpl $0x1, 0x6a672(%rip)     # 0x96b58
jle 0x2c4f9
movl -0x34(%rbp), %esi
leaq 0x1a398(%rip), %rdi     # 0x4688a
movb $0x0, %al
callq 0x30f0
movl 0x6a625(%rip), %eax     # 0x96b24
addl $0x1, %eax
movl %eax, 0x6a61c(%rip)     # 0x96b24
cmpl $0x1, 0x6a649(%rip)     # 0x96b58
jle 0x2c590
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x84(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x4ec0
movq -0x90(%rbp), %rsi
movl -0x84(%rbp), %edx
movq %rax, %rcx
leaq 0x1a34e(%rip), %rdi     # 0x4689f
movb $0x0, %al
callq 0x30f0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x4ec0
movq %rax, %rsi
leaq 0x1a34b(%rip), %rdi     # 0x468ba
movb $0x0, %al
callq 0x30f0
movq -0x20(%rbp), %rdi
callq 0x4ec0
movq %rax, %rsi
leaq 0x1a336(%rip), %rdi     # 0x468bf
movb $0x0, %al
callq 0x30f0
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)