// File: /workspace/github_cpp_makefile_star2_O1/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 0x9fcb(%rip), %rdi      # 0x1b157
movl $0xa, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9e79(%rip), %r14      # 0x1b022
movl $0x14, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9f99(%rip), %r15      # 0x1b162
movl $0x18, %esi
movl $0x1, %edx
movq %r15, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9f92(%rip), %rdi      # 0x1b17b
movl $0x18, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9f8e(%rip), %rdi      # 0x1b194
movl $0x1d, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9e8d(%rip), %r12      # 0x1b0b0
movl $0x1c, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9e8a(%rip), %r13      # 0x1b0cd
movl $0x18, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9e83(%rip), %rbp      # 0x1b0e6
movl $0x16, %esi
movl $0x1, %edx
movq %rbp, %rdi
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9f2f(%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 0x9eee(%rip), %rdi      # 0x1b1c0
movl $0x1b, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x1d, %esi
movl $0x1, %edx
leaq 0x9e9b(%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 0x9e85(%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 0x9e41(%rip), %rdi      # 0x1b1e7
movl $0x18, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x1d, %esi
movl $0x1, %edx
leaq 0x9dc7(%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 0x9dd5(%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 0x9d92(%rip), %rdi      # 0x1b20c
movl $0x19, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9d8f(%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 0x9d5c(%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 0x9d1a(%rip), %rdi      # 0x1b268
movl $0x20, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9d1e(%rip), %rdi      # 0x1b289
movl $0x1e, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9d20(%rip), %rdi      # 0x1b2a8
movl $0x1c, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9d20(%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 0x9ce0(%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 0x9c9c(%rip), %rdi      # 0x1b2f8
movl $0x1d, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9c9d(%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 0x9c4b(%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 0x9bbe(%rip), %rdi      # 0x1b2f8
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9bed(%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 0x9b9e(%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 0x9aea(%rip), %rdi      # 0x1b2f8
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9b3d(%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 0x9aeb(%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 0x9aa8(%rip), %rdi      # 0x1b380
movl $0x31, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9abd(%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 0x9a6c(%rip), %rdi      # 0x1b3c9
movl $0xc, %esi
movl $0x1, %edx
callq 0x2390
movq 0x308(%rbx), %rcx
movl $0x14, %esi
movl $0x1, %edx
leaq 0x969e(%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 0x993e(%rip), %rdi      # 0x1b2f8
callq 0x2390
movq 0x308(%rbx), %rcx
leaq 0x9a09(%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