// File: /workspace/github_cpp_makefile_star2_O3/philipperemy[P]digital-setting-circles/Test.cpp
// Function: Test::test_Util()
void Test::test_Util()
{
    setUpErrorMessage("test_Util() - failed");

    long long tmp = Util::getEffectiveTime();
    Util::sleep(1000);
    assertEquals(tmp + 1, Util::getEffectiveTime());

    assertEquals(0.0, Util::diff180(360.0, 360.0));
    //360=0 -> 170, diff = 170
    assertEquals(170.0, Util::diff180(170.0, 360.0));
    assertEquals(0.0, Util::diff180(0.0, 360.0));
    assertEquals(0.0, Util::diff180(-180.0, 180.0));
    //40 -> 90, diff = -50
    assertEquals(-50.0, Util::diff180(40.0, 90.0));
    //-20 -> 80 = -100
    assertEquals(-100.0, Util::diff180(-20.0, 80.0));

    StarData starData1;
    StarData starData2;

    starData1.az = 1;
    starData1.el = 2;
    starData1.ra = 3;
    starData1.dec = 4;
    starData1.time = 5;

    starData2.az = 1;
    starData2.el = 2;
    starData2.ra = 3;
    starData2.dec = 4;
    starData2.time = 5;

    assertTrue(!Util::goodAlignmentGeometry(starData1, starData2));

    starData1.az = 1;
    starData1.el = 2;
    starData1.ra = 3;
    starData1.dec = 4;
    starData1.time = 5;

    starData2.az = 1;
    starData2.el = 50;
    starData2.ra = 3;
    starData2.dec = 4;
    starData2.time = 5;

    assertTrue(!Util::goodAlignmentGeometry(starData1, starData2));


    starData1.az = 1;
    starData1.el = 2;
    starData1.ra = 3;
    starData1.dec = 4;
    starData1.time = 5;

    starData2.az = 100;
    starData2.el = 50;
    starData2.ra = 3;
    starData2.dec = 4;
    starData2.time = 5;

    assertTrue(Util::goodAlignmentGeometry(starData1, starData2));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x9ac0(%rip), %rsi      # 0x31d84
leaq 0x9acd(%rip), %rdx      # 0x31d98
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x4f28
movq %rbx, %rdi
movq %r14, %rsi
callq 0x28f78
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x282f7
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x32e0
callq 0x2b30a
movq %rax, %r14
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x2b36c
incq %r14
callq 0x2b30a
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x29956
movsd 0x3d41(%rip), %xmm0     # 0x2c068
movaps %xmm0, %xmm1
callq 0x2b148
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
movq %rbx, %rdi
callq 0x29578
movsd 0x98bb(%rip), %xmm0     # 0x31c00
movsd 0x3d1b(%rip), %xmm1     # 0x2c068
callq 0x2b148
movaps %xmm0, %xmm1
movq %rbx, %rdi
movsd 0x98a0(%rip), %xmm0     # 0x31c00
callq 0x29578
xorps %xmm0, %xmm0
movsd 0x3cf8(%rip), %xmm1     # 0x2c068
callq 0x2b148
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
movq %rbx, %rdi
callq 0x29578
movsd 0x987d(%rip), %xmm0     # 0x31c08
movsd 0x987d(%rip), %xmm1     # 0x31c10
callq 0x2b148
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
movq %rbx, %rdi
callq 0x29578
movsd 0x986a(%rip), %xmm0     # 0x31c18
movsd 0x986a(%rip), %xmm1     # 0x31c20
callq 0x2b148
movaps %xmm0, %xmm1
movsd 0x9862(%rip), %xmm0     # 0x31c28
movq %rbx, %rdi
callq 0x29578
movsd 0x985a(%rip), %xmm0     # 0x31c30
movsd 0x9712(%rip), %xmm1     # 0x31af0
callq 0x2b148
movaps %xmm0, %xmm1
movsd 0x984a(%rip), %xmm0     # 0x31c38
movq %rbx, %rdi
callq 0x29578
leaq -0xa8(%rbp), %rdi
callq 0x26850
leaq -0x78(%rbp), %rdi
callq 0x26850
movabsq $0x3ff0000000000000, %r13 # imm = 0x3FF0000000000000
leaq -0xa8(%rbp), %rdi
movq %r13, 0x8(%rdi)
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, 0x10(%rdi)
movabsq $0x4008000000000000, %r14 # imm = 0x4008000000000000
movq %r14, 0x18(%rdi)
movabsq $0x4010000000000000, %r15 # imm = 0x4010000000000000
movq %r15, 0x20(%rdi)
movabsq $0x4014000000000000, %r12 # imm = 0x4014000000000000
movq %r12, 0x28(%rdi)
leaq -0x78(%rbp), %rsi
movq %r13, 0x8(%rsi)
movq %rax, 0x10(%rsi)
movq %r14, 0x18(%rsi)
movq %r15, 0x20(%rsi)
movq %r12, 0x28(%rsi)
callq 0x2b24a
xorb $0x1, %al
movzbl %al, %esi
movq %rbx, %rdi
callq 0x2930a
leaq -0xa8(%rbp), %rdi
movq %r13, 0x8(%rdi)
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, 0x10(%rdi)
movq %r14, 0x18(%rdi)
movq %r15, 0x20(%rdi)
movq %r12, 0x28(%rdi)
leaq -0x78(%rbp), %rsi
movq %r13, 0x8(%rsi)
movabsq $0x4049000000000000, %rax # imm = 0x4049000000000000
movq %rax, 0x10(%rsi)
movq %r14, 0x18(%rsi)
movq %r15, 0x20(%rsi)
movq %r12, 0x28(%rsi)
callq 0x2b24a
xorb $0x1, %al
movzbl %al, %esi
movq %rbx, %rdi
callq 0x2930a
leaq -0xa8(%rbp), %rdi
movq %r13, 0x8(%rdi)
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, 0x10(%rdi)
movq %r14, 0x18(%rdi)
movq %r15, 0x20(%rdi)
movq %r12, 0x28(%rdi)
movabsq $0x4059000000000000, %rax # imm = 0x4059000000000000
leaq -0x78(%rbp), %rsi
movq %rax, 0x8(%rsi)
movabsq $0x4049000000000000, %rax # imm = 0x4049000000000000
movq %rax, 0x10(%rsi)
movq %r14, 0x18(%rsi)
movq %r15, 0x20(%rsi)
movq %r12, 0x28(%rsi)
callq 0x2b24a
movzbl %al, %esi
movq %rbx, %rdi
callq 0x2930a
leaq -0x78(%rbp), %rdi
callq 0x26878
leaq -0xa8(%rbp), %rdi
callq 0x26878
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2858e
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x2859a
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x32e0
jmp 0x2859a
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x26878
leaq -0xa8(%rbp), %rdi
callq 0x26878
movq %rbx, %rdi
callq 0x34b0