// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x90, %rsp
movl $0x1, %edi
callq 0x7509
movq %rax, %rbx
testq %rax, %rax
je 0x77a9
movzbl (%rbx), %ebp
cmpl $0x7b, %ebp
je 0x75f2
cmpl $0x28, %ebp
jne 0x7609
leaq 0x2131(%rip), %rsi      # 0x970d
movq %rbx, %rdi
callq 0x2230
testl %eax, %eax
je 0x79ac
cmpb $0x7b, %bpl
jne 0x7609
leaq 0x2121(%rip), %rsi      # 0x971a
movq %rbx, %rdi
callq 0x2230
testl %eax, %eax
je 0x78fe
movb (%rbx), %bpl
cmpb $0x2d, %bpl
jne 0x77de
leaq 0x2101(%rip), %rsi      # 0x971e
movq %rbx, %rdi
callq 0x2230
testl %eax, %eax
je 0x7987
cmpb $0x2d, %bpl
jne 0x77de
leaq 0x20e3(%rip), %rsi      # 0x9721
movq %rbx, %rdi
callq 0x2230
testl %eax, %eax
je 0x7a9a
cmpb $0x2d, %bpl
jne 0x77de
leaq 0x20c5(%rip), %rsi      # 0x9724
movq %rbx, %rdi
callq 0x2230
testl %eax, %eax
je 0x7ae1
cmpb $0x2d, %bpl
jne 0x77de
leaq 0x20a7(%rip), %rsi      # 0x9727
movq %rbx, %rdi
callq 0x2230
testl %eax, %eax
je 0x7b14
cmpb $0x2d, %bpl
jne 0x77de
leaq 0x2089(%rip), %rsi      # 0x972a
movq %rbx, %rdi
callq 0x2230
testl %eax, %eax
je 0x7b88
cmpb $0x2d, %bpl
jne 0x77de
leaq 0x206b(%rip), %rsi      # 0x972d
movq %rbx, %rdi
callq 0x2230
testl %eax, %eax
je 0x7b99
cmpb $0x2d, %bpl
jne 0x77de
leaq 0x204d(%rip), %rsi      # 0x9730
movq %rbx, %rdi
callq 0x2230
testl %eax, %eax
je 0x7baa
cmpb $0x2d, %bpl
jne 0x77de
leaq 0x202f(%rip), %rsi      # 0x9733
movq %rbx, %rdi
callq 0x2230
testl %eax, %eax
je 0x7bbb
cmpb $0x2d, %bpl
jne 0x77de
leaq 0x2011(%rip), %rsi      # 0x9736
movq %rbx, %rdi
callq 0x2230
testl %eax, %eax
jne 0x77de
movl $0x1, %edi
callq 0x7509
movq %rax, %r14
testq %rax, %rax
je 0x774d
cmpb $0x0, (%r14)
jne 0x7772
callq 0x6b0f
leaq 0x1be0(%rip), %rsi      # 0x9339
leaq 0x1fd9(%rip), %r8       # 0x9739
movl $0x7c, %edi
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x68c8
movb (%r14), %al
leal -0x30(%rax), %ecx
cmpb $0x9, %cl
ja 0x7bd7
cmpb $0x0, 0x1(%r14)
jne 0x7bd7
movzbl %cl, %edi
leaq 0x1b00(%rip), %rcx      # 0x9296
cmpb %al, (%rdi,%rcx)
jne 0x7bd7
callq 0x20a0
jmp 0x7a36
callq 0x6b0f
movq 0x9bfb(%rip), %rcx      # 0x113b0
movslq 0x9bfc(%rip), %rdx      # 0x113b8
movq -0x10(%rcx,%rdx,8), %rcx
leaq 0x1b71(%rip), %rsi      # 0x9339
leaq 0x1f2a(%rip), %r8       # 0x96f9
movl $0x7c, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x68c8
movl $0x1, %edi
callq 0x7509
movq %rax, %r14
testq %rax, %rax
je 0x78a4
movzbl (%r14), %ebp
cmpl $0x21, %ebp
je 0x781f
cmpl $0x3d, %ebp
jne 0x7836
leaq 0x1f5e(%rip), %rsi      # 0x9767
movq %r14, %rdi
callq 0x2230
testl %eax, %eax
je 0x7a55
cmpb $0x21, %bpl
jne 0x7836
leaq 0x1f40(%rip), %rsi      # 0x9766
movq %r14, %rdi
callq 0x2230
testl %eax, %eax
je 0x7a01
cmpb $0x2d, %bpl
jne 0x78c9
leaq 0x1f22(%rip), %rsi      # 0x9769
movq %r14, %rdi
callq 0x2230
testl %eax, %eax
je 0x7a41
cmpb $0x2d, %bpl
jne 0x78c9
leaq 0x1f09(%rip), %rsi      # 0x976d
movq %r14, %rdi
callq 0x2230
testl %eax, %eax
je 0x7abf
cmpb $0x2d, %bpl
jne 0x78c9
leaq 0x1ef0(%rip), %rsi      # 0x9771
movq %r14, %rdi
callq 0x2230
testl %eax, %eax
jne 0x78c9
xorl %edi, %edi
callq 0x7509
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
jmp 0x7ad1
callq 0x6b0f
leaq 0x1a89(%rip), %rsi      # 0x9339
leaq 0x1e9d(%rip), %r8       # 0x9754
movl $0x7c, %edi
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x68c8
callq 0x6b0f
leaq 0x1a64(%rip), %rsi      # 0x9339
leaq 0x1e99(%rip), %r8       # 0x9775
xorl %ebp, %ebp
movl $0x7c, %edi
movq %rax, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x68c8
movl %ebp, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x23c0
testl %eax, %eax
je 0x7a8b
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x7934
callq 0x6b0f
leaq 0x1a1f(%rip), %rsi      # 0x933d
leaq 0x1a2f(%rip), %rcx      # 0x9354
movl $0x7c, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x68c8
movq %rsp, %rdi
callq 0x23a0
movl %eax, %ebx
movl $0x1, %edi
callq 0x7509
testq %rax, %rax
je 0x7977
leaq 0x1dc8(%rip), %r14      # 0x971c
cmpb $0x7d, (%rax)
jne 0x7968
movq %rax, %rdi
movq %r14, %rsi
callq 0x2230
testl %eax, %eax
je 0x797d
movl $0x1, %edi
callq 0x7509
testq %rax, %rax
jne 0x7954
decl 0x9a3b(%rip)            # 0x113b8
xorl %ebp, %ebx
orl (%rsp), %ebx
jmp 0x7b0b
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x7509
testq %rax, %rax
je 0x78f0
cmpb $0x0, (%rax)
je 0x7b81
movq %rax, %rdi
xorl %esi, %esi
jmp 0x7b04
callq 0x7206
movl %eax, %ebp
movl $0x1, %edi
callq 0x7509
testq %rax, %rax
je 0x79de
cmpb $0x29, (%rax)
jne 0x79de
leaq 0x1c93(%rip), %rsi      # 0x9661
movq %rax, %rdi
callq 0x2230
testl %eax, %eax
je 0x78f0
callq 0x6b0f
leaq 0x194f(%rip), %rsi      # 0x9339
leaq 0x1d1e(%rip), %r8       # 0x970f
movl $0x7c, %edi
movq %rax, %rdx
movq %rbx, %rcx
jmp 0x78e9
testq %rbx, %rbx
sete %bpl
xorl %edi, %edi
callq 0x7509
testq %rax, %rax
sete %cl
orb %bpl, %cl
movb $0x1, %bpl
jne 0x78f0
movb (%rbx), %cl
cmpb (%rax), %cl
jne 0x78f0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2230
testl %eax, %eax
setne %bpl
jmp 0x78f0
xorl %edi, %edi
callq 0x7509
movq %rbx, %rdi
movq %rax, %rsi
movl $0x2, %edx
jmp 0x7ad1
testq %rbx, %rbx
sete %r14b
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x7509
testq %rax, %rax
sete %cl
orb %r14b, %cl
jne 0x78f0
movb (%rbx), %cl
cmpb (%rax), %cl
jne 0x7b81
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2230
jmp 0x7b09
movl $0x1, %edi
callq 0x7257
jmp 0x7609
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x7509
testq %rax, %rax
je 0x78f0
cmpb $0x0, (%rax)
je 0x7b81
movq %rax, %rdi
movl $0x4, %esi
jmp 0x7b04
xorl %edi, %edi
callq 0x7509
movq %rbx, %rdi
movq %rax, %rsi
movl $0x3, %edx
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x7c79
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x7509
testq %rax, %rax
je 0x78f0
cmpb $0x0, (%rax)
je 0x7b81
movq %rax, %rdi
movl $0x2, %esi
callq 0x2330
testl %eax, %eax
sete %bpl
jmp 0x78f0
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x7509
testq %rax, %rax
je 0x78f0
movq %rax, %rbx
cmpb $0x0, (%rax)
je 0x7b81
movq %rbx, %rdi
movl $0x1, %esi
callq 0x2330
testl %eax, %eax
sete %bpl
leaq 0x4724(%rip), %rcx      # 0xc26c
orl (%rcx), %eax
jne 0x78f0
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x2270
testl %eax, %eax
js 0x7b81
movl 0x18(%rsp), %eax
movl %eax, %ecx
andl $0xf000, %ecx           # imm = 0xF000
movb $0x1, %bpl
cmpl $0x4000, %ecx           # imm = 0x4000
je 0x78f0
testb $0x49, %al
jmp 0x7a38
xorl %ebp, %ebp
jmp 0x78f0
xorl %edi, %edi
callq 0x7509
movq %rax, %rdi
movl $0x4000, %esi           # imm = 0x4000
jmp 0x7bca
xorl %edi, %edi
callq 0x7509
movq %rax, %rdi
movl $0x8000, %esi           # imm = 0x8000
jmp 0x7bca
xorl %edi, %edi
callq 0x7509
movq %rax, %rdi
movl $0xa000, %esi           # imm = 0xA000
jmp 0x7bca
xorl %edi, %edi
callq 0x7509
movq %rax, %rdi
movl $0x1, %esi
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x7bfa
callq 0x6b0f
leaq 0x1756(%rip), %rsi      # 0x9339
leaq 0x1b5e(%rip), %r8       # 0x9748
movl $0x7c, %edi
movq %rax, %rdx
movq %r14, %rcx
jmp 0x77d7