// File: /workspace/github_cpp_makefile_star2_O1/cssartori[P]ga-qap/src/geneticalgorithm.cpp
// Function: GeneticAlgorithm::run()
Solution GeneticAlgorithm::run(){
	/*Creates an objective function evaluator and a population creator*/
	ObjectiveFunction of(data);

	/*Creates random population as initial set*/
	std::vector<Solution> population = PopulationCreator::random(pop_size, data.n, of, generator);

	/*Local search object*/
	LocalSearch ls(data, of);

	/*Improves locally all the initial solutions*/
	for(size_t i=0;i<population.size();i++){
		population[i] = ls.all_pair_changes(population[i]);
	}
	/*Sorts population in increasing order*/
	sort(population.begin(), population.end());//, comp);
	/*Selects the best solution*/
	Solution best_solution = population[0];
	
	if(prints) printf("Best solution in generation 0:  %i\n", best_solution.fitness());
	
	/*Updates basic information attributes*/
	this->best_solution = best_solution;
	this->initial_solution = best_solution;
	this->iter_best = 0;
	
	/*Initialize basic variables of the GA*/
	size_t u = 1;
	size_t last_mutation = 0;
	int mutation_type = 1;
    size_t generation = 0;
	
	/*GA main loop*/
	while(generation < max_generations){
		generation++;
		std::vector<Solution> offspring;
		while(offspring.size() < pop_size*0.5){
			int except = -1;
			/*Tournament to select parents*/
			Solution p1 = tournament(population, k, except);
			Solution p2 = tournament(population, k, except);

			/*crossover of parents*/
			Solution c = crossover_opt(p1, p2, of);

			/*Evaluate c*/
			//c.set_fitness(of.eval(c));
			
			/*Run a limited local search on the new child*/
			c = ls.limited_iterated_search(c, data.n, generator);	

			offspring.push_back(c);
		}

		/*Sorts offspring in increasing order*/
		sort(offspring.begin(), offspring.end());//, comp);
		/*Inserts the best individuals from offspring in the population as long as they are better than the latter*/
		for(size_t i=0;i<offspring.size();i++){
			if(offspring[i] < population[pop_size-1-i])
				population[pop_size-1-i] = offspring[i];
		}
		
		/*Sorts population in increasing order*/
		sort(population.begin(), population.end());//, comp);
		
		/*In case population has converged*/
		if(population[0] >= best_solution && generation - last_mutation > 100 && generation - iter_best > 200 && mutation_type==1){ 
			/*First try the shift mutation approach*/
			for(size_t i=0;i<pop_size;i++){
				shift_mutation(population[i], u);
				population[i].set_fitness(of.eval(population[i]));
			}
			if(prints) printf("Mutated population with u = %li\n", u);

			u++;
			if(u > data.n){
				/*In case the shift mutation has not done the job, go to the second type*/
				u=1;
				mutation_type=2;
			}

			sort(population.begin(), population.end());//, comp);
			last_mutation = generation;
		}else if(population[0] >= best_solution && generation - last_mutation > 100 && generation - iter_best > 200 && mutation_type==2){
			/*The second approach executes several perturbations in the solutions*/
			if(prints) printf("Perturbing solutions...\n");

			std::uniform_int_distribution<int> rand_place (0,data.n-1);
			
			for(size_t i=0;i<pop_size;i++){
				for(size_t j=0;j<data.n*0.2;j++){
					int r = rand_place(generator);
					int s = rand_place(generator);
					while(r == s) r = rand_place(generator);

					population[i].set_fitness(of.eval_pair_change(population[i], r, s));
				
					int temp = population[i][r];
					population[i][r] = population[i][s];
					population[i][s] = temp;
				}
				
				/*Improves the solutions locally*/
				population[i] = ls.all_pair_changes(population[i]);
			}
			
			sort(population.begin(), population.end());//, comp);
			last_mutation = generation;
			mutation_type = 1;
		}
		
		/*If the new best solution is better than the current one*/
		if(population[0] < best_solution){
			/*Update the current best solution*/
			best_solution = population[0];
			this->best_solution = best_solution;
			this->iter_best = generation;
			u = 1;
			if(prints) printf("Best solution in generation %li:  %i\n", generation, best_solution.fitness());
		}
	}

	/*Finally, return the best solution found*/
	return best_solution;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rsi, %r14
movq %rdi, 0x10(%rsp)
movq (%rsi), %rsi
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
callq 0x3734
movq (%r14), %rax
movq 0x10(%r14), %rsi
movq 0x30(%rax), %rdx
leaq 0x80(%r14), %r8
leaq 0x18(%rsp), %rdi
movq %rbx, %rcx
movq %r8, 0x98(%rsp)
callq 0x3d80
movq %r14, 0x48(%rsp)
movq (%r14), %rsi
leaq 0x108(%rsp), %rdi
movq %rbx, %rdx
callq 0x46e0
movq 0x18(%rsp), %rbp
movq 0x20(%rsp), %r13
movq %r13, %rax
subq %rbp, %rax
je 0x4d9a
xorl %r14d, %r14d
leaq 0x158(%rsp), %rbx
leaq 0x78(%rsp), %r12
xorl %r15d, %r15d
leaq (%r14,%rbp), %rsi
movq %rbx, %rdi
callq 0x2e46
movl 0x18(%rbp,%r14), %eax
movl %eax, 0x170(%rsp)
movq %r12, %rdi
leaq 0x108(%rsp), %rsi
movq %rbx, %rdx
callq 0x46e8
movq 0x18(%rsp), %r13
leaq (%r14,%r13), %rdi
movq %r12, %rsi
callq 0x4b58
movl 0x90(%rsp), %eax
movl %eax, 0x18(%r13,%r14)
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x4d57
movq 0x88(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x158(%rsp), %rdi
testq %rdi, %rdi
je 0x4d74
movq 0x168(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
incq %r15
movq 0x18(%rsp), %rbp
movq 0x20(%rsp), %r13
movq %r13, %rax
subq %rbp, %rax
sarq $0x5, %rax
addq $0x20, %r14
cmpq %rax, %r15
jb 0x4cf5
jmp 0x4d9e
sarq $0x5, %rax
cmpq %r13, %rbp
je 0x4dc6
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x6451
movq %rbp, %rdi
movq %r13, %rsi
callq 0x6507
movq 0x18(%rsp), %rbx
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x2e46
movl 0x18(%rbx), %eax
movq 0x10(%rsp), %rbx
movl %eax, 0x18(%rbx)
movq 0x48(%rsp), %rax
cmpb $0x1, 0x30(%rax)
jne 0x4e06
movq %rbx, %rdi
callq 0x3612
leaq 0x24b3(%rip), %rdi      # 0x72b0
movl %eax, %esi
xorl %eax, %eax
callq 0x2040
movq 0x48(%rsp), %r14
leaq 0x38(%r14), %rdi
movq %rdi, 0x100(%rsp)
movq %rbx, %rsi
callq 0x2cfe
movl 0x18(%rbx), %eax
movl %eax, 0x50(%r14)
leaq 0x58(%r14), %rdi
movq %rbx, %rsi
callq 0x2cfe
movl 0x18(%rbx), %eax
movl %eax, 0x70(%r14)
movq $0x0, 0x78(%r14)
cmpq $0x0, 0x20(%r14)
je 0x56a1
movl $0x1, 0x3c(%rsp)
movl $0x1, %eax
movq %rax, 0x40(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
movq 0x58(%rsp), %r13
movq %r13, %rax
sarq $0x5, %rax
movq %rax, %xmm0
movq 0x21e6(%rip), %xmm2     # 0x7080
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0x21ea(%rip), %xmm3     # 0x7090
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movq 0x10(%r14), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm3, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
mulsd 0x23a8(%rip), %xmm2     # 0x7280
ucomisd %xmm1, %xmm2
movq %r14, %rbx
jbe 0x50fe
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
movq 0x18(%rbx), %rcx
leaq 0x78(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x18(%rsp), %r15
movq %r15, %rdx
leaq 0x74(%rsp), %r12
movq %r12, %r8
callq 0x57f4
movq 0x18(%rbx), %rcx
leaq 0xc0(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %r8
callq 0x57f4
leaq 0xa0(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r13, %rcx
leaq 0x68(%rsp), %r8
callq 0x5954
leaq 0x138(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2e46
movl 0xb8(%rsp), %eax
movl %eax, 0x150(%rsp)
movq (%rbx), %rax
movl 0x30(%rax), %ecx
leaq 0xe0(%rsp), %rdi
leaq 0x108(%rsp), %rsi
movq %r12, %rdx
movq 0x98(%rsp), %r8
callq 0x47f0
movq 0xa0(%rsp), %rdi
movq 0xb0(%rsp), %rsi
movq 0xe0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movupd 0xe8(%rsp), %xmm0
movupd %xmm0, 0xa8(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0xe0(%rsp)
movq $0x0, 0xf0(%rsp)
testq %rdi, %rdi
je 0x4feb
subq %rdi, %rsi
callq 0x21a0
movl 0xf8(%rsp), %eax
movl %eax, 0xb8(%rsp)
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x5016
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x138(%rsp), %rdi
testq %rdi, %rdi
je 0x5033
movq 0x148(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x40e0
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x505d
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x507a
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x5094
movq 0x88(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x50(%rsp), %r12
movq 0x58(%rsp), %r13
movq %r13, %rax
subq %r12, %rax
sarq $0x5, %rax
movq %rax, %xmm0
movq 0x1fcb(%rip), %xmm2     # 0x7080
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0x1fcf(%rip), %xmm3     # 0x7090
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movq 0x10(%rbx), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm3, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
mulsd 0x218e(%rip), %xmm2     # 0x7280
ucomisd %xmm1, %xmm2
ja 0x4ee5
jmp 0x5101
xorl %r12d, %r12d
cmpq %r13, %r12
je 0x5129
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x6451
movq %r12, %rdi
movq %r13, %rsi
callq 0x6507
movq 0x50(%rsp), %rdi
cmpq %rdi, 0x58(%rsp)
je 0x51a8
movq $-0x20, %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
addq %r15, %rdi
movq 0x10(%rbx), %rsi
shlq $0x5, %rsi
addq 0x18(%rsp), %rsi
addq %r14, %rsi
callq 0x361a
testb %al, %al
je 0x5187
movq 0x50(%rsp), %r13
leaq (%r15,%r13), %rsi
movq 0x10(%rbx), %rbp
shlq $0x5, %rbp
addq 0x18(%rsp), %rbp
leaq (%r14,%rbp), %rdi
callq 0x2cfe
movl 0x18(%r13,%r15), %eax
movl %eax, 0x18(%rbp,%r14)
incq %r12
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rax
subq %rdi, %rax
sarq $0x5, %rax
addq $-0x20, %r14
addq $0x20, %r15
cmpq %rax, %r12
jb 0x5142
movq 0x18(%rsp), %r12
movq 0x20(%rsp), %r13
cmpq %r13, %r12
je 0x51e4
movq %r13, %rax
subq %r12, %rax
sarq $0x5, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x6451
movq %r12, %rdi
movq %r13, %rsi
callq 0x6507
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x3638
movq 0x8(%rsp), %r14
incq %r14
movq %r14, 0x8(%rsp)
subq 0x30(%rsp), %r14
cmpq $0x65, %r14
setae %cl
andb %cl, %al
cmpb $0x1, %al
jne 0x5314
movq 0x8(%rsp), %rax
subq 0x78(%rbx), %rax
cmpq $0xc9, %rax
jb 0x5314
cmpl $0x1, 0x3c(%rsp)
jne 0x5314
cmpq $0x0, 0x10(%rbx)
je 0x5284
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x18(%rsp), %rsi
addq %r15, %rsi
movq %rbx, %rdi
movq 0x40(%rsp), %rdx
callq 0x60c8
movq 0x18(%rsp), %r14
addq %r15, %r14
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x3738
movq %r14, %rdi
movl %eax, %esi
callq 0x3616
incq %r12
addq $0x20, %r15
cmpq 0x10(%rbx), %r12
jb 0x5243
cmpb $0x0, 0x30(%rbx)
je 0x529d
leaq 0x2043(%rip), %rdi      # 0x72d4
movq 0x40(%rsp), %rsi
xorl %eax, %eax
callq 0x2040
movq 0x40(%rsp), %rcx
incq %rcx
movq (%rbx), %rax
xorl %edx, %edx
cmpq 0x30(%rax), %rcx
seta %dl
movl $0x1, %eax
cmovaq %rax, %rcx
movq %rcx, 0x40(%rsp)
incl %edx
movl %edx, 0x3c(%rsp)
movq 0x18(%rsp), %r12
movq 0x20(%rsp), %r13
cmpq %r13, %r12
je 0x55fa
movq %r13, %rax
subq %r12, %rax
sarq $0x5, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x6451
movq %r12, %rdi
movq %r13, %rsi
callq 0x6507
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x5604
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x3638
cmpq $0x65, %r14
setae %cl
andb %cl, %al
cmpb $0x1, %al
jne 0x5604
movq 0x8(%rsp), %rax
subq 0x78(%rbx), %rax
cmpq $0xc9, %rax
jb 0x5604
cmpl $0x2, 0x3c(%rsp)
jne 0x5604
cmpb $0x1, 0x30(%rbx)
jne 0x5366
leaq 0x1fba(%rip), %rdi      # 0x731b
callq 0x2230
movq (%rbx), %rax
movl 0x30(%rax), %eax
decl %eax
movl $0x0, 0xc0(%rsp)
movl %eax, 0xc4(%rsp)
cmpq $0x0, 0x10(%rbx)
leaq 0x78(%rsp), %r12
leaq 0xc0(%rsp), %r13
je 0x55b6
movq $0x0, 0x30(%rsp)
movq (%rbx), %rax
movsd 0x30(%rax), %xmm0
unpcklps 0x1cd0(%rip), %xmm0     # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x1cd8(%rip), %xmm0     # 0x7090
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x1ebc(%rip), %xmm1     # 0x7288
ucomisd 0x1ebc(%rip), %xmm1     # 0x7290
jbe 0x5504
xorl %r15d, %r15d
movq %r13, %rdi
movq 0x98(%rsp), %rbx
movq %rbx, %rsi
movq %r13, %rdx
callq 0x4242
movl %eax, %ebp
movq %r13, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x4242
movl %eax, %r13d
cmpl %r13d, %ebp
jne 0x5422
leaq 0xc0(%rsp), %rdi
movq %rbx, %rsi
movq %rdi, %rdx
callq 0x4242
movl %eax, %ebp
jmp 0x5406
movq 0x30(%rsp), %r12
shlq $0x5, %r12
movq 0x18(%rsp), %r14
addq %r12, %r14
movslq %ebp, %rdx
movslq %r13d, %rcx
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x37f6
movq %r14, %rdi
movl %eax, %esi
callq 0x3616
movq 0x18(%rsp), %rdi
addq %r12, %rdi
movl %ebp, %esi
callq 0x35fc
movl (%rax), %r14d
movq 0x18(%rsp), %rdi
addq %r12, %rdi
movl %r13d, %esi
callq 0x35fc
movl (%rax), %ebx
movq 0x18(%rsp), %rdi
addq %r12, %rdi
movl %ebp, %esi
callq 0x35fc
movl %ebx, (%rax)
addq 0x18(%rsp), %r12
movq %r12, %rdi
movl %r13d, %esi
callq 0x35fc
movl %r14d, (%rax)
incq %r15
movq %r15, %xmm0
movq 0x1bd8(%rip), %xmm2     # 0x7080
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0x1bdc(%rip), %xmm3     # 0x7090
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movq 0x48(%rsp), %rax
movq (%rax), %rax
movq 0x30(%rax), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm3, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
mulsd 0x1d9b(%rip), %xmm2     # 0x7288
ucomisd %xmm1, %xmm2
leaq 0x78(%rsp), %r12
leaq 0xc0(%rsp), %r13
ja 0x53dd
movq 0x30(%rsp), %r15
shlq $0x5, %r15
movq 0x18(%rsp), %r14
addq %r15, %r14
leaq 0x118(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2e46
movl 0x18(%r14), %eax
movl %eax, 0x130(%rsp)
movq %r12, %rdi
leaq 0x108(%rsp), %rsi
movq %rbx, %rdx
callq 0x46e8
movq 0x18(%rsp), %rbx
leaq (%rbx,%r15), %rdi
movq %r12, %rsi
callq 0x4b58
movl 0x90(%rsp), %eax
movl %eax, 0x18(%rbx,%r15)
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x557d
movq 0x88(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
movq 0x48(%rsp), %rbx
je 0x559f
movq 0x128(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x30(%rsp), %rcx
incq %rcx
movq %rcx, 0x30(%rsp)
cmpq 0x10(%rbx), %rcx
jb 0x53a1
movq 0x18(%rsp), %r12
movq 0x20(%rsp), %r13
cmpq %r13, %r12
je 0x55f2
movq %r13, %rax
subq %r12, %rax
sarq $0x5, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x6451
movq %r12, %rdi
movq %r13, %rsi
callq 0x6507
movl $0x1, 0x3c(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x361a
testb %al, %al
je 0x5680
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x2cfe
movl 0x18(%r14), %eax
movq 0x10(%rsp), %rsi
movl %eax, 0x18(%rsi)
movq 0x100(%rsp), %rdi
callq 0x2cfe
movq 0x10(%rsp), %rdi
movl 0x18(%rdi), %eax
movl %eax, 0x50(%rbx)
movq 0x8(%rsp), %rax
movq %rax, 0x78(%rbx)
movl $0x1, %eax
movq %rax, 0x40(%rsp)
cmpb $0x1, 0x30(%rbx)
jne 0x5680
callq 0x3612
leaq 0x1c83(%rip), %rdi      # 0x72f5
movq 0x8(%rsp), %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x2040
leaq 0x50(%rsp), %rdi
callq 0x4126
movq 0x8(%rsp), %rax
cmpq 0x20(%rbx), %rax
movq %rbx, %r14
movq 0x10(%rsp), %rbx
jb 0x4e70
leaq 0x18(%rsp), %rdi
callq 0x4126
movq %rbx, %rax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x57c9
jmp 0x56f0
jmp 0x57bc
movq %rax, %rbx
movq 0x158(%rsp), %rdi
testq %rdi, %rdi
je 0x57e2
movq 0x168(%rsp), %rsi
jmp 0x57da
movq %rax, %rbx
jmp 0x57e2
movq %rax, %rbx
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x57bf
movq 0x128(%rsp), %rsi
jmp 0x57aa
jmp 0x57bc
jmp 0x57bc
jmp 0x57bc
jmp 0x57bc
jmp 0x575b
movq %rax, %rbx
jmp 0x577b
movq %rax, %rbx
movq 0x138(%rsp), %rdi
testq %rdi, %rdi
je 0x575e
movq 0x148(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0x575e
movq %rax, %rbx
jmp 0x5798
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x577b
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x5798
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x57bf
movq 0x88(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0x57bf
jmp 0x57bc
jmp 0x57bc
jmp 0x57bc
jmp 0x57bc
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x4126
movq 0x10(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x57e2
movq 0x10(%rax), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0x18(%rsp), %rdi
callq 0x4126
movq %rbx, %rdi
callq 0x2280