// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/expand.c
// Function: expand_statement
static int expand_statement(struct statement *stmt)
{
	if (!stmt)
		return 0;

	switch (stmt->type) {
	case STMT_DECLARATION: {
		struct symbol *sym;
		FOR_EACH_PTR(stmt->declaration, sym) {
			expand_symbol(sym);
		} END_FOR_EACH_PTR(sym);
		return SIDE_EFFECTS;
	}

	case STMT_RETURN:
		expand_return_expression(stmt);
		return SIDE_EFFECTS;

	case STMT_EXPRESSION:
		return expand_expression(stmt->expression);

	case STMT_COMPOUND:
		return expand_compound(stmt);

	case STMT_IF:
		return expand_if_statement(stmt);

	case STMT_ITERATOR:
		expand_expression(stmt->iterator_pre_condition);
		expand_expression(stmt->iterator_post_condition);
		expand_statement(stmt->iterator_pre_statement);
		expand_statement(stmt->iterator_statement);
		expand_statement(stmt->iterator_post_statement);
		return SIDE_EFFECTS;

	case STMT_SWITCH:
		expand_expression(stmt->switch_expression);
		expand_statement(stmt->switch_statement);
		return SIDE_EFFECTS;

	case STMT_CASE:
		expand_const_expression(stmt->case_expression, "case statement");
		expand_const_expression(stmt->case_to, "case statement");
		expand_statement(stmt->case_statement);
		return SIDE_EFFECTS;

	case STMT_LABEL:
		expand_statement(stmt->label_statement);
		return SIDE_EFFECTS;

	case STMT_GOTO:
		expand_expression(stmt->goto_expression);
		return SIDE_EFFECTS;

	case STMT_NONE:
		break;
	case STMT_ASM:
		expand_asm_statement(stmt);
		break;
	case STMT_CONTEXT:
		expand_expression(stmt->expression);
		break;
	case STMT_RANGE:
		expand_expression(stmt->range_expression);
		expand_expression(stmt->range_low);
		expand_expression(stmt->range_high);
		break;
	}
	return SIDE_EFFECTS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0xf1d6
movq %rdi, %r14
xorl %ebp, %ebp
leaq 0x30f6f(%rip), %r15     # 0x40080
leaq 0x5d7a0(%rip), %r12     # 0x6c8b8
movl (%r14), %eax
movl $0x2710, %ebx           # imm = 0x2710
decl %eax
cmpl $0xc, %eax
ja 0xf3c9
movl $0x20, %r13d
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq 0x10(%r14), %rdi
movl $0x64, %ebx
testq %rdi, %rdi
je 0xf3c9
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0xf3c9
cmpq %r12, %rax
je 0xf3c9
callq 0xed77
movq 0x18(%r14), %rdi
callq 0xf0ee
jmp 0xf1c1
movq 0x10(%r14), %rdi
callq 0x10788
movq 0x18(%r14), %rdi
callq 0x10788
jmp 0xf1c1
movq 0x30(%r14), %rdi
callq 0xed77
movq 0x48(%r14), %rdi
callq 0xed77
movq 0x28(%r14), %rdi
callq 0xf0ee
movq 0x38(%r14), %rdi
callq 0xf0ee
movl $0x40, %r13d
jmp 0xf1c1
movq 0x10(%r14), %rdi
callq 0xed77
movl $0x18, %r13d
movq (%r14,%r13), %r14
movb $0x1, %bpl
testq %r14, %r14
jne 0xf118
jmp 0xf3cf
xorl %ebx, %ebx
jmp 0xf3d4
movq 0x10(%r14), %rdi
jmp 0xf3bf
movq 0x18(%r14), %r15
testq %r15, %r15
je 0xf23a
movq %r15, %r12
movzwl (%r12), %eax
testb %al, %al
jle 0xf230
xorl %r13d, %r13d
movq 0x18(%r12,%r13,8), %rcx
movzwl %ax, %edx
cmpl $0x100, %edx            # imm = 0x100
jb 0xf213
testq %rcx, %rcx
je 0xf221
movq 0x10(%rcx), %rdi
callq 0xed77
movzwl (%r12), %eax
incq %r13
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %r13
jl 0xf1fe
movq 0x10(%r12), %r12
cmpq %r15, %r12
jne 0xf1f2
movq 0x20(%r14), %r14
testq %r14, %r14
je 0xf3c9
movq %r14, %r15
movzwl (%r15), %eax
testb %al, %al
jle 0xf286
xorl %r12d, %r12d
movq 0x18(%r15,%r12,8), %rcx
movzwl %ax, %edx
cmpl $0x100, %edx            # imm = 0x100
jb 0xf26a
testq %rcx, %rcx
je 0xf277
movq 0x10(%rcx), %rdi
callq 0xed77
movzwl (%r15), %eax
incq %r12
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %r12
jl 0xf255
movq 0x10(%r15), %r15
cmpq %r14, %r15
jne 0xf24a
jmp 0xf3c9
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0xf2a2
callq 0xed34
movq 0x28(%r14), %r15
movq %r15, %rdi
callq 0xf0ee
movl %eax, %ebx
movq 0x10(%r14), %rax
testq %rax, %rax
je 0xf3e5
movl %ebp, 0xc(%rsp)
xorl %r13d, %r13d
testq %r15, %r15
setne %r13b
movq %rax, %r12
movq %rax, 0x10(%rsp)
movzwl (%r12), %eax
testb %al, %al
jle 0xf31f
xorl %ebp, %ebp
movq %r15, %rcx
movq 0x18(%r12,%rbp,8), %r15
movzwl %ax, %edx
cmpl $0x100, %edx            # imm = 0x100
jb 0xf2fb
testq %r15, %r15
jne 0xf2fb
movq %rcx, %r15
jmp 0xf310
incl %r13d
movq %r15, %rdi
callq 0xf0ee
addl %eax, %ebx
movzwl (%r12), %eax
movq %r15, %rcx
incq %rbp
movzwl %ax, %edx
movsbq %dl, %rdx
cmpq %rdx, %rbp
jl 0xf2e1
movq 0x10(%r12), %r12
movq 0x10(%rsp), %rax
cmpq %rax, %r12
jne 0xf2d3
cmpl $0x1, %r13d
movl 0xc(%rsp), %ebp
jne 0xf3c9
jmp 0xf3ea
movq 0x10(%r14), %r14
testq %r14, %r14
je 0xf3c9
movq %r14, %r15
movzwl (%r15), %eax
testb %al, %al
jle 0xf385
xorl %r12d, %r12d
movq 0x18(%r15,%r12,8), %rdi
movzwl %ax, %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0xf36d
testq %rdi, %rdi
je 0xf376
callq 0xed34
movzwl (%r15), %eax
incq %r12
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %r12
jl 0xf358
movq 0x10(%r15), %r15
cmpq %r14, %r15
jne 0xf34d
jmp 0xf3c9
movq 0x10(%r14), %rdi
callq 0xed77
movq 0x18(%r14), %rdi
callq 0xed77
movq 0x20(%r14), %rdi
jmp 0xf3bf
movq 0x10(%r14), %rdi
callq 0xed77
testb $0x1, %bpl
jne 0xf3cf
movl %eax, %ebx
jmp 0xf3d4
movq 0x18(%r14), %rdi
callq 0xed77
movl $0x2710, %ebx           # imm = 0x2710
testb $0x1, %bpl
je 0xf3d4
movl $0x2710, %ebx           # imm = 0x2710
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r15, %r15
je 0xf3c9
cmpq $0x0, 0x18(%r14)
jne 0xf3c9
movl $0xa, %ecx
movq %r14, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
jmp 0xf3c9