LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::allocateStackSpace(int)
void CodeGenerator::allocateStackSpace(int size) {
    if (size == 0) return;
    // SBC: A = A - M - (1 - C)
    loadConstIntoA(256 - size);
    code << "CLC" << nl;
    code << "ADC " << cSP << nl;
    code << "STA " << cSP << nl;
}

// Assembly:
testl %esi, %esi
je 0x112e6
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x100, %eax            # imm = 0x100
subl %esi, %eax
movl %eax, %esi
callq 0x10ee0
leaq 0x80(%rbx), %r14
leaq 0x1788(%rip), %rsi      # 0x129e8
movl $0x3, %edx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
leaq 0x184e(%rip), %rsi      # 0x12ad1
movl $0x4, %edx
movq %r14, %rdi
callq 0x32d0
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
leaq 0x168d(%rip), %rsi      # 0x12943
movl $0x4, %edx
movq %r14, %rdi
callq 0x32d0
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x32d0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/schneebergerlab[P]DrLink/analyze_molecule.cpp
// Function: decipher_cigar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int decipher_cigar(string cigar)
{
    // CIGAR alphabet: M I D N S H P; * = X: 23S23M1D8M1I16M1D29M
    char *cstr = (char*)cigar.c_str();
    string numstr("");
    int covlen = 0;
    for (int i=0; i<cigar.size(); i++)
    {
        if(cstr[i]>='0' && cstr[i]<='9')
        {
            numstr += cstr[i];
        }
        else
        if(cstr[i] == 'M' || cstr[i] == 'I'|| cstr[i] == 'D'|| cstr[i] == 'N'|| 
           cstr[i] == 'S' || cstr[i] == 'H'|| cstr[i] == 'P')
        {
            if(cstr[i] == 'M' || cstr[i] == 'D')
            {
                covlen += atoi(numstr.c_str());
            }
            numstr.clear();
        }
    }    
    return covlen;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq (%rdi), %r12
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x3394c(%rip), %rdx     # 0x3eb22
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x5384
cmpq $0x0, 0x8(%rbx)
je 0xb254
xorl %r13d, %r13d
leaq 0x8(%rsp), %r14
movl $0x9430, %r15d          # imm = 0x9430
xorl %ebp, %ebp
movzbl (%r12,%r13), %eax
leal -0x30(%rax), %ecx
cmpb $0x9, %cl
ja 0xb214
movsbl %al, %esi
movq %r14, %rdi
callq 0x42b0
jmp 0xb249
addl $-0x44, %eax
cmpl $0xf, %eax
ja 0xb249
btl %eax, %r15d
jb 0xb238
movl $0x201, %ecx            # imm = 0x201
btl %eax, %ecx
jae 0xb249
movq 0x8(%rsp), %rdi
callq 0x44d0
addl %eax, %ebp
movq $0x0, 0x10(%rsp)
movq 0x8(%rsp), %rax
movb $0x0, (%rax)
incq %r13
cmpq %r13, 0x8(%rbx)
ja 0xb1fa
jmp 0xb256
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb272
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb2a2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O1/schneebergerlab[P]DrLink/detect_recombsite.cpp
// Function: check_candidate_cosite(std::multimap<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::pair<unsigned long, unsigned long>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::pair<unsigned long, unsigned long>>>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long, unsigned long)
bool check_candidate_cosite(multimap<string, std::pair<unsigned long, unsigned long> >* badMolecule,
                            string mkey,
                            unsigned long mstart,
                            unsigned long mend)
{
    bool passchecking = true; // if not in bad molecule set, passing checking
    std::pair <multimap<string, std::pair<unsigned long, unsigned long> >::iterator, 
               multimap<string, std::pair<unsigned long, unsigned long> >::iterator> clitr_region;
    clitr_region = (*badMolecule).equal_range(mkey);
    multimap<string, std::pair<unsigned long, unsigned long> >::iterator clitr;
    for (clitr=clitr_region.first; clitr!=clitr_region.second; ++clitr)
    {
        std::pair<unsigned long, unsigned long> span = (*clitr).second;
        if( (mstart>=span.first && mstart<=span.second) ||
            (mend>=span.first   && mend<=span.second) )
        {
            // caution: might be too stringent here: check overlapping size then?
            passchecking = false;
            break;
        }
    }
    return passchecking; 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
callq 0x21ebc
cmpq %rdx, %rax
je 0x1e90f
movq %rdx, %r15
movb $0x1, %bpl
movq 0x40(%rax), %rdx
movq 0x48(%rax), %rdi
cmpq %r14, %rdx
seta %cl
cmpq %r14, %rdi
setb %sil
cmpq %rbx, %rdx
seta %r8b
cmpq %rbx, %rdi
setb %dl
orb %r8b, %dl
xorl %edi, %edi
testb $0x1, %dl
jne 0x1e8ea
xorl %r8d, %r8d
jmp 0x1e8ee
movzbl %bpl, %r8d
orb %sil, %cl
cmovnel %r8d, %edi
movl %edi, %ebp
cmpb $0x1, %cl
jne 0x1e912
testb %dl, %dl
je 0x1e912
movq %rax, %rdi
callq 0x4230
cmpq %r15, %rax
jne 0x1e8b9
jmp 0x1e912
movb $0x1, %bpl
andb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/schneebergerlab[P]DrLink/separate_chr_v2.cpp
// Function: gen_random(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, int)
bool gen_random(string* str, const int len) {
    // from stackoverflow
    static const char alphanum[] =
        "0123456789"
        "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        "abcdefghijklmnopqrstuvwxyz";
    for (int i = 0; i < len; ++i) {
        (*str) += alphanum[rand() % (sizeof(alphanum) - 1)];
    }
    return true;
}

// Assembly:
testl %esi, %esi
jle 0x36887
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movabsq $-0x7bdef7bdef7bdef7, %r15 # imm = 0x8421084210842109
leaq 0x867a(%rip), %r12      # 0x3eec0
callq 0x40e0
movslq %eax, %rcx
movq %rcx, %rax
shrq %rax
mulq %r15
shrq $0x4, %rdx
movq %rdx, %rax
shlq $0x6, %rax
addq %rdx, %rdx
subq %rax, %rdx
addq %rcx, %rdx
movsbl (%r12,%rdx), %esi
movq %r14, %rdi
callq 0x42b0
decl %ebx
jne 0x36846
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
movb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]optimal-seed-solver/spacedSeedSolver.cc
// Function: SpacedSeedSolver::storeHash(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void SpacedSeedSolver::storeHash(string tableName) {
	ofstream storeFile;
	storeFile.open(tableName.c_str() );

	storeFile<< mask << endl;

	for (int i = 0; i < freqTable.size(); i++)
		storeFile << freqTable[i] << endl;

	storeFile.close();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x3440
movq (%r14), %rsi
movq %r15, %rdi
movl $0x10, %edx
callq 0x3050
movq 0x2a8(%rbx), %rsi
movq 0x2b0(%rbx), %rdx
leaq 0x8(%rsp), %rdi
callq 0x32e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movq 0x290(%rbx), %rax
cmpq %rax, 0x298(%rbx)
je 0x4ac2
xorl %r12d, %r12d
leaq 0x8(%rsp), %r14
movl (%rax,%r12,4), %esi
movq %r14, %rdi
callq 0x31c0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
incq %r12
movq 0x290(%rbx), %rax
movq 0x298(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
ja 0x4a6f
leaq 0x8(%rsp), %rdi
callq 0x33a0
movq 0x94ed(%rip), %rax      # 0xdfc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x10(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x8(%rsp,%rcx)
callq 0x3220
leaq 0x100(%rsp), %rdi
callq 0x30f0
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x4b0f
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33c0
movq %rbx, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]optimal-seed-solver/spacedSeedSolver.cc
// Function: SpacedSeedSolver::loadHash(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void SpacedSeedSolver::loadHash(string tableName) {
	ifstream storeFile;
	storeFile.open(tableName.c_str() );

	storeFile >> mask;

	unsigned int oneCount = 0;
	for (int i = 0; i < mask.length(); i++)
		if (mask[i] == '1')
			oneCount++;

	freqTable.resize( (1 << (2 * oneCount) ), 0);
	
	seed = string(oneCount, 'N');

	for (int i = 0; i < freqTable.size(); i++)
		storeFile >> freqTable[i];

	storeFile.close();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x32d0
movq (%r14), %rsi
movq %r15, %rdi
movl $0x8, %edx
callq 0x3190
leaq 0x2a8(%rbx), %r14
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x3340
movq 0x2b0(%rbx), %rax
testq %rax, %rax
je 0x4b94
movq (%r14), %rcx
xorl %edx, %edx
xorl %r14d, %r14d
xorl %esi, %esi
cmpb $0x31, (%rcx,%rdx)
sete %sil
addl %esi, %r14d
incq %rdx
cmpq %rdx, %rax
jne 0x4b7d
jmp 0x4b97
xorl %r14d, %r14d
leal (%r14,%r14), %ecx
movl $0x1, %esi
shll %cl, %esi
leaq 0x290(%rbx), %rdi
movq %rsp, %rdx
movl $0x0, (%rdx)
callq 0x4d84
movl %r14d, %esi
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rsp, %rdi
movl $0x4e, %edx
callq 0x32f0
leaq 0x270(%rbx), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x3310
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x4bf7
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x290(%rbx), %rsi
cmpq %rsi, 0x298(%rbx)
je 0x4c3e
xorl %r15d, %r15d
leaq 0x20(%rsp), %r14
xorl %r12d, %r12d
addq %r15, %rsi
movq %r14, %rdi
callq 0x3470
incq %r12
movq 0x290(%rbx), %rsi
movq 0x298(%rbx), %rax
subq %rsi, %rax
sarq $0x2, %rax
addq $0x4, %r15
cmpq %r12, %rax
ja 0x4c12
leaq 0x20(%rsp), %rdi
callq 0x3090
leaq 0x20(%rsp), %rdi
callq 0x30c0
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x4c69
jmp 0x4c69
jmp 0x4c69
jmp 0x4c69
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]optimal-seed-solver/spacedSeedSolver.cc
// Function: SpacedSeedSolver::solveDNA(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
unsigned int SpacedSeedSolver::solveDNA(string DNA, unsigned int seedNum) {
	unsigned int totalFreq = 0;
	
	for (int i = 0; i < seedNum; i++) {
		string spacedSeed = DNA.substr(i * mask.length(), mask.length() );
		unsigned int oneCount = 0;
		for (int i = 0; i < spacedSeed.length(); i++) {
		   if (mask[i] == '1') {
				seed[oneCount] = spacedSeed[i];
				oneCount++;
		   }
		}
		unsigned int hash = hashGen.calculateHash(seed, seed.length() );
		totalFreq += freqTable[hash];
	}
	return totalFreq;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, 0x20(%rsp)
testl %edx, %edx
je 0x4d4b
movq %rdi, %r14
leaq 0x268(%rdi), %r15
leaq 0x270(%rdi), %r12
movl %edx, %r13d
xorl %ebx, %ebx
xorl %ebp, %ebp
movq 0x2b0(%r14), %rcx
movq %rcx, %rdx
imulq %rbx, %rdx
movq %rsp, %rdi
movq 0x20(%rsp), %rsi
callq 0x32a0
cmpq $0x0, 0x8(%rsp)
je 0x4d04
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x2a8(%r14), %rdx
cmpb $0x31, (%rdx,%rax)
jne 0x4cfa
movq (%rsp), %rdx
movb (%rdx,%rax), %dl
movl %ecx, %esi
movq 0x270(%r14), %rdi
movb %dl, (%rdi,%rsi)
incl %ecx
incq %rax
cmpq %rax, 0x8(%rsp)
ja 0x4cd8
movl 0x278(%r14), %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x97ce
movl %eax, %eax
movq 0x290(%r14), %rcx
addl (%rcx,%rax,4), %ebp
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4d3d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
incq %rbx
cmpq %r13, %rbx
jne 0x4cb1
jmp 0x4d4d
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4d7c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
movq %rbx, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O1/Lartu[P]coraldb/source/map_functions.cpp
// Function: set_key(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void set_key(const std::string &key, const std::string &value)
{
    /* Sets the value of a key into the dictionary. If the key is not found,
     * it's added. Otherwise, it's value is changed.
     * Time complexity:
     * - Average: O(1)
     * - Worst case: O(n)
     */
    global_db_mutex.lock();
    if (global_db.find(key) == global_db.end())
        global_db.emplace(key, value);
    else
        global_db[key] = value;
    global_db_mutex.unlock();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x6808(%rip), %rdi      # 0xa320
callq 0x3410
testl %eax, %eax
jne 0x3b69
leaq 0x67c0(%rip), %rdi      # 0xa2e8
movq %r14, %rsi
callq 0x59c0
leaq 0x67b1(%rip), %rdi      # 0xa2e8
movq %r14, %rsi
testq %rax, %rax
je 0x3b51
callq 0x5eae
movq %rax, %rdi
movq %rbx, %rsi
callq 0x31b0
jmp 0x3b59
movq %rbx, %rdx
callq 0x5aec
leaq 0x67c0(%rip), %rdi      # 0xa320
popq %rbx
popq %r14
popq %rbp
jmp 0x3230
movl %eax, %edi
callq 0x31e0
// File: /workspace/github_cpp_makefile_star2_O1/Lartu[P]coraldb/source/map_functions.cpp
// Function: read_key(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool read_key(const std::string &key, std::string &out)
{
    /* Returns the value of a key via the out parameter. If a value could be
     * read, the function returns true. Otherwise it returns false.
     * Time complexity:
     * - Average: O(1)
     * - Worst case: O(n)
     */
    bool found;
    global_db_mutex.lock();
    std::unordered_map<std::string, std::string>::const_iterator it = global_db.find(key);
    found = it != global_db.end();
    if (found)
    {
        out = it->second;
    }
    global_db_mutex.unlock();
    return found;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x679c(%rip), %rdi      # 0xa320
callq 0x3410
testl %eax, %eax
jne 0x3bc9
leaq 0x6754(%rip), %rdi      # 0xa2e8
movq %r14, %rsi
callq 0x59c0
movq %rax, %r14
testq %rax, %rax
je 0x3bb0
leaq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x31b0
testq %r14, %r14
setne %bl
leaq 0x6763(%rip), %rdi      # 0xa320
callq 0x3230
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl %eax, %edi
callq 0x31e0
// File: /workspace/github_cpp_makefile_star2_O1/Lartu[P]coraldb/source/map_functions.cpp
// Function: drop_key(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void drop_key(const std::string &key)
{
    /* Erases the element with the key from the dictionary.
     * Time complexity:
     * - Average: O(1)
     * - Worst case: O(n)
     */
    global_db_mutex.lock();
    global_db.erase(key);
    global_db_mutex.unlock();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x6740(%rip), %rdi      # 0xa320
callq 0x3410
testl %eax, %eax
jne 0x3c0a
leaq 0x66f8(%rip), %rdi      # 0xa2e8
movq %rbx, %rsi
callq 0x5ffc
leaq 0x6721(%rip), %rdi      # 0xa320
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3230
movl %eax, %edi
callq 0x31e0
// File: /workspace/github_cpp_makefile_star2_O1/Lartu[P]coraldb/source/map_functions.cpp
// Function: probe_key(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool probe_key(const std::string &key)
{
    /* Returns true if the key exists in the dictionary, false otherwise.
     * Time complexity:
     * - Average: O(1)
     * - Worst case: O(n)
     */
    bool found;
    global_db_mutex.lock();
    found = global_db.find(key) != global_db.end();
    global_db_mutex.unlock();
    return found;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x66ff(%rip), %rdi      # 0xa320
callq 0x3410
testl %eax, %eax
jne 0x3c54
leaq 0x66b7(%rip), %rdi      # 0xa2e8
movq %rbx, %rsi
callq 0x59c0
testq %rax, %rax
setne %bl
leaq 0x66da(%rip), %rdi      # 0xa320
callq 0x3230
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl %eax, %edi
callq 0x31e0
// File: /workspace/github_cpp_makefile_star2_O1/Lartu[P]coraldb/source/checkpoint.cpp
// Function: test_save_file_permissions()
int test_save_file_permissions()
{
    FILE *fp = fopen(global_filename.c_str(), "a+");
    if (fp == NULL)
    {
        if (errno == EACCES)
        {
            std::cerr << "CoralDB: Cannot write to checkpoint file " << global_filename << ", permission denied." << std::endl;
        }
        else
        {
            std::cerr << "CoralDB: Cannot write to checkpoint file " << global_filename << ": " << strerror(errno) << "." << std::endl;
        }
        return 1;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x59e3(%rip), %rdi      # 0xa370
leaq 0x28b1(%rip), %rsi      # 0x7245
callq 0x3350
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jne 0x4a8f
callq 0x3040
movq %rax, %r14
movl (%rax), %r15d
movq 0x5637(%rip), %rbx      # 0x9ff0
leaq 0x2888(%rip), %rsi      # 0x7248
movl $0x29, %edx
movq %rbx, %rdi
callq 0x3330
movq 0x599c(%rip), %rsi      # 0xa370
movq 0x599d(%rip), %rdx      # 0xa378
movq %rbx, %rdi
callq 0x3330
movq %rax, %rbx
cmpl $0xd, %r15d
jne 0x49fa
leaq 0x287f(%rip), %rsi      # 0x7272
movl $0x14, %edx
jmp 0x4a5b
leaq 0x26e8(%rip), %rsi      # 0x70e9
movl $0x2, %edx
movq %rbx, %rdi
callq 0x3330
movl (%r14), %edi
callq 0x3110
testq %rax, %rax
je 0x4a36
movq %rax, %r14
movq %rax, %rdi
callq 0x3150
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x3330
jmp 0x4a4f
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq %rbx, %rdi
addq %rax, %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x3470
leaq 0x282f(%rip), %rsi      # 0x7285
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3330
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3200
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Lartu[P]coraldb/source/checkpoint.cpp
// Function: checkpoint_handler()
void checkpoint_handler()
{
    /* This function waits until it's time for the checkpoint. When it is,
     * it requests the saving of the checkpoint file.
     */
    while (true)
    {
        std::this_thread::sleep_for(std::chrono::milliseconds(CHECKPOINT_TIME));
        save_datafile();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movabsq $0x20c49ba5e353f7cf, %r14 # imm = 0x20C49BA5E353F7CF
leaq -0x20(%rbp), %rbx
movslq 0x57e6(%rip), %rcx      # 0xa2a0
testq %rcx, %rcx
jle 0x4b00
movq %rcx, %rax
shrq $0x3, %rax
mulq %r14
shrq $0x4, %rdx
imulq $-0x3e8, %rdx, %rax     # imm = 0xFC18
addq %rcx, %rax
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
movq %rdx, -0x20(%rbp)
movq %rax, -0x18(%rbp)
movq %rbx, %rdi
movq %rbx, %rsi
callq 0x30d0
cmpl $-0x1, %eax
jne 0x4b00
callq 0x3040
cmpl $0x4, (%rax)
je 0x4ae6
callq 0x44d3
jmp 0x4ab3
// File: /workspace/github_cpp_makefile_star2_O1/Lartu[P]coraldb/source/coraldb.cpp
// Function: show_help()
void show_help()
{
    print_version();
    std::cout << "Usage: coraldb [switches]" << std::endl;
    std::cout << " -h, --help          shows this help" << std::endl;
    std::cout << " -p, --port          sets the database port" << std::endl;
    std::cout << " -f, --file          sets the database checkpoint file" << std::endl;
    std::cout << " -c, --checkpoint    sets the checkpoint timeout in seconds" << std::endl;
    std::cout << " -a, --anyport       use any available port" << std::endl;
    std::cout << " -v, --version       prints version information" << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x4b07
movq 0x5419(%rip), %rbx      # 0x9fd0
leaq 0x2741(%rip), %rsi      # 0x72ff
movl $0x19, %edx
movq %rbx, %rdi
callq 0x3330
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3200
leaq 0x2720(%rip), %rsi      # 0x7319
movl $0x24, %edx
movq %rbx, %rdi
callq 0x3330
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3200
leaq 0x270a(%rip), %rsi      # 0x733e
movl $0x2b, %edx
movq %rbx, %rdi
callq 0x3330
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3200
leaq 0x26fb(%rip), %rsi      # 0x736a
movl $0x36, %edx
movq %rbx, %rdi
callq 0x3330
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3200
leaq 0x26f7(%rip), %rsi      # 0x73a1
movl $0x3b, %edx
movq %rbx, %rdi
callq 0x3330
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3200
leaq 0x26f8(%rip), %rsi      # 0x73dd
movl $0x2b, %edx
movq %rbx, %rdi
callq 0x3330
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3200
leaq 0x26e9(%rip), %rsi      # 0x7409
movl $0x2f, %edx
movq %rbx, %rdi
callq 0x3330
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3200
// File: /workspace/github_cpp_makefile_star2_O1/Lartu[P]coraldb/source/coraldb.cpp
// Function: main
int main(int argc, char **argv)
{
    int arg_out = parse_arguments(argc, argv);
    if (arg_out == 0)
    {
        print_version();
        if (test_save_file_permissions() == 0)
        {
            load_checkpoint();
            std::thread checkpoint_thread(checkpoint_handler);
            checkpoint_thread.detach();
            start_socket();
        }
        else
        {
            return 1;
        }
    }
    else
    {
        return arg_out;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x4d5a
testl %eax, %eax
jne 0x55ba
callq 0x4b07
callq 0x497c
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
je 0x55c1
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x4773
leaq -0xb33(%rip), %rsi      # 0x4a9a
leaq -0x10(%rbp), %rbx
movq %rbx, %rdi
callq 0x57c6
movq %rbx, %rdi
callq 0x3490
callq 0x53d6
cmpq $0x0, -0x10(%rbp)
jne 0x55f5
movq %rax, %rdi
callq 0x34a0
callq 0x30b0
// File: /workspace/github_cpp_makefile_star2_O1/jovermann[P]streplace/src/CommandLineParser.cpp
// Function: ut1::CommandLineParser::Option::setValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char)
void CommandLineParser::Option::setValue(const std::string& v, char listSepChar_)
{
    if (isList && (count > 0))
    {
        value += listSepChar_;
        value += v;
    }
    else
    {
        value = v;
    }
    count++;
    if (argName.empty())
    {
        value = std::to_string(count);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x90(%rdi), %rbx
cmpb $0x1, 0x88(%rdi)
jne 0x5b92
cmpl $0x0, 0xb0(%r14)
je 0x5b92
movsbl %dl, %esi
movq %rbx, %rdi
callq 0x5390
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x5100
jmp 0x5b9d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5220
movl 0xb0(%r14), %ebp
incl %ebp
movl %ebp, 0xb0(%r14)
cmpq $0x0, 0x50(%r14)
jne 0x5c4e
movl $0x1, %eax
cmpl $0xa, %ebp
jb 0x5c06
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebp, %edx
cmpl $0x63, %edx
jbe 0x5bff
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x5c04
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x5c06
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x5bce
addl $-0x3, %eax
jmp 0x5c06
addl $-0x2, %eax
jmp 0x5c06
decl %eax
movl %eax, %esi
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x54e0
movq (%r14), %rdi
movl 0x8(%r14), %esi
movl %ebp, %edx
callq 0x8e37
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5500
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x5c4e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jovermann[P]streplace/src/CommandLineParser.cpp
// Function: ut1::CommandLineParser::getShortOption(char)
CommandLineParser::Option* CommandLineParser::getShortOption(char shortOption)
{
    auto it = shortOptionToLongOption.find(shortOption);
    if (it == shortOptionToLongOption.end())
    {
        return nullptr;
    }
    return getOption(it->second);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x58(%rdi), %rax
leaq 0x50(%rdi), %rcx
movq %rcx, %rdx
testq %rax, %rax
je 0x66af
movq %rcx, %rdx
xorl %edi, %edi
cmpb %sil, 0x20(%rax)
setl %dil
cmovgeq %rax, %rdx
movq 0x10(%rax,%rdi,8), %rax
testq %rax, %rax
jne 0x6697
movq %rcx, %rax
cmpq %rcx, %rdx
je 0x66c2
cmpb %sil, 0x20(%rdx)
cmovgq %rcx, %rdx
movq %rdx, %rax
cmpq %rcx, %rax
je 0x66ec
addq $0x28, %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa316
movq %rax, %rcx
addq $0x8, %rbx
leaq 0x40(%rax), %rdx
xorl %eax, %eax
cmpq %rbx, %rcx
cmovneq %rdx, %rax
jmp 0x66ee
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/jovermann[P]streplace/src/CommandLineParser.cpp
// Function: ut1::CommandLineParser::getCount(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
unsigned CommandLineParser::getCount(const std::string& longOption) const
{
    const Option* option = getOption(longOption);
    if (option)
    {
        return option->count;
    }
    else
    {
        throw std::runtime_error("CommandLineParser::getCount(): Unknown option '" + longOption + "'!");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0xa316
addq $0x8, %rbx
cmpq %rbx, %rax
je 0x8239
movl 0xf0(%rax), %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x51e0
movq %rax, %rbx
leaq 0x18e91(%rip), %rsi     # 0x210de
leaq 0x28(%rsp), %rdi
movq %r14, %rdx
callq 0x8929
leaq 0x18ead(%rip), %rsi     # 0x2110e
leaq 0x28(%rsp), %rdi
callq 0x57c0
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x828c
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x8299
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x5690
xorl %ebp, %ebp
movq 0x25d27(%rip), %rsi     # 0x2dff0
movq 0x25cc8(%rip), %rdx     # 0x2df98
movq %rbx, %rdi
callq 0x56e0
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x82fa
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x82fa
movq %rax, %r14
movb $0x1, %bpl
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x831d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x831d
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x832a
movq %rbx, %rdi
callq 0x5310
movq %r14, %rdi
callq 0x5720
// File: /workspace/github_cpp_makefile_star2_O1/jovermann[P]streplace/src/CommandLineParser.cpp
// Function: ut1::CommandLineParser::getStr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
const std::string& CommandLineParser::getStr(const std::string& longOption) const
{
    const Option* option = getOption(longOption);
    if (option)
    {
        return option->value;
    }
    else
    {
        throw std::runtime_error("CommandLineParser::getStr(): Unknown option '" + longOption + "'!");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0xa316
addq $0x8, %rbx
cmpq %rbx, %rax
je 0x8381
addq $0xd0, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x51e0
movq %rax, %rbx
leaq 0x18d7c(%rip), %rsi     # 0x21111
leaq 0x28(%rsp), %rdi
movq %r14, %rdx
callq 0x8929
leaq 0x18d65(%rip), %rsi     # 0x2110e
leaq 0x28(%rsp), %rdi
callq 0x57c0
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x83d4
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x83e1
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x5690
xorl %ebp, %ebp
movq 0x25bdf(%rip), %rsi     # 0x2dff0
movq 0x25b80(%rip), %rdx     # 0x2df98
movq %rbx, %rdi
callq 0x56e0
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x8442
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x8442
movq %rax, %r14
movb $0x1, %bpl
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8465
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x8465
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x8472
movq %rbx, %rdi
callq 0x5310
movq %r14, %rdi
callq 0x5720
// File: /workspace/github_cpp_makefile_star2_O1/jovermann[P]streplace/src/CommandLineParser.cpp
// Function: ut1::CommandLineParser::getInt(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
long long CommandLineParser::getInt(const std::string& longOption) const
{
    std::string value = getStr(longOption);
    const char* end   = nullptr;
    long long   r     = std::strtoll(value.c_str(), const_cast<char**>(&end), 0);
    ut1::skipSpace(end);
    if (end && (end != value.c_str()) && (*end == 0))
    {
        return r;
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
callq 0x8352
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x9022
leaq 0x28(%rsp), %r14
movq $0x0, (%r14)
movq (%rbx), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x5070
movq %rax, %rbx
movq %r14, %rdi
callq 0xb14f
movq (%r14), %rax
testq %rax, %rax
je 0x8518
cmpq 0x8(%rsp), %rax
je 0x8518
cmpb $0x0, (%rax)
je 0x851a
xorl %ebx, %ebx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x8531
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/jovermann[P]streplace/src/CommandLineParser.cpp
// Function: ut1::CommandLineParser::getUInt(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
unsigned long long CommandLineParser::getUInt(const std::string& longOption) const
{
    std::string        value = getStr(longOption);
    const char*        end   = nullptr;
    unsigned long long r     = std::strtoull(value.c_str(), const_cast<char**>(&end), 0);
    ut1::skipSpace(end);
    if (end && (end != value.c_str()) && (*end == 0))
    {
        return r;
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
callq 0x8352
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x9022
leaq 0x28(%rsp), %r14
movq $0x0, (%r14)
movq (%rbx), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x5590
movq %rax, %rbx
movq %r14, %rdi
callq 0xb14f
movq (%r14), %rax
testq %rax, %rax
je 0x85a4
cmpq 0x8(%rsp), %rax
je 0x85a4
cmpb $0x0, (%rax)
je 0x85a6
xorl %ebx, %ebx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x85bd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/jovermann[P]streplace/src/CommandLineParser.cpp
// Function: ut1::CommandLineParser::getDouble(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
double CommandLineParser::getDouble(const std::string& longOption) const
{
    std::string value = getStr(longOption);
    const char* end   = nullptr;
    double      r     = std::strtod(value.c_str(), const_cast<char**>(&end));
    ut1::skipSpace(end);
    if (end && (end != value.c_str()) && (*end == 0))
    {
        return r;
    }
    return 0.0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
callq 0x8352
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x9022
leaq 0x28(%rsp), %r14
movq $0x0, (%r14)
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x5330
movsd %xmm0, (%rsp)
movq %r14, %rdi
callq 0xb14f
movq (%r14), %rax
testq %rax, %rax
je 0x8630
cmpq 0x8(%rsp), %rax
je 0x8630
cmpb $0x0, (%rax)
je 0x865e
xorps %xmm0, %xmm0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x8654
movq 0x18(%rsp), %rsi
incq %rsi
movsd %xmm0, (%rsp)
callq 0x5410
movsd (%rsp), %xmm0
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movsd (%rsp), %xmm0
jmp 0x8633
nop
// File: /workspace/github_cpp_makefile_star2_O1/jovermann[P]streplace/src/CommandLineParser.cpp
// Function: ut1::CommandLineParser::setValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
void CommandLineParser::setValue(const std::string& longOption, const std::string& value, bool clearList)
{
    Option* option = getOption(longOption);
    if (option)
    {
        if (clearList)
        {
            option->value = "";
        }
        option->setValue(value, listSepChar);
    }
    else
    {
        throw std::runtime_error("CommandLineParser::setValue(): Unknown option '" + longOption + "'!");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
callq 0xa316
leaq 0x8(%r14), %rcx
leaq 0x40(%rax), %rdx
xorl %r12d, %r12d
cmpq %rcx, %rax
cmovneq %rdx, %r12
je 0x86db
testb %bpl, %bpl
je 0x86bc
leaq 0x90(%r12), %rdi
movq 0x98(%r12), %rdx
leaq 0x189f8(%rip), %rcx     # 0x210aa
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x5630
movsbl 0x90(%r14), %edx
movq %r12, %rdi
movq %rbx, %rsi
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5b4c
movl $0x10, %edi
callq 0x51e0
movq %rax, %rbx
leaq 0x18a50(%rip), %rsi     # 0x2113f
leaq 0x20(%rsp), %rdi
movq %r15, %rdx
callq 0x8929
leaq 0x18a0b(%rip), %rsi     # 0x2110e
leaq 0x20(%rsp), %rdi
callq 0x57c0
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x872e
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x873a
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rsp, %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x5690
xorl %ebp, %ebp
movq 0x25888(%rip), %rsi     # 0x2dff0
movq 0x25829(%rip), %rdx     # 0x2df98
movq %rbx, %rdi
callq 0x56e0
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x8798
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x8798
movq %rax, %r14
movb $0x1, %bpl
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x87bb
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0x87bb
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x87c8
movq %rbx, %rdi
callq 0x5310
movq %r14, %rdi
callq 0x5720
// File: /workspace/github_cpp_makefile_star2_O1/jovermann[P]streplace/src/CommandLineParser.cpp
// Function: ut1::CommandLineParser::getOption(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
CommandLineParser::Option* CommandLineParser::getOption(const std::string& longOption)
{
    auto it = options.find(longOption);
    if (it == options.end())
    {
        return nullptr;
    }
    return &(it->second);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xa316
addq $0x8, %rbx
leaq 0x40(%rax), %rdx
xorl %ecx, %ecx
cmpq %rbx, %rax
cmovneq %rdx, %rcx
movq %rcx, %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jovermann[P]streplace/src/CommandLineParser.cpp
// Function: ut1::CommandLineParser::reportErrorAndExit(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
void CommandLineParser::reportErrorAndExit(const std::string& message, int exitStatus)
{
    if (instance)
    {
        // This is the 99.999% case.
        instance->error(message, exitStatus);
    }
    else
    {
        // We will virtually never end up in this case since an instance of CommandLineOptions should be
        // created as the first thing.
        std::cout << message << "\n";
        std::exit(exitStatus);
    }
}

// Assembly:
pushq %rbx
movl %esi, %ebx
movq %rdi, %rsi
movq 0x25fe7(%rip), %rdi     # 0x2e848
testq %rdi, %rdi
jne 0x8888
movq 0x2574b(%rip), %rdi     # 0x2dfb8
callq 0x53b0
leaq 0x18830(%rip), %rsi     # 0x210a9
movq %rax, %rdi
callq 0x53f0
movl %ebx, %edi
callq 0x54f0
movl %ebx, %edx
callq 0x87f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/jovermann[P]streplace/src/MiscUtils.cpp
// Function: ut1::splitString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char, int)
void replaceStringInPlace(std::string& s, const std::string& from, const std::string& to)
{
    if (!from.empty())
    {
        for (size_t pos = 0;; pos += to.size())
        {
            pos = s.find(from, pos);
            if (pos == std::string::npos)
            {
                break;
            }
            s.replace(pos, from.size(), to);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, (%rsp)
movq $0x0, 0x10(%rdi)
cmpq $0x0, 0x8(%rsi)
je 0xab4a
movl %ecx, %r15d
movq %rsi, %r14
xorl %ebx, %ebx
movsbl %dl, %ecx
movl %ecx, 0x8(%rsp)
leaq 0x10(%rsp), %rbp
movq %rsi, 0x30(%rsp)
movq %r14, %rdi
movl 0x8(%rsp), %esi
movq %rbx, %rdx
callq 0x5570
movq %rax, %r13
cmpq $-0x1, %rax
setne %al
addl $-0x1, %r15d
movl %r15d, 0xc(%rsp)
setb %r12b
andb %al, %r12b
je 0xaafa
movq %r13, %rcx
subq %rbx, %rcx
movq %rbp, %r15
movq %rbp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x5450
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x9ed0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xaaf2
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5410
incq %r13
movq %r13, %rbx
jmp 0xab37
movq %rbp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq $-0x1, %rcx
callq 0x5450
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0x9ed0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xab37
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5410
testb %r12b, %r12b
movl 0xc(%rsp), %r15d
movq 0x30(%rsp), %r14
jne 0xaa88
movq (%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xab5f
movq %rax, %r14
jmp 0xab85
jmp 0xab66
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xab85
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
callq 0x88ce
movq %r14, %rdi
callq 0x5720
// File: /workspace/github_cpp_makefile_star2_O1/jovermann[P]streplace/src/MiscUtils.cpp
// Function: ut1::splitString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
std::vector<std::string> splitString(const std::string& s, const std::string& sep, int maxSplit)
{
    std::vector<std::string> r;

    // Special case: Empty string results in empty list (rather than a list with a single empty string).
    if (s.empty())
    {
        return r;
    }

    for (size_t start = 0;; maxSplit--)
    {
        size_t end = s.find(sep, start);
        if ((end == std::string::npos) || (maxSplit == 0))
        {
            r.push_back(s.substr(start));
            break;
        }
        r.push_back(s.substr(start, end - start));
        start = end + sep.length();
    }
    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x28(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, (%rsp)
movq $0x0, 0x10(%rdi)
cmpq $0x0, 0x8(%rsi)
je 0xac9f
movl %ecx, %ebp
movq %rsi, %r14
xorl %ebx, %ebx
leaq 0x8(%rsp), %r15
movq %rsi, 0x30(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rcx
movq %r14, %rdi
movq %rbx, %rdx
callq 0x5700
movq %rax, %r13
cmpq $-0x1, %rax
setne %al
addl $-0x1, %ebp
movq %r14, %rsi
movl %ebp, %r14d
setb %r12b
andb %al, %r12b
je 0xac54
movq %r13, %rcx
subq %rbx, %rcx
movq %r15, %rbp
movq %r15, %rdi
movq %rbx, %rdx
callq 0x5450
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0x9ed0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xac46
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x28(%rsp), %rax
addq 0x8(%rax), %r13
movq %r13, %rbx
jmp 0xac8e
movq %r15, %rdi
movq %rbx, %rdx
movq $-0x1, %rcx
callq 0x5450
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x9ed0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xac8e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
testb %r12b, %r12b
movl %r14d, %ebp
movq 0x30(%rsp), %r14
jne 0xabd7
movq (%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xacb4
movq %rax, %r14
jmp 0xacda
jmp 0xacbb
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xacda
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
callq 0x88ce
movq %r14, %rdi
callq 0x5720
// File: /workspace/github_cpp_makefile_star2_O1/jovermann[P]streplace/src/MiscUtils.cpp
// Function: ut1::joinStrings(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string joinStrings(const std::vector<std::string>& stringList, const std::string& sep)
{
    std::stringstream r;
    if (!stringList.empty())
    {
        r << stringList[0];
        for (size_t i = 1; i < stringList.size(); i++)
        {
            r << sep << stringList[i];
        }
    }
    return r.str();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %rdi
callq 0x52f0
movq (%r15), %rax
cmpq 0x8(%r15), %rax
je 0xb0e8
leaq 0x10(%rsp), %r12
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r12, %rdi
callq 0x54b0
movq 0x8(%r15), %rax
subq (%r15), %rax
cmpq $0x21, %rax
jb 0xb0e8
movl $0x1, %r13d
movl $0x28, %ebp
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r12, %rdi
callq 0x54b0
movq (%r15), %rcx
movq -0x8(%rcx,%rbp), %rsi
movq (%rcx,%rbp), %rdx
movq %rax, %rdi
callq 0x54b0
movq 0x8(%r15), %rax
subq (%r15), %rax
incq %r13
sarq $0x5, %rax
addq $0x20, %rbp
cmpq %rax, %r13
jb 0xb0ae
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x5660
movq 0x22e6c(%rip), %rsi     # 0x2df68
movq %rsp, %rdi
callq 0x5320
leaq 0x80(%rsp), %rdi
callq 0x5130
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb128
movq %rax, %rbx
movq 0x22e36(%rip), %rsi     # 0x2df68
movq %rsp, %rdi
callq 0x5320
leaq 0x80(%rsp), %rdi
callq 0x5130
movq %rbx, %rdi
callq 0x5720
// File: /workspace/github_cpp_makefile_star2_O1/jovermann[P]streplace/src/MiscUtils.cpp
// Function: ut1::capitalize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string capitalize(std::string s)
{
    s = tolower(s);
    if (!s.empty())
    {
        s[0] = char(std::toupper(unsigned(s[0])));
    }
    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x9022
movq 0x8(%r15), %r15
testq %r15, %r15
je 0xb2e1
movq 0x8(%rsp), %r13
xorl %ebp, %ebp
movzbl (%r13,%rbp), %edi
callq 0x55f0
movb %al, (%r13,%rbp)
incq %rbp
cmpq %rbp, %r15
jne 0xb2c9
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x8(%rsp), %rax
cmpq %r12, %rax
je 0xb305
movq %rax, 0x28(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x38(%rsp)
jmp 0xb30f
movups (%r12), %xmm0
movups %xmm0, (%r13)
movq 0x10(%rsp), %rax
leaq 0x28(%rsp), %r15
movq %rax, 0x8(%r15)
movq %r12, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5500
movq (%r15), %rdi
cmpq %r13, %rdi
je 0xb350
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xb367
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
cmpq $0x0, 0x8(%rbx)
je 0xb37d
movq (%rbx), %r15
movsbl (%r15), %edi
callq 0x5770
movb %al, (%r15)
leaq 0x10(%r14), %rcx
movq %rcx, (%r14)
movq (%rbx), %rdx
leaq 0x10(%rbx), %rax
cmpq %rax, %rdx
je 0xb39c
movq %rdx, (%r14)
movq (%rax), %rcx
movq %rcx, 0x10(%r14)
jmp 0xb3a2
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%r14)
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %r14, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jovermann[P]streplace/src/MiscUtils.cpp
// Function: ut1::quoteRegexChars(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string quoteRegexChars(const std::string& s)
{
    std::string       r;
    const std::string special = "[](){}^$.*+|?\\";
    for (char c: s)
    {
        if (special.find(c) != std::string::npos)
        {
            r += '\\';
        }
        r += c;
    }
    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rsp)
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x16061(%rip), %rsi     # 0x21487
leaq 0x16068(%rip), %rdx     # 0x21495
leaq 0x8(%rsp), %rdi
callq 0x90b2
movq 0x8(%r14), %r13
testq %r13, %r13
je 0xb481
movq (%r14), %r12
xorl %r15d, %r15d
leaq 0x8(%rsp), %r14
movsbl (%r12,%r15), %ebp
movq %r14, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x5570
cmpq $-0x1, %rax
je 0xb46f
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x5390
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5390
incq %r15
cmpq %r15, %r13
jne 0xb44b
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb49d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0xb4d3
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb4d3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rbx), %rdi
cmpq (%rsp), %rdi
je 0xb4eb
movq (%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x5410
movq %r14, %rdi
callq 0x5720