LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/ALSchwalm[P]cppEvolve/include/cppEvolve/Genome/Tree/Tree.hpp
// Function: void evolve::tree::TreeFactory<int>::addNode<int, int>(int (*)(int, int), std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void addNode(Rtype (*f)(T...), const std::string& name) {
        static_assert(sizeof...(T) > 0,
                      "Node function with 0 arguments should be terminator");
        const auto val = currentID;

        // explicitly capture to avoid bug in gcc
        std::function<BaseNode<Rtype>*()> func = [f, name, val]() {
            return new Node<std::function<Rtype(T...)>>(f, name, val);
        };
        nodes[currentID++] = func;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movl 0x4(%rdi), %r15d
leaq -0x60(%rbp), %rdi
movq %rsi, -0x8(%rdi)
leaq -0x50(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
callq 0x3ea6
movl %r15d, 0x10(%r14)
leaq -0x38(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x3d6c
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x2a88
callq 0x2140
leaq 0x8(%rbx), %rdi
movl 0x4(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x4(%rbx)
leaq -0x68(%rbp), %rsi
movl %eax, (%rsi)
callq 0x3dca
leaq -0x38(%rbp), %rsi
movq %rax, %rdi
callq 0x3e32
movq -0x28(%rbp), %rax
testq %rax, %rax
je 0x2ac3
leaq -0x38(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2b05
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x2afd
callq 0x2140
jmp 0x2afd
movq %rax, %rbx
movq -0x28(%rbp), %rax
testq %rax, %rax
je 0x2afd
leaq -0x38(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq %rbx, %rdi
callq 0x21f0
movq %rax, %rdi
callq 0x3603
nop
// File: /workspace/github_cpp_makefile_star2_O1/ALSchwalm[P]cppEvolve/include/cppEvolve/Genome/Tree/Tree.hpp
// Function: evolve::tree::TreeFactory<int>::addTerminator(int (*)(), std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void addTerminator(Rtype (*f)(), const std::string& name) {
        const auto val = currentID;
        std::function<BaseNode<Rtype>*()> func = [f, name, val]() {
            return new Terminator<std::function<Rtype()>>(f, name, val);
        };
        terminators[currentID++] = func;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movl 0x4(%rdi), %r15d
leaq -0x60(%rbp), %rdi
movq %rsi, -0x8(%rdi)
leaq -0x50(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
callq 0x3ea6
movl %r15d, 0x10(%r14)
leaq -0x38(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x4f80
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x2c38
callq 0x2140
leaq 0x38(%rbx), %rdi
movl 0x4(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x4(%rbx)
leaq -0x68(%rbp), %rsi
movl %eax, (%rsi)
callq 0x3dca
leaq -0x38(%rbp), %rsi
movq %rax, %rdi
callq 0x3e32
movq -0x28(%rbp), %rax
testq %rax, %rax
je 0x2c73
leaq -0x38(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2cb5
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r14, %rdi
je 0x2cad
callq 0x2140
jmp 0x2cad
movq %rax, %rbx
movq -0x28(%rbp), %rax
testq %rax, %rax
je 0x2cad
leaq -0x38(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq %rbx, %rdi
callq 0x21f0
movq %rax, %rdi
callq 0x3603
// File: /workspace/github_cpp_makefile_star2_O1/ALSchwalm[P]cppEvolve/include/cppEvolve/Genome/Tree/Crossover.hpp
// Function: evolve::tree::Tree<int>* evolve::tree::crossover::singlePoint<int>(evolve::tree::Tree<int> const*, evolve::tree::Tree<int> const*)
Tree<T>* singlePoint(const Tree<T>* left, const Tree<T>* right) {
    auto tree = left->clone(); // Copy left

    auto treeDepth = right->getDepth();
    auto depth = utils::random_uint(treeDepth);

    auto sourceNode = right->root; // Crossover from the right to the left
    BaseNode<T>* prevSourceNode = nullptr;

    for (unsigned int i = 0; i < depth; ++i) {
        if (sourceNode->getChildren().empty()) {
            sourceNode = prevSourceNode; // Do not copy terminators
            break;
        }
        prevSourceNode = sourceNode;
        sourceNode = sourceNode->getChildren()[utils::random_uint(
            sourceNode->getChildren().size())];
    }

    auto currentNode = tree->root;
    BaseNode<T>* prevNode = nullptr;

    for (unsigned int i = 0; i < depth; ++i) {
        prevNode = currentNode;
        auto nextNodeLocation =
            utils::random_uint(currentNode->getChildren().size());
        currentNode = currentNode->getChildren()[nextNodeLocation];

        if (sourceNode->getDepth() == currentNode->getDepth()) {
            auto& children = prevNode->getChildren();
            delete currentNode;
            children[nextNodeLocation] = sourceNode->clone();
            break;
        } else if (currentNode->getChildren().empty()) {
            break; // This point should never be reached
        }
    }

    return tree;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
callq 0x5496
movq %rax, -0x40(%rbp)
movq (%r15), %rdi
callq 0x54d4
movl %eax, %esi
xorl %edi, %edi
callq 0x23cc
movq (%r15), %rdx
movq %rax, -0x38(%rbp)
testq %rax, %rax
je 0x2d3f
movq 0x8(%rdx), %rcx
movq 0x10(%rdx), %rsi
cmpq %rsi, %rcx
je 0x2d45
movl $0x1, %ebx
movq %rdx, %r14
subq %rcx, %rsi
sarq $0x3, %rsi
xorl %edi, %edi
callq 0x23cc
movq %r14, -0x30(%rbp)
movq 0x8(%r14), %rcx
movq (%rcx,%rax,8), %rdx
movl %ebx, %ecx
cmpq %rcx, -0x38(%rbp)
jbe 0x2d3f
movq 0x8(%rdx), %rcx
movq 0x10(%rdx), %rsi
incl %ebx
cmpq %rsi, %rcx
jne 0x2d09
jmp 0x2d4d
movq %rdx, -0x30(%rbp)
jmp 0x2d4d
movq $0x0, -0x30(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x2dcf
movq -0x40(%rbp), %rax
movq (%rax), %r14
movl $0x1, %r15d
movq 0x10(%r14), %rsi
subq 0x8(%r14), %rsi
sarq $0x3, %rsi
xorl %edi, %edi
callq 0x23cc
movq %rax, %r13
movq 0x8(%r14), %rax
movq (%rax,%r13,8), %r12
movq -0x30(%rbp), %rdi
callq 0x54d4
movl %eax, %ebx
movq %r12, %rdi
callq 0x54d4
cmpl %eax, %ebx
je 0x2db3
movq 0x8(%r12), %rax
cmpq 0x10(%r12), %rax
je 0x2dcf
movl %r15d, %eax
incl %r15d
movq %r12, %r14
cmpq %rax, -0x38(%rbp)
ja 0x2d61
jmp 0x2dcf
movq (%r12), %rax
movq %r12, %rdi
callq *0x8(%rax)
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x8(%r14), %rcx
movq %rax, (%rcx,%r13,8)
movq -0x40(%rbp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ALSchwalm[P]cppEvolve/include/cppEvolve/Genome/Tree/Mutator.hpp
// Function: void evolve::tree::mutator::randomNode<int>(evolve::tree::Tree<int>*, evolve::tree::TreeFactory<int> const&)
void randomNode(Tree<T>* tree, const TreeFactory<T>& factory) {
    auto treeDepth = tree->getDepth();
    auto depth = utils::random_uint(treeDepth);

    auto currentNode = tree->root;
    BaseNode<T>* prevNode = nullptr;

    for (unsigned int i = 0; i < depth; ++i) {
        prevNode = currentNode;
        auto nodeLocation =
            utils::random_uint(currentNode->getChildren().size());
        currentNode = currentNode->getChildren()[nodeLocation];

        if (currentNode->getChildren().empty()) {
            auto& children = prevNode->getChildren();
            delete currentNode;
            children[nodeLocation] = factory.createRandomTerminator();
            return;
        }
    }

    auto childValue = utils::random_uint(currentNode->getChildren().size());
    auto nodeDepth = currentNode->getChildren()[childValue]->getDepth();
    delete currentNode->getChildren()[childValue];

    currentNode->getChildren()[childValue] =
        factory.createRandomSubTree(nodeDepth - 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rdi
callq 0x54d4
movl %eax, %esi
xorl %edi, %edi
callq 0x23cc
movq (%r15), %r13
movq %rax, -0x38(%rbp)
testq %rax, %rax
setne %bl
je 0x2eaf
movq 0x10(%r13), %rsi
subq 0x8(%r13), %rsi
sarq $0x3, %rsi
xorl %edi, %edi
callq 0x23cc
movq %rax, %r12
movq 0x8(%r13), %rax
movq (%rax,%r12,8), %r15
movq 0x8(%r15), %rax
cmpq 0x10(%r15), %rax
je 0x2e8d
movq %r14, -0x30(%rbp)
movl $0x1, %r14d
movq %r15, %r13
movl %r14d, %eax
cmpq %rax, -0x38(%rbp)
seta %bl
jbe 0x2eab
movq 0x10(%r13), %rsi
subq 0x8(%r13), %rsi
sarq $0x3, %rsi
xorl %edi, %edi
callq 0x23cc
movq %rax, %r12
movq 0x8(%r13), %rax
movq (%rax,%r12,8), %r15
movq 0x8(%r15), %rax
incl %r14d
cmpq 0x10(%r15), %rax
jne 0x2e4f
movq -0x30(%rbp), %r14
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
movq %r14, %rdi
callq 0x5552
movq 0x8(%r13), %rcx
movq %rax, (%rcx,%r12,8)
movq %r15, %r13
jmp 0x2eaf
movq -0x30(%rbp), %r14
testb %bl, %bl
jne 0x2f05
movq %r14, %rbx
movq 0x10(%r13), %rsi
subq 0x8(%r13), %rsi
sarq $0x3, %rsi
xorl %edi, %edi
callq 0x23cc
movq %rax, %r14
movq 0x8(%r13), %rax
movq (%rax,%r14,8), %rdi
callq 0x54d4
movl %eax, %r15d
movq 0x8(%r13), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x2eef
movq (%rdi), %rax
callq *0x8(%rax)
decl %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x55ac
movq 0x8(%r13), %rcx
movq %rax, (%rcx,%r14,8)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ALSchwalm[P]cppEvolve/include/cppEvolve/Genome/Tree/Tree.hpp
// Function: evolve::tree::Node<std::function<int (int, int)>>::clone() const
virtual BaseNode<typename Genome::result_type>* clone() const {
        auto node = new Node<Genome>(val, this->name, this->ID);
        for (auto child : this->children) {
            node->children.push_back(child->clone());
        }
        return node;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movl $0x68, %edi
callq 0x2160
movq %rax, %rbx
leaq 0x48(%r14), %rsi
leaq -0x50(%rbp), %rdi
callq 0x4182
leaq 0x20(%r14), %rdx
movl 0x40(%r14), %ecx
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x4094
movq -0x40(%rbp), %rax
testq %rax, %rax
je 0x431b
leaq -0x50(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x8(%r14), %r12
movq 0x10(%r14), %r13
cmpq %r13, %r12
je 0x4369
movq %rbx, %r14
addq $0x8, %r14
leaq -0x30(%rbp), %r15
movq (%r12), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, -0x30(%rbp)
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x4355
movq %rax, (%rsi)
addq $0x8, 0x10(%rbx)
jmp 0x4360
movq %r14, %rdi
movq %r15, %rdx
callq 0x452a
addq $0x8, %r12
cmpq %r13, %r12
jne 0x4333
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4399
movq %rax, %r14
movq -0x40(%rbp), %rax
testq %rax, %rax
je 0x43a4
leaq -0x50(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x43a4
movq %rax, %rdi
callq 0x3603
movq %rax, %r14
movq %rbx, %rdi
callq 0x2140
movq %r14, %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O1/ALSchwalm[P]cppEvolve/include/cppEvolve/Genome/Tree/Tree.hpp
// Function: evolve::tree::Terminator<std::function<int ()>>::clone() const
virtual BaseNode<typename Genome::result_type>* clone() const {
        auto node = new Terminator<Genome>(val, this->name, this->ID);
        for (auto child : this->children) {
            node->children.push_back(child->clone());
        }
        return node;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movl $0x68, %edi
callq 0x2160
movq %rax, %rbx
leaq 0x48(%r14), %rsi
leaq -0x50(%rbp), %rdi
callq 0x51a8
leaq 0x20(%r14), %rdx
movl 0x40(%r14), %ecx
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x5132
movq -0x40(%rbp), %rax
testq %rax, %rax
je 0x52dd
leaq -0x50(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x8(%r14), %r12
movq 0x10(%r14), %r13
cmpq %r13, %r12
je 0x532b
movq %rbx, %r14
addq $0x8, %r14
leaq -0x30(%rbp), %r15
movq (%r12), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, -0x30(%rbp)
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x5317
movq %rax, (%rsi)
addq $0x8, 0x10(%rbx)
jmp 0x5322
movq %r14, %rdi
movq %r15, %rdx
callq 0x452a
addq $0x8, %r12
cmpq %r13, %r12
jne 0x52f5
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x535b
movq %rax, %r14
movq -0x40(%rbp), %rax
testq %rax, %rax
je 0x5366
leaq -0x50(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x5366
movq %rax, %rdi
callq 0x3603
movq %rax, %r14
movq %rbx, %rdi
callq 0x2140
movq %r14, %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O1/ALSchwalm[P]cppEvolve/include/cppEvolve/Genome/Tree/Tree.hpp
// Function: evolve::tree::BaseNode<int>::getDepth() const
unsigned int getDepth() const {
        unsigned int max = 0;
        for (auto child : children) {
            auto depth = child->getDepth();
            if (depth > max)
                max = depth;
        }
        return max + 1;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rdi), %r14
movq 0x10(%rdi), %r15
cmpq %r15, %r14
je 0x5507
xorl %ebx, %ebx
movq (%r14), %rdi
callq 0x54d4
cmpl %ebx, %eax
cmoval %eax, %ebx
addq $0x8, %r14
cmpq %r15, %r14
jne 0x54ed
incl %ebx
jmp 0x550c
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ALSchwalm[P]cppEvolve/include/cppEvolve/Genome/Tree/Tree.hpp
// Function: evolve::tree::TreeFactory<int>::createRandomSubTree(unsigned int) const
BaseNode<Rtype>* createRandomSubTree(unsigned int depth = 5) const {

        BaseNode<Rtype>* root = nullptr;

        if (depth == 0) {
            root = createRandomTerminator();
        } else {
            root = createRandomNode();
            for (unsigned int i = 0; i < root->getNumChildren(); ++i) {
                root->getChildren().push_back(createRandomSubTree(depth - 1));
            }
        }
        return root;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x563b
movl %esi, %r14d
movq %rbx, %rdi
callq 0x5652
movq %rax, %r15
movq (%rax), %rax
movq %r15, %rdi
callq *0x20(%rax)
testl %eax, %eax
je 0x5629
decl %r14d
movq %r15, %r12
addq $0x8, %r12
xorl %r13d, %r13d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x55ac
movq %rax, -0x30(%rbp)
movq 0x10(%r15), %rsi
cmpq 0x18(%r15), %rsi
je 0x560c
movq %rax, (%rsi)
addq $0x8, 0x10(%r15)
jmp 0x5618
movq %r12, %rdi
leaq -0x30(%rbp), %rdx
callq 0x452a
incl %r13d
movq (%r15), %rax
movq %r15, %rdi
callq *0x20(%rax)
cmpl %eax, %r13d
jb 0x55e9
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5552
nop
// File: /workspace/github_cpp_makefile_star2_O1/ALSchwalm[P]cppEvolve/include/cppEvolve/Selector.hpp
// Function: void evolve::selector::details::topHelper<evolve::tree::Tree<int>*, 10ul, (evolve::Ordering)1>(std::vector<evolve::tree::Tree<int>*, std::allocator<evolve::tree::Tree<int>*>>&, std::function<float (evolve::tree::Tree<int>* const&)> const&, std::integral_constant<bool, true>)
void topHelper(std::vector<Genome>& population,
               const std::function<float(const Genome&)>& evaluator,
               std::true_type) {
    orderedSort(population, evaluator, Ord);

    auto location = population.begin();
    std::advance(location, Num);

    // Assume the pointer points to dynamically allocated memory
    for (auto iter = location; iter != population.end(); ++iter) {
        delete *iter;
    }

    population.erase(location, population.end());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl $0x1, %edx
callq 0x575e
movq (%rbx), %r15
movq 0x8(%rbx), %rax
addq $0x50, %r15
cmpq %rax, %r15
je 0x573a
movq %r15, %r12
movq (%r12), %r14
testq %r14, %r14
je 0x572d
movq (%r14), %rdi
testq %rdi, %rdi
je 0x5725
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x2140
addq $0x8, %r12
movq 0x8(%rbx), %rax
cmpq %rax, %r12
jne 0x570e
cmpq %rax, %r15
je 0x5755
movq 0x8(%rbx), %rcx
movq %rcx, %rdx
subq %rax, %rdx
addq %rdx, %r15
cmpq %r15, %rcx
je 0x5755
movq %r15, 0x8(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ALSchwalm[P]cppEvolve/include/cppEvolve/Genome/Tree/Tree.hpp
// Function: std::ostream& evolve::tree::operator<<<int>(std::ostream&, evolve::tree::BaseNode<int> const&)
std::ostream& operator<<(std::ostream& out, const BaseNode<T>& node) {
    out << node.name;

    if (!node.children.empty()) {
        out << "(";
        for (unsigned int i = 0; i < node.children.size() - 1; ++i)
            out << *(node.children[i]) << ", ";

        out << *node.children[node.children.size() - 1] << ")";
    }
    return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x20(%rsi), %rsi
movq 0x28(%r14), %rdx
callq 0x2180
movq 0x8(%r14), %rax
cmpq 0x10(%r14), %rax
je 0x6d6b
leaq 0x6bb(%rip), %rsi       # 0x739d
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2180
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
decq %rcx
je 0x6d4b
movl $0x1, %r12d
xorl %edx, %edx
leaq 0x741(%rip), %r15       # 0x7453
movq (%rax,%rdx,8), %rsi
movq %rbx, %rdi
callq 0x6caf
movl $0x2, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2180
movl %r12d, %edx
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
decq %rcx
incl %r12d
cmpq %rdx, %rcx
ja 0x6d12
movq (%rax,%rcx,8), %rsi
movq %rbx, %rdi
callq 0x6caf
leaq 0x684(%rip), %rsi       # 0x73e2
movl $0x1, %edx
movq %rax, %rdi
callq 0x2180
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/dannye[P]jed/src/decoder.cpp
// Function: readQuantizationTable(BitReader&, JPGImage*)
void readQuantizationTable(BitReader& bitReader, JPGImage* const image) {
    std::cout << "Reading DQT Marker\n";
    int length = bitReader.readWord();
    length -= 2;

    while (length > 0) {
        byte tableInfo = bitReader.readByte();
        length -= 1;
        byte tableID = tableInfo & 0x0F;

        if (tableID > 3) {
            std::cout << "Error - Invalid quantization table ID: " << (uint)tableID << '\n';
            image->valid = false;
            return;
        }
        QuantizationTable& qTable = image->quantizationTables[tableID];
        qTable.set = true;

        if (tableInfo >> 4 != 0) {
            for (uint i = 0; i < 64; ++i) {
                qTable.table[zigZagMap[i]] = bitReader.readWord();
            }
            length -= 128;
        }
        else {
            for (uint i = 0; i < 64; ++i) {
                qTable.table[zigZagMap[i]] = bitReader.readByte();
            }
            length -= 64;
        }
    }

    if (length != 0) {
        std::cout << "Error - DQT invalid\n";
        image->valid = false;
        return;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x77f0(%rip), %rdi      # 0x9fd8
leaq 0x4ac7(%rip), %rsi      # 0x72b6
movl $0x13, %edx
callq 0x2130
movb $0x0, 0x1(%r14)
leaq 0x8(%r14), %r12
movq %r12, %rdi
callq 0x2140
movl %eax, %r13d
shll $0x8, %r13d
movq %r12, %rdi
callq 0x2140
leal (%rax,%r13), %ebp
addl $-0x2, %ebp
leaq 0x48c9(%rip), %r15      # 0x70f0
movq %rbx, 0x10(%rsp)
testl %ebp, %ebp
jle 0x2942
movb $0x0, 0x1(%r14)
movq %r12, %rdi
callq 0x2140
movl %eax, %r13d
andb $0xf, %al
cmpb $0x4, %al
movb %al, 0xa(%rsp)
jae 0x28e2
movl %ebp, 0xc(%rsp)
movzbl %al, %eax
movl %eax, %ecx
shll $0x8, %ecx
leal (%rcx,%rax,4), %eax
leaq (%rbx,%rax), %rbp
movb $0x1, 0x100(%rbx,%rax)
xorl %ebx, %ebx
cmpb $0x10, %r13b
jae 0x28a0
movb $0x0, 0x1(%r14)
movq %r12, %rdi
callq 0x2140
movzbl %al, %eax
movzbl (%rbx,%r15), %ecx
movl %eax, (%rbp,%rcx,4)
incq %rbx
cmpq $0x40, %rbx
jne 0x2875
movl 0xc(%rsp), %ebp
addl $-0x41, %ebp
jmp 0x28db
movb $0x0, 0x1(%r14)
movq %r12, %rdi
callq 0x2140
movl %eax, %r13d
shll $0x8, %r13d
movq %r12, %rdi
callq 0x2140
addl %r13d, %eax
movzbl (%rbx,%r15), %ecx
movl %eax, (%rbp,%rcx,4)
incq %rbx
cmpq $0x40, %rbx
jne 0x28a0
movl 0xc(%rsp), %ebp
addl $0xffffff7f, %ebp       # imm = 0xFFFFFF7F
movq 0x10(%rsp), %rbx
jmp 0x2935
decl %ebp
andl $0xf, %r13d
movl $0x27, %edx
movl %ebp, %ebx
movq 0x76e2(%rip), %rbp      # 0x9fd8
movq %rbp, %rdi
leaq 0x4979(%rip), %rsi      # 0x7279
callq 0x2130
movq %rbp, %rdi
movl %ebx, %ebp
movq 0x10(%rsp), %rbx
movq %r13, %rsi
callq 0x20a0
movb $0xa, 0xb(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0xb(%rsp), %rsi
callq 0x2130
movb $0x0, 0x2088(%rbx)
cmpb $0x4, 0xa(%rsp)
jb 0x282c
jmp 0x2963
je 0x2963
movq 0x768d(%rip), %rdi      # 0x9fd8
leaq 0x4978(%rip), %rsi      # 0x72ca
movl $0x14, %edx
callq 0x2130
movb $0x0, 0x2088(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/dannye[P]jed/src/decoder.cpp
// Function: readRestartInterval(BitReader&, JPGImage*)
void readRestartInterval(BitReader& bitReader, JPGImage* const image) {
    std::cout << "Reading DRI Marker\n";
    uint length = bitReader.readWord();

    image->restartInterval = bitReader.readWord();
    if (length - 4 != 0) {
        std::cout << "Error - DRI invalid\n";
        image->valid = false;
        return;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x692f(%rip), %rdi      # 0x9fd8
leaq 0x3f97(%rip), %rsi      # 0x7647
movl $0x13, %edx
callq 0x2130
xorl %r13d, %r13d
movb %r13b, 0x1(%r14)
leaq 0x8(%r14), %r15
movq %r15, %rdi
callq 0x2140
movl %eax, %ebp
shll $0x8, %ebp
movq %r15, %rdi
callq 0x2140
movl %eax, %r12d
addl %ebp, %r12d
movb %r13b, 0x1(%r14)
movq %r15, %rdi
callq 0x2140
movl %eax, %ebp
shll $0x8, %ebp
movq %r15, %rdi
callq 0x2140
addl %ebp, %eax
movl %eax, 0x2078(%rbx)
cmpl $0x4, %r12d
je 0x3726
movq 0x68ca(%rip), %rdi      # 0x9fd8
leaq 0x3f46(%rip), %rsi      # 0x765b
movl $0x14, %edx
callq 0x2130
movb $0x0, 0x2088(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/dannye[P]jed/src/decoder.cpp
// Function: readAPPN(BitReader&, JPGImage*)
void readAPPN(BitReader& bitReader, JPGImage* const image) {
    std::cout << "Reading APPN Marker\n";
    uint length = bitReader.readWord();
    if (length < 2) {
        std::cout << "Error - APPN invalid\n";
        image->valid = false;
        return;
    }

    for (uint i = 0; i < length - 2; ++i) {
        bitReader.readByte();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x688e(%rip), %rdi      # 0x9fd8
leaq 0x3f1f(%rip), %rsi      # 0x7670
movl $0x14, %edx
callq 0x2130
movb $0x0, 0x1(%rbx)
leaq 0x8(%rbx), %r15
movq %r15, %rdi
callq 0x2140
movl %eax, %r12d
shll $0x8, %r12d
movq %r15, %rdi
callq 0x2140
movl %eax, %ebp
addl %r12d, %ebp
cmpl $0x2, %ebp
jae 0x37a6
movq 0x684d(%rip), %rdi      # 0x9fd8
leaq 0x3ef3(%rip), %rsi      # 0x7685
movl $0x15, %edx
callq 0x2130
movb $0x0, 0x2088(%r14)
jmp 0x37bb
addl $-0x2, %ebp
je 0x37bb
movb $0x0, 0x1(%rbx)
movq %r15, %rdi
callq 0x2140
decl %ebp
jne 0x37ab
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/dannye[P]jed/src/decoder.cpp
// Function: readComment(BitReader&, JPGImage*)
void readComment(BitReader& bitReader, JPGImage* const image) {
    std::cout << "Reading COM Marker\n";
    uint length = bitReader.readWord();
    if (length < 2) {
        std::cout << "Error - COM invalid\n";
        image->valid = false;
        return;
    }

    for (uint i = 0; i < length - 2; ++i) {
        bitReader.readByte();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x67ff(%rip), %rdi      # 0x9fd8
leaq 0x3ebb(%rip), %rsi      # 0x769b
movl $0x13, %edx
callq 0x2130
movb $0x0, 0x1(%rbx)
leaq 0x8(%rbx), %r15
movq %r15, %rdi
callq 0x2140
movl %eax, %r12d
shll $0x8, %r12d
movq %r15, %rdi
callq 0x2140
movl %eax, %ebp
addl %r12d, %ebp
cmpl $0x2, %ebp
jae 0x3835
movq 0x67be(%rip), %rdi      # 0x9fd8
leaq 0x3e8e(%rip), %rsi      # 0x76af
movl $0x14, %edx
callq 0x2130
movb $0x0, 0x2088(%r14)
jmp 0x384a
addl $-0x2, %ebp
je 0x384a
movb $0x0, 0x1(%rbx)
movq %r15, %rdi
callq 0x2140
decl %ebp
jne 0x383a
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/dannye[P]jed/src/decoder.cpp
// Function: getNextSymbol(BitReader&, HuffmanTable const&)
byte getNextSymbol(BitReader& bitReader, const HuffmanTable& hTable) {
    uint currentCode = 0;
    for (uint i = 0; i < 16; ++i) {
        int bit = bitReader.readBit();
        if (bit == -1) {
            return -1;
        }
        currentCode = (currentCode << 1) | bit;
        for (uint j = hTable.offsets[i]; j < hTable.offsets[i + 1]; ++j) {
            if (currentCode == hTable.codes[j]) {
                return hTable.symbols[j];
            }
        }
    }
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x6692
cmpl $-0x1, %eax
je 0x4cb3
addl %r12d, %r12d
orl %eax, %r12d
movzbl (%rbx,%r15), %ecx
movzbl 0x1(%rbx,%r15), %edx
cmpb %dl, %cl
setae %al
jae 0x4cbf
cmpl 0xc4(%rbx,%rcx,4), %r12d
je 0x4cb8
incq %rcx
cmpq %rcx, %rdx
jne 0x4c9c
setbe %al
jmp 0x4cbf
movb $-0x1, %bpl
jmp 0x4cbd
movb 0x11(%rbx,%rcx), %bpl
xorl %eax, %eax
testb %al, %al
je 0x4ccf
incq %r15
cmpq $0x10, %r15
jne 0x4c77
movb $-0x1, %bpl
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/dannye[P]jed/src/decoder.cpp
// Function: dequantize(JPGImage const*)
void dequantize(const JPGImage* const image) {
    for (uint y = 0; y < image->blockHeight; y += image->verticalSamplingFactor) {
        for (uint x = 0; x < image->blockWidth; x += image->horizontalSamplingFactor) {
            for (uint i = 0; i < image->numComponents; ++i) {
                const ColorComponent& component = image->colorComponents[i];
                for (uint v = 0; v < component.verticalSamplingFactor; ++v) {
                    for (uint h = 0; h < component.horizontalSamplingFactor; ++h) {
                        dequantizeBlockComponent(image->quantizationTables[component.quantizationTableID],
                            image->blocks[(y + v) * image->blockWidthReal + (x + h)][i]);
                    }
                }
            }
        }
    }
}

// Assembly:
cmpl $0x0, 0x208c(%rdi)
je 0x5702
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x2050(%rdi), %rax
movq %rax, -0x8(%rsp)
movzbl 0x209d(%rdi), %eax
movl %eax, -0x18(%rsp)
xorl %edx, %edx
cmpl $0x0, 0x2090(%rdi)
je 0x56e8
movzbl 0x2070(%rdi), %eax
movq %rax, -0x10(%rsp)
movzbl 0x209c(%rdi), %eax
movl %eax, -0x14(%rsp)
xorl %r9d, %r9d
cmpq $0x0, -0x10(%rsp)
je 0x56d6
xorl %r10d, %r10d
leaq (,%r10,8), %r11
subq %r10, %r11
movq -0x8(%rsp), %rax
movzbl 0x1(%rax,%r11), %ebx
testl %ebx, %ebx
je 0x56c8
addq -0x8(%rsp), %r11
movzbl (%r11), %ebp
xorl %r14d, %r14d
testl %ebp, %ebp
je 0x56bc
movzbl 0x2(%r11), %ecx
movl %ecx, %esi
shll $0x8, %esi
leaq (%rsi,%rcx,4), %r15
addq %rdi, %r15
movq 0x2080(%rdi), %r12
leal (%r14,%rdx), %r13d
xorl %ecx, %ecx
movl 0x2098(%rdi), %esi
imull %r13d, %esi
addl %ecx, %esi
addl %r9d, %esi
leaq (%rsi,%rsi,2), %r8
shlq $0x8, %r8
addq %r12, %r8
testl %r10d, %r10d
je 0x569e
cmpl $0x2, %r10d
je 0x5692
cmpl $0x1, %r10d
jne 0x569b
addq $0x100, %r8             # imm = 0x100
jmp 0x569e
addq $0x200, %r8             # imm = 0x200
jmp 0x569e
xorl %r8d, %r8d
xorl %esi, %esi
movl (%r8,%rsi,4), %eax
imull (%r15,%rsi,4), %eax
movl %eax, (%r8,%rsi,4)
incq %rsi
cmpq $0x40, %rsi
jne 0x56a0
incl %ecx
cmpl %ebp, %ecx
jne 0x565e
incl %r14d
cmpl %ebx, %r14d
jne 0x563c
incq %r10
cmpq -0x10(%rsp), %r10
jne 0x5612
addl -0x14(%rsp), %r9d
cmpl 0x2090(%rdi), %r9d
jb 0x5603
addl -0x18(%rsp), %edx
cmpl 0x208c(%rdi), %edx
jb 0x55dc
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/dannye[P]jed/src/decoder.cpp
// Function: YCbCrToRGBBlock(Block&, Block const&, unsigned int, unsigned int, unsigned int, unsigned int)
void YCbCrToRGBBlock(Block& yBlock, const Block& cbcrBlock, const uint vSamp, const uint hSamp, const uint v, const uint h) {
    for (uint y = 7; y < 8; --y) {
        for (uint x = 7; x < 8; --x) {
            const uint pixel = y * 8 + x;
            const uint cbcrPixelRow = y / vSamp + 4 * v;
            const uint cbcrPixelColumn = x / hSamp + 4 * h;
            const uint cbcrPixel = cbcrPixelRow * 8 + cbcrPixelColumn;
            int r = yBlock.y[pixel]                                    + 1.402f * cbcrBlock.cr[cbcrPixel] + 128;
            int g = yBlock.y[pixel] - 0.344f * cbcrBlock.cb[cbcrPixel] - 0.714f * cbcrBlock.cr[cbcrPixel] + 128;
            int b = yBlock.y[pixel] + 1.772f * cbcrBlock.cb[cbcrPixel]                                    + 128;
            if (r < 0)   r = 0;
            if (r > 255) r = 255;
            if (g < 0)   g = 0;
            if (g > 255) g = 255;
            if (b < 0)   b = 0;
            if (b > 255) b = 255;
            yBlock.r[pixel] = r;
            yBlock.g[pixel] = g;
            yBlock.b[pixel] = b;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r11d
shll $0x5, %r8d
leal (%r8,%r9,4), %r8d
addq $0xfc, %rdi
movl $0x7, %r9d
xorl %ebx, %ebx
movss 0x12f7(%rip), %xmm0     # 0x7130
movss 0x12f3(%rip), %xmm1     # 0x7134
movss 0x12ef(%rip), %xmm2     # 0x7138
movss 0x12eb(%rip), %xmm3     # 0x713c
movss 0x12e7(%rip), %xmm4     # 0x7140
movl $0xff, %ebp
movl %r9d, %eax
xorl %edx, %edx
divl %r11d
leal (%r8,%rax,8), %r14d
movq %rdi, %r15
movl $0x7, %r10d
movl %r10d, %eax
xorl %edx, %edx
divl %ecx
xorps %xmm5, %xmm5
cvtsi2ssl (%r15), %xmm5
addl %r14d, %eax
xorps %xmm6, %xmm6
cvtsi2ssl 0x200(%rsi,%rax,4), %xmm6
movaps %xmm6, %xmm7
mulss %xmm0, %xmm7
addss %xmm5, %xmm7
addss %xmm1, %xmm7
cvttss2si %xmm7, %edx
xorps %xmm7, %xmm7
cvtsi2ssl 0x100(%rsi,%rax,4), %xmm7
movaps %xmm7, %xmm8
mulss %xmm2, %xmm8
addss %xmm5, %xmm8
mulss %xmm3, %xmm6
addss %xmm8, %xmm6
addss %xmm1, %xmm6
cvttss2si %xmm6, %eax
mulss %xmm4, %xmm7
addss %xmm5, %xmm7
addss %xmm1, %xmm7
cvttss2si %xmm7, %r12d
testl %edx, %edx
cmovlel %ebx, %edx
cmpl %ebp, %edx
cmovgel %ebp, %edx
testl %eax, %eax
cmovlel %ebx, %eax
cmpl %ebp, %eax
cmovgel %ebp, %eax
testl %r12d, %r12d
cmovlel %ebx, %r12d
cmpl %ebp, %r12d
cmovgel %ebp, %r12d
movl %edx, (%r15)
movl %eax, 0x100(%r15)
movl %r12d, 0x200(%r15)
decq %r10
addq $-0x4, %r15
cmpq $0x8, %r10
jb 0x5e73
decq %r9
addq $-0x20, %rdi
cmpq $0x8, %r9
jb 0x5e5e
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/dannye[P]jed/src/decoder.cpp
// Function: YCbCrToRGB(JPGImage const*)
void YCbCrToRGB(const JPGImage* const image) {
    const uint vSamp = image->verticalSamplingFactor;
    const uint hSamp = image->horizontalSamplingFactor;
    for (uint y = 0; y < image->blockHeight; y += vSamp) {
        for (uint x = 0; x < image->blockWidth; x += hSamp) {
            const Block& cbcrBlock = image->blocks[y * image->blockWidthReal + x];
            for (uint v = vSamp - 1; v < vSamp; --v) {
                for (uint h = hSamp - 1; h < hSamp; --h) {
                    Block& yBlock = image->blocks[(y + v) * image->blockWidthReal + (x + h)];
                    YCbCrToRGBBlock(yBlock, cbcrBlock, vSamp, hSamp, v, h);
                }
            }
        }
    }
}

// Assembly:
cmpl $0x0, 0x208c(%rdi)
je 0x6060
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rdx
movzbl 0x209d(%rdi), %r12d
movzbl 0x209c(%rdi), %r14d
leal -0x1(%r12), %eax
leal -0x1(%r14), %ecx
movl %ecx, 0x18(%rsp)
movl $0x0, 0xc(%rsp)
movl %eax, 0x14(%rsp)
movl %eax, 0x10(%rsp)
movq %rdi, 0x20(%rsp)
cmpl $0x0, 0x2090(%rdx)
je 0x6036
xorl %ebx, %ebx
testb %r12b, %r12b
je 0x6027
movl 0x2098(%rdx), %eax
imull 0xc(%rsp), %eax
addl %ebx, %eax
leaq (%rax,%rax,2), %rbp
shlq $0x8, %rbp
addq 0x2080(%rdx), %rbp
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %r15d
movl 0x18(%rsp), %eax
movl %eax, %r13d
testb %r14b, %r14b
movl %esi, 0x1c(%rsp)
je 0x601d
movl 0x2098(%rdx), %eax
imull %esi, %eax
addl %ebx, %eax
addl %r13d, %eax
leaq (%rax,%rax,2), %rdi
shlq $0x8, %rdi
addq 0x2080(%rdx), %rdi
movq %rbp, %rsi
movl %r12d, %edx
movl %r14d, %ecx
movl %r15d, %r8d
movl %r13d, %r9d
callq 0x5e0f
movl 0x1c(%rsp), %esi
movq 0x20(%rsp), %rdx
decl %r13d
cmpl %r14d, %r13d
jb 0x5fdb
decl %r15d
decl %esi
cmpl %r12d, %r15d
jb 0x5fcb
addl %r14d, %ebx
cmpl 0x2090(%rdx), %ebx
jb 0x5f9d
movl 0xc(%rsp), %eax
addl %r12d, %eax
addl %r12d, 0x10(%rsp)
movl %eax, 0xc(%rsp)
cmpl 0x208c(%rdx), %eax
jb 0x5f8e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/dannye[P]jed/src/decoder.cpp
// Function: putInt(unsigned char*&, unsigned int)
void putInt(byte*& bufferPos, const uint v) {
    *bufferPos++ = v >>  0;
    *bufferPos++ = v >>  8;
    *bufferPos++ = v >> 16;
    *bufferPos++ = v >> 24;
}

// Assembly:
movl %esi, %eax
movq (%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rdi)
movb %al, (%rcx)
movq (%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rdi)
movb %ah, (%rcx)
movl %esi, %ecx
shrl $0x10, %ecx
movq (%rdi), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, (%rdi)
movb %cl, (%rdx)
shrl $0x18, %eax
movq (%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rdi)
movb %al, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/Infinidat[P]slimfastq/config.cpp
// Function: croak(char const*, ...)
void croak(const char *format, ...) {
    va_list args;
    va_start(args, format);
    fprintf(stderr, "slimfastq: %s %s: ",
            ( conf.encode ? "encoding" : "decoding"),
            conf.get_info("orig.filename"));

    // if (errno)
    //     fprintf(stderr, "err=%s", strerror(errno));

    vfprintf(stderr, format, args);
    fprintf(stderr, "\n");

    exit(1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x2387
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r14
movq %rdi, 0x10(%r14)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%r14)
movq 0xdc22(%rip), %r13      # 0xffd0
movq (%r13), %r15
leaq 0xff67(%rip), %rax      # 0x12320
leaq 0x7ccf(%rip), %rcx      # 0xa08f
leaq 0x7cd1(%rip), %r12      # 0xa098
cmpb $0x0, 0xc(%rax)
cmovneq %rcx, %r12
leaq 0x7ccb(%rip), %rsi      # 0xa0a1
callq 0x3764
leaq 0x7c9a(%rip), %rsi      # 0xa07c
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x2250
movq (%r13), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2240
movq (%r13), %rsi
pushq $0xa
popq %rdi
callq 0x2220
pushq $0x1
popq %rdi
callq 0x2210
// File: /workspace/github_cpp_makefile_star2_O1/Infinidat[P]slimfastq/filer.cpp
// Function: OneFile::do_confess() const
void do_confess() const {
        // i: 'name'       : size  : first : node
        fprintf(stderr, " i: name      : NODES count    : 1st    : 2nd\n");
        for (UINT32 i = 0;
             i < next_findex;
             i++) {
            char name[10];
            strncpy(name, (char*)&files[i].name, 8);
            fprintf(stderr, "%2d: %-10s: %-15lld: %d:\t: %d\n",
                    i, (i? name : "<info>"), files[i].size, files[i].first, files[i].node);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0xdac2(%rip), %rbp      # 0xffd0
movq (%rbp), %rcx
leaq 0x878f(%rip), %rdi      # 0xaca8
pushq $0x2e
popq %rsi
pushq $0x1
popq %rdx
callq 0x22e0
cmpq $0x0, 0x2010(%rbx)
je 0x2595
leaq 0xe(%rsp), %r14
leaq 0x879d(%rip), %r12      # 0xacd7
xorl %eax, %eax
xorl %r13d, %r13d
imulq $0x18, %rax, %r15
leaq (%rbx,%r15), %rsi
movq %r14, %rdi
pushq $0x8
popq %rdx
callq 0x2100
testl %r13d, %r13d
movq %r14, %rcx
leaq 0x8797(%rip), %rax      # 0xacf6
cmoveq %rax, %rcx
movq (%rbp), %rdi
movq 0x8(%rbx,%r15), %r8
movl 0x10(%rbx,%r15), %r9d
movl 0x14(%rbx,%r15), %eax
movl %eax, (%rsp)
movq %r12, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x2250
incl %r13d
movq %r13, %rax
cmpq %r13, 0x2010(%rbx)
ja 0x253f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Infinidat[P]slimfastq/./base2_ranger.hpp
// Function: GenSave::save_x(unsigned char const*, unsigned char const*, unsigned long long, unsigned long long) (.cold.1)
void normalize() {
        freq_val =
            ((freq_val & ~M_ONES) >> 1 ) |
             (freq_val &  M_ONES);
        // (freq_val & ~M_ONES) >> 1 ;
    }

// Assembly:
movl (%rdi), %eax
movl %eax, %ecx
shrl %ecx
andl $0x7f7f7f7f, %ecx       # imm = 0x7F7F7F7F
andl $0x1010101, %eax        # imm = 0x1010101
orl %ecx, %eax
movl %eax, (%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/Infinidat[P]slimfastq/usrs.cpp
// Function: UsrSave::get_record() (.cold.1)
void UsrSave::load_check() {
    likely_if (m_cur+PLL_STRT < m_end)
        return;
    for (int i = m_cur, cnt=0; i < m_end; i++)
        if (m_buff[i] == '\n')
            if (++cnt >= 4)
                return;
    load_page();
}

// Assembly:
movl %esi, %eax
subl %edi, %eax
jle 0x2b53
movslq %edi, %rcx
movslq %esi, %rsi
leaq (%rcx,%rdx), %rdi
addq $0x31, %rdi
incq %rcx
xorl %r8d, %r8d
movb $0x1, %r10b
xorl %r9d, %r9d
cmpb $0xa, (%rdi,%r8)
jne 0x2b37
cmpl $0x3, %r9d
jge 0x2b4c
incl %r9d
leaq (%rcx,%r8), %r10
cmpq %rsi, %r10
setl %r10b
incq %r8
cmpl %r8d, %eax
jne 0x2b27
jmp 0x2b53
testb $0x1, %r10b
je 0x2b53
retq
movq %rdx, %rdi
jmp 0x8254
// File: /workspace/github_cpp_makefile_star2_O1/Infinidat[P]slimfastq/bfiler.cpp
// Function: BFileSave::~BFileSave()
BFileSave::~BFileSave() {
    if (bcnt and filer)
        ranger->put(&rc, bmap);
    rc.done();
    DELETE(filer);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x0, 0x1(%rdi)
je 0x3108
cmpq $0x0, 0x38(%rbx)
je 0x3108
movq 0x8(%rbx), %rdi
leaq 0x10(%rbx), %rsi
movzbl (%rbx), %edx
callq 0x3270
leaq 0x10(%rbx), %rdi
callq 0x33be
movq 0x38(%rbx), %r14
testq %r14, %r14
je 0x312f
movq %r14, %rdi
callq 0x50f6
movl $0x4040, %esi           # imm = 0x4040
movq %r14, %rdi
callq 0x21c0
movq $0x0, 0x38(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3042
movq %rax, %rdi
callq 0x33b3
// File: /workspace/github_cpp_makefile_star2_O1/Infinidat[P]slimfastq/bfiler.cpp
// Function: BFileSave::putb(bool)
void BFileSave::putb(bool bit) {
    bmap |= ((!!bit)<<bcnt++);
    rarely_if (bcnt == 8) {
        ranger->put(&rc, bmap);
        bmap = bcnt = 0;
    }
}

// Assembly:
movb 0x1(%rdi), %cl
leal 0x1(%rcx), %eax
movb %al, 0x1(%rdi)
shll %cl, %esi
orb (%rdi), %sil
movb %sil, (%rdi)
cmpb $0x8, %al
je 0x3164
retq
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
leaq 0x10(%rbx), %rax
movzbl %sil, %edx
movq %rax, %rsi
callq 0x3270
movw $0x0, (%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Infinidat[P]slimfastq/bfiler.cpp
// Function: BFileLoad::getb()
bool BFileLoad::getb() {
    rarely_if(bcnt == 0) {
        bcnt = 8;
        bmap = ranger->get(&rc);
    }
    return !! (bmap & (0x100>> bcnt--));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpb $0x0, 0x1(%rdi)
je 0x325a
movzbl (%rbx), %eax
movb 0x1(%rbx), %cl
leal -0x1(%rcx), %edx
shll %cl, %eax
movb %dl, 0x1(%rbx)
shrl $0x8, %eax
andl $0x1, %eax
popq %rbx
retq
movb $0x8, 0x1(%rbx)
movq 0x8(%rbx), %rdi
leaq 0x10(%rbx), %rsi
callq 0x34b4
movb %al, (%rbx)
jmp 0x3244
nop
// File: /workspace/github_cpp_makefile_star2_O1/Infinidat[P]slimfastq/./power_ranger.hpp
// Function: PowerRanger::put(RCoder*, unsigned char)
void put(RCoder *rc, UCHAR sym) {
        UINT32 sumf  = 0;
        UINT32 i = 0;

        rarely_if(iend <= sym)
            for (;iend <= sym; iend++)
                  syms[iend] = iend;

        for (; syms[i] != sym; sumf += freq[i++]);

        rc->Encode(sumf+i, freq[i]+1, total + NSYM);

        update_freq(i);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
cmpw %bp, 0x204(%rdi)
jbe 0x3321
cmpb %bpl, 0x207(%rbx)
jne 0x329e
xorl %esi, %esi
xorl %r15d, %r15d
xorl %ecx, %ecx
jmp 0x32bf
xorl %eax, %eax
xorl %r15d, %r15d
xorl %esi, %esi
incl %r15d
movzwl 0x4(%rbx,%rax,2), %eax
addl %eax, %esi
movq %r15, %rax
movq %r15, %rcx
cmpb %bpl, 0x207(%rbx,%r15)
jne 0x32a5
addl %r15d, %esi
movzwl 0x4(%rbx,%rcx,2), %edx
incl %edx
movl $0x100, %ecx            # imm = 0x100
addl (%rbx), %ecx
movq %r14, %rdi
callq 0x3610
movslq %r15d, %rax
movzwl 0x4(%rbx,%rax,2), %ecx
cmpl $0x7fd3, %ecx           # imm = 0x7FD3
jae 0x3337
movzwl 0x4(%rbx,%rax,2), %ecx
addl $0xe, %ecx
movw %cx, 0x4(%rbx,%rax,2)
addl $0xe, (%rbx)
testl %eax, %eax
je 0x3316
movb 0x206(%rbx), %dl
incb %dl
movb %dl, 0x206(%rbx)
testb $0xf, %dl
jne 0x3316
cmpw 0x2(%rbx,%rax,2), %cx
ja 0x337e
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x204(%rbx), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x2300
jmp 0x328c
testl %r15d, %r15d
jne 0x3346
addl $0x100, %ecx            # imm = 0x100
cmpl (%rbx), %ecx
ja 0x3316
movl $0x0, (%rbx)
cmpw $0x0, 0x204(%rbx)
je 0x32e8
xorl %ecx, %ecx
xorl %edx, %edx
movzwl 0x4(%rbx,%rcx,2), %esi
shrl %esi
movw %si, 0x4(%rbx,%rcx,2)
addl %esi, %edx
incq %rcx
movzwl 0x204(%rbx), %esi
cmpq %rsi, %rcx
jb 0x335a
movl %edx, (%rbx)
jmp 0x32e8
movb 0x207(%rbx,%rax), %cl
movb 0x206(%rbx,%rax), %dl
movb %dl, 0x207(%rbx,%rax)
movb %cl, 0x206(%rbx,%rax)
movzwl 0x4(%rbx,%rax,2), %ecx
movzwl 0x2(%rbx,%rax,2), %edx
movw %dx, 0x4(%rbx,%rax,2)
movw %cx, 0x2(%rbx,%rax,2)
jmp 0x3316
// File: /workspace/github_cpp_makefile_star2_O1/Infinidat[P]slimfastq/./coder.hpp
// Function: RCoder::done()
void done() {
        // Allow explicit 'done' in case we wish not FilerSave close before this call
        if (m_out) {
            for (int i=0; i<8; i++) {
                m_out->put(low >> 56);
                low <<= 8;
            }
            m_out = NULL;
        }
    }

// Assembly:
cmpq $0x0, 0x20(%rdi)
je 0x3428
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x8, %ebp
movq 0x20(%rbx), %r14
movb 0x7(%rbx), %r15b
cmpq $0x2000, 0x2018(%r14) # imm = 0x2000
jae 0x340a
movq 0x2018(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x2018(%r14)
movb %r15b, 0x9(%r14,%rax)
shlq $0x8, (%rbx)
decl %ebp
jne 0x33d4
jmp 0x3416
movq %r14, %rdi
xorl %esi, %esi
callq 0x5126
jmp 0x33e9
movq $0x0, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Infinidat[P]slimfastq/./coder.hpp
// Function: RCoder::init(FilerLoad*)
void init(FilerLoad* f_in) {
        m_in  = f_in;
        m_out = NULL;
        low=0;
        range=(UINT32)-1;
        code = 0;               // happy compiler
        for (int i=0; i<8; i++)
            code = (code<<8) | m_in->get();
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, 0x18(%rdi)
movq $0x0, 0x20(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movl $0xffffffff, 0x10(%rdi) # imm = 0xFFFFFFFF
movl $0x8, %ebp
movq 0x8(%rbx), %r15
movq 0x18(%rbx), %r14
movq 0x2020(%r14), %rax
cmpq 0x2018(%r14), %rax
jbe 0x349e
cmpb $0x1, 0x8(%r14)
jne 0x348b
movq 0x2018(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x2018(%r14)
movzbl 0x9(%r14,%rax), %eax
jmp 0x348d
xorl %eax, %eax
shlq $0x8, %r15
orq %rax, %r15
movq %r15, 0x8(%rbx)
decl %ebp
jne 0x3452
jmp 0x34a8
movq %r14, %rdi
callq 0x533a
jmp 0x346a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Infinidat[P]slimfastq/./power_ranger.hpp
// Function: PowerRanger::get(RCoder*)
UINT16 get(RCoder *rc) {

        UINT32 vtot = total + NSYM; // - iend;
        UINT32 sumf = 0;
        UINT32 i;

        UINT32 prob = rc->GetFreq(vtot);
        for ( i = 0;
              i < NSYM;
              i ++ ) {

            rarely_if(iend    == i)
                syms[ iend++ ] = i;

            if (sumf +  freq[i] + 1 <= prob)
                sumf += freq[i] + 1;
            else
                break;
        }
        rc->Decode(sumf, freq[i]+1, vtot);

        return update_freq(i);
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r8
movq %rdi, %rbx
movl $0x100, %ecx            # imm = 0x100
addl (%rdi), %ecx
movl 0x10(%rsi), %eax
xorl %edi, %edi
xorl %edx, %edx
divl %ecx
movl %eax, %esi
movl %eax, 0x10(%r8)
movq 0x8(%r8), %rax
xorl %edx, %edx
divq %rsi
movzwl 0x204(%rbx), %edx
xorl %esi, %esi
movzwl %dx, %r9d
cmpq %r9, %rdi
je 0x3514
movzwl 0x4(%rbx,%rdi,2), %r9d
leal (%rsi,%r9), %r10d
incl %r10d
cmpl %eax, %r10d
ja 0x352e
addl %r9d, %esi
incl %esi
incq %rdi
cmpq $0x100, %rdi            # imm = 0x100
jne 0x34e6
jmp 0x3529
leal 0x1(%r9), %edx
movw %dx, 0x204(%rbx)
movb %dil, 0x207(%rbx,%r9)
jmp 0x34ef
movl $0x100, %edi            # imm = 0x100
movl %edi, %r14d
movzwl 0x4(%rbx,%r14,2), %edx
incl %edx
movq %r8, %rdi
callq 0x36b8
movzwl 0x4(%rbx,%r14,2), %eax
cmpl $0x7fd3, %eax           # imm = 0x7FD3
jae 0x3595
movzwl 0x4(%rbx,%r14,2), %eax
addl $0xe, %eax
movw %ax, 0x4(%rbx,%r14,2)
addl $0xe, (%rbx)
testq %r14, %r14
je 0x3582
movb 0x206(%rbx), %cl
incb %cl
movb %cl, 0x206(%rbx)
testb $0xf, %cl
jne 0x3582
movslq %r14d, %rcx
cmpw 0x2(%rbx,%rcx,2), %ax
ja 0x35db
movb 0x207(%rbx,%r14), %al
movzbl %al, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
testq %r14, %r14
jne 0x35a3
addl $0x100, %eax            # imm = 0x100
cmpl (%rbx), %eax
ja 0x3582
movl $0x0, (%rbx)
cmpw $0x0, 0x204(%rbx)
je 0x354e
xorl %eax, %eax
xorl %ecx, %ecx
movzwl 0x4(%rbx,%rax,2), %edx
shrl %edx
movw %dx, 0x4(%rbx,%rax,2)
addl %edx, %ecx
incq %rax
movzwl 0x204(%rbx), %edx
cmpq %rdx, %rax
jb 0x35b7
movl %ecx, (%rbx)
jmp 0x354e
movb 0x207(%rbx,%r14), %al
movb 0x206(%rbx,%rcx), %dl
movb %dl, 0x207(%rbx,%r14)
movb %al, 0x206(%rbx,%rcx)
movd 0x2(%rbx,%rcx,2), %xmm0
pshuflw $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3,4,5,6,7]
movd %xmm0, 0x2(%rbx,%rcx,2)
jmp 0x358a
nop
// File: /workspace/github_cpp_makefile_star2_O1/Infinidat[P]slimfastq/./coder.hpp
// Function: RCoder::Encode(unsigned int, unsigned int, unsigned int)
void Encode (UINT32 cumFreq, UINT32 freq, UINT32 totFreq) {

        range /= totFreq ;
        low   += cumFreq * range ;
        range *= freq;

        // assert (cumFreq + freq <= totFreq);

        while( range<TOP ) {
            rarely_if ( (low^(low+range)) & (0xffULL<<56) )
                range = ((UINT32(low)|(TOP-1))-UINT32(low));
            m_out->put(low >> 56);
            range <<= 8;
            low   <<= 8;
        }
    }

// Assembly:
movl %edx, %r8d
movl 0x10(%rdi), %eax
xorl %edx, %edx
divl %ecx
imull %eax, %esi
addq %rsi, (%rdi)
imull %eax, %r8d
movl %r8d, 0x10(%rdi)
cmpl $0xffffff, %r8d         # imm = 0xFFFFFF
ja 0x36b6
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rbx), %r15
movl %r8d, %eax
addq %r15, %rax
xorq %r15, %rax
shrq $0x38, %rax
jne 0x3696
movq 0x20(%rbx), %r14
cmpq $0x2000, 0x2018(%r14) # imm = 0x2000
jae 0x36a5
shrq $0x38, %r15
movq 0x2018(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x2018(%r14)
movb %r15b, 0x9(%r14,%rax)
movl 0x10(%rbx), %r8d
shll $0x8, %r8d
movl %r8d, 0x10(%rbx)
shlq $0x8, (%rbx)
cmpl $0x1000000, %r8d        # imm = 0x1000000
jb 0x363d
jmp 0x36b1
movl %r15d, %eax
notl %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
movl %eax, 0x10(%rbx)
jmp 0x364f
movq %r14, %rdi
xorl %esi, %esi
callq 0x5126
jmp 0x3660
popq %rbx
popq %r14
popq %r15
retq
nop