// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]Register-Interval/main.cpp
// Function: basic_blocks_log(std::vector<basicBlock*, std::allocator<basicBlock*>>, char*)
void basic_blocks_log(vector<basicBlock*> basic_blocks, 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/BasicBlocks_" + File + ".txt");
        
        vector<basicBlock*> P ,S;
	out << "The number of basic_blocks = " << basic_blocks.size() << endl;
	for (int i = 0; i < basic_blocks.size(); i++){
		out << " #The basic_block ID : " << basic_blocks[i]->getID() << endl;
		out << "		#Number of Instructions = " << basic_blocks[i]->numberOfInstructions() << endl;
		out << "		#Register_list = {";
		set<string> L = basic_blocks[i]->get_output_list();
		set<string>::iterator it;
		for (it = L.begin(); it != L.end(); it++)
			out << *it << " ";
		out << "}; #Number of Registers = " << L.size() << ";" << endl;
		P = basic_blocks[i]->get_predecessors();
		S = basic_blocks[i]->get_successors();
		out << "		#predecessors = {";
		for(int j=0;j<P.size();j++){
			out << P[j]->getID() << " ";
		}
		out << "};		#successors = {";
		for(int j=0;j<S.size();j++){
			out << S[j]->getID() << " ";
		}
		out <<"};" << endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rdi, -0x68(%rbp)
leaq -0xb8(%rbp), %rbx
leaq -0x2b8(%rbp), %rdx
movq %rbx, %rdi
callq 0x20e0
leaq 0x4316(%rip), %rsi      # 0xb064
movl $0x1, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2360
cmpl $-0x1, %eax
je 0x6d91
leaq 0x42fb(%rip), %rbx      # 0xb064
leaq -0xb8(%rbp), %r14
movl %eax, %r15d
leal 0x1(%r15), %eax
movslq %eax, %rdx
movl $0x1, %ecx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2360
cmpl $-0x1, %eax
jne 0x6d70
jmp 0x6d94
movl %eax, %r15d
leaq 0x42cb(%rip), %rsi      # 0xb066
leaq -0xb8(%rbp), %rbx
movl $0x1, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2360
leal 0x1(%r15), %ecx
movslq %ecx, %rdx
notl %r15d
addl %eax, %r15d
movslq %r15d, %rcx
leaq -0x2b8(%rbp), %rdi
movq %rbx, %rsi
callq 0x2200
leaq -0xb8(%rbp), %rdi
leaq -0x2b8(%rbp), %rbx
movq %rbx, %rsi
callq 0x2270
movq (%rbx), %rdi
leaq -0x2a8(%rbp), %rax
cmpq %rax, %rdi
movq -0x68(%rbp), %r14
je 0x6dfe
callq 0x21c0
leaq 0x4263(%rip), %rsi      # 0xb068
leaq -0x60(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x8ecc
leaq 0x4260(%rip), %rsi      # 0xb07c
leaq -0x60(%rbp), %rdi
callq 0x23a0
leaq -0x88(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x6e52
movq %rdx, -0x98(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x88(%rbp)
jmp 0x6e58
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
leaq -0x98(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x2b8(%rbp), %rdi
movl $0x10, %edx
callq 0x23b0
movq -0x98(%rbp), %rdi
cmpq %rbx, %rdi
je 0x6e98
callq 0x21c0
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6eaa
callq 0x21c0
leaq 0x41d0(%rip), %rsi      # 0xb081
leaq -0x2b8(%rbp), %rdi
movl $0x1d, %edx
callq 0x2230
movq 0x8(%r14), %rsi
subq (%r14), %rsi
sarq $0x3, %rsi
leaq -0x2b8(%rbp), %r13
movq %r13, %rdi
callq 0x2140
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq 0x8(%r14), %rax
cmpq (%r14), %rax
je 0x72ae
movq %r14, %rbx
movq $0x0, -0x38(%rbp)
xorl %r14d, %r14d
movq $0x0, -0x30(%rbp)
movl $0x17, %edx
movq %r13, %rdi
leaq 0x4167(%rip), %rsi      # 0xb09f
callq 0x2230
movq (%rbx), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %esi
movq %r13, %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 $0x1c, %edx
movq %r13, %rdi
leaq 0x412c(%rip), %rsi      # 0xb0b7
callq 0x2230
movq (%rbx), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x48(%rax), %esi
movq %r13, %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 $0x14, %edx
movq %r13, %rdi
leaq 0x40f5(%rip), %rsi      # 0xb0d4
callq 0x2230
movq %rbx, %r12
movq (%rbx), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl $0xc0, %eax
addq %rax, %rsi
leaq -0x98(%rbp), %rdi
callq 0x8fd0
movq -0x80(%rbp), %r15
leaq -0x90(%rbp), %rbx
cmpq %rbx, %r15
je 0x704a
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
movq %r13, %rdi
callq 0x2230
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4080(%rip), %rsi      # 0xb0b5
callq 0x2230
movq %r15, %rdi
callq 0x2240
movq %rax, %r15
cmpq %rbx, %rax
jne 0x7016
movl $0x1a, %edx
movq %r13, %rdi
leaq 0x4090(%rip), %rsi      # 0xb0e9
callq 0x2230
movq %r12, %rbx
movq -0x70(%rbp), %rsi
leaq -0x2b8(%rbp), %rdi
callq 0x2140
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x40aa(%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 (%rbx), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
addq $0x60, %rsi
leaq -0x60(%rbp), %rdi
callq 0x8e42
movq -0x60(%rbp), %r12
movq -0x58(%rbp), %r13
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
testq %r14, %r14
je 0x70eb
movq %r14, %rdi
callq 0x21c0
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x70f9
callq 0x21c0
movq (%rbx), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
addq $0x78, %rsi
leaq -0x60(%rbp), %rdi
callq 0x8e42
movq -0x60(%rbp), %r15
movq -0x58(%rbp), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x7136
callq 0x21c0
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x7144
callq 0x21c0
movl $0x13, %edx
movq %r15, -0x30(%rbp)
movq %r12, %r14
leaq -0x2b8(%rbp), %rdi
leaq 0x3fa6(%rip), %rsi      # 0xb104
callq 0x2230
subq %r12, %r13
je 0x71a5
sarq $0x3, %r13
cmpq $0x1, %r13
adcq $0x0, %r13
xorl %r14d, %r14d
movq (%r12,%r14,8), %rax
movl (%rax), %esi
leaq -0x2b8(%rbp), %rdi
callq 0x2350
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3f1d(%rip), %rsi      # 0xb0b5
callq 0x2230
incq %r14
cmpq %r14, %r13
jne 0x7177
movl $0x13, %edx
movq %r15, -0x30(%rbp)
movq %r12, %r14
leaq -0x2b8(%rbp), %rdi
leaq 0x3f59(%rip), %rsi      # 0xb118
callq 0x2230
subq %r15, %rbx
leaq -0x2b8(%rbp), %r13
je 0x7209
sarq $0x3, %rbx
cmpq $0x1, %rbx
adcq $0x0, %rbx
xorl %r14d, %r14d
movq (%r15,%r14,8), %rax
movl (%rax), %esi
movq %r13, %rdi
callq 0x2350
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3eb9(%rip), %rsi      # 0xb0b5
callq 0x2230
incq %r14
cmpq %r14, %rbx
jne 0x71df
movl $0x2, %edx
movq %r15, -0x30(%rbp)
movq %r12, %r14
movq %r13, %rdi
leaq 0x3f0d(%rip), %rsi      # 0xb12c
callq 0x2230
movq -0x68(%rbp), %rbx
movq -0x2b8(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x2b8(%rbp), %rax
addq %rax, %rdi
movq %r15, -0x30(%rbp)
movq %r12, %r14
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %r15, -0x30(%rbp)
movq %r12, %r14
leaq -0x2b8(%rbp), %rdi
callq 0x2030
movq %r15, -0x30(%rbp)
movq %r12, %r14
movq %rax, %rdi
callq 0x2150
leaq -0x98(%rbp), %rdi
callq 0x8f66
movq -0x38(%rbp), %rdx
incq %rdx
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x3, %rax
movq %r12, %r14
movq %r15, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
cmpq %rdx, %rax
leaq -0x2b8(%rbp), %r13
ja 0x6f29
jmp 0x72b4
xorl %r15d, %r15d
xorl %r12d, %r12d
testq %r15, %r15
je 0x72c1
movq %r15, %rdi
callq 0x21c0
testq %r12, %r12
je 0x72ce
movq %r12, %rdi
callq 0x21c0
movq 0x7d03(%rip), %rax      # 0xefd8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x2b0(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x2b8(%rbp,%rcx)
callq 0x2190
leaq -0x1c0(%rbp), %rdi
callq 0x20c0
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7319
callq 0x21c0
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r13
movq -0x98(%rbp), %rdi
cmpq %rbx, %rdi
je 0x7344
callq 0x21c0
jmp 0x7344
movq %rax, %r13
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x73c3
callq 0x21c0
jmp 0x73c3
jmp 0x735a
movq %rax, %r13
jmp 0x73c3
movq %rax, %r13
movq $0x0, -0x30(%rbp)
xorl %r14d, %r14d
jmp 0x739c
jmp 0x738d
movq %rax, %r13
jmp 0x7388
jmp 0x7378
movq %rax, %r13
jmp 0x739c
jmp 0x738d
jmp 0x7381
movq %rax, %r13
movq %r15, -0x30(%rbp)
movq %r12, %r14
jmp 0x7390
movq %rax, %r13
leaq -0x98(%rbp), %rdi
callq 0x8f66
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x73aa
callq 0x21c0
testq %r14, %r14
je 0x73b7
movq %r14, %rdi
callq 0x21c0
leaq -0x2b8(%rbp), %rdi
callq 0x22e0
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x73d8
callq 0x21c0
movq %r13, %rdi
callq 0x2370