// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x11d9f
movl $0x0, -0x4(%rbp)
jmp 0x11fe2
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x40(%rbp)
subq $0xd, %rax
ja 0x11fdb
movq -0x40(%rbp), %rax
leaq 0x502c2(%rip), %rcx     # 0x62080
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x11dc9
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x11dee
jmp 0x11e63
jmp 0x11df0
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x28(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x11e4f
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x11e3b
cmpq $0x0, -0x18(%rbp)
jne 0x11e3b
jmp 0x11e44
movq -0x18(%rbp), %rdi
callq 0x11aa0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x11df7
jmp 0x11e51
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq -0x20(%rbp), %rax
jne 0x11df0
movl $0x2710, -0x4(%rbp)     # imm = 0x2710
jmp 0x11fe2
movq -0x10(%rbp), %rdi
callq 0x14c10
movl $0x2710, -0x4(%rbp)     # imm = 0x2710
jmp 0x11fe2
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x11b30
movl %eax, -0x4(%rbp)
jmp 0x11fe2
movq -0x10(%rbp), %rdi
callq 0x14c30
movl %eax, -0x4(%rbp)
jmp 0x11fe2
movq -0x10(%rbp), %rdi
callq 0x14d60
movl %eax, -0x4(%rbp)
jmp 0x11fe2
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x11b30
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x11b30
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x11d80
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x11d80
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x11d80
movl $0x2710, -0x4(%rbp)     # imm = 0x2710
jmp 0x11fe2
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x11b30
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x11d80
movl $0x2710, -0x4(%rbp)     # imm = 0x2710
jmp 0x11fe2
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x57402(%rip), %rsi     # 0x6933f
callq 0x14de0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x573ee(%rip), %rsi     # 0x6933f
callq 0x14de0
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x11d80
movl $0x2710, -0x4(%rbp)     # imm = 0x2710
jmp 0x11fe2
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x11d80
movl $0x2710, -0x4(%rbp)     # imm = 0x2710
jmp 0x11fe2
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x11b30
movl $0x2710, -0x4(%rbp)     # imm = 0x2710
jmp 0x11fe2
jmp 0x11fdb
movq -0x10(%rbp), %rdi
callq 0x14e60
jmp 0x11fdb
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x11b30
jmp 0x11fdb
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x11b30
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x11b30
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x11b30
movl $0x2710, -0x4(%rbp)     # imm = 0x2710
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)