// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]Register-Interval/./src/implementation/RegisterIntervalCreation.cpp
// Function: RegisterIntervalCreationPass::registerIntervalCreationPassTwo(std::vector<registerInterval*, std::allocator<registerInterval*>>, int)
vector<registerInterval*> RegisterIntervalCreationPass::registerIntervalCreationPassTwo(vector<registerInterval*> RegisterInterval_in,int N){
	vector<registerInterval*> RegisterInterval_out;//The registerInterval set that contains the reduced register-intervals

        /*Initialization*/
	for (auto i = RegisterInterval_in.begin(); i != RegisterInterval_in.end(); i++){
		(*i)->set_next_level_registerInterval(nullptr);
	}

	queue<registerInterval*> WorkingSet; //The working set of registerInterval creation algorithm (pass 2)

        
	for(auto i = RegisterInterval_in.begin(); i != RegisterInterval_in.end(); i++){
		auto Predecessors = (*i)->get_predecessors();
		if(Predecessors.size() == 0){// each register-interval with no predecessors is assumed as an entry registerInterval
			auto temp = new registerInterval();
			RegisterInterval_out.push_back(temp);
                        (*i)->set_next_level_registerInterval(temp);
			WorkingSet.push(*i);//The register-interval is added to working set of the algorithm
		}
	}

	while (!WorkingSet.empty()){
		auto i = WorkingSet.front();//Get a register-interval form the working set
		WorkingSet.pop();
		auto ii = i->nextLevelInterval();//ii is the current next-level register-interval that i belongs to 
		if (i->get_register_list().size() < N){//Just register-intervals will be processed that contain less registers than the allowed number of registers
			ii->set_register_list(i->get_register_list());//At the beginning the register list of the current next-level register registerInterval is equal to i
                        
                        /*This loop looks at all register-interval as a candidate for adding to the current register-interval
                                                            and checks the required conditions*/
			for (auto Interval = RegisterInterval_in.begin(); Interval != RegisterInterval_in.end(); Interval++){
				auto Predecessors = (*Interval)->get_predecessors();
				bool C = true;//This boolean value will determine that all predecessors of the candidate register-interval belong to the current next-level register-interval
                                set<string> Union;//This set will contain the union of register sets of all register-intervals that belong to the current next-level register-interval
                                Union.clear();

				visit_registerInterval_all_predecessors(*Interval);//All predecessors of the candidate register-interval in CFG will be marked

                                /*This loop will determine that all predecessors of the current register-interval belong to the current next-level register-interval*/
				for(auto p = Predecessors.begin(); p != Predecessors.end(); p++){
					if((*p)->nextLevelInterval() != ii)
						if(*p != *Interval)
							C = false;
				}

                                /*This loop will set the union set of registers of all register-intervals that the the candidate register-interval can be reached from
                                                                        and also belong to the current next-level register registerInterval*/
				for(auto iterator = RegisterInterval_in.begin(); iterator != RegisterInterval_in.end(); iterator++){
					auto s = (*iterator)->get_register_list();
					for (auto it = s.begin(); it != s.end(); it++){
						Union.insert(*it);
					}
				}

                                /*At this point we add the candidate register-interval to the current register-interval if all required conditions are satisfied*/
				if ((*Interval)->nextLevelInterval() == nullptr //the register-interval should belong to no other next-level register-intervals
                                        && C //the register-interval can be reached from the current next-level register-interval
                                        && Union.size() < N //the size of the union set should not be more than the allowed number of registers in each register-interval
                                        )
                                {
					(*Interval)->set_next_level_registerInterval(ii);
					auto s = (*Interval)->get_register_list();
					Union = ii->get_register_list();
					for (auto it = s.begin(); it != s.end(); ++it){
						Union.insert(*it);
					}
					ii->set_register_list(Union);
				}
			}
		}
                /*At this point no more register-intervals can be added to the current next-level register-interval*/
                
		set<registerInterval*> Successors;//This set will contain the successors the current next-level register-interval
		Successors.clear();
                /*This loop determines the members of Successors set*/
		for (auto Interval = RegisterInterval_in.begin(); Interval != RegisterInterval_in.end(); Interval++){
			if ((*Interval)->nextLevelInterval() == ii){
				auto S = (*Interval)->get_successors();
				for (auto s = S.begin(); s != S.end(); s++){
					Successors.insert(*s);
				}
			}
		}
                
                /*This loop will assign  new register-intervals to all successors of the current next-level registerInterval (as their next-level register registerIntervals)*/
		for (auto s = Successors.begin(); s != Successors.end(); s++){
			if ((*s)->nextLevelInterval() == nullptr){
				auto temp = new registerInterval();
				RegisterInterval_out.push_back(temp);
				(*s)->set_next_level_registerInterval(temp);
				WorkingSet.push(*s);
			}
		}
	}
        /*At this point all register-intervals of the next level are created
                    and rest of the function sets the register lists and the forms the new CFG*/

	/*this loop sets the register list of all output register-intervals*/
	for (auto Interval = RegisterInterval_out.begin(); Interval != RegisterInterval_out.end(); Interval++){
		set<string> regList;
            	regList.clear();
		for (auto iterator = RegisterInterval_in.begin(); iterator != RegisterInterval_in.end(); iterator++){
			if ((*iterator)->nextLevelInterval() == *Interval){
				auto R = (*iterator)->get_register_list();
				for (auto it = R.begin(); it != R.end(); it++){
					regList.insert(*it);
				}
			}
		}
		(*Interval)->set_register_list(regList);
	}

	/*this loop sets the series of instructions in all output register-intervals*/
	string code;
	for (auto Interval = RegisterInterval_out.begin(); Interval != RegisterInterval_out.end(); Interval++){
		code = "";
		for (auto iterator = RegisterInterval_in.begin(); iterator != RegisterInterval_in.end(); iterator++){
			if ((*iterator)->nextLevelInterval() == *Interval){
				code = code + (*iterator)->get_code();
			}
		}
		(*Interval)->set_code(code);
	}

	/*this loop sets the predecessors and successors of all output register-intervals*/
	for (auto Interval = RegisterInterval_out.begin(); Interval != RegisterInterval_out.end(); Interval++){
		for (auto iterator = RegisterInterval_in.begin(); iterator != RegisterInterval_in.end(); iterator++){
			if ((*iterator)->nextLevelInterval() == *Interval){
				auto Predecessors = (*iterator)->get_predecessors();
                                for (auto p = Predecessors.begin(); p != Predecessors.end(); p++){
					if ((*p)->nextLevelInterval() != *Interval)
						(*Interval)->add_successors((*p)->nextLevelInterval());
				}
                                
				auto Successors = (*iterator)->get_successors();
				for (auto s = Successors.begin(); s != Successors.end(); s++){
					if ((*s)->nextLevelInterval() != *Interval){
						(*Interval)->add_predecessor((*s)->nextLevelInterval());
					}
				}
			}
		}
	}

	return RegisterInterval_out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movl %edx, -0x70(%rbp)
movq %rsi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, -0x68(%rbp)
movq $0x0, 0x10(%rdi)
movq (%rsi), %rax
cmpq 0x8(%rsi), %rax
je 0x4ab0
movq (%rax), %rcx
movq $0x0, 0x30(%rcx)
addq $0x8, %rax
cmpq 0x8(%rbx), %rax
jne 0x4a9b
leaq -0x130(%rbp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0xa56a
movq (%rbx), %r12
movq %rbx, -0x30(%rbp)
cmpq 0x8(%rbx), %r12
je 0x4c1b
movl $0x90, %ebx
leaq -0x60(%rbp), %r13
xorl %r14d, %r14d
leaq -0x130(%rbp), %r15
movq (%r12), %rsi
addq %rbx, %rsi
movq %r13, %rdi
callq 0x8d52
movq -0x60(%rbp), %rdi
cmpq %rdi, -0x58(%rbp)
jne 0x4bff
movl $0xc0, %edi
callq 0x21e0
movq %r14, 0x8(%rax)
movl %r14d, 0x10(%rax)
movq %r14, 0x18(%rax)
movl %r14d, 0x20(%rax)
movq %r14, 0x28(%rax)
leaq 0x48(%rax), %rcx
movq %rcx, 0x38(%rax)
movq %r14, 0x40(%rax)
movb $0x0, 0x48(%rax)
movq %rax, %rcx
addq $0x68, %rcx
movl %r14d, 0x68(%rax)
movq %r14, 0x70(%rax)
movq %rcx, 0x78(%rax)
movq %rcx, 0x80(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%rax)
movups %xmm0, 0x98(%rax)
movups %xmm0, 0xa8(%rax)
movq %r14, 0xb8(%rax)
movl 0xa685(%rip), %ecx      # 0xf204
leal 0x1(%rcx), %edx
movl %edx, 0xa67c(%rip)      # 0xf204
movl %ecx, (%rax)
movl %r14d, 0x58(%rax)
movq %rax, -0xa0(%rbp)
movq -0x68(%rbp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x4bad
movq %rax, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x4bb9
leaq -0xa0(%rbp), %rdx
callq 0x9c5c
movq (%r12), %rax
movq -0xa0(%rbp), %rcx
movq %rcx, 0x30(%rax)
movq -0x100(%rbp), %rax
movq -0xf0(%rbp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x4bf0
movq (%r12), %rcx
movq %rcx, (%rax)
addq $0x8, -0x100(%rbp)
jmp 0x4bfb
movq %r15, %rdi
movq %r12, %rsi
callq 0xa6e4
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x4c09
callq 0x21c0
addq $0x8, %r12
movq -0x30(%rbp), %rax
cmpq 0x8(%rax), %r12
jne 0x4af5
movq -0x120(%rbp), %rax
cmpq %rax, -0x100(%rbp)
je 0x512b
movslq -0x70(%rbp), %rcx
movq %rcx, -0xd8(%rbp)
leaq -0x98(%rbp), %r14
leaq -0x60(%rbp), %r15
movq (%rax), %rbx
movq -0x110(%rbp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x4c5e
addq $0x8, %rax
jmp 0x4c95
movq -0x118(%rbp), %rdi
callq 0x21c0
movq -0x108(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x108(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x118(%rbp)
leaq 0x200(%rax), %rcx
movq %rcx, -0x110(%rbp)
movq -0x30(%rbp), %r13
movq %rax, -0x120(%rbp)
movq 0x30(%rbx), %rax
movq %rax, -0x70(%rbp)
addq $0x60, %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x905a
movq -0x38(%rbp), %r12
movq %r15, %rdi
callq 0x8ff0
cmpq -0xd8(%rbp), %r12
leaq -0x58(%rbp), %r12
jae 0x4f59
leaq -0x1a0(%rbp), %rdi
movq %rbx, %rsi
callq 0x905a
movq -0x70(%rbp), %rdi
leaq -0x1a0(%rbp), %rbx
movq %rbx, %rsi
callq 0x2828
movq %rbx, %rdi
callq 0x8ff0
movq (%r13), %rbx
cmpq 0x8(%r13), %rbx
je 0x4f59
movq -0x70(%rbp), %rax
addq $0x60, %rax
movq %rax, -0x138(%rbp)
movq (%rbx), %rsi
movl $0x90, %eax
addq %rax, %rsi
leaq -0x170(%rbp), %rdi
callq 0x8d52
movl $0x0, -0x58(%rbp)
xorl %eax, %eax
movq %rax, -0x50(%rbp)
movq %r12, -0x48(%rbp)
movq %r12, -0x40(%rbp)
movq %rax, -0x38(%rbp)
movq %r15, %rdi
callq 0x95a8
movq (%rbx), %rdi
callq 0x5696
movq -0x170(%rbp), %rax
movq -0x168(%rbp), %rcx
movb $0x1, %r13b
cmpq %rcx, %rax
je 0x4d90
movq -0x70(%rbp), %rsi
movq (%rax), %rdx
cmpq %rsi, 0x30(%rdx)
je 0x4d87
cmpq (%rbx), %rdx
sete %dl
andb %dl, %r13b
addq $0x8, %rax
cmpq %rcx, %rax
jne 0x4d75
movq %rbx, -0xe0(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %r12
cmpq 0x8(%rax), %r12
leaq -0xa0(%rbp), %rbx
je 0x4e00
movq (%r12), %rsi
addq $0x60, %rsi
movq %rbx, %rdi
callq 0x905a
movq -0x88(%rbp), %rbx
cmpq %r14, %rbx
je 0x4de3
leaq 0x20(%rbx), %rsi
movq %r15, %rdi
callq 0x9d96
movq %rbx, %rdi
callq 0x2240
movq %rax, %rbx
cmpq %r14, %rax
jne 0x4dc7
leaq -0xa0(%rbp), %rbx
movq %rbx, %rdi
callq 0x8ff0
addq $0x8, %r12
movq -0x30(%rbp), %rax
cmpq 0x8(%rax), %r12
jne 0x4dab
movq -0xe0(%rbp), %rbx
movq (%rbx), %rax
cmpq $0x0, 0x30(%rax)
leaq -0x58(%rbp), %r12
jne 0x4f2e
movq -0xd8(%rbp), %rcx
cmpq %rcx, -0x38(%rbp)
setb %cl
andb %cl, %r13b
cmpb $0x1, %r13b
jne 0x4f2e
movq -0x70(%rbp), %rcx
movq %rcx, 0x30(%rax)
movq (%rbx), %rsi
addq $0x60, %rsi
leaq -0xa0(%rbp), %r13
movq %r13, %rdi
callq 0x905a
leaq -0xd0(%rbp), %rdi
movq -0x138(%rbp), %rsi
callq 0x905a
movq %r15, %rdi
callq 0x95a8
movq -0xc0(%rbp), %rax
testq %rax, %rax
je 0x4ec5
movl -0xc8(%rbp), %ecx
movl %ecx, -0x58(%rbp)
movq %rax, -0x50(%rbp)
movups -0xb8(%rbp), %xmm0
movups %xmm0, -0x48(%rbp)
movq %r12, 0x8(%rax)
movq -0xa8(%rbp), %rax
movq %rax, -0x38(%rbp)
xorl %ecx, %ecx
movq %rcx, -0xc0(%rbp)
leaq -0xc8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq %rax, -0xb0(%rbp)
movq %rcx, -0xa8(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x8ff0
movq -0x88(%rbp), %rbx
cmpq %r14, %rbx
je 0x4ef9
leaq 0x20(%rbx), %rsi
movq %r15, %rdi
callq 0x9d96
movq %rbx, %rdi
callq 0x2240
movq %rax, %rbx
cmpq %r14, %rax
jne 0x4edd
leaq -0x200(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x905a
movq -0x70(%rbp), %rdi
movq %rbx, %rsi
callq 0x2828
movq %rbx, %rdi
callq 0x8ff0
movq %r13, %rdi
callq 0x8ff0
movq -0xe0(%rbp), %rbx
movq %r15, %rdi
callq 0x8ff0
movq -0x170(%rbp), %rdi
testq %rdi, %rdi
je 0x4f47
callq 0x21c0
addq $0x8, %rbx
movq -0x30(%rbp), %r13
cmpq 0x8(%r13), %rbx
jne 0x4d1b
movl $0x0, -0x58(%rbp)
xorl %eax, %eax
movq %rax, -0x50(%rbp)
movq %r12, -0x48(%rbp)
movq %r12, -0x40(%rbp)
movq %rax, -0x38(%rbp)
movq %r15, %rdi
callq 0xa8ee
movq (%r13), %r12
movq 0x8(%r13), %rax
cmpq %rax, %r12
je 0x4fee
movq (%r12), %rsi
movq -0x70(%rbp), %rcx
cmpq %rcx, 0x30(%rsi)
jne 0x4fe8
addq $0xa8, %rsi
leaq -0xa0(%rbp), %rdi
callq 0x8d52
movq -0xa0(%rbp), %rbx
cmpq -0x98(%rbp), %rbx
je 0x4fd7
movq %r15, %rdi
movq %rbx, %rsi
callq 0xa926
addq $0x8, %rbx
cmpq -0x98(%rbp), %rbx
jne 0x4fb8
movq -0xa0(%rbp), %rbx
testq %rbx, %rbx
je 0x4fe4
movq %rbx, %rdi
callq 0x21c0
movq 0x8(%r13), %rax
addq $0x8, %r12
jmp 0x4f82
movq -0x48(%rbp), %r13
leaq -0x58(%rbp), %rbx
cmpq %rbx, %r13
leaq -0x130(%rbp), %r12
je 0x510f
movq 0x20(%r13), %rax
cmpq $0x0, 0x30(%rax)
jne 0x50fb
movl $0xc0, %edi
callq 0x21e0
xorl %esi, %esi
movq %rsi, 0x8(%rax)
movl %esi, 0x10(%rax)
movq %rsi, 0x18(%rax)
movl %esi, 0x20(%rax)
movq %rsi, 0x28(%rax)
leaq 0x48(%rax), %rcx
movq %rcx, 0x38(%rax)
movq %rsi, 0x40(%rax)
movb $0x0, 0x48(%rax)
movq %rax, %rcx
addq $0x68, %rcx
movl %esi, 0x68(%rax)
movq %rsi, 0x70(%rax)
movq %rcx, 0x78(%rax)
movq %rcx, 0x80(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%rax)
movups %xmm0, 0x98(%rax)
movups %xmm0, 0xa8(%rax)
movq %rsi, 0xb8(%rax)
movl 0xa183(%rip), %ecx      # 0xf204
leal 0x1(%rcx), %edx
movl %edx, 0xa17a(%rip)      # 0xf204
movl %ecx, (%rax)
movl %esi, 0x58(%rax)
movq %rax, -0xa0(%rbp)
movq -0x68(%rbp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x50ae
movq %rax, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x50ba
leaq -0xa0(%rbp), %rdx
callq 0x9c5c
leaq 0x20(%r13), %rsi
movq (%rsi), %rax
movq -0xa0(%rbp), %rcx
movq %rcx, 0x30(%rax)
movq -0x100(%rbp), %rax
movq -0xf0(%rbp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x50f3
movq (%rsi), %rcx
movq %rcx, (%rax)
addq $0x8, -0x100(%rbp)
jmp 0x50fb
movq %r12, %rdi
callq 0xa6e4
movq %r13, %rdi
callq 0x2240
movq %rax, %r13
cmpq %rbx, %rax
jne 0x5006
movq %r15, %rdi
callq 0x9638
movq -0x120(%rbp), %rax
cmpq %rax, -0x100(%rbp)
jne 0x4c45
movq -0x68(%rbp), %rax
movq (%rax), %r12
cmpq 0x8(%rax), %r12
je 0x54dc
leaq -0x98(%rbp), %r14
leaq -0x60(%rbp), %r15
movq -0x30(%rbp), %rbx
movl $0x0, -0x58(%rbp)
xorl %ecx, %ecx
movq %rcx, -0x50(%rbp)
leaq -0x58(%rbp), %rax
movq %rax, -0x48(%rbp)
movq %rax, -0x40(%rbp)
movq %rcx, -0x38(%rbp)
movq %r15, %rdi
callq 0x95a8
movq (%rbx), %r13
movq 0x8(%rbx), %rax
cmpq %rax, %r13
je 0x51dc
movq (%r13), %rsi
movq 0x30(%rsi), %rcx
cmpq (%r12), %rcx
jne 0x51d6
addq $0x60, %rsi
leaq -0xa0(%rbp), %rdi
callq 0x905a
movq -0x88(%rbp), %rbx
cmpq %r14, %rbx
je 0x51c2
leaq 0x20(%rbx), %rsi
movq %r15, %rdi
callq 0x9d96
movq %rbx, %rdi
callq 0x2240
movq %rax, %rbx
cmpq %r14, %rax
jne 0x51a6
leaq -0xa0(%rbp), %rdi
callq 0x8ff0
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x8, %r13
jmp 0x5177
movq (%r12), %rbx
leaq -0x1d0(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x905a
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2828
movq -0x30(%rbp), %rbx
movq %r13, %rdi
callq 0x8ff0
movq %r15, %rdi
callq 0x8ff0
addq $0x8, %r12
movq -0x68(%rbp), %rdx
cmpq 0x8(%rdx), %r12
jne 0x514b
movq (%rdx), %r14
leaq -0x50(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpq %r12, %r14
je 0x53bb
leaq -0xc0(%rbp), %r13
leaq -0x90(%rbp), %r12
leaq -0xd0(%rbp), %r15
movq -0x58(%rbp), %rdx
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
leaq 0x5e4e(%rip), %rcx      # 0xb0b6
xorl %r8d, %r8d
callq 0x2300
movq -0x30(%rbp), %rax
movq (%rax), %rbx
movq 0x8(%rax), %rax
cmpq %rax, %rbx
je 0x5350
movq (%rbx), %rcx
movq 0x30(%rcx), %rdx
cmpq (%r14), %rdx
jne 0x5347
movq %r13, -0xd0(%rbp)
movq 0x38(%rcx), %rsi
movq 0x40(%rcx), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x975c
movq -0x60(%rbp), %rcx
movq -0x58(%rbp), %r8
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2220
movq %r12, -0xa0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x52eb
movq %rdx, -0xa0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x90(%rbp)
jmp 0x52f3
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, -0x98(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x60(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x2270
movq -0xa0(%rbp), %rdi
cmpq %r12, %rdi
je 0x532e
callq 0x21c0
movq -0xd0(%rbp), %rdi
cmpq %r13, %rdi
je 0x533f
callq 0x21c0
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x8, %rbx
jmp 0x527b
movq (%r14), %rbx
leaq -0x148(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
leaq -0x158(%rbp), %rdi
callq 0x975c
movq %rbx, %rdi
leaq -0x158(%rbp), %rsi
callq 0x2754
movq -0x158(%rbp), %rdi
leaq -0x148(%rbp), %rax
cmpq %rax, %rdi
je 0x539f
callq 0x21c0
addq $0x8, %r14
movq -0x68(%rbp), %rdx
cmpq 0x8(%rdx), %r14
jne 0x5257
movq %r14, %r12
movq (%rdx), %r14
movq -0x30(%rbp), %rbx
cmpq %r12, %r14
je 0x54d6
movq 0x8(%rbx), %rax
leaq -0xd0(%rbp), %r13
movq -0x30(%rbp), %rcx
movq (%rcx), %r15
cmpq %rax, %r15
je 0x54c9
movq (%r15), %rsi
movq 0x30(%rsi), %rcx
cmpq (%r14), %rcx
jne 0x54b8
addq $0x90, %rsi
leaq -0xa0(%rbp), %rdi
callq 0x8d52
movq -0xa0(%rbp), %rbx
movq -0x98(%rbp), %rax
cmpq %rax, %rbx
leaq -0x50(%rbp), %r12
je 0x543d
movq (%rbx), %rcx
movq 0x30(%rcx), %rsi
movq (%r14), %rdi
cmpq %rdi, %rsi
je 0x5434
callq 0x2a48
movq -0x98(%rbp), %rax
addq $0x8, %rbx
cmpq %rax, %rbx
jne 0x5419
movq (%r15), %rsi
movl $0xa8, %eax
addq %rax, %rsi
movq %r13, %rdi
callq 0x8d52
movq -0xd0(%rbp), %rbx
movq -0xc8(%rbp), %rax
cmpq %rax, %rbx
je 0x548e
movq (%rbx), %rcx
movq 0x30(%rcx), %rsi
movq (%r14), %rdi
cmpq %rdi, %rsi
je 0x547e
callq 0x29cc
movq -0xc8(%rbp), %rax
addq $0x8, %rbx
cmpq %rax, %rbx
jne 0x5463
movq -0xd0(%rbp), %rbx
testq %rbx, %rbx
je 0x549b
movq %rbx, %rdi
callq 0x21c0
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x54ac
callq 0x21c0
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x68(%rbp), %rdx
addq $0x8, %r15
cmpq %rax, %r15
jne 0x53df
movq 0x8(%rdx), %r12
addq $0x8, %r14
cmpq %r12, %r14
jne 0x53cf
leaq -0x50(%rbp), %rax
jmp 0x54ef
leaq -0x50(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq -0x60(%rbp), %rdi
cmpq %rax, %rdi
je 0x54fd
callq 0x21c0
leaq -0x130(%rbp), %rdi
callq 0x9690
movq -0x68(%rbp), %rax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x567c
jmp 0x55c3
movq %rax, %rbx
leaq -0x1a0(%rbp), %rdi
jmp 0x563b
movq %rax, %rbx
movq -0x158(%rbp), %rdi
leaq -0x148(%rbp), %rax
cmpq %rax, %rdi
jne 0x55ac
jmp 0x55b6
movq %rax, %rbx
movq -0x60(%rbp), %rdi
jmp 0x5666
jmp 0x55c3
movq %rax, %rbx
leaq -0x1d0(%rbp), %rdi
jmp 0x5632
jmp 0x55be
jmp 0x55c3
jmp 0x55b3
jmp 0x5647
movq %rax, %rbx
leaq -0x200(%rbp), %rdi
callq 0x8ff0
jmp 0x564a
jmp 0x5642
jmp 0x5647
jmp 0x55ea
jmp 0x55b3
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
cmpq %r13, %rdi
je 0x55b6
callq 0x21c0
jmp 0x55b6
movq %rax, %rbx
leaq -0x50(%rbp), %r12
jmp 0x55fe
jmp 0x55cd
movq %rax, %rbx
jmp 0x5637
movq %rax, %rbx
jmp 0x5670
jmp 0x5642
movq %rax, %rbx
jmp 0x561d
jmp 0x5647
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
testq %rdi, %rdi
je 0x55ed
callq 0x21c0
jmp 0x55ed
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x55fe
callq 0x21c0
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
jne 0x566b
jmp 0x5670
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x561d
callq 0x21c0
leaq -0x60(%rbp), %rdi
callq 0x9638
jmp 0x5670
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x8ff0
leaq -0x60(%rbp), %rdi
callq 0x8ff0
jmp 0x5670
movq %rax, %rbx
jmp 0x5656
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x8ff0
leaq -0x60(%rbp), %rdi
callq 0x8ff0
movq -0x170(%rbp), %rdi
testq %rdi, %rdi
je 0x5670
callq 0x21c0
leaq -0x130(%rbp), %rdi
callq 0x9690
movq -0x68(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x568d
callq 0x21c0
movq %rbx, %rdi
callq 0x2370
nop