// File: /workspace/github_cpp_makefile_star2_O1/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 0x97ab(%rip), %rsi      # 0x31db1
leaq 0x97b8(%rip), %rdx      # 0x31dc5
leaq -0x58(%rbp), %r14
movq %r14, %rdi
callq 0x4e0a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x28e38
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0x28639
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x32e0
leaq -0xb8(%rbp), %rdi
callq 0x2670c
leaq -0x88(%rbp), %rdi
callq 0x2670c
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 0x4ea4
leaq -0x468(%rbp), %rdi
movl $0x186a0, %esi          # imm = 0x186A0
callq 0x505a
leaq -0x468(%rbp), %rdi
movl $0x2710, %esi           # imm = 0x2710
movl $0x2710, %edx           # imm = 0x2710
callq 0x5048
leaq -0x468(%rbp), %rdi
movsd 0x9527(%rip), %xmm0     # 0x31c40
movsd 0x9527(%rip), %xmm1     # 0x31c48
callq 0x4f86
leaq -0x28(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x9691(%rip), %rsi      # 0x31dc6
leaq 0x969a(%rip), %rdx      # 0x31dd6
leaq -0x38(%rbp), %rdi
callq 0x4e0a
leaq -0x468(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x5036
movq -0x38(%rbp), %rdi
cmpq %r14, %rdi
je 0x2876a
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x32e0
leaq -0x468(%rbp), %rdi
callq 0x4f40
leaq -0x468(%rbp), %rdi
movl $0x7d0, %esi            # imm = 0x7D0
movl $0xbb8, %edx            # imm = 0xBB8
callq 0x508a
leaq -0x468(%rbp), %rdi
callq 0x517a
movq 0x11829(%rip), %rdi     # 0x39fc8
leaq 0x9631(%rip), %rsi      # 0x31dd7
movl $0xb, %edx
callq 0x3310
leaq -0x468(%rbp), %rdi
callq 0x4ff6
movzbl %al, %esi
movq 0x11802(%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 0x117cc(%rip), %rdi     # 0x39fc8
leaq 0x95e0(%rip), %rsi      # 0x31de3
movl $0xc, %edx
callq 0x3310
leaq -0x468(%rbp), %rdi
callq 0x4fda
movq 0x117a8(%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 0x11772(%rip), %rdi     # 0x39fc8
leaq 0x9593(%rip), %rsi      # 0x31df0
movl $0xc, %edx
callq 0x3310
leaq -0x468(%rbp), %rdi
callq 0x4fe8
movq 0x1174e(%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 0x4fb2
leaq -0x88(%rbp), %rdi
callq 0x26734
leaq -0xb8(%rbp), %rdi
callq 0x26734
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 0x2891e
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x32e0
jmp 0x2891e
jmp 0x2891b
movq %rax, %rbx
jmp 0x2892a
movq %rax, %rbx
jmp 0x28936
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0x28942
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x32e0
jmp 0x28942
movq %rax, %rbx
leaq -0x468(%rbp), %rdi
callq 0x4fb2
leaq -0x88(%rbp), %rdi
callq 0x26734
leaq -0xb8(%rbp), %rdi
callq 0x26734
movq %rbx, %rdi
callq 0x34b0