// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movl $0x1, %edi
callq 0x9bb0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x9d55
callq 0x8df0
movq %rax, %rdx
movq 0x9685(%rip), %rax      # 0x133b0
movl 0x9687(%rip), %ecx      # 0x133b8
subl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movl $0x7c, %edi
leaq 0x1a56(%rip), %rsi      # 0xb79d
leaq 0x1e27(%rip), %r8       # 0xbb75
movb $0x0, %al
callq 0x8af0
movq -0x20(%rbp), %rdi
leaq 0x1e29(%rip), %rsi      # 0xbb89
callq 0x9b40
testb $0x1, %al
jne 0x9d6b
jmp 0x9dc5
callq 0x97e0
andb $0x1, %al
movb %al, -0x2(%rbp)
movl $0x1, %edi
callq 0x9bb0
movq %rax, %rdi
leaq 0x1d3c(%rip), %rsi      # 0xbac5
callq 0x9b40
testb $0x1, %al
jne 0x9db8
callq 0x8df0
movq %rax, %rdx
movq -0x20(%rbp), %rcx
movl $0x7c, %edi
leaq 0x19f3(%rip), %rsi      # 0xb79d
leaq 0x1dda(%rip), %r8       # 0xbb8b
movb $0x0, %al
callq 0x8af0
movb -0x2(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xa2ee
movq -0x20(%rbp), %rdi
leaq 0x1dc6(%rip), %rsi      # 0xbb96
callq 0x9b40
testb $0x1, %al
jne 0x9dde
jmp 0x9eb9
callq 0x23c0
movl %eax, -0x8(%rbp)
cmpl $-0x1, %eax
jne 0x9e0d
callq 0x8df0
movq %rax, %rdx
movl $0x7c, %edi
leaq 0x19a2(%rip), %rsi      # 0xb7a1
leaq 0x19b2(%rip), %rcx      # 0xb7b8
movb $0x0, %al
callq 0x8af0
cmpl $0x0, -0x8(%rbp)
jne 0x9e22
movl $0x1, %edi
callq 0x9860
jmp 0x9eb7
leaq -0x10(%rbp), %rdi
callq 0x23a0
movl %eax, -0xc(%rbp)
movl $0x1, %edi
callq 0x9bb0
movq %rax, %rcx
movq %rcx, -0x20(%rbp)
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x29(%rbp)
je 0x9e5f
movq -0x20(%rbp), %rdi
leaq 0x1d43(%rip), %rsi      # 0xbb98
callq 0x9b40
xorb $-0x1, %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x9e68
jmp 0x9e6a
jmp 0x9e2e
cmpq $0x0, -0x20(%rbp)
jne 0x9e80
movl 0x9541(%rip), %eax      # 0x133b8
addl $-0x1, %eax
movl %eax, 0x9538(%rip)      # 0x133b8
movl -0xc(%rbp), %ecx
xorl %eax, %eax
cmpl -0x8(%rbp), %ecx
movb %al, -0x2a(%rbp)
jne 0x9e97
cmpl $0x0, -0x10(%rbp)
sete %al
movb %al, -0x2a(%rbp)
movb -0x2a(%rbp), %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xa2ee
jmp 0x9eb9
movq -0x20(%rbp), %rdi
leaq 0x1cd6(%rip), %rsi      # 0xbb9a
callq 0x9b40
testb $0x1, %al
jne 0x9ecf
jmp 0x9eea
xorl %edi, %edi
callq 0x9bb0
movq %rax, %rdi
xorl %esi, %esi
callq 0xa300
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xa2ee
movq -0x20(%rbp), %rdi
leaq 0x1ca8(%rip), %rsi      # 0xbb9d
callq 0x9b40
testb $0x1, %al
jne 0x9f00
jmp 0x9f1e
xorl %edi, %edi
callq 0x9bb0
movq %rax, %rdi
movl $0x4, %esi
callq 0xa300
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xa2ee
movq -0x20(%rbp), %rdi
leaq 0x1c77(%rip), %rsi      # 0xbba0
callq 0x9b40
testb $0x1, %al
jne 0x9f34
jmp 0x9f52
xorl %edi, %edi
callq 0x9bb0
movq %rax, %rdi
movl $0x2, %esi
callq 0xa300
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xa2ee
movq -0x20(%rbp), %rdi
leaq 0x1c46(%rip), %rsi      # 0xbba3
callq 0x9b40
testb $0x1, %al
jne 0x9f68
jmp 0x9f86
xorl %edi, %edi
callq 0x9bb0
movq %rax, %rdi
movl $0x1, %esi
callq 0xa300
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xa2ee
movq -0x20(%rbp), %rdi
leaq 0x1c15(%rip), %rsi      # 0xbba6
callq 0x9b40
testb $0x1, %al
jne 0x9f9c
jmp 0x9fba
xorl %edi, %edi
callq 0x9bb0
movq %rax, %rdi
movl $0x4000, %esi           # imm = 0x4000
callq 0xa3d0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xa2ee
movq -0x20(%rbp), %rdi
leaq 0x1be4(%rip), %rsi      # 0xbba9
callq 0x9b40
testb $0x1, %al
jne 0x9fd0
jmp 0x9fee
xorl %edi, %edi
callq 0x9bb0
movq %rax, %rdi
movl $0x8000, %esi           # imm = 0x8000
callq 0xa3d0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xa2ee
movq -0x20(%rbp), %rdi
leaq 0x1bb3(%rip), %rsi      # 0xbbac
callq 0x9b40
testb $0x1, %al
jne 0xa004
jmp 0xa022
xorl %edi, %edi
callq 0x9bb0
movq %rax, %rdi
movl $0xa000, %esi           # imm = 0xA000
callq 0xa3d0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xa2ee
movq -0x20(%rbp), %rdi
leaq 0x1b82(%rip), %rsi      # 0xbbaf
callq 0x9b40
testb $0x1, %al
jne 0xa038
jmp 0xa056
xorl %edi, %edi
callq 0x9bb0
movq %rax, %rdi
movl $0x1, %esi
callq 0xa3d0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xa2ee
movq -0x20(%rbp), %rdi
leaq 0x1b51(%rip), %rsi      # 0xbbb2
callq 0x9b40
testb $0x1, %al
jne 0xa06f
jmp 0xa158
movl $0x1, %edi
callq 0x9bb0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xa090
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xa0b6
callq 0x8df0
movq %rax, %rdx
movq -0x20(%rbp), %rcx
movl $0x7c, %edi
leaq 0x16f5(%rip), %rsi      # 0xb79d
leaq 0x1b06(%rip), %r8       # 0xbbb5
movb $0x0, %al
callq 0x8af0
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0xa132
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jg 0xa132
movq -0x28(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0xa132
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0xa130
cmpl $0x9, -0x14(%rbp)
jg 0xa130
movl -0x14(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movslq %edx, %rcx
leaq 0x15f1(%rip), %rax      # 0xb6fa
movsbl (%rax,%rcx), %eax
movq -0x28(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xa130
movl -0x14(%rbp), %edi
callq 0x20a0
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xa2ee
jmp 0xa132
callq 0x8df0
movq %rax, %rdx
movq -0x28(%rbp), %rcx
movl $0x7c, %edi
leaq 0x1653(%rip), %rsi      # 0xb79d
leaq 0x1a73(%rip), %r8       # 0xbbc4
movb $0x0, %al
callq 0x8af0
movl $0x1, %edi
callq 0x9bb0
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0xa192
callq 0x8df0
movq %rax, %rdx
movq -0x20(%rbp), %rcx
movl $0x7c, %edi
leaq 0x1619(%rip), %rsi      # 0xb79d
leaq 0x1a45(%rip), %r8       # 0xbbd0
movb $0x0, %al
callq 0x8af0
movq -0x28(%rbp), %rdi
leaq 0x1a46(%rip), %rsi      # 0xbbe3
callq 0x9b40
testb $0x1, %al
jne 0xa1a8
jmp 0xa1cd
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
xorl %edi, %edi
callq 0x9bb0
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x9b40
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xa2ee
movq -0x28(%rbp), %rdi
leaq 0x1a0a(%rip), %rsi      # 0xbbe2
callq 0x9b40
testb $0x1, %al
jne 0xa1e3
jmp 0xa20a
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
xorl %edi, %edi
callq 0x9bb0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x9b40
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xa2ee
movq -0x28(%rbp), %rdi
leaq 0x19d0(%rip), %rsi      # 0xbbe5
callq 0x9b40
testb $0x1, %al
jne 0xa220
jmp 0xa24a
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
xorl %edi, %edi
callq 0x9bb0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movl $0x2, %edx
callq 0xa4d0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xa2ee
movq -0x28(%rbp), %rdi
leaq 0x1994(%rip), %rsi      # 0xbbe9
callq 0x9b40
testb $0x1, %al
jne 0xa260
jmp 0xa287
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
xorl %edi, %edi
callq 0x9bb0
movq -0x50(%rbp), %rdi
movq %rax, %rsi
movl $0x3, %edx
callq 0xa4d0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xa2ee
movq -0x28(%rbp), %rdi
leaq 0x195b(%rip), %rsi      # 0xbbed
callq 0x9b40
testb $0x1, %al
jne 0xa29d
jmp 0xa2c4
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
xorl %edi, %edi
callq 0x9bb0
movq -0x58(%rbp), %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0xa4d0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0xa2ee
callq 0x8df0
movq %rax, %rdx
movq -0x28(%rbp), %rcx
movl $0x7c, %edi
leaq 0x14c1(%rip), %rsi      # 0xb79d
leaq 0x190e(%rip), %r8       # 0xbbf1
movb $0x0, %al
callq 0x8af0
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)