// File: /workspace/github_c_makefile_star2_O1/eitijupaenoithoowohd[P]TBezierInterpolation/TBezierInterpolation.cpp
// Function: main
int main()
{
	vector<Point2D> testValues;
	vector<Segment> spline;
	Point2D p;

	testValues.push_back(Point2D(0, 0));
	testValues.push_back(Point2D(20, 0));
	testValues.push_back(Point2D(45, -47));
	testValues.push_back(Point2D(53, 335));
	testValues.push_back(Point2D(57, 26));
	testValues.push_back(Point2D(62, 387));
	testValues.push_back(Point2D(74, 104));
	testValues.push_back(Point2D(89, 0));
	testValues.push_back(Point2D(95, 100));
	testValues.push_back(Point2D(100, 0));

	calculateSpline(testValues, spline);

	for (auto s : spline)
	{
		for (int i = 0; i < RESOLUTION; ++i)
		{
			s.calc((double)i / (double)RESOLUTION, p);
			cout << p.x << " " << p.y << endl;
		}
	}

	cout << testValues.back().x << " " << testValues.back().y << endl;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movq %rax, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movapd %xmm0, (%rsp)
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x1755
movupd %xmm0, (%rsi)
addq $0x10, 0x18(%rsp)
jmp 0x1762
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0x1e1c
movabsq $0x4034000000000000, %rax # imm = 0x4034000000000000
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x1796
movupd (%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x18(%rsp)
jmp 0x17a3
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0x1e1c
movabsq $0x4046800000000000, %rax # imm = 0x4046800000000000
movq %rax, (%rsp)
movabsq $-0x3fb8800000000000, %rax # imm = 0xC047800000000000
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x17dd
movupd (%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x18(%rsp)
jmp 0x17ea
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0x1e1c
movabsq $0x404a800000000000, %rax # imm = 0x404A800000000000
movq %rax, (%rsp)
movabsq $0x4074f00000000000, %rax # imm = 0x4074F00000000000
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x1824
movupd (%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x18(%rsp)
jmp 0x1831
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0x1e1c
movabsq $0x404c800000000000, %rax # imm = 0x404C800000000000
movq %rax, (%rsp)
movabsq $0x403a000000000000, %rax # imm = 0x403A000000000000
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x186b
movupd (%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x18(%rsp)
jmp 0x1878
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0x1e1c
movabsq $0x404f000000000000, %rax # imm = 0x404F000000000000
movq %rax, (%rsp)
movabsq $0x4078300000000000, %rax # imm = 0x4078300000000000
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x18b2
movupd (%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x18(%rsp)
jmp 0x18bf
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0x1e1c
movabsq $0x4052800000000000, %rax # imm = 0x4052800000000000
movq %rax, (%rsp)
movabsq $0x405a000000000000, %rax # imm = 0x405A000000000000
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x18f9
movupd (%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x18(%rsp)
jmp 0x1906
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0x1e1c
movabsq $0x4056400000000000, %rax # imm = 0x4056400000000000
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x193a
movupd (%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x18(%rsp)
jmp 0x1947
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0x1e1c
movabsq $0x4057c00000000000, %rax # imm = 0x4057C00000000000
movq %rax, (%rsp)
movabsq $0x4059000000000000, %rbx # imm = 0x4059000000000000
movq %rbx, 0x8(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x1981
movupd (%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x18(%rsp)
jmp 0x198e
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0x1e1c
movq %rbx, (%rsp)
movq $0x0, 0x8(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x19b8
movupd (%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x18(%rsp)
jmp 0x19c5
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0x1e1c
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x126c
movq 0x30(%rsp), %r12
movq 0x38(%rsp), %r13
cmpq %r13, %r12
je 0x1bb4
movq 0x25ea(%rip), %rbx      # 0x3fd8
leaq 0x653(%rip), %r14       # 0x2048
movsd (%r12), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x8(%r12), %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x10(%r12), %xmm0
movsd %xmm0, 0x78(%rsp)
movsd 0x18(%r12), %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x20(%r12), %xmm0
movsd %xmm0, 0x70(%rsp)
movsd 0x28(%r12), %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x30(%r12), %xmm0
movsd %xmm0, 0x68(%rsp)
movsd 0x38(%r12), %xmm0
movsd %xmm0, 0x48(%rsp)
xorl %ebp, %ebp
xorps %xmm4, %xmm4
cvtsi2sd %ebp, %xmm4
mulsd 0x5c8(%rip), %xmm4      # 0x2038
movapd %xmm4, %xmm2
mulsd %xmm4, %xmm2
movapd %xmm4, %xmm3
mulsd %xmm2, %xmm3
movsd 0x5a0(%rip), %xmm0      # 0x2028
subsd %xmm4, %xmm0
movapd %xmm0, %xmm5
movsd 0x5a8(%rip), %xmm1      # 0x2040
mulsd %xmm1, %xmm2
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm0
mulsd %xmm0, %xmm5
mulsd %xmm1, %xmm4
mulsd %xmm0, %xmm4
movsd 0x78(%rsp), %xmm0
movsd %xmm4, 0x90(%rsp)
mulsd %xmm4, %xmm0
movsd %xmm5, 0x88(%rsp)
movapd %xmm5, %xmm1
mulsd 0x80(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm2, 0x98(%rsp)
mulsd 0x70(%rsp), %xmm2
addsd %xmm1, %xmm2
movsd %xmm3, 0xa0(%rsp)
movapd %xmm3, %xmm0
mulsd 0x68(%rsp), %xmm0
addsd %xmm2, %xmm0
movq %rbx, %rdi
callq 0x1100
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x10e0
movsd 0x90(%rsp), %xmm0
mulsd 0x58(%rsp), %xmm0
movsd 0x88(%rsp), %xmm2
mulsd 0x60(%rsp), %xmm2
addsd %xmm0, %xmm2
movsd 0x98(%rsp), %xmm1
mulsd 0x50(%rsp), %xmm1
addsd %xmm2, %xmm1
movsd 0xa0(%rsp), %xmm0
mulsd 0x48(%rsp), %xmm0
addsd %xmm1, %xmm0
movq %r15, %rdi
callq 0x1100
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %esi
movq %r15, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
incl %ebp
cmpl $0x20, %ebp
jne 0x1a61
addq $0x40, %r12
cmpq %r13, %r12
jne 0x19f5
movq 0x18(%rsp), %rax
movsd -0x10(%rax), %xmm0
movq 0x2413(%rip), %rdi      # 0x3fd8
callq 0x1100
movq %rax, %rbx
leaq 0x474(%rip), %rsi       # 0x2048
movl $0x1, %edx
movq %rax, %rdi
callq 0x10e0
movq 0x18(%rsp), %rax
movsd -0x8(%rax), %xmm0
movq %rbx, %rdi
callq 0x1100
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1c2c
callq 0x10b0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1c3b
callq 0x10b0
xorl %eax, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1c65
jmp 0x1c65
jmp 0x1c65
jmp 0x1c65
jmp 0x1c65
jmp 0x1c65
jmp 0x1c65
jmp 0x1c65
jmp 0x1c65
jmp 0x1c65
jmp 0x1c65
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1c77
callq 0x10b0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1c86
callq 0x10b0
movq %rbx, %rdi
callq 0x1110