// File: /workspace/github_c_makefile_star2_O0/nimble-code[P]Uno/Src/uno_lts.c
// Function: prep_graph
static void
prep_graph(Graphs *g)
{	State *s;
	Trans *t;
	int cnt;

	curgraph = g;

	for (s = g->all; s; s = s->all)
	{	s->visited = 0;
		if (!s->succ)
		{	if (s->n)
			{	if (s->n->hdr.tok == RETURN)
					continue;

				if (killpath(s->n))	/* non-returning fct called */
					continue;
			}

			if (s->n
			&&  s->n->hdr.tok != GOTO
			&&  s->n->hdr.tok != COLON
			&& !s->nxt
			&&  (!s->n->hdr.fnm || strcmp(s->n->hdr.fnm, "-1") != 0))
			{	g->status |= 2;	/* no value returned */

				if (0) printf("no value returned at %s:%d: -- %s = %d\n",
					s->n->hdr.fnm, s->n->hdr.line,
					toksym(s->n->hdr.tok,0),
					s->n->hdr.tok);
				if (debug)
				printf("prepgraph %s adds 2 <%d:%d> %s:%d\n",
					g->fctnm,
					(int) s->n->hdr.type,
					s->n->hdr.tok,
					s->n->hdr.fnm,
					s->n->hdr.line);
			}

			t = get_trans();
			t->branch = lts_redirect(s->nxt);
			t->nxt = (Trans *) 0;
			s->succ = t;
		} else
		{	cnt = 0;
			for (t = s->succ; t; t = t->nxt)
			{	t->branch = lts_redirect(t->branch);
				cnt++;
			}
			s->iscond = (cnt > 1);

			/* find cases like "if (c);" */
			if (picky == 1
			&&  s->n
			&&  suppress(s->n->hdr.fnm, s->n->hdr.line) == 0
			&&  cnt == 2
			&&  s->n->hdr.type == TN_IF
			&&  s->succ->branch == s->succ->nxt->branch)
				printf("uno: %s:%d: in fct %s, 'if' followed by null-statement\n",
					s->n->hdr.fnm, s->n->hdr.line, curgraph->fctnm);
	}	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, 0x64e81(%rip)     # 0x85fa8
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x213a0
movq -0x10(%rbp), %rax
movw $0x0, 0x4a(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jne 0x21294
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2118e
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x120, 0x18(%rax)      # imm = 0x120
jne 0x21176
jmp 0x2138f
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x23e50
cmpl $0x0, %eax
je 0x2118c
jmp 0x2138f
jmp 0x2118e
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x21256
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x11c, 0x18(%rax)      # imm = 0x11C
je 0x21256
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x14e, 0x18(%rax)      # imm = 0x14E
je 0x21256
movq -0x10(%rbp), %rax
cmpq $0x0, 0x60(%rax)
jne 0x21256
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpq $0x0, 0x8(%rax)
je 0x211fd
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x23ee4(%rip), %rsi     # 0x450d7
callq 0x3160
cmpl $0x0, %eax
je 0x21256
movq -0x8(%rbp), %rax
movswl 0x42(%rax), %ecx
orl $0x2, %ecx
movw %cx, 0x42(%rax)
cmpl $0x0, 0x64dbd(%rip)     # 0x85fd0
je 0x21254
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x1c(%rax), %edx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x18(%rax), %ecx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %r8
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x10(%rax), %r9d
leaq 0x240ab(%rip), %rdi     # 0x452f8
movb $0x0, %al
callq 0x30f0
jmp 0x21256
callq 0x23020
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0x23f90
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x50(%rax)
jmp 0x2138d
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x212dd
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x23f90
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x212a7
cmpl $0x1, -0x1c(%rbp)
setg %al
andb $0x1, %al
movzbl %al, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x48(%rax)
leaq 0x2d0a5(%rip), %rax     # 0x4e3a0
cmpl $0x1, (%rax)
jne 0x2138b
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2138b
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x10(%rax), %esi
callq 0x1fd20
cmpl $0x0, %eax
jne 0x2138b
cmpl $0x2, -0x1c(%rbp)
jne 0x2138b
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x1b, 0x1c(%rax)
jne 0x2138b
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x50(%rcx), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x10(%rcx), %rax
jne 0x2138b
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x10(%rax), %edx
movq 0x64c2e(%rip), %rax     # 0x85fa8
movq (%rax), %rcx
leaq 0x23f97(%rip), %rdi     # 0x4531b
movb $0x0, %al
callq 0x30f0
jmp 0x2138d
jmp 0x2138f
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x21133
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)