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

    StarData starData1;
    StarData starData2;

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

    starData2.az = 10;
    starData2.el = 3.;
    starData2.ra = 30;
    starData2.dec = 40;
    starData2.time = 5;

    Data data(starData1, starData2);

    data.setEncoderReadRate(100000); //100 Khz
    data.setEncoderResolution(10000, 10000);

    //Set by user.
    //Look up in the dico to find RA and DEC of the target
    data.setTarget(50, 60);
    data.setStarName("target star name");

    data.applyAlignmentData();

    data.updateCurrentAzEl(2000, 3000);
    data.calculateTargetAzEl();

    std::cout << "is aligned " << data.isAligned() << std::endl;
    std::cout << "target AZ = " << data.getTargetAz() << std::endl;
    std::cout << "target EL = " << data.getTargetEl() << std::endl;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x458, %rsp            # imm = 0x458
movq %rdi, %rbx
leaq -0x48(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x9667(%rip), %rsi      # 0x31db1
leaq 0x9674(%rip), %rdx      # 0x31dc5
leaq -0x58(%rbp), %r14
movq %r14, %rdi
callq 0x4f28
movq %rbx, %rdi
movq %r14, %rsi
callq 0x28f78
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0x2877d
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x32e0
leaq -0xb8(%rbp), %rdi
callq 0x26850
leaq -0x88(%rbp), %rdi
callq 0x26850
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
leaq -0xb8(%rbp), %rsi
movq %rax, 0x8(%rsi)
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, 0x10(%rsi)
movabsq $0x4008000000000000, %rax # imm = 0x4008000000000000
movq %rax, 0x18(%rsi)
movabsq $0x4010000000000000, %rcx # imm = 0x4010000000000000
movq %rcx, 0x20(%rsi)
movabsq $0x4014000000000000, %rcx # imm = 0x4014000000000000
movq %rcx, 0x28(%rsi)
movabsq $0x4024000000000000, %rdi # imm = 0x4024000000000000
leaq -0x88(%rbp), %rdx
movq %rdi, 0x8(%rdx)
movq %rax, 0x10(%rdx)
movabsq $0x403e000000000000, %rax # imm = 0x403E000000000000
movq %rax, 0x18(%rdx)
movabsq $0x4044000000000000, %rax # imm = 0x4044000000000000
movq %rax, 0x20(%rdx)
movq %rcx, 0x28(%rdx)
leaq -0x468(%rbp), %rdi
callq 0x4fc8
leaq -0x468(%rbp), %rdi
movl $0x186a0, %esi          # imm = 0x186A0
callq 0x517e
leaq -0x468(%rbp), %rdi
movl $0x2710, %esi           # imm = 0x2710
movl $0x2710, %edx           # imm = 0x2710
callq 0x516c
leaq -0x468(%rbp), %rdi
movsd 0x93e3(%rip), %xmm0     # 0x31c40
movsd 0x93e3(%rip), %xmm1     # 0x31c48
callq 0x50aa
leaq -0x28(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x954d(%rip), %rsi      # 0x31dc6
leaq 0x9556(%rip), %rdx      # 0x31dd6
leaq -0x38(%rbp), %rdi
callq 0x4f28
leaq -0x468(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x515a
movq -0x38(%rbp), %rdi
cmpq %r14, %rdi
je 0x288ae
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x32e0
leaq -0x468(%rbp), %rdi
callq 0x5064
leaq -0x468(%rbp), %rdi
movl $0x7d0, %esi            # imm = 0x7D0
movl $0xbb8, %edx            # imm = 0xBB8
callq 0x51ae
leaq -0x468(%rbp), %rdi
callq 0x529e
movq 0x116e5(%rip), %rdi     # 0x39fc8
leaq 0x94ed(%rip), %rsi      # 0x31dd7
movl $0xb, %edx
callq 0x3310
leaq -0x468(%rbp), %rdi
callq 0x511a
movzbl %al, %esi
movq 0x116be(%rip), %rdi     # 0x39fc8
callq 0x3430
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq 0x11688(%rip), %rdi     # 0x39fc8
leaq 0x949c(%rip), %rsi      # 0x31de3
movl $0xc, %edx
callq 0x3310
leaq -0x468(%rbp), %rdi
callq 0x50fe
movq 0x11664(%rip), %rdi     # 0x39fc8
callq 0x33f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq 0x1162e(%rip), %rdi     # 0x39fc8
leaq 0x944f(%rip), %rsi      # 0x31df0
movl $0xc, %edx
callq 0x3310
leaq -0x468(%rbp), %rdi
callq 0x510c
movq 0x1160a(%rip), %rdi     # 0x39fc8
callq 0x33f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
leaq -0x468(%rbp), %rdi
callq 0x50d6
leaq -0x88(%rbp), %rdi
callq 0x26878
leaq -0xb8(%rbp), %rdi
callq 0x26878
addq $0x458, %rsp            # imm = 0x458
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r14, %rdi
je 0x28a62
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x32e0
jmp 0x28a62
jmp 0x28a5f
movq %rax, %rbx
jmp 0x28a6e
movq %rax, %rbx
jmp 0x28a7a
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0x28a86
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x32e0
jmp 0x28a86
movq %rax, %rbx
leaq -0x468(%rbp), %rdi
callq 0x50d6
leaq -0x88(%rbp), %rdi
callq 0x26878
leaq -0xb8(%rbp), %rdi
callq 0x26878
movq %rbx, %rdi
callq 0x34b0