// File: /workspace/github_cpp_makefile_star2_O1/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 $0xe8, %rsp
movq %rdi, %rbx
movq 0x160(%rsp), %rax
movq %rax, 0x40(%rsp)
movaps 0x150(%rsp), %xmm1
movups %xmm1, 0x30(%rsp)
movq 0x148(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x138(%rsp), %xmm1
movups %xmm1, 0x18(%rsp)
movq 0x130(%rsp), %rax
movq %rax, 0x10(%rsp)
movapd 0x120(%rsp), %xmm1
movupd %xmm1, (%rsp)
leaq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0x86980
movl (%r14), %eax
testl %eax, %eax
je 0x86ed2
leaq 0x138(%rsp), %rax
leaq 0x120(%rsp), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
movsd (%rcx), %xmm1
movsd 0x8(%rcx), %xmm2
movsd 0x10(%rcx), %xmm0
movsd (%rax), %xmm3
movsd 0x8(%rax), %xmm4
movsd 0x10(%rax), %xmm5
movsd %xmm1, 0xe0(%rsp)
movsd %xmm3, 0xc8(%rsp)
subsd %xmm3, %xmm1
movsd %xmm2, 0xd8(%rsp)
movsd %xmm4, 0xc0(%rsp)
subsd %xmm4, %xmm2
movsd %xmm0, 0xd0(%rsp)
movsd %xmm5, 0xb8(%rsp)
subsd %xmm5, %xmm0
mulsd %xmm2, %xmm2
mulsd %xmm1, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x86f16
sqrtsd %xmm0, %xmm0
jmp 0x86f1b
movl %eax, (%rbx)
movq 0x98(%rsp), %rax
movq %rax, 0x8(%rbx)
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rbx)
movq 0xa8(%rsp), %rax
movq %rax, 0x18(%rbx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x98(%rsp)
movq $0x0, 0xa8(%rsp)
jmp 0x870ec
callq 0x4350
movsd %xmm0, 0x48(%rsp)
cmpl $0x0, 0x90(%rsp)
jle 0x870be
movsd 0x48(%rsp), %xmm0
addsd 0xcc63b(%rip), %xmm0    # 0x153578
movsd %xmm0, 0x48(%rsp)
xorl %r13d, %r13d
movabsq $-0x5555555555555555, %rbp # imm = 0xAAAAAAAAAAAAAAAB
leaq 0x50(%rsp), %r12
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x98(%rsp), %rax
movq 0xa0(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %rbp, %rdx
cmpq %r14, %rdx
jbe 0x8711e
movups (%rax,%r13), %xmm0
movaps %xmm0, 0x50(%rsp)
movq 0x10(%rax,%r13), %rax
movq %rax, 0x60(%rsp)
movsd 0x50(%rsp), %xmm1
movsd 0x58(%rsp), %xmm2
movsd 0x60(%rsp), %xmm0
subsd 0xe0(%rsp), %xmm1
subsd 0xd8(%rsp), %xmm2
subsd 0xd0(%rsp), %xmm0
mulsd %xmm2, %xmm2
mulsd %xmm1, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0xcc2e4(%rip), %xmm0    # 0x1532c0
jb 0x86fe7
xorps %xmm3, %xmm3
sqrtsd %xmm0, %xmm3
jmp 0x86ff0
callq 0x4350
movapd %xmm0, %xmm3
movsd 0x50(%rsp), %xmm1
movsd 0x58(%rsp), %xmm2
movsd 0x60(%rsp), %xmm0
subsd 0xc8(%rsp), %xmm1
subsd 0xc0(%rsp), %xmm2
subsd 0xb8(%rsp), %xmm0
mulsd %xmm2, %xmm2
mulsd %xmm1, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0xcc287(%rip), %xmm0    # 0x1532c0
jb 0x87041
sqrtsd %xmm0, %xmm0
jmp 0x87058
movsd %xmm3, 0xb0(%rsp)
callq 0x4350
movsd 0xb0(%rsp), %xmm3
movsd 0x48(%rsp), %xmm1
ucomisd %xmm3, %xmm1
jb 0x870a4
ucomisd %xmm0, %xmm1
jb 0x870a4
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0x87094
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsi)
movapd 0x50(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x18, 0x78(%rsp)
jmp 0x870a1
leaq 0x70(%rsp), %rdi
movq %r12, %rdx
callq 0x3012c
incl %r15d
incq %r14
movslq 0x90(%rsp), %rax
addq $0x18, %r13
cmpq %rax, %r14
jl 0x86f5b
jmp 0x870c1
xorl %r15d, %r15d
movl %r15d, (%rbx)
leaq 0x8(%rbx), %rdi
leaq 0x70(%rsp), %rsi
callq 0xe7f6
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x870ec
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x87109
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc8580(%rip), %rdi     # 0x14f6a5
movq %r14, %rsi
xorl %eax, %eax
callq 0x4630
jmp 0x87133
jmp 0x87133
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x87150
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x8716d
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4780