// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/expand.c
// Function: expand_expression
static int expand_expression(struct expression *expr)
{
	if (!expr)
		return 0;
	if (!expr->ctype || expr->ctype == &bad_ctype)
		return UNSAFE;

	switch (expr->type) {
	case EXPR_VALUE:
	case EXPR_FVALUE:
	case EXPR_STRING:
		return 0;
	case EXPR_TYPE:
	case EXPR_SYMBOL:
		return expand_symbol_expression(expr);
	case EXPR_BINOP:
		return expand_binop(expr);

	case EXPR_LOGICAL:
		return expand_logical(expr);

	case EXPR_COMMA:
		return expand_comma(expr);

	case EXPR_COMPARE:
		return expand_compare(expr);

	case EXPR_ASSIGNMENT:
		return expand_assignment(expr);

	case EXPR_PREOP:
		return expand_preop(expr);

	case EXPR_POSTOP:
		return expand_postop(expr);

	case EXPR_CAST:
	case EXPR_FORCE_CAST:
	case EXPR_IMPLIED_CAST:
		return expand_cast(expr);

	case EXPR_CALL:
		return expand_call(expr);

	case EXPR_DEREF:
		warning(expr->pos, "we should not have an EXPR_DEREF left at expansion time");
		return UNSAFE;

	case EXPR_SELECT:
	case EXPR_CONDITIONAL:
		return expand_conditional(expr);

	case EXPR_STATEMENT: {
		struct statement *stmt = expr->statement;
		int cost = expand_statement(stmt);

		if (stmt->type == STMT_EXPRESSION && stmt->expression)
			*expr = *stmt->expression;
		return cost;
	}

	case EXPR_LABEL:
		return 0;

	case EXPR_INITIALIZER:
		sort_expression_list(&expr->expr_list);
		verify_nonoverlapping(&expr->expr_list, expr);
		return expand_expression_list(expr->expr_list);

	case EXPR_IDENTIFIER:
		return UNSAFE;

	case EXPR_INDEX:
		return UNSAFE;

	case EXPR_SLICE:
		return expand_expression(expr->base) + 1;

	case EXPR_POS:
		return expand_pos_expression(expr);

	case EXPR_GENERIC:
	case EXPR_SIZEOF:
	case EXPR_PTRSIZEOF:
	case EXPR_ALIGNOF:
	case EXPR_OFFSETOF:
		expression_error(expr, "internal front-end error: sizeof in expansion?");
		return UNSAFE;
	}
	return SIDE_EFFECTS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0xee04
movq %rdi, %r14
xorl %ebp, %ebp
leaq 0x5db22(%rip), %rcx     # 0x6c8b8
leaq 0x31267(%rip), %rdx     # 0x40004
xorl %ebx, %ebx
leal 0x2710(%rbx), %r15d
movq 0x10(%r14), %rsi
movl $0x64, %eax
testq %rsi, %rsi
je 0xf0ce
cmpq %rcx, %rsi
je 0xf0ce
movl (%r14), %eax
movzbl %al, %esi
decl %esi
cmpl $0x1e, %esi
ja 0xef9a
movslq (%rdx,%rsi,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
movq 0x20(%r14), %r14
testb $0x1, %bpl
cmovel %r15d, %r12d
movb $0x1, %bpl
testq %r14, %r14
jne 0xeda6
jmp 0xf0d4
movq 0x20(%r14), %r14
incl %ebx
testq %r14, %r14
jne 0xed9f
jmp 0xf0c5
xorl %ebx, %ebx
jmp 0xf0dd
leaq 0x3141f(%rip), %rsi     # 0x40231
movq %r14, %rdi
xorl %eax, %eax
callq 0x11b04
testb $0x1, %bpl
jne 0xf0d4
addl $0x64, %ebx
jmp 0xf0dd
movq 0x28(%r14), %r15
movq %r15, %rdi
callq 0xed77
movzbl (%r15), %ecx
cmpl $0x1c, %ecx
je 0xee4c
cmpl $0x1, %ecx
jne 0xf02c
movq 0x10(%r14), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0xea9c
jmp 0xef8b
movq 0x20(%r14), %rcx
cmpq 0x5115d(%rip), %rcx     # 0x5ffc8
je 0xf07e
movq 0xb0(%rcx), %rdi
testq %rdi, %rdi
je 0xee88
cmpq $0x0, 0x28(%r14)
je 0xf0c9
movb 0x68(%rcx), %al
andb $0xc, %al
cmpb $0x1, %al
movl $0x2, %eax
sbbl $0x0, %eax
jmp 0xf0ce
movq 0x20(%r14), %r15
movq 0x28(%r14), %r13
movq 0x30(%r14), %rax
movq %rax, 0x8(%rsp)
movq %r15, %rdi
callq 0xed77
cmpb $0x1, (%r15)
jne 0xf03f
cmpq $0x0, 0x20(%r15)
cmoveq 0x8(%rsp), %r13
movb 0x1(%r14), %al
movb %al, 0x8(%rsp)
testq %r13, %r13
cmoveq %r15, %r13
movq %r13, %rdi
callq 0xed77
movaps (%r13), %xmm0
movaps 0x10(%r13), %xmm1
movaps 0x20(%r13), %xmm2
movaps 0x30(%r13), %xmm3
movaps %xmm0, (%r14)
movaps %xmm1, 0x10(%r14)
movaps %xmm2, 0x20(%r14)
movaps %xmm3, 0x30(%r14)
movb (%r14), %cl
movb 0x8(%rsp), %dl
movb %dl, 0x1(%r14)
cmpb $0x1, %cl
jne 0xf0ce
movl 0x28(%r15), %ecx
orl %ecx, 0x28(%r14)
jmp 0xf0ce
movq 0x20(%r14), %r15
movq %r15, %rdi
callq 0xf0ee
cmpl $0x2, (%r15)
jne 0xf0ce
movq 0x10(%r15), %rcx
testq %rcx, %rcx
je 0xf0ce
movaps (%rcx), %xmm0
movaps 0x10(%rcx), %xmm1
movaps 0x20(%rcx), %xmm2
movaps 0x30(%rcx), %xmm3
movaps %xmm3, 0x30(%r14)
movaps %xmm2, 0x20(%r14)
movaps %xmm1, 0x10(%r14)
movaps %xmm0, (%r14)
jmp 0xf0ce
movq %r14, %rdi
callq 0xfe9c
jmp 0xf0ce
movq %r14, %rdi
callq 0xfe85
movl %r15d, %ebx
testb $0x1, %bpl
jne 0xf0d4
jmp 0xf0dd
movl $0x2710, %eax           # imm = 0x2710
jmp 0xf0ce
movq %r14, %rdi
callq 0xfa4f
jmp 0xf0ce
movq 0x8(%r14), %rdi
leaq 0x3123d(%rip), %rsi     # 0x401f9
xorl %eax, %eax
callq 0x118fc
jmp 0xee1c
movq %r14, %rdi
callq 0xf582
jmp 0xf0ce
leaq 0x20(%r14), %r15
leaq 0x173f(%rip), %rsi      # 0x1071f
movq %r15, %rdi
callq 0x29f40
movq 0x10(%r14), %rax
movl 0x50(%rax), %esi
movq %r15, %rdi
callq 0x10418
movq 0x20(%r14), %rdi
callq 0x10571
jmp 0xf0ce
movq %r14, %rdi
callq 0xfb83
jmp 0xf0ce
movq %r14, %rdi
callq 0x105db
jmp 0xf0ce
movq %r14, %rdi
callq 0x102c7
jmp 0xf0ce
testb $0x1, %bpl
jne 0xf0d4
addl %eax, %ebx
incl %ebx
jmp 0xf0dd
movq %rax, 0x10(%rsp)
movq %r13, %rdi
callq 0xed77
movl %eax, %r15d
movq 0x8(%rsp), %rdi
callq 0xed77
addl %r15d, %eax
cmpl $0x13, %eax
jg 0xf068
movb $0x12, (%r14)
addl $-0x9, %eax
movq 0x10(%rsp), %rcx
addl %ecx, %eax
addl $0xa, %eax
jmp 0xf0ce
movq %r14, %rdi
callq 0xfafc
jmp 0xf0ce
leaq 0x57dbf(%rip), %rcx     # 0x66e44
cmpl $0x0, (%rcx)
je 0xf0ab
movq 0x28(%r14), %rdi
callq 0x2de35
movq 0x8(%r14), %rdi
leaq 0x311c2(%rip), %rsi     # 0x40260
movq %rax, %rdx
xorl %eax, %eax
callq 0x118fc
movl (%r14), %eax
andl $0xffffff00, %eax       # imm = 0xFFFFFF00
incl %eax
movl %eax, (%r14)
movq $0x0, 0x20(%r14)
movl $0x0, 0x28(%r14)
xorl %eax, %eax
jmp 0xf0ce
callq 0xed77
testb $0x1, %bpl
je 0xf0d9
movl %r12d, %ebx
jmp 0xf0dd
addl %ebx, %eax
movl %eax, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq