// File: /workspace/github_cpp_makefile_star2_O2/Luthaf[P]zeopp/geometry.cc
// Function: findLineSegIntersections(Point, Point, Point, double)
pair<int, vector<Point> > findLineSegIntersections(Point p1, Point p2, Point circCenter, double rad){
  pair<int, vector<Point> > prelimResults = findLineIntersections(p1, p2, circCenter, rad);
 
  if(prelimResults.first == 0)
    return prelimResults;
  else{
    double tolerance = 0.00001;
    int numResults = 0;
    vector<Point> pts = vector<Point> ();
    double lineSegLength = calcEuclideanDistance(p1, p2);
    for(int i = 0; i < prelimResults.first; i++){
      Point possSol = prelimResults.second.at(i);
      double p1Dist = calcEuclideanDistance(possSol, p1);
      double p2Dist = calcEuclideanDistance(possSol, p2);
      if((p1Dist <= lineSegLength + tolerance) && (p2Dist <= lineSegLength + tolerance)){
	pts.push_back(possSol);
	numResults++;
      }
    }
    return pair<int, vector<Point> > (numResults, pts);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %rbx
movq 0x170(%rsp), %rax
movq %rax, 0x40(%rsp)
movaps 0x160(%rsp), %xmm1
movups %xmm1, 0x30(%rsp)
movq 0x158(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x148(%rsp), %xmm1
movups %xmm1, 0x18(%rsp)
movq 0x140(%rsp), %rax
movq %rax, 0x10(%rsp)
movapd 0x130(%rsp), %xmm1
movupd %xmm1, (%rsp)
leaq 0x70(%rsp), %r14
movq %r14, %rdi
callq 0x64996
movl (%r14), %eax
testl %eax, %eax
je 0x64ee7
leaq 0x148(%rsp), %rcx
leaq 0x130(%rsp), %rdx
xorps %xmm0, %xmm0
leaq 0x90(%rsp), %r15
movaps %xmm0, (%r15)
andq $0x0, 0x10(%r15)
movsd (%rdx), %xmm6
movsd 0x8(%rdx), %xmm7
movsd 0x10(%rdx), %xmm8
movsd (%rcx), %xmm0
movsd 0x8(%rcx), %xmm1
movsd 0x10(%rcx), %xmm2
movapd %xmm6, %xmm3
subsd %xmm0, %xmm3
movapd %xmm7, %xmm4
subsd %xmm1, %xmm4
movapd %xmm8, %xmm5
subsd %xmm2, %xmm5
mulsd %xmm4, %xmm4
mulsd %xmm3, %xmm3
addsd %xmm4, %xmm3
mulsd %xmm5, %xmm5
addsd %xmm3, %xmm5
sqrtsd %xmm5, %xmm3
addsd 0x9b7bb(%rip), %xmm3    # 0x100598
leaq 0x78(%rsp), %r14
unpcklpd %xmm2, %xmm8            # xmm8 = xmm8[0],xmm2[0]
movapd %xmm8, 0xc0(%rsp)
unpcklpd %xmm0, %xmm6            # xmm6 = xmm6[0],xmm0[0]
movapd %xmm6, 0xe0(%rsp)
unpcklpd %xmm1, %xmm7            # xmm7 = xmm7[0],xmm1[0]
movapd %xmm7, 0xd0(%rsp)
unpcklpd %xmm3, %xmm3            # xmm3 = xmm3[0,0]
movapd %xmm3, 0xb0(%rsp)
xorl %r12d, %r12d
leaq 0x50(%rsp), %r13
xorl %ebp, %ebp
cltq
cmpq %rax, %r12
jge 0x64ec5
movq %r14, %rdi
movq %r12, %rsi
callq 0x246b4
movups (%rax), %xmm0
movaps %xmm0, 0x50(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x60(%rsp)
movapd 0x50(%rsp), %xmm0
movupd 0x58(%rsp), %xmm1
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
subpd 0xe0(%rsp), %xmm0
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
subpd 0xd0(%rsp), %xmm1
movsd 0x60(%rsp), %xmm2
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
subpd 0xc0(%rsp), %xmm2
mulpd %xmm1, %xmm1
mulpd %xmm0, %xmm0
addpd %xmm1, %xmm0
mulpd %xmm2, %xmm2
addpd %xmm0, %xmm2
sqrtpd %xmm2, %xmm0
cmpnlepd 0xb0(%rsp), %xmm0
movmskpd %xmm0, %eax
testl %eax, %eax
jne 0x64eb9
movq %r15, %rdi
movq %r13, %rsi
callq 0x2468e
incl %ebp
incq %r12
movl 0x70(%rsp), %eax
jmp 0x64e22
movl %ebp, (%rbx)
leaq 0x8(%rbx), %rdi
leaq 0x90(%rsp), %rsi
callq 0xa66e
leaq 0x90(%rsp), %rdi
callq 0xb83e
jmp 0x64f14
andl $0x0, (%rbx)
movupd 0x78(%rsp), %xmm0
movupd %xmm0, 0x8(%rbx)
movq 0x88(%rsp), %rax
movq %rax, 0x18(%rbx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x78(%rsp)
andq $0x0, 0x88(%rsp)
leaq 0x78(%rsp), %rdi
callq 0xb83e
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x64f37
jmp 0x64f37
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0xb83e
movq %r14, %rdi
callq 0xb83e
movq %rbx, %rdi
callq 0x4780