// File: FakePsyho[P]halite2/./hlt/collision.hpp
// Function: hlt::collision::segment_circle_intersect(hlt::Location const&, hlt::Location const&, hlt::Location const&, double)
static bool segment_circle_intersect(const Location& start, const Location& end, const Location& center, const double radius) {
            const double start_x = start.pos_x;
            const double start_y = start.pos_y;
            const double end_x = end.pos_x;
            const double end_y = end.pos_y;
            const double center_x = center.pos_x;
            const double center_y = center.pos_y;
            const double dx = end_x - start_x;
            const double dy = end_y - start_y;

            const double a = square(dx) + square(dy);

            if (a == 0.0) return start.dist_sq(center) <= square(radius);
			
            const double b =
                    -2 * (square(start_x) - (start_x * end_x)
                    - (start_x * center_x) + (end_x * center_x)
                    + square(start_y) - (start_y * end_y)
                    - (start_y * center_y) + (end_y * center_y));


            const double t = std::max(0.0, std::min(-b / (2 * a), 1.0));

            const double closest_x = start_x + dx * t;
            const double closest_y = start_y + dy * t;
            return Location(closest_x, closest_y).dist_sq(center) <= square(radius);
        }

// Assembly:
subq $0xd8, %rsp
movq %rdi, 0xc8(%rsp)
movq %rsi, 0xc0(%rsp)
movq %rdx, 0xb8(%rsp)
movsd %xmm0, 0xb0(%rsp)
movq 0xc8(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0xa8(%rsp)
movq 0xc8(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0xa0(%rsp)
movq 0xc0(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x98(%rsp)
movq 0xc0(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x90(%rsp)
movq 0xb8(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x88(%rsp)
movq 0xb8(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x98(%rsp), %xmm0
subsd 0xa8(%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
movsd 0x90(%rsp), %xmm0
subsd 0xa0(%rsp), %xmm0
movsd %xmm0, 0x70(%rsp)
movsd 0x78(%rsp), %xmm0
callq 0x12130
movsd %xmm0, 0x18(%rsp)
movsd 0x70(%rsp), %xmm0
callq 0x12130
movaps %xmm0, %xmm1
movsd 0x18(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
movsd 0x68(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x11ecd
jp 0x11ecd
movq 0xc8(%rsp), %rdi
movq 0xb8(%rsp), %rsi
callq 0x133d0
movsd %xmm0, 0x10(%rsp)
movsd 0xb0(%rsp), %xmm0
callq 0x12130
movsd 0x10(%rsp), %xmm1
ucomisd %xmm1, %xmm0
setae %al
andb $0x1, %al
movb %al, 0xd7(%rsp)
jmp 0x12111
movsd 0xa8(%rsp), %xmm0
callq 0x12130
movaps %xmm0, %xmm1
movsd 0xa8(%rsp), %xmm0
movsd 0x98(%rsp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0xa8(%rsp), %xmm1
movsd 0x88(%rsp), %xmm2
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x98(%rsp), %xmm0
movsd 0x88(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rsp)
movsd 0xa0(%rsp), %xmm0
callq 0x12130
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
addsd %xmm1, %xmm0
movsd 0xa0(%rsp), %xmm1
movsd 0x90(%rsp), %xmm2
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0xa0(%rsp), %xmm0
movsd 0x80(%rsp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x90(%rsp), %xmm1
movsd 0x80(%rsp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x291eb(%rip), %xmm0    # 0x3b1e8
mulsd %xmm1, %xmm0
movsd %xmm0, 0x60(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x60(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x28fe3(%rip), %xmm1    # 0x3b018
mulsd 0x68(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x29023(%rip), %xmm0    # 0x3b070
movsd %xmm0, 0x40(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x13750
movq %rax, %rsi
leaq 0x50(%rsp), %rdi
callq 0x13860
movsd (%rax), %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0xa8(%rsp), %xmm1
movsd 0x78(%rsp), %xmm0
movsd 0x58(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0xa0(%rsp), %xmm1
movsd 0x70(%rsp), %xmm0
movsd 0x58(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x38(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
leaq 0x20(%rsp), %rdi
callq 0x13380
movq 0xb8(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x133d0
movsd %xmm0, 0x8(%rsp)
movsd 0xb0(%rsp), %xmm0
callq 0x12130
movsd 0x8(%rsp), %xmm1
ucomisd %xmm1, %xmm0
setae %al
andb $0x1, %al
movb %al, 0xd7(%rsp)
movb 0xd7(%rsp), %al
andb $0x1, %al
addq $0xd8, %rsp
retq
nopw %cs:(%rax,%rax)