// File: /workspace/github_c_makefile_star2_O2/nimble-code[P]Uno/Src/uno_generic.c
// Function: sel_args
static int
sel_args(treenode *e, treenode *n, int which)	/* 1:select(name,with,without), 2:unselect() */
{	treenode *f, *g;
	int val1, val2;

	/*	   TN_FUNC_CALL:e
		      /    \
		     /      \
		TN_IDENT  TN_EXPR_LIST:f
		   /          /         \
		select       /       TN_INT:val2
	                    /
	           TN_EXPR_LIST:g
	                  /      \
		 TN_STRING       TN_INT:val1
	      or TN_IDENT:MATCH:arg1
	 */
		if (!e->rnode
		||   e->rnode->hdr.type != TN_EXPR_LIST)
			goto bad1;
	f = e->rnode;
		if (!f->lnode
		||   f->lnode->hdr.type != TN_EXPR_LIST)
			goto bad1;
	g = f->lnode;
		if (!g->lnode || !g->rnode)
			goto bad1;
	nogood = 0;
	val1 = eval_const_expr(g->rnode, n);
	val2 = eval_const_expr(f->rnode, n);
	if (nogood || g->lnode->hdr.type != TN_STRING)
	{
bad1:		err_path++;
		fprintf(stderr, "\t\t%s:%d: error expecting string in '%s' [%d:%d]\n",
			n?n->hdr.fnm:"--",
			n?n->hdr.line:0,
			x_stmnt(e),
			nogood,
			(!nogood)?g->lnode->hdr.type:-1);
		exit(1);
	}

	user_name = ((leafnode *)g->lnode)->data.str;

	if (debug)
	printf(">>saw %s(%s,%d,%d)\n", x_stmnt(e), user_name, val1, val2);

	return dosel(n, user_name, val1, val2, which);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r12
movq 0x48(%rdi), %r14
testq %r14, %r14
movq %rdi, 0x10(%rsp)
je 0x1a72a
cmpl $0xa, 0x1c(%r14)
jne 0x1a72a
movq 0x40(%r14), %r13
testq %r13, %r13
je 0x1a72a
cmpl $0xa, 0x1c(%r13)
jne 0x1a72a
cmpq $0x0, 0x40(%r13)
je 0x1a72a
movq 0x48(%r13), %rdi
testq %rdi, %rdi
je 0x1a72a
movl %edx, %ebx
leaq 0x653b8(%rip), %r15     # 0x7f998
andl $0x0, (%r15)
movq %r12, %rsi
callq 0x18519
movl %eax, %ebp
movq 0x48(%r14), %rdi
movq %r12, %rsi
callq 0x18519
movl %eax, 0xc(%rsp)
cmpl $0x0, (%r15)
jne 0x1a72a
movq 0x40(%r13), %rax
cmpl $0x2f, 0x1c(%rax)
jne 0x1a72a
movq 0x40(%rax), %r15
movq %r15, 0x65457(%rip)     # 0x7fa78
movb $0x1, %al
testq %r12, %r12
je 0x1a65d
cmpl $0x1b, 0x1c(%r12)
jne 0x1a63a
movq 0x40(%r12), %r12
testq %r12, %r12
je 0x1a65d
movq 0x28(%r12), %rax
testq %rax, %rax
je 0x1a659
addq $0x18, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x1a659
andl $0x0, (%rax)
addq $0x10, %rax
jmp 0x1a648
xorl %eax, %eax
jmp 0x1a660
xorl %r12d, %r12d
movq 0x65401(%rip), %rcx     # 0x7fa68
testq %rcx, %rcx
jne 0x1a676
jmp 0x1a67e
andb $-0x2, 0x13(%rcx)
addq $0x18, %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x1a66e
xorl %r13d, %r13d
testb %al, %al
jne 0x1a718
movq 0x28(%r12), %r12
testq %r12, %r12
je 0x1a718
addq $0x18, %r12
xorl %r13d, %r13d
pushq $0x1
popq %r14
movq (%r12), %r12
testq %r12, %r12
je 0x1a718
cmpb $0x0, (%r15)
je 0x1a6ca
movq 0x8(%r12), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x3190
testl %eax, %eax
jne 0x1a70c
cmpl $0x1, %ebx
jne 0x1a6e3
movl 0x4(%r12), %esi
testl %ebp, %esi
je 0x1a70c
movl %r14d, %ecx
movl %r14d, %edx
movl %r13d, %eax
jmp 0x1a6fe
cmpl $0x0, (%r12)
je 0x1a70c
movl 0x4(%r12), %esi
movl %r14d, %eax
testl %ebp, %esi
je 0x1a70f
xorl %ecx, %ecx
movl %r13d, %edx
movl %r14d, %eax
andl 0xc(%rsp), %esi
jne 0x1a70f
movl %ecx, (%r12)
movl %edx, %eax
jmp 0x1a70f
movl %r13d, %eax
addq $0x10, %r12
movl %eax, %r13d
jmp 0x1a6a2
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incl 0x65340(%rip)           # 0x7fa70
movq 0x1c8c1(%rip), %rax     # 0x36ff8
testq %r12, %r12
jne 0x1a747
xorl %ebx, %ebx
leaq 0x3ac0(%rip), %r14      # 0x1e205
jmp 0x1a751
movq 0x8(%r12), %r14
movl 0x10(%r12), %ebx
movq (%rax), %r12
movq 0x10(%rsp), %rdi
callq 0x4ac7
leaq 0x65233(%rip), %rcx     # 0x7f998
movl (%rcx), %r9d
testl %r9d, %r9d
jne 0x1a776
movq 0x40(%r13), %rcx
movl 0x1c(%rcx), %ecx
jmp 0x1a779
pushq $-0x1
popq %rcx
movl %ecx, (%rsp)
leaq 0x14979(%rip), %rsi     # 0x2f0fc
movq %r12, %rdi
movq %r14, %rdx
movl %ebx, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x31a0
pushq $0x1
popq %rdi
callq 0x3270