// File: /workspace/github_cpp_makefile_star2_O3/Albuso0[P]entropy/main.cpp
// Function: main
int main(int argc, char *argv[])
{
    int k =0 , L = 0, N = 0;
    double M = 0;
    std::string fin = "", hist = "";
    
    std::CommandLine cmd;
    cmd.AddValue ("k",  "Alphabet size", k);
    cmd.AddValue ("L",  "Polynoimal degree. Default c0*log(k)", L);
    cmd.AddValue ("M",  "M/n is the right-end of approximation interval. Default c1*log(k)", M);
    cmd.AddValue ("N",  "Threshold to apply polynomial estimator. Default c2*log(k)", N);
    cmd.AddValue ("fin",  "fingerprint data file", fin);
    cmd.AddValue ("hist",  "histogram data file", hist);
    cmd.Parse (argc, argv);
    if( k == 0 ) { std::cerr<<"Please input k!\n"; exit(1); }
    if( L == 0 ) L = 1.6*log(k); // Default value
    if( M == 0 ) M = 3.5*log(k); // Default value
    if( N == 0 ) N = 1.6*log(k); // Default value
    if( (hist=="") && (fin=="") ) { std::cerr<<"Please input fingerprint or histogram!\n"; exit(1); }

    printf("\n");
    // Set estimator
    Entropy entropy( k );
    entropy.setDegree( L ); 
    entropy.setInterval( M ); 
    entropy.setThreshold( N ); 
    print_param(entropy);

    // Input fingerprint from file
    if ( fin!="")
        entropy.setFin(fin);
    else
        entropy.setHist(hist);
    print_results(entropy);
    
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rsi, %rbx
movl %edi, %ebp
xorl %eax, %eax
movl %eax, 0x4(%rsp)
movl %eax, 0xc(%rsp)
movl %eax, 0x8(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1ceb(%rip), %r14      # 0x619b
leaq 0xa8(%rsp), %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x4ed6
leaq 0xd8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xc8(%rsp), %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x4ed6
leaq 0x90(%rsp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
movq $0x0, 0x10(%rax)
leaq 0x48(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1b96(%rip), %rsi      # 0x60a0
leaq 0x1b90(%rip), %rdx      # 0x60a1
leaq 0x38(%rsp), %rdi
callq 0x4ed6
leaq 0x20(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x1b77(%rip), %rsi      # 0x60a2
leaq 0x1b7d(%rip), %rdx      # 0x60af
leaq 0x10(%rsp), %rdi
callq 0x4ed6
leaq 0x90(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x4(%rsp), %rcx
callq 0x4c4e
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x456f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x4586
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3230
leaq 0x38(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x1b1b(%rip), %rsi      # 0x60b0
leaq 0x1b15(%rip), %rdx      # 0x60b1
callq 0x4ed6
leaq 0x10(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x1b02(%rip), %rsi      # 0x60b2
leaq 0x1b1f(%rip), %rdx      # 0x60d6
callq 0x4ed6
leaq 0x90(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rcx
callq 0x4c4e
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x45ef
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x4606
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3230
leaq 0x38(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x1ac2(%rip), %rsi      # 0x60d7
leaq 0x1abc(%rip), %rdx      # 0x60d8
callq 0x4ed6
leaq 0x10(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x1aa9(%rip), %rsi      # 0x60d9
leaq 0x1ae3(%rip), %rdx      # 0x611a
callq 0x4ed6
leaq 0x90(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq 0x4cf4
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x466f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x4686
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3230
leaq 0x38(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x1a86(%rip), %rsi      # 0x611b
leaq 0x1a80(%rip), %rdx      # 0x611c
callq 0x4ed6
leaq 0x10(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x1a6d(%rip), %rsi      # 0x611d
leaq 0x1aa0(%rip), %rdx      # 0x6157
callq 0x4ed6
leaq 0x90(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x8(%rsp), %rcx
callq 0x4c4e
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x46ef
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x4706
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3230
leaq 0x38(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x1a43(%rip), %rsi      # 0x6158
leaq 0x1a3f(%rip), %rdx      # 0x615b
callq 0x4ed6
leaq 0x10(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x1a2c(%rip), %rsi      # 0x615c
leaq 0x1a3a(%rip), %rdx      # 0x6171
callq 0x4ed6
leaq 0x90(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0xa8(%rsp), %rcx
callq 0x4d9a
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x4772
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x4789
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3230
leaq 0x38(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x19da(%rip), %rsi      # 0x6172
leaq 0x19d7(%rip), %rdx      # 0x6176
callq 0x4ed6
leaq 0x10(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x19c4(%rip), %rsi      # 0x6177
leaq 0x19d0(%rip), %rdx      # 0x618a
callq 0x4ed6
leaq 0x90(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0xc8(%rsp), %rcx
callq 0x4d9a
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x47f5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x480c
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3230
leaq 0x90(%rsp), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x5344
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0x4a3f
cmpl $0x0, 0xc(%rsp)
jne 0x484a
cvtsi2sd %eax, %xmm0
callq 0x31d0
mulsd 0x184e(%rip), %xmm0     # 0x6090
cvttsd2si %xmm0, %eax
movl %eax, 0xc(%rsp)
movsd 0x30(%rsp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x4878
jp 0x4878
xorps %xmm0, %xmm0
cvtsi2sdl 0x4(%rsp), %xmm0
callq 0x31d0
mulsd 0x1826(%rip), %xmm0     # 0x6098
movsd %xmm0, 0x30(%rsp)
cmpl $0x0, 0x8(%rsp)
jne 0x489d
xorps %xmm0, %xmm0
cvtsi2sdl 0x4(%rsp), %xmm0
callq 0x31d0
mulsd 0x17fb(%rip), %xmm0     # 0x6090
cvttsd2si %xmm0, %eax
movl %eax, 0x8(%rsp)
leaq 0x18f7(%rip), %rsi      # 0x619b
leaq 0xc8(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0x48d1
leaq 0x18df(%rip), %rsi      # 0x619b
leaq 0xa8(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
je 0x4a54
movl $0xa, %edi
callq 0x32f0
movl 0x4(%rsp), %esi
leaq 0x38(%rsp), %rdi
callq 0x3fa6
movl 0xc(%rsp), %esi
leaq 0x38(%rsp), %rdi
callq 0x3e38
movsd 0x30(%rsp), %xmm0
leaq 0x38(%rsp), %rdi
movsd %xmm0, 0x10(%rdi)
xorps %xmm0, %xmm0
cvtsi2sdl 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rdi)
callq 0x4b71
leaq 0x187a(%rip), %rsi      # 0x619b
leaq 0xa8(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
je 0x497a
leaq 0x118(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x108(%rsp), %rdi
callq 0x4e40
leaq 0x38(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x39be
movq 0x108(%rsp), %rdi
jmp 0x49c0
leaq 0xf8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
addq %rsi, %rdx
leaq 0xe8(%rsp), %rdi
callq 0x4e40
leaq 0x38(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x3c90
movq 0xe8(%rsp), %rdi
cmpq %r14, %rdi
je 0x49d0
movq (%r14), %rsi
incq %rsi
callq 0x3230
leaq 0x38(%rsp), %rdi
callq 0x4bdf
leaq 0x38(%rsp), %rdi
callq 0x3fc4
leaq 0x90(%rsp), %rdi
callq 0x5998
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4a0e
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4a2b
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3230
xorl %eax, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x45aa(%rip), %rdi      # 0x8ff0
leaq 0x173e(%rip), %rsi      # 0x618b
callq 0x3210
jmp 0x4a67
movq 0x4595(%rip), %rdi      # 0x8ff0
leaq 0x173a(%rip), %rsi      # 0x619c
callq 0x3210
movl $0x1, %edi
callq 0x32a0
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
cmpq %r14, %rdi
je 0x4b18
movq 0xf8(%rsp), %rsi
jmp 0x4aa7
movq %rax, %rbx
movq 0x108(%rsp), %rdi
cmpq %r14, %rdi
je 0x4b18
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3230
jmp 0x4b18
jmp 0x4b10
jmp 0x4ad1
jmp 0x4aed
jmp 0x4b10
jmp 0x4ad1
jmp 0x4aed
jmp 0x4b10
jmp 0x4ad1
jmp 0x4aed
jmp 0x4b10
jmp 0x4ad1
jmp 0x4aed
jmp 0x4b10
jmp 0x4ad1
jmp 0x4aed
jmp 0x4b10
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x4af0
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3230
jmp 0x4af0
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x4b22
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3230
jmp 0x4b22
jmp 0x4b10
movq %rax, %rbx
jmp 0x4b4c
movq %rax, %rbx
jmp 0x4b22
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3fc4
leaq 0x90(%rsp), %rdi
callq 0x5998
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4b4c
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4b69
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3230
movq %rbx, %rdi
callq 0x33b0