// File: /workspace/github_cpp_makefile_star2_O1/ddunbar[P]PDSample/ScallopedSector.cpp
// Function: ScallopedSector::ScallopedSector(Vec2&, float, float, Vec2&, float, float, Vec2&, float, float)
ScallopedSector::ScallopedSector(Vec2 &_Pt, float _a1, float _a2, Vec2 &P1, float r1, float sign1, Vec2 &P2, float r2, float sign2)
{
	Vec2 v1 = Vec2(P1.x - _Pt.x, P1.y - _Pt.y);
	Vec2 v2 = Vec2(P2.x - _Pt.x, P2.y - _Pt.y);

	P = _Pt;
	a1 = _a1;
	a2 = _a2;

	arcs[0].P = P1;
	arcs[0].r = r1;
	arcs[0].sign = sign1;
	arcs[0].d = sqrt(v1.x*v1.x + v1.y*v1.y);
	arcs[0].rSqrd = arcs[0].r*arcs[0].r;
	arcs[0].dSqrd = arcs[0].d*arcs[0].d;
	arcs[0].theta = atan2(v1.y,v1.x);
	arcs[0].integralAtStart = integralOfDistToCircle(a1 - arcs[0].theta, arcs[0].d, arcs[0].r, arcs[0].sign);

	arcs[1].P = P2;
	arcs[1].r = r2;
	arcs[1].sign = sign2;
	arcs[1].d = sqrt(v2.x*v2.x + v2.y*v2.y);
	arcs[1].rSqrd = arcs[1].r*arcs[1].r;
	arcs[1].dSqrd = arcs[1].d*arcs[1].d;
	arcs[1].theta = atan2(v2.y,v2.x);
	arcs[1].integralAtStart = integralOfDistToCircle(a1 - arcs[1].theta, arcs[1].d, arcs[1].r, arcs[1].sign);

	area = calcAreaToAngle(a2);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movss %xmm5, 0x14(%rsp)
movss %xmm4, 0x10(%rsp)
movq %rcx, %r14
movq %rdi, %rbx
movss (%rdx), %xmm8
movss 0x4(%rdx), %xmm9
movss (%rsi), %xmm4
movss 0x4(%rsi), %xmm5
subss %xmm4, %xmm8
subss %xmm5, %xmm9
movss (%rcx), %xmm6
movss 0x4(%rcx), %xmm7
subss %xmm4, %xmm6
movss %xmm6, 0x4(%rsp)
subss %xmm5, %xmm7
movss %xmm7, (%rsp)
movq (%rsi), %rax
movq %rax, (%rdi)
movss %xmm0, 0x8(%rdi)
movss %xmm1, 0xc(%rdi)
movq (%rdx), %rax
movq %rax, 0x14(%rdi)
movss %xmm2, 0x1c(%rdi)
movss %xmm3, 0x20(%rdi)
movaps %xmm9, %xmm1
mulss %xmm9, %xmm1
movaps %xmm8, %xmm0
mulss %xmm8, %xmm0
addss %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x771c
sqrtss %xmm0, %xmm0
jmp 0x773d
movss %xmm8, 0xc(%rsp)
movss %xmm9, 0x8(%rsp)
callq 0x2320
movss 0x8(%rsp), %xmm9
movss 0xc(%rsp), %xmm8
movss %xmm0, 0x24(%rbx)
movups 0x1c(%rbx), %xmm1
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
mulps %xmm0, %xmm0
movlps %xmm0, 0x30(%rbx)
movaps %xmm9, %xmm0
movaps %xmm8, %xmm1
callq 0x2230
movss %xmm0, 0x28(%rbx)
movss 0x8(%rbx), %xmm4
movss 0x1c(%rbx), %xmm2
subss %xmm0, %xmm4
movss 0x24(%rbx), %xmm1
movss 0x20(%rbx), %xmm3
movaps %xmm4, %xmm0
callq 0x783e
movss %xmm0, 0x2c(%rbx)
movq (%r14), %rax
movq %rax, 0x38(%rbx)
movss 0x10(%rsp), %xmm0
movss %xmm0, 0x40(%rbx)
movss 0x14(%rsp), %xmm0
movss %xmm0, 0x44(%rbx)
movss (%rsp), %xmm1
mulss %xmm1, %xmm1
movss 0x4(%rsp), %xmm0
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
ucomiss 0x2cce(%rip), %xmm0     # 0xa494
jb 0x77ce
sqrtss %xmm0, %xmm0
jmp 0x77d3
callq 0x2320
movss %xmm0, 0x48(%rbx)
movups 0x40(%rbx), %xmm1
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
mulps %xmm0, %xmm0
movlps %xmm0, 0x54(%rbx)
movss (%rsp), %xmm0
movss 0x4(%rsp), %xmm1
callq 0x2230
movss %xmm0, 0x4c(%rbx)
movss 0x8(%rbx), %xmm4
movss 0x40(%rbx), %xmm2
subss %xmm0, %xmm4
movss 0x48(%rbx), %xmm1
movss 0x44(%rbx), %xmm3
movaps %xmm4, %xmm0
callq 0x783e
movss %xmm0, 0x50(%rbx)
movss 0xc(%rbx), %xmm0
movq %rbx, %rdi
callq 0x791e
movss %xmm0, 0x10(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq