// File: 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
subq $0x6b0, %rsp            # imm = 0x6B0
movq %rsi, -0x5b0(%rbp)
movq %rdi, -0x5c0(%rbp)
movq %rdi, %rax
movq %rax, -0x5b8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movb $0x0, -0x15(%rbp)
callq 0xb650
movq -0x5b0(%rbp), %rdi
callq 0xc7e0
movq %rax, -0x20(%rbp)
movq -0x5b0(%rbp), %rdi
callq 0xc850
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xc810
testb $0x1, %al
jne 0x677a
jmp 0x67a0
leaq -0x20(%rbp), %rdi
callq 0xc880
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3cd0
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0xc8a0
movq %rax, -0x30(%rbp)
jmp 0x6757
leaq -0x80(%rbp), %rdi
callq 0xc930
jmp 0x67ab
movq -0x5b0(%rbp), %rdi
callq 0xc7e0
movq %rax, -0x98(%rbp)
movq -0x5b0(%rbp), %rdi
callq 0xc850
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xc810
testb $0x1, %al
jne 0x67ed
jmp 0x693b
leaq -0x98(%rbp), %rdi
callq 0xc880
movq (%rax), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x3c50
jmp 0x680a
leaq -0xb8(%rbp), %rdi
callq 0xbc10
cmpq $0x0, %rax
jne 0x6904
movl $0xc0, %edi
callq 0x3250
movq %rax, -0x5c8(%rbp)
jmp 0x6833
movq -0x5c8(%rbp), %rdi
callq 0x3710
jmp 0x6841
movq -0x5c0(%rbp), %rdi
movq -0x5c8(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0xc0(%rbp), %rsi
callq 0xbc50
jmp 0x6864
leaq -0x98(%rbp), %rdi
movq %rdi, -0x5d0(%rbp)
callq 0xc880
movq (%rax), %rdi
movq -0xc0(%rbp), %rsi
callq 0x3cd0
movq -0x5d0(%rbp), %rdi
callq 0xc880
movq %rax, %rsi
leaq -0x80(%rbp), %rdi
callq 0xc960
jmp 0x68a0
jmp 0x6904
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x7a52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x7a2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x692a
movq -0x5c8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
callq 0x3230
jmp 0x692a
leaq -0xb8(%rbp), %rdi
callq 0xb670
leaq -0x98(%rbp), %rdi
xorl %esi, %esi
callq 0xc8a0
movq %rax, -0xc8(%rbp)
jmp 0x67be
leaq -0xb8(%rbp), %rdi
callq 0xb670
jmp 0x7a2b
jmp 0x693d
leaq -0x80(%rbp), %rdi
callq 0xc990
movb %al, -0x5d1(%rbp)
jmp 0x694e
movb -0x5d1(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x695f
jmp 0x7213
leaq -0x80(%rbp), %rdi
callq 0xc9b0
movq %rax, -0x5e0(%rbp)
jmp 0x6971
movq -0x5e0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xd0(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xc9d0
jmp 0x698d
movq -0xd0(%rbp), %rdi
callq 0x3cf0
movq %rax, -0xd8(%rbp)
movq -0xd0(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0x38f0
jmp 0x69b5
leaq -0x108(%rbp), %rdi
callq 0xc350
movq %rax, -0x5e8(%rbp)
movslq -0x14(%rbp), %rax
movq %rax, -0x5f0(%rbp)
leaq -0x108(%rbp), %rdi
callq 0xb6d0
movq -0x5f0(%rbp), %rcx
movq -0x5e8(%rbp), %rax
cmpq %rcx, %rax
jae 0x6f39
movq -0xd8(%rbp), %rax
movq %rax, -0x5f8(%rbp)
movq -0xd0(%rbp), %rsi
leaq -0x138(%rbp), %rdi
callq 0x38f0
jmp 0x6a19
movq -0x5f8(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x3950
jmp 0x6a2e
leaq -0x138(%rbp), %rdi
callq 0xb6d0
movq -0x5b0(%rbp), %rdi
callq 0xc7e0
movq %rax, -0x140(%rbp)
movq -0x5b0(%rbp), %rdi
callq 0xc850
movq %rax, -0x148(%rbp)
leaq -0x140(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0xc810
testb $0x1, %al
jne 0x6a7c
jmp 0x6f37
leaq -0x140(%rbp), %rdi
callq 0xc880
movq (%rax), %rsi
leaq -0x160(%rbp), %rdi
callq 0x3c50
jmp 0x6a99
movb $0x1, -0x161(%rbp)
leaq -0x198(%rbp), %rdi
movq %rdi, -0x600(%rbp)
callq 0xb630
movq -0x600(%rbp), %rdi
callq 0xc460
leaq -0x140(%rbp), %rdi
callq 0xc880
movq (%rax), %rdi
callq 0x7a70
jmp 0x6ad5
leaq -0x160(%rbp), %rdi
callq 0xc7e0
movq %rax, -0x1a0(%rbp)
leaq -0x160(%rbp), %rdi
callq 0xc850
movq %rax, -0x1a8(%rbp)
leaq -0x1a0(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0xc810
testb $0x1, %al
jne 0x6b17
jmp 0x6bc6
leaq -0x1a0(%rbp), %rdi
callq 0xc880
movq (%rax), %rdi
callq 0x3cf0
cmpq -0xd8(%rbp), %rax
je 0x6baa
leaq -0x1a0(%rbp), %rdi
callq 0xc880
movq (%rax), %rax
movq %rax, -0x608(%rbp)
leaq -0x140(%rbp), %rdi
callq 0xc880
movq %rax, %rcx
movq -0x608(%rbp), %rax
cmpq (%rcx), %rax
je 0x6ba8
movb $0x0, -0x161(%rbp)
jmp 0x6ba8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x138(%rbp), %rdi
callq 0xb6d0
jmp 0x7a2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x6f1a
jmp 0x6baa
jmp 0x6bac
leaq -0x1a0(%rbp), %rdi
xorl %esi, %esi
callq 0xc8a0
movq %rax, -0x1b0(%rbp)
jmp 0x6ae8
movq -0x5b0(%rbp), %rdi
callq 0xc7e0
movq %rax, -0x1b8(%rbp)
movq -0x5b0(%rbp), %rdi
callq 0xc850
movq %rax, -0x1c0(%rbp)
leaq -0x1b8(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0xc810
testb $0x1, %al
jne 0x6c08
jmp 0x6d0e
leaq -0x1b8(%rbp), %rdi
callq 0xc880
movq (%rax), %rsi
leaq -0x1f0(%rbp), %rdi
callq 0x38f0
jmp 0x6c25
leaq -0x1f0(%rbp), %rdi
callq 0xb9f0
movq %rax, -0x1f8(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0xba50
movq %rax, -0x200(%rbp)
leaq -0x1f8(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0xba20
testb $0x1, %al
jne 0x6c67
jmp 0x6ce8
leaq -0x1f8(%rbp), %rdi
callq 0xba80
movq %rax, %rsi
leaq -0x198(%rbp), %rdi
callq 0xbe30
movb %dl, -0x611(%rbp)
movq %rax, -0x610(%rbp)
jmp 0x6c91
movb -0x611(%rbp), %al
movq -0x610(%rbp), %rcx
movq %rcx, -0x210(%rbp)
movb %al, -0x208(%rbp)
leaq -0x1f8(%rbp), %rdi
xorl %esi, %esi
callq 0xc5e0
movq %rax, -0x218(%rbp)
jmp 0x6c38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0xb6d0
jmp 0x6f1a
leaq -0x1f0(%rbp), %rdi
callq 0xb6d0
leaq -0x1b8(%rbp), %rdi
xorl %esi, %esi
callq 0xc8a0
movq %rax, -0x220(%rbp)
jmp 0x6bd9
leaq -0x140(%rbp), %rdi
callq 0xc880
movq (%rax), %rdi
callq 0x3cf0
cmpq $0x0, %rax
jne 0x6ee8
testb $0x1, -0x161(%rbp)
je 0x6ee8
leaq -0x198(%rbp), %rdi
callq 0xc350
movslq -0x14(%rbp), %rcx
cmpq %rcx, %rax
jae 0x6ee8
leaq -0x140(%rbp), %rdi
movq %rdi, -0x620(%rbp)
callq 0xc880
movq (%rax), %rdi
movq -0xd8(%rbp), %rsi
callq 0x3cd0
movq -0x620(%rbp), %rdi
callq 0xc880
movq (%rax), %rsi
leaq -0x250(%rbp), %rdi
callq 0x38f0
jmp 0x6d91
movq -0xd8(%rbp), %rsi
leaq -0x280(%rbp), %rdi
callq 0x38f0
jmp 0x6da6
leaq -0x198(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0xc580
leaq -0x280(%rbp), %rdi
callq 0xb6d0
leaq -0x250(%rbp), %rdi
callq 0xb9f0
movq %rax, -0x288(%rbp)
leaq -0x250(%rbp), %rdi
callq 0xba50
movq %rax, -0x290(%rbp)
leaq -0x288(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0xba20
testb $0x1, %al
jne 0x6e04
jmp 0x6e6a
leaq -0x288(%rbp), %rdi
callq 0xba80
movq %rax, %rsi
leaq -0x198(%rbp), %rdi
callq 0xbe30
movb %dl, -0x629(%rbp)
movq %rax, -0x628(%rbp)
jmp 0x6e2e
movb -0x629(%rbp), %al
movq -0x628(%rbp), %rcx
movq %rcx, -0x2a0(%rbp)
movb %al, -0x298(%rbp)
leaq -0x288(%rbp), %rdi
callq 0xbbe0
jmp 0x6dd8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x6eda
movq -0xd8(%rbp), %rax
movq %rax, -0x638(%rbp)
leaq -0x2d0(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0xb710
jmp 0x6e8d
movq -0x638(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x3950
jmp 0x6ea2
leaq -0x2d0(%rbp), %rdi
callq 0xb6d0
leaq -0x250(%rbp), %rdi
callq 0xb6d0
jmp 0x6ee8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0xb6d0
leaq -0x250(%rbp), %rdi
callq 0xb6d0
jmp 0x6f1a
leaq -0x198(%rbp), %rdi
callq 0xb6d0
leaq -0x160(%rbp), %rdi
callq 0xb670
leaq -0x140(%rbp), %rdi
xorl %esi, %esi
callq 0xc8a0
movq %rax, -0x2d8(%rbp)
jmp 0x6a4d
leaq -0x198(%rbp), %rdi
callq 0xb6d0
leaq -0x160(%rbp), %rdi
callq 0xb670
jmp 0x7a2b
jmp 0x6f39
leaq -0x308(%rbp), %rdi
callq 0xc9f0
leaq -0x308(%rbp), %rdi
callq 0xca10
movq -0x5b0(%rbp), %rdi
callq 0xc7e0
movq %rax, -0x310(%rbp)
movq -0x5b0(%rbp), %rdi
callq 0xc850
movq %rax, -0x318(%rbp)
leaq -0x310(%rbp), %rdi
leaq -0x318(%rbp), %rsi
callq 0xc810
testb $0x1, %al
jne 0x6f93
jmp 0x70d3
leaq -0x310(%rbp), %rdi
callq 0xc880
movq (%rax), %rdi
callq 0x3cf0
cmpq -0xd8(%rbp), %rax
jne 0x70b7
leaq -0x310(%rbp), %rdi
callq 0xc880
movq (%rax), %rsi
leaq -0x330(%rbp), %rdi
callq 0x3c90
jmp 0x6fd1
leaq -0x330(%rbp), %rdi
callq 0xc7e0
movq %rax, -0x338(%rbp)
leaq -0x330(%rbp), %rdi
callq 0xc850
movq %rax, -0x340(%rbp)
leaq -0x338(%rbp), %rdi
leaq -0x340(%rbp), %rsi
callq 0xc810
testb $0x1, %al
jne 0x7013
jmp 0x70ab
leaq -0x338(%rbp), %rdi
callq 0xc880
movq %rax, %rsi
leaq -0x308(%rbp), %rdi
callq 0xca30
movb %dl, -0x641(%rbp)
movq %rax, -0x640(%rbp)
jmp 0x703d
movb -0x641(%rbp), %al
movq -0x640(%rbp), %rcx
movq %rcx, -0x350(%rbp)
movb %al, -0x348(%rbp)
leaq -0x338(%rbp), %rdi
xorl %esi, %esi
callq 0xc8a0
movq %rax, -0x358(%rbp)
jmp 0x6fe4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x7202
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x330(%rbp), %rdi
callq 0xb670
jmp 0x7202
leaq -0x330(%rbp), %rdi
callq 0xb670
jmp 0x70b9
leaq -0x310(%rbp), %rdi
xorl %esi, %esi
callq 0xc8a0
movq %rax, -0x360(%rbp)
jmp 0x6f64
leaq -0x308(%rbp), %rdi
callq 0xca80
movq %rax, -0x368(%rbp)
leaq -0x308(%rbp), %rdi
callq 0xcae0
movq %rax, -0x370(%rbp)
leaq -0x368(%rbp), %rdi
leaq -0x370(%rbp), %rsi
callq 0xcab0
testb $0x1, %al
jne 0x7115
jmp 0x71f1
leaq -0x368(%rbp), %rdi
callq 0xcb10
movq (%rax), %rdi
callq 0x3cf0
cmpq $0x0, %rax
jne 0x71d5
movl $0xc0, %edi
callq 0x3250
movq %rax, -0x650(%rbp)
jmp 0x7146
movq -0x650(%rbp), %rdi
callq 0x3710
jmp 0x7154
movq -0x5c0(%rbp), %rdi
movq -0x650(%rbp), %rax
movq %rax, -0x378(%rbp)
leaq -0x378(%rbp), %rsi
callq 0xbc50
jmp 0x7177
leaq -0x368(%rbp), %rdi
movq %rdi, -0x658(%rbp)
callq 0xcb10
movq (%rax), %rdi
movq -0x378(%rbp), %rsi
callq 0x3cd0
movq -0x658(%rbp), %rdi
callq 0xcb10
movq %rax, %rsi
leaq -0x80(%rbp), %rdi
callq 0xc960
jmp 0x71b3
jmp 0x71d5
movq -0x650(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
callq 0x3230
jmp 0x7202
jmp 0x71d7
leaq -0x368(%rbp), %rdi
xorl %esi, %esi
callq 0xcb30
movq %rax, -0x380(%rbp)
jmp 0x70e6
leaq -0x308(%rbp), %rdi
callq 0xcb70
jmp 0x693d
leaq -0x308(%rbp), %rdi
callq 0xcb70
jmp 0x7a2b
movq -0x5c0(%rbp), %rdi
callq 0xc7e0
movq %rax, -0x388(%rbp)
movq -0x5c0(%rbp), %rdi
callq 0xc850
movq %rax, -0x390(%rbp)
leaq -0x388(%rbp), %rdi
leaq -0x390(%rbp), %rsi
callq 0xc810
testb $0x1, %al
jne 0x7255
jmp 0x74a9
leaq -0x3c0(%rbp), %rdi
callq 0xb630
leaq -0x3c0(%rbp), %rdi
callq 0xc460
movq -0x5b0(%rbp), %rdi
callq 0xc7e0
movq %rax, -0x3c8(%rbp)
movq -0x5b0(%rbp), %rdi
callq 0xc850
movq %rax, -0x3d0(%rbp)
leaq -0x3c8(%rbp), %rdi
leaq -0x3d0(%rbp), %rsi
callq 0xc810
testb $0x1, %al
jne 0x72af
jmp 0x7408
leaq -0x3c8(%rbp), %rdi
callq 0xc880
movq (%rax), %rdi
callq 0x3cf0
movq %rax, -0x660(%rbp)
leaq -0x388(%rbp), %rdi
callq 0xc880
movq %rax, %rcx
movq -0x660(%rbp), %rax
cmpq (%rcx), %rax
jne 0x73ec
leaq -0x3c8(%rbp), %rdi
callq 0xc880
movq (%rax), %rsi
leaq -0x400(%rbp), %rdi
callq 0x38f0
jmp 0x7306
leaq -0x400(%rbp), %rdi
callq 0xb9f0
movq %rax, -0x408(%rbp)
leaq -0x400(%rbp), %rdi
callq 0xba50
movq %rax, -0x410(%rbp)
leaq -0x408(%rbp), %rdi
leaq -0x410(%rbp), %rsi
callq 0xba20
testb $0x1, %al
jne 0x7348
jmp 0x73e0
leaq -0x408(%rbp), %rdi
callq 0xba80
movq %rax, %rsi
leaq -0x3c0(%rbp), %rdi
callq 0xbe30
movb %dl, -0x669(%rbp)
movq %rax, -0x668(%rbp)
jmp 0x7372
movb -0x669(%rbp), %al
movq -0x668(%rbp), %rcx
movq %rcx, -0x420(%rbp)
movb %al, -0x418(%rbp)
leaq -0x408(%rbp), %rdi
xorl %esi, %esi
callq 0xc5e0
movq %rax, -0x428(%rbp)
jmp 0x7319
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x7498
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x400(%rbp), %rdi
callq 0xb6d0
jmp 0x7498
leaq -0x400(%rbp), %rdi
callq 0xb6d0
jmp 0x73ee
leaq -0x3c8(%rbp), %rdi
xorl %esi, %esi
callq 0xc8a0
movq %rax, -0x430(%rbp)
jmp 0x7280
leaq -0x388(%rbp), %rdi
callq 0xc880
movq (%rax), %rax
movq %rax, -0x678(%rbp)
leaq -0x460(%rbp), %rdi
leaq -0x3c0(%rbp), %rsi
callq 0xb710
jmp 0x7433
movq -0x678(%rbp), %rdi
leaq -0x460(%rbp), %rsi
callq 0x3950
jmp 0x7448
leaq -0x460(%rbp), %rdi
callq 0xb6d0
leaq -0x3c0(%rbp), %rdi
callq 0xb6d0
leaq -0x388(%rbp), %rdi
xorl %esi, %esi
callq 0xc8a0
movq %rax, -0x468(%rbp)
jmp 0x7226
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x460(%rbp), %rdi
callq 0xb6d0
leaq -0x3c0(%rbp), %rdi
callq 0xb6d0
jmp 0x7a2b
leaq -0x488(%rbp), %rdi
callq 0x3360
movq -0x5c0(%rbp), %rdi
callq 0xc7e0
movq %rax, -0x490(%rbp)
movq -0x5c0(%rbp), %rdi
callq 0xc850
movq %rax, -0x498(%rbp)
leaq -0x490(%rbp), %rdi
leaq -0x498(%rbp), %rsi
callq 0xc810
testb $0x1, %al
jne 0x74f7
jmp 0x76cd
leaq 0x10b9c(%rip), %rsi     # 0x1809a
leaq -0x488(%rbp), %rdi
callq 0x3330
jmp 0x750c
movq -0x5b0(%rbp), %rdi
callq 0xc7e0
movq %rax, -0x4a0(%rbp)
movq -0x5b0(%rbp), %rdi
callq 0xc850
movq %rax, -0x4a8(%rbp)
leaq -0x4a0(%rbp), %rdi
leaq -0x4a8(%rbp), %rsi
callq 0xc810
testb $0x1, %al
jne 0x754e
jmp 0x7644
leaq -0x4a0(%rbp), %rdi
callq 0xc880
movq (%rax), %rdi
callq 0x3cf0
movq %rax, -0x680(%rbp)
leaq -0x490(%rbp), %rdi
callq 0xc880
movq %rax, %rcx
movq -0x680(%rbp), %rax
cmpq (%rcx), %rax
jne 0x7628
leaq -0x4a0(%rbp), %rdi
callq 0xc880
movq (%rax), %rsi
leaq -0x4e8(%rbp), %rdi
callq 0x38c0
jmp 0x75a5
leaq -0x4c8(%rbp), %rdi
leaq -0x488(%rbp), %rsi
leaq -0x4e8(%rbp), %rdx
callq 0xc8e0
jmp 0x75c1
leaq -0x488(%rbp), %rdi
leaq -0x4c8(%rbp), %rsi
callq 0x32c0
leaq -0x4c8(%rbp), %rdi
callq 0x31a0
leaq -0x4e8(%rbp), %rdi
callq 0x31a0
jmp 0x7628
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x7a1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x4e8(%rbp), %rdi
callq 0x31a0
jmp 0x7a1f
jmp 0x762a
leaq -0x4a0(%rbp), %rdi
xorl %esi, %esi
callq 0xc8a0
movq %rax, -0x4f0(%rbp)
jmp 0x751f
leaq -0x490(%rbp), %rdi
callq 0xc880
movq (%rax), %rax
movq %rax, -0x688(%rbp)
leaq -0x510(%rbp), %rdi
leaq -0x488(%rbp), %rsi
callq 0x3110
jmp 0x766f
movq -0x688(%rbp), %rdi
leaq -0x510(%rbp), %rsi
callq 0x3820
jmp 0x7684
leaq -0x510(%rbp), %rdi
callq 0x31a0
leaq -0x490(%rbp), %rdi
xorl %esi, %esi
callq 0xc8a0
movq %rax, -0x518(%rbp)
jmp 0x74c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x510(%rbp), %rdi
callq 0x31a0
jmp 0x7a1f
movq -0x5c0(%rbp), %rdi
callq 0xc7e0
movq %rax, -0x520(%rbp)
movq -0x5c0(%rbp), %rdi
callq 0xc850
movq %rax, -0x528(%rbp)
leaq -0x520(%rbp), %rdi
leaq -0x528(%rbp), %rsi
callq 0xc810
testb $0x1, %al
jne 0x770f
jmp 0x79fe
movq -0x5b0(%rbp), %rdi
callq 0xc7e0
movq %rax, -0x530(%rbp)
movq -0x5b0(%rbp), %rdi
callq 0xc850
movq %rax, -0x538(%rbp)
leaq -0x530(%rbp), %rdi
leaq -0x538(%rbp), %rsi
callq 0xc810
testb $0x1, %al
jne 0x7751
jmp 0x79e2
leaq -0x530(%rbp), %rdi
callq 0xc880
movq (%rax), %rdi
callq 0x3cf0
movq %rax, -0x690(%rbp)
leaq -0x520(%rbp), %rdi
callq 0xc880
movq %rax, %rcx
movq -0x690(%rbp), %rax
cmpq (%rcx), %rax
jne 0x79c6
leaq -0x530(%rbp), %rdi
callq 0xc880
movq (%rax), %rsi
leaq -0x550(%rbp), %rdi
callq 0x3c50
jmp 0x77a8
leaq -0x550(%rbp), %rdi
callq 0xc7e0
movq %rax, -0x558(%rbp)
leaq -0x550(%rbp), %rdi
callq 0xc850
movq %rax, -0x560(%rbp)
leaq -0x558(%rbp), %rdi
leaq -0x560(%rbp), %rsi
callq 0xc810
testb $0x1, %al
jne 0x77ea
jmp 0x7890
leaq -0x558(%rbp), %rdi
callq 0xc880
movq (%rax), %rdi
callq 0x3cf0
movq %rax, -0x698(%rbp)
leaq -0x520(%rbp), %rdi
callq 0xc880
movq %rax, %rcx
movq -0x698(%rbp), %rax
cmpq (%rcx), %rax
je 0x7874
leaq -0x520(%rbp), %rdi
callq 0xc880
movq (%rax), %rax
movq %rax, -0x6a0(%rbp)
leaq -0x558(%rbp), %rdi
callq 0xc880
movq (%rax), %rdi
callq 0x3cf0
movq -0x6a0(%rbp), %rdi
movq %rax, %rsi
callq 0x3bb0
jmp 0x785b
jmp 0x7874
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x79b8
jmp 0x7876
leaq -0x558(%rbp), %rdi
xorl %esi, %esi
callq 0xc8a0
movq %rax, -0x568(%rbp)
jmp 0x77bb
leaq -0x530(%rbp), %rdi
callq 0xc880
movq (%rax), %rsi
leaq -0x580(%rbp), %rdi
callq 0x3c90
jmp 0x78ad
leaq -0x580(%rbp), %rdi
callq 0xc7e0
movq %rax, -0x588(%rbp)
leaq -0x580(%rbp), %rdi
callq 0xc850
movq %rax, -0x590(%rbp)
leaq -0x588(%rbp), %rdi
leaq -0x590(%rbp), %rsi
callq 0xc810
testb $0x1, %al
jne 0x78ef
jmp 0x799e
leaq -0x588(%rbp), %rdi
callq 0xc880
movq (%rax), %rdi
callq 0x3cf0
movq %rax, -0x6a8(%rbp)
leaq -0x520(%rbp), %rdi
callq 0xc880
movq %rax, %rcx
movq -0x6a8(%rbp), %rax
cmpq (%rcx), %rax
je 0x7982
leaq -0x520(%rbp), %rdi
callq 0xc880
movq (%rax), %rax
movq %rax, -0x6b0(%rbp)
leaq -0x588(%rbp), %rdi
callq 0xc880
movq (%rax), %rdi
callq 0x3cf0
movq -0x6b0(%rbp), %rdi
movq %rax, %rsi
callq 0x3b10
jmp 0x7960
jmp 0x7982
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x580(%rbp), %rdi
callq 0xb670
jmp 0x79b8
jmp 0x7984
leaq -0x588(%rbp), %rdi
xorl %esi, %esi
callq 0xc8a0
movq %rax, -0x598(%rbp)
jmp 0x78c0
leaq -0x580(%rbp), %rdi
callq 0xb670
leaq -0x550(%rbp), %rdi
callq 0xb670
jmp 0x79c6
leaq -0x550(%rbp), %rdi
callq 0xb670
jmp 0x7a1f
jmp 0x79c8
leaq -0x530(%rbp), %rdi
xorl %esi, %esi
callq 0xc8a0
movq %rax, -0x5a0(%rbp)
jmp 0x7722
jmp 0x79e4
leaq -0x520(%rbp), %rdi
xorl %esi, %esi
callq 0xc8a0
movq %rax, -0x5a8(%rbp)
jmp 0x76e0
movb $0x1, -0x15(%rbp)
leaq -0x488(%rbp), %rdi
callq 0x31a0
leaq -0x80(%rbp), %rdi
callq 0xcb90
testb $0x1, -0x15(%rbp)
jne 0x7a42
jmp 0x7a36
leaq -0x488(%rbp), %rdi
callq 0x31a0
leaq -0x80(%rbp), %rdi
callq 0xcb90
jmp 0x7a52
movq -0x5c0(%rbp), %rdi
callq 0xb670
movq -0x5b8(%rbp), %rax
addq $0x6b0, %rsp            # imm = 0x6B0
popq %rbp
retq
movq -0x5c0(%rbp), %rdi
callq 0xb670
movq -0x88(%rbp), %rdi
callq 0x3440
nopw (%rax,%rax)