// File: /workspace/github_cpp_makefile_star2_O2/ALSchwalm[P]entrospy/entrospy/entrospy.cpp
// Function: main
int main(int argc, char** argv) {
    po::options_description desc("Usage: entrospy [OPTION] PATH...", 100);

    PrintingPolicy policy;
    DataFormat format;
    std::vector<std::string> paths;

    desc.add_options()                    //
        ("help,h", "Print help messages") //
        ("paths", po::value<std::vector<std::string>>(&paths),
         "Paths to search")                  //
        ("debug", "Enable debugging output") //
        ("all,a",
         "Do not ignore hidden files and directories") //
        ("block,b", po::value<std::string>(),
         "Process each file 'block' at a time. This will show the"
         " entropy for each block rather than the total file. The provided"
         " argument will be interpreted as a byte count unless suffixed"
         " with 'K', 'M', or 'G' for kilo, mega, and giga-bytes "
         "respectively") //
        ("categorize,c",
         "Show a categorization based on entropy in addition to the score") //
        ("print,p", "Print a hex view of each block")                       //
        ("addr", po::value<AddressFormat>(&policy.addr_format)
                     ->default_value(AddressFormat::HEX, "hex"),
         "Format to use for printed addresses: 'hex' or 'dec'") //
        ("lower,l", po::value<double>(&policy.bounds.first),
         "Do not show files with entropy lower than 'lower'") //
        ("upper,u", po::value<double>(&policy.bounds.second),
         "Do not show files with entropy higher than 'upper'") //
        ("format,f", po::value<DataFormat>(&format)
                         ->default_value(DataFormat::DATA, "data"),
         "Input format: 'data','text' or 'base64'") //
        ("graph,g",
         "Output a gnuplot script to standard out") //
        ("recursive,r",
         "Run directories in PATH recursively"); //

    po::positional_options_description p;
    p.add("paths", -1);

    po::variables_map vm;

    try {
        po::store(po::command_line_parser(argc, argv)
                      .options(desc)
                      .positional(p)
                      .run(),
                  vm);

        if (vm.count("help")) {
            std::cout << desc << std::endl;
            return 0;
        }

        po::notify(vm);
    } catch (po::error& e) {
        std::cerr << "entrospy: " << e.what() << std::endl;
        return EXIT_FAILURE;
    }

    uint64_t block_size = 0;
    if (vm.count("block")) {
        block_size = parse_block_size(vm["block"].as<std::string>());
    }

    if (vm.count("print")) {
        if (!vm.count("block")) {
            std::cerr << "entrospy: cannot specify 'print' without 'block'"
                      << std::endl;
            return EXIT_FAILURE;
        } else {
            policy.print_blocks = true;
        }
    }

    if (vm.count("graph")) {
        policy.print_graph = true;
    }

    if (vm.count("categorize")) {
        policy.categorize = true;
    }

    auto title = boost::format("Entropy for %1% (bs=%2%)") %
                 boost::algorithm::join(paths, ", ") % block_size;

    EntropyGraph graph{boost::str(title), block_size, policy};
    for (const auto& path : paths) {
        if (fs::is_directory(path)) {
            if (!vm.count("recursive")) {
                std::cerr << "entrospy: " << path << ": Is a directory"
                          << std::endl;
                continue;
            } else {
                for (fs::recursive_directory_iterator iter(path), end;
                     iter != end; ++iter) {
                    if (fs::is_directory(iter->path())) {
                        if (is_hidden(iter->path()) && !vm.count("all")) {
                            iter.no_push();
                        }
                        continue;
                    }
                    if (!is_hidden(iter->path()) || vm.count("all")) {
                        shannon_file(iter->path().string(), block_size, policy,
                                     format, graph);
                    }
                }
            }
        } else {
            shannon_file(path, block_size, policy, format, graph);
        }
    }

    if (policy.print_graph) {
        std::cout << graph;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3a8, %rsp            # imm = 0x3A8
movq %rsi, %rbx
movl %edi, %ebp
leaq 0xc6df(%rip), %rsi      # 0x1522d
leaq 0x90(%rsp), %rdi
leaq 0x1a8(%rsp), %rdx
callq 0x8150
movq 0x19426(%rip), %rax     # 0x21f90
movl (%rax), %ecx
shrl %ecx
leaq 0x328(%rsp), %rdi
leaq 0x90(%rsp), %rsi
pushq $0x64
popq %rdx
callq 0x8570
leaq 0x90(%rsp), %rdi
callq 0x87d8
andw $0x0, 0x40(%rsp)
movb $0x0, 0x42(%rsp)
movaps 0xc50b(%rip), %xmm0     # 0x150b0
movups %xmm0, 0x48(%rsp)
andl $0x0, 0x58(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
andq $0x0, 0x80(%rsp)
leaq 0x328(%rsp), %rdi
callq 0x8460
leaq 0x288(%rsp), %rdi
movq %rax, (%rdi)
leaq 0xc66f(%rip), %rsi      # 0x1524e
leaq 0xc66f(%rip), %rdx      # 0x15255
callq 0x8730
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0x9684
leaq 0xc66a(%rip), %rsi      # 0x15269
leaq 0xc669(%rip), %rcx      # 0x1526f
movq %r14, %rdi
movq %rax, %rdx
callq 0x8790
leaq 0xc667(%rip), %rsi      # 0x1527f
leaq 0xc666(%rip), %rdx      # 0x15285
movq %rax, %rdi
callq 0x8730
leaq 0xc66f(%rip), %rsi      # 0x1529d
leaq 0xc66e(%rip), %rdx      # 0x152a3
movq %rax, %rdi
callq 0x8730
movq %rax, %r14
callq 0x96c1
leaq 0xc682(%rip), %rsi      # 0x152ce
leaq 0xc683(%rip), %rcx      # 0x152d6
movq %r14, %rdi
movq %rax, %rdx
callq 0x8790
leaq 0xc768(%rip), %rsi      # 0x153cd
leaq 0xc76e(%rip), %rdx      # 0x153da
movq %rax, %rdi
callq 0x8730
leaq 0xc79f(%rip), %rsi      # 0x1541a
leaq 0xc7a0(%rip), %rdx      # 0x15422
movq %rax, %rdi
callq 0x8730
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0x96c8
movq %rax, %r15
movl $0x1, 0x170(%rsp)
leaq 0xc79a(%rip), %rsi      # 0x15446
leaq 0x90(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x8150
leaq 0x170(%rsp), %rsi
leaq 0x90(%rsp), %rdx
movq %r15, %rdi
callq 0x9706
leaq 0xc764(%rip), %rsi      # 0x15441
leaq 0xc766(%rip), %rcx      # 0x1544a
movq %r14, %rdi
movq %rax, %rdx
callq 0x8790
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x9765
leaq 0xc77b(%rip), %rsi      # 0x1547e
leaq 0xc77c(%rip), %rcx      # 0x15486
movq %r14, %rdi
movq %rax, %rdx
callq 0x8790
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x9765
leaq 0xc78f(%rip), %rsi      # 0x154b8
leaq 0xc790(%rip), %rcx      # 0x154c0
movq %r14, %rdi
movq %rax, %rdx
callq 0x8790
movq %rax, %r14
leaq 0x1c(%rsp), %rdi
callq 0x97a2
movq %rax, %r15
movl $0x100, 0x20(%rsp)      # imm = 0x100
leaq 0xc7a2(%rip), %rsi      # 0x154fc
leaq 0x1a8(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x8150
leaq 0x20(%rsp), %rsi
leaq 0x1a8(%rsp), %rdx
movq %r15, %rdi
callq 0x97e0
leaq 0xc76b(%rip), %rsi      # 0x154f3
leaq 0xc772(%rip), %rcx      # 0x15501
movq %r14, %rdi
movq %rax, %rdx
callq 0x8790
leaq 0xc788(%rip), %rsi      # 0x15529
leaq 0xc789(%rip), %rdx      # 0x15531
movq %rax, %rdi
callq 0x8730
leaq 0xc7a2(%rip), %rsi      # 0x15559
leaq 0xc7a7(%rip), %rdx      # 0x15565
movq %rax, %rdi
callq 0x8730
leaq 0x1a8(%rsp), %rdi
callq 0x87d8
leaq 0x90(%rsp), %rdi
callq 0x87d8
leaq 0x170(%rsp), %rdi
callq 0x84f0
leaq 0xc475(%rip), %rsi      # 0x15269
leaq 0x170(%rsp), %rdi
pushq $-0x1
popq %rdx
callq 0x83f0
leaq 0x288(%rsp), %rdi
callq 0x8190
leaq 0x90(%rsp), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x9840
leaq 0x90(%rsp), %rdi
leaq 0x328(%rsp), %rsi
callq 0x98d0
movq %rax, %rbx
leaq 0x170(%rsp), %rsi
movq %rax, %rdi
callq 0x8680
leaq 0x1a8(%rsp), %rdi
movq %rbx, %rsi
callq 0x98ee
leaq 0x1a8(%rsp), %rdi
leaq 0x288(%rsp), %rsi
xorl %edx, %edx
callq 0x86e0
leaq 0x1a8(%rsp), %rdi
callq 0x9df6
leaq 0x90(%rsp), %rdi
callq 0x997c
leaq 0xc6f6(%rip), %rsi      # 0x15589
leaq 0x90(%rsp), %rdi
leaq 0x1a8(%rsp), %rdx
callq 0x8150
leaq 0x298(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x999c
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x87d8
testq %rbx, %rbx
je 0x8ef5
movq 0x190d7(%rip), %rdi     # 0x21fb0
leaq 0x328(%rsp), %rsi
callq 0x8090
xorl %ebx, %ebx
movq %rax, %rdi
callq 0x81c0
jmp 0x93e5
leaq 0x288(%rsp), %rdi
callq 0x8230
andq $0x0, 0x10(%rsp)
leaq 0xc52c(%rip), %rsi      # 0x1543b
leaq 0x90(%rsp), %rdi
leaq 0x1a8(%rsp), %rdx
callq 0x8150
leaq 0x90(%rsp), %rsi
leaq 0x298(%rsp), %rdi
callq 0x999c
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x87d8
testq %rbx, %rbx
je 0x8fa1
leaq 0xc4e6(%rip), %rsi      # 0x1543b
leaq 0x90(%rsp), %rdi
leaq 0x1a8(%rsp), %rdx
callq 0x8150
leaq 0x288(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x8410
movq %rax, %rdi
callq 0xf3fc
movq %rax, %rdi
callq 0x8a90
movq %rax, 0x10(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x87d8
leaq 0xc5f1(%rip), %rsi      # 0x15599
leaq 0x90(%rsp), %rdi
leaq 0x1a8(%rsp), %rdx
callq 0x8150
leaq 0x90(%rsp), %rsi
leaq 0x298(%rsp), %rdi
callq 0x999c
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x87d8
testq %rbx, %rbx
je 0x9036
leaq 0xc44d(%rip), %rsi      # 0x1543b
leaq 0x90(%rsp), %rdi
leaq 0x1a8(%rsp), %rdx
callq 0x8150
leaq 0x90(%rsp), %rsi
leaq 0x298(%rsp), %rdi
callq 0x999c
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x87d8
testq %rbx, %rbx
je 0x93c7
movb $0x1, 0x40(%rsp)
leaq 0xc593(%rip), %rsi      # 0x155d0
leaq 0x90(%rsp), %rdi
leaq 0x1a8(%rsp), %rdx
callq 0x8150
leaq 0x90(%rsp), %rsi
leaq 0x298(%rsp), %rdi
callq 0x999c
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x87d8
testq %rbx, %rbx
je 0x9081
movb $0x1, 0x41(%rsp)
leaq 0xc54e(%rip), %rsi      # 0x155d6
leaq 0x90(%rsp), %rdi
leaq 0x1a8(%rsp), %rdx
callq 0x8150
leaq 0x90(%rsp), %rsi
leaq 0x298(%rsp), %rdi
callq 0x999c
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x87d8
testq %rbx, %rbx
je 0x90cc
movb $0x1, 0x42(%rsp)
leaq 0xc50e(%rip), %rsi      # 0x155e1
leaq 0x1a8(%rsp), %rdi
callq 0x99b6
leaq 0xc513(%rip), %rdx      # 0x155fa
leaq 0x20(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x9aa2
leaq 0x1a8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x1156b
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x122f0
leaq 0x90(%rsp), %rdi
movq %rax, %rsi
callq 0x9b52
leaq 0x20(%rsp), %rdi
callq 0x87d8
leaq 0x1a8(%rsp), %rdi
callq 0x9c02
leaq 0x20(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x124e8
movq 0x10(%rsp), %rdx
leaq 0x1a8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rcx
callq 0x12994
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x87d8
movq 0x70(%rsp), %r15
movq 0x78(%rsp), %rax
movq %rax, 0x88(%rsp)
leaq 0x68(%rsp), %r13
leaq 0x60(%rsp), %rbp
leaq 0xf(%rsp), %rbx
cmpq 0x88(%rsp), %r15
je 0x938e
movq %r14, %rdi
movq %r15, %rsi
callq 0x8540
movq %r14, %rdi
callq 0x9c36
movl %eax, %r12d
movq %r14, %rdi
callq 0x87d8
testb %r12b, %r12b
je 0x931e
movq %r14, %rdi
leaq 0xc426(%rip), %rsi      # 0x155fd
movq %r13, %rdx
callq 0x8150
leaq 0x298(%rsp), %rdi
movq %r14, %rsi
callq 0x999c
movq %rax, %r12
movq %r14, %rdi
callq 0x87d8
testq %r12, %r12
je 0x9350
movq %r14, %rdi
movq %r15, %rsi
callq 0x8540
movq %r13, %rdi
movq %r14, %rsi
callq 0x9c5a
movq %r14, %rdi
callq 0x87d8
andq $0x0, 0x60(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x9c89
testb %al, %al
je 0x933e
movq %r13, %rdi
callq 0x128d2
movq %rax, %rdi
callq 0x9c36
testb %al, %al
je 0x92a5
movq %r13, %rdi
callq 0x128d2
movq %rax, %rdi
callq 0x8a3c
testb %al, %al
je 0x9311
movq %r14, %rdi
leaq 0xc3a8(%rip), %rsi      # 0x15618
movq %rbx, %rdx
callq 0x8150
leaq 0x298(%rsp), %rdi
movq %r14, %rsi
callq 0x999c
movq %rax, %r12
movq %r14, %rdi
callq 0x87d8
testq %r12, %r12
jne 0x9311
movq %r13, %rdi
pushq $0x1
popq %rsi
callq 0xa4b8
jmp 0x9311
movq %r13, %rdi
callq 0x128d2
movq %rax, %rdi
callq 0x8a3c
testb %al, %al
je 0x92eb
movq %r14, %rdi
leaq 0xc355(%rip), %rsi      # 0x15618
movq %rbx, %rdx
callq 0x8150
leaq 0x298(%rsp), %rdi
movq %r14, %rsi
callq 0x999c
movq %rax, %r12
movq %r14, %rdi
callq 0x87d8
testq %r12, %r12
je 0x9311
movq %r13, %rdi
callq 0x128d2
movq 0x10(%rsp), %rsi
movl 0x1c(%rsp), %ecx
movq %rax, %rdi
leaq 0x40(%rsp), %rdx
leaq 0x1a8(%rsp), %r8
callq 0x13b06
movq %r13, %rdi
callq 0x128ca
jmp 0x9227
movq 0x10(%rsp), %rsi
movl 0x1c(%rsp), %ecx
movq %r15, %rdi
leaq 0x40(%rsp), %rdx
leaq 0x1a8(%rsp), %r8
callq 0x13b06
jmp 0x9385
movq %rbp, %rdi
callq 0xa3f4
movq %r13, %rdi
callq 0xa3f4
jmp 0x9385
movq 0x18c91(%rip), %rdi     # 0x21fe8
leaq 0xc230(%rip), %rsi      # 0x1558e
callq 0x83b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x8360
movq %rax, %rdi
leaq 0xc28f(%rip), %rsi      # 0x15607
callq 0x83b0
movq %rax, %rdi
callq 0x81c0
addq $0x20, %r15
jmp 0x9198
cmpb $0x0, 0x41(%rsp)
je 0x93a9
movq 0x18c14(%rip), %rdi     # 0x21fb0
leaq 0x1a8(%rsp), %rsi
callq 0x12a1a
leaq 0x1a8(%rsp), %rdi
callq 0x9c94
leaq 0x90(%rsp), %rdi
callq 0x9c02
xorl %ebx, %ebx
jmp 0x93e5
movq 0x18c1a(%rip), %rdi     # 0x21fe8
leaq 0xc1ca(%rip), %rsi      # 0x1559f
callq 0x83b0
movq %rax, %rdi
callq 0x81c0
pushq $0x1
popq %rbx
leaq 0x288(%rsp), %rdi
callq 0x9caa
leaq 0x170(%rsp), %rdi
callq 0x9cdc
leaq 0x70(%rsp), %rdi
callq 0x9cf2
leaq 0x328(%rsp), %rdi
callq 0x9d14
movl %ebx, %eax
addq $0x3a8, %rsp            # imm = 0x3A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x95cf
jmp 0x9466
jmp 0x946e
jmp 0x9466
jmp 0x9466
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x87d8
jmp 0x960d
movq %rax, %rbx
jmp 0x960d
movq %rax, %rbx
jmp 0x9490
jmp 0x9466
jmp 0x946e
jmp 0x9466
jmp 0x946e
jmp 0x9466
jmp 0x946e
jmp 0x9466
jmp 0x946e
movq %rax, %rbx
jmp 0x961a
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x87d8
jmp 0x961a
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x87d8
leaq 0x1a8(%rsp), %rdi
jmp 0x9615
movq %rdx, %r14
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x87d8
jmp 0x9526
jmp 0x9501
movq %rdx, %r14
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
callq 0x9df6
jmp 0x9519
jmp 0x9501
jmp 0x94cd
movq %rax, %rbx
jmp 0x9627
jmp 0x95ca
jmp 0x95a7
jmp 0x95ca
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x87d8
jmp 0x964b
movq %rax, %rbx
jmp 0x964b
movq %rdx, %r14
movq %rax, %rbx
jmp 0x9526
jmp 0x95cf
jmp 0x95b9
movq %rdx, %r14
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x997c
cmpl $0x1, %r14d
jne 0x961a
movq %rbx, %rdi
callq 0x8160
movq %rax, %rbx
movq 0x18aa6(%rip), %rdi     # 0x21fe8
leaq 0xc045(%rip), %rsi      # 0x1558e
callq 0x83b0
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x83b0
movq %rax, %rdi
callq 0x81c0
callq 0x8660
jmp 0x93e2
jmp 0x9466
movq %rax, %rbx
callq 0x8660
jmp 0x961a
movq %rax, %rdi
callq 0x9653
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
callq 0x87d8
jmp 0x95aa
jmp 0x95cf
jmp 0x95b9
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x87d8
jmp 0x9634
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x87d8
jmp 0x9600
jmp 0x95cf
movq %rax, %rbx
jmp 0x9634
movq %rax, %rbx
jmp 0x9600
jmp 0x95e9
jmp 0x95da
jmp 0x95e9
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x87d8
jmp 0x95ec
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0xa3f4
leaq 0x68(%rsp), %rdi
callq 0xa3f4
leaq 0x1a8(%rsp), %rdi
callq 0x9c94
leaq 0x90(%rsp), %rdi
callq 0x9c02
leaq 0x288(%rsp), %rdi
callq 0x9caa
leaq 0x170(%rsp), %rdi
callq 0x9cdc
leaq 0x70(%rsp), %rdi
callq 0x9cf2
leaq 0x328(%rsp), %rdi
callq 0x9d14
movq %rbx, %rdi
callq 0x86f0