// File: /workspace/github_cpp_makefile_star2_O3/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 0x4978(%rip), %rdi      # 0x7fd8
leaq 0x1ad9(%rip), %rsi      # 0x5140
movl $0x1d, %edx
callq 0x21d0
movq 0x4b70(%rip), %rcx      # 0x81e8
movq 0x8(%rcx), %rax
cmpq %rax, 0x10(%rcx)
je 0x389f
xorl %r13d, %r13d
movq 0x4948(%rip), %rbx      # 0x7fd8
leaq 0x1ade(%rip), %r15      # 0x5175
leaq -0x48(%rbp), %r14
movq (%rax,%r13,8), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
cmpl $-0x3, %eax
je 0x376a
cmpl $-0x2, %eax
jne 0x387d
movl $0x13, %edx
movq %rbx, %rdi
leaq 0x1a98(%rip), %rsi      # 0x515e
callq 0x21d0
movq 0x4b16(%rip), %rax      # 0x81e8
movq 0x8(%rax), %rax
movq (%rax,%r13,8), %rax
movl 0x8(%rax), %esi
movq %r14, %rdi
callq 0x3486
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x21d0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3707
callq 0x2190
movq 0x4ada(%rip), %rax      # 0x81e8
movq 0x8(%rax), %rax
movq (%rax,%r13,8), %rax
movl 0x8(%rax), %eax
leal -0x10(%rax), %ecx
movl $0x2, %edx
movq %rbx, %rdi
cmpl $0x2, %ecx
jb 0x37e8
cmpl $0x14, %eax
je 0x3842
cmpl $0x3, %eax
jne 0x3875
leaq 0x1a2c(%rip), %rsi      # 0x5172
callq 0x21d0
movq 0x4a96(%rip), %rax      # 0x81e8
movq 0x8(%rax), %rax
movq (%rax,%r13,8), %rax
movl 0x10(%rax), %esi
movq %rbx, %rdi
callq 0x2260
jmp 0x386d
movl $0x13, %edx
movq %rbx, %rdi
leaq 0x19ff(%rip), %rsi      # 0x5178
callq 0x21d0
movq 0x4a63(%rip), %rax      # 0x81e8
movq 0x8(%rax), %rax
movq (%rax,%r13,8), %rax
movq 0x18(%rax), %rsi
movq 0x20(%rax), %rdx
movq %rbx, %rdi
callq 0x21d0
movl $0x2, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
movq 0x4a34(%rip), %r12      # 0x81e8
movq 0x8(%r12), %rax
movq (%rax,%r13,8), %rax
addq $0x58, %rax
movq %rax, 0x4a20(%rip)      # 0x81e8
callq 0x3648
movq %r12, 0x4a14(%rip)      # 0x81e8
movl $0x19, %edx
movq %rbx, %rdi
leaq 0x19a9(%rip), %rsi      # 0x518c
jmp 0x3878
leaq 0x1983(%rip), %rsi      # 0x5172
callq 0x21d0
movq 0x49ed(%rip), %rax      # 0x81e8
movq 0x8(%rax), %rax
movq (%rax,%r13,8), %rax
movl 0xc(%rax), %esi
movq %r14, %rdi
callq 0x3486
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x21d0
movl $0x2, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x387d
callq 0x2190
jmp 0x387d
leaq 0x1929(%rip), %rsi      # 0x5172
callq 0x21d0
movq 0x4993(%rip), %rax      # 0x81e8
movq 0x8(%rax), %rax
movq (%rax,%r13,8), %rax
movq 0x18(%rax), %rsi
movq 0x20(%rax), %rdx
movq %rbx, %rdi
callq 0x21d0
movl $0x2, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
incq %r13
movq 0x4961(%rip), %rcx      # 0x81e8
movq 0x8(%rcx), %rax
movq 0x10(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r13, %rcx
ja 0x369b
movq 0x4732(%rip), %rdi      # 0x7fd8
leaq 0x18f9(%rip), %rsi      # 0x51a6
movl $0x1b, %edx
callq 0x21d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x38c8
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x38dd
callq 0x2190
movq %rbx, %rdi
callq 0x2270