// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]Register-Interval/main.cpp
// Function: registerInterval_log(std::vector<registerInterval*, std::allocator<registerInterval*>>, int, char*)
void registerInterval_log(vector<registerInterval*> intervals, int iteration, char* file_name){
	std::string File(file_name);
	int p = File.find("/");
	int p1 = p;
	while(p != string::npos){
		p1 = p;
		p = File.find("/", p + 1);
	}
	int p2 = File.find(".");
	File = File.substr(p1 + 1, p2 - p1 - 1);
        std::ofstream out("output/registerIntervals_" + File + ".txt");
        
	out << "The number of Intervals = " << intervals.size() << endl;
	for (int i = 0; i < intervals.size(); i++){
		out << " #Interval ID = " << intervals[i]->getID() << " #Number of Instructions = " << intervals[i]->getNumberOfInstructions() << endl;
		out << "		 #Register_list = {";
		set<string> L = intervals[i]->get_register_list();
		set<string>::iterator it;
		for (it = L.begin(); it != L.end(); it++)
			out << *it << " ";
		out << "}; #Number of Registers = " << L.size() << ";" << endl;
			
		vector<registerInterval*> ii;

		ii = intervals[i]->get_predecessors();
		out <<"		Predecessors = { ";
		for(int j = 0; j < ii.size(); j++){
			out << ii[j]->getID() << " ";
		}

		ii = intervals[i]->get_successors();
		out << "}		Successors = { ";
		for(int j = 0; j < ii.size(); j++){
			out << ii[j]->getID() << " ";
		}
		out << "};" << endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %rdi, %r12
leaq -0xb0(%rbp), %r14
leaq -0x2b0(%rbp), %rax
movq %r14, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x20e0
leaq 0x3c4a(%rip), %rsi      # 0xb064
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x2360
cmpl $-0x1, %eax
je 0x745b
leaq 0x3c2f(%rip), %r14      # 0xb064
leaq -0xb0(%rbp), %r15
movl %eax, %ebx
leal 0x1(%rbx), %eax
movslq %eax, %rdx
movl $0x1, %ecx
movq %r15, %rdi
movq %r14, %rsi
callq 0x2360
cmpl $-0x1, %eax
jne 0x743c
jmp 0x745d
movl %eax, %ebx
leaq 0x3c02(%rip), %rsi      # 0xb066
leaq -0xb0(%rbp), %r14
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x2360
leal 0x1(%rbx), %ecx
movslq %ecx, %rdx
notl %ebx
addl %eax, %ebx
movslq %ebx, %rcx
leaq -0x2b0(%rbp), %rdi
movq %r14, %rsi
callq 0x2200
leaq -0xb0(%rbp), %rdi
leaq -0x2b0(%rbp), %r14
movq %r14, %rsi
callq 0x2270
movq (%r14), %rdi
leaq -0x2a0(%rbp), %rax
cmpq %rax, %rdi
je 0x74c0
callq 0x21c0
leaq 0x3c68(%rip), %rsi      # 0xb12f
leaq -0x50(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
callq 0x8ecc
leaq 0x3b9e(%rip), %rsi      # 0xb07c
leaq -0x50(%rbp), %rdi
callq 0x23a0
leaq -0x80(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x750e
movq %rdx, -0x90(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x80(%rbp)
jmp 0x7515
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq -0x90(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x2b0(%rbp), %rdi
movl $0x10, %edx
callq 0x23b0
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x7555
callq 0x21c0
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7567
callq 0x21c0
leaq 0x3bdb(%rip), %rsi      # 0xb149
leaq -0x2b0(%rbp), %rdi
movl $0x1a, %edx
callq 0x2230
movq 0x8(%r12), %rsi
subq (%r12), %rsi
sarq $0x3, %rsi
leaq -0x2b0(%rbp), %r14
movq %r14, %rdi
callq 0x2140
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq 0x8(%r12), %rax
cmpq (%r12), %rax
je 0x78b1
xorl %ebx, %ebx
leaq 0x3ad8(%rip), %r13      # 0xb0b5
movq %r12, -0x58(%rbp)
movl $0x10, %edx
movq %r14, %rdi
leaq 0x3b74(%rip), %rsi      # 0xb164
callq 0x2230
movq (%r12), %rax
movq (%rax,%rbx,8), %rax
movl (%rax), %esi
movq %r14, %rdi
callq 0x2350
movq %rax, %r15
movl $0x1b, %edx
movq %rax, %rdi
leaq 0x3b5c(%rip), %rsi      # 0xb175
callq 0x2230
movq (%r12), %rax
movq (%rax,%rbx,8), %rax
movl 0x58(%rax), %esi
movq %r15, %rdi
callq 0x2350
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movl $0x15, %edx
movq %r14, %rdi
leaq 0x3b27(%rip), %rsi      # 0xb191
callq 0x2230
movq (%r12), %rax
movq (%rax,%rbx,8), %rsi
addq $0x60, %rsi
leaq -0x90(%rbp), %rdi
callq 0x8fd0
movq -0x78(%rbp), %r15
leaq -0x88(%rbp), %rax
cmpq %rax, %r15
je 0x76c4
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
movq %r14, %rdi
callq 0x2230
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2230
movq %r15, %rdi
callq 0x2240
movq %rax, %r15
jmp 0x768b
movl $0x1a, %edx
movq %r14, %rdi
leaq 0x3a16(%rip), %rsi      # 0xb0e9
callq 0x2230
movq -0x68(%rbp), %rsi
movq %r14, %rdi
callq 0x2140
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3a37(%rip), %rsi      # 0xb12d
callq 0x2230
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq (%r12), %rax
movq %rbx, -0x60(%rbp)
movq (%rax,%rbx,8), %rsi
movl $0x90, %eax
addq %rax, %rsi
leaq -0x50(%rbp), %rdi
callq 0x8cd6
movq -0x50(%rbp), %r15
movq -0x48(%rbp), %rbx
movl $0x13, %edx
movq %r15, %r12
movq %r14, %rdi
leaq 0x3a4e(%rip), %rsi      # 0xb1a7
callq 0x2230
subq %r15, %rbx
je 0x7798
sarq $0x3, %rbx
cmpq $0x1, %rbx
adcq $0x0, %rbx
xorl %r12d, %r12d
movq (%r15,%r12,8), %rax
movl (%rax), %esi
movq %r14, %rdi
callq 0x2350
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2230
incq %r12
cmpq %r12, %rbx
jne 0x7772
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl $0xa8, %eax
addq %rax, %rsi
leaq -0x50(%rbp), %rdi
callq 0x8cd6
movq -0x50(%rbp), %r12
movq -0x48(%rbp), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
testq %r15, %r15
je 0x77dc
movq %r15, %rdi
callq 0x21c0
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x77ea
callq 0x21c0
movl $0x12, %edx
movq %r14, %rdi
leaq 0x39c2(%rip), %rsi      # 0xb1bb
callq 0x2230
subq %r12, %rbx
je 0x7838
sarq $0x3, %rbx
cmpq $0x1, %rbx
adcq $0x0, %rbx
xorl %r15d, %r15d
movq (%r12,%r15,8), %rax
movl (%rax), %esi
movq %r14, %rdi
callq 0x2350
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2230
incq %r15
cmpq %r15, %rbx
jne 0x7812
movl $0x2, %edx
movq %r14, %rdi
leaq 0x38e5(%rip), %rsi      # 0xb12c
callq 0x2230
movq -0x2b0(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
testq %r12, %r12
je 0x7884
movq %r12, %rdi
callq 0x21c0
leaq -0x90(%rbp), %rdi
callq 0x8f66
movq -0x60(%rbp), %rbx
incq %rbx
movq -0x58(%rbp), %r12
movq 0x8(%r12), %rax
subq (%r12), %rax
sarq $0x3, %rax
cmpq %rbx, %rax
ja 0x75e1
movq 0x7720(%rip), %rax      # 0xefd8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x2a8(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x2b0(%rbp,%rcx)
callq 0x2190
leaq -0x1b8(%rbp), %rdi
callq 0x20c0
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x78fc
callq 0x21c0
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x7927
callq 0x21c0
jmp 0x7927
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x798e
callq 0x21c0
jmp 0x798e
jmp 0x793d
movq %rax, %rbx
jmp 0x798e
jmp 0x7954
jmp 0x7961
movq %rax, %rbx
xorl %r15d, %r15d
jmp 0x7964
jmp 0x7954
jmp 0x7959
jmp 0x7973
movq %rax, %rbx
jmp 0x7982
movq %rax, %rbx
movq %r12, %r15
jmp 0x7964
movq %rax, %rbx
testq %r15, %r15
je 0x7976
movq %r15, %rdi
callq 0x21c0
jmp 0x7976
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x8f66
leaq -0x2b0(%rbp), %rdi
callq 0x22e0
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x79a3
callq 0x21c0
movq %rbx, %rdi
callq 0x2370