// File: /workspace/github_c_makefile_star2_O2/s3lase[P]v6shell/util.c
// Function: e3
static bool
e3(void)
{
	bool re;
	pid_t cpid, tpid;
	int cstat, d;
	char *a, *b;

	if ((a = nxtarg(RETERR)) == NULL)
		err(FC_ERR, FMT3S, getmyname(), iav[iap - 2], ERR_EXPR);

	/*
	 * Deal w/ parentheses for grouping.
	 */
	if (equal(a, "(")) {
		re = expr();
		if (!equal(nxtarg(RETERR), ")"))
			err(FC_ERR, FMT3S, getmyname(), a, ERR_PAREN);
		return re;
	}

	/*
	 * Execute { command [arg ...] } to obtain its exit status.
	 */
	if (equal(a, "{")) {
		if ((cpid = fork()) == -1)
			err(FC_ERR, FMT2S, getmyname(), ERR_FORK);
		if (cpid == 0)
			/**** Child! ****/
			doex(FORKED);
		else {
			/**** Parent! ****/
			tpid = wait(&cstat);
			while ((a = nxtarg(RETERR)) != NULL && !equal(a, "}"))
				;	/* nothing */
			if (a == NULL)
				iap--;
			return (tpid == cpid && cstat == 0) ? true : false;
		}
	}

	/*
	 * file existence/permission tests
	 */
	if (equal(a, "-e"))
		return ifaccess(nxtarg(!RETERR), F_OK);
	if (equal(a, "-r"))
		return ifaccess(nxtarg(!RETERR), R_OK);
	if (equal(a, "-w"))
		return ifaccess(nxtarg(!RETERR), W_OK);
	if (equal(a, "-x"))
		return ifaccess(nxtarg(!RETERR), X_OK);

	/*
	 * file existence/type tests
	 */
	if (equal(a, "-d"))
		return ifstat1(nxtarg(!RETERR), S_IFDIR);
	if (equal(a, "-f"))
		return ifstat1(nxtarg(!RETERR), S_IFREG);
	if (equal(a, "-h"))
		return ifstat1(nxtarg(!RETERR), S_IFLNK);
	if (equal(a, "-s"))
		return ifstat1(nxtarg(!RETERR), F_GZ);
	if (equal(a, "-t")) {
		/* Does the descriptor refer to a terminal device? */
		b = nxtarg(RETERR);
		if (b == NULL || *b == EOS)
			err(FC_ERR, FMT3S, getmyname(), a, ERR_DIGIT);
		if (*b >= '0' && *b <= '9' && *(b + 1) == EOS) {
			d = *b - '0';
			if (IS_DIGIT(d, *b))
				return isatty(d) != 0;
		}
		err(FC_ERR, FMT3S, getmyname(), b, ERR_NOTDIGIT);
	}

	/*
	 * binary comparisons
	 */
	if ((b = nxtarg(RETERR)) == NULL)
		err(FC_ERR, FMT3S, getmyname(), a, ERR_OPERATOR);
	if (equal(b,  "="))
		return  equal(a, nxtarg(!RETERR));
	if (equal(b, "!="))
		return !equal(a, nxtarg(!RETERR));
	if (equal(b, "-ot"))
		return ifstat2(a, nxtarg(!RETERR), F_OT);
	if (equal(b, "-nt"))
		return ifstat2(a, nxtarg(!RETERR), F_NT);
	if (equal(b, "-ef"))
		return ifstat2(a, nxtarg(!RETERR), F_EF);
	err(FC_ERR, FMT3S, getmyname(), b, ERR_OPUNKNOWN);
	/*NOTREACHED*/
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $0x1
popq %rdi
callq 0x6d38
movq %rax, %rbx
testq %rax, %rax
jne 0x6e30
callq 0x6455
movq 0xa5a7(%rip), %rcx      # 0x113b0
movslq 0xa5a8(%rip), %rdx      # 0x113b8
movq -0x10(%rcx,%rdx,8), %rcx
leaq 0x151d(%rip), %rsi      # 0x8339
leaq 0x18cf(%rip), %r8       # 0x86f2
pushq $0x7c
popq %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6218
leaq 0x18cf(%rip), %rsi      # 0x8706
movq %rbx, %rdi
callq 0x6d0f
testb %al, %al
je 0x6e91
callq 0x6aa4
movl %eax, %ebp
pushq $0x1
popq %rdi
callq 0x6d38
leaq 0x1804(%rip), %rsi      # 0x865d
movq %rax, %rdi
callq 0x6d0f
testb %al, %al
jne 0x6f1d
callq 0x6455
leaq 0x14c4(%rip), %rsi      # 0x8339
leaq 0x188c(%rip), %r8       # 0x8708
pushq $0x7c
popq %rdi
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6218
jmp 0x6f1d
leaq 0x187b(%rip), %rsi      # 0x8713
movq %rbx, %rdi
callq 0x6d0f
testb %al, %al
je 0x6f32
callq 0x23c0
testl %eax, %eax
je 0x6f2a
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x6ed8
callq 0x6455
leaq 0x1479(%rip), %rsi      # 0x833d
leaq 0x1489(%rip), %rcx      # 0x8354
pushq $0x7c
popq %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6218
leaq 0x4(%rsp), %rdi
callq 0x23a0
movl %eax, %ebx
pushq $0x1
popq %r14
leaq 0x1826(%rip), %r15      # 0x8715
movl %r14d, %edi
callq 0x6d38
testq %rax, %rax
je 0x6f0d
movq %rax, %rdi
movq %r15, %rsi
callq 0x6d0f
testb %al, %al
je 0x6eef
jmp 0x6f13
decl 0xa4a5(%rip)            # 0x113b8
xorl %ebp, %ebx
orl 0x4(%rsp), %ebx
sete %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rdi
callq 0x6b48
leaq 0x17de(%rip), %rsi      # 0x8717
movq %rbx, %rdi
callq 0x6d0f
testb %al, %al
je 0x6f53
xorl %edi, %edi
callq 0x6d38
movq %rax, %rdi
xorl %esi, %esi
jmp 0x6faf
leaq 0x17c0(%rip), %rsi      # 0x871a
movq %rbx, %rdi
callq 0x6d0f
testb %al, %al
je 0x6f71
xorl %edi, %edi
callq 0x6d38
pushq $0x4
jmp 0x6fab
leaq 0x17a5(%rip), %rsi      # 0x871d
movq %rbx, %rdi
callq 0x6d0f
testb %al, %al
je 0x6f8f
xorl %edi, %edi
callq 0x6d38
pushq $0x2
jmp 0x6fab
leaq 0x178a(%rip), %rsi      # 0x8720
movq %rbx, %rdi
callq 0x6d0f
testb %al, %al
je 0x6fbe
xorl %edi, %edi
callq 0x6d38
pushq $0x1
popq %rsi
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7221
leaq 0x175e(%rip), %rsi      # 0x8723
movq %rbx, %rdi
callq 0x6d0f
testb %al, %al
je 0x6fe2
xorl %edi, %edi
callq 0x6d38
movq %rax, %rdi
movl $0x4000, %esi           # imm = 0x4000
jmp 0x704a
leaq 0x173d(%rip), %rsi      # 0x8726
movq %rbx, %rdi
callq 0x6d0f
testb %al, %al
je 0x7006
xorl %edi, %edi
callq 0x6d38
movq %rax, %rdi
movl $0x8000, %esi           # imm = 0x8000
jmp 0x704a
leaq 0x171c(%rip), %rsi      # 0x8729
movq %rbx, %rdi
callq 0x6d0f
testb %al, %al
je 0x702a
xorl %edi, %edi
callq 0x6d38
movq %rax, %rdi
movl $0xa000, %esi           # imm = 0xA000
jmp 0x704a
leaq 0x16fb(%rip), %rsi      # 0x872c
movq %rbx, %rdi
callq 0x6d0f
testb %al, %al
je 0x7059
xorl %edi, %edi
callq 0x6d38
pushq $0x1
popq %rsi
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x729b
leaq 0x16cf(%rip), %rsi      # 0x872f
movq %rbx, %rdi
callq 0x6d0f
testb %al, %al
je 0x70fe
pushq $0x1
popq %rdi
callq 0x6d38
movq %rax, %r14
testq %rax, %rax
je 0x7087
movb (%r14), %al
testb %al, %al
jne 0x70ad
callq 0x6455
leaq 0x12a6(%rip), %rsi      # 0x8339
leaq 0x1698(%rip), %r8       # 0x8732
pushq $0x7c
popq %rdi
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6218
movb (%r14), %al
leal -0x30(%rax), %ecx
cmpb $0x9, %cl
ja 0x70db
cmpb $0x0, 0x1(%r14)
jne 0x70db
movzbl %cl, %edi
leaq 0x11d0(%rip), %rcx      # 0x8296
cmpb %al, (%rdi,%rcx)
jne 0x70db
callq 0x20a0
testl %eax, %eax
setne %bpl
jmp 0x6f1d
callq 0x6455
leaq 0x1252(%rip), %rsi      # 0x8339
leaq 0x1653(%rip), %r8       # 0x8741
pushq $0x7c
popq %rdi
movq %rax, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x6218
pushq $0x1
popq %rdi
callq 0x6d38
movq %rax, %r14
testq %rax, %rax
jne 0x7131
callq 0x6455
leaq 0x121f(%rip), %rsi      # 0x8339
leaq 0x162c(%rip), %r8       # 0x874d
pushq $0x7c
popq %rdi
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6218
leaq 0x1628(%rip), %rsi      # 0x8760
movq %r14, %rdi
callq 0x6d0f
testb %al, %al
je 0x7160
xorl %edi, %edi
callq 0x6d38
movq %rbx, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6d0f
leaq 0x15f8(%rip), %rsi      # 0x875f
movq %r14, %rdi
callq 0x6d0f
testb %al, %al
je 0x7190
xorl %edi, %edi
callq 0x6d38
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6d0f
movl %eax, %ebp
xorb $0x1, %bpl
jmp 0x6f1d
leaq 0x15cb(%rip), %rsi      # 0x8762
movq %r14, %rdi
callq 0x6d0f
testb %al, %al
je 0x71ae
xorl %edi, %edi
callq 0x6d38
pushq $0x2
jmp 0x71e8
leaq 0x15b1(%rip), %rsi      # 0x8766
movq %r14, %rdi
callq 0x6d0f
testb %al, %al
je 0x71cc
xorl %edi, %edi
callq 0x6d38
pushq $0x3
jmp 0x71e8
leaq 0x1597(%rip), %rsi      # 0x876a
movq %r14, %rdi
callq 0x6d0f
testb %al, %al
je 0x71fe
xorl %edi, %edi
callq 0x6d38
pushq $0x4
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x731a
callq 0x6455
leaq 0x112f(%rip), %rsi      # 0x8339
leaq 0x155d(%rip), %r8       # 0x876e
xorl %ebp, %ebp
pushq $0x7c
popq %rdi
movq %rax, %rdx
movq %r14, %rcx
jmp 0x6e85