// File: /workspace/github_c_makefile_star2_O0/nimble-code[P]Uno/Src/uno_lts.c
// Function: lts_if
static State *
lts_if(State *n, if_node *ifn)
{	State *now = n;

	if (!ifn) return now;

	if (ifn->hdr.tok == QUESTMARK)		/* cond?then:else */
	{	lts_tree(NS, ifn->cond);
		lts_tree(NS, ifn->then_n);
		lts_tree(NS, ifn->else_n);
	} else					/* if-then-else */
	{	State *ts, *es;
		Trans *tr;
		leafnode *ln;
		treenode *tn;
		treenode *tg;

		if (now->n->hdr.which != IF_T)
		{	fprintf(stderr, "\nuno: expected if (got %s)\n",
				name_of_nodetype(now->n->hdr.which));
		}
#if 0
		now->n = ifn->cond;	/* the condition */
#endif
		ts = create_state(curgraph);
		ts->n = ifn->then_n;
		es = create_state(curgraph);
		es->n = ifn->else_n;

		tr = get_trans();
		tr->cond = mk_bool("_true_");
		tr->branch = ts;
		tr->nxt = get_trans();
		tr->nxt->cond = mk_bool("_false_");
		tr->nxt->branch = es;

		now->succ = tr;

		ts = lts_tree(ts, ts->n);
		es = lts_tree(es, es->n);

		ln = mk_ident();
		tn = mk_goto_node(ln);
		tg = mk_label_node(ln, (treenode *) ifn, "if");

		if (!ifn->else_n)
			es->n = tn;
		else
			lts_tree(es, tn);

		now = lts_tree(ts, tg);
	}
	return now;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x225ac
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2277a
movq -0x18(%rbp), %rax
cmpl $0x14d, 0x18(%rax)      # imm = 0x14D
jne 0x225fa
movq 0x63a98(%rip), %rdi     # 0x86058
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x21040
movq 0x63a84(%rip), %rdi     # 0x86058
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0x21040
movq 0x63a70(%rip), %rdi     # 0x86058
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
callq 0x21040
jmp 0x22772
movq -0x20(%rbp), %rax
movq (%rax), %rax
cmpl $0x2, (%rax)
je 0x22637
movq 0x2b9eb(%rip), %rax     # 0x4dff8
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl (%rax), %edi
callq 0x7ff0
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x22b62(%rip), %rsi     # 0x45192
movb $0x0, %al
callq 0x3170
movq 0x6396a(%rip), %rdi     # 0x85fa8
callq 0x22500
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq 0x6394b(%rip), %rdi     # 0x85fa8
callq 0x22500
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
callq 0x23020
movq %rax, -0x38(%rbp)
leaq 0x22a21(%rip), %rdi     # 0x450a6
callq 0x19e80
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
callq 0x23020
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x18(%rax)
leaq 0x229e7(%rip), %rdi     # 0x4509e
callq 0x19e80
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x28(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
callq 0x21040
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
callq 0x21040
movq %rax, -0x30(%rbp)
callq 0x19dd0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x23080
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq 0x129d2(%rip), %rdx     # 0x35105
callq 0x230e0
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jne 0x22754
movq -0x48(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0x22761
movq -0x30(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x21040
movq -0x28(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x21040
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)