// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/dissect.c
// Function: do_expression
static struct symbol *do_expression(usage_t mode, struct expression *expr)
{
	struct symbol *ret = &int_ctype;

again:
	if (expr) switch (expr->type) {
	default:
		warning(expr->pos, "bad expr->type: %d", expr->type);

	case EXPR_TYPE:		// [struct T]; Why ???
	case EXPR_VALUE:
	case EXPR_FVALUE:

	break; case EXPR_LABEL:
		ret = &label_ctype;

	break; case EXPR_STRING:
		ret = &string_ctype;

	break; case EXPR_STATEMENT:
		ret = do_statement(mode, expr->statement);

	break; case EXPR_SIZEOF: case EXPR_ALIGNOF: case EXPR_PTRSIZEOF:
		do_expression(U_VOID, expr->cast_expression);

	break; case EXPR_COMMA:
		do_expression(U_VOID, expr->left);
		ret = do_expression(mode, expr->right);

	break; case EXPR_CAST: case EXPR_FORCE_CAST: //case EXPR_IMPLIED_CAST:
		ret = base_type(expr->cast_type);
		do_initializer(ret, expr->cast_expression);

	break; case EXPR_COMPARE: case EXPR_LOGICAL:
		mode = u_rval(mode);
		do_expression(mode, expr->left);
		do_expression(mode, expr->right);

	break; case EXPR_CONDITIONAL: //case EXPR_SELECT:
		do_expression(expr->cond_true
					? U_R_VAL : U_R_VAL | mode,
				expr->conditional);
		ret = do_expression(mode, expr->cond_true);
		ret = do_expression(mode, expr->cond_false);

	break; case EXPR_CALL:
		if (expr->fn->type == EXPR_SYMBOL)
			expr->fn->op = 'f'; /* for expr_symbol() */
		ret = do_expression(U_R_PTR, expr->fn);
		if (is_ptr(ret))
			ret = ret->ctype.base_type;
		DO_2_LIST(ret->arguments, expr->args, arg, val,
			do_expression(u_lval(base_type(arg)), val));
		ret = ret->type == SYM_FN ? base_type(ret)
			: &bad_ctype;

	break; case EXPR_ASSIGNMENT:
		mode |= U_W_VAL | U_R_VAL;
		if (expr->op == '=')
			mode &= ~U_R_VAL;
		ret = do_expression(mode, expr->left);
		report_implicit(mode, &expr->pos, ret);
		mode = expr->op == '='
			? u_lval(ret) : U_R_VAL;
		do_expression(mode, expr->right);

	break; case EXPR_BINOP: {
		struct symbol *l, *r;
		mode |= u_rval(mode);
		l = do_expression(mode, expr->left);
		r = do_expression(mode, expr->right);
		if (expr->op != '+' && expr->op != '-')
			;
		else if (!is_ptr_type(r))
			ret = l;
		else if (!is_ptr_type(l))
			ret = r;
	}

	break; case EXPR_PREOP: case EXPR_POSTOP: {
		struct expression *unop = expr->unop;

		switch (expr->op) {
		case SPECIAL_INCREMENT:
		case SPECIAL_DECREMENT:
			mode |= U_W_VAL | U_R_VAL;
		default:
			mode |= u_rval(mode);
		case '(':
			ret = do_expression(mode, unop);

		break; case '&':
			if ((expr = peek_preop(unop, '*')))
				goto again;
			ret = alloc_symbol(unop->pos, SYM_PTR);
			ret->ctype.base_type =
				do_expression(u_addr(mode), unop);

		break; case '*':
			if ((expr = peek_preop(unop, '&')))
				goto again;
			if (mode & (U_MASK << U_SHIFT))
				mode |= U_R_VAL;
			mode <<= U_SHIFT;
			if (mode & (U_R_AOF << U_SHIFT))
				mode |= U_R_VAL;
			if (mode & (U_W_VAL << U_SHIFT))
				mode |= U_W_AOF;
			ret = do_expression(mode, unop);
			ret = is_ptr(ret) ? base_type(ret)
				: &bad_ctype;
		}
	}

	break; case EXPR_DEREF: {
		struct symbol *p_type;
		usage_t p_mode;

		p_mode = mode & U_SELF;
		if (!(mode & U_MASK) && (mode & (U_MASK << U_SHIFT)))
			p_mode = U_R_VAL;
		p_type = do_expression(p_mode, expr->deref);

		ret = report_member(mode, &expr->pos, p_type,
			lookup_member(p_type, expr->member, NULL));
	}

	break; case EXPR_OFFSETOF: {
		struct symbol *in = base_type(expr->in);

		do {
			if (expr->op == '.') {
				in = report_member(U_VOID, &expr->pos, in,
					lookup_member(in, expr->ident, NULL));
			} else {
				do_expression(U_R_VAL, expr->index);
				in = in->ctype.base_type;
			}
		} while ((expr = expr->down));
	}

	break; case EXPR_GENERIC: {
		struct type_expression *map;

		do_expression(U_VOID, expr->control);

		for (map = expr->map; map; map = map->next)
			ret = do_expression(mode, map->expr);
		if (expr->def)
			ret = do_expression(mode, expr->def);
	}

	break; case EXPR_SYMBOL:
		ret = report_symbol(mode, expr);
	}

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x84957(%rip), %rax     # 0x99eb0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x15dbe
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0xa0(%rbp)
subl $0x1e, %eax
ja 0x15596
movq -0xa0(%rbp), %rax
leaq 0x52f83(%rip), %rcx     # 0x68510
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %edx
andl $0xff, %edx
movq 0x8(%rax), %rdi
leaq 0x5303b(%rip), %rsi     # 0x685ec
movb $0x0, %al
callq 0x16f90
jmp 0x15dbc
leaq 0x8598c(%rip), %rax     # 0x9af50
movq %rax, -0x18(%rbp)
jmp 0x15dbc
leaq 0x855fc(%rip), %rax     # 0x9abd0
movq %rax, -0x18(%rbp)
jmp 0x15dbc
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x15f90
movq %rax, -0x18(%rbp)
jmp 0x15dbc
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
xorl %edi, %edi
callq 0x15540
jmp 0x15dbc
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
xorl %edi, %edi
callq 0x15540
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x15540
movq %rax, -0x18(%rbp)
jmp 0x15dbc
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x16290
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x16310
jmp 0x15dbc
movl -0x4(%rbp), %edi
callq 0x16580
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x15540
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x15540
jmp 0x15dbc
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x156a1
movl $0x4, %eax
movl %eax, -0xa4(%rbp)
jmp 0x156ad
movl -0x4(%rbp), %eax
orl $0x4, %eax
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %edi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x15540
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x15540
movq %rax, -0x18(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x15540
movq %rax, -0x18(%rbp)
jmp 0x15dbc
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl (%rax), %eax
andl $0xff, %eax
cmpl $0x3, %eax
jne 0x15710
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl $0x66, 0x4(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
movl $0x400, %edi            # imm = 0x400
callq 0x15540
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x165a0
cmpl $0x0, %eax
je 0x15740
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x15742
jmp 0x15744
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x157cf
jmp 0x15773
movl -0x3c(%rbp), %eax
movq -0x38(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x157ac
movq -0x38(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
andq $-0x4, %rax
movq %rax, -0x20(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x157cd
movq $0x0, -0x20(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq -0x30(%rbp), %rax
jne 0x15773
jmp 0x157cf
jmp 0x157d1
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x157f9
jmp 0x158f6
jmp 0x157fb
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x50(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x158de
movq -0x50(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x50(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x1584d
cmpq $0x0, -0x28(%rbp)
jne 0x1584d
jmp 0x158d0
movq -0x20(%rbp), %rdi
callq 0x16290
movq %rax, %rdi
callq 0x165e0
movl %eax, %edi
movq -0x28(%rbp), %rsi
callq 0x15540
cmpq $0x0, -0x20(%rbp)
je 0x158ce
jmp 0x15872
movl -0x3c(%rbp), %eax
movq -0x38(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x158ab
movq -0x38(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
andq $-0x4, %rax
movq %rax, -0x20(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x158cc
movq $0x0, -0x20(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq -0x30(%rbp), %rax
jne 0x15872
jmp 0x158ce
jmp 0x158d0
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x15802
jmp 0x158e0
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq -0x48(%rbp), %rax
jne 0x157fb
jmp 0x158f8
jmp 0x158fa
movq -0x18(%rbp), %rax
movl (%rax), %eax
andl $0xff, %eax
cmpl $0x5, %eax
jne 0x1591c
movq -0x18(%rbp), %rdi
callq 0x16290
movq %rax, -0xb0(%rbp)
jmp 0x1592c
leaq 0x8570d(%rip), %rax     # 0x9b030
movq %rax, -0xb0(%rbp)
jmp 0x1592c
movq -0xb0(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x15dbc
movl -0x4(%rbp), %eax
orl $0xc, %eax
movl %eax, -0x4(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x3d, 0x4(%rax)
jne 0x15958
movl -0x4(%rbp), %eax
andl $-0x5, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x15540
movq %rax, -0x18(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
movq -0x18(%rbp), %rdx
callq 0x16660
movq -0x10(%rbp), %rax
cmpl $0x3d, 0x4(%rax)
jne 0x1599b
movq -0x18(%rbp), %rdi
callq 0x165e0
movl %eax, -0xb4(%rbp)
jmp 0x159a8
movl $0x4, %eax
movl %eax, -0xb4(%rbp)
jmp 0x159a8
movl -0xb4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x15540
jmp 0x15dbc
movl -0x4(%rbp), %edi
callq 0x16580
orl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x15540
movq %rax, -0x68(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x15540
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2b, 0x4(%rax)
je 0x15a12
movq -0x10(%rbp), %rax
cmpl $0x2d, 0x4(%rax)
je 0x15a12
jmp 0x15a44
movq -0x70(%rbp), %rdi
callq 0x16790
cmpl $0x0, %eax
jne 0x15a2a
movq -0x68(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x15a42
movq -0x68(%rbp), %rdi
callq 0x16790
cmpl $0x0, %eax
jne 0x15a40
movq -0x70(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x15a42
jmp 0x15a44
jmp 0x15dbc
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0xb8(%rbp)
subl $0x26, %eax
je 0x15ad1
jmp 0x15a69
movl -0xb8(%rbp), %eax
subl $0x28, %eax
je 0x15abc
jmp 0x15a76
movl -0xb8(%rbp), %eax
subl $0x2a, %eax
je 0x15b27
jmp 0x15a87
movl -0xb8(%rbp), %eax
subl $0x101, %eax            # imm = 0x101
je 0x15aa5
jmp 0x15a96
movl -0xb8(%rbp), %eax
subl $0x103, %eax            # imm = 0x103
jne 0x15aae
jmp 0x15aa5
movl -0x4(%rbp), %eax
orl $0xc, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
callq 0x16580
orl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
movq -0x78(%rbp), %rsi
callq 0x15540
movq %rax, -0x18(%rbp)
jmp 0x15bda
movq -0x78(%rbp), %rdi
movl $0x2a, %esi
callq 0x16800
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x15aee
jmp 0x1555d
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x4, %esi
callq 0x2c220
movq %rax, -0x18(%rbp)
movl -0x4(%rbp), %edi
callq 0x16870
movl %eax, %edi
movq -0x78(%rbp), %rsi
callq 0x15540
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x60(%rax)
jmp 0x15bda
movq -0x78(%rbp), %rdi
movl $0x26, %esi
callq 0x16800
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x15b44
jmp 0x1555d
movl -0x4(%rbp), %eax
andl $0xd00, %eax            # imm = 0xD00
cmpl $0x0, %eax
je 0x15b5a
movl -0x4(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
shll $0x8, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x15b79
movl -0x4(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x15b8f
movl -0x4(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
movq -0x78(%rbp), %rsi
callq 0x15540
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x165a0
cmpl $0x0, %eax
je 0x15bbf
movq -0x18(%rbp), %rdi
callq 0x16290
movq %rax, -0xc0(%rbp)
jmp 0x15bcf
leaq 0x8546a(%rip), %rax     # 0x9b030
movq %rax, -0xc0(%rbp)
jmp 0x15bcf
movq -0xc0(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x15dbc
movl -0x4(%rbp), %eax
andl $0xff, %eax
movl %eax, -0x84(%rbp)
movl -0x4(%rbp), %eax
andl $0xd, %eax
cmpl $0x0, %eax
jne 0x15c0f
movl -0x4(%rbp), %eax
andl $0xd00, %eax            # imm = 0xD00
cmpl $0x0, %eax
je 0x15c0f
movl $0x4, -0x84(%rbp)
movl -0x84(%rbp), %edi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x15540
movq %rax, -0x80(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0xd4(%rbp)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xd0(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x80(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x16920
movl -0xd4(%rbp), %edi
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
movq %rax, %rcx
callq 0x168a0
movq %rax, -0x18(%rbp)
jmp 0x15dbc
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x16290
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2e, 0x4(%rax)
jne 0x15cf7
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xe8(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x90(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x16920
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
movq %rax, %rcx
xorl %edi, %edi
callq 0x168a0
movq %rax, -0x90(%rbp)
jmp 0x15d1b
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
movl $0x4, %edi
callq 0x15540
movq -0x90(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x90(%rbp)
jmp 0x15d1d
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
jne 0x15c97
jmp 0x15dbc
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
xorl %edi, %edi
callq 0x15540
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x98(%rbp)
cmpq $0x0, -0x98(%rbp)
je 0x15d8b
movl -0x4(%rbp), %edi
movq -0x98(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x15540
movq %rax, -0x18(%rbp)
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x98(%rbp)
jmp 0x15d56
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x15daa
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x15540
movq %rax, -0x18(%rbp)
jmp 0x15dbc
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x169a0
movq %rax, -0x18(%rbp)
jmp 0x15dbe
movq -0x18(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax,%rax)