// File: /workspace/github_c_makefile_star2_O2/s3lase[P]v6shell/util.c
// Function: doex
static void
doex(bool forked)
{
	enum sbikey xak;
	char **xap, **xav;

	if (iap < 2 || iap > iac)	/* should never (but can) be true */
		err(FC_ERR, FMT2S, getmyname(), ERR_AVIINVAL);

	xav = xap = &iav[iap];
	while (*xap != NULL) {
		if (forked && equal(*xap, "}"))
			break;
		xap++;
	}
	if (forked && xap - xav > 0 && !equal(*xap, "}"))
		err(FC_ERR, FMT3S, getmyname(), iav[iap - 1], ERR_BRACE);
	*xap = NULL;
	if (xav[0] == NULL) {
		if (forked)
			err(FC_ERR, FMT3S, getmyname(), iav[iap - 1], ERR_COMMAND);
		else
			/* Currently unreachable; do not remove. */
			err(FC_ERR, FMT2S, getmyname(), ERR_COMMAND);
	}

	/* Invoke the ":" or "exit" special command. */
	if (equal(xav[0], ":"))
		_exit(SH_TRUE);
	if (equal(xav[0], "exit")) {
		(void)lseek(FD0, (off_t)0, SEEK_END);
		_exit(SH_TRUE);
	}

	xak = cmd_lookup(xav[0]);
	if (IS_SBI(xak)) {
		if (forked)
			_exit(uexec(xak, (int)(xap - xav), xav));
		else
			(void)uexec(xak, (int)(xap - xav), xav);
		return;
	}

	(void)err_pexec(xav[0], xav);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
movl 0xa85d(%rip), %eax      # 0x113b8
cmpl $0x2, %eax
jl 0x6b68
cmpl 0xa842(%rip), %eax      # 0x113a8
jle 0x6b8e
callq 0x6455
leaq 0x17c9(%rip), %rsi      # 0x833d
leaq 0x1c04(%rip), %rcx      # 0x877f
pushq $0x7c
popq %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6218
movl 0xa82a(%rip), %eax      # 0x113b8
movslq %eax, %r14
shlq $0x3, %r14
addq 0xa814(%rip), %r14      # 0x113b0
xorl %r13d, %r13d
leaq 0x1b6f(%rip), %r15      # 0x8715
xorl %ebp, %ebp
movq (%r14,%r13), %r12
testq %r12, %r12
je 0x6bcc
testb %bl, %bl
je 0x6bc4
movq %r12, %rdi
movq %r15, %rsi
callq 0x6d0f
testb %al, %al
jne 0x6bcc
incl %ebp
addq $0x8, %r13
jmp 0x6ba8
testq %r13, %r13
setg %al
andb %bl, %al
cmpb $0x1, %al
jne 0x6c1e
leaq 0x1b36(%rip), %rsi      # 0x8715
movq %r12, %rdi
callq 0x6d0f
testb %al, %al
jne 0x6c1e
callq 0x6455
movq 0xa7b9(%rip), %rcx      # 0x113b0
movslq 0xa7ba(%rip), %rdx      # 0x113b8
movq -0x8(%rcx,%rdx,8), %rcx
leaq 0x172f(%rip), %rsi      # 0x8339
leaq 0x1b93(%rip), %r8       # 0x87a4
pushq $0x7c
popq %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6218
andq $0x0, (%r14,%r13)
cmpq $0x0, (%r14)
jne 0x6c7d
callq 0x6455
testb %bl, %bl
je 0x6c62
movq 0xa777(%rip), %rcx      # 0x113b0
movslq 0xa778(%rip), %rdx      # 0x113b8
movq -0x8(%rcx,%rdx,8), %rcx
leaq 0x16ed(%rip), %rsi      # 0x8339
leaq 0x1b5c(%rip), %r8       # 0x87af
pushq $0x7c
popq %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6218
jmp 0x6c7d
leaq 0x16d4(%rip), %rsi      # 0x833d
leaq 0x1b3f(%rip), %rcx      # 0x87af
pushq $0x7c
popq %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6218
movq (%r14), %r15
leaq 0x1a07(%rip), %rsi      # 0x868e
movq %r15, %rdi
callq 0x6d0f
testb %al, %al
jne 0x6d01
leaq 0x1570(%rip), %rsi      # 0x820a
movq %r15, %rdi
callq 0x6d0f
testb %al, %al
jne 0x6cf5
movq %r15, %rdi
callq 0x31a5
cmpl $0x9, %eax
ja 0x6cdc
movl $0x390, %ecx            # imm = 0x390
btl %eax, %ecx
jae 0x6cdc
movl %eax, %edi
movl %ebp, %esi
movq %r14, %rdx
callq 0x6510
testb %bl, %bl
jne 0x6d08
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x76a8
pushq $0x2
popq %rdx
xorl %edi, %edi
xorl %esi, %esi
callq 0x21a0
xorl %edi, %edi
callq 0x2080
movl %eax, %edi
callq 0x2080