// File: /workspace/github_cpp_makefile_star2_O3/Albuso0[P]entropy/main_test.cpp
// Function: main
int main()
{
    int k = 100000;

    // Set estimator
    Entropy entropy( k );
    entropy.setDegree( 18 ); // L = 1.6 log k
    entropy.setInterval( 40 ); // M = 3.5 log k
    entropy.setThreshold( 18 ); // N = 1.6 log k
    print_param(entropy); // print parameters

    // Input fingerprint from file
    entropy.setFin("fin_sample.txt"); // fingerprint of 3000 samples generated from uniform[100000]
    print_results(entropy); // print estimation results

    // Input fingerprint inline
    std::vector<int> freq, cnt;
    freq.push_back(1); cnt.push_back(2910); 
    freq.push_back(2); cnt.push_back(45);
    entropy.setFin(freq, cnt);
    print_results(entropy);

    // Input histogram from file
    entropy.setHist("hist_sample.txt"); // histogram of 3000 samples generated from uniform[100000]
    print_results(entropy);
    
    // Input histogram inline
    std::vector<int> hist;
    for (int i = 0; i < 2910; i++) hist.push_back(1);
    for (int i = 0; i < 45; i++) hist.push_back(2);
    entropy.setHist(hist);
    print_results(entropy);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
movl $0x186a0, %esi          # imm = 0x186A0
callq 0x2e66
movq %rbx, %rdi
movl $0x12, %esi
callq 0x2cf8
movaps 0xd2c(%rip), %xmm0      # 0x4090
leaq 0xa8(%rsp), %rdi
movups %xmm0, 0x8(%rdi)
callq 0x36dd
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xd18(%rip), %rsi       # 0x40a0
leaq 0xd1f(%rip), %rdx       # 0x40ae
leaq 0x88(%rsp), %rdi
callq 0x37ba
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x287e
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x33ce
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0xa8(%rsp), %rdi
callq 0x374b
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rdi
movaps %xmm0, (%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movq %rax, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
leaq 0x10(%rsp), %rdx
movl $0x1, (%rdx)
xorl %esi, %esi
callq 0x3850
movq 0x38(%rsp), %rsi
movl $0xb5e, 0x10(%rsp)      # imm = 0xB5E
cmpq 0x40(%rsp), %rsi
je 0x342d
movl $0xb5e, (%rsi)          # imm = 0xB5E
addq $0x4, %rsi
movq %rsi, 0x38(%rsp)
jmp 0x343c
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x3850
movl $0x2, 0x10(%rsp)
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0x3461
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x58(%rsp)
jmp 0x3470
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x3850
movl $0x2d, 0x10(%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x3495
movl $0x2d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x38(%rsp)
jmp 0x34a4
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x3850
leaq 0xa8(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x296e
leaq 0xa8(%rsp), %rdi
callq 0x374b
leaq 0x78(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xbd7(%rip), %rsi       # 0x40af
leaq 0xbdf(%rip), %rdx       # 0x40be
leaq 0x68(%rsp), %rdi
callq 0x37ba
leaq 0xa8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x2b50
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x3512
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0xa8(%rsp), %rdi
callq 0x374b
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rbx
movaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movl $0xb5e, %ebp            # imm = 0xB5E
leaq 0xc(%rsp), %r14
movl $0x1, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x3561
movl $0x1, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x356c
movq %rbx, %rdi
movq %r14, %rdx
callq 0x3850
decl %ebp
jne 0x353c
movl $0x2d, %ebp
leaq 0x10(%rsp), %rbx
leaq 0xc(%rsp), %r14
movl $0x2, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x35a4
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x35af
movq %rbx, %rdi
movq %r14, %rdx
callq 0x3850
decl %ebp
jne 0x357f
leaq 0xa8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2a0c
leaq 0xa8(%rsp), %rdi
callq 0x374b
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x35e9
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x3600
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x3617
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0xa8(%rsp), %rdi
callq 0x2e84
xorl %eax, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x3679
jmp 0x3679
jmp 0x3679
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x369a
movq 0x78(%rsp), %rsi
incq %rsi
jmp 0x3695
jmp 0x3679
jmp 0x3679
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x36c8
movq 0x98(%rsp), %rsi
incq %rsi
jmp 0x36c3
jmp 0x3674
jmp 0x3680
movq %rax, %rbx
jmp 0x36c8
movq %rax, %rbx
jmp 0x369a
jmp 0x3680
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x369a
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x36b1
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x36c8
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0xa8(%rsp), %rdi
callq 0x2e84
movq %rbx, %rdi
callq 0x2290