// File: /workspace/github_cpp_makefile_star2_O3/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 0x3bc6(%rip), %rsi      # 0xb064
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x2360
cmpl $-0x1, %eax
je 0x74df
leaq 0x3bab(%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 0x74c0
jmp 0x74e4
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
leaq 0x3b7b(%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 0x7547
callq 0x21c0
leaq 0x3be1(%rip), %rsi      # 0xb12f
leaq -0x50(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
callq 0x8f56
leaq 0x3b17(%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 0x7595
movq %rdx, -0x90(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x80(%rbp)
jmp 0x759c
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 0x75dc
callq 0x21c0
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x75ee
callq 0x21c0
leaq 0x3b54(%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 0x7938
xorl %ebx, %ebx
leaq 0x3a51(%rip), %r13      # 0xb0b5
movq %r12, -0x58(%rbp)
movl $0x10, %edx
movq %r14, %rdi
leaq 0x3aed(%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 0x3ad5(%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 0x3aa0(%rip), %rsi      # 0xb191
callq 0x2230
movq (%r12), %rax
movq (%rax,%rbx,8), %rsi
addq $0x60, %rsi
leaq -0x90(%rbp), %rdi
callq 0x905a
movq -0x78(%rbp), %r15
leaq -0x88(%rbp), %rax
cmpq %rax, %r15
je 0x774b
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 0x7712
movl $0x1a, %edx
movq %r14, %rdi
leaq 0x398f(%rip), %rsi      # 0xb0e9
callq 0x2230
movq -0x68(%rbp), %rsi
movq %r14, %rdi
callq 0x2140
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x39b0(%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 0x8d52
movq -0x50(%rbp), %r15
movq -0x48(%rbp), %rbx
movl $0x13, %edx
movq %r15, %r12
movq %r14, %rdi
leaq 0x39c7(%rip), %rsi      # 0xb1a7
callq 0x2230
subq %r15, %rbx
je 0x781f
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 0x77f9
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 0x8d52
movq -0x50(%rbp), %r12
movq -0x48(%rbp), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
testq %r15, %r15
je 0x7871
movq %r15, %rdi
callq 0x21c0
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x7871
callq 0x21c0
movl $0x12, %edx
movq %r14, %rdi
leaq 0x393b(%rip), %rsi      # 0xb1bb
callq 0x2230
subq %r12, %rbx
je 0x78bf
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 0x7899
movl $0x2, %edx
movq %r14, %rdi
leaq 0x385e(%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 0x790b
movq %r12, %rdi
callq 0x21c0
leaq -0x90(%rbp), %rdi
callq 0x8ff0
movq -0x60(%rbp), %rbx
incq %rbx
movq -0x58(%rbp), %r12
movq 0x8(%r12), %rax
subq (%r12), %rax
sarq $0x3, %rax
cmpq %rbx, %rax
ja 0x7668
movq 0x7699(%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 0x7983
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 0x79ae
callq 0x21c0
jmp 0x79ae
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7a18
callq 0x21c0
jmp 0x7a18
jmp 0x79c4
movq %rax, %rbx
jmp 0x7a18
jmp 0x79e3
movq %rax, %rbx
jmp 0x79da
jmp 0x79fd
jmp 0x79e3
movq %rax, %rbx
movq %r12, %r15
testq %r15, %r15
jne 0x79f3
jmp 0x7a00
jmp 0x79fd
movq %rax, %rbx
jmp 0x7a0c
movq %rax, %rbx
movq %r12, %r15
jmp 0x79f3
movq %rax, %rbx
movq %r15, %rdi
callq 0x21c0
jmp 0x7a00
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x8ff0
leaq -0x2b0(%rbp), %rdi
callq 0x22e0
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7a2d
callq 0x21c0
movq %rbx, %rdi
callq 0x2370