// File: /workspace/github_cpp_makefile_star2_O2/Danis98[P]PietGen/parse.cpp
// Function: print_ast()
void print_ast(){
	std::cout<<"[DEBUG] BEGIN STATEMENT LIST\n";
	for(int i=0;i<cur_node->stmts.size();i++){
		int type=cur_node->stmts[i]->getID();
		switch(type){
		case STMT:
			std::cout<<"[DEBUG] STATEMENT {"<<keyword_to_str(cur_node->stmts[i]->cmd);
			if(cur_node->stmts[i]->cmd==TOK_PUSH)
				std::cout<<", "<<cur_node->stmts[i]->val<<"}\n";
			else if(cur_node->stmts[i]->cmd==TOK_IN || cur_node->stmts[i]->cmd==TOK_OUT)
				std::cout<<", "<<keyword_to_str(cur_node->stmts[i]->io_type)<<"}\n";
			else if(cur_node->stmts[i]->cmd==TOK_CALL)
				std::cout<<", "<<cur_node->stmts[i]->id<<"}\n";
			else
				std::cout<<"}\n";
			break;
		case PROC:{
			std::cout<<"[DEBUG] PROCEDURE {"<<cur_node->stmts[i]->id<<"}\n";
			NStatementList *prev=cur_node;
			cur_node=&(((NProcedure*)cur_node->stmts[i])->block);
			print_ast();
			cur_node=prev;
			std::cout<<"[DEBUG] END OF PROCEDURE\n";
			break;}
		default: break;
		}
	}
	std::cout<<"[DEBUG] END STATEMENT LIST\n";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x4ea3(%rip), %rbx      # 0x7fd8
leaq 0x1fd8(%rip), %rsi      # 0x5114
movq %rbx, %rdi
callq 0x2180
xorl %r13d, %r13d
leaq 0x1ffb(%rip), %r15      # 0x5149
leaq -0x48(%rbp), %r14
movq 0x5087(%rip), %rcx      # 0x81e0
movq 0x8(%rcx), %rax
movq 0x10(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r13, %rcx
jbe 0x3315
movq (%rax,%r13,8), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
cmpl $-0x3, %eax
je 0x322a
cmpl $-0x2, %eax
jne 0x330d
movq %rbx, %rdi
leaq 0x1f9b(%rip), %rsi      # 0x5132
callq 0x2180
movq %rax, %r12
movq 0x503a(%rip), %rax      # 0x81e0
movq 0x8(%rax), %rax
movq (%rax,%r13,8), %rax
movl 0x8(%rax), %esi
movq %r14, %rdi
callq 0x300a
movq %r12, %rdi
movq %r14, %rsi
callq 0x2160
movq %r14, %rdi
callq 0x20d0
movq 0x500d(%rip), %rax      # 0x81e0
movq 0x8(%rax), %rax
movq (%rax,%r13,8), %rax
movl 0x8(%rax), %eax
leal -0x10(%rax), %ecx
movq %rbx, %rdi
cmpl $0x2, %ecx
jb 0x3292
cmpl $0x14, %eax
je 0x32db
cmpl $0x3, %eax
jne 0x3305
leaq 0x1f40(%rip), %rsi      # 0x5146
callq 0x2180
movq 0x4fce(%rip), %rcx      # 0x81e0
movq 0x8(%rcx), %rcx
movq (%rcx,%r13,8), %rcx
movl 0x10(%rcx), %esi
movq %rax, %rdi
callq 0x2240
jmp 0x3302
movq %rbx, %rdi
leaq 0x1f18(%rip), %rsi      # 0x514c
callq 0x2180
movq 0x4fa0(%rip), %rcx      # 0x81e0
movq 0x8(%rcx), %rcx
movq (%rcx,%r13,8), %rsi
addq $0x18, %rsi
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
movq %r15, %rsi
callq 0x2180
movq 0x4f7a(%rip), %r12      # 0x81e0
movq 0x8(%r12), %rax
movq (%rax,%r13,8), %rax
addq $0x58, %rax
movq %rax, 0x4f66(%rip)      # 0x81e0
callq 0x311d
movq %r12, 0x4f5a(%rip)      # 0x81e0
movq %rbx, %rdi
leaq 0x1ed0(%rip), %rsi      # 0x5160
jmp 0x3308
leaq 0x1ead(%rip), %rsi      # 0x5146
callq 0x2180
movq %rax, %r12
movq 0x4f38(%rip), %rax      # 0x81e0
movq 0x8(%rax), %rax
movq (%rax,%r13,8), %rax
movl 0xc(%rax), %esi
movq %r14, %rdi
callq 0x300a
movq %r12, %rdi
movq %r14, %rsi
callq 0x2160
movq %rax, %rdi
movq %r15, %rsi
callq 0x2180
movq %r14, %rdi
callq 0x20d0
jmp 0x330d
leaq 0x1e64(%rip), %rsi      # 0x5146
callq 0x2180
movq 0x4ef2(%rip), %rcx      # 0x81e0
movq 0x8(%rcx), %rcx
movq (%rcx,%r13,8), %rsi
addq $0x18, %rsi
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
movq %r15, %rsi
callq 0x2180
incq %r13
jmp 0x3152
movq 0x4cbc(%rip), %rdi      # 0x7fd8
leaq 0x1e57(%rip), %rsi      # 0x517a
callq 0x2180
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3339
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x2250