// File: /workspace/github_c_makefile_star2_O0/darwin-on-arm[P]darwin-sdk/developer_cmds/unifdef/unifdef.c
// Function: eval_unary
static Linetype
eval_unary(const struct ops *ops, int *valp, const char **cpp)
{
	const char *cp;
	char *ep;
	int sym;
	bool defparen;
	Linetype lt;

	cp = skipcomment(*cpp);
	if (*cp == '!') {
		debug("eval%d !", ops - eval_ops);
		cp++;
		lt = eval_unary(ops, valp, &cp);
		if (lt == LT_ERROR)
			return (LT_ERROR);
		if (lt != LT_IF) {
			*valp = !*valp;
			lt = *valp ? LT_TRUE : LT_FALSE;
		}
	} else if (*cp == '(') {
		cp++;
		debug("eval%d (", ops - eval_ops);
		lt = eval_table(eval_ops, valp, &cp);
		if (lt == LT_ERROR)
			return (LT_ERROR);
		cp = skipcomment(cp);
		if (*cp++ != ')')
			return (LT_ERROR);
	} else if (isdigit((unsigned char)*cp)) {
		debug("eval%d number", ops - eval_ops);
		*valp = strtol(cp, &ep, 0);
		if (ep == cp)
			return (LT_ERROR);
		lt = *valp ? LT_TRUE : LT_FALSE;
		cp = skipsym(cp);
	} else if (strncmp(cp, "defined", 7) == 0 && endsym(cp[7])) {
		cp = skipcomment(cp+7);
		debug("eval%d defined", ops - eval_ops);
		if (*cp == '(') {
			cp = skipcomment(cp+1);
			defparen = true;
		} else {
			defparen = false;
		}
		sym = findsym(cp);
		if (sym < 0) {
			lt = LT_IF;
		} else {
			*valp = (value[sym] != NULL);
			lt = *valp ? LT_TRUE : LT_FALSE;
		}
		cp = skipsym(cp);
		cp = skipcomment(cp);
		if (defparen && *cp++ != ')')
			return (LT_ERROR);
		constexpr = false;
	} else if (!endsym(*cp)) {
		debug("eval%d symbol", ops - eval_ops);
		sym = findsym(cp);
		cp = skipsym(cp);
		if (sym < 0) {
			lt = LT_IF;
			cp = skipargs(cp);
		} else if (value[sym] == NULL) {
			*valp = 0;
			lt = LT_FALSE;
		} else {
			*valp = strtol(value[sym], &ep, 0);
			if (*ep != '\0' || ep == value[sym])
				return (LT_ERROR);
			lt = *valp ? LT_TRUE : LT_FALSE;
			cp = skipargs(cp);
		}
		constexpr = false;
	} else {
		debug("eval%d bad expr", ops - eval_ops);
		return (LT_ERROR);
	}

	*cpp = cp;
	debug("eval%d = %d", ops - eval_ops, *valp);
	return (lt);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x4160
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x21, %eax
jne 0x4f6a
movq -0x10(%rbp), %rax
leaq 0x3d91(%rip), %rcx      # 0x8c70
subq %rcx, %rax
movl $0x58, %ecx
cqto
idivq %rcx
movq %rax, %rsi
leaq 0x15b7(%rip), %rdi      # 0x64ad
movb $0x0, %al
callq 0x4020
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x4ea0
movl %eax, -0x3c(%rbp)
cmpl $0x16, -0x3c(%rbp)
jne 0x4f2f
movl $0x16, -0x4(%rbp)
jmp 0x53b4
cmpl $0x2, -0x3c(%rbp)
je 0x4f65
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movl (%rax), %edx
movl $0x4, %eax
movl $0x3, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x3c(%rbp)
jmp 0x5374
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
jne 0x500d
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
leaq 0x3cdf(%rip), %rcx      # 0x8c70
subq %rcx, %rax
movl $0x58, %ecx
cqto
idivq %rcx
movq %rax, %rsi
leaq 0x150e(%rip), %rdi      # 0x64b6
movb $0x0, %al
callq 0x4020
movq -0x18(%rbp), %rsi
leaq 0x3cb6(%rip), %rdi      # 0x8c70
leaq -0x28(%rbp), %rdx
callq 0x4af0
movl %eax, -0x3c(%rbp)
cmpl $0x16, -0x3c(%rbp)
jne 0x4fd8
movl $0x16, -0x4(%rbp)
jmp 0x53b4
movq -0x28(%rbp), %rdi
callq 0x4160
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movsbl (%rax), %eax
cmpl $0x29, %eax
je 0x5008
movl $0x16, -0x4(%rbp)
jmp 0x53b4
jmp 0x5372
callq 0x3280
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movzbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x50b2
movq -0x10(%rbp), %rax
leaq 0x3c34(%rip), %rcx      # 0x8c70
subq %rcx, %rax
movl $0x58, %ecx
cqto
idivq %rcx
movq %rax, %rsi
leaq 0x146c(%rip), %rdi      # 0x64bf
movb $0x0, %al
callq 0x4020
movq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x31b0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
jne 0x5087
movl $0x16, -0x4(%rbp)
jmp 0x53b4
movq -0x18(%rbp), %rax
movl (%rax), %edx
movl $0x4, %eax
movl $0x3, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x3c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x46b0
movq %rax, -0x28(%rbp)
jmp 0x5370
movq -0x28(%rbp), %rdi
leaq 0x1417(%rip), %rsi      # 0x64d4
movl $0x7, %edx
callq 0x3070
cmpl $0x0, %eax
jne 0x5206
callq 0x3280
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x5206
movq -0x28(%rbp), %rax
movsbl 0x7(%rax), %eax
cmpl $0x5f, %eax
je 0x5206
movq -0x28(%rbp), %rdi
addq $0x7, %rdi
callq 0x4160
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
leaq 0x3b50(%rip), %rcx      # 0x8c70
subq %rcx, %rax
movl $0x58, %ecx
cqto
idivq %rcx
movq %rax, %rsi
leaq 0x1396(%rip), %rdi      # 0x64cd
movb $0x0, %al
callq 0x4020
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
jne 0x5161
movq -0x28(%rbp), %rdi
addq $0x1, %rdi
callq 0x4160
movq %rax, -0x28(%rbp)
movb $0x1, -0x35(%rbp)
jmp 0x5165
movb $0x0, -0x35(%rbp)
movq -0x28(%rbp), %rdi
callq 0x47e0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x5180
movl $0x2, -0x3c(%rbp)
jmp 0x51b7
movslq -0x34(%rbp), %rcx
leaq 0x6175(%rip), %rax      # 0xb300
cmpq $0x0, (%rax,%rcx,8)
setne %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movl (%rax), %edx
movl $0x4, %eax
movl $0x3, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x3c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x46b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x4160
movq %rax, -0x28(%rbp)
testb $0x1, -0x35(%rbp)
je 0x51fa
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movsbl (%rax), %eax
cmpl $0x29, %eax
je 0x51fa
movl $0x16, -0x4(%rbp)
jmp 0x53b4
movb $0x0, 0x1724f(%rip)     # 0x1c450
jmp 0x536e
callq 0x3280
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movzbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x5234
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5f, %eax
jne 0x533a
movq -0x10(%rbp), %rax
leaq 0x3a31(%rip), %rcx      # 0x8c70
subq %rcx, %rax
movl $0x58, %ecx
cqto
idivq %rcx
movq %rax, %rsi
leaq 0x1286(%rip), %rdi      # 0x64dc
movb $0x0, %al
callq 0x4020
movq -0x28(%rbp), %rdi
callq 0x47e0
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rdi
callq 0x46b0
movq %rax, -0x28(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x5295
movl $0x2, -0x3c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x5510
movq %rax, -0x28(%rbp)
jmp 0x5331
movslq -0x34(%rbp), %rcx
leaq 0x6060(%rip), %rax      # 0xb300
cmpq $0x0, (%rax,%rcx,8)
jne 0x52ba
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movl $0x4, -0x3c(%rbp)
jmp 0x532f
movslq -0x34(%rbp), %rcx
leaq 0x603b(%rip), %rax      # 0xb300
movq (%rax,%rcx,8), %rdi
leaq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x31b0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x52fd
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rdx
leaq 0x6009(%rip), %rcx      # 0xb300
cmpq (%rcx,%rdx,8), %rax
jne 0x5309
movl $0x16, -0x4(%rbp)
jmp 0x53b4
movq -0x18(%rbp), %rax
movl (%rax), %edx
movl $0x4, %eax
movl $0x3, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x3c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x5510
movq %rax, -0x28(%rbp)
jmp 0x5331
movb $0x0, 0x17118(%rip)     # 0x1c450
jmp 0x536c
movq -0x10(%rbp), %rax
leaq 0x392b(%rip), %rcx      # 0x8c70
subq %rcx, %rax
movl $0x58, %ecx
cqto
idivq %rcx
movq %rax, %rsi
leaq 0x118e(%rip), %rdi      # 0x64ea
movb $0x0, %al
callq 0x4020
movl $0x16, -0x4(%rbp)
jmp 0x53b4
jmp 0x536e
jmp 0x5370
jmp 0x5372
jmp 0x5374
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x38e6(%rip), %rcx      # 0x8c70
subq %rcx, %rax
movl $0x58, %ecx
cqto
idivq %rcx
movq %rax, %rsi
movq -0x18(%rbp), %rax
movl (%rax), %edx
leaq 0x10d5(%rip), %rdi      # 0x647c
movb $0x0, %al
callq 0x4020
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)