// File: /workspace/github_cpp_makefile_star2_O1/Danis98[P]PietGen/parse.cpp
// Function: parse_stmt()
void parse_stmt(){
	token t=get_tok();
	NStatement *stmt=new NStatement;
	stmt->cmd=keyword_map[t];
	if(keyword_map[t]==TOK_PROC){
		stmt=new NProcedure;
		if(nested) parse_error("Procedures cannot be nested");
		NStatementList *prev_node=cur_node;
		token id=get_tok();
		if(keyword_map[id]!=TOK_INVALID)
			parse_error("Keywords are not permitted as procedure IDs: "
					+id+" used\n");
		nested=true;
		cur_node=&(((NProcedure*)stmt)->block);
		parse_stmt_list();
		cur_node=prev_node;
		nested=false;
		token end=get_tok();
		if(keyword_map[end]!=TOK_END)
			parse_error("Procedures must be ended with the end keyword");
	}
	else if(keyword_map[t]==TOK_PUSH){
		token v=get_tok();
		int val=to_num(v);
		if(val==-1) parse_error("Only integers can be pushed into the stack: "
					+v+" pushed instead");
		stmt->val=val;
	}
	else if(keyword_map[t]==TOK_IN){
		token io=get_tok();
		if(keyword_map[io]!=TOK_INT && keyword_map[io]!=TOK_CHAR)
			parse_error("Wrong token: "+io);
		stmt->io_type=keyword_map[io];}
	else if(keyword_map[t]==TOK_OUT){
		token io=get_tok();
		if(keyword_map[io]!=TOK_INT && keyword_map[io]!=TOK_CHAR)
			parse_error("Wrong token: "+io);
		stmt->io_type=keyword_map[io];
	}
	else if(keyword_map[t]==TOK_CALL){
		token id=get_tok();
		if(keyword_map[id]!=TOK_INVALID)
			parse_error("Keywords are not permitted as procedure IDs: "
					+id+" used\n");
		stmt->id=id;
	}
	
	cur_node->stmts.push_back(stmt);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movslq 0x48d4(%rip), %rax      # 0x81f0
leal 0x1(%rax), %ecx
movl %ecx, 0x48cb(%rip)      # 0x81f0
leaq 0x484c(%rip), %rbx      # 0x8178
movq (%rbx), %rcx
shlq $0x5, %rax
leaq -0x80(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x26ac
movl $0x38, %edi
callq 0x21b0
leaq 0x43dc(%rip), %rcx      # 0x7d40
movq %rcx, (%rax)
movq %rax, %rcx
addq $0x28, %rcx
movq %rcx, 0x18(%rax)
movq $0x0, 0x20(%rax)
movb $0x0, 0x28(%rax)
movq %rax, -0x30(%rbp)
leaq 0x482f(%rip), %rdi      # 0x81b8
leaq -0x90(%rbp), %rsi
callq 0x43ce
movl (%rax), %eax
movq -0x30(%rbp), %rcx
movl %eax, 0x8(%rcx)
leaq 0x4813(%rip), %rdi      # 0x81b8
leaq -0x90(%rbp), %rsi
callq 0x43ce
cmpl $0x1, (%rax)
jne 0x3afa
movl $0x78, %edi
callq 0x21b0
leaq 0x28(%rax), %rcx
movq %rcx, 0x18(%rax)
xorl %ecx, %ecx
movq %rcx, 0x20(%rax)
movb %cl, 0x28(%rax)
leaq 0x43a4(%rip), %rdx      # 0x7d80
movq %rdx, (%rax)
movq %rax, %rdx
addq $0x48, %rdx
movq %rdx, 0x38(%rax)
movq %rcx, 0x40(%rax)
movb %cl, 0x48(%rax)
leaq 0x42f8(%rip), %rdx      # 0x7cf0
movq %rdx, 0x58(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%rax)
movq %rcx, 0x70(%rax)
movq %rax, -0x30(%rbp)
cmpb $0x1, 0x47e2(%rip)      # 0x81f4
je 0x3de0
movq 0x47c9(%rip), %r12      # 0x81e8
movslq 0x47ca(%rip), %rax      # 0x81f0
leal 0x1(%rax), %ecx
movl %ecx, 0x47c1(%rip)      # 0x81f0
movq (%rbx), %rcx
shlq $0x5, %rax
leaq -0x40(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x26ac
leaq 0x475e(%rip), %rdi      # 0x81b8
leaq -0x50(%rbp), %rsi
callq 0x43ce
cmpl $0x0, (%rax)
jne 0x3e11
movb $0x1, 0x4781(%rip)      # 0x81f4
movq -0x30(%rbp), %rax
addq $0x58, %rax
movq %rax, 0x4766(%rip)      # 0x81e8
callq 0x40f0
movq %r12, 0x475a(%rip)      # 0x81e8
movb $0x0, 0x475f(%rip)      # 0x81f4
movslq 0x4754(%rip), %rax      # 0x81f0
leal 0x1(%rax), %ecx
movl %ecx, 0x474b(%rip)      # 0x81f0
movq (%rbx), %rcx
shlq $0x5, %rax
leaq -0x60(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %rdi
callq 0x26ac
leaq 0x46e7(%rip), %rdi      # 0x81b8
leaq -0x70(%rbp), %rsi
callq 0x43ce
cmpl $0x2, (%rax)
jne 0x3e61
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
je 0x3d08
callq 0x2190
jmp 0x3d08
leaq 0x46b7(%rip), %rdi      # 0x81b8
leaq -0x90(%rbp), %rsi
callq 0x43ce
cmpl $0x3, (%rax)
jne 0x3bb2
movslq 0x46d3(%rip), %rax      # 0x81f0
leal 0x1(%rax), %ecx
movl %ecx, 0x46ca(%rip)      # 0x81f0
movq (%rbx), %rcx
shlq $0x5, %rax
leaq -0x40(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x26ac
leaq -0xe0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf0(%rbp), %rdi
callq 0x26ac
movq -0xe8(%rbp), %rax
testq %rax, %rax
je 0x3cda
xorl %ecx, %ecx
movq -0xf0(%rbp), %rdx
xorl %r12d, %r12d
movzbl (%rdx,%rcx), %esi
leal -0x3a(%rsi), %edi
cmpb $-0xa, %dil
jb 0x3cdf
leal (%r12,%r12,4), %edi
leal (%rsi,%rdi,2), %r12d
addl $-0x30, %r12d
incq %rcx
cmpq %rcx, %rax
jne 0x3b88
jmp 0x3ce5
leaq 0x45ff(%rip), %rdi      # 0x81b8
leaq -0x90(%rbp), %rsi
callq 0x43ce
cmpl $0x10, (%rax)
jne 0x3c41
movslq 0x461f(%rip), %rax      # 0x81f0
leal 0x1(%rax), %ecx
movl %ecx, 0x4616(%rip)      # 0x81f0
movq (%rbx), %rcx
shlq $0x5, %rax
leaq -0x40(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x26ac
leaq 0x45b3(%rip), %rdi      # 0x81b8
leaq -0x50(%rbp), %rsi
callq 0x43ce
cmpl $0x12, (%rax)
je 0x3c2c
leaq 0x459e(%rip), %rdi      # 0x81b8
leaq -0x50(%rbp), %rsi
callq 0x43ce
cmpl $0x13, (%rax)
jne 0x3f0f
leaq 0x4585(%rip), %rdi      # 0x81b8
leaq -0x50(%rbp), %rsi
callq 0x43ce
jmp 0x3ccf
leaq 0x4570(%rip), %rdi      # 0x81b8
leaq -0x90(%rbp), %rsi
callq 0x43ce
cmpl $0x11, (%rax)
jne 0x3d65
movslq 0x458c(%rip), %rax      # 0x81f0
leal 0x1(%rax), %ecx
movl %ecx, 0x4583(%rip)      # 0x81f0
movq (%rbx), %rcx
shlq $0x5, %rax
leaq -0x40(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x26ac
leaq 0x4520(%rip), %rdi      # 0x81b8
leaq -0x50(%rbp), %rsi
callq 0x43ce
cmpl $0x12, (%rax)
je 0x3cbf
leaq 0x450b(%rip), %rdi      # 0x81b8
leaq -0x50(%rbp), %rsi
callq 0x43ce
cmpl $0x13, (%rax)
jne 0x3f66
leaq 0x44f2(%rip), %rdi      # 0x81b8
leaq -0x50(%rbp), %rsi
callq 0x43ce
movl (%rax), %eax
movq -0x30(%rbp), %rcx
movl %eax, 0xc(%rcx)
jmp 0x3d08
xorl %r12d, %r12d
jmp 0x3ce5
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq -0xf0(%rbp), %rdi
cmpq %rbx, %rdi
je 0x3cf6
callq 0x2190
cmpl $-0x1, %r12d
je 0x3e92
movq -0x30(%rbp), %rax
movl %r12d, 0x10(%rax)
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x3d16
callq 0x2190
movq 0x44cb(%rip), %rdi      # 0x81e8
movq 0x10(%rdi), %rsi
cmpq 0x18(%rdi), %rsi
je 0x3d35
movq -0x30(%rbp), %rax
movq %rax, (%rsi)
addq $0x8, 0x10(%rdi)
jmp 0x3d42
addq $0x8, %rdi
leaq -0x30(%rbp), %rdx
callq 0x4b70
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x3d53
callq 0x2190
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x444c(%rip), %rdi      # 0x81b8
leaq -0x90(%rbp), %rsi
callq 0x43ce
cmpl $0x14, (%rax)
jne 0x3d16
movslq 0x446c(%rip), %rax      # 0x81f0
leal 0x1(%rax), %ecx
movl %ecx, 0x4463(%rip)      # 0x81f0
movq (%rbx), %rcx
shlq $0x5, %rax
leaq -0x40(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x26ac
leaq 0x4400(%rip), %rdi      # 0x81b8
leaq -0x50(%rbp), %rsi
callq 0x43ce
cmpl $0x0, (%rax)
jne 0x3f89
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
leaq -0x50(%rbp), %rsi
callq 0x20f0
jmp 0x3d08
leaq -0x140(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x13d0(%rip), %rsi      # 0x51c2
leaq 0x13e4(%rip), %rdx      # 0x51dd
leaq -0x150(%rbp), %rdi
callq 0x2746
leaq -0x150(%rbp), %rdi
callq 0x2e00
leaq 0x13c6(%rip), %rsi      # 0x51de
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x444d
leaq 0x13e0(%rip), %rsi      # 0x520c
leaq -0x70(%rbp), %rdi
callq 0x22a0
leaq -0x100(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x3edb
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x3eec
leaq -0x120(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x13a0(%rip), %rsi      # 0x5213
leaq 0x13c6(%rip), %rdx      # 0x5240
leaq -0x130(%rbp), %rdi
callq 0x2746
leaq -0x130(%rbp), %rdi
callq 0x2e00
leaq 0x13a8(%rip), %rsi      # 0x5241
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x444d
leaq 0x13c1(%rip), %rsi      # 0x526e
leaq -0x70(%rbp), %rdi
callq 0x22a0
leaq -0xc0(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x3f32
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x3f43
movq %rdx, -0x110(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x100(%rbp)
movq 0x8(%rax), %rdx
leaq -0x110(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x2e00
leaq 0x1368(%rip), %rsi      # 0x527e
leaq -0x190(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x444d
leaq -0x190(%rbp), %rdi
callq 0x2e00
movq %rdx, -0xd0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xc0(%rbp)
movq 0x8(%rax), %rdx
leaq -0xd0(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x2e00
leaq 0x1311(%rip), %rsi      # 0x527e
leaq -0x170(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x444d
leaq -0x170(%rbp), %rdi
callq 0x2e00
leaq 0x124e(%rip), %rsi      # 0x51de
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x444d
leaq 0x1268(%rip), %rsi      # 0x520c
leaq -0x70(%rbp), %rdi
callq 0x22a0
leaq -0xa0(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x3fd2
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x3fe3
movq %rdx, -0xb0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xa0(%rbp)
movq 0x8(%rax), %rdx
leaq -0xb0(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x2e00
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
jmp 0x4058
jmp 0x4064
jmp 0x40c1
movq %rax, %rbx
leaq -0x160(%rbp), %rax
jmp 0x406b
movq %rax, %rbx
leaq -0x180(%rbp), %rax
jmp 0x406b
jmp 0x40d4
jmp 0x40c1
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
jmp 0x4058
jmp 0x4064
jmp 0x40d4
movq %rax, %rbx
movq -0x110(%rbp), %rdi
cmpq %r12, %rdi
je 0x4067
callq 0x2190
jmp 0x4067
movq %rax, %rbx
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x40b6
jmp 0x40c4
jmp 0x40c1
jmp 0x40d4
jmp 0x40c1
movq %rax, %rbx
movq -0x130(%rbp), %rdi
cmpq %r13, %rdi
je 0x40ad
callq 0x2190
jmp 0x40ad
jmp 0x40aa
jmp 0x40c1
jmp 0x40c1
movq %rax, %rbx
movq -0x150(%rbp), %rdi
jmp 0x40c8
jmp 0x40d4
jmp 0x40d4
jmp 0x40c1
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
je 0x40c4
callq 0x2190
jmp 0x40c4
jmp 0x40c1
jmp 0x40d4
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x40d7
callq 0x2190
jmp 0x40d7
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x40e8
callq 0x2190
movq %rbx, %rdi
callq 0x2270