// File: /workspace/github_cpp_makefile_star2_O1/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 0x2e58
movq %rbx, %rdi
movl $0x12, %esi
callq 0x2ce8
movabsq $0x4044000000000000, %rax # imm = 0x4044000000000000
leaq 0xa8(%rsp), %rdi
movq %rax, 0x10(%rdi)
movabsq $0x4032000000000000, %rax # imm = 0x4032000000000000
movq %rax, 0x8(%rdi)
callq 0x36fc
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xd01(%rip), %rsi       # 0x408a
leaq 0xd08(%rip), %rdx       # 0x4098
leaq 0x88(%rsp), %rdi
callq 0x37d8
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x287c
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x33cf
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0xa8(%rsp), %rdi
callq 0x376a
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
xorl %eax, %eax
movq %rax, 0x60(%rsp)
movq %rax, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movl $0x1, 0x10(%rsp)
movq 0x58(%rsp), %rsi
testq %rsi, %rsi
je 0x3418
movl $0x1, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x58(%rsp)
jmp 0x3427
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x3868
movl $0xb5e, 0x10(%rsp)      # imm = 0xB5E
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x344c
movl $0xb5e, (%rsi)          # imm = 0xB5E
addq $0x4, %rsi
movq %rsi, 0x38(%rsp)
jmp 0x345b
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x3868
movl $0x2, 0x10(%rsp)
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0x3480
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x58(%rsp)
jmp 0x348f
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x3868
movl $0x2d, 0x10(%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x34b4
movl $0x2d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x38(%rsp)
jmp 0x34c3
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x3868
leaq 0xa8(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x296c
leaq 0xa8(%rsp), %rdi
callq 0x376a
leaq 0x78(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xba2(%rip), %rsi       # 0x4099
leaq 0xbaa(%rip), %rdx       # 0x40a8
leaq 0x68(%rsp), %rdi
callq 0x37d8
leaq 0xa8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x2b44
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x3531
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21a0
leaq 0xa8(%rsp), %rdi
callq 0x376a
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 0x3580
movl $0x1, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x358b
movq %rbx, %rdi
movq %r14, %rdx
callq 0x3868
decl %ebp
jne 0x355b
movl $0x2d, %ebp
leaq 0x10(%rsp), %rbx
leaq 0xc(%rsp), %r14
movl $0x2, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x35c3
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x35ce
movq %rbx, %rdi
movq %r14, %rdx
callq 0x3868
decl %ebp
jne 0x359e
leaq 0xa8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2a0a
leaq 0xa8(%rsp), %rdi
callq 0x376a
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3608
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x361f
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x3636
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0xa8(%rsp), %rdi
callq 0x2e76
xorl %eax, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x3698
jmp 0x3698
jmp 0x3698
jmp 0x3698
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x36b9
movq 0x78(%rsp), %rsi
incq %rsi
jmp 0x36b4
jmp 0x3698
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x36e7
movq 0x98(%rsp), %rsi
incq %rsi
jmp 0x36e2
jmp 0x3693
jmp 0x369f
movq %rax, %rbx
jmp 0x36e7
movq %rax, %rbx
jmp 0x36b9
jmp 0x369f
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x36b9
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x36d0
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x36e7
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0xa8(%rsp), %rdi
callq 0x2e76
movq %rbx, %rdi
callq 0x2290