// File: /workspace/github_cpp_makefile_star2_O1/FakePsyho[P]halite2/MyBot.cpp
// Function: move_to(hlt::Ship const&, hlt::Location const&, double, double, bool, bool, bool, int, bool)
Move move_to(const Ship& ship, const Location& target, double maxSpeed = MAX_SPEED, double radius = 0, bool avoidEnemies = false, bool cluster = false, bool avoidEdges = false, int baitTarget = -1, bool reversePlayers = false) {
	radius *= radius;
	VC<Entity> planets = findCloseEntities(ship.location, 10.0, MASK_PLANETS);
	VC<Entity> docked = findCloseEntities(ship.location, 10.0, MASK_ALLIES_DOCKED);
	VC<Entity> entities = findCloseEntities(ship.location, 16.0, MASK_PLANETS | MASK_ALLIES | MASK_ALLIES_DOCKED | MASK_ENEMIES_DOCKED, ship.entity_id);
	VC<Entity> enemies = avoidEnemies ? findCloseEntities(ship.location, 25.0, MASK_ENEMIES) : VC<Entity>();
	VC<Entity> miners = findCloseEntities(ship.location, 13.0, MASK_ENEMIES_DOCKED);
	// VC<Entity> allies = cluster || reversePlayers ? findCloseEntities(ship.location, 30.0, MASK_ALLIES | MASK_ALLIES_DOCKED, ship.entity_id) : VC<Entity>();
	VC<Entity> allies = cluster ? findCloseEntities(ship.location, 30.0, MASK_ALLIES | MASK_ALLIES_DOCKED) : VC<Entity>();
	VC<Location> spawnedEnemies;
	Entity baitEnemy;
	if (reversePlayers) {
		allies = VC<Entity>();
		docked = VC<Entity>();
		miners = findCloseEntities(ship.location, 13.0, MASK_ALLIES_DOCKED);
		enemies = findCloseEntities(ship.location, 25.0, MASK_ALLIES);
		for (auto& e : entities) e.move.move_thrust = 0;
	}
	if (avoidEnemies) {
		for (Entity& enemy : enemies) {
			enemy.move.move_thrust = MAX_SPEED;
			enemy.move.move_angle_deg = util::angle_rad_to_deg_clipped(enemy.location.orient_towards_in_rad(ship.location));
		}
		if (!reversePlayers) {
			for (auto& spawn : spawnedShips) {
				if (spawn.Y != player_id && ship.location.dist(spawn.X) < 25.0) spawnedEnemies.PB(spawn.X);
			}
		}
		
		if (baitTarget != -1) {
			for (auto& e : enemies) if (e.entity_id == baitTarget) baitEnemy = e;
			if (baitEnemy.entity_id != baitTarget) baitTarget = -1;
		}
	}
	
	double ang = ship.location.get_angle(target);
	
	int TOTAL_ANG_STEPS = 360;
	
	double bv = 1e9;
	double bang = 0;
	double bd2 = 0;
	double bthrust = -1;
	int battackers = 0;
	bool bbait = false;
	
	// if (radius == 0 && !avoidEnemies && !detectCollisions(ship.location, round_angle(ang), (int)maxSpeed, entities)) return Move::thrust_rad(ship.entity_id, (int)maxSpeed, round_angle(ang));
	
	const double DANGER_DIST = baitTarget == -1 ? 6.25 : 6.25;
	int angoff = angle_rad_to_deg_clipped(ang);
	
	for (int xang = 0; xang < 360; xang += 360 / TOTAL_ANG_STEPS) {
		int nang = (xang + angoff) % 360;
		REP(nthrust, maxSpeed + 1e-9) {
			if (nthrust == 0 && xang) continue;
			Location end = ship.location + velocity[nang][nthrust];
			double d2 = target.dist_sq(end);
			double av = d2;
			if (radius) av = av < radius ? radius - av : 10000 + av;
			
			if (enemies.S == 0 && allies.S == 0 && av >= bv) continue;
			
			if (detectCollisions(ship.location, end, entities)) continue;
			
			bool closeToPlanet = false;
			for (auto& p : planets) {
				if (end.dist_sq(p.location) < (p.radius + 1) * (p.radius + 1)) {
					closeToPlanet = true;
					break;
				}
			}
			if (closeToPlanet) continue;
			
			if (!avoidEnemies && !m.in_ex_bounds(end, 4)) continue;
			
			bool abait = false;
			int aattackers = 0;
			
			if (avoidEnemies) {
				double minDist = 1e9;
				int closeEnemies = 0;
				if (true || baitTarget == -1) {
					if (enemies.S) {
						for (Entity& e : enemies) {
							if (e.entity_id == baitTarget) continue;
							double d = segment_circle_dist(ship.location, end, e);
							minDist = min(minDist, d);
							closeEnemies += d < DANGER_DIST;
						}
						for (auto& loc : spawnedEnemies) {
							minDist = min(minDist, end.dist(loc));
							closeEnemies += end.dist(loc) < DANGER_DIST;
						}
					}
				} else {
					for (Entity& e : enemies) {
						if (e.entity_id == baitTarget) continue;
						double d = end.dist(e.location) - MAX_SPEED;
						minDist = min(minDist, d);
						closeEnemies += d < DANGER_DIST;
					}
					for (auto& loc : spawnedEnemies) {
						minDist = min(minDist, end.dist(loc));
						closeEnemies += end.dist(loc) < DANGER_DIST;
					}
				}
				aattackers = closeEnemies;
				
				if (minDist < 1e5) {
					av = 10000;
					if (d2 >= radius) {
						av += 10000;
						av += sqrt(d2);
					} else {
						// if (minDist < 6.25) av += 10000;
						av += sqrt(radius) - sqrt(d2);
					}
					if (minDist < DANGER_DIST) {
						double dockDist = 1e9;
						for (auto& e : docked) dockDist = min(dockDist, end.dist_sq(e.location));
						if (dockDist > 4 * 4)
							av += closeEnemies * 20000;
					}
					double maxDist = 9.0 + (4 - ship.health / 64.0) * 1.0;
					av -= min(maxDist, minDist) * 4;
				}
				
				if (true || avoidEdges) {
					double edgeXDist = min(end.pos_x, m.map_width - end.pos_x);
					double edgeYDist = min(end.pos_y, m.map_height - end.pos_y);
					av += max(0.0, 12 - edgeXDist);
					av += max(0.0, 12 - edgeYDist);
				}
				
				if (baitTarget != -1 && segment_circle_dist(ship.location, end, baitEnemy) < 5.5) {
					av -= 1000;
					abait = true;
				}
				
				if (allies.S) {
					av -= sqrt(d2);
					for (Entity& e : allies) {
						av += 17.5 * sqrt(max(1.0, end.dist(e.destination()) + 0.0));
					}
				}
			}
			
			if (radius || avoidEnemies) {
				for (Entity& e : miners)
					if (end.dist_sq(e.location) < 6 * 6) {
						av -= 2;
						// break;
					}
			}
			
			if (avoidEnemies && earlyPhase && players_no == 4) {
				av += (leftSide ? max(0.0, end.pos_x - 50) : max(0.0, m.map_width - end.pos_x - 50)) * 0.025;
			}
			
			if (av < bv) {
				bd2 = d2;
				bbait = abait;
				battackers = aattackers;
				
				bv = av;
				bang = nang;
				bthrust = nthrust;
			}
		}
	}
	
	// if (reversePlayers) {
		// log("Ang: " + i2s(bang) + " Thrust: " + i2s(bthrust));
		// Location end = ship.location + Move::get_velocity_deg(bang, bthrust);
		// log("Vel: " + Move::get_velocity_deg(bang, bthrust).tostring());
		// log("End: " + end.tostring());
		// log("BV: " + i2s(bv) + " BD2: " + i2s(bd2));
		// for (Entity& entity : entities) {
			// log("Rad: " + i2s(entity.radius) + " Pos: " + entity.location.tostring() + " DistS: " + i2s(entity.location.dist(ship.location)) + " DistE: " + i2s(entity.location.dist(end)) + " Close: " + i2s(segment_circle_dist(ship.location, end, entity.location)));
		// }
		// for (auto& e : enemies) {
			// log("Enemy: " + i2s((int)e.entity_id) + " Pos: " + e.location.tostring() + " DistSO: " + i2s(ship.location.dist(e.location)) + " Close: " + i2s(segment_circle_dist(ship.location, end, e)));
		// }
	// }
	
	Move mv = Move::thrust(ship.entity_id, bthrust, bang);
	mv.value = bv;
	mv.bait = bbait;
	mv.attackers = battackers;
	return mv;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movl %r8d, %ebx
movl %ecx, 0xc(%rsp)
movsd %xmm1, 0x50(%rsp)
movsd %xmm0, 0xc0(%rsp)
movq %rdx, 0x178(%rsp)
movq %rsi, %r12
movq %rdi, %r14
movsd 0x8(%rsi), %xmm0
movsd 0x10(%rsi), %xmm1
leaq 0x1a0(%rsp), %rdi
movsd 0x1136e(%rip), %xmm2    # 0x16028
movl $0x1, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3ff2
movq 0x8(%r12), %xmm0
movq 0x10(%r12), %xmm1
leaq 0x120(%rsp), %rdi
movq 0x11341(%rip), %xmm2    # 0x16028
movl $0x4, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3ff2
movq 0x8(%r12), %xmm0
movq 0x10(%r12), %xmm1
movl (%r12), %edx
leaq 0x188(%rsp), %rdi
movq 0x11338(%rip), %xmm2    # 0x16050
movl $0x17, %esi
callq 0x3ff2
cmpb $0x0, 0xc(%rsp)
je 0x4d55
movq 0x8(%r12), %xmm0
movq 0x10(%r12), %xmm1
leaq 0x60(%rsp), %rdi
movq 0x11314(%rip), %xmm2    # 0x16058
movl $0x8, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3ff2
jmp 0x4d68
pxor %xmm0, %xmm0
movdqa %xmm0, 0x60(%rsp)
movq $0x0, 0x70(%rsp)
movq 0x8(%r12), %xmm0
movq 0x10(%r12), %xmm1
leaq 0x100(%rsp), %rdi
movq 0x112da(%rip), %xmm2    # 0x16060
movl $0x10, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3ff2
testb %bl, %bl
je 0x4dc8
movq 0x8(%r12), %xmm0
movq 0x10(%r12), %xmm1
leaq 0xa0(%rsp), %rdi
movq 0x112b1(%rip), %xmm2    # 0x16068
movl $0x6, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3ff2
jmp 0x4de1
pxor %xmm0, %xmm0
movdqa %xmm0, 0xa0(%rsp)
movq $0x0, 0xb0(%rsp)
pxor %xmm0, %xmm0
movdqa %xmm0, 0xd0(%rsp)
xorl %eax, %eax
movq %rax, 0xe0(%rsp)
movq %rax, 0x218(%rsp)
movb %al, 0x220(%rsp)
movb %al, 0x240(%rsp)
movq %rax, 0x224(%rsp)
movb %al, 0x22c(%rsp)
movdqu %xmm0, 0x1f8(%rsp)
movdqu %xmm0, 0x204(%rsp)
cmpb $0x0, 0x298(%rsp)
je 0x5082
movq 0xa0(%rsp), %rdi
movq 0xb0(%rsp), %rsi
movdqa %xmm0, 0xa0(%rsp)
movq $0x0, 0xb0(%rsp)
testq %rdi, %rdi
je 0x4e6f
subq %rdi, %rsi
callq 0x3240
movq 0x120(%rsp), %rdi
movq 0x130(%rsp), %rsi
pxor %xmm0, %xmm0
movdqa %xmm0, 0x120(%rsp)
movq $0x0, 0x130(%rsp)
testq %rdi, %rdi
je 0x4ea5
subq %rdi, %rsi
callq 0x3240
movsd 0x8(%r12), %xmm0
movsd 0x10(%r12), %xmm1
leaq 0x30(%rsp), %rdi
movsd 0x111a0(%rip), %xmm2    # 0x16060
movl $0x4, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3ff2
movq 0x100(%rsp), %rdi
movq 0x110(%rsp), %rsi
movaps 0x30(%rsp), %xmm0
movaps %xmm0, 0x100(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x110(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
testq %rdi, %rdi
je 0x4f17
subq %rdi, %rsi
callq 0x3240
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x4f2e
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movsd 0x8(%r12), %xmm0
movq 0x10(%r12), %xmm1
leaq 0x30(%rsp), %rdi
movq 0x1110f(%rip), %xmm2    # 0x16058
movl $0x2, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3ff2
movq 0x60(%rsp), %rdi
movq 0x70(%rsp), %rsi
movdqa 0x30(%rsp), %xmm0
movdqa %xmm0, 0x60(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x70(%rsp)
pxor %xmm0, %xmm0
movdqa %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
testq %rdi, %rdi
je 0x4f98
subq %rdi, %rsi
callq 0x3240
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x4faf
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movq 0x188(%rsp), %rcx
movq 0x190(%rsp), %rax
cmpq %rax, %rcx
je 0x5082
subq %rcx, %rax
addq $-0x78, %rax
movabsq $-0x7777777777777777, %rdx # imm = 0x8888888888888889
mulq %rdx
movq %rdx, %xmm0
shrq $0x6, %rdx
addq $0x2, %rdx
andq $-0x2, %rdx
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
psrlq $0x6, %xmm0
addq $0x98, %rcx
xorl %eax, %eax
movdqa 0x11248(%rip), %xmm1    # 0x16250
movdqa 0x11250(%rip), %xmm2    # 0x16260
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movq %rax, %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
por %xmm1, %xmm4
pxor %xmm2, %xmm4
movdqa %xmm4, %xmm5
pcmpgtd %xmm0, %xmm5
pcmpeqd %xmm0, %xmm4
pshufd $0xf5, %xmm4, %xmm6     # xmm6 = xmm4[1,1,3,3]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm5, %xmm4     # xmm4 = xmm5[1,1,3,3]
por %xmm6, %xmm4
movd %xmm4, %esi
notl %esi
testb $0x1, %sil
je 0x505c
movq $0x0, -0x78(%rcx)
pxor %xmm3, %xmm4
pextrw $0x4, %xmm4, %esi
testb $0x1, %sil
je 0x5072
movq $0x0, (%rcx)
addq $0x2, %rax
addq $0xf0, %rcx
cmpq %rax, %rdx
jne 0x5018
movq %r14, 0x1b8(%rsp)
movl 0x290(%rsp), %eax
movl %eax, 0x2c(%rsp)
cmpb $0x0, 0xc(%rsp)
je 0x527b
movq 0x60(%rsp), %r14
movq 0x68(%rsp), %r15
cmpq %r15, %r14
je 0x5159
movabsq $0x401c000000000000, %rbx # imm = 0x401C000000000000
movabsq $0x2d82d82d82d82d83, %r13 # imm = 0x2D82D82D82D82D83
movl $0x168, %ebp            # imm = 0x168
movq %rbx, 0x20(%r14)
movsd 0x8(%r12), %xmm1
movsd 0x10(%r12), %xmm0
subsd 0x8(%r14), %xmm1
subsd 0x10(%r14), %xmm0
callq 0x3050
addsd 0x10f79(%rip), %xmm0    # 0x16070
mulsd 0x10f41(%rip), %xmm0    # 0x16040
divsd 0x10f41(%rip), %xmm0    # 0x16048
callq 0x3040
movq %rax, %rcx
imulq %r13
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x6, %rdx
addq %rax, %rdx
imulq $0x168, %rdx, %rax      # imm = 0x168
subq %rax, %rcx
addq %rbp, %rcx
movq %rcx, %rax
mulq %r13
shrq $0x6, %rdx
imull $0x168, %edx, %eax      # imm = 0x168
subl %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x28(%r14)
addq $0x78, %r14
cmpq %r15, %r14
jne 0x50cc
cmpb $0x0, 0x298(%rsp)
jne 0x5214
movq 0x18fe2(%rip), %rbx     # 0x1e150
movq 0x18fe3(%rip), %r15     # 0x1e158
cmpq %r15, %rbx
je 0x5214
leaq 0xd0(%rsp), %r14
movl 0x10(%rbx), %eax
cmpl 0x18b4d(%rip), %eax     # 0x1dcdc
je 0x5207
movsd 0x8(%r12), %xmm0
subsd (%rbx), %xmm0
movsd 0x10(%r12), %xmm1
subsd 0x8(%rbx), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0x10e54(%rip), %xmm0    # 0x16010
jb 0x51c4
sqrtsd %xmm0, %xmm0
jmp 0x51c9
callq 0x31e0
movsd 0x10e87(%rip), %xmm1    # 0x16058
ucomisd %xmm0, %xmm1
jbe 0x5207
movq 0xd8(%rsp), %rsi
cmpq 0xe0(%rsp), %rsi
je 0x51fc
movdqu (%rbx), %xmm0
movdqu %xmm0, (%rsi)
addq $0x10, 0xd8(%rsp)
jmp 0x5207
movq %r14, %rdi
movq %rbx, %rdx
callq 0x120e0
addq $0x18, %rbx
cmpq %r15, %rbx
jne 0x5186
cmpl $-0x1, 0x290(%rsp)
je 0x5273
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %r8
cmpq %r8, %rax
je 0x5257
leaq 0x1e0(%rsp), %rdx
movl 0x290(%rsp), %ecx
cmpl %ecx, (%rax)
jne 0x524e
movl $0xf, %ecx
movq %rdx, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
addq $0x78, %rax
cmpq %r8, %rax
jne 0x5235
movl 0x290(%rsp), %ecx
cmpl %ecx, 0x1e0(%rsp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovnel %eax, %ecx
movl %ecx, 0x2c(%rsp)
jmp 0x527b
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
movsd 0x50(%rsp), %xmm0
mulsd %xmm0, %xmm0
movsd %xmm0, 0x50(%rsp)
leaq 0x8(%r12), %rax
movq %rax, 0xc8(%rsp)
movq 0x178(%rsp), %rax
movsd (%rax), %xmm1
movsd 0x8(%rax), %xmm0
subsd 0x8(%r12), %xmm1
movq %r12, 0x150(%rsp)
subsd 0x10(%r12), %xmm0
callq 0x3050
addsd 0x10da4(%rip), %xmm0    # 0x16070
mulsd 0x10d6c(%rip), %xmm0    # 0x16040
divsd 0x10d6c(%rip), %xmm0    # 0x16048
callq 0x3040
movq %rax, %rsi
movabsq $0x2d82d82d82d82d83, %rcx # imm = 0x2D82D82D82D82D83
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x6, %rdx
addq %rax, %rdx
imulq $0x168, %rdx, %rax      # imm = 0x168
subq %rax, %rsi
addq $0x168, %rsi            # imm = 0x168
movq %rsi, %rax
mulq %rcx
shrq $0x6, %rdx
imull $0x168, %edx, %eax      # imm = 0x168
subl %eax, %esi
movq %rsi, 0x1c8(%rsp)
movsd 0xc0(%rsp), %xmm0
addsd 0x10d3d(%rip), %xmm0    # 0x16078
movsd %xmm0, 0xc0(%rsp)
xorpd %xmm0, %xmm0
movsd 0x50(%rsp), %xmm1
ucomisd %xmm0, %xmm1
setp %al
setne %cl
orb %al, %cl
orb 0xc(%rsp), %cl
movb %cl, 0xb(%rsp)
movq $0x0, 0x170(%rsp)
movsd 0x10d0a(%rip), %xmm0    # 0x16080
movsd %xmm0, 0x168(%rsp)
movsd 0x10d01(%rip), %xmm0    # 0x16088
movl $0x1, %r13d
sqrtsd %xmm1, %xmm1
movsd %xmm1, 0x1c0(%rsp)
movq $0x0, 0x160(%rsp)
xorl %ebx, %ebx
movsd %xmm0, 0xb8(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x158(%rsp)
movsd 0xc0(%rsp), %xmm0
ucomisd 0x10c41(%rip), %xmm0    # 0x16010
jbe 0x5cc7
movq 0x1c8(%rsp), %rax
leal (%rbx,%rax), %ecx
movl %ecx, %eax
shrl $0x3, %eax
imulq $0x16c16c17, %rax, %rax # imm = 0x16C16C17
shrq $0x22, %rax
imull $0x168, %eax, %eax      # imm = 0x168
subl %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x1d0(%rsp)
xorpd %xmm1, %xmm1
shlq $0x7, %rcx
leaq 0x18d59(%rip), %rax     # 0x1e170
addq %rax, %rcx
movq %rcx, 0x1d8(%rsp)
xorl %r15d, %r15d
testl %ebx, %ebx
setne %al
testq %r15, %r15
sete %cl
testb %cl, %al
jne 0x5ca9
movsd %xmm1, 0x180(%rsp)
movq %r15, %rax
shlq $0x4, %rax
movsd 0x50(%rsp), %xmm2
ucomisd 0x10bba(%rip), %xmm2    # 0x16010
movq 0xc8(%rsp), %rcx
movupd (%rcx), %xmm1
movq 0x1d8(%rsp), %rcx
addpd (%rax,%rcx), %xmm1
movapd %xmm1, 0x30(%rsp)
movq 0x178(%rsp), %rax
movsd (%rax), %xmm4
movsd 0x8(%rax), %xmm0
subsd %xmm1, %xmm4
movapd %xmm1, 0x80(%rsp)
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
movapd %xmm1, 0x140(%rsp)
subsd %xmm1, %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm4, %xmm4
addsd %xmm0, %xmm4
movapd %xmm4, 0x10(%rsp)
jne 0x54ba
jnp 0x54e9
movapd %xmm2, %xmm0
subsd %xmm4, %xmm0
movapd %xmm4, %xmm1
addsd 0x10bc2(%rip), %xmm1    # 0x16090
movapd %xmm4, %xmm3
cmpltsd %xmm2, %xmm3
andpd %xmm3, %xmm0
andnpd %xmm1, %xmm3
orpd %xmm0, %xmm3
movapd %xmm3, 0x10(%rsp)
movsd %xmm4, 0xe8(%rsp)
movq 0x68(%rsp), %rax
cmpq 0x60(%rsp), %rax
je 0x5703
movq 0xc8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x188(%rsp), %rdx
movsd 0x10b79(%rip), %xmm0    # 0x16098
movl $0x1, %ecx
callq 0x4443
testl %eax, %eax
jne 0x5ca9
movq 0x1a0(%rsp), %rcx
movq 0x1a8(%rsp), %rax
cmpq %rax, %rcx
je 0x55a7
addq $0x78, %rcx
xorl %edx, %edx
movapd 0x80(%rsp), %xmm0
subsd -0x70(%rcx), %xmm0
movapd 0x140(%rsp), %xmm1
subsd -0x68(%rcx), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd -0x8(%rcx), %xmm1
addsd 0x10a97(%rip), %xmm1    # 0x16018
mulsd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
movzbl %dl, %edx
cmoval %r13d, %edx
ja 0x559e
leaq 0x78(%rcx), %rsi
cmpq %rax, %rcx
movq %rsi, %rcx
jne 0x554c
testb $0x1, %dl
jne 0x5ca9
cmpb $0x0, 0xc(%rsp)
je 0x5733
movq 0x60(%rsp), %r14
movq 0x68(%rsp), %r12
xorl %ebp, %ebp
cmpq %r14, %r12
je 0x57bd
movsd 0x10ab9(%rip), %xmm0    # 0x16088
movsd %xmm0, 0x98(%rsp)
movl 0x2c(%rsp), %eax
cmpl %eax, (%r14)
je 0x561b
movq 0xc8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq %r14, %rdx
callq 0x5f21
xorl %eax, %eax
movsd 0x10ab0(%rip), %xmm1    # 0x160b0
ucomisd %xmm0, %xmm1
minsd 0x98(%rsp), %xmm0
seta %al
addl %eax, %ebp
movsd %xmm0, 0x98(%rsp)
addq $0x78, %r14
cmpq %r12, %r14
jne 0x55d8
movq 0xd0(%rsp), %r14
movq 0xd8(%rsp), %r12
movsd 0x98(%rsp), %xmm5
cmpq %r12, %r14
je 0x57c5
movapd 0x80(%rsp), %xmm0
subsd (%r14), %xmm0
movapd 0x140(%rsp), %xmm1
subsd 0x8(%r14), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0x10999(%rip), %xmm0    # 0x16010
jb 0x5682
xorps %xmm5, %xmm5
sqrtsd %xmm0, %xmm5
jmp 0x568b
callq 0x31e0
movapd %xmm0, %xmm5
movapd 0x80(%rsp), %xmm0
subsd (%r14), %xmm0
movapd 0x140(%rsp), %xmm1
subsd 0x8(%r14), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0x10954(%rip), %xmm0    # 0x16010
jb 0x56c4
sqrtsd %xmm0, %xmm0
jmp 0x56d5
movsd %xmm5, 0x58(%rsp)
callq 0x31e0
movsd 0x58(%rsp), %xmm5
minsd 0x98(%rsp), %xmm5
xorl %eax, %eax
movsd 0x109c8(%rip), %xmm1    # 0x160b0
ucomisd %xmm0, %xmm1
seta %al
addl %eax, %ebp
addq $0x10, %r14
movsd %xmm5, 0x98(%rsp)
jmp 0x563d
movq 0xa8(%rsp), %rax
cmpq 0xa0(%rsp), %rax
jne 0x5502
movapd 0x10(%rsp), %xmm0
ucomisd 0xb8(%rsp), %xmm0
jae 0x5ca9
jmp 0x5502
movapd 0x80(%rsp), %xmm1
ucomisd 0x1095c(%rip), %xmm1    # 0x160a0
jbe 0x5ca9
xorps %xmm0, %xmm0
cvtsi2sdl 0x18593(%rip), %xmm0 # 0x1dce8
addsd 0x1094b(%rip), %xmm0    # 0x160a8
ucomisd %xmm1, %xmm0
jbe 0x5ca9
movapd 0x140(%rsp), %xmm0
ucomisd 0x10928(%rip), %xmm0    # 0x160a0
jbe 0x5ca9
xorps %xmm0, %xmm0
cvtsi2sdl 0x18563(%rip), %xmm0 # 0x1dcec
addsd 0x10917(%rip), %xmm0    # 0x160a8
ucomisd 0x140(%rsp), %xmm0
jbe 0x5ca9
cmpb $0x0, 0xc(%rsp)
jne 0x55b2
movl $0x0, 0x80(%rsp)
xorl %ebp, %ebp
jmp 0x5b27
movsd 0x108c3(%rip), %xmm5    # 0x16088
movsd 0x108eb(%rip), %xmm0    # 0x160b8
ucomisd %xmm5, %xmm0
jbe 0x5971
movsd 0x50(%rsp), %xmm1
movsd 0xe8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jae 0x5839
ucomisd 0x1081c(%rip), %xmm1    # 0x16010
movsd 0x1c0(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movsd %xmm5, 0x58(%rsp)
jae 0x5820
movsd 0x50(%rsp), %xmm0
callq 0x31e0
movsd 0x58(%rsp), %xmm5
movaps %xmm0, 0x10(%rsp)
movsd 0xe8(%rsp), %xmm0
ucomisd 0x107df(%rip), %xmm0    # 0x16010
jb 0x5849
sqrtsd %xmm0, %xmm0
jmp 0x5854
ucomisd 0x107cf(%rip), %xmm0    # 0x16010
jb 0x586e
sqrtsd %xmm0, %xmm0
jmp 0x587f
callq 0x31e0
movsd 0x58(%rsp), %xmm5
movapd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0x1082a(%rip), %xmm1    # 0x16090
movapd %xmm1, 0x10(%rsp)
jmp 0x588d
movsd %xmm5, 0x58(%rsp)
callq 0x31e0
movsd 0x58(%rsp), %xmm5
addsd 0x10839(%rip), %xmm0    # 0x160c0
movapd %xmm0, 0x10(%rsp)
movsd 0x1081b(%rip), %xmm0    # 0x160b0
ucomisd %xmm5, %xmm0
jbe 0x592d
movq 0x120(%rsp), %rax
movq 0x128(%rsp), %rcx
cmpq %rcx, %rax
je 0x590a
movsd 0x107cc(%rip), %xmm0    # 0x16088
movapd 0x80(%rsp), %xmm3
movapd 0x140(%rsp), %xmm4
movapd %xmm0, %xmm1
movapd %xmm3, %xmm0
subsd 0x8(%rax), %xmm0
movapd %xmm4, %xmm2
subsd 0x10(%rax), %xmm2
mulsd %xmm2, %xmm2
mulsd %xmm0, %xmm0
addsd %xmm2, %xmm0
minsd %xmm1, %xmm0
addq $0x78, %rax
cmpq %rcx, %rax
jne 0x58ce
ucomisd 0x1074b(%rip), %xmm0    # 0x16050
seta %al
jmp 0x590c
movb $0x1, %al
testb %al, %al
je 0x592d
imull $0x4e20, %ebp, %eax     # imm = 0x4E20
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movapd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, 0x10(%rsp)
movq 0x150(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sdl 0x68(%rax), %xmm0
mulsd 0x10783(%rip), %xmm0    # 0x160c8
movsd 0x10753(%rip), %xmm1    # 0x160a0
addsd %xmm1, %xmm0
addsd 0x10777(%rip), %xmm0    # 0x160d0
minsd %xmm0, %xmm5
mulsd %xmm1, %xmm5
movapd 0x10(%rsp), %xmm0
subsd %xmm5, %xmm0
movapd %xmm0, 0x10(%rsp)
cvtdq2pd 0x1836f(%rip), %xmm1    # 0x1dce8
movapd 0x80(%rsp), %xmm0
subpd %xmm0, %xmm1
minpd %xmm0, %xmm1
movapd 0x108de(%rip), %xmm0    # 0x16270
subpd %xmm1, %xmm0
xorpd %xmm1, %xmm1
cmpltpd %xmm0, %xmm1
movmskpd %xmm1, %eax
xorpd %xmm2, %xmm2
movapd %xmm0, %xmm1
testb $0x1, %al
jne 0x59b3
xorpd %xmm1, %xmm1
testb $0x2, %al
je 0x59bf
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
movapd %xmm0, %xmm2
movapd 0x10(%rsp), %xmm0
addsd %xmm1, %xmm0
addsd %xmm2, %xmm0
movapd %xmm0, 0x10(%rsp)
cmpl $-0x1, 0x2c(%rsp)
je 0x5a21
movq 0xc8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x1e0(%rsp), %rdx
callq 0x5f21
movsd 0x106dc(%rip), %xmm1    # 0x160d8
ucomisd %xmm0, %xmm1
jbe 0x5a21
movapd 0x10(%rsp), %xmm0
addsd 0x106d0(%rip), %xmm0    # 0x160e0
movapd %xmm0, 0x10(%rsp)
movb $0x1, %al
movl %eax, 0x80(%rsp)
jmp 0x5a2c
movl $0x0, 0x80(%rsp)
movq 0xa8(%rsp), %rax
cmpq 0xa0(%rsp), %rax
je 0x5b27
movsd 0xe8(%rsp), %xmm0
ucomisd 0x105bd(%rip), %xmm0    # 0x16010
jb 0x5a5b
sqrtsd %xmm0, %xmm0
jmp 0x5a60
callq 0x31e0
movapd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, 0x10(%rsp)
movq 0xa0(%rsp), %r14
movq 0xa8(%rsp), %r12
cmpq %r12, %r14
je 0x5b27
addq $0x18, %r14
movq %r14, %rdi
callq 0xe2ac
movapd %xmm0, %xmm2
addsd -0x10(%r14), %xmm2
addsd -0x8(%r14), %xmm1
movsd 0x30(%rsp), %xmm0
subsd %xmm2, %xmm0
movsd 0x38(%rsp), %xmm2
subsd %xmm1, %xmm2
mulsd %xmm2, %xmm2
mulsd %xmm0, %xmm0
addsd %xmm2, %xmm0
ucomisd 0x10543(%rip), %xmm0    # 0x16010
jb 0x5ad5
sqrtsd %xmm0, %xmm0
jmp 0x5ada
callq 0x31e0
xorpd %xmm1, %xmm1
addsd %xmm1, %xmm0
maxsd 0x1052e(%rip), %xmm0    # 0x16018
ucomisd %xmm1, %xmm0
jb 0x5af6
sqrtsd %xmm0, %xmm0
jmp 0x5afb
callq 0x31e0
mulsd 0x105e5(%rip), %xmm0    # 0x160e8
movapd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, 0x10(%rsp)
leaq 0x78(%r14), %rax
addq $0x60, %r14
cmpq %r12, %r14
movq %rax, %r14
jne 0x5a8d
cmpb $0x0, 0xb(%rsp)
je 0x5bab
movq 0x100(%rsp), %rax
movq 0x108(%rsp), %rcx
cmpq %rcx, %rax
je 0x5bab
movsd 0x30(%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
movsd 0x104d9(%rip), %xmm4    # 0x16030
movsd 0x10591(%rip), %xmm5    # 0x160f0
movapd 0x10(%rsp), %xmm6
movapd %xmm1, %xmm0
subsd 0x8(%rax), %xmm0
movapd %xmm2, %xmm3
subsd 0x10(%rax), %xmm3
mulsd %xmm3, %xmm3
mulsd %xmm0, %xmm0
addsd %xmm3, %xmm0
movapd %xmm6, %xmm3
addsd %xmm4, %xmm3
cmpltsd %xmm5, %xmm0
andpd %xmm0, %xmm3
andnpd %xmm6, %xmm0
orpd %xmm3, %xmm0
addq $0x78, %rax
movapd %xmm0, %xmm6
cmpq %rcx, %rax
jne 0x5b65
jmp 0x5bb1
movapd 0x10(%rsp), %xmm0
cmpb $0x0, 0xc(%rsp)
je 0x5bf8
cmpb $0x1, 0x1766d(%rip)     # 0x1d22c
movq 0x180(%rsp), %xmm2
jne 0x5c5d
cmpl $0x4, 0x17653(%rip)     # 0x1d228
jne 0x5c5d
cmpb $0x1, 0x18102(%rip)     # 0x1dce4
jne 0x5c03
movq $0x0, 0xf8(%rsp)
movsd 0x30(%rsp), %xmm1
jmp 0x5c20
movq 0x180(%rsp), %xmm2
jmp 0x5c5d
movq $0x0, 0xf8(%rsp)
xorps %xmm1, %xmm1
cvtsi2sdl 0x180ce(%rip), %xmm1 # 0x1dce8
subsd 0x30(%rsp), %xmm1
addsd 0x104d0(%rip), %xmm1    # 0x160f8
movsd %xmm1, 0xf0(%rsp)
ucomisd 0x103d7(%rip), %xmm1    # 0x16010
leaq 0xf8(%rsp), %rax
leaq 0xf0(%rsp), %rcx
cmovaq %rcx, %rax
movsd (%rax), %xmm1
mulsd 0x104a7(%rip), %xmm1    # 0x16100
addsd %xmm1, %xmm0
movsd 0xb8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x5ca9
movl 0x80(%rsp), %eax
movq %rax, 0x160(%rsp)
movl %ebp, %eax
movq %rax, 0x170(%rsp)
movq %xmm2, 0x168(%rsp)
movsd 0x1d0(%rsp), %xmm1
movsd %xmm1, 0x158(%rsp)
movsd %xmm0, 0xb8(%rsp)
incq %r15
xorps %xmm1, %xmm1
cvtsi2sd %r15d, %xmm1
movsd 0xc0(%rsp), %xmm0
ucomisd %xmm1, %xmm0
ja 0x5425
incl %ebx
cmpl $0x168, %ebx            # imm = 0x168
jne 0x53be
movq 0x150(%rsp), %rax
movl (%rax), %eax
xorl %ecx, %ecx
movq 0x1b8(%rsp), %rbx
movb %cl, 0x48(%rbx)
movb %cl, 0x34(%rbx)
movq $0x0, 0x2c(%rbx)
movl $0x1, (%rbx)
movl %eax, 0x4(%rbx)
movsd 0x168(%rsp), %xmm0
movsd %xmm0, 0x8(%rbx)
movsd 0x158(%rsp), %xmm0
movsd %xmm0, 0x10(%rbx)
movl $0x0, 0x18(%rbx)
movsd 0xb8(%rsp), %xmm0
movsd %xmm0, 0x20(%rbx)
movq 0x160(%rsp), %rax
andb $0x1, %al
movb %al, 0x28(%rbx)
movq 0x170(%rsp), %rax
movl %eax, 0x2c(%rbx)
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x5d66
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x5d83
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x5da0
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x5db7
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movq 0x188(%rsp), %rdi
testq %rdi, %rdi
je 0x5dd4
movq 0x198(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x5df1
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movq 0x1a0(%rsp), %rdi
testq %rdi, %rdi
je 0x5e0e
movq 0x1b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movq %rbx, %rax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5e51
jmp 0x5e51
jmp 0x5e51
movq %rax, %rbx
jmp 0x5e8e
movq %rax, %rbx
jmp 0x5ec2
movq %rax, %rbx
jmp 0x5eab
movq %rax, %rbx
jmp 0x5edf
movq %rax, %rbx
jmp 0x5efc
jmp 0x5e51
jmp 0x5e51
jmp 0x5e51
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x5e71
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x5e8e
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x5eab
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x5ec2
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movq 0x188(%rsp), %rdi
testq %rdi, %rdi
je 0x5edf
movq 0x198(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x5efc
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movq 0x1a0(%rsp), %rdi
testq %rdi, %rdi
je 0x5f19
movq 0x1b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movq %rbx, %rdi
callq 0x33d0