// File: /workspace/github_cpp_makefile_star2_O3/lhydave[P]SysYCompilerLab/back/no_alloc.cpp
// Function: no_alloc::gen_stmt(std::shared_ptr<eeyore_AST::stmt_node> const&)
void gen_stmt(const shared_ptr<stmt_node> &stmt)
{
	if (stmt->label != -1)
		tigger_dst << emit_label(stmt->label);
	switch (stmt->stmt_type)
	{
	case STMT_ASSIGN:
	{
		dbg_printf("assign stmt gen\n");
		auto stmt_new = std::static_pointer_cast<assign_node>(stmt);
		gen_assign(stmt_new->lval, stmt_new->rval);
		break;
	}
	case STMT_GOTO:
	{
		dbg_printf("goto stmt gen\n");
		auto stmt_new = std::static_pointer_cast<goto_node>(stmt);
		gen_goto(stmt_new);
		break;
	}
	case STMT_RET:
	{
		dbg_printf("ret stmt gen\n");
		auto stmt_new = std::static_pointer_cast<ret_node>(stmt);
		gen_ret(stmt_new);
		break;
	}
	case STMT_CALL:
	{
		dbg_printf("call stmt gen\n");
		auto stmt_new = std::static_pointer_cast<call_node>(stmt);
		gen_call(stmt_new);
		break;
	}
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq (%rdi), %rsi
movl 0x4(%rsi), %eax
cmpl $-0x1, %eax
je 0x1f80b
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl %eax, %esi
callq 0x1cae3
movq (%r14), %rsi
movq 0x8(%r14), %rdx
leaq 0x15c10(%rip), %rdi     # 0x353f8
callq 0x52a0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1f808
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
movq (%rbx), %rsi
movl (%rsi), %eax
cmpq $0x3, %rax
ja 0x1f954
leaq 0x9f6e(%rip), %rcx      # 0x2978c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x1f920
movq 0x15795(%rip), %rax     # 0x34fd0
cmpb $0x0, (%rax)
je 0x1f91b
incl 0x8(%r14)
jmp 0x1f920
movq %rsi, 0x8(%rsp)
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x1f8c1
movq 0x15769(%rip), %rcx     # 0x34fd0
cmpb $0x0, (%rcx)
je 0x1f8bd
incl 0x8(%rax)
jmp 0x1f8c1
movq %rsi, 0x28(%rsp)
movq 0x8(%rbx), %rax
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x1f8d1
movq 0x15745(%rip), %rcx     # 0x34fd0
cmpb $0x0, (%rcx)
je 0x1f8cd
incl 0x8(%rax)
jmp 0x1f8d1
movq %rsi, 0x8(%rsp)
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x1f93b
movq 0x1571d(%rip), %rcx     # 0x34fd0
cmpb $0x0, (%rcx)
je 0x1f937
incl 0x8(%rax)
jmp 0x1f93b
lock
incl 0x8(%rax)
leaq 0x8(%rsp), %rdi
callq 0x20369
jmp 0x1f945
lock
incl 0x8(%rax)
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xa050(%rip), %rdx      # 0x29931
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x6d8a
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x20473
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x1f914
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x30(%rsp), %rdi
jmp 0x1f94a
lock
incl 0x8(%r14)
leaq 0x8(%rsi), %rdi
addq $0x18, %rsi
callq 0x1f9cb
testq %r14, %r14
je 0x1f954
movq %r14, %rdi
jmp 0x1f94f
lock
incl 0x8(%rax)
leaq 0x8(%rsp), %rdi
callq 0x1fd5f
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1f954
callq 0x18806
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x1f98a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x1f98a
jmp 0x1f991
movq %rax, %rbx
testq %r14, %r14
je 0x1f9c3
movq %r14, %rdi
jmp 0x1f99e
movq %rax, %rbx
movq 0x30(%rsp), %rdi
jmp 0x1f999
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1f9c3
callq 0x18806
jmp 0x1f9c3
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1f9c3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
movq %rbx, %rdi
callq 0x54c0