// File: /workspace/github_c_makefile_star2_O0/nimble-code[P]Uno/Src/uno_lts.c
// Function: covered
static int
covered(State *s, SymRef *gr)
{	SymRef *r, *q, *lq;
	int cnt = 0;
#if 0
	this check secures coverage of global variables use only
	we are interested in U or R before D errors
	so the presence or absence of a DEF (1) on any gvar is important
	and determines its uniqueness
	we do not care about combinations of variables - just if
	individual variables have been seen with certain flags
#endif

	/* 1: each var in gr must have appeared in at least one
	 *    previous visit with the same DEF status, as recorded
	 *    in a list s->gi stored at state s for this purpose
	 */
	if (!gr)
	{	if (!s->seenempty)
		{	s->seenempty = 1;
			cnt++;
		}
		goto done;
	}

	if (!(s->gi))	/* first visit */
	{	s->gi = copy_list(gr);	/* seed initial visit list */
		s->il = copy_list(gr);	/* seed intersection list */
		cnt++;
		goto done;
	} else
	for (r = gr; r; r = r->nxt)		/* each var in gr (dfstack->globrefs) */
	{	for (q = s->gi; q; q = q->nxt)	/* see if already covered in s->gi */
			if (q->sm == r->sm
			&&  (r->status & DEF) == (q->status & DEF))
				break;
		if (!q)	/* not covered yet */
		{	q = uno_copy_ref(r);
			q->nxt = s->gi;
			s->gi = q;
			cnt++;
	}	}

	/* 2: each var absent from gr
		must have been absent in at least one previous visit
		i.e., must be absent from the intersection list
	 */
	lq = (SymRef *) 0;
	for (r = s->il; r; r = r->nxt)
	{	if (!in_lst(gr, r))	/* should drop r from il */
		{	if (!lq)
				s->il = r->nxt;
			else
				lq->nxt = r->nxt;
			cnt++;
		} else
			lq = r;		/* good, it's there */
	}
done:
	if (debug)
	{	printf("Covered %s:\n", (cnt==0)?"yes":"no");
		for (r = gr; r; r = r->nxt)
			printf("	%s	%d\n", r->sm->nme->str, r->status);
		printf("GI:\n");
		for (r = s->gi; r; r = r->nxt)
			printf("	%s	%d\n", r->sm->nme->str, r->status);
		printf("IL:\n");
		for (r = s->il; r; r = r->nxt)
			printf("	%s	%d\n", r->sm->nme->str, r->status);
	}

	return (cnt == 0);	/* true if nothing needed adding */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x2c(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x25711
movq -0x8(%rbp), %rax
cmpw $0x0, 0x30(%rax)
jne 0x2570c
movq -0x8(%rbp), %rax
movw $0x1, 0x30(%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2587b
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x25752
movq -0x10(%rbp), %rdi
callq 0x25dd0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
callq 0x25dd0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2587b
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x257fe
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x257b2
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jne 0x257a2
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x1, %eax
movq -0x20(%rbp), %rcx
movl 0x10(%rcx), %ecx
andl $0x1, %ecx
cmpl %ecx, %eax
jne 0x257a2
jmp 0x257b2
jmp 0x257a4
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x25771
cmpq $0x0, -0x20(%rbp)
jne 0x257eb
movq -0x18(%rbp), %rdi
callq 0x204c0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x257ed
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x2575a
jmp 0x25800
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x25879
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x25e60
cmpl $0x0, %eax
jne 0x25861
cmpq $0x0, -0x28(%rbp)
jne 0x25846
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x25856
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x25869
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x2586b
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x25814
jmp 0x2587b
cmpl $0x0, 0x6074e(%rip)     # 0x85fd0
je 0x25997
movl -0x2c(%rbp), %ecx
leaq 0x1fbb1(%rip), %rsi     # 0x45443
leaq 0x1fcb9(%rip), %rax     # 0x45552
cmpl $0x0, %ecx
cmoveq %rax, %rsi
leaq 0x1fd0b(%rip), %rdi     # 0x455b2
movb $0x0, %al
callq 0x30f0
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x258ef
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %edx
leaq 0x1fbbc(%rip), %rdi     # 0x45496
movb $0x0, %al
callq 0x30f0
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x258b6
leaq 0x1fc60(%rip), %rdi     # 0x45556
movb $0x0, %al
callq 0x30f0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x25942
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %edx
leaq 0x1fb69(%rip), %rdi     # 0x45496
movb $0x0, %al
callq 0x30f0
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x25909
leaq 0x1fc12(%rip), %rdi     # 0x4555b
movb $0x0, %al
callq 0x30f0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x25995
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %edx
leaq 0x1fb16(%rip), %rdi     # 0x45496
movb $0x0, %al
callq 0x30f0
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x2595c
jmp 0x25997
cmpl $0x0, -0x2c(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)