// File: /workspace/github_c_makefile_star2_O2/lucvoo[P]sparse-dev/ast-inspect.c
// Function: inspect_statement
void inspect_statement(AstNode *node)
{
	struct statement *stmt = node->ptr;
	node->text = g_strdup_printf("%s %s:", node->text, statement_type_name(stmt->type));
	switch (stmt->type) {
		case STMT_COMPOUND:
			ast_append_child(node, "stmts:", stmt->stmts, inspect_statement_list);
			break;
		case STMT_EXPRESSION:
			ast_append_child(node, "expression:", stmt->expression, inspect_expression);
			break;
		case STMT_IF:
			ast_append_child(node, "conditional:", stmt->if_conditional, inspect_expression);
			ast_append_child(node, "if_true:", stmt->if_true, inspect_statement);
			ast_append_child(node, "if_false:", stmt->if_false, inspect_statement);
			break;
		case STMT_ITERATOR:
			ast_append_child(node, "break:", stmt->iterator_break, inspect_symbol);
			ast_append_child(node, "continue:", stmt->iterator_continue, inspect_symbol);
			ast_append_child(node, "pre_statement:", stmt->iterator_pre_statement,
					 inspect_statement);
			ast_append_child(node, "statement:", stmt->iterator_statement,
					 inspect_statement);
			ast_append_child(node, "post_statement:", stmt->iterator_post_statement,
					 inspect_statement);
			break;

		case STMT_SWITCH:
			ast_append_child(node, "switch_expression:", stmt->switch_expression, inspect_expression);
			ast_append_child(node, "switch_statement:", stmt->switch_statement, inspect_statement);
			ast_append_child(node, "switch_break:", stmt->switch_break, inspect_symbol);
			ast_append_child(node, "switch_case:", stmt->switch_case, inspect_symbol);
			break;
		case STMT_CASE:
			ast_append_child(node, "case_expression:", stmt->case_expression, inspect_expression);
			ast_append_child(node, "case_to:", stmt->case_to, inspect_expression);
			ast_append_child(node, "case_statement:", stmt->case_statement, inspect_statement);
			ast_append_child(node, "case_label:", stmt->case_label, inspect_symbol);
			break;
		case STMT_RETURN:
			ast_append_child(node, "ret_value:", stmt->ret_value, inspect_expression);
			ast_append_child(node, "ret_target:", stmt->ret_target, inspect_symbol);
			break;

		default:
			break;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rsi
movq 0x38(%rdi), %r15
movl (%r15), %eax
leaq 0xcda6(%rip), %rcx      # 0x46b74
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
leaq 0xce14(%rip), %rdi      # 0x46bf0
xorl %eax, %eax
callq 0xf1f0
movq %rax, 0x28(%rbx)
movl (%r15), %eax
addl $-0x2, %eax
cmpl $0x6, %eax
ja 0x39eec
leaq 0xcd13(%rip), %rcx      # 0x46b10
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%r15), %rdx
leaq 0xce6e(%rip), %rsi      # 0x46c7f
leaq 0x21f(%rip), %rcx       # 0x3a037
jmp 0x39f04
movq 0x10(%r15), %rdx
leaq 0xce52(%rip), %rsi      # 0x46c7a
leaq 0x208(%rip), %r14       # 0x3a037
movq %rbx, %rdi
movq %r14, %rcx
callq 0x39fe8
movq 0x18(%r15), %rdx
leaq 0xce46(%rip), %rsi      # 0x46c8b
movq %rbx, %rdi
movq %r14, %rcx
callq 0x39fe8
movq 0x20(%r15), %rdx
leaq 0xce39(%rip), %rsi      # 0x46c94
leaq -0xae(%rip), %rcx       # 0x39db4
movq %rbx, %rdi
callq 0x39fe8
movq 0x28(%r15), %rdx
leaq 0xce2f(%rip), %rsi      # 0x46ca4
jmp 0x39ee3
movq 0x10(%r15), %rdx
leaq 0x9258(%rip), %rsi      # 0x430da
leaq 0x1ae(%rip), %rcx       # 0x3a037
movq %rbx, %rdi
callq 0x39fe8
movq 0x18(%r15), %rdx
leaq 0xcd62(%rip), %rsi      # 0x46bfe
leaq -0xef(%rip), %r14       # 0x39db4
movq %rbx, %rdi
movq %r14, %rcx
callq 0x39fe8
movq 0x20(%r15), %rdx
leaq 0xcd4e(%rip), %rsi      # 0x46c07
jmp 0x39fdb
movq 0x10(%r15), %rdx
leaq 0xcde7(%rip), %rsi      # 0x46cb0
leaq 0x167(%rip), %rcx       # 0x3a037
movq %rbx, %rdi
callq 0x39fe8
movq 0x18(%r15), %rdx
leaq 0xcdd8(%rip), %rsi      # 0x46cbb
leaq 0x237(%rip), %rcx       # 0x3a121
jmp 0x39f04
popq %rbx
popq %r14
popq %r15
retq
movq 0x10(%r15), %rdx
leaq 0xccfa(%rip), %rsi      # 0x46bf7
leaq 0x120(%rip), %rcx       # 0x3a024
movq %rbx, %rdi
jmp 0x39fe1
movq 0x10(%r15), %rdx
leaq 0xcd23(%rip), %rsi      # 0x46c3a
leaq 0x119(%rip), %rcx       # 0x3a037
movq %rbx, %rdi
callq 0x39fe8
movq 0x18(%r15), %rdx
leaq 0xcd1c(%rip), %rsi      # 0x46c4d
leaq -0x184(%rip), %rcx      # 0x39db4
movq %rbx, %rdi
callq 0x39fe8
movq 0x20(%r15), %rdx
leaq 0xcd14(%rip), %rsi      # 0x46c5f
leaq 0x1cf(%rip), %r14       # 0x3a121
movq %rbx, %rdi
movq %r14, %rcx
callq 0x39fe8
movq 0x28(%r15), %rdx
leaq 0xcd05(%rip), %rsi      # 0x46c6d
jmp 0x39fdb
movq 0x10(%r15), %rdx
leaq 0xccf1(%rip), %rsi      # 0x46c66
leaq 0x1a5(%rip), %r14       # 0x3a121
movq %rbx, %rdi
movq %r14, %rcx
callq 0x39fe8
movq 0x18(%r15), %rdx
leaq 0xcc7f(%rip), %rsi      # 0x46c11
movq %rbx, %rdi
movq %r14, %rcx
callq 0x39fe8
movq 0x28(%r15), %rdx
leaq 0xcc73(%rip), %rsi      # 0x46c1b
leaq -0x1fb(%rip), %r14      # 0x39db4
movq %rbx, %rdi
movq %r14, %rcx
callq 0x39fe8
movq 0x38(%r15), %rdx
leaq 0xcc5a(%rip), %rsi      # 0x46c1f
movq %rbx, %rdi
movq %r14, %rcx
callq 0x39fe8
movq 0x40(%r15), %rdx
leaq 0xcc4f(%rip), %rsi      # 0x46c2a
movq %rbx, %rdi
movq %r14, %rcx
popq %rbx
popq %r14
popq %r15
jmp 0x39fe8