// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/compile-i386.c
// Function: x86_statement
static struct storage *x86_statement(struct statement *stmt)
{
	if (!stmt)
		return NULL;
	switch (stmt->type) {
	default:
		return NULL;
	case STMT_RETURN:
		return emit_return_stmt(stmt);
	case STMT_DECLARATION:
		x86_symbol_decl(stmt->declaration);
		break;
	case STMT_COMPOUND: {
		struct statement *s;
		struct storage *last = NULL;

		FOR_EACH_PTR(stmt->stmts, s) {
			last = x86_statement(s);
		} END_FOR_EACH_PTR(s);

		return last;
	}

	case STMT_EXPRESSION:
		return x86_expression(stmt->expression);
	case STMT_IF:
		emit_if_conditional(stmt);
		return NULL;

	case STMT_CASE:
		emit_case_statement(stmt);
		break;
	case STMT_SWITCH:
		emit_switch_statement(stmt);
		break;

	case STMT_ITERATOR:
		emit_loop(stmt);
		break;

	case STMT_NONE:
		break;

	case STMT_LABEL:
		printf(".L%p:\n", stmt->label_identifier);
		x86_statement(stmt->label_statement);
		break;

	case STMT_GOTO:
		if (stmt->goto_expression) {
			struct storage *val = x86_expression(stmt->goto_expression);
			printf("\tgoto *v%d\n", val->pseudo);
		} else if (!strcmp("break", show_ident(stmt->goto_label->ident))) {
			struct storage *lbv = new_storage(STOR_LABEL);
			lbv->label = loopstk_break();
			lbv->flags = STOR_WANTS_FREE;
			insn("jmp", lbv, NULL, "'break'; go to loop bottom");
		} else if (!strcmp("continue", show_ident(stmt->goto_label->ident))) {
			struct storage *lbv = new_storage(STOR_LABEL);
			lbv->label = loopstk_continue();
			lbv->flags = STOR_WANTS_FREE;
			insn("jmp", lbv, NULL, "'continue'; go to loop top");
		} else {
			struct storage *labelsym = new_labelsym(stmt->goto_label);
			insn("jmp", labelsym, NULL, NULL);
		}
		break;
	case STMT_ASM:
		printf("\tasm( .... )\n");
		break;
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x61d90
movq $0x0, -0x8(%rbp)
jmp 0x6206c
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x68(%rbp)
subq $0xb, %rax
ja 0x61db4
movq -0x68(%rbp), %rax
leaq 0x108dd(%rip), %rcx     # 0x72688
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq $0x0, -0x8(%rbp)
jmp 0x6206c
movq -0x10(%rbp), %rdi
callq 0x62b50
movq %rax, -0x8(%rbp)
jmp 0x6206c
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x62c40
jmp 0x62064
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x61e12
jmp 0x61e8b
jmp 0x61e14
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x30(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x61e77
movq -0x30(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x61e5f
cmpq $0x0, -0x18(%rbp)
jne 0x61e5f
jmp 0x61e6c
movq -0x18(%rbp), %rdi
callq 0x61d70
movq %rax, -0x20(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x61e1b
jmp 0x61e79
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq -0x28(%rbp), %rax
jne 0x61e14
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6206c
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x62220
movq %rax, -0x8(%rbp)
jmp 0x6206c
movq -0x10(%rbp), %rdi
callq 0x62cf0
movq $0x0, -0x8(%rbp)
jmp 0x6206c
movq -0x10(%rbp), %rdi
callq 0x62d60
jmp 0x62064
movq -0x10(%rbp), %rdi
callq 0x62d90
jmp 0x62064
movq -0x10(%rbp), %rdi
callq 0x63120
jmp 0x62064
jmp 0x62064
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x9b79(%rip), %rdi      # 0x6ba7b
movb $0x0, %al
callq 0x11110
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x61d70
jmp 0x62064
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x61f51
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x62220
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl 0x20(%rax), %esi
leaq 0x10a16(%rip), %rdi     # 0x7295b
movb $0x0, %al
callq 0x11110
jmp 0x62054
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x314b0
movq %rax, %rsi
leaq 0x6a44(%rip), %rdi      # 0x689b0
callq 0x111e0
cmpl $0x0, %eax
jne 0x61fbe
movl $0x5, %edi
callq 0x63490
movq %rax, -0x50(%rbp)
callq 0x634e0
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x50(%rbp), %rax
movq $0x2, 0x8(%rax)
movq -0x50(%rbp), %rsi
leaq 0xb210(%rip), %rdi      # 0x6d1b9
xorl %eax, %eax
movl %eax, %edx
leaq 0x109b3(%rip), %rcx     # 0x72967
callq 0x63500
jmp 0x62052
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x314b0
movq %rax, %rsi
leaq 0x69dd(%rip), %rdi      # 0x689b6
callq 0x111e0
cmpl $0x0, %eax
jne 0x62028
movl $0x5, %edi
callq 0x63490
movq %rax, -0x58(%rbp)
callq 0x635d0
movl %eax, %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x58(%rbp), %rax
movq $0x2, 0x8(%rax)
movq -0x58(%rbp), %rsi
leaq 0xb1a3(%rip), %rdi      # 0x6d1b9
xorl %eax, %eax
movl %eax, %edx
leaq 0x10961(%rip), %rcx     # 0x72982
callq 0x63500
jmp 0x62050
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x635f0
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rsi
leaq 0xb175(%rip), %rdi      # 0x6d1b9
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0x63500
jmp 0x62052
jmp 0x62054
jmp 0x62064
leaq 0x9aa6(%rip), %rdi      # 0x6bb03
movb $0x0, %al
callq 0x11110
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)