// File: /workspace/github_c_makefile_star2_O0/nimble-code[P]Uno/Src/uno_lts.c
// Function: lts_while
static State *
lts_while(State *now, treenode *node)	/* lnode - cond; rnode - body */
{	State *ts, *es;
	Trans *tr;
	leafnode *si, *ei;
	treenode *el, *en;
	treenode *sl, *sn;
	if_node *t;

	if (!node->lnode)
		node->lnode = mk_int(1);
	if (!node->rnode)
		node->rnode = mk_int(1);

	si = mk_ident();	/* start of loop */
	sl = mk_label_node(si, node, "while");
	sn = mk_goto_node(si);

	ei = mk_ident();	/*   end of loop */
	el = mk_label_node(ei, node, "while");
	en = mk_goto_node(ei);

	lts_push_start(sn);
	lts_push_end(en);

	ts = create_state(curgraph);	/* then branch */
	ts->n = node->rnode;		/* while body */
	es = create_state(curgraph);	/* else branch */
	es->n = en;

	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 = lts_tree(now, sl);	/* add start label */

	t = (if_node *) emalloc(sizeof(if_node));
	t->hdr.which = IF_T;
	t->hdr.type = TN_IF;

	t->hdr.fnm = node->hdr.fnm;
	t->hdr.line = node->hdr.line;
	t->hdr.defuse = node->lnode->hdr.defuse;
#ifdef DEFTYP
	t->hdr.deftyp = node->lnode->hdr.deftyp;
#endif

	t->cond = node->lnode;		/* loop condition */
	t->then_n = ts->n;		/* just for form, */
	t->else_n = es->n;		/* the real info is in tr */

	now = add_seq(now, (treenode *) t); /* add loop test */
	now->succ = tr;			/* with its two branches */

	ts = lts_tree(ts, ts->n);	/* find end of loop body */
	ts = lts_tree(ts, sn);		/* add jump back to start */
	now = lts_tree(ts, el);		/* place the end label after that */

	lts_pop_start();
	lts_pop_end();

	return now;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x40(%rax)
jne 0x23940
movl $0x1, %edi
callq 0x19f10
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
jne 0x23960
movl $0x1, %edi
callq 0x19f10
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
callq 0x19dd0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0x2197a(%rip), %rdx     # 0x452f2
callq 0x230e0
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rdi
callq 0x23080
movq %rax, -0x58(%rbp)
callq 0x19dd0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0x2194c(%rip), %rdx     # 0x452f2
callq 0x230e0
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x23080
movq %rax, -0x48(%rbp)
movq -0x58(%rbp), %rdi
callq 0x23210
movq -0x48(%rbp), %rdi
callq 0x23250
movq 0x625d3(%rip), %rdi     # 0x85fa8
callq 0x22500
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq 0x625b4(%rip), %rdi     # 0x85fa8
callq 0x22500
movq %rax, -0x20(%rbp)
movq -0x48(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
callq 0x23020
movq %rax, -0x28(%rbp)
leaq 0x2168e(%rip), %rdi     # 0x450a6
callq 0x19e80
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
callq 0x23020
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
leaq 0x21654(%rip), %rdi     # 0x4509e
callq 0x19e80
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x21040
movq %rax, -0x8(%rbp)
movl $0x58, %edi
callq 0x54c0
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movl $0x2, (%rax)
movq -0x60(%rbp), %rax
movl $0x1b, 0x1c(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x28(%rax), %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x232a0
movq %rax, -0x8(%rbp)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x21040
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x21040
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x21040
movq %rax, -0x8(%rbp)
callq 0x23320
callq 0x23390
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)