// File: /workspace/github_cpp_makefile_star2_O1/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
movups %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
leaq 0x108(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq -0x28(%rcx), %rsi
callq 0xe77c
leaq 0x130(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1340e(%rip), %rsi     # 0x192f9
leaq 0x1340e(%rip), %rdx     # 0x19300
leaq 0x120(%rsp), %r12
movq %r12, %rdi
callq 0x3c34
leaq 0x140(%rsp), %r15
leaq 0x150(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x133e4(%rip), %rsi     # 0x19301
leaq 0x133e7(%rip), %rdx     # 0x1930b
movq %r15, %rdi
callq 0x3c34
leaq 0x160(%rsp), %r15
leaq 0x170(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x133c5(%rip), %rsi     # 0x1930c
leaq 0x133c6(%rip), %rdx     # 0x19314
movq %r15, %rdi
callq 0x3c34
leaq 0x180(%rsp), %r15
leaq 0x190(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x133a4(%rip), %rsi     # 0x19315
leaq 0x133a6(%rip), %rdx     # 0x1931e
movq %r15, %rdi
callq 0x3c34
leaq 0x1a0(%rsp), %r15
leaq 0x1b0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x13384(%rip), %rsi     # 0x1931f
leaq 0x13384(%rip), %rdx     # 0x19326
movq %r15, %rdi
callq 0x3c34
leaq 0x1c0(%rsp), %r15
leaq 0x1d0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x13362(%rip), %rsi     # 0x19327
leaq 0x13362(%rip), %rdx     # 0x1932e
movq %r15, %rdi
callq 0x3c34
leaq 0x1e0(%rsp), %r15
leaq 0x1f0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x13340(%rip), %rsi     # 0x1932f
leaq 0x13343(%rip), %rdx     # 0x19339
movq %r15, %rdi
callq 0x3c34
leaq 0x200(%rsp), %r15
leaq 0x210(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x13321(%rip), %rsi     # 0x1933a
leaq 0x13322(%rip), %rdx     # 0x19342
movq %r15, %rdi
callq 0x3c34
leaq 0x220(%rsp), %r15
leaq 0x230(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x13300(%rip), %rsi     # 0x19343
leaq 0x13302(%rip), %rdx     # 0x1934c
movq %r15, %rdi
callq 0x3c34
leaq 0x240(%rsp), %r15
leaq 0x250(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x132e0(%rip), %rsi     # 0x1934d
leaq 0x132e0(%rip), %rdx     # 0x19354
movq %r15, %rdi
callq 0x3c34
leaq 0x98(%rsp), %r15
leaq 0x30(%rsp), %rbp
leaq 0x120(%rsp), %rbx
xorl %r12d, %r12d
movq 0x98(%rsp), %rsi
movq %r15, %rdi
callq 0xe77c
movl $0x0, 0xdc(%rsp)
leaq 0x146da(%rip), %rax     # 0x1a790
movl (%r12,%rax), %eax
movl %eax, 0xd8(%rsp)
leaq 0x14698(%rip), %rax     # 0x1a760
movl (%r12,%rax), %eax
movl %eax, 0x118(%rsp)
movq %r15, %rdi
leaq 0xd8(%rsp), %rsi
callq 0xde50
movq %rbp, %r13
movq %rbp, 0x20(%rsp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x3ba4
leaq 0xb0(%rsp), %rdi
movq %rbx, %rsi
callq 0x2120
movq 0x40(%rsp), %rax
movq 0x90(%rax), %rbp
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x3ba4
movq 0x90(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0xe0e0
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x3ba4
movq 0xd0(%rsp), %rax
movq %rax, 0x88(%rsp)
movq %rbp, %rdi
movq %rsp, %rsi
leaq 0x48(%rsp), %rdx
movl $0x1, %ecx
callq 0xfc28
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
movq %r13, %rbp
je 0x61be
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x50(%rsp), %rdi
callq 0xdea4
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x61e3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
je 0x61fa
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
addq $0x20, %rbx
addq $0x4, %r12
cmpq $0x28, %r12
jne 0x6094
movq $-0x140, %rbx           # imm = 0xFEC0
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x6227
movq (%r14), %rsi
incq %rsi
callq 0x2200
addq $-0x20, %r14
addq $0x20, %rbx
jne 0x6213
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x6256
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0xe0(%rsp), %rdi
callq 0xdea4
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x6288
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x2200
movq %r15, %rdi
callq 0xdea4
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x62b2
jmp 0x62b2
jmp 0x62b2
jmp 0x62b2
jmp 0x62b2
jmp 0x62b2
jmp 0x62b2
jmp 0x62b2
movq %rax, %rbx
cmpq %r15, %r12
je 0x6386
addq $-0x10, %r15
leaq 0x120(%rsp), %r14
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x62de
movq (%r15), %rsi
incq %rsi
callq 0x2200
leaq -0x20(%r15), %rax
addq $-0x10, %r15
cmpq %r14, %r15
movq %rax, %r15
jne 0x62ca
jmp 0x6386
movq %rax, %rbx
movq %r12, %r15
jmp 0x62b5
jmp 0x62fd
movq %rax, %rbx
jmp 0x635a
movq %rax, %rbx
jmp 0x6323
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xdea4
jmp 0x6323
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xde7a
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x6343
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x6343
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x635a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
xorl %r15d, %r15d
movq 0x240(%rsp,%r15), %rdi
leaq (%r14,%r15), %rax
cmpq %rdi, %rax
je 0x6379
movq (%rax), %rsi
incq %rsi
callq 0x2200
addq $-0x20, %r15
cmpq $-0x140, %r15           # imm = 0xFEC0
jne 0x635d
leaq 0xd8(%rsp), %rdi
callq 0xde7a
leaq 0x90(%rsp), %rdi
callq 0xde7a
movq %rbx, %rdi
callq 0x2330