// File: /workspace/github_c_makefile_star2_O2/lucvoo[P]sparse-dev/dissect.c
// Function: do_statement
static struct symbol *do_statement(usage_t mode, struct statement *stmt)
{
	struct symbol *ret = &void_ctype;

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

	case STMT_NONE:
	case STMT_RANGE:
	case STMT_CONTEXT:

	break; case STMT_DECLARATION:
		do_sym_list(stmt->declaration);

	break; case STMT_EXPRESSION:
		ret = do_expression(mode, stmt->expression);

	break; case STMT_RETURN: {
		struct symbol *type = dissect_ctx->ctype.base_type;
		do_expression(u_lval(base_type(type)), stmt->expression);
	}

	break; case STMT_ASM:
		do_expression(U_R_VAL, stmt->asm_string);
		do_asm_xputs(U_W_VAL, stmt->asm_outputs);
		do_asm_xputs(U_R_VAL, stmt->asm_inputs);

	break; case STMT_COMPOUND: {
		int count;

		count = statement_list_size(stmt->stmts);
		DO_LIST(stmt->stmts, st,
			ret = do_statement(--count ? U_VOID : mode, st));
	}

	break; case STMT_ITERATOR:
		do_sym_list(stmt->iterator_syms);
		do_statement(U_VOID, stmt->iterator_pre_statement);
		do_expression(U_R_VAL, stmt->iterator_pre_condition);
		do_statement(U_VOID, stmt->iterator_post_statement);
		do_statement(U_VOID, stmt->iterator_statement);
		do_expression(U_R_VAL, stmt->iterator_post_condition);

	break; case STMT_IF:
		do_expression(U_R_VAL, stmt->if_conditional);
		do_statement(U_VOID, stmt->if_true);
		do_statement(U_VOID, stmt->if_false);

	break; case STMT_SWITCH:
		do_expression(U_R_VAL, stmt->switch_expression);
		do_statement(U_VOID, stmt->switch_statement);

	break; case STMT_CASE:
		do_expression(U_R_VAL, stmt->case_expression);
		do_expression(U_R_VAL, stmt->case_to);
		do_statement(U_VOID, stmt->case_statement);

	break; case STMT_GOTO:
		do_expression(U_R_PTR, stmt->goto_expression);

	break; case STMT_LABEL:
		do_statement(mode, stmt->label_statement);

	}

	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
xorl %r12d, %r12d
leaq 0x5979f(%rip), %rbx     # 0x6b470
leaq 0x2c834(%rip), %r13     # 0x3e50c
pushq $0x4
popq %r15
pushq $0x20
popq %rcx
pushq $0x18
popq %rsi
testq %r14, %r14
je 0x11eb7
movl (%r14), %edx
cmpq $0xd, %rdx
ja 0x11ea5
movslq (%r13,%rdx,4), %rax
addq %r13, %rax
jmpq *%rax
movq 0x20(%r14), %r14
movb $0x1, %r12b
jmp 0x11ce2
movq %rsi, %rbp
movq 0x10(%r14), %rsi
movl %r15d, %edi
movq %rcx, %r12
callq 0x11701
movq 0x18(%r14), %rsi
movl %r15d, %edi
callq 0x11701
jmp 0x11d48
movq %rsi, %rbp
movq 0x10(%r14), %rsi
movl %r15d, %edi
movq %rcx, %r12
callq 0x11701
movq 0x18(%r14), %rsi
xorl %edi, %edi
callq 0x11cb7
movq %rbp, %rsi
movq %r12, %rcx
movq %r12, %rax
jmp 0x11d6e
movq %rsi, %rbp
movq 0x10(%r14), %rsi
movl %r15d, %edi
movq %rcx, %r12
callq 0x11701
movq %rbp, %rsi
movq %r12, %rcx
movq %rbp, %rax
movq (%r14,%rax), %r14
movb $0x1, %r12b
xorl %ebp, %ebp
jmp 0x11ce2
movq 0x18(%r14), %rsi
movl $0x400, %edi            # imm = 0x400
jmp 0x11e9e
movq 0x10(%r14), %rdi
callq 0x1c380
movl %eax, %r15d
movq 0x10(%r14), %rax
movq %rax, (%rsp)
testq %rax, %rax
je 0x11eb7
leaq 0x596c2(%rip), %rbx     # 0x6b470
movq (%rsp), %r13
xorl %r14d, %r14d
movl (%r13), %eax
movsbq %al, %rcx
cmpq %rcx, %r14
jge 0x11dea
movq 0x18(%r13,%r14,8), %rsi
cmpw $0x100, %ax             # imm = 0x100
jb 0x11dd2
testq %rsi, %rsi
je 0x11de5
decl %r15d
movl $0x0, %edi
cmovel %ebp, %edi
callq 0x11cb7
movq %rax, %rbx
incq %r14
jmp 0x11db5
movq 0x10(%r13), %r13
cmpq (%rsp), %r13
jne 0x11db2
jmp 0x11eb7
movq 0x20(%r14), %rdi
callq 0x113af
movq 0x28(%r14), %rsi
xorl %edi, %edi
callq 0x11cb7
movq 0x30(%r14), %rsi
pushq $0x4
popq %rbx
movl %ebx, %edi
callq 0x11701
movq 0x40(%r14), %rsi
xorl %edi, %edi
callq 0x11cb7
movq 0x38(%r14), %rsi
xorl %edi, %edi
callq 0x11cb7
movq 0x48(%r14), %rsi
movl %ebx, %edi
callq 0x11701
jmp 0x11ebd
movq 0x10(%r14), %rsi
movl %ebp, %edi
callq 0x11701
movq %rax, %rbx
jmp 0x11eb7
movq 0x10(%r14), %rdi
callq 0x113af
jmp 0x11eb7
movq 0x10(%r14), %rsi
pushq $0x4
popq %rbp
movl %ebp, %edi
callq 0x11701
movq 0x18(%r14), %rsi
pushq $0x8
popq %rdi
callq 0x12215
movq 0x20(%r14), %rsi
movl %ebp, %edi
callq 0x12215
jmp 0x11eb7
movq 0x54d59(%rip), %rax     # 0x66be0
movq 0x60(%rax), %rdi
callq 0x11ed6
movq %rax, %rdi
callq 0x1207b
movq 0x10(%r14), %rsi
movl %eax, %edi
callq 0x11701
jmp 0x11eb7
movq 0x4(%r14), %rdi
leaq 0x2c6cf(%rip), %rsi     # 0x3e57f
xorl %eax, %eax
callq 0x1263a
testb $0x1, %r12b
je 0x11ec4
leaq 0x595ac(%rip), %rbx     # 0x6b470
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq