// File: /workspace/github_cpp_makefile_star2_O1/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), %rax
cmpl $-0x1, 0x4(%rax)
je 0x1f893
movl 0x4(%rax), %esi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x1cafc
movq (%r14), %rsi
movq 0x8(%r14), %rdx
leaq 0x15b85(%rip), %rdi     # 0x353f8
callq 0x52a0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1f893
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
movq (%rbx), %rsi
movl (%rsi), %eax
cmpq $0x3, %rax
ja 0x1f9df
leaq 0x9e8b(%rip), %rcx      # 0x29734
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x1f9ab
movq 0x1570a(%rip), %rax     # 0x34fd0
cmpb $0x0, (%rax)
je 0x1f9a6
incl 0x8(%r14)
jmp 0x1f9ab
movq %rsi, 0x8(%rsp)
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x1f94c
movq 0x156de(%rip), %rcx     # 0x34fd0
cmpb $0x0, (%rcx)
je 0x1f948
incl 0x8(%rax)
jmp 0x1f94c
movq %rsi, 0x28(%rsp)
movq 0x8(%rbx), %rax
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x1f95c
movq 0x156ba(%rip), %rcx     # 0x34fd0
cmpb $0x0, (%rcx)
je 0x1f958
incl 0x8(%rax)
jmp 0x1f95c
movq %rsi, 0x8(%rsp)
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x1f9c6
movq 0x15692(%rip), %rcx     # 0x34fd0
cmpb $0x0, (%rcx)
je 0x1f9c2
incl 0x8(%rax)
jmp 0x1f9c6
lock
incl 0x8(%rax)
leaq 0x8(%rsp), %rdi
callq 0x203e0
jmp 0x1f9d0
lock
incl 0x8(%rax)
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x9f6d(%rip), %rdx      # 0x298d9
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x6ef6
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x204ea
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x1f99f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x30(%rsp), %rdi
jmp 0x1f9d5
lock
incl 0x8(%r14)
leaq 0x8(%rsi), %rdi
addq $0x18, %rsi
callq 0x1fa56
testq %r14, %r14
je 0x1f9df
movq %r14, %rdi
jmp 0x1f9da
lock
incl 0x8(%rax)
leaq 0x8(%rsp), %rdi
callq 0x1fdea
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1f9df
callq 0x18722
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x1fa15
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x1fa15
jmp 0x1fa1c
movq %rax, %rbx
testq %r14, %r14
je 0x1fa4e
movq %r14, %rdi
jmp 0x1fa29
movq %rax, %rbx
movq 0x30(%rsp), %rdi
jmp 0x1fa24
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1fa4e
callq 0x18722
jmp 0x1fa4e
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1fa4e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
movq %rbx, %rdi
callq 0x54c0