// File: /workspace/github_cpp_makefile_star2_O1/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 0x9c04(%rip), %rsi      # 0x31d84
leaq 0x9c11(%rip), %rdx      # 0x31d98
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x4e0a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x28e38
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x281b3
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x32e0
callq 0x2b232
movq %rax, %r14
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x2b294
incq %r14
callq 0x2b232
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x29828
movsd 0x3e85(%rip), %xmm0     # 0x2c068
movaps %xmm0, %xmm1
callq 0x2b070
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
movq %rbx, %rdi
callq 0x2943c
movsd 0x99ff(%rip), %xmm0     # 0x31c00
movsd 0x3e5f(%rip), %xmm1     # 0x2c068
callq 0x2b070
movaps %xmm0, %xmm1
movq %rbx, %rdi
movsd 0x99e4(%rip), %xmm0     # 0x31c00
callq 0x2943c
xorps %xmm0, %xmm0
movsd 0x3e3c(%rip), %xmm1     # 0x2c068
callq 0x2b070
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
movq %rbx, %rdi
callq 0x2943c
movsd 0x99c1(%rip), %xmm0     # 0x31c08
movsd 0x99c1(%rip), %xmm1     # 0x31c10
callq 0x2b070
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
movq %rbx, %rdi
callq 0x2943c
movsd 0x99ae(%rip), %xmm0     # 0x31c18
movsd 0x99ae(%rip), %xmm1     # 0x31c20
callq 0x2b070
movaps %xmm0, %xmm1
movsd 0x99a6(%rip), %xmm0     # 0x31c28
movq %rbx, %rdi
callq 0x2943c
movsd 0x999e(%rip), %xmm0     # 0x31c30
movsd 0x9856(%rip), %xmm1     # 0x31af0
callq 0x2b070
movaps %xmm0, %xmm1
movsd 0x998e(%rip), %xmm0     # 0x31c38
movq %rbx, %rdi
callq 0x2943c
leaq -0xa8(%rbp), %rdi
callq 0x2670c
leaq -0x78(%rbp), %rdi
callq 0x2670c
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 0x2b172
xorb $0x1, %al
movzbl %al, %esi
movq %rbx, %rdi
callq 0x291ce
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 0x2b172
xorb $0x1, %al
movzbl %al, %esi
movq %rbx, %rdi
callq 0x291ce
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 0x2b172
movzbl %al, %esi
movq %rbx, %rdi
callq 0x291ce
leaq -0x78(%rbp), %rdi
callq 0x26734
leaq -0xa8(%rbp), %rdi
callq 0x26734
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2844a
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x28456
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x32e0
jmp 0x28456
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x26734
leaq -0xa8(%rbp), %rdi
callq 0x26734
movq %rbx, %rdi
callq 0x34b0