LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/nicluo[P]sorting-numbers/generate.cpp
// Function: main
int main(int argc, char *argv[]) {
    /* Must provide -n and -o argument */
    if (argc != 5 || strncmp(argv[1], "-n", 3) != 0 || strncmp(argv[3], "-o", 3) != 0) {
        printUsage(argv[0]);
        return 1;
    }
    
    /* Parse n */
    int n = 10;
    
    try {
        int nArg = std::stoi(argv[2]);
        n = nArg;
    } catch (std::invalid_argument &e) {
        printInvalidArgument();
        printUsage(argv[0]);
        return 1;
    }
    
    /* Open output file */
    char* outputFilename = argv[4];
    std::ofstream out;
    out.open(outputFilename, std::ofstream::out);
    
    /* Seed random number generator with current time */
    std::srand(std::time(0));
    
    /* Print n random numbers */
    for (int i = 0; i < n; i++) {
        out << std::rand() << "\n";
    }
    
    /* Flush and close output file */
    out.close();
        
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %rbx
cmpl $0x5, %edi
jne 0x1372
movq 0x8(%rbx), %rax
cmpb $0x2d, (%rax)
jne 0x1372
cmpb $0x6e, 0x1(%rax)
jne 0x1372
cmpb $0x0, 0x2(%rax)
jne 0x1372
movq 0x18(%rbx), %rax
cmpb $0x2d, (%rax)
jne 0x1372
cmpb $0x6f, 0x1(%rax)
jne 0x1372
cmpb $0x0, 0x2(%rax)
je 0x138b
movq (%rbx), %rdi
callq 0x12dc
pushq $0x1
popq %rax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x14ba
leaq 0x8(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x149e
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x1090
movq 0x20(%rbx), %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x1170
pushq $0x10
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1040
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x10f0
movl %eax, %edi
callq 0x1100
testl %ebp, %ebp
cmovgl %ebp, %r15d
leaq 0x8(%rsp), %rbx
leaq 0xc48(%rip), %r14       # 0x2043
subl $0x1, %r15d
jb 0x141d
callq 0x1050
movq %rbx, %rdi
movl %eax, %esi
callq 0x1180
movq %rax, %rdi
movq %r14, %rsi
callq 0x1110
jmp 0x13fb
leaq 0x8(%rsp), %rdi
callq 0x1120
leaq 0x8(%rsp), %rdi
callq 0x1140
xorl %eax, %eax
jmp 0x137d
movq %rdx, %r15
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x1090
jmp 0x1450
movq %rdx, %r15
movq %rax, %r14
cmpl $0x1, %r15d
jne 0x1496
movq %r14, %rdi
callq 0x1070
callq 0x1316
movq (%rbx), %rdi
callq 0x12dc
callq 0x1160
jmp 0x137a
movq %rax, %r14
callq 0x1160
jmp 0x1496
movq %rax, %rdi
callq 0x14f5
jmp 0x1489
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x1140
movq %r14, %rdi
callq 0x1190
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, 0xc(%rsp)
movl %edx, 0x8(%rsp)
cmpl %edx, %esi
je 0x2641
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
callq 0x26dc
testb %al, %al
jne 0x25ea
movq %rbx, %rdi
movl %r14d, %esi
callq 0x264c
movq %rbx, %rdi
movl %ebp, %esi
callq 0x26dc
testb %al, %al
jne 0x2602
movq %rbx, %rdi
movl %ebp, %esi
callq 0x264c
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2a44
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
movq %rax, %r14
callq 0x2a44
leaq 0x10(%rsp), %rsi
leaq 0x8(%rax), %rdi
movq %rax, %r15
movq %r14, (%rsi)
callq 0x2a80
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x4370
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movl %esi, 0x4(%rsp)
movl %edx, (%rsp)
callq 0x26dc
testb %al, %al
je 0x26cf
leaq 0x4(%rsp), %rsi
movq %r15, %rdi
callq 0x2a44
movq %rax, %r14
movq %rax, %rbx
addq $0x8, %r14
movq %rsp, %rsi
movq %r15, %rdi
callq 0x2a44
movq %rax, %r15
xorl %r12d, %r12d
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r12
jae 0x26cf
cmpq %r15, (%rax,%r12,8)
jne 0x26ca
leaq (%rax,%r12,8), %rsi
movq %r14, %rdi
callq 0x26f4
decq %r12
incq %r12
jmp 0x26a1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Kobzol[P]sigmod-2016/src/job.h
// Function: JobQueue::add_job(JobType, unsigned int, unsigned int)
void add_job(JobType type, sigint from, sigint to)
    {
        std::unique_lock<std::mutex> guard(this->lock);

#ifdef THREAD_USE_JOB_SYNC
        while (this->size >= this->jobs.capacity)
        {
            this->bufferFull.wait(guard);
        }
#endif

        Barrier* barrier = this->barrier;
        Barrier* modifyBarrier = barrier;
        bool allocated = false;

        if (type != JobType::Query || this->barrier->modification)
        {
            Barrier* newBarrier = &BarrierMemory[BarrierIndex++];
            assert(BarrierIndex < BARRIER_BUFFER_COUNT);
            newBarrier->modification = type != JobType::Query;
            newBarrier->waiting = 1;
            modifyBarrier = newBarrier;
            this->barrier = modifyBarrier;
        }
        else if (!this->barrier->modification)
        {
            barrier->push();
        }

        this->jobs[this->end] = Job(type, from, to, barrier, modifyBarrier, allocated);
        this->end = (this->end + 1) % this->jobs.size;

        this->size++;

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

        assert(this->size <= this->jobs.capacity);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %r15d
leaq 0xb0(%rdi), %rsi
leaq 0x8(%rsp), %r12
movq %rdi, %rbx
movl %ecx, %ebp
movl %edx, %r14d
movq %r12, %rdi
callq 0x328e
leaq 0x130(%rbx), %r13
movq 0x98(%rbx), %rax
cmpq 0xe0(%rbx), %rax
jb 0x333b
movq %r13, %rdi
movq %r12, %rsi
callq 0x2070
jmp 0x331e
movq 0xf0(%rbx), %rax
testl %r15d, %r15d
jne 0x3350
cmpb $0x1, (%rax)
jne 0x342d
movq 0x312279(%rip), %rdx    # 0x3155d0
leaq 0x1(%rdx), %rcx
movq %rcx, 0x31226e(%rip)    # 0x3155d0
cmpq $0x30d40, %rcx          # imm = 0x30D40
jae 0x3452
shlq $0x4, %rdx
leaq 0x4e56(%rip), %rsi      # 0x81d0
testl %r15d, %r15d
leaq (%rsi,%rdx), %rcx
setne (%rdx,%rsi)
movq $0x1, 0x8(%rdx,%rsi)
movq %rcx, 0xf0(%rbx)
movq 0x31223c(%rip), %rdx    # 0x3155d8
leaq 0x1(%rdx), %rsi
movq %rsi, 0x312231(%rip)    # 0x3155d8
movslq 0xa8(%rbx), %rsi
movq 0xe8(%rbx), %rdi
imulq $0x30, %rsi, %rsi
movq %rdx, (%rdi,%rsi)
movl %r15d, 0x8(%rdi,%rsi)
movl %r14d, 0xc(%rdi,%rsi)
movl %ebp, 0x10(%rdi,%rsi)
movq %rax, 0x18(%rdi,%rsi)
movq %rcx, 0x20(%rdi,%rsi)
movb $0x0, 0x28(%rdi,%rsi)
xorl %edx, %edx
leaq 0x68(%rbx), %rdi
movq 0xa8(%rbx), %rax
incq %rax
divq 0xd8(%rbx)
movq %rdx, 0xa8(%rbx)
incq 0x98(%rbx)
callq 0x20e0
movq 0x98(%rbx), %rax
cmpq 0xe0(%rbx), %rax
ja 0x3439
leaq 0x8(%rsp), %rdi
callq 0x32d4
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incq 0x8(%rax)
movq %rax, %rcx
jmp 0x3395
leaq 0x1dd8(%rip), %rdi      # 0x5218
leaq 0x1d97(%rip), %rsi      # 0x51de
leaq 0x1d9a(%rip), %rcx      # 0x51e8
pushq $0x7b
jmp 0x3469
leaq 0x1d61(%rip), %rdi      # 0x51ba
leaq 0x1d7e(%rip), %rsi      # 0x51de
leaq 0x1d81(%rip), %rcx      # 0x51e8
pushq $0x67
popq %rdx
callq 0x2110
nop
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x31236a(%rip), %r14    # 0x315848
leaq 0x8(%rsp), %r15
leaq 0x3120f6(%rip), %r12    # 0x3155e0
movq %rdi, %rbx
cmpb $0x0, 0x8(%rbx)
jne 0x354e
movq %r15, %rdi
movq %r14, %rsi
callq 0x35e8
movl 0x10(%rsp), %eax
movl 0x14(%rsp), %esi
movl 0x18(%rsp), %edx
cmpl $0x2, %eax
je 0x351e
cmpl $0x1, %eax
jne 0x352a
movq %r12, %rdi
callq 0x25b8
jmp 0x3526
movq %r12, %rdi
callq 0x265e
xorl %edx, %edx
jmp 0x3541
movq 0x8(%rsp), %rax
movq (%rbx), %rcx
movl %esi, %edi
movl %edx, %esi
movq %rax, %rdx
callq 0x36b0
movq %rax, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x383c
jmp 0x34ed
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
addq $0xb0, %rsi
movq %rdi, %rbx
movq %rsp, %r15
movq %r15, %rdi
callq 0x328e
leaq 0x68(%r14), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3924
movq 0xa0(%r14), %rax
movq 0xe8(%r14), %rcx
movslq %eax, %rdx
incq %rax
imulq $0x30, %rdx, %rdx
vmovups (%rcx,%rdx), %ymm0
vmovups 0x10(%rcx,%rdx), %ymm1
xorl %edx, %edx
vmovups %ymm1, 0x10(%rbx)
vmovups %ymm0, (%rbx)
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 0x3684
addq $0x130, %r14            # imm = 0x130
movq %r14, %rdi
vzeroupper
callq 0x20e0
movq %rsp, %rdi
vzeroupper
callq 0x32d4
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rsp, %rdi
movq %rax, %rbx
callq 0x32d4
movq %rbx, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
leaq 0xb0(%rdi), %rbx
movq %rdi, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rbx, %rdi
callq 0x3f0e
cmpl $0x0, 0x8(%r15)
jne 0x3881
movq (%r15), %rax
leaq 0x8(%rsp), %rsi
leaq 0x100(%r14), %rdi
movq %rax, (%rsi)
movq %r12, 0x8(%rsi)
callq 0x3f22
movq 0x20(%r15), %rax
leaq 0x68(%r14), %rdi
decq 0x8(%rax)
decq (%r14)
callq 0x20e0
cmpb $0x1, 0x60(%r14)
jne 0x38fa
cmpq $0x0, 0x98(%r14)
jne 0x38fa
cmpq $0x0, (%r14)
jne 0x38fa
leaq 0x8(%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0x328e
leaq 0x30(%r14), %rdi
callq 0x20e0
xorl %eax, %eax
movb %al, 0x60(%r14)
movb %al, 0x4901(%rip)       # 0x81d0
andq $0x0, 0x4901(%rip)      # 0x81d8
leaq 0x8(%rsp), %rdi
leaq 0x48ed(%rip), %rax      # 0x81d0
movq $0x1, 0x311ce2(%rip) # 0x3155d0
movq %rax, 0xf0(%r14)
callq 0x32d4
movq %rbx, %rdi
callq 0x2170
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x3910
movq %rbx, %rdi
movq %rax, %r14
callq 0x2170
movq %r14, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
movq 0x10(%rdi), %r12
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x30
popq %r13
movq %rsi, %rax
mulq %r13
pushq $-0x1
popq %rdi
cmovnoq %rax, %rdi
callq 0x2030
movq %rax, %r15
testq %r12, %r12
je 0x41b5
testq %rbx, %rbx
je 0x4196
imulq $0x30, %rbx, %rax
xorl %edx, %edx
vpmovsxbq 0x102e(%rip), %zmm1 # 0x5148
vpmovsxbq 0x102c(%rip), %zmm2 # 0x5150
vpbroadcastd 0x1016(%rip), %zmm3 # 0x5144
vpmovsxwd 0x1030(%rip), %zmm4 # 0x5168
xorl %ecx, %ecx
addq $-0x30, %rax
divq %r13
movabsq $0xffffffffffffff0, %rdx # imm = 0xFFFFFFFFFFFFFF0
leaq 0x10(%rax), %rsi
vpbroadcastq %rax, %zmm0
movq %r15, %rax
andq %rsi, %rdx
vpbroadcastq %rcx, %zmm5
addq $0x10, %rcx
vporq %zmm1, %zmm5, %zmm6
vporq %zmm2, %zmm5, %zmm5
vpcmpleuq %zmm0, %zmm5, %k0
vpcmpleuq %zmm0, %zmm6, %k1
kunpckbw %k0, %k1, %k1
vpscatterdd %zmm3, 0x8(%rax,%zmm4) {%k1}
addq $0x300, %rax            # imm = 0x300
cmpq %rcx, %rdx
jne 0x415b
imulq $0x30, (%r14), %rdx
movq %r15, %rdi
movq %r12, %rsi
vzeroupper
callq 0x2190
movq %r12, %rdi
callq 0x2220
jmp 0x424a
testq %rbx, %rbx
je 0x424a
imulq $0x30, %rbx, %rax
xorl %edx, %edx
vpmovsxbq 0xf7a(%rip), %zmm1 # 0x5148
vpmovsxbq 0xf78(%rip), %zmm2 # 0x5150
vpbroadcastd 0xf62(%rip), %zmm3 # 0x5144
vpmovsxwd 0xf7c(%rip), %zmm4 # 0x5168
xorl %ecx, %ecx
addq $-0x30, %rax
divq %r13
movabsq $0xffffffffffffff0, %rdx # imm = 0xFFFFFFFFFFFFFF0
leaq 0x10(%rax), %rsi
vpbroadcastq %rax, %zmm0
movq %r15, %rax
andq %rsi, %rdx
vpbroadcastq %rcx, %zmm5
addq $0x10, %rcx
vporq %zmm1, %zmm5, %zmm6
vporq %zmm2, %zmm5, %zmm5
vpcmpleuq %zmm0, %zmm5, %k0
vpcmpleuq %zmm0, %zmm6, %k1
kunpckbw %k0, %k1, %k1
vpscatterdd %zmm3, 0x8(%rax,%zmm4) {%k1}
addq $0x300, %rax            # imm = 0x300
cmpq %rcx, %rdx
jne 0x420f
movq %r15, 0x10(%r14)
movq %rbx, 0x8(%r14)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
vzeroupper
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %rbx
callq 0x4334
movl %eax, %ebp
movl %eax, 0xc(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4334
movl %eax, 0x8(%rsp)
cmpl %eax, %ebp
je 0x43ec
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x39aa
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
movq %rax, %r14
callq 0x39aa
movq 0xe8(%r14), %rcx
cmpq 0xe8(%rax), %rcx
jae 0x43d6
movl 0x8(%rsp), %eax
movl %eax, 0xe0(%r14)
jmp 0x43ec
movl 0xc(%rsp), %edx
movl %edx, 0xe0(%rax)
ja 0x43ec
incq %rcx
movq %rcx, 0xe8(%r14)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
movsd (%rcx), %xmm0
movl %edx, %eax
xorl %edx, %edx
cmpq %rdx, %rax
je 0x460c
movzbl (%rdi,%rdx), %r8d
movzbl (%rsi,%rdx), %r9d
subl %r9d, %r8d
imull %r8d, %r8d
cvtsi2sd %r8d, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, (%rcx)
incq %rdx
jmp 0x45e4
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x49fb(%rip), %xmm0     # 0x9010
jbe 0x4636
pushq %rax
mulsd %xmm1, %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x4190
mulsd 0x49e7(%rip), %xmm0     # 0x9018
addq $0x8, %rsp
retq
movsd 0x49ca(%rip), %xmm0     # 0x9008
retq
// File: /workspace/github_cpp_makefile_star2_O2/Jiro-iwai[P]yuv2psnr/yuv2psnr.cpp
// Function: parse_option(int, char**, Option&)
void parse_option
( int argc
, char* argv[]
, Option& opt
)
{
  for( int i = 1; i < argc; i++ ) {

    string op = argv[i];
    
    if( op == "-w" ) {
      i++;
      opt.width = boost::lexical_cast<int>(argv[i]);
    } else if( op == "-h" ) {
      i++;
      opt.height = boost::lexical_cast<int>(argv[i]);
    } else if( op == "-i0" ) {
      i++;
      opt.file0 = argv[i];
    } else if( op == "-i1" ) {
      i++;
      opt.file1 = argv[i];
    } else if( op == "-v" ) {
      opt.showFrame = true;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
leaq 0x28(%rdx), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rdx), %rax
movq %rax, 0x10(%rsp)
pushq $0x1
popq %r15
leaq 0x18(%rsp), %r13
cmpl %ebp, %r15d
jge 0x474e
movslq %r15d, %r12
movq (%r14,%r12,8), %rsi
movq %r13, %rdi
leaq 0x7(%rsp), %rdx
callq 0x4100
movq %r13, %rdi
leaq 0x4aad(%rip), %rsi      # 0x9144
callq 0x4d12
testb %al, %al
je 0x46b4
leaq (%r14,%r12,8), %rdi
addq $0x8, %rdi
callq 0x4d1f
incl %r15d
movl %eax, (%rbx)
jmp 0x4725
movq %r13, %rdi
leaq 0x4a89(%rip), %rsi      # 0x9147
callq 0x4d12
testb %al, %al
je 0x46dc
leaq (%r14,%r12,8), %rdi
addq $0x8, %rdi
callq 0x4d1f
incl %r15d
movl %eax, 0x4(%rbx)
jmp 0x4725
movq %r13, %rdi
leaq 0x4a64(%rip), %rsi      # 0x914a
callq 0x4d12
testb %al, %al
je 0x4700
movq 0x8(%r14,%r12,8), %rsi
movq 0x10(%rsp), %rdi
callq 0x4470
jmp 0x4722
movq %r13, %rdi
leaq 0x4a44(%rip), %rsi      # 0x914e
callq 0x4d12
testb %al, %al
je 0x4735
movq 0x8(%r14,%r12,8), %rsi
movq 0x8(%rsp), %rdi
callq 0x4470
incl %r15d
movq %r13, %rdi
callq 0x4160
incl %r15d
jmp 0x4670
movq %r13, %rdi
leaq 0x4a13(%rip), %rsi      # 0x9152
callq 0x4d12
testb %al, %al
je 0x4725
movb $0x1, 0x48(%rbx)
jmp 0x4725
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x4160
movq %rbx, %rdi
callq 0x4430
// File: /workspace/github_cpp_makefile_star2_O2/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 0x386d
cmpl $0x2, %edi
jne 0x38af
leaq 0x62632b(%rip), %rbx    # 0x629b50
xorl %r14d, %r14d
cmpq $0x100, %r14            # imm = 0x100
je 0x38a7
cvtsi2sd %r14d, %xmm1
divsd 0x67ca(%rip), %xmm1     # 0xa008
movsd 0x67ca(%rip), %xmm0     # 0xa010
callq 0x3430
movsd 0x67c5(%rip), %xmm1     # 0xa018
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x31f0
movsd %xmm0, (%rbx)
incq %r14
addq $0x8, %rbx
jmp 0x3828
leaq 0x6262dc(%rip), %rbx    # 0x629b50
xorl %r14d, %r14d
cmpq $0x100, %r14            # imm = 0x100
je 0x38a7
cvtsi2sd %r14d, %xmm1
divsd 0x677b(%rip), %xmm1     # 0xa008
movsd 0x677b(%rip), %xmm0     # 0xa010
callq 0x3430
movsd %xmm0, (%rbx)
incq %r14
addq $0x8, %rbx
jmp 0x3877
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movsbl %dil, %edx
movq 0xb70e(%rip), %rax      # 0xefc8
movq (%rax), %rdi
leaq 0x67f8(%rip), %rsi      # 0xa0bc
xorl %eax, %eax
callq 0x3340
pushq $0x1
popq %rdi
callq 0x32e0
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x1
popq %r12
movslq 0xb3a1(%rip), %rax      # 0xf2c8
movq 0x626472(%rip), %rsi    # 0x62a3a0
cmpq %rax, %r12
jge 0x3f8d
imulq $0x30, %r12, %r13
movq 0x18(%rsi,%r13), %r14
leaq (%rsi,%r13), %rax
addq $0x8, %rax
cmpq %rax, %r14
je 0x3f88
leaq 0x20(%r14), %r15
movl 0x38(%r14), %ebp
movq %rsi, %rdi
movq %r15, %rsi
callq 0x5fcc
addl %ebp, (%rax)
movl 0x3c(%r14), %ebp
movq 0x626437(%rip), %rdi    # 0x62a3a0
movq %r15, %rsi
callq 0x5fcc
addl %ebp, 0x4(%rax)
movq %r14, %rdi
callq 0x31a0
movq %rax, %r14
movq 0x62641a(%rip), %rsi    # 0x62a3a0
jmp 0x3f3c
incq %r12
jmp 0x3f20
movl 0xb315(%rip), %edx      # 0xf2a8
movzbl 0xb315(%rip), %ecx      # 0xf2af
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3994
// File: /workspace/github_cpp_makefile_star2_O2/Ahhgust[P]STRaitRazor/str8.cpp
// Function: buffer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
bool
buffer(string mem[], string qmem[]) {

  unsigned i=0;
  string dummy;

  while (getline(*currentInputStream, mem[i])) {
    getline(*currentInputStream, mem[i]); // read in the DNA string
    // added by AW: Force to upper-case
    for (char & c : mem[i])
      c = toupper(c);

    getline(*currentInputStream, dummy); // the +
    getline(*currentInputStream, qmem[i]); // the quality string (ignored)
    ++i;
    if (i == RECSINMEM) {
      
      int c = currentInputStream->peek();
      if (c == EOF) {
        LASTREC = RECSINMEM;
        return 1;
      }
      return 0;
    }
  }
  

  LASTREC = i;
  for ( ; i < RECSINMEM; ++i) {
    mem[i].clear();
    qmem[i].clear();
  }
  
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
pushq $0x8
popq %rbp
xorl %r15d, %r15d
movq %rsi, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
movq 0x625b04(%rip), %rdi    # 0x629af0
movq %r15, %r12
shlq $0x5, %r12
leaq (%r14,%r12), %r13
movq %r13, %rsi
callq 0x3080
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4099
movq 0x625ad8(%rip), %rdi    # 0x629af0
movq %r13, %rsi
callq 0x3080
movq (%r13), %rbx
movq 0x8(%r13), %r13
xorl %r14d, %r14d
cmpq %r14, %r13
je 0x4043
movsbl (%rbx,%r14), %edi
callq 0x3490
movb %al, (%rbx,%r14)
incq %r14
jmp 0x402b
movq 0x625aa6(%rip), %rdi    # 0x629af0
leaq 0x18(%rsp), %rsi
callq 0x3080
movq 0x10(%rsp), %rbx
movq 0x8(%rsp), %r14
movq 0x625a8b(%rip), %rdi    # 0x629af0
addq %rbx, %r12
movq %r12, %rsi
callq 0x3080
incq %r15
addq $0x20, %rbp
cmpq $0xc350, %r15           # imm = 0xC350
jne 0x3fe5
movq 0x625a65(%rip), %rdi    # 0x629af0
callq 0x30e0
cmpl $-0x1, %eax
je 0x40c9
xorl %ebx, %ebx
jmp 0x40d5
movl %r15d, 0xb1d8(%rip)     # 0xf278
xorl %eax, %eax
cmpq $0x186a08, %rbp         # imm = 0x186A08
je 0x40d3
andq $0x0, (%r14,%rbp)
movq -0x8(%r14,%rbp), %rcx
movb %al, (%rcx)
andq $0x0, (%rbx,%rbp)
movq -0x8(%rbx,%rbp), %rcx
movb %al, (%rcx)
addq $0x20, %rbp
jmp 0x40a2
movl $0xc350, 0xb1a5(%rip)   # imm = 0xC350
movb $0x1, %bl
leaq 0x18(%rsp), %rdi
callq 0x3110
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x40f2
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3440
// File: /workspace/github_cpp_makefile_star2_O2/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, %ebx
movq %rdi, %r14
leal 0x1(%rbx), %eax
movslq %eax, %rdi
callq 0x3030
movslq %ebx, %rsi
movb $0x0, (%rax,%rsi)
xorl %ecx, %ecx
testl %esi, %esi
movl $0x0, %edx
cmovgl %esi, %edx
addq %r14, %rsi
decq %rsi
cmpq %rcx, %rdx
je 0x416e
movzbl (%rsi), %edi
cmpl $0x41, %edi
je 0x415f
cmpl $0x43, %edi
je 0x4155
cmpl $0x47, %edi
je 0x415a
cmpl $0x54, %edi
jne 0x4162
movb $0x41, %dil
jmp 0x4162
movb $0x47, %dil
jmp 0x4162
movb $0x43, %dil
jmp 0x4162
movb $0x54, %dil
movb %dil, (%rax,%rcx)
incq %rcx
decq %rsi
jmp 0x4134
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x6254f5(%rip), %r14d   # 0x62a360
shll $0x2, %r14d
leaq (,%r14,4), %rdi
callq 0x3030
movq %rax, %rbx
movq %r14, %rdi
callq 0x3030
movq %rax, %r14
leaq 0xa44f(%rip), %r15      # 0xf2e0
movq %r15, 0x624c48(%rip)    # 0x629ae0
leaq 0x317841(%rip), %r12    # 0x31c6e0
movq %r12, 0x624c42(%rip)    # 0x629ae8
movq %r15, %rdi
movq %r12, %rsi
callq 0x3fb0
movl %eax, %ebp
xorl %edi, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x450b
testb %bpl, %bpl
je 0x4ea6
movq %rbx, %rdi
callq 0x3300
movq %r14, %rdi
callq 0x3300
movq 0xa3dc(%rip), %rdi      # 0xf2b8
movq 0x6254bd(%rip), %rsi    # 0x62a3a0
movl 0xa3bf(%rip), %edx      # 0xf2a8
movzbl 0xa3bf(%rip), %ecx      # 0xf2af
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3994
// File: /workspace/github_cpp_makefile_star2_O2/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 0x9be6(%rip), %rbx      # 0xf2e0
leaq 0x316fdf(%rip), %r14    # 0x31c6e0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3fb0
xchgb %al, 0x9bc6(%rip)       # 0xf2d8
movb 0x9bc0(%rip), %al       # 0xf2d8
testb $0x1, %al
je 0x5724
movb $0x1, %al
xchgb %al, 0x9bb5(%rip)       # 0xf2d9
movq %rbx, 0x6243b5(%rip)    # 0x629ae0
movq %r14, 0x6243b6(%rip)    # 0x629ae8
movl 0x9b90(%rip), %eax      # 0xf2c8
xchgl %eax, 0x624402(%rip)    # 0x629b40
leaq 0x19059b(%rip), %r15    # 0x195ce0
leaq 0x49d994(%rip), %r12    # 0x4a30e0
leaq 0x6243cd(%rip), %r13    # 0x629b20
movb 0x9b80(%rip), %al       # 0xf2d9
testb $0x1, %al
jne 0x579b
cmpq %rbx, 0x62437c(%rip)    # 0x629ae0
je 0x576e
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x5774
movq %r15, %rdi
movq %r12, %rsi
callq 0x3fb0
xchgb %al, 0x9b5a(%rip)       # 0xf2d9
movb $0x1, %al
xchgb %al, 0x6243bd(%rip)     # 0x629b44
movb 0x9b4c(%rip), %al       # 0xf2d9
testb $0x1, %al
jne 0x579b
movq %r13, %rdi
callq 0x3180
jmp 0x5753
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %r15
pushq %r14
pushq %rbx
movl (%rsi), %eax
movl (%rdx), %ecx
cmpl %eax, %ecx
jae 0x703f
xorl %ebx, %ebx
jmp 0x7053
movb $0x1, %bl
ja 0x7053
movq %rdx, %r14
movq %rsi, %r15
movl 0x14(%rsi), %eax
movl 0x14(%rdx), %ecx
cmpl %ecx, %eax
jge 0x705b
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
jg 0x703b
movb 0x10(%r14), %cl
cmpb $0x0, 0x10(%r15)
je 0x7093
testb %cl, %cl
je 0x7053
movq 0x8(%r15), %rcx
movq 0x8(%r14), %rdx
xorl %esi, %esi
testl %eax, %eax
cmovlel %esi, %eax
cmpl %esi, %eax
je 0x703b
movb (%rcx,%rsi), %dil
movb (%rdx,%rsi), %r8b
cmpb %r8b, %dil
jl 0x7053
jg 0x703b
incq %rsi
jmp 0x707b
testb $0x1, %cl
jne 0x703b
cvtsi2sd %eax, %xmm0
mulsd 0x2f7c(%rip), %xmm0     # 0xa020
callq 0x3070
cvttsd2si %xmm0, %rdx
movq 0x8(%r15), %rax
movq 0x8(%r14), %rcx
movl %edx, %edx
xorl %esi, %esi
cmpl %esi, %edx
je 0x703b
movq (%rax,%rsi,8), %rdi
movq (%rcx,%rsi,8), %r8
cmpq %r8, %rdi
jb 0x7053
ja 0x703b
incq %rsi
jmp 0x70ba
// File: /workspace/github_cpp_makefile_star2_O2/Ahhgust[P]STRaitRazor/parseConfig.cpp
// Function: validDNAWithAmbiguities(char const*)
bool
validDNAWithAmbiguities(const char* c) {

    while (*c) {
      if (*c != 'A' && *c != 'C' && *c != 'T' && *c != 'G' && 
	  *c != 'R' && *c != 'Y' && *c != 'S' && *c != 'W' && *c != 'K' && *c != 'M')
	return false;
      ++c;
    }
    return true;
}

// Assembly:
movl $0x14e1445, %eax        # imm = 0x14E1445
movzbl (%rdi), %ecx
testl %ecx, %ecx
je 0x7a5a
leal -0x41(%rcx), %edx
cmpl $0x18, %edx
ja 0x7a5a
btl %edx, %eax
jae 0x7a5a
incq %rdi
jmp 0x7a41
testl %ecx, %ecx
sete %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ahhgust[P]STRaitRazor/parseConfig.cpp
// Function: validDNA(char const*)
bool
validDNA(const char* c) {

    while (*c) {
      if (*c != 'A' && *c != 'C' && *c != 'T' && *c != 'G')
	return false;
      ++c;
    }
    return true;
}

// Assembly:
movl $0x80045, %eax          # imm = 0x80045
movzbl (%rdi), %ecx
testl %ecx, %ecx
je 0x7a7e
leal -0x41(%rcx), %edx
cmpl $0x13, %edx
ja 0x7a7e
btl %edx, %eax
jae 0x7a7e
incq %rdi
jmp 0x7a65
testl %ecx, %ecx
sete %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x3e
popq %rcx
subl %edx, %ecx
cmpl $0x47, %esi
je 0x8489
cmpl $0x43, %esi
je 0x847b
pushq $0x3
popq %rax
shlq %cl, %rax
cmpl $0x41, %esi
jne 0x8499
notq %rax
andq %rdi, %rax
retq
btsq %rcx, %rdi
movb $0x3f, %al
subb %dl, %al
btrq %rax, %rdi
jmp 0x8495
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_O2/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:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl %esi, %r15d
xorl %r14d, %r14d
xorl %eax, %eax
cmpl %r14d, %r15d
je 0x84e0
movsbl (%rbx,%r14), %esi
movq %rax, %rdi
movl %r14d, %edx
callq 0x8458
incq %r14
jmp 0x84c6
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movl %esi, %r15d
pushq $0x41
popq %rsi
movq %rdx, %rdi
movq %r15, %rdx
callq 0x3170
xorl %r12d, %r12d
cmpl %r12d, %r15d
je 0x8521
movq %r14, %rdi
movl %r12d, %esi
callq 0x849d
movb %al, (%rbx,%r12)
incq %r12
jmp 0x8508
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ahhgust[P]STRaitRazor/lookup.cpp
// Function: reverseComplement(unsigned long*, unsigned long*, unsigned int)
void
reverseComplement(binaryword *in, binaryword *out, unsigned numBases) {

  unsigned j, i = numBases-1;
  unsigned inIndex, inBase, outIndex, outBase, prevOutIndex=UINT_MAX;

  char c;
  for (j=0 ; j < numBases; --i, ++j) {
    inIndex = i/(MAXWORD/2);
    inBase = i % (MAXWORD/2);
    c = getLetter(in[inIndex], inBase);
    if (c == 'A') {
      c = 'T';
    } else if (c == 'T') {
      c = 'A';
    } else if (c == 'G') {
      c = 'C';
    } else if (c == 'C') {
      c = 'G';
    } else {
      fprintf(stderr, "Cannot happen! Got letter: %c\n", c);
      exit(EXIT_FAILURE);
    }


    outIndex = j / (MAXWORD/2);
    outBase = j %  (MAXWORD/2);

    if (outIndex != prevOutIndex)
      out[outIndex] = 0;

    out[outIndex] = setLetter(out[outIndex], c, outBase);
    prevOutIndex = outIndex;
  }


}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, (%rsp)
decl %ebx
pushq $-0x1
popq %rbp
xorl %r12d, %r12d
cmpl $-0x1, %ebx
je 0x85fc
movl %ebx, %esi
andl $0x1f, %esi
movl %ebx, %eax
shrl $0x5, %eax
movq (%rsp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x849d
cmpb $0x41, %al
je 0x85bc
movzbl %al, %edx
cmpl $0x43, %edx
je 0x85c0
cmpl $0x47, %edx
je 0x85b8
cmpl $0x54, %edx
jne 0x860b
movb $0x41, %al
jmp 0x85c2
movb $0x43, %al
jmp 0x85c2
movb $0x54, %al
jmp 0x85c2
movb $0x47, %al
movl %r12d, %r13d
shrl $0x5, %r13d
movl %r13d, %r15d
cmpl %ebp, %r13d
jne 0x85d9
movl %ebp, %ecx
movq (%r14,%rcx,8), %rdi
jmp 0x85e0
andq $0x0, (%r14,%r15,8)
xorl %edi, %edi
movl %r12d, %edx
andl $0x1f, %edx
movzbl %al, %esi
callq 0x8458
movq %rax, (%r14,%r15,8)
incl %r12d
decl %ebx
movl %r13d, %ebp
jmp 0x8582
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x69b6(%rip), %rax      # 0xefc8
movq (%rax), %rdi
leaq 0x2849(%rip), %rsi      # 0xae65
xorl %eax, %eax
callq 0x3340
pushq $0x1
popq %rdi
callq 0x32e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Ahhgust[P]STRaitRazor/trie.cpp
// Function: Trie::findPrefixMatch(char const*, unsigned int, unsigned int*, unsigned char*)
unsigned
Trie::findPrefixMatch(const char *w, unsigned wordLen, unsigned *outId, unsigned char *outType) {
  unsigned i, numHits=0;
  
  char c;
  TrieNode *parent, *child;
  parent = root;
  
  // traverse the tree, 
  for (i=0; i < wordLen && *w; ++i, ++w) {

    if (parent->id != NULL) {
      int size = parent->id->size();
      for ( int i = 0; i < size; ++i) {
	++numHits;
	*outType++ = parent->type->at(i);
	*outId++ = parent->id->at(i);
      }
    }


    c = *w;
    if (c == 'A') {
      if (parent->a == NULL) {
	return numHits;
      }
      child = parent->a;
    } else if (c == 'C') {
      if (parent->c == NULL) {
	return numHits;
      }
      child = parent->c;
    } else if (c == 'G') {
      if (parent->g == NULL) {
	return numHits;
      }
      child = parent->g;
    } else {
      if (parent->t == NULL) {
	return numHits;
      }
      child = parent->t;
    }
    
    parent = child;
  }

  // this is a corner case....
  // the entire binaryword matches the entire anchor sequence

  if (parent->id != NULL) {
    int size = parent->id->size();
    for ( int i = 0; i < size; ++i) {
      ++numHits;
      *outType++ = parent->type->at(i);
      *outId++ = parent->id->at(i);
    }
  }

  return numHits;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r14
movq %rcx, %r15
movl %edx, 0xc(%rsp)
movq %rsi, %r12
movq (%rdi), %rbx
xorl %edx, %edx
xorl %ebp, %ebp
cmpl 0xc(%rsp), %edx
je 0x8710
movb (%r12), %al
testb %al, %al
je 0x8710
movq 0x20(%rbx), %rcx
testq %rcx, %rcx
je 0x86db
movl %edx, 0x10(%rsp)
movl %ebp, 0x14(%rsp)
movq 0x8(%rcx), %rbp
subq (%rcx), %rbp
shrq $0x2, %rbp
testl %ebp, %ebp
movl $0x0, %eax
cmovlel %eax, %ebp
xorl %r13d, %r13d
cmpq %r13, %rbp
je 0x86c8
movq 0x28(%rbx), %rdi
movq %r13, %rsi
callq 0x962a
movb (%rax), %al
movb %al, (%r14,%r13)
movq 0x20(%rbx), %rdi
movq %r13, %rsi
callq 0x9648
movl (%rax), %eax
movl %eax, (%r15)
addq $0x4, %r15
incq %r13
jmp 0x8697
movl 0x14(%rsp), %eax
addl %ebp, %eax
movl %eax, %ebp
movb (%r12), %al
addq %r13, %r14
movl 0x10(%rsp), %edx
cmpb $0x47, %al
je 0x86f7
movzbl %al, %eax
cmpl $0x43, %eax
je 0x86f1
cmpl $0x41, %eax
jne 0x86fd
movq (%rbx), %rbx
jmp 0x8701
movq 0x8(%rbx), %rbx
jmp 0x8701
movq 0x10(%rbx), %rbx
jmp 0x8701
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x8762
incl %edx
incq %r12
jmp 0x8658
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x8762
movq 0x8(%rax), %r13
subq (%rax), %r13
shrq $0x2, %r13
xorl %r12d, %r12d
testl %r13d, %r13d
cmovlel %r12d, %r13d
cmpq %r12, %r13
je 0x875c
movq 0x28(%rbx), %rdi
movq %r12, %rsi
callq 0x962a
movb (%rax), %al
movb %al, (%r14,%r12)
movq 0x20(%rbx), %rdi
movq %r12, %rsi
callq 0x9648
movl (%rax), %eax
movl %eax, (%r15,%r12,4)
incq %r12
jmp 0x872e
addl %ebp, %r13d
movl %r13d, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Ahhgust[P]STRaitRazor/trie.cpp
// Function: Trie::existsPrefixMatch(char const*, unsigned int, unsigned int, unsigned char)
bool
Trie::existsPrefixMatch(const char *w, unsigned wordLen, unsigned outId, unsigned char outType) {

  unsigned i;
  char c;
  TrieNode *parent, *child;
  parent = root;
  
  // traverse the tree, 
  for (i=0; i < wordLen && *w; ++i, ++w) {

    if (parent->id != NULL) {
      int size = parent->id->size();
      for ( int i = 0; i < size; ++i) {
	if ( parent->type->at(i) == outType &&
	     parent->id->at(i) == outId)
	  return true;
      }
    }


    c = *w;
    if (c == 'A') {
      if (parent->a == NULL) {
	return false;
      }
      child = parent->a;
    } else if (c == 'C') {
      if (parent->c == NULL) {
	return false;
      }
      child = parent->c;
    } else if (c == 'G') {
      if (parent->g == NULL) {
	return false;
      }
      child = parent->g;
    } else {
      if (parent->t == NULL) {
	return false;
      }
      child = parent->t;
    }
    
    parent = child;
  }

  // this is a corner case....
  // the entire binaryword matches the entire anchor sequence

  if (parent->id != NULL) {
    int size = parent->id->size();
    for ( int i = 0; i < size; ++i) {
	if ( parent->type->at(i) == outType &&
	     parent->id->at(i) == outId)
	  return true;
    }
  }

  return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movl %ecx, %ebp
movq %rsi, %r15
movq (%rdi), %r13
xorl %esi, %esi
movl %edx, (%rsp)
cmpl %edx, %esi
je 0x8848
movb (%r15), %al
testb %al, %al
je 0x8848
movq 0x20(%r13), %rcx
testq %rcx, %rcx
je 0x87fd
movl %esi, 0x4(%rsp)
movq 0x8(%rcx), %r14
subq (%rcx), %r14
shrq $0x2, %r14
testl %r14d, %r14d
movl $0x0, %eax
cmovlel %eax, %r14d
xorl %r12d, %r12d
cmpq %r12, %r14
je 0x87f3
movq 0x28(%r13), %rdi
movq %r12, %rsi
callq 0x962a
cmpb %bl, (%rax)
jne 0x87ee
movq 0x20(%r13), %rdi
movq %r12, %rsi
callq 0x9648
cmpl %ebp, (%rax)
je 0x8833
incq %r12
jmp 0x87c9
movb (%r15), %al
movl (%rsp), %edx
movl 0x4(%rsp), %esi
cmpb $0x47, %al
je 0x881a
movzbl %al, %eax
cmpl $0x43, %eax
je 0x8814
cmpl $0x41, %eax
jne 0x8820
movq (%r13), %r13
jmp 0x8824
movq 0x8(%r13), %r13
jmp 0x8824
movq 0x10(%r13), %r13
jmp 0x8824
movq 0x18(%r13), %r13
testq %r13, %r13
je 0x8897
incl %esi
incq %r15
jmp 0x878f
movb $0x1, %r14b
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%r13), %rax
xorl %r14d, %r14d
testq %rax, %rax
je 0x8836
movq 0x8(%rax), %r12
subq (%rax), %r12
shrq $0x2, %r12
testl %r12d, %r12d
cmovlel %r14d, %r12d
xorl %r15d, %r15d
cmpq %r15, %r12
setne %r14b
je 0x8836
movq 0x28(%r13), %rdi
movq %r15, %rsi
callq 0x962a
cmpb %bl, (%rax)
jne 0x8892
movq 0x20(%r13), %rdi
movq %r15, %rsi
callq 0x9648
cmpl %ebp, (%rax)
je 0x8836
incq %r15
jmp 0x8869
xorl %r14d, %r14d
jmp 0x8836
// File: /workspace/github_cpp_makefile_star2_O2/Ahhgust[P]STRaitRazor/trie.cpp
// Function: Trie::initMem(unsigned int)
void
Trie::initMem(unsigned num_nodes) {
  
  unsigned i;
  mem = new TrieNode[num_nodes];
  TrieNode *head = mem;
  for (i=0; i < num_nodes; ++i, ++head) {
    (*head).a =     (*head).c =    (*head).g =     (*head).t = NULL;
    (*head).id = NULL;
    (*head).type = NULL;
  }

  numNodes = num_nodes;
  root = mem;
  
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, %eax
imulq $0x30, %rax, %rdi
callq 0x3030
movq %rax, 0x8(%rbx)
xorps %xmm0, %xmm0
movl %ebp, %ecx
movq %rax, %rdx
subl $0x1, %ecx
jb 0x88d1
movups %xmm0, 0x20(%rdx)
movups %xmm0, 0x10(%rdx)
movups %xmm0, (%rdx)
addq $0x30, %rdx
jmp 0x88bb
movl %ebp, 0x10(%rbx)
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq