// File: /workspace/github_cpp_makefile_star2_O3/AndrewAlbert[P]Compiler-Theory/SourceCode/codeGenerator.cpp
// Function: codeGenerator::WriteRuntime()
void codeGenerator::WriteRuntime(){
	fprintf( oFile, "\nGETBOOL:\n");
	fprintf( oFile, "   FP_reg = SP_reg;\n");
	fprintf( oFile, "   SP_reg = FP_reg + 3;\n");
	fprintf( oFile, "   iReg[0] = getBool();\n");
	fprintf( oFile, "   MM[FP_reg + 2] = iReg[0];\n");
	fprintf( oFile, "   TP_reg = MM[FP_reg + 1];\n");
	fprintf( oFile, "   FP_reg = MM[FP_reg];\n");
	fprintf( oFile, "   goto BRANCH_TABLE;\n");

	fprintf( oFile, "\nGETINTEGER:\n");
	fprintf( oFile, "   FP_reg = SP_reg;\n");
	fprintf( oFile, "   SP_reg = FP_reg + 3;\n");
	fprintf( oFile, "   iReg[0] = getInteger();\n");
	fprintf( oFile, "   MM[FP_reg + 2] = iReg[0];\n");
	fprintf( oFile, "   TP_reg = MM[FP_reg + 1];\n");
	fprintf( oFile, "   FP_reg = MM[FP_reg];\n");
	fprintf( oFile, "   goto BRANCH_TABLE;\n");

	fprintf( oFile, "\nGETCHAR:\n");
	fprintf( oFile, "   FP_reg = SP_reg;\n");
	fprintf( oFile, "   SP_reg = FP_reg + 3;\n");
	fprintf( oFile, "   iReg[0] = getChar();\n");
	fprintf( oFile, "   MM[FP_reg + 2] = iReg[0];\n");
	fprintf( oFile, "   TP_reg = MM[FP_reg + 1];\n");
	fprintf( oFile, "   FP_reg = MM[FP_reg];\n");
	fprintf( oFile, "   goto BRANCH_TABLE;\n");

	fprintf( oFile, "\nGETFLOAT:\n");
	fprintf( oFile, "   FP_reg = SP_reg;\n");
	fprintf( oFile, "   SP_reg = FP_reg + 3;\n");
	fprintf( oFile, "   fReg[0] = getFloat();\n");
	fprintf( oFile, "   memcpy(&MM[FP_reg + 2], &iReg[0], sizeof(int) );\n");
	fprintf( oFile, "   TP_reg = MM[FP_reg + 1];\n");
	fprintf( oFile, "   FP_reg = MM[FP_reg];\n");
	fprintf( oFile, "   goto BRANCH_TABLE;\n");

	fprintf( oFile, "\nGETSTRING:\n");
	fprintf( oFile, "   FP_reg = SP_reg;\n");
	fprintf( oFile, "   SP_reg = FP_reg + 3;\n");
	fprintf( oFile, "   iReg[0] = getString(buffer);\n");
	fprintf( oFile, "   HP_reg = HP_reg - iReg[0];\n");
	fprintf( oFile, "   MM[FP_reg + 2] = HP_reg;\n");
	fprintf( oFile, "   strcpy((char*)&MM[HP_reg], buffer);\n");
	fprintf( oFile, "   TP_reg = MM[FP_reg + 1];\n");
	fprintf( oFile, "   FP_reg = MM[FP_reg];\n");
	fprintf( oFile, "   goto BRANCH_TABLE;\n");

	fprintf( oFile, "\nPUTBOOL:\n");
	fprintf( oFile, "   FP_reg = SP_reg;\n");
	fprintf( oFile, "   SP_reg = FP_reg + 3;\n");
	fprintf( oFile, "   iReg[0] = MM[FP_reg + 2];\n");
	fprintf( oFile, "   putBool(iReg[0]);\n");
	fprintf( oFile, "   TP_reg = MM[FP_reg + 1];\n");
	fprintf( oFile, "   FP_reg = MM[FP_reg];\n");
	fprintf( oFile, "   goto BRANCH_TABLE;\n");

	fprintf( oFile, "\nPUTINTEGER:\n");
	fprintf( oFile, "   FP_reg = SP_reg;\n");
	fprintf( oFile, "   SP_reg = FP_reg + 3;\n");
	fprintf( oFile, "   iReg[0] = MM[FP_reg + 2];\n");
	fprintf( oFile, "   putInteger(iReg[0]);\n");
	fprintf( oFile, "   TP_reg = MM[FP_reg + 1];\n");
	fprintf( oFile, "   FP_reg = MM[FP_reg];\n");
	fprintf( oFile, "   goto BRANCH_TABLE;\n");

	fprintf( oFile, "\nPUTCHAR:\n");
	fprintf( oFile, "   FP_reg = SP_reg;\n");
	fprintf( oFile, "   SP_reg = FP_reg + 3;\n");
	fprintf( oFile, "   iReg[0] = MM[FP_reg + 2];\n");
	fprintf( oFile, "   putChar(iReg[0]);\n");
	fprintf( oFile, "   TP_reg = MM[FP_reg + 1];\n");
	fprintf( oFile, "   FP_reg = MM[FP_reg];\n");
	fprintf( oFile, "   goto BRANCH_TABLE;\n");

	fprintf( oFile, "\nPUTFLOAT:\n");
	fprintf( oFile, "   FP_reg = SP_reg;\n");
	fprintf( oFile, "   SP_reg = FP_reg + 3;\n");
	fprintf( oFile, "   memcpy(&fReg[0],&MM[FP_reg + 2],sizeof(int));\n");
	fprintf( oFile, "   putFloat(fReg[0]);\n");
	fprintf( oFile, "   TP_reg = MM[FP_reg + 1];\n");
	fprintf( oFile, "   FP_reg = MM[FP_reg];\n");
	fprintf( oFile, "   goto BRANCH_TABLE;\n");

	fprintf( oFile, "\nPUTSTRING:\n");
	fprintf( oFile, "   FP_reg = SP_reg;\n");
	fprintf( oFile, "   SP_reg = FP_reg + 3;\n");
	fprintf( oFile, "   iReg[0] = MM[FP_reg + 2];\n");
	fprintf( oFile, "   putString((char*)&MM[iReg[0]]);\n");
	fprintf( oFile, "   TP_reg = MM[FP_reg + 1];\n");
	fprintf( oFile, "   FP_reg = MM[FP_reg];\n");
	fprintf( oFile, "   goto BRANCH_TABLE;\n");
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x308(%rdi), %rcx
leaq 0xa0ad(%rip), %rdi      # 0x1b157
movl $0xa, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9f5b(%rip), %r14      # 0x1b022
movl $0x14, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0xa07b(%rip), %r15      # 0x1b162
movl $0x18, %esi
movl $0x1, %edx
movq %r15, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0xa074(%rip), %rdi      # 0x1b17b
movl $0x18, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0xa070(%rip), %rdi      # 0x1b194
movl $0x1d, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9f6f(%rip), %r12      # 0x1b0b0
movl $0x1c, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9f6c(%rip), %r13      # 0x1b0cd
movl $0x18, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9f65(%rip), %rbp      # 0x1b0e6
movl $0x16, %esi
movl $0x1, %edx
movq %rbp, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0xa011(%rip), %rdi      # 0x1b1b2
movl $0xd, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x14, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r15, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9fd0(%rip), %rdi      # 0x1b1c0
movl $0x1b, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x1d, %esi
movl $0x1, %edx
leaq 0x9f7d(%rip), %rdi      # 0x1b194
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x1c, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x16, %esi
movl $0x1, %edx
movq %rbp, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9f67(%rip), %rdi      # 0x1b1dc
movl $0xa, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x14, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r15, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9f23(%rip), %rdi      # 0x1b1e7
movl $0x18, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x1d, %esi
movl $0x1, %edx
leaq 0x9ea9(%rip), %rdi      # 0x1b194
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x1c, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x16, %esi
movl $0x1, %edx
movq %rbp, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9eb7(%rip), %rdi      # 0x1b200
movl $0xb, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x14, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r15, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9e74(%rip), %rdi      # 0x1b20c
movl $0x19, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9e71(%rip), %rdi      # 0x1b226
movl $0x34, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x1c, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x16, %esi
movl $0x1, %edx
movq %rbp, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9e3e(%rip), %rdi      # 0x1b25b
movl $0xc, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x14, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r15, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9dfc(%rip), %rdi      # 0x1b268
movl $0x20, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9e00(%rip), %rdi      # 0x1b289
movl $0x1e, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9e02(%rip), %rdi      # 0x1b2a8
movl $0x1c, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9e02(%rip), %rdi      # 0x1b2c5
movl $0x27, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x1c, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x16, %esi
movl $0x1, %edx
movq %rbp, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9dc2(%rip), %rdi      # 0x1b2ed
movl $0xa, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x14, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r15, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9d7e(%rip), %rdi      # 0x1b2f8
movl $0x1d, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9d7f(%rip), %rdi      # 0x1b316
movl $0x15, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x1c, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x16, %esi
movl $0x1, %edx
movq %rbp, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9d2d(%rip), %rdi      # 0x1b32c
movl $0xd, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x14, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r15, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x1d, %esi
movl $0x1, %edx
leaq 0x9ca0(%rip), %rdi      # 0x1b2f8
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9ccf(%rip), %rdi      # 0x1b33a
movl $0x18, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x1c, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x16, %esi
movl $0x1, %edx
movq %rbp, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9c80(%rip), %rdi      # 0x1b353
movl $0xa, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x14, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r15, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x1d, %esi
movl $0x1, %edx
leaq 0x9bcc(%rip), %rdi      # 0x1b2f8
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9c1f(%rip), %rdi      # 0x1b35e
movl $0x15, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x1c, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x16, %esi
movl $0x1, %edx
movq %rbp, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9bcd(%rip), %rdi      # 0x1b374
movl $0xb, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x14, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r15, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9b8a(%rip), %rdi      # 0x1b380
movl $0x31, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9b9f(%rip), %rdi      # 0x1b3b2
movl $0x16, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x1c, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x16, %esi
movl $0x1, %edx
movq %rbp, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9b4e(%rip), %rdi      # 0x1b3c9
movl $0xc, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x14, %esi
movl $0x1, %edx
leaq 0x9780(%rip), %rdi      # 0x1b022
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r15, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x1d, %esi
movl $0x1, %edx
leaq 0x9a20(%rip), %rdi      # 0x1b2f8
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9aeb(%rip), %rdi      # 0x1b3d6
movl $0x23, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x1c, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x18, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x16, %esi
movl $0x1, %edx
movq %rbp, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2390
nop