// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
andl $0x0, 0xc(%rsp)
andl $0x0, 0x14(%rsp)
movq %rsi, %rbx
andl $0x0, 0x10(%rsp)
movl %edi, %ebp
andq $0x0, 0x38(%rsp)
leaq 0x1d6b(%rip), %r14      # 0x618b
leaq 0xb0(%rsp), %rdi
leaq 0x58(%rsp), %rdx
movq %r14, %rsi
callq 0x49d4
leaq 0xd0(%rsp), %rdi
leaq 0x58(%rsp), %rdx
movq %r14, %rsi
callq 0x49d4
leaq 0x40(%rsp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x1c2e(%rip), %rsi      # 0x6090
leaq 0x58(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x49d4
leaq 0x1c1a(%rip), %rsi      # 0x6092
leaq 0x18(%rsp), %rdi
leaq 0xa(%rsp), %rdx
callq 0x49d4
leaq 0x40(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0xc(%rsp), %rcx
callq 0x4a10
leaq 0x18(%rsp), %rdi
callq 0x3100
leaq 0x58(%rsp), %rdi
callq 0x3100
leaq 0x1be5(%rip), %rsi      # 0x60a0
leaq 0x58(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x49d4
leaq 0x1bd1(%rip), %rsi      # 0x60a2
leaq 0x18(%rsp), %rdi
leaq 0xa(%rsp), %rdx
callq 0x49d4
leaq 0x40(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x14(%rsp), %rcx
callq 0x4a10
leaq 0x18(%rsp), %rdi
callq 0x3100
leaq 0x58(%rsp), %rdi
callq 0x3100
leaq 0x1bb3(%rip), %rsi      # 0x60c7
leaq 0x58(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x49d4
leaq 0x1b9f(%rip), %rsi      # 0x60c9
leaq 0x18(%rsp), %rdi
leaq 0xa(%rsp), %rdx
callq 0x49d4
leaq 0x40(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x38(%rsp), %rcx
callq 0x4aa6
leaq 0x18(%rsp), %rdi
callq 0x3100
leaq 0x58(%rsp), %rdi
callq 0x3100
leaq 0x1b9e(%rip), %rsi      # 0x610b
leaq 0x58(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x49d4
leaq 0x1b8a(%rip), %rsi      # 0x610d
leaq 0x18(%rsp), %rdi
leaq 0xa(%rsp), %rdx
callq 0x49d4
leaq 0x40(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0x4a10
leaq 0x18(%rsp), %rdi
callq 0x3100
leaq 0x58(%rsp), %rdi
callq 0x3100
leaq 0x1b82(%rip), %rsi      # 0x6148
leaq 0x58(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x49d4
leaq 0x1b70(%rip), %rsi      # 0x614c
leaq 0x18(%rsp), %rdi
leaq 0xa(%rsp), %rdx
callq 0x49d4
leaq 0x40(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0xb0(%rsp), %rcx
callq 0x4b3c
leaq 0x18(%rsp), %rdi
callq 0x3100
leaq 0x58(%rsp), %rdi
callq 0x3100
leaq 0x1b40(%rip), %rsi      # 0x6162
leaq 0x58(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x49d4
leaq 0x1b2f(%rip), %rsi      # 0x6167
leaq 0x18(%rsp), %rdi
leaq 0xa(%rsp), %rdx
callq 0x49d4
leaq 0x40(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0xd0(%rsp), %rcx
callq 0x4b3c
leaq 0x18(%rsp), %rdi
callq 0x3100
leaq 0x58(%rsp), %rdi
callq 0x3100
leaq 0x40(%rsp), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x4ff0
movl 0xc(%rsp), %eax
testl %eax, %eax
je 0x4829
cmpl $0x0, 0x14(%rsp)
jne 0x46b2
cvtsi2sd %eax, %xmm0
callq 0x31d0
mulsd 0x19d6(%rip), %xmm0     # 0x6080
cvttsd2si %xmm0, %eax
movl %eax, 0x14(%rsp)
movsd 0x38(%rsp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x46dd
jp 0x46dd
cvtsi2sdl 0xc(%rsp), %xmm0
callq 0x31d0
mulsd 0x19b1(%rip), %xmm0     # 0x6088
movsd %xmm0, 0x38(%rsp)
cmpl $0x0, 0x10(%rsp)
jne 0x46ff
cvtsi2sdl 0xc(%rsp), %xmm0
callq 0x31d0
mulsd 0x1989(%rip), %xmm0     # 0x6080
cvttsd2si %xmm0, %eax
movl %eax, 0x10(%rsp)
leaq 0x1a85(%rip), %rsi      # 0x618b
leaq 0xd0(%rsp), %rdi
callq 0x4bd2
testb %al, %al
je 0x4733
leaq 0x1a6d(%rip), %rsi      # 0x618b
leaq 0xb0(%rsp), %rdi
callq 0x4bd2
testb %al, %al
jne 0x483e
pushq $0xa
popq %rdi
callq 0x32e0
movl 0xc(%rsp), %esi
leaq 0x58(%rsp), %rdi
callq 0x3e16
movl 0x14(%rsp), %esi
leaq 0x58(%rsp), %rdi
callq 0x3cd4
movsd 0x38(%rsp), %xmm0
leaq 0x58(%rsp), %rdi
movsd %xmm0, 0x10(%rdi)
cvtsi2sdl 0x10(%rsp), %xmm0
movsd %xmm0, 0x8(%rdi)
callq 0x48fb
leaq 0x1a0d(%rip), %rsi      # 0x618b
leaq 0xb0(%rsp), %rdi
callq 0x4bdf
testb %al, %al
je 0x47b6
leaq 0x110(%rsp), %rbx
leaq 0xb0(%rsp), %rsi
movq %rbx, %rdi
callq 0x32d0
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
callq 0x38ee
jmp 0x47db
leaq 0xf0(%rsp), %rbx
leaq 0xd0(%rsp), %rsi
movq %rbx, %rdi
callq 0x32d0
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
callq 0x3b60
movq %rbx, %rdi
callq 0x3100
leaq 0x58(%rsp), %rdi
callq 0x4967
leaq 0x58(%rsp), %rdi
callq 0x3e56
leaq 0x40(%rsp), %rdi
callq 0x542c
leaq 0xd0(%rsp), %rdi
callq 0x3100
leaq 0xb0(%rsp), %rdi
callq 0x3100
xorl %eax, %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r14
popq %rbp
retq
movq 0x47c0(%rip), %rdi      # 0x8ff0
leaq 0x1944(%rip), %rsi      # 0x617b
callq 0x3210
jmp 0x4851
movq 0x47ab(%rip), %rdi      # 0x8ff0
leaq 0x1940(%rip), %rsi      # 0x618c
callq 0x3210
pushq $0x1
popq %rdi
callq 0x3280
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
jmp 0x4871
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0x3100
jmp 0x48c5
jmp 0x48bd
jmp 0x4898
jmp 0x48a7
jmp 0x48bd
jmp 0x4898
jmp 0x48a7
jmp 0x48bd
jmp 0x4898
jmp 0x48a7
jmp 0x48bd
jmp 0x4898
jmp 0x48a7
jmp 0x48bd
jmp 0x4898
jmp 0x48a7
jmp 0x48bd
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3100
jmp 0x48aa
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3100
jmp 0x48cf
jmp 0x48bd
movq %rax, %rbx
jmp 0x48e6
movq %rax, %rbx
jmp 0x48cf
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3e56
leaq 0x40(%rsp), %rdi
callq 0x542c
leaq 0xd0(%rsp), %rdi
callq 0x3100
leaq 0xb0(%rsp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3370