LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/ef-gy[P]libefgy/include/ef.gy/polar.h
// Function: efgy::math::vector<double, 3u, efgy::math::format::polar>::vector(efgy::math::vector<double, 3u, efgy::math::format::cartesian> const&, efgy::math::format::polar const&)
vector(const vector<F, n, format::cartesian> &v,
         const format::polar &s = format::polar())
      : std::array<F, n>(), spaceTag(s) {
    (*this)[0] = length(v);
    for (unsigned int k = 0; k < (n - 1); k++) {
      F s = F(0);
      for (unsigned int i = k; i < n; i++) {
        s += v[i] * v[i];
      }
      s = v[k] / sqrt(s);
      if (k == (n - 2)) {
        (*this)[(n - 1)] = arccosine(s);
        if (v[(n - 1)] < F(0)) {
          (*this)[(n - 1)] = M_PI * F(2) - (*this)[(n - 1)];
        }
      } else {
        (*this)[(k + 1)] = arccosine(s);
      }
    }
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq (%rdx), %rax
movq %rax, 0x18(%rdi)
xorpd %xmm0, %xmm0
xorl %eax, %eax
movsd (%rbx,%rax,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rax
cmpq $0x3, %rax
jne 0x55b0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x55d6
sqrtsd %xmm0, %xmm0
jmp 0x55db
callq 0x41f0
movsd %xmm0, (%r14)
xorl %r15d, %r15d
xorpd %xmm0, %xmm0
movq %r15, %rax
movsd (%rbx,%rax,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rax
cmpq $0x3, %rax
jne 0x55ea
movsd (%rbx,%r15,8), %xmm1
ucomisd 0xea02(%rip), %xmm0     # 0x14010
jb 0x5616
sqrtsd %xmm0, %xmm0
jmp 0x5627
movsd %xmm1, 0x8(%rsp)
callq 0x41f0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x4240
cmpq $0x1, %r15
jne 0x565f
movsd %xmm0, 0x10(%r14)
xorpd %xmm1, %xmm1
ucomisd 0x10(%rbx), %xmm1
jbe 0x5665
movsd 0xe9b5(%rip), %xmm1     # 0x14008
subsd %xmm0, %xmm1
movsd %xmm1, 0x10(%r14)
jmp 0x5665
movsd %xmm0, 0x8(%r14)
leaq 0x1(%r15), %rax
testq %r15, %r15
movq %rax, %r15
je 0x55e3
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/sbme-tutorials[P]huffman-encoding/huffman.cpp
// Function: Huffman::readInput()
void Huffman::readInput()
{
    std::cin >> intensity >> width >> height >> maxIntensity;
    for (int i = 0; i < width * height; i++)
    {
        int temp;
        std::cin >> temp;
        input.push_back(temp);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x30(%rdi), %rsi
movq 0x61a0(%rip), %rdi      # 0x8fe0
callq 0x2270
leaq 0x20(%rbx), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x2140
leaq 0x24(%rbx), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x2140
leaq 0x28(%rbx), %rsi
movq %rax, %rdi
callq 0x2140
movl 0x24(%rbx), %eax
imull 0x20(%rbx), %eax
testl %eax, %eax
jle 0x2eb5
addq $0x58, %rbx
xorl %r13d, %r13d
leaq -0x29(%rbp), %r12
movq 0x6154(%rip), %rdi      # 0x8fe0
leaq -0x30(%rbp), %rsi
callq 0x2140
movb -0x30(%rbp), %al
movb %al, -0x29(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4510
incl %r13d
movl (%r15), %eax
imull (%r14), %eax
cmpl %eax, %r13d
jl 0x2e85
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sbme-tutorials[P]huffman-encoding/huffman.cpp
// Function: Huffman::computeProb()
float Huffman::computeProb() // computes entropy and probability of each greyscale value
{
    unsigned long long pixels = input.size(); // total number of pixels in the pic
    float entropy = 0;
    for (auto value : input) // for loop to calculate frequency of each greyscale value
    {
        probability[value]++;
    }
    // divide the frequency over total
    // number of pixels to get probability
    for (auto &value : probability)
    {
        value.second = value.second / (float)pixels;
        entropy += value.second * log2(value.second); //entropy formula
    }
    return -1 * entropy;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x58(%rdi), %r13
movq 0x60(%rdi), %r12
movq %r12, %rax
subq %r13, %rax
movq %rax, -0x50(%rbp)
je 0x2f1e
leaq 0x70(%rbx), %r14
leaq -0x29(%rbp), %r15
movb (%r13), %al
movb %al, -0x29(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x4250
movss (%rax), %xmm0
addss 0x3136(%rip), %xmm0     # 0x6048
movss %xmm0, (%rax)
incq %r13
cmpq %r12, %r13
jne 0x2ef4
movq 0x88(%rbx), %r14
addq $0x78, %rbx
cmpq %rbx, %r14
je 0x2f3e
movq -0x50(%rbp), %rcx
testq %rcx, %rcx
js 0x2f47
cvtsi2ss %rcx, %xmm2
jmp 0x2f5c
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
jmp 0x2fa8
movq %rcx, %rax
shrq %rax
andl $0x1, %ecx
orq %rax, %rcx
cvtsi2ss %rcx, %xmm2
addss %xmm2, %xmm2
xorps %xmm1, %xmm1
movaps %xmm1, -0x50(%rbp)
movss %xmm2, -0x30(%rbp)
movss 0x24(%r14), %xmm0
divss %xmm2, %xmm0
movss %xmm0, -0x34(%rbp)
movss %xmm0, 0x24(%r14)
callq 0x2280
mulss -0x34(%rbp), %xmm0
movaps -0x50(%rbp), %xmm1
addss %xmm0, %xmm1
movaps %xmm1, -0x50(%rbp)
movq %r14, %rdi
callq 0x2180
movss -0x30(%rbp), %xmm2
movq %rax, %r14
cmpq %rbx, %rax
jne 0x2f68
movaps -0x50(%rbp), %xmm0
xorps 0x309d(%rip), %xmm0     # 0x6050
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sbme-tutorials[P]huffman-encoding/huffman.cpp
// Function: Huffman::buildTree()
void Huffman::buildTree()
{
    struct Compare
    {
        bool operator()(Node *a, Node *b)
        {
            return (a->p > b->p);
        }
    };
    // Create a min heap & inserts all characters of input data[]
    std::priority_queue<Node *, std::vector<Node *>, Compare> minHeap;
    //build heap
    for (auto pixel : probability)
    {
        Node *n = new Node{pixel.first, pixel.second, nullptr, nullptr};
        minHeap.push(n);
    }
    Node *parent;
    while (minHeap.size() != 1)
    {
        Node *left = minHeap.top();
        minHeap.pop();
        Node *right = minHeap.top();
        minHeap.pop();
        parent = new Node;
        parent->p = left->p + right->p;
        parent->left = left;
        parent->right = right;
        minHeap.push(parent);
    }
    tree = parent;

    char arr[255];
    getCodeTable(tree, arr, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
movq 0x88(%rdi), %r14
movq %rdi, -0x68(%rbp)
leaq 0x78(%rdi), %r13
cmpq %r13, %r14
je 0x3059
leaq -0x60(%rbp), %r15
leaq -0x170(%rbp), %r12
movb 0x20(%r14), %bl
movss 0x24(%r14), %xmm0
movss %xmm0, -0x2c(%rbp)
movl $0x18, %edi
callq 0x2200
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movb %bl, (%rax)
movss -0x2c(%rbp), %xmm0
movss %xmm0, 0x4(%rax)
movq %rax, -0x170(%rbp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x312e
movq %r14, %rdi
callq 0x2180
movq %rax, %r14
cmpq %r13, %rax
jne 0x3004
leaq -0x60(%rbp), %r14
leaq -0x38(%rbp), %r15
movq -0x60(%rbp), %rax
movq -0x58(%rbp), %rcx
subq %rax, %rcx
cmpq $0x8, %rcx
je 0x30c8
movq (%rax), %r12
movq %r14, %rdi
callq 0x31b6
movq -0x60(%rbp), %rax
movq (%rax), %r13
movq %r14, %rdi
callq 0x31b6
movl $0x18, %edi
callq 0x2200
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rax, -0x38(%rbp)
movss 0x4(%r12), %xmm0
addss 0x4(%r13), %xmm0
movss %xmm0, 0x4(%rax)
movq %r12, 0x8(%rax)
movq %r13, 0x10(%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0x312e
jmp 0x3061
movq -0x38(%rbp), %rsi
movq -0x68(%rbp), %rdi
movq %rsi, 0x50(%rdi)
leaq -0x170(%rbp), %rdx
xorl %ecx, %ecx
callq 0x32b4
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x30f7
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x2210
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x310d
jmp 0x310d
movq %rax, %rbx
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x3125
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2360
nop
// File: /workspace/github_cpp_makefile_star2_O1/sbme-tutorials[P]huffman-encoding/huffman.cpp
// Function: Huffman::getCodeTable(Node*, char*, int)
void Huffman::getCodeTable(Node *parent, char *arr, int index)
{
    if (parent->left)
    {
        arr[index] = '0';
        getCodeTable(parent->left, arr, index + 1);
    }

    if (parent->right)
    {
        arr[index] = '1';
        getCodeTable(parent->right, arr, index + 1);
    }

    if (!(parent->right || parent->left))
    {
        std::string binaryCode(arr, arr + index);
        codeTable[parent->val] = binaryCode;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x0, 0x8(%rsi)
movslq %ecx, %r12
je 0x32f1
movb $0x30, (%r15,%r12)
movq 0x8(%rbx), %rsi
leal 0x1(%r12), %ecx
movq %r14, %rdi
movq %r15, %rdx
callq 0x32b4
cmpq $0x0, 0x10(%rbx)
je 0x3311
movb $0x31, (%r15,%r12)
movq 0x10(%rbx), %rsi
leal 0x1(%r12), %ecx
movq %r14, %rdi
movq %r15, %rdx
callq 0x32b4
cmpq $0x0, 0x10(%rbx)
jne 0x336c
cmpq $0x0, 0x8(%rbx)
jne 0x336c
addq %r15, %r12
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2d8a
addq $0xa0, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42b8
leaq -0x48(%rbp), %rsi
movq %rax, %rdi
callq 0x2120
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x336c
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x3393
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2360
nop
// File: /workspace/github_cpp_makefile_star2_O1/sbme-tutorials[P]huffman-encoding/huffman.cpp
// Function: Huffman::encode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Huffman::encode(std::string outputFile)
{
    readInput();
    computeProb();
    buildTree();
    sizeOfEncoded = 0;
    for (auto element : input)
    {
        if (codeTable.find(element) != codeTable.end())
        {
            std::string binaryCode = codeTable[element];
            encoded += binaryCode;
        }
    }
    encoded.erase(std::remove(encoded.begin(), encoded.end(), '\0'), encoded.end());
    sizeOfEncoded = encoded.length();
    outputEncoded(outputFile);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, -0x58(%rbp)
movq %rdi, %rbx
callq 0x2e24
movq %rbx, %rdi
callq 0x2ec4
movq %rbx, %rdi
callq 0x2fc2
movq $0x0, 0xf0(%rbx)
movq 0x58(%rbx), %r13
movq 0x60(%rbx), %r14
cmpq %r14, %r13
je 0x34a3
leaq 0xa0(%rbx), %rax
movq %rax, -0x68(%rbp)
leaq 0xa8(%rbx), %r15
leaq -0x40(%rbp), %r12
leaq 0xd0(%rbx), %rax
movq %rax, -0x60(%rbp)
movb (%r13), %al
movb %al, -0x29(%rbp)
movq 0xb0(%rbx), %rdx
movq %r15, %rcx
testq %rdx, %rdx
je 0x3436
movq %r15, %rcx
xorl %esi, %esi
cmpb %al, 0x20(%rdx)
setb %sil
cmovaeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x341f
movq %r15, %rdx
cmpq %r15, %rcx
je 0x3448
cmpb 0x20(%rcx), %al
cmovbq %r15, %rcx
movq %rcx, %rdx
cmpq %r15, %rdx
je 0x3497
movq -0x68(%rbp), %rdi
leaq -0x29(%rbp), %rsi
callq 0x42b8
movq %r12, -0x50(%rbp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x2d8a
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x60(%rbp), %rdi
callq 0x20b0
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x3497
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2210
incq %r13
cmpq %r14, %r13
jne 0x3406
movq 0xd0(%rbx), %rdi
movq 0xd8(%rbx), %rsi
addq %rdi, %rsi
xorl %r14d, %r14d
leaq -0x50(%rbp), %rdx
movb %r14b, (%rdx)
callq 0x4bb6
movq %rax, %rcx
subq 0xd0(%rbx), %rcx
movq %rcx, 0xd8(%rbx)
movb %r14b, (%rax)
movq 0xd8(%rbx), %rax
movq %rax, 0xf0(%rbx)
leaq -0x78(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x58(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %r14
movq %r14, %rdi
callq 0x2d8a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3572
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x352d
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2210
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x3569
movq -0x78(%rbp), %rsi
jmp 0x3561
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x3569
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2360
nop
// File: /workspace/github_cpp_makefile_star2_O1/sbme-tutorials[P]huffman-encoding/huffman.cpp
// Function: Huffman::bitPacking()
void Huffman::bitPacking()
{
    packed.clear();
    std::string str = "";
    for (auto e : encoded)
    {
        str.push_back(e);
        if (str.size() == 8)
        {
            int dec = std::bitset<8>(str).to_ulong();
            unsigned char temp = (unsigned char)dec;
            packed.push_back(temp);
            str = "";
        }
    }
    int numOfZeros = (8 - (encoded.length() % 8)); // to complete the last byte of the code
    if (numOfZeros != 8)
    {
        for (int i = 0; i < numOfZeros; ++i)
        {
            str.push_back('0');
        }
        if (str.size() == 8)
        {
            int dec = std::bitset<8>(str).to_ulong();
            unsigned char temp = (unsigned char)dec;
            packed.push_back(temp);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x110(%rdi), %rax
cmpq %rax, 0x118(%rdi)
je 0x3963
movq %rax, 0x118(%rbx)
leaq 0x110(%rbx), %rax
movq %rax, -0x58(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2704(%rip), %rdx      # 0x6081
leaq -0x50(%rbp), %rdi
movq %rdx, %rsi
callq 0x2cf0
movq 0xd8(%rbx), %r14
testq %r14, %r14
je 0x3a14
movq 0xd0(%rbx), %r13
xorl %r12d, %r12d
leaq -0x50(%rbp), %r15
movsbl (%r13,%r12), %esi
movq %r15, %rdi
callq 0x21d0
cmpq $0x8, -0x48(%rbp)
jne 0x3a0c
leaq -0x30(%rbp), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x4432
movb -0x30(%rbp), %al
movb %al, -0x30(%rbp)
movq 0x118(%rbx), %rsi
cmpq 0x120(%rbx), %rsi
je 0x39e7
movb %al, (%rsi)
incq 0x118(%rbx)
jmp 0x39f4
movq -0x58(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x510e
movq -0x48(%rbp), %rdx
movq %r15, %rdi
xorl %esi, %esi
leaq 0x267d(%rip), %rcx      # 0x6081
xorl %r8d, %r8d
callq 0x2300
incq %r12
cmpq %r12, %r14
jne 0x39a3
movl 0xd8(%rbx), %r14d
andl $0x7, %r14d
je 0x3a7f
orl $-0x8, %r14d
leaq -0x50(%rbp), %r15
movq %r15, %rdi
movl $0x30, %esi
callq 0x21d0
incl %r14d
jne 0x3a29
cmpq $0x8, -0x48(%rbp)
jne 0x3a7f
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
xorl %edx, %edx
callq 0x4432
movb -0x30(%rbp), %al
movb %al, -0x30(%rbp)
movq 0x118(%rbx), %rsi
cmpq 0x120(%rbx), %rsi
je 0x3a72
movb %al, (%rsi)
incq 0x118(%rbx)
jmp 0x3a7f
leaq -0x30(%rbp), %rdx
movq -0x58(%rbp), %rdi
callq 0x510e
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3a98
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2210
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3ab1
jmp 0x3ab1
jmp 0x3ab1
jmp 0x3ab1
jmp 0x3ab1
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x3acd
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2360
nop
// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH15_ObjectOrientedProgramming/examples/useQuote.cc
// Function: main
int main()
{
	Quote base("0-201-82470-1", 50);
	print_total(cout, base, 10);    // calls Quote::net_price
	
	Bulk_quote derived("0-201-82470-1", 50, 5, .19);
	print_total(cout, derived, 10); // calls Bulk_quote::net_price
	
	Quote *baseP = &derived;
	
	// calls the version from the base class 
	// regardless of the dynamic type of baseP
	double undiscounted = baseP->Quote::net_price(42);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
leaq -0x58(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xd90(%rip), %rsi       # 0x3030
leaq 0xd96(%rip), %rdx       # 0x303d
leaq -0x68(%rbp), %rdi
callq 0x2618
leaq 0x29f9(%rip), %r15      # 0x4cb0
leaq -0xb0(%rbp), %rdi
movq %r15, -0x8(%rdi)
leaq -0xa0(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
callq 0x257e
movabsq $0x4049000000000000, %rbx # imm = 0x4049000000000000
movq %rbx, -0x90(%rbp)
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x2303
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x20b0
movq 0x2cce(%rip), %rdi      # 0x4fd8
leaq -0xb8(%rbp), %rsi
movl $0xa, %edx
callq 0x26b4
leaq -0x78(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0xd06(%rip), %rsi       # 0x3030
leaq 0xd0c(%rip), %rdx       # 0x303d
leaq -0x88(%rbp), %rdi
callq 0x2618
leaq -0x60(%rbp), %rdi
movq %r15, -0x8(%rdi)
leaq -0x50(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
addq %rsi, %rdx
callq 0x257e
movq %rbx, -0x40(%rbp)
movq $0x5, -0x38(%rbp)
movabsq $0x3fc851eb851eb852, %rax # imm = 0x3FC851EB851EB852
movq %rax, -0x30(%rbp)
leaq 0x29a6(%rip), %rax      # 0x4d28
addq $0x10, %rax
movq %rax, -0x68(%rbp)
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x23a2
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x20b0
movq 0x2c2f(%rip), %rdi      # 0x4fd8
leaq -0x68(%rbp), %rsi
movl $0xa, %edx
callq 0x26b4
movq %r15, -0x68(%rbp)
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x23d0
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x20b0
movq %r15, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
cmpq %r14, %rdi
je 0x23f2
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x20b0
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r15, -0x68(%rbp)
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x243e
movq -0x50(%rbp), %rsi
jmp 0x242f
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x243e
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x20b0
jmp 0x243e
jmp 0x243b
movq %rax, %rbx
movq %r15, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
cmpq %r14, %rdi
je 0x2477
movq -0xa0(%rbp), %rsi
jmp 0x246a
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x2477
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x20b0
jmp 0x2477
movq %rax, %rbx
movq %rbx, %rdi
callq 0x20f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH01_GettingStarted/examples/mysum.cc
// Function: main
int main() 
{
	int sum = 0, value = 0;

	// read until end-of-file, calculating a running total of all values read
	while (std::cin >> value) 
		sum += value; // equivalent to sum = sum + value

	std::cout << "Sum is: " << sum << std::endl;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq -0x1c(%rbp), %rsi
movl $0x0, (%rsi)
movq 0x2dd9(%rip), %rdi      # 0x3fe0
callq 0x1040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
xorl %ebx, %ebx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1245
xorl %ebx, %ebx
movq 0x2dbb(%rip), %r14      # 0x3fe0
leaq -0x1c(%rbp), %r15
addl -0x1c(%rbp), %ebx
movq %r14, %rdi
movq %r15, %rsi
callq 0x1040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x1229
movq 0x2d84(%rip), %r14      # 0x3fd0
leaq 0xdb1(%rip), %rsi       # 0x2004
movl $0x8, %edx
movq %r14, %rdi
callq 0x1080
movq %r14, %rdi
movl %ebx, %esi
callq 0x10a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1070
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1050
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Kobzol[P]sigmod-2016/src/graph.cpp
// Function: Graph::add_edge(unsigned int, unsigned int)
void Graph::add_edge(sigint from, sigint to)
{
    if (from == to) return;
    if (!this->has_vertex(from)) this->add_vertex(from);
    if (!this->has_vertex(to)) this->add_vertex(to);

    Vertex& dest = this->nodes.at(to);

#ifdef CHECK_UNIQUE_EDGES
    for (Vertex* edge : this->nodes.at(from).edges_out)
    {
        if (edge == &dest)
        {
            this->non_unique++;
            return;
        }
    }
#endif

    Vertex& src = this->nodes.at(from);

    src.edges_out.push_back(&dest);
#ifdef USE_UNION_FIND
    src.join(*this, dest);
#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %esi, 0x1c(%rsp)
movl %edx, 0xc(%rsp)
cmpl %edx, %esi
je 0x26f6
movq %rdi, %rbx
leaq 0x10(%rsp), %rax
movl %esi, (%rax)
movq %rax, %rsi
callq 0x2850
testq %rax, %rax
jne 0x2670
movl 0x1c(%rsp), %eax
leaq 0x10(%rsp), %rdx
movl %eax, (%rdx)
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x2bd4
movl 0xc(%rsp), %eax
leaq 0x10(%rsp), %rsi
movl %eax, (%rsi)
movq %rbx, %rdi
callq 0x2850
testq %rax, %rax
jne 0x269e
movl 0xc(%rsp), %eax
leaq 0x10(%rsp), %rdx
movl %eax, (%rdx)
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x2bd4
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x2a64
movq %rax, %r14
leaq 0x1c(%rsp), %rsi
movq %rbx, %rdi
callq 0x2a64
movq %rax, %r15
movq %r14, 0x10(%rsp)
movq 0x10(%rax), %rsi
cmpq 0x18(%rax), %rsi
je 0x26d7
movq %r14, (%rsi)
addq $0x8, 0x10(%r15)
jmp 0x26e8
movq %r15, %rdi
addq $0x8, %rdi
leaq 0x10(%rsp), %rdx
callq 0x2aa6
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x44ca
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/Kobzol[P]sigmod-2016/src/graph.cpp
// Function: Graph::remove_edge(unsigned int, unsigned int)
void Graph::remove_edge(sigint from, sigint to)
{
    if (!this->has_vertex(from)) return;

    std::vector<Vertex*>& edges = this->nodes.at(from).edges_out;
    Vertex* address = &this->nodes.at(to);

#ifdef CHECK_UNIQUE_EDGES   // je kontrola uz pri vkladani, neni potreba prochazet vsechny
    size_t size = edges.size();

    for (size_t i = 0; i < size; i++)
    {
        if (edges[i] == address)
        {
            edges.erase(edges.begin() + i);
            return;
        }
    }
#else
    for (size_t i = 0; i < edges.size(); i++)
    {
        if (edges[i] == address)
        {
            edges.erase(edges.begin() + i);
            i--;
        }
    }
#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movl %esi, 0x8(%rsp)
movl %edx, 0x4(%rsp)
leaq 0xc(%rsp), %rax
movl %esi, (%rax)
movq %rax, %rsi
callq 0x2850
testq %rax, %rax
je 0x27a7
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2a64
movq %rax, %rbx
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x2a64
movq %rax, %r14
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rdx
cmpq %rax, %rdx
je 0x27a7
xorl %r15d, %r15d
cmpq %r14, (%rax,%r15,8)
jne 0x278d
leaq (%rax,%r15,8), %rdi
leaq 0x8(%rdi), %rsi
cmpq %rdx, %rsi
je 0x2785
subq %rsi, %rdx
callq 0x22c0
addq $-0x8, 0x10(%rbx)
decq %r15
incq %r15
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rdx
movq %rdx, %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r15
jb 0x276a
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Kobzol[P]sigmod-2016/src/thread_pool.h
// Function: Thread::thread_fn()
void thread_fn()
    {
        while (!this->terminated)
        {
            //std::cerr << "Thread " << this->id << " waiting for job" << std::endl;
            Job job = jobQueue.pop_job();
            //std::cerr << "Thread " << this->id << " got job" << std::endl;

#ifndef THREAD_USE_JOB_SYNC
            if (job.type == JobType::Invalid)
            {
                std::this_thread::sleep_for(std::chrono::milliseconds(1));
                continue;
            }
#endif

            int64_t result = 0;
            if (job.type == JobType::AddEdge)
            {
                graph.add_edge(job.from, job.to);
            }
            else if (job.type == JobType::RemoveEdge)
            {
                graph.remove_edge(job.from, job.to);
            }
            else
            {
                result = GraphEvaluator::query(job.from, job.to, job.id, this->id);
            }

            //std::cerr << "Thread " << this->id << " giving job" << std::endl;
            jobQueue.add_result(job, result);
            //std::cerr << "Thread " << this->id << " gave job" << std::endl;
        }
    }

// Assembly:
cmpb $0x0, 0x8(%rdi)
jne 0x36d6
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x3121f1(%rip), %r14    # 0x315848
leaq 0x8(%rsp), %r15
leaq 0x311f7d(%rip), %r12    # 0x3155e0
movq %r15, %rdi
movq %r14, %rsi
callq 0x3770
movl 0x10(%rsp), %eax
cmpl $0x2, %eax
je 0x368e
cmpl $0x1, %eax
jne 0x36a2
movl 0x14(%rsp), %esi
movl 0x18(%rsp), %edx
movq %r12, %rdi
callq 0x262a
jmp 0x369e
movl 0x14(%rsp), %esi
movl 0x18(%rsp), %edx
movq %r12, %rdi
callq 0x2712
xorl %edx, %edx
jmp 0x36ba
movl 0x14(%rsp), %edi
movl 0x18(%rsp), %esi
movq 0x8(%rsp), %rdx
movq (%rbx), %rcx
callq 0x3848
movq %rax, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3ad2
cmpb $0x1, 0x8(%rbx)
jne 0x3663
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Kobzol[P]sigmod-2016/src/job.h
// Function: JobQueue::pop_job()
Job pop_job()
    {
        std::unique_lock<std::mutex> guard(this->lock);

#ifdef THREAD_USE_JOB_SYNC
        this->bufferEmpty.wait(guard, [this] { return this->is_job_available(); });
#else
        if (!this->is_job_available())
        {
            return Job(JobType::Invalid);
        }
#endif

        Job job = this->jobs[this->start];

        this->start = (this->start + 1) % this->jobs.size;
        this->size--;
        this->jobs_in_work++;

#ifdef THREAD_USE_JOB_SYNC
        if (this->size == this->jobs.capacity - 1)
        {
            this->bufferFull.notify_one();
        }
#endif

        return job;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xb0(%rsi), %rax
movq %rsp, %r15
movq %rax, (%r15)
movb $0x0, 0x8(%r15)
movq %r15, %rdi
callq 0x442c
movb $0x1, 0x8(%r15)
leaq 0x68(%r14), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3bda
movq 0xa0(%r14), %rax
movslq %eax, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0xe8(%r14), %rdx
shlq $0x4, %rcx
vmovups (%rdx,%rcx), %ymm0
vmovups 0x10(%rdx,%rcx), %ymm1
vmovups %ymm1, 0x10(%rbx)
vmovups %ymm0, (%rbx)
incq %rax
xorl %edx, %edx
divq 0xd8(%r14)
movq %rdx, 0xa0(%r14)
movq 0x98(%r14), %rax
leaq -0x1(%rax), %rcx
movq %rcx, 0x98(%r14)
incq (%r14)
cmpq 0xe0(%r14), %rax
jne 0x381d
addq $0x130, %r14            # imm = 0x130
movq %r14, %rdi
vzeroupper
callq 0x20d0
movq %rsp, %rdi
vzeroupper
callq 0x3414
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3414
movq %rbx, %rdi
callq 0x2300
// File: /workspace/github_cpp_makefile_star2_O1/Kobzol[P]sigmod-2016/src/job.h
// Function: JobQueue::add_result(Job&, long)
void add_result(Job& job, int64_t result)
    {
        std::lock_guard<std::mutex> guard(this->lock);

        if (job.type == JobType::Query)
        {
            this->results.insert({job.id, result});
        }

        job.modifyBarrier->pop();

        this->jobs_in_work--;

#ifdef THREAD_USE_JOB_SYNC
        this->bufferEmpty.notify_one();
#endif

        if (this->batchEnded && this->size == 0 && this->jobs_in_work == 0)
        {
            std::unique_lock<std::mutex> lock(this->jobMutex);
            this->batchEndCV.notify_one();
            this->reset();
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
leaq 0xb0(%rdi), %rbx
movq %rbx, %rdi
callq 0x2280
testl %eax, %eax
jne 0x3bbe
cmpl $0x0, 0x8(%r15)
jne 0x3b1f
leaq 0x100(%r14), %rdi
movq (%r15), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r12, 0x8(%rsi)
callq 0x40ac
movq 0x20(%r15), %rax
decq 0x8(%rax)
decq (%r14)
leaq 0x68(%r14), %rdi
callq 0x20d0
cmpb $0x1, 0x60(%r14)
jne 0x3baa
cmpq $0x0, 0x98(%r14)
jne 0x3baa
cmpq $0x0, (%r14)
jne 0x3baa
leaq 0x8(%r14), %rax
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
movb $0x0, 0x8(%rdi)
callq 0x442c
leaq 0x8(%rsp), %r15
movb $0x1, 0x8(%r15)
leaq 0x30(%r14), %rdi
callq 0x20d0
xorl %eax, %eax
movb %al, 0x60(%r14)
movb %al, 0x4652(%rip)       # 0x81d0
leaq 0x464b(%rip), %rax      # 0x81d0
movq $0x0, 0x4648(%rip) # 0x81d8
movq $0x1, 0x311a35(%rip) # 0x3155d0
movq %rax, 0xf0(%r14)
movq %r15, %rdi
callq 0x3414
movq %rbx, %rdi
callq 0x2170
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl %eax, %edi
callq 0x2110
jmp 0x3bc7
movq %rax, %r14
movq %rbx, %rdi
callq 0x2170
movq %r14, %rdi
callq 0x2300
// File: /workspace/github_cpp_makefile_star2_O1/Kobzol[P]sigmod-2016/src/vector.h
// Function: Vector<Job>::reallocate(unsigned long)
void reallocate(size_t capacity)
	{
		if (this->data != nullptr)
		{
			T* new_data = new T[capacity];
			memcpy(new_data, this->data, this->size * sizeof(T));

			delete[] this->data;

			this->data = new_data;
		}
		else this->data = new T[capacity];

		this->capacity = capacity;

	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %r12
movl $0x30, %ecx
movq %rsi, %rax
mulq %rcx
movq $-0x1, %rdi
cmovnoq %rax, %rdi
callq 0x2030
movq %rax, %r15
testq %r12, %r12
je 0x42f7
testq %rbx, %rbx
je 0x42d1
leaq (%rbx,%rbx,2), %rdx
shlq $0x4, %rdx
addq $-0x30, %rdx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
mulxq %rax, %rax, %rax
vpbroadcastq %rax, %zmm0
shrq $0x5, %rax
addq $0x10, %rax
andq $-0x10, %rax
vpsrlq $0x5, %zmm0, %zmm0
xorl %ecx, %ecx
vpmovsxbq 0xf2c(%rip), %zmm1 # 0x51a0
vpmovsxbq 0xf1a(%rip), %zmm2 # 0x5198
vpbroadcastd 0xf30(%rip), %zmm3 # 0x51b8
vpmovsxwd 0xf2a(%rip), %zmm4 # 0x51bc
movq %r15, %rdx
vpbroadcastq %rcx, %zmm5
vporq %zmm1, %zmm5, %zmm6
vporq %zmm2, %zmm5, %zmm5
vpcmpleuq %zmm0, %zmm5, %k0
vpcmpleuq %zmm0, %zmm6, %k1
kunpckbw %k0, %k1, %k1
vpscatterdd %zmm3, 0x8(%rdx,%zmm4) {%k1}
addq $0x10, %rcx
addq $0x300, %rdx            # imm = 0x300
cmpq %rcx, %rax
jne 0x4295
movq (%r14), %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rdx
movq %r15, %rdi
movq %r12, %rsi
vzeroupper
callq 0x2190
movq %r12, %rdi
callq 0x2220
jmp 0x439d
testq %rbx, %rbx
je 0x439d
leaq (%rbx,%rbx,2), %rdx
shlq $0x4, %rdx
addq $-0x30, %rdx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
mulxq %rax, %rax, %rax
vpbroadcastq %rax, %zmm0
shrq $0x5, %rax
addq $0x10, %rax
andq $-0x10, %rax
vpsrlq $0x5, %zmm0, %zmm0
xorl %ecx, %ecx
vpmovsxbq 0xe60(%rip), %zmm1 # 0x51a0
vpmovsxbq 0xe4e(%rip), %zmm2 # 0x5198
vpbroadcastd 0xe64(%rip), %zmm3 # 0x51b8
vpmovsxwd 0xe5e(%rip), %zmm4 # 0x51bc
movq %r15, %rdx
vpbroadcastq %rcx, %zmm5
vporq %zmm1, %zmm5, %zmm6
vporq %zmm2, %zmm5, %zmm5
vpcmpleuq %zmm0, %zmm5, %k0
vpcmpleuq %zmm0, %zmm6, %k1
kunpckbw %k0, %k1, %k1
vpscatterdd %zmm3, 0x8(%rdx,%zmm4) {%k1}
addq $0x10, %rcx
addq $0x300, %rdx            # imm = 0x300
cmpq %rcx, %rax
jne 0x4361
movq %r15, 0x10(%r14)
movq %rbx, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
vzeroupper
retq
// File: /workspace/github_cpp_makefile_star2_O1/Kobzol[P]sigmod-2016/src/vertex.cpp
// Function: Vertex::join(Graph&, Vertex&)
void Vertex::join(Graph& graph, Vertex& vertex)
{
    sigint thisParentId = this->get_parent(graph);
    sigint otherParentId = vertex.get_parent(graph);

    if (thisParentId == otherParentId) return;

    Vertex& thisParent = graph.nodes[thisParentId];
    Vertex& otherParent = graph.nodes[otherParentId];

    if (thisParent.rank < otherParent.rank)
    {
        thisParent.parent = otherParentId;
    }
    else if (thisParent.rank > otherParent.rank)
    {
        otherParent.parent = thisParentId;
    }
    else
    {
        otherParent.parent = thisParentId;
        thisParent.rank++;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
callq 0x4490
movl %eax, (%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4490
movl %eax, 0x4(%rsp)
cmpl %eax, (%rsp)
je 0x453d
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x3c50
movq %rax, %r14
leaq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0x3c50
movq 0xe8(%r14), %rcx
cmpq 0xe8(%rax), %rcx
jae 0x4528
movl 0x4(%rsp), %eax
movl %eax, 0xe0(%r14)
jmp 0x453d
movl (%rsp), %edx
movl %edx, 0xe0(%rax)
ja 0x453d
incq %rcx
movq %rcx, 0xe8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/Jiro-iwai[P]yuv2psnr/yuv2psnr.cpp
// Function: MSE(unsigned char*, unsigned char*, unsigned int, double&)
void MSE
( unsigned char* c0
, unsigned char* c1
, unsigned int min_read_unit
, double& MSE
)
{
  for( int i = 0; i < min_read_unit; i++ ) {
    unsigned char I = c0[i];
    unsigned char K = c1[i];
    int diff = I - K;
    MSE += diff*diff;
  }
}

// Assembly:
testl %edx, %edx
je 0x45c1
movsd (%rcx), %xmm0
movl %edx, %eax
xorl %edx, %edx
movzbl (%rdi,%rdx), %r8d
movzbl (%rsi,%rdx), %r9d
subl %r9d, %r8d
imull %r8d, %r8d
xorps %xmm1, %xmm1
cvtsi2sd %r8d, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, (%rcx)
incq %rdx
cmpq %rdx, %rax
jne 0x4598
retq
// File: /workspace/github_cpp_makefile_star2_O1/Jiro-iwai[P]yuv2psnr/yuv2psnr.cpp
// Function: MSE2PSNR(double, double)
double MSE2PSNR
( double MSE
, double MAX
)
{
  double PSNR = INFINITY;

  if( DBL_EPSILON < MSE ) {
    PSNR = 10 * log10( (MAX*MAX)/MSE );
  }

  return PSNR;
}

// Assembly:
ucomisd 0x6a46(%rip), %xmm0     # 0xb010
jbe 0x45eb
pushq %rax
mulsd %xmm1, %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x4170
mulsd 0x6a32(%rip), %xmm0     # 0xb018
addq $0x8, %rsp
retq
movsd 0x6a15(%rip), %xmm0     # 0xb008
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ahhgust[P]STRaitRazor/str8.cpp
// Function: initQvalLUT(char)
void
initQvalLUT(char qtype) {
  unsigned i;


  if (qtype == EDGAR_QUALITY) {
    // standard quality to probability (of error) computation
    // see https://en.wikipedia.org/wiki/Phred_quality_score
    // we do this A LOT
    // so let's make a LUT
    for(i = 0; i < MAXQVAL; ++i) {
      QUALITY_TO_ERRORPROB[i] = pow(10, i/-10.0);
    }

  } else if (qtype == EXPECT_QUALITY) {

    // we want exp( sum(log( prob correct )) ==
    // prod(prob correct) ==
    // prod(1.0 - prob incorrect)
    for(i = 0; i < MAXQVAL; ++i) {
      QUALITY_TO_ERRORPROB[i] = log(1.0 - pow(10, i/-10.0));
    }

  } else {
    fprintf(stderr, "Illegal quality flag: %u", (int)qtype);
    exit(EXIT_FAILURE);
  }

}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x1, %edi
je 0x3a20
cmpl $0x2, %edi
jne 0x3a63
leaq 0x62619b(%rip), %rbx    # 0x629b70
xorl %r14d, %r14d
xorps %xmm1, %xmm1
cvtsi2sd %r14d, %xmm1
divsd 0x7620(%rip), %xmm1     # 0xb008
movsd 0x7620(%rip), %xmm0     # 0xb010
callq 0x3470
movsd 0x761b(%rip), %xmm1     # 0xb018
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x3230
movsd %xmm0, (%rbx)
incq %r14
addq $0x8, %rbx
cmpq $0x100, %r14            # imm = 0x100
jne 0x39d8
jmp 0x3a5b
leaq 0x626149(%rip), %rbx    # 0x629b70
xorl %r14d, %r14d
xorps %xmm1, %xmm1
cvtsi2sd %r14d, %xmm1
divsd 0x75ce(%rip), %xmm1     # 0xb008
movsd 0x75ce(%rip), %xmm0     # 0xb010
callq 0x3470
movsd %xmm0, (%rbx)
incq %r14
addq $0x8, %rbx
cmpq $0x100, %r14            # imm = 0x100
jne 0x3a2a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movzbl %dil, %edi
callq 0x3520
// File: /workspace/github_cpp_makefile_star2_O1/Ahhgust[P]STRaitRazor/str8.cpp
// Function: getProbCorrect(char const*, unsigned int)
double
getProbCorrect(const char *qseq, unsigned stop) {

  unsigned i = 0;
  unsigned qval;

  double logsum=0.;

  for(i=0; i < stop && *qseq; ++i, ++qseq) {
    qval = *qseq - PHREDMINUS;
    if (qval < 0)
      qval = 0;
    else if (qval >= MAXQVAL)
      qval = MAXQVAL-1;
    // equivalent to: += log(1-error prob)
    // note that QUALITY_TO_ERRORPROB is constructed differently in this case
    logsum += QUALITY_TO_ERRORPROB[ qval ];
  }
  
  return exp(logsum);
}

// Assembly:
testl %esi, %esi
je 0x3ade
movl %esi, %eax
xorpd %xmm0, %xmm0
xorl %ecx, %ecx
movl $0xff, %edx
leaq 0x6260bd(%rip), %rsi    # 0x629b70
movsbl (%rdi,%rcx), %r8d
testl %r8d, %r8d
je 0x3490
addl $-0x21, %r8d
cmpl %edx, %r8d
cmovael %edx, %r8d
addsd (%rsi,%r8,8), %xmm0
incq %rcx
cmpl %ecx, %eax
jne 0x3ab3
jmp 0x3490
xorps %xmm0, %xmm0
jmp 0x3490
// File: /workspace/github_cpp_makefile_star2_O1/Ahhgust[P]STRaitRazor/str8.cpp
// Function: printReportsMT(_IO_FILE*)
void
printReportsMT(FILE *stream) {
  int i;
  // merge the maps
  for (i=1 ; i < opt.numThreads; ++i) {
    Matches::iterator itr = matches[i].begin();
    // sum up all of the unique haplotypes itr->first
    // with their associated frequency counts
    for( ; itr != matches[i].end(); ++itr) {
      matches[0][ itr->first ].first += itr->second.first;
      matches[0][ itr->first ].second += itr->second.second;
    }
  }
  printReports(stream, matches[0], opt.minPrint,opt.noReverseComplement);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x2, 0xb104(%rip)      # 0xf2e8
jl 0x425f
movl $0x1, %r12d
movq 0x6261cd(%rip), %rdi    # 0x62a3c0
leaq (%r12,%r12,2), %r13
shlq $0x4, %r13
leaq (%rdi,%r13), %rax
addq $0x8, %rax
movq 0x10(%rax), %r14
cmpq %rax, %r14
je 0x4250
leaq 0x20(%r14), %r15
movl 0x38(%r14), %ebp
movq %r15, %rsi
callq 0x6c84
addl %ebp, (%rax)
movl 0x3c(%r14), %ebp
movq 0x626197(%rip), %rdi    # 0x62a3c0
movq %r15, %rsi
callq 0x6c84
addl %ebp, 0x4(%rax)
movq %r14, %rdi
callq 0x31d0
movq %rax, %r14
movq 0x62617a(%rip), %rdi    # 0x62a3c0
leaq (%rdi,%r13), %rax
addq $0x8, %rax
jmp 0x4207
incq %r12
movslq 0xb08e(%rip), %rax      # 0xf2e8
cmpq %rax, %r12
jl 0x41ec
movq 0x62615a(%rip), %rsi    # 0x62a3c0
movl 0xb05c(%rip), %edx      # 0xf2c8
movzbl 0xb05c(%rip), %ecx      # 0xf2cf
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3b40
// File: /workspace/github_cpp_makefile_star2_O1/Ahhgust[P]STRaitRazor/str8.cpp
// Function: revcompCstring(char const*, int)
char *
revcompCstring(const char *dna, int len) {
  char *revcompd = new char[ len + 1 ];
  revcompd[len]=0;
  int j=len-1;
  int i=0;
  char c;
  for ( ; i < len; ++i, --j) {
    c = dna[j];
    if (c=='A')
      revcompd[i] = 'T';
    else if (c=='T')
      revcompd[i] = 'A';
    else if (c=='G')
      revcompd[i] = 'C';
    else if (c=='C')
      revcompd[i] = 'G';
    else
      revcompd[i] = c;

  }
  return revcompd;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leal 0x1(%r14), %eax
movslq %eax, %rdi
callq 0x3030
movslq %r14d, %rcx
movb $0x0, (%rax,%rcx)
testl %ecx, %ecx
jle 0x44fb
movl %r14d, %ecx
movq %rax, %rdx
movb -0x1(%rbx,%rcx), %sil
movzbl %sil, %edi
cmpl $0x46, %edi
jg 0x44d6
cmpl $0x41, %edi
je 0x44e5
cmpl $0x43, %edi
jne 0x44ed
movb $0x47, %sil
jmp 0x44ed
cmpl $0x47, %edi
je 0x44ea
cmpl $0x54, %edi
jne 0x44ed
movb $0x41, %sil
jmp 0x44ed
movb $0x54, %sil
jmp 0x44ed
movb $0x43, %sil
decq %rcx
movb %sil, (%rdx)
incq %rdx
testq %rcx, %rcx
jne 0x44b9
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ahhgust[P]STRaitRazor/str8.cpp
// Function: findMatchesOneThread()
void
findMatchesOneThread() {

  bool done=false;

    // a ceiling on the number of matches you can find on a single pass through the trie
  unsigned *matchIds = new unsigned[ numStrs * 4];
  unsigned char *matchTypes = new unsigned char[ numStrs * 4];
  
  records = MEM; // we're only using one of the buffers...
  qrecords=QMEM;
  while (!done) {
    done = buffer(MEM, QMEM);
    processDNA_Trie(0, matchIds, matchTypes);
  }
    
  delete [] matchIds;
  delete [] matchTypes;

  printReports(opt.out, matches[0], opt.minPrint,opt.noReverseComplement);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x624e1b(%rip), %r14d   # 0x62a380
shll $0x2, %r14d
leaq (,%r14,4), %rdi
callq 0x3030
movq %rax, %rbx
movq %r14, %rdi
callq 0x3030
movq %rax, %r14
leaq 0x9d75(%rip), %r15      # 0xf300
movq %r15, 0x62456e(%rip)    # 0x629b00
leaq 0x317167(%rip), %r12    # 0x31c700
movq %r12, 0x624568(%rip)    # 0x629b08
movq %r15, %rdi
movq %r12, %rsi
callq 0x4289
movl %eax, %ebp
xorl %edi, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x4927
testb %bpl, %bpl
je 0x55a0
movq %rbx, %rdi
callq 0x3360
movq %r14, %rdi
callq 0x3360
movq 0x9d02(%rip), %rdi      # 0xf2d8
movq 0x624de3(%rip), %rsi    # 0x62a3c0
movl 0x9ce5(%rip), %edx      # 0xf2c8
movzbl 0x9ce5(%rip), %ecx      # 0xf2cf
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3b40
// File: /workspace/github_cpp_makefile_star2_O1/Ahhgust[P]STRaitRazor/str8.cpp
// Function: writerThread(void*)
void *
writerThread(void *arg) {
  
  done=buffer(MEM, QMEM); // read in a bunch of data
  if (done)
    nextdone = true;

  records = MEM; // set up the pointer
  qrecords=QMEM;
  
  workersWorking= opt.numThreads; // let the workers start processing the data

  unsigned i=0;
  while (! nextdone) {
    ++i;

    if (records == MEM) 
      nextdone=buffer(OTHERMEM, OTHERQMEM);
    else 
      nextdone=buffer(MEM, QMEM);

    buffered=1; // the double buffer is set up

    if (nextdone) {
      break; // no sense waiting...
    }

#ifdef OSX
    sem_wait(writersLock); // wait for the readers to finish reading *records
#else
    sem_wait(&writersLock); // wait for the readers to finish reading *records
#endif
  }

  return NULL;

}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x914d(%rip), %rbx      # 0xf300
leaq 0x316546(%rip), %r14    # 0x31c700
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4289
xchgb %al, 0x912d(%rip)       # 0xf2f8
movb 0x9127(%rip), %al       # 0xf2f8
testb $0x1, %al
je 0x61dd
movb $0x1, %al
xchgb %al, 0x911c(%rip)       # 0xf2f9
movq %rbx, 0x62391c(%rip)    # 0x629b00
movq %r14, 0x62391d(%rip)    # 0x629b08
movl 0x90f7(%rip), %eax      # 0xf2e8
xchgl %eax, 0x623969(%rip)    # 0x629b60
movb 0x90fc(%rip), %al       # 0xf2f9
testb $0x1, %al
jne 0x6263
leaq 0x18faf8(%rip), %r14    # 0x195d00
leaq 0x49cef1(%rip), %r15    # 0x4a3100
leaq 0x62392a(%rip), %r12    # 0x629b40
leaq 0x3164e3(%rip), %r13    # 0x31c700
cmpq %rbx, 0x6238dc(%rip)    # 0x629b00
je 0x622e
movq %rbx, %rdi
movq %r13, %rsi
jmp 0x6234
movq %r14, %rdi
movq %r15, %rsi
callq 0x4289
xchgb %al, 0x90ba(%rip)       # 0xf2f9
movb $0x1, %al
xchgb %al, 0x62391d(%rip)     # 0x629b64
movb 0x90ac(%rip), %al       # 0xf2f9
testb $0x1, %al
jne 0x6263
movq %r12, %rdi
callq 0x3190
movb 0x909a(%rip), %al       # 0xf2f9
testb $0x1, %al
je 0x621d
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ahhgust[P]STRaitRazor/str8.cpp
// Function: CompareReport::operator()(Report const&, Report const&) const
bool operator() (const Report &a, const Report &b) const {
    //TODO: Handle string/float pair instead of lexicographic ordering

    unsigned i1 = a.strIndex;
    unsigned i2 = b.strIndex;

    // different loci
    if (i2 < i1) 
      return false;
    else if (i1 < i2) 
      return true;


    // different haplotype lengths; ergo different haplotypes
    if (a.hapLength < b.hapLength)
      return true;
    else if (a.hapLength > b.hapLength)
      return false;

    // one haplotype has nonstandard letters and the other does not.    
    if (a.nonstandardLetters == false && b.nonstandardLetters==true)
      return false;
    else if (a.nonstandardLetters == true && b.nonstandardLetters==false)
      return true;

    if (a.nonstandardLetters==false) { // compare binary words

    // compute the (min) length in binarywords of the two haplotypes
      unsigned i, lengthInWords = ceil( min(a.hapLength, b.hapLength)/ (MAXWORD/2.0));
      binaryword *b1 = a.haplotype;
      binaryword *b2 = b.haplotype;
      
      for (i=0; i < lengthInWords; ++i, ++b1, ++b2) {
        if (*b1 < *b2)
          return true;
        else if (*b1 > *b2)
          return false;
      }

    } else { // compare char*s
      char *b1 = (char*) a.haplotype;
      char *b2 = (char*) b.haplotype;

      for (int i=0; i < a.hapLength; ++i, ++b1, ++b2) {
        if (*b1 < *b2)
          return true;
        else if (*b1 > *b2)
          return false;
      }
    }

    return false;
    
  }

// Assembly:
movl (%rsi), %eax
movl (%rdx), %ecx
cmpl %eax, %ecx
jae 0x7d7d
xorl %eax, %eax
jmp 0x7e8e
movb $0x1, %al
ja 0x7e8e
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movl 0x14(%rsi), %ecx
movl 0x14(%rdx), %edx
cmpl %edx, %ecx
jl 0x7e87
cmpl %edx, %ecx
jle 0x7da8
xorl %eax, %eax
jmp 0x7e87
movb 0x10(%rbx), %dl
testb %dl, %dl
jne 0x7db6
cmpb $0x0, 0x10(%r14)
jne 0x7da1
testb %dl, %dl
je 0x7dc5
cmpb $0x0, 0x10(%r14)
je 0x7e87
testb %dl, %dl
je 0x7e16
testl %ecx, %ecx
setg %dl
jle 0x7e73
movq 0x8(%r14), %rsi
movq 0x8(%rbx), %rdi
movb (%rdi), %r9b
movb (%rsi), %r10b
movb $0x1, %al
cmpb %r10b, %r9b
jl 0x7e73
movl $0x1, %r8d
cmpb %r10b, %r9b
jg 0x7e91
cmpl %ecx, %r8d
setl %dl
je 0x7e73
movb (%rdi,%r8), %r9b
movb (%rsi,%r8), %r10b
incq %r8
cmpb %r10b, %r9b
jge 0x7df3
jmp 0x7e73
cvtsi2sd %ecx, %xmm0
mulsd 0x31fe(%rip), %xmm0     # 0xb020
callq 0x3080
cvttsd2si %xmm0, %rdx
testl %edx, %edx
setne %cl
je 0x7e7e
movq 0x8(%r14), %rsi
movq 0x8(%rbx), %rdi
movq (%rdi), %r10
movq (%rsi), %r11
movb $0x1, %al
cmpq %r11, %r10
jb 0x7e7e
movl %edx, %r8d
movl $0x1, %r9d
cmpq %r11, %r10
ja 0x7e95
cmpl %edx, %r9d
setb %cl
cmpl %r9d, %r8d
je 0x7e7e
movq (%rdi,%r9,8), %r10
movq (%rsi,%r9,8), %r11
incq %r9
cmpq %r11, %r10
jae 0x7e51
jmp 0x7e7e
testb $0x1, %dl
je 0x7da1
jmp 0x7e87
testb $0x1, %cl
je 0x7da1
addq $0x8, %rsp
popq %rbx
popq %r14
andb $0x1, %al
retq
xorl %eax, %eax
jmp 0x7e73
xorl %eax, %eax
jmp 0x7e7e
nop
// File: /workspace/github_cpp_makefile_star2_O1/Ahhgust[P]STRaitRazor/lookup.cpp
// Function: setLetter(unsigned long, char, unsigned int)
binaryword
setLetter(binaryword w, char letter, unsigned pos) {


  pos = MAXWORD - 2 - (pos + pos);
  

  if (letter == 'A') { // clear two bits
    w &= ~( ((binaryword)3) << pos);
  } else if (letter == 'C') { // C is 01 in this schema
    w |= ((binaryword)1) << (pos); // set 1 bit to 1
    w &= ~( ((binaryword)1) << (pos+1)); // set the next bit to 0
  } else if (letter == 'G') {
    w |= ((binaryword)1) << (pos+1); //  and vice versa
    w &= ~( ((binaryword)1) << (pos)); //
  } else { // setting two bits
    w |= ((binaryword)3) << (pos);
  }

  return w;
}

// Assembly:
addl %edx, %edx
movl $0x3e, %ecx
subl %edx, %ecx
cmpl $0x47, %esi
je 0x958d
cmpl $0x43, %esi
je 0x957f
movl $0x3, %eax
shlq %cl, %rax
cmpl $0x41, %esi
jne 0x959d
notq %rax
andq %rdi, %rax
retq
btsq %rcx, %rdi
movb $0x3f, %al
subb %dl, %al
btrq %rax, %rdi
jmp 0x9599
movb $0x3f, %al
subb %dl, %al
btsq %rax, %rdi
btrq %rcx, %rdi
movq %rdi, %rax
retq
orq %rdi, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ahhgust[P]STRaitRazor/lookup.cpp
// Function: gatcToLong(char*, unsigned int)
binaryword
gatcToLong(char *s, unsigned numChars) {

  unsigned i;
  binaryword num=0;


  for (i=0; i < numChars; ++i, ++s) {
    num = setLetter(num, *s, i);
  }

  return num;
}

// Assembly:
testl %esi, %esi
je 0x95ec
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl %esi, %r15d
xorl %r14d, %r14d
xorl %eax, %eax
movsbl (%rbx,%r14), %esi
movq %rax, %rdi
movl %r14d, %edx
callq 0x9558
incq %r14
cmpl %r14d, %r15d
jne 0x95ce
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ahhgust[P]STRaitRazor/lookup.cpp
// Function: longToGatc(unsigned long, unsigned int, char*)
void
longToGatc(binaryword num, unsigned numChars, char *buffer) {
  unsigned i;

  memset(buffer, 'A', numChars); // initialize to 'A' (ie, 0)
  
  for (i=0; i < numChars; ++i, ++buffer) {
    *buffer = getLetter(num, i);
  }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movl %esi, %r15d
movq %rdx, %rdi
movl $0x41, %esi
movq %r15, %rdx
callq 0x3180
testl %ebp, %ebp
je 0x964c
addq %r15, %r15
movl $0x3e, %edx
movl %edx, %ecx
andb $-0x2, %cl
movq %r14, %rax
shrq %cl, %rax
shll $0x3, %eax
movl $0x54474341, %esi       # imm = 0x54474341
movl %eax, %ecx
shrl %cl, %esi
movb %sil, (%rbx)
incq %rbx
leaq (%r15,%rdx), %rax
addq $-0x2, %rax
addq $-0x2, %rdx
cmpq $0x3e, %rax
jne 0x961d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq