// File: skaringa[P]DistanceCalculation/Sample.cpp
// Function: main
int main()
{
	list<DistanceCalculator*> calcs;
	calcs.push_back(new ReallySimpleDistanceCalculator());
	calcs.push_back(new SimpleDistanceCalculator());
	calcs.push_back(new SphereDistanceCalculator());
	calcs.push_back(new SphereDistanceHaversineCalculator());
	calcs.push_back(new GeodDistanceCalculator());

	Point rue1(49.9917, 8.41321, "Ruesselsheim Station");
	Point rue2(50.0049, 8.42182, "Ruesselsheim Opel bridge");
	compareDistanceCalculators(rue1, rue2, calcs);
	
	Point berlin(52.5164, 13.3777, "Berlin Brandenburg Gate");
	Point lissabon(38.692668, -9.177944, "Lisbon Tagus bridge");
	compareDistanceCalculators(berlin, lissabon, calcs);

	// negativ coordinates
	Point montevideo(-34.81816, -56.21383, "Montevideo, Uruguay");
	compareDistanceCalculators(berlin, montevideo, calcs);

	// very small distance 
	Point near0(50.0, 8.0, "testpoint");
	Point near1m(50.000008985, 8.0, "testpoint+1m");
	compareDistanceCalculators(near0, near1m, calcs);
	Point near1cm(50.00000009, 8.0, "testpoint+1cm");
	compareDistanceCalculators(near0, near1cm, calcs);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3c0, %rsp            # imm = 0x3C0
leaq -0x18(%rbp), %rdi
callq 0x4530
movl $0x8, %edi
callq 0x3210
movq %rax, -0x358(%rbp)
jmp 0x3b47
movq -0x358(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x4590
movq -0x358(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x4550
jmp 0x3b74
movl $0x8, %edi
callq 0x3210
movq %rax, -0x360(%rbp)
jmp 0x3b87
movq -0x360(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x45d0
movq -0x360(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4550
jmp 0x3bb4
movl $0x8, %edi
callq 0x3210
movq %rax, -0x368(%rbp)
jmp 0x3bc7
movq -0x368(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x4610
movq -0x368(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x4550
jmp 0x3bf4
movl $0x8, %edi
callq 0x3210
movq %rax, -0x370(%rbp)
jmp 0x3c07
movq -0x370(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x4650
movq -0x370(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x4550
jmp 0x3c34
movl $0x8, %edi
callq 0x3210
movq %rax, -0x378(%rbp)
jmp 0x3c47
movq -0x378(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x4690
movq -0x378(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4550
jmp 0x3c74
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x380(%rbp)
callq 0x3360
movq -0x380(%rbp), %rdx
leaq 0x248b(%rip), %rsi      # 0x6120
leaq -0xa8(%rbp), %rdi
callq 0x46d0
jmp 0x3ca3
leaq -0x88(%rbp), %rdi
movsd 0x23ce(%rip), %xmm0     # 0x6080
movsd 0x23ce(%rip), %xmm1     # 0x6088
leaq -0xa8(%rbp), %rsi
callq 0x4780
jmp 0x3cc8
leaq -0xa8(%rbp), %rdi
callq 0x3110
leaq -0xa9(%rbp), %rdi
callq 0x3250
leaq -0x109(%rbp), %rdi
movq %rdi, -0x388(%rbp)
callq 0x3360
movq -0x388(%rbp), %rdx
leaq 0x2434(%rip), %rsi      # 0x6135
leaq -0x108(%rbp), %rdi
callq 0x46d0
jmp 0x3d0f
leaq -0xe8(%rbp), %rdi
movsd 0x2372(%rip), %xmm0     # 0x6090
movsd 0x2372(%rip), %xmm1     # 0x6098
leaq -0x108(%rbp), %rsi
callq 0x4780
jmp 0x3d34
leaq -0x108(%rbp), %rdi
callq 0x3110
leaq -0x109(%rbp), %rdi
callq 0x3250
leaq -0x88(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
leaq -0x18(%rbp), %rdx
callq 0x4350
jmp 0x3d65
leaq -0x169(%rbp), %rdi
movq %rdi, -0x390(%rbp)
callq 0x3360
movq -0x390(%rbp), %rdx
leaq 0x23c8(%rip), %rsi      # 0x614e
leaq -0x168(%rbp), %rdi
callq 0x46d0
jmp 0x3d94
leaq -0x148(%rbp), %rdi
movsd 0x22fd(%rip), %xmm0     # 0x60a0
movsd 0x22fd(%rip), %xmm1     # 0x60a8
leaq -0x168(%rbp), %rsi
callq 0x4780
jmp 0x3db9
leaq -0x168(%rbp), %rdi
callq 0x3110
leaq -0x169(%rbp), %rdi
callq 0x3250
leaq -0x1c9(%rbp), %rdi
movq %rdi, -0x398(%rbp)
callq 0x3360
movq -0x398(%rbp), %rdx
leaq 0x2374(%rip), %rsi      # 0x6166
leaq -0x1c8(%rbp), %rdi
callq 0x46d0
jmp 0x3e00
leaq -0x1a8(%rbp), %rdi
movsd 0x22a1(%rip), %xmm0     # 0x60b0
movsd 0x22a1(%rip), %xmm1     # 0x60b8
leaq -0x1c8(%rbp), %rsi
callq 0x4780
jmp 0x3e25
leaq -0x1c8(%rbp), %rdi
callq 0x3110
leaq -0x1c9(%rbp), %rdi
callq 0x3250
leaq -0x148(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
leaq -0x18(%rbp), %rdx
callq 0x4350
jmp 0x3e56
leaq -0x229(%rbp), %rdi
movq %rdi, -0x3a0(%rbp)
callq 0x3360
movq -0x3a0(%rbp), %rdx
leaq 0x2303(%rip), %rsi      # 0x617a
leaq -0x228(%rbp), %rdi
callq 0x46d0
jmp 0x3e85
leaq -0x208(%rbp), %rdi
movsd 0x222c(%rip), %xmm0     # 0x60c0
movsd 0x222c(%rip), %xmm1     # 0x60c8
leaq -0x228(%rbp), %rsi
callq 0x4780
jmp 0x3eaa
leaq -0x228(%rbp), %rdi
callq 0x3110
leaq -0x229(%rbp), %rdi
callq 0x3250
leaq -0x148(%rbp), %rdi
leaq -0x208(%rbp), %rsi
leaq -0x18(%rbp), %rdx
callq 0x4350
jmp 0x3edb
leaq -0x289(%rbp), %rdi
movq %rdi, -0x3a8(%rbp)
callq 0x3360
movq -0x3a8(%rbp), %rdx
leaq 0x2292(%rip), %rsi      # 0x618e
leaq -0x288(%rbp), %rdi
callq 0x46d0
jmp 0x3f0a
leaq -0x268(%rbp), %rdi
movsd 0x21b7(%rip), %xmm0     # 0x60d0
movsd 0x21b7(%rip), %xmm1     # 0x60d8
leaq -0x288(%rbp), %rsi
callq 0x4780
jmp 0x3f2f
leaq -0x288(%rbp), %rdi
callq 0x3110
leaq -0x289(%rbp), %rdi
callq 0x3250
leaq -0x2e9(%rbp), %rdi
movq %rdi, -0x3b0(%rbp)
callq 0x3360
movq -0x3b0(%rbp), %rdx
leaq 0x2230(%rip), %rsi      # 0x6198
leaq -0x2e8(%rbp), %rdi
callq 0x46d0
jmp 0x3f76
leaq -0x2c8(%rbp), %rdi
movsd 0x215b(%rip), %xmm0     # 0x60e0
movsd 0x214b(%rip), %xmm1     # 0x60d8
leaq -0x2e8(%rbp), %rsi
callq 0x4780
jmp 0x3f9b
leaq -0x2e8(%rbp), %rdi
callq 0x3110
leaq -0x2e9(%rbp), %rdi
callq 0x3250
leaq -0x268(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
leaq -0x18(%rbp), %rdx
callq 0x4350
jmp 0x3fcc
leaq -0x349(%rbp), %rdi
movq %rdi, -0x3b8(%rbp)
callq 0x3360
movq -0x3b8(%rbp), %rdx
leaq 0x21b8(%rip), %rsi      # 0x61a5
leaq -0x348(%rbp), %rdi
callq 0x46d0
jmp 0x3ffb
leaq -0x328(%rbp), %rdi
movsd 0x20de(%rip), %xmm0     # 0x60e8
movsd 0x20c6(%rip), %xmm1     # 0x60d8
leaq -0x348(%rbp), %rsi
callq 0x4780
jmp 0x4020
leaq -0x348(%rbp), %rdi
callq 0x3110
leaq -0x349(%rbp), %rdi
callq 0x3250
leaq -0x268(%rbp), %rdi
leaq -0x328(%rbp), %rsi
leaq -0x18(%rbp), %rdx
callq 0x4350
jmp 0x4051
leaq -0x328(%rbp), %rdi
callq 0x3a80
leaq -0x2c8(%rbp), %rdi
callq 0x3a80
leaq -0x268(%rbp), %rdi
callq 0x3a80
leaq -0x208(%rbp), %rdi
callq 0x3a80
leaq -0x1a8(%rbp), %rdi
callq 0x3a80
leaq -0x148(%rbp), %rdi
callq 0x3a80
leaq -0xe8(%rbp), %rdi
callq 0x3a80
leaq -0x88(%rbp), %rdi
callq 0x3a80
leaq -0x18(%rbp), %rdi
callq 0x47e0
xorl %eax, %eax
addq $0x3c0, %rsp            # imm = 0x3C0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x4335
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x40fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3110
leaq -0xa9(%rbp), %rdi
callq 0x3250
jmp 0x4335
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x4133
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x3110
leaq -0x109(%rbp), %rdi
callq 0x3250
jmp 0x4329
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x431d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x417b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x3110
leaq -0x169(%rbp), %rdi
callq 0x3250
jmp 0x431d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x41b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x3110
leaq -0x1c9(%rbp), %rdi
callq 0x3250
jmp 0x4311
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x4305
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x41fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x3110
leaq -0x229(%rbp), %rdi
callq 0x3250
jmp 0x4305
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x42f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x4242
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x3110
leaq -0x289(%rbp), %rdi
callq 0x3250
jmp 0x42f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x4279
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x3110
leaq -0x2e9(%rbp), %rdi
callq 0x3250
jmp 0x42ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x42e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x42bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x348(%rbp), %rdi
callq 0x3110
leaq -0x349(%rbp), %rdi
callq 0x3250
jmp 0x42e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x328(%rbp), %rdi
callq 0x3a80
leaq -0x2c8(%rbp), %rdi
callq 0x3a80
leaq -0x268(%rbp), %rdi
callq 0x3a80
leaq -0x208(%rbp), %rdi
callq 0x3a80
leaq -0x1a8(%rbp), %rdi
callq 0x3a80
leaq -0x148(%rbp), %rdi
callq 0x3a80
leaq -0xe8(%rbp), %rdi
callq 0x3a80
leaq -0x88(%rbp), %rdi
callq 0x3a80
leaq -0x18(%rbp), %rdi
callq 0x47e0
movq -0x28(%rbp), %rdi
callq 0x3350
nopw (%rax,%rax)