// File: /workspace/github_cpp_makefile_star2_O2/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 0x68(%rsp), %rbx
movq %rbx, %rdi
movl $0x186a0, %esi          # imm = 0x186A0
callq 0x2ce6
pushq $0x12
popq %rsi
movq %rbx, %rdi
callq 0x2ba4
movaps 0xd8d(%rip), %xmm0      # 0x4080
leaq 0x68(%rsp), %rdi
movups %xmm0, 0x8(%rdi)
callq 0x3528
leaq 0xd88(%rip), %rsi       # 0x4090
leaq 0xe0(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x3600
leaq 0x68(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x27be
leaq 0xe0(%rsp), %rdi
callq 0x20d0
leaq 0x68(%rsp), %rdi
callq 0x3594
leaq 0x50(%rsp), %rdi
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
andq $0x0, 0x40(%rsp)
movaps %xmm0, (%rdi)
movaps %xmm0, 0x30(%rsp)
leaq 0x10(%rsp), %rsi
movl $0x1, (%rsi)
callq 0x3706
leaq 0x10(%rsp), %rsi
movl $0xb5e, (%rsi)          # imm = 0xB5E
leaq 0x30(%rsp), %rdi
callq 0x3706
leaq 0x10(%rsp), %rsi
movl $0x2, (%rsi)
leaq 0x50(%rsp), %rdi
callq 0x3706
leaq 0x10(%rsp), %rsi
movl $0x2d, (%rsi)
leaq 0x30(%rsp), %rdi
callq 0x3706
leaq 0x68(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x28a8
leaq 0x68(%rsp), %rdi
callq 0x3594
leaq 0xccd(%rip), %rsi       # 0x409f
leaq 0xc0(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x3600
leaq 0x68(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x2a30
leaq 0xc0(%rsp), %rdi
callq 0x20d0
leaq 0x68(%rsp), %rdi
callq 0x3594
leaq 0x10(%rsp), %rbx
andq $0x0, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
movl $0xb5e, %ebp            # imm = 0xB5E
leaq 0xc(%rsp), %r14
subl $0x1, %ebp
jb 0x3441
movl $0x1, 0xc(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3706
jmp 0x3427
pushq $0x2d
popq %rbp
leaq 0x10(%rsp), %rbx
leaq 0xc(%rsp), %r14
subl $0x1, %ebp
jb 0x3468
movl $0x2, 0xc(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3706
jmp 0x344e
leaq 0x68(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2936
leaq 0x68(%rsp), %rdi
callq 0x3594
leaq 0x10(%rsp), %rdi
callq 0x36d2
leaq 0x30(%rsp), %rdi
callq 0x36d2
leaq 0x50(%rsp), %rdi
callq 0x36d2
leaq 0x68(%rsp), %rdi
callq 0x2d26
xorl %eax, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x20d0
jmp 0x3502
jmp 0x34ee
jmp 0x34ee
jmp 0x34ee
jmp 0x34ee
jmp 0x34ee
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x20d0
jmp 0x3516
jmp 0x34e9
jmp 0x34f5
movq %rax, %rbx
jmp 0x3516
movq %rax, %rbx
jmp 0x3502
jmp 0x34f5
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x36d2
leaq 0x30(%rsp), %rdi
callq 0x36d2
leaq 0x50(%rsp), %rdi
callq 0x36d2
leaq 0x68(%rsp), %rdi
callq 0x2d26
movq %rbx, %rdi
callq 0x22a0