// File: /workspace/github_c_makefile_star2_O3/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
pushq %rax
movq %rsi, %r12
movq %rdi, %r15
movq 0x48(%rdi), %r14
testq %r14, %r14
je 0x1c988
cmpl $0xa, 0x1c(%r14)
jne 0x1c988
movq 0x40(%r14), %r13
testq %r13, %r13
je 0x1c988
cmpl $0xa, 0x1c(%r13)
jne 0x1c988
cmpq $0x0, 0x40(%r13)
je 0x1c988
movl %edx, 0x4(%rsp)
movq 0x48(%r13), %rdi
testq %rdi, %rdi
je 0x1c988
leaq 0x6415f(%rip), %rbp     # 0x80998
movl $0x0, (%rbp)
movq %r12, %rsi
callq 0x1a750
movl %eax, %ebx
movq 0x48(%r14), %rdi
movq %r12, %rsi
callq 0x1a750
cmpl $0x0, (%rbp)
jne 0x1c988
movl %eax, %r14d
movq 0x40(%r13), %rax
cmpl $0x2f, 0x1c(%rax)
jne 0x1c988
movq 0x40(%rax), %r15
movq %r15, 0x641fc(%rip)     # 0x80a78
movb $0x1, %al
testq %r12, %r12
movl 0x4(%rsp), %ebp
je 0x1c8bc
cmpl $0x1b, 0x1c(%r12)
jne 0x1c899
movq 0x40(%r12), %r12
testq %r12, %r12
je 0x1c8bc
movq 0x28(%r12), %rax
testq %rax, %rax
je 0x1c8b8
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x1c8b8
movl $0x0, (%rax)
movq 0x10(%rax), %rax
jmp 0x1c8a7
xorl %eax, %eax
jmp 0x1c8bf
xorl %r12d, %r12d
movq 0x641a2(%rip), %rcx     # 0x80a68
testq %rcx, %rcx
je 0x1c8dd
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x1c8dd
andb $-0x2, 0x13(%rcx)
movq 0x18(%rcx), %rcx
jmp 0x1c8ce
xorl %r13d, %r13d
testb %al, %al
jne 0x1c976
movq 0x28(%r12), %rax
testq %rax, %rax
je 0x1c976
movq 0x18(%rax), %r12
testq %r12, %r12
je 0x1c976
xorl %r13d, %r13d
cmpb $0x0, (%r15)
je 0x1c921
movq 0x8(%r12), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x3190
testl %eax, %eax
jne 0x1c962
cmpl $0x1, %ebp
jne 0x1c93b
movl 0x4(%r12), %edx
testl %ebx, %edx
je 0x1c962
movl $0x1, %eax
movl $0x1, %ecx
jmp 0x1c956
cmpl $0x0, (%r12)
je 0x1c962
movl 0x4(%r12), %edx
testl %ebx, %edx
je 0x1c96e
xorl %eax, %eax
movl %r13d, %ecx
movl $0x1, %r13d
andl %r14d, %edx
jne 0x1c962
movl %eax, (%r12)
movl %ecx, %r13d
movq 0x10(%r12), %r12
testq %r12, %r12
jne 0x1c902
jmp 0x1c976
movl $0x1, %r13d
jmp 0x1c962
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x4290