// File: /workspace/github_c_makefile_star2_O1/nimble-code[P]Uno/Src/uno_lts.c
// Function: lts_switch
static State *
lts_switch(State *now, treenode *node)
{	leafnode *ei;
	treenode *el, *en;
	int osaw;

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

	lts_push_end(en);	/* set break destination */

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

	/* lnode - switch expr
	 * rnode - cases
	 */
	lts_push_switch(now);	/* this is where jumps to case labels will go */
	now->n = node->lnode;	/* the switch expression */

	osaw = sawdefault;
	sawdefault = 0;

	now = lts_tree(now, node->rnode); /* process breaks and case labels */

	if (!sawdefault)	/* add nil jump to end */
	{	State *t, *stc;
		Trans *tr;

		want_break(node);

		stc = create_state(curgraph);
		stc->n = lts_top_end();		/* jump to endlabel */

		t = lts_top_switch(node);	/* add to switch stmnt */

		tr = get_trans();
		tr->branch = stc;
		tr->cond = mk_deflt();

		tr->nxt = t->succ;
		t->succ = tr;

		now = add_seq(now, stc->n);
	}

	sawdefault = osaw;

	now = lts_tree(now, el);	/* place end label */

	lts_pop_end();
	lts_pop_switch();
	return now;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
callq 0x101ad
movq %rax, %r12
leaq 0x1920d(%rip), %rdx     # 0x2ff2c
movq %rax, %rdi
movq %r14, %rsi
callq 0x169b4
movq %rax, %rbx
movl $0x50, %edi
callq 0x61a1
movl $0x4, (%rax)
movabsq $0x1d0000011c, %rcx     # imm = 0x1D0000011C
movq %rcx, 0x18(%rax)
leaq 0x190eb(%rip), %rcx     # 0x2fe3d
movq %rcx, 0x8(%rax)
movq %r12, 0x40(%rax)
movq %rax, %rdi
callq 0x16abd
cmpq $0x0, 0x40(%r14)
jne 0x16d77
movl $0x1, %edi
callq 0x1028c
movq %rax, 0x40(%r14)
movl $0x10, %edi
callq 0x61a1
movq %r15, (%rax)
movq 0x5917d(%rip), %rcx     # 0x6ff08
movq %rcx, 0x8(%rax)
movq %rax, 0x59172(%rip)     # 0x6ff08
movq 0x40(%r14), %rax
movq %rax, (%r15)
movb 0x5915c(%rip), %bpl     # 0x6ff00
movb $0x0, 0x59155(%rip)     # 0x6ff00
movq 0x48(%r14), %rsi
movq %r15, %rdi
callq 0x15e11
movq %rax, %r15
cmpb $0x0, 0x5913f(%rip)     # 0x6ff00
jne 0x16ecb
movq %r14, %rdi
callq 0x16c72
movq 0x59072(%rip), %r13     # 0x6fe48
movq 0x590e3(%rip), %r12     # 0x6fec0
testq %r12, %r12
je 0x16e1c
movq 0x68(%r12), %rax
movq %rax, 0x590d2(%rip)     # 0x6fec0
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%r12)
movups %xmm0, 0x50(%r12)
movups %xmm0, 0x40(%r12)
movups %xmm0, 0x30(%r12)
movups %xmm0, 0x20(%r12)
movups %xmm0, 0x10(%r12)
movups %xmm0, (%r12)
jmp 0x16e29
movl $0x70, %edi
callq 0x61a1
movq %rax, %r12
movq 0x10(%r13), %rax
movq %rax, 0x68(%r12)
movq %r12, 0x10(%r13)
xorl %edi, %edi
cmpq $0x0, 0x590b8(%rip)     # 0x6fef8
setne %dil
leaq 0x190fa(%rip), %rsi     # 0x2ff45
callq 0x13f8c
movq 0x590a1(%rip), %rax     # 0x6fef8
movl $0x1, 0x8(%rax)
movq (%rax), %rax
movq %rax, (%r12)
movq %r14, %rdi
callq 0x16b93
movq %rax, %r14
movq 0x59051(%rip), %r13     # 0x6fec8
testq %r13, %r13
je 0x16e96
movq 0x18(%r13), %rax
movq %rax, 0x59041(%rip)     # 0x6fec8
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r13)
movups %xmm0, (%r13)
jmp 0x16ea3
movl $0x20, %edi
callq 0x61a1
movq %rax, %r13
movq %r12, 0x10(%r13)
callq 0x102b2
movq %rax, (%r13)
movq 0x50(%r14), %rax
movq %rax, 0x18(%r13)
movq %r13, 0x50(%r14)
movq (%r12), %rsi
movq %r15, %rdi
callq 0x16b0a
movq %rax, %r15
andb $0x1, %bpl
movb %bpl, 0x5902a(%rip)     # 0x6ff00
movq %r15, %rdi
movq %rbx, %rsi
callq 0x15e11
movq %rax, %rbx
xorl %edi, %edi
cmpq $0x0, 0x5900a(%rip)     # 0x6fef8
setne %dil
leaq 0x18fa9(%rip), %rsi     # 0x2fea2
callq 0x13f8c
movq 0x58ff3(%rip), %rax     # 0x6fef8
movq 0x10(%rax), %rcx
movq %rcx, 0x58fe8(%rip)     # 0x6fef8
movq 0x58fc9(%rip), %rcx     # 0x6fee0
movq %rcx, 0x10(%rax)
movq %rax, 0x58fbe(%rip)     # 0x6fee0
xorl %edi, %edi
cmpq $0x0, 0x58fdc(%rip)     # 0x6ff08
setne %dil
leaq 0x1901e(%rip), %rsi     # 0x2ff55
callq 0x13f8c
movq 0x58fc5(%rip), %rax     # 0x6ff08
movq 0x8(%rax), %rax
movq %rax, 0x58fba(%rip)     # 0x6ff08
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq