// File: /workspace/github_cpp_makefile_star2_O3/AndrewAlbert[P]Compiler-Theory/SourceCode/parser.cpp
// Function: Parser::declareRunTime()
void Parser::declareRunTime(){
	//Procedure to be added to the symbol tables
	scopeValue procVal;
	procVal.size = 0;
	procVal.type = TYPE_PROCEDURE;
	procVal.paramType = TYPE_PARAM_NULL;
	
	// input / output parameter of the runtime procedure
	scopeValue inputVal;
	inputVal.arguments.clear();
	
	string IDs[10] = {"GETBOOL", "GETINTEGER", "GETFLOAT", "GETSTRING", "GETCHAR", "PUTBOOL", "PUTINTEGER", "PUTFLOAT", "PUTSTRING", "PUTCHAR"};
	int ParamTypes[10] = {TYPE_PARAM_OUT, TYPE_PARAM_OUT, TYPE_PARAM_OUT, TYPE_PARAM_OUT, TYPE_PARAM_OUT, TYPE_PARAM_IN, TYPE_PARAM_IN, TYPE_PARAM_IN, TYPE_PARAM_IN, TYPE_PARAM_IN};
	int Types[10] = {TYPE_BOOL, TYPE_INTEGER, TYPE_FLOAT, TYPE_STRING, TYPE_CHAR, TYPE_BOOL, TYPE_INTEGER, TYPE_FLOAT, TYPE_STRING, TYPE_CHAR};

	for(int i = 0; i < 10; i++){
		//clear parameter list
		procVal.arguments.clear();
		
		inputVal.size = 0;

		//get new parameter values
		inputVal.type = Types[i];
		inputVal.paramType = ParamTypes[i];
		
		//start new parameter list
		procVal.arguments.push_back(inputVal);
		
		//add procedure as a global symbol to the outermost scope
		string symbolID = IDs[i];
		procVal.CallLabel = IDs[i];
		Scopes->addSymbol(symbolID, procVal, true);
	}
	return;	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rdi, 0x40(%rsp)
xorps %xmm0, %xmm0
leaq 0xc0(%rsp), %rcx
movups %xmm0, -0x28(%rcx)
xorl %eax, %eax
movq %rax, -0x18(%rcx)
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq $0x11e, -0x30(%rcx)     # imm = 0x11E
movl $0x122, 0x10(%rcx)      # imm = 0x122
leaq 0xe0(%rsp), %rdi
movq %rax, 0x10(%rdi)
movups %xmm0, (%rdi)
leaq 0x108(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
xorl %esi, %esi
callq 0xe698
leaq 0x130(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x13412(%rip), %rsi     # 0x192f9
leaq 0x13412(%rip), %rdx     # 0x19300
leaq 0x120(%rsp), %rbx
movq %rbx, %rdi
callq 0x3c42
leaq 0x140(%rsp), %r12
leaq 0x150(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x133e8(%rip), %rsi     # 0x19301
leaq 0x133eb(%rip), %rdx     # 0x1930b
movq %r12, %rdi
callq 0x3c42
leaq 0x160(%rsp), %r12
leaq 0x170(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x133c9(%rip), %rsi     # 0x1930c
leaq 0x133ca(%rip), %rdx     # 0x19314
movq %r12, %rdi
callq 0x3c42
leaq 0x180(%rsp), %r12
leaq 0x190(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x133a8(%rip), %rsi     # 0x19315
leaq 0x133aa(%rip), %rdx     # 0x1931e
movq %r12, %rdi
callq 0x3c42
leaq 0x1a0(%rsp), %r12
leaq 0x1b0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x13388(%rip), %rsi     # 0x1931f
leaq 0x13388(%rip), %rdx     # 0x19326
movq %r12, %rdi
callq 0x3c42
leaq 0x1c0(%rsp), %r12
leaq 0x1d0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x13366(%rip), %rsi     # 0x19327
leaq 0x13366(%rip), %rdx     # 0x1932e
movq %r12, %rdi
callq 0x3c42
leaq 0x1e0(%rsp), %r12
leaq 0x1f0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x13344(%rip), %rsi     # 0x1932f
leaq 0x13347(%rip), %rdx     # 0x19339
movq %r12, %rdi
callq 0x3c42
leaq 0x200(%rsp), %r12
leaq 0x210(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x13325(%rip), %rsi     # 0x1933a
leaq 0x13326(%rip), %rdx     # 0x19342
movq %r12, %rdi
callq 0x3c42
leaq 0x220(%rsp), %r12
leaq 0x230(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x13304(%rip), %rsi     # 0x19343
leaq 0x13306(%rip), %rdx     # 0x1934c
movq %r12, %rdi
callq 0x3c42
leaq 0x240(%rsp), %r12
leaq 0x250(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x132e4(%rip), %rsi     # 0x1934d
leaq 0x132e4(%rip), %rdx     # 0x19354
movq %r12, %rdi
callq 0x3c42
leaq 0x98(%rsp), %r12
xorl %r13d, %r13d
leaq 0x20(%rsp), %rbp
movq 0x98(%rsp), %rsi
movq %r12, %rdi
callq 0xe698
movl $0x0, 0xdc(%rsp)
leaq 0x146e6(%rip), %rax     # 0x1a790
movl (%r13,%rax), %eax
movl %eax, 0xd8(%rsp)
leaq 0x146a3(%rip), %rax     # 0x1a760
movl (%r13,%rax), %eax
movl %eax, 0x118(%rsp)
movq %r12, %rdi
leaq 0xd8(%rsp), %rsi
callq 0xdd50
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x3bac
leaq 0xb0(%rsp), %rdi
movq %rbx, %rsi
callq 0x2120
movq 0x40(%rsp), %rax
movq 0x90(%rax), %r15
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x3bac
movq 0x90(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0xdfee
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x3bac
movq 0xd0(%rsp), %rax
movq %rax, 0x88(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
leaq 0x48(%rsp), %rdx
movl $0x1, %ecx
callq 0xfb86
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x61b0
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x50(%rsp), %rdi
callq 0xdda4
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x61d6
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x61f1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2200
addq $0x20, %rbx
addq $0x4, %r13
cmpq $0x28, %r13
jne 0x6088
movq $-0x140, %rbx           # imm = 0xFEC0
leaq 0xc0(%rsp), %r15
leaq 0xe0(%rsp), %r13
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x622e
movq (%r14), %rsi
incq %rsi
callq 0x2200
addq $-0x20, %r14
addq $0x20, %rbx
jne 0x621a
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x625d
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x2200
movq %r13, %rdi
callq 0xdda4
movq 0xb0(%rsp), %rdi
cmpq %r15, %rdi
je 0x6282
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x2200
movq %r12, %rdi
callq 0xdda4
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x62ac
jmp 0x62ac
jmp 0x62ac
jmp 0x62ac
jmp 0x62ac
jmp 0x62ac
jmp 0x62ac
jmp 0x62ac
movq %rax, %r15
addq $-0x10, %r12
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x62c9
movq (%r12), %rsi
incq %rsi
callq 0x2200
leaq -0x20(%r12), %rax
addq $-0x10, %r12
cmpq %rbx, %r12
movq %rax, %r12
jne 0x62b3
jmp 0x6376
movq %rax, %r15
jmp 0x6376
jmp 0x62e9
movq %rax, %r15
jmp 0x634b
movq %rax, %r15
jmp 0x630f
movq %rax, %r15
leaq 0x50(%rsp), %rdi
callq 0xdda4
jmp 0x630f
movq %rax, %r15
leaq 0x48(%rsp), %rdi
callq 0xdd7a
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x6330
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x6330
movq %rax, %r15
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x634b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2200
xorl %ebx, %ebx
movq 0x240(%rsp,%rbx), %rdi
leaq (%r14,%rbx), %rax
cmpq %rdi, %rax
je 0x6369
movq (%rax), %rsi
incq %rsi
callq 0x2200
addq $-0x20, %rbx
cmpq $-0x140, %rbx           # imm = 0xFEC0
jne 0x634d
leaq 0xd8(%rsp), %rdi
callq 0xdd7a
leaq 0x90(%rsp), %rdi
callq 0xdd7a
movq %r15, %rdi
callq 0x2330