// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/expression.c
// Function: unary_expression
static struct token *unary_expression(struct token *token, struct expression **tree)
{
	if (token_type(token) == TOKEN_IDENT) {
		struct ident *ident = token->ident;
		if (ident->reserved) {
			static const struct {
				struct ident *id;
				int type;
			} type_information[] = {
				{ &sizeof_ident, EXPR_SIZEOF },
				{ &__alignof___ident, EXPR_ALIGNOF },
				{ &__alignof_ident, EXPR_ALIGNOF },
				{ &_Alignof_ident, EXPR_ALIGNOF },
				{ &__sizeof_ptr___ident, EXPR_PTRSIZEOF },
			};
			int i;
			for (i = 0; i < ARRAY_SIZE(type_information); i++) {
				if (ident == type_information[i].id)
					return type_info_expression(token, tree, type_information[i].type);
			}
		}
	}

	if (token_type(token) == TOKEN_SPECIAL) {
		if (match_oplist(token->special,
		    SPECIAL_INCREMENT, SPECIAL_DECREMENT,
		    '&', '*', 0)) {
		    	struct expression *unop;
			struct expression *unary;
			struct token *next;

			next = cast_expression(token->next, &unop);
			if (!unop) {
				sparse_error(token->pos, "Syntax error in unary expression");
				*tree = NULL;
				return next;
			}
			unary = alloc_expression(token->pos, EXPR_PREOP);
			unary->op = token->special;
			unary->unop = unop;
			*tree = unary;
			return next;
		}
		/* possibly constant ones */
		if (match_oplist(token->special, '+', '-', '~', '!', 0)) {
		    	struct expression *unop;
			struct expression *unary;
			struct token *next;

			next = cast_expression(token->next, &unop);
			if (!unop) {
				sparse_error(token->pos, "Syntax error in unary expression");
				*tree = NULL;
				return next;
			}
			unary = alloc_expression(token->pos, EXPR_PREOP);
			unary->op = token->special;
			unary->unop = unop;
			*tree = unary;
			return next;
		}
		/* Gcc extension: &&label gives the address of a label */
		if (match_op(token, SPECIAL_LOGICAL_AND) &&
		    token_type(token->next) == TOKEN_IDENT) {
			struct expression *label = alloc_expression(token->pos, EXPR_LABEL);
			struct symbol *sym = label_symbol(token->next, 1);
			if (!(sym->ctype.modifiers & MOD_ADDRESSABLE)) {
				sym->ctype.modifiers |= MOD_ADDRESSABLE;
				add_symbol(&function_computed_target_list, sym);
			}
			check_label_usage(sym, token->pos);
			label->flags = CEF_ADDR;
			label->label_symbol = sym;
			*tree = label;
			return token->next->next;
		}
						
	}
			
	return postfix_expression(token, tree, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
andq $0x3f, %rax
cmpl $0x3, %eax
jne 0x58497
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb 0x11(%rax), %al
shrb %al
andb $0x1, %al
cmpb $0x0, %al
je 0x58495
movl $0x0, -0x24(%rbp)
movslq -0x24(%rbp), %rax
cmpq $0x5, %rax
jae 0x58493
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rdx
leaq 0x2b941(%rip), %rcx     # 0x83d90
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jne 0x58486
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movslq -0x24(%rbp), %rcx
leaq 0x2b922(%rip), %rax     # 0x83d90
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edx
callq 0x587f0
movq %rax, -0x8(%rbp)
jmp 0x5871e
jmp 0x58488
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x58436
jmp 0x58495
jmp 0x58497
movq -0x10(%rbp), %rax
movq (%rax), %rax
andq $0x3f, %rax
cmpl $0x12, %eax
jne 0x58709
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edi
movl $0x101, %esi            # imm = 0x101
movl $0x103, %edx            # imm = 0x103
movl $0x26, %ecx
movl $0x2a, %r8d
xorl %r9d, %r9d
movb $0x0, %al
callq 0x58990
cmpl $0x0, %eax
je 0x5856a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x57f30
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x58523
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x1475c(%rip), %rsi     # 0x6cc60
movb $0x0, %al
callq 0x16f90
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5871e
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x9, %esi
callq 0x55c50
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5871e
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edi
movl $0x2b, %esi
movl $0x2d, %edx
movl $0x7e, %ecx
movl $0x21, %r8d
xorl %r9d, %r9d
movb $0x0, %al
callq 0x58990
cmpl $0x0, %eax
je 0x58629
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x57f30
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x585e2
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x1469d(%rip), %rsi     # 0x6cc60
movb $0x0, %al
callq 0x16f90
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5871e
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x9, %esi
callq 0x55c50
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5871e
movq -0x10(%rbp), %rdi
movl $0x10c, %esi            # imm = 0x10C
callq 0x55c10
cmpl $0x0, %eax
je 0x58707
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
andq $0x3f, %rax
cmpl $0x3, %eax
jne 0x58707
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x17, %esi
callq 0x55c50
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0x23060
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq 0x68(%rax), %rax
andq $0x100, %rax            # imm = 0x100
cmpq $0x0, %rax
jne 0x586ba
movq -0x68(%rbp), %rax
movq 0x68(%rax), %rcx
orq $0x100, %rcx            # imm = 0x100
movq %rcx, 0x68(%rax)
movq -0x68(%rbp), %rsi
leaq 0x34c4b(%rip), %rdi     # 0x8d300
callq 0x559e0
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x236e0
movq -0x60(%rbp), %rax
movl (%rax), %ecx
andl $0xffff00ff, %ecx       # imm = 0xFFFF00FF
orl $0x4000, %ecx           # imm = 0x4000
movl %ecx, (%rax)
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x60(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x5871e
jmp 0x58709
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x58100
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)