LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tbonelaforge[P]gradebook/GradebookPrinter.cpp
// Function: GradebookPrinter::GradebookPrinter(Gradebook&, bool)
GradebookPrinter::GradebookPrinter(Gradebook& gradebook, bool idMode) : gradebook(gradebook), idMode(idMode) {
    numRows = gradebook.getNumStudents() + 1; // Extra row for table header
    numColumns = gradebook.getNumPrograms() + gradebook.getNumTests() + gradebook.getNumFinals() + 3;
    cellContents = new string*[numRows];
    for (int i = 0; i < numRows; i++) {
        cellContents[i] = new string[numColumns];
    }
    columnWidths = new int[numColumns];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %r13
movq %rsi, (%rdi)
movb %dl, 0x20(%rdi)
movq %rsi, %rdi
callq 0x459e
incl %eax
movl %eax, 0x8(%r13)
movq %r14, %rdi
callq 0x41d6
movl %eax, %r15d
movq %r14, %rdi
callq 0x41de
movl %eax, %r12d
addl %r15d, %r12d
movq %r14, %rdi
callq 0x41e8
movl %r12d, %ebx
addl %eax, %ebx
leal (%rax,%r12), %r14d
addl $0x3, %r14d
movl %r14d, 0xc(%r13)
movslq 0x8(%r13), %rax
movq %rax, -0x38(%rbp)
leaq (,%rax,8), %rdi
testq %rax, %rax
pushq $-0x1
popq %rax
cmovsq %rax, %rdi
callq 0x2030
movq %r13, %r12
movq %rax, 0x10(%r13)
movslq %r14d, %r14
movq %r14, %rax
shlq $0x5, %rax
movq %rax, -0x40(%rbp)
leaq 0x8(%rax), %r15
movl %ebx, -0x2c(%rbp)
cmpl $-0x3, %ebx
pushq $-0x1
popq %rax
cmovlq %rax, %r15
xorl %r13d, %r13d
movq -0x38(%rbp), %rax
testl %eax, %eax
movl $0x0, %ebx
cmovgl %eax, %ebx
cmpq %rbx, %r13
je 0x5170
movq %r15, %rdi
callq 0x2030
movq %r14, (%rax)
testl %r14d, %r14d
je 0x515e
leaq 0x18(%rax), %rcx
movq -0x40(%rbp), %rdx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rcx
addq $-0x20, %rdx
jne 0x5148
addq $0x8, %rax
movq 0x10(%r12), %rcx
movq %rax, (%rcx,%r13,8)
incq %r13
jmp 0x512b
shlq $0x2, %r14
cmpl $-0x3, -0x2c(%rbp)
pushq $-0x1
popq %rax
cmovlq %rax, %r14
movq %r14, %rdi
callq 0x2030
movq %rax, 0x18(%r12)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tbonelaforge[P]gradebook/GradebookPrinter.cpp
// Function: GradebookPrinter::~GradebookPrinter()
GradebookPrinter::~GradebookPrinter() {
    for (int i = 0; i < numRows; i++) {
        delete[] cellContents[i];
    }
    delete[] cellContents;
    delete[] columnWidths;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, -0x30(%rbp)
xorl %r12d, %r12d
movq -0x30(%rbp), %rcx
movslq 0x8(%rcx), %rax
movq 0x10(%rcx), %rdi
cmpq %rax, %r12
jge 0x520a
movq (%rdi,%r12,8), %r14
testq %r14, %r14
je 0x5205
movq -0x8(%r14), %rbx
testq %rbx, %rbx
je 0x51ee
leaq -0x20(%r14), %r13
movq %rbx, %r15
shlq $0x5, %r15
leaq (%r15,%r13), %rdi
callq 0x2358
addq $-0x20, %r15
jne 0x51df
addq $-0x8, %r14
shlq $0x5, %rbx
orq $0x8, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2320
incq %r12
jmp 0x51b1
testq %rdi, %rdi
je 0x5214
callq 0x2210
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rdi
addq $0x8, %rsp
testq %rdi, %rdi
je 0x5234
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2210
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tbonelaforge[P]gradebook/GradebookPrinter.cpp
// Function: GradebookPrinter::fillStudentData()
void GradebookPrinter::fillStudentData() {
    int i = 0;
    Student * student;
    string * studentRow;
    if (idMode) {
        student = gradebook.getHead();
        while (student != NULL) {
            studentRow = cellContents[1 + i];
            fillStudentRow(studentRow, student);
            i += 1;
            student = student->next;
        }
    } else {
        Node * current = gradebook.getIndex();
        while (current != NULL) {
            student = current->student;
            studentRow = cellContents[1 + i];
            fillStudentRow(studentRow, student);
            i += 1;
            current = current->next;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
cmpb $0x1, 0x20(%rbx)
jne 0x54eb
callq 0x45a8
movq %rax, %r14
pushq $0x8
popq %r15
testq %r14, %r14
je 0x5519
movq 0x10(%rbx), %rax
movq (%rax,%r15), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x56c8
movq (%r14), %r14
addq $0x8, %r15
jmp 0x54ca
callq 0x45b2
movq %rax, %r14
pushq $0x8
popq %r15
testq %r14, %r14
je 0x5519
movq (%r14), %rdx
movq 0x10(%rbx), %rax
movq (%rax,%r15), %rsi
movq %rbx, %rdi
callq 0x56c8
movq 0x8(%r14), %r14
addq $0x8, %r15
jmp 0x54f7
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tbonelaforge[P]gradebook/GradebookPrinter.cpp
// Function: GradebookPrinter::centerString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
string GradebookPrinter::centerString(string data, int columnWidth) {
    int blanksNeeded = columnWidth - data.length();
    int lb = blanksNeeded / 2;
    int rb = blanksNeeded - lb;
    string lbs = "";
    string rbs = "";
    for (int i = 0; i < lb; i++) {
        lbs += " ";
    }
    for (int i = 0; i < rb; i++) {
        rbs += " ";
    }
    return lbs + data + rbs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, -0x30(%rbp)
subl 0x8(%rsi), %r15d
pushq $0x2
popq %rcx
movl %r15d, %eax
cltd
idivl %ecx
movl %eax, %r12d
leaq 0x1f79(%rip), %r13      # 0x74cf
leaq -0x90(%rbp), %rdi
leaq -0x50(%rbp), %rdx
movq %r13, %rsi
callq 0x5d02
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rdx
movq %r13, %rsi
callq 0x5d02
subl %r12d, %r15d
xorl %ebx, %ebx
testl %r12d, %r12d
cmovgl %r12d, %ebx
leaq 0x1d9b(%rip), %r12      # 0x7327
leaq -0x90(%rbp), %r13
subl $0x1, %ebx
jb 0x55a5
movq %r13, %rdi
movq %r12, %rsi
callq 0x2300
jmp 0x5593
xorl %r13d, %r13d
testl %r15d, %r15d
cmovgl %r15d, %r13d
leaq 0x1d71(%rip), %r15      # 0x7327
leaq -0x50(%rbp), %r12
subl $0x1, %r13d
jb 0x55cd
movq %r12, %rdi
movq %r15, %rsi
callq 0x2300
jmp 0x55ba
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movq %r14, %rdx
callq 0x5e06
leaq -0x70(%rbp), %rsi
leaq -0x50(%rbp), %rdx
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x5ddd
leaq -0x70(%rbp), %rdi
callq 0x2358
leaq -0x50(%rbp), %rdi
callq 0x2358
leaq -0x90(%rbp), %rdi
callq 0x2358
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x2358
jmp 0x563e
jmp 0x563b
movq %rax, %rbx
jmp 0x5647
jmp 0x563b
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2358
leaq -0x90(%rbp), %rdi
callq 0x2358
movq %rbx, %rdi
callq 0x22d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tbonelaforge[P]gradebook/GradebookPrinter.cpp
// Function: GradebookPrinter::printRowSeparator(std::ostream&)
void GradebookPrinter::printRowSeparator(ostream& out) {
    for (int j = 0; j < numColumns; j++) {
        for (int k = 0; k < columnWidths[j]; k++) {
            out << '-';
        }
        if (j < numColumns - 1) {
            out << '-';
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
pushq $0x2d
popq %r15
movslq 0xc(%r14), %rax
cmpq %rax, %r12
jge 0x56b9
xorl %r13d, %r13d
movq 0x18(%r14), %rax
cmpl (%rax,%r12,4), %r13d
jge 0x569d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x21d0
incl %r13d
jmp 0x5683
movslq 0xc(%r14), %rax
decq %rax
cmpq %rax, %r12
jge 0x56b4
movq %rbx, %rdi
movl %r15d, %esi
callq 0x21d0
incq %r12
jmp 0x5677
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tplinderoth[P]introDist/introDist.cpp
// Function: mainInfo()
void mainInfo () {
	int w = 12;
	std::cerr << "\nintroDist [function] [-function_inputs]\n"
	<< "\nFunctions:\n"
	<< std::setw(w) << std::left << "comp2Dist" << std::setw(w) << "Find regions where the genetic distance between an individual and a population is less than expected\n"
	<< std::setw(w) << std::left << "comp3Dist" << std::setw(w) << "Distance between 2 individuals and their respective populations, weighted by distance between the individuals\n"
	<< std::setw(w) << std::left << "avgDist" << std::setw(w) << "Genome-wide distance between populations or an individual and a population\n"
	<< "\n";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x9a50(%rip), %rdi      # 0xcff0
leaq 0x5fb7(%rip), %rsi      # 0x955e
callq 0x3220
leaq 0x5fd5(%rip), %rsi      # 0x9588
movq %rax, %rdi
callq 0x3220
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
pushq $0xc
popq %rbx
movq %rbx, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
movl $0xffffff4f, %r14d      # imm = 0xFFFFFF4F
movl 0x18(%rax,%rcx), %edx
andl %r14d, %edx
orl $0x20, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x5a87(%rip), %rsi      # 0x9070
movq %rax, %rdi
callq 0x3220
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %rbx, 0x10(%rax,%rcx)
leaq 0x5f91(%rip), %rsi      # 0x9595
movq %rax, %rdi
callq 0x3220
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq %rbx, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl %r14d, %edx
orl $0x20, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x5a49(%rip), %rsi      # 0x907a
movq %rax, %rdi
callq 0x3220
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %rbx, 0x10(%rax,%rcx)
leaq 0x5faf(%rip), %rsi      # 0x95fb
movq %rax, %rdi
callq 0x3220
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq %rbx, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
andl 0x18(%rax,%rcx), %r14d
orl $0x20, %r14d
movl %r14d, 0x18(%rax,%rcx)
leaq 0x5a0b(%rip), %rsi      # 0x9084
movq %rax, %rdi
callq 0x3220
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %rbx, 0x10(%rax,%rcx)
leaq 0x5fd6(%rip), %rsi      # 0x966a
movq %rax, %rdi
callq 0x3220
leaq 0x650f(%rip), %rsi      # 0x9bb2
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x3220
// File: /workspace/github_cpp_makefile_star2_O2/tplinderoth[P]introDist/introDist.cpp
// Function: comp2Dist(std::basic_fstream<char, std::char_traits<char>>&, std::basic_fstream<char, std::char_traits<char>>&, unsigned int, unsigned int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, double const*)
int comp2Dist (std::fstream &freqfile, std::fstream &genofile, unsigned int window, unsigned int step, int useAvg, std::string* genofname, const double* distance) {
	int comp2return = 0;

	switch (useAvg) {
		case 0 :
			std::cerr << "Using window-wide distance between populations\n";
			comp2return = comp2DistReg(freqfile, genofile, window, step);
			break;
		case 1 :
			std::cerr << "Using genome-wide distance between populations\n";
			comp2return = comp2DistPopAvg(freqfile, genofile, window, step, genofname, distance);
			break;
		case 2 :
			std::cerr << "Using genome-wide distance between individual and population 2\n";
			comp2return = comp2DistIndAvg(freqfile, genofile, window, step, genofname, distance);
			break;
		default :
			std::cerr << "Need to specify -useAvg 0, 1, or 2 in call to comp2Dist\n";
			comp2return = -1;
	}

	return comp2return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r12
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r13
movq 0x10(%rbp), %rbx
movq 0x93a8(%rip), %rdi      # 0xcff0
cmpl $0x2, %r8d
je 0x3cbd
cmpl $0x1, %r8d
je 0x3c89
testl %r8d, %r8d
jne 0x3cf1
leaq 0x5714(%rip), %rsi      # 0x9378
movl %ecx, %ebx
callq 0x3220
movq %r13, %rdi
movq %r15, %rsi
movl %r14d, %edx
movl %ebx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x533a
leaq 0x5718(%rip), %rsi      # 0x93a8
movl %ecx, -0x2c(%rbp)
callq 0x3220
movq %r13, %rdi
movq %r15, %rsi
movl %r14d, %edx
movl -0x2c(%rbp), %ecx
movq %r12, %r8
movq %rbx, %r9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5a9d
leaq 0x5714(%rip), %rsi      # 0x93d8
movl %ecx, -0x2c(%rbp)
callq 0x3220
movq %r13, %rdi
movq %r15, %rsi
movl %r14d, %edx
movl -0x2c(%rbp), %ecx
movq %r12, %r8
movq %rbx, %r9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6328
leaq 0x5720(%rip), %rsi      # 0x9418
callq 0x3220
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tplinderoth[P]introDist/introDist.cpp
// Function: avgDist(std::basic_fstream<char, std::char_traits<char>>&, std::basic_fstream<char, std::char_traits<char>>&, int)
int avgDist (std::fstream &freqfile, std::fstream &genofile, int avgtype) {
	int distreturn = 0;

	switch (avgtype) {
		case 0 :
			std::cerr << "Calculating expected distance between populations\n";
			distreturn = avg2PopDist(freqfile);
			break;
		case 1 :
			std::cerr << "Calculating distance between individual and population\n";
			distreturn = avgIndPopDist(freqfile, genofile);
			break;
		default:
			std::cerr << "Need to specify -distance 0 or 1 in call to -avgDist\n";
			distreturn = -1;
	}

	return distreturn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x1, %edx
je 0x44bf
movq 0x8b4d(%rip), %rdi      # 0xcff0
testl %edx, %edx
jne 0x44e4
leaq 0x4d62(%rip), %rsi      # 0x9210
callq 0x3220
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4ced
movq %rsi, %r14
movq 0x8b27(%rip), %rdi      # 0xcff0
leaq 0x4d73(%rip), %rsi      # 0x9243
callq 0x3220
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x4f0d
leaq 0x4d90(%rip), %rsi      # 0x927b
callq 0x3220
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tplinderoth[P]introDist/introDist.cpp
// Function: avgDistInfo(int)
void avgDistInfo (int avgtype) {
	int w = 12;
	std::cerr << "\nintroDist avgDist [-freq] [-avgtype 0]\n"
	<< "introDist avgDist [-freq] [-geno] [-avgtype 1]\n"
	<< "\nInput:\n"
	<< std::setw(w) << std::left << "-freq" << std::setw(w) << "FILE" << "file with (1) chr, (2) position, (3) population1 allele frequency, (4) population2 allele frequency\n"
	<< std::setw(w) << std::left << "-geno" << std::setw(w) << "FILE" << "file with (1) chr, (2) position, (3) individual genotypes (supply when -avgtype 1)\n"
	<< std::setw(w) << std::left << "-avgtype" << std::setw(w) << "INT" << "distance between (0) populations or (1) individual and population 2 " << "[" << avgtype << "]" << "\n"
	<< "\nOutput:\n"
	<< "(1) genetic distance\n"
	<< "(2) number of sites with data\n"
	<< "\n";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebx
movq 0x84b5(%rip), %rdi      # 0xcff0
leaq 0x4fc5(%rip), %rsi      # 0x9b07
callq 0x3220
leaq 0x4fe2(%rip), %rsi      # 0x9b30
movq %rax, %rdi
callq 0x3220
leaq 0x4b7f(%rip), %rsi      # 0x96dc
movq %rax, %rdi
callq 0x3220
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
pushq $0xc
popq %r15
movq %r15, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
movl $0xffffff4f, %r12d      # imm = 0xFFFFFF4F
movl 0x18(%rax,%rcx), %edx
andl %r12d, %edx
orl $0x20, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x4511(%rip), %rsi      # 0x90a5
movq %rax, %rdi
callq 0x3220
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x4b36(%rip), %r14      # 0x96e5
movq %rax, %rdi
movq %r14, %rsi
callq 0x3220
leaq 0x4b29(%rip), %rsi      # 0x96ea
movq %rax, %rdi
callq 0x3220
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq %r15, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl %r12d, %edx
orl $0x20, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x44e3(%rip), %rsi      # 0x90d1
movq %rax, %rdi
callq 0x3220
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
movq %rax, %rdi
movq %r14, %rsi
callq 0x3220
leaq 0x4f4c(%rip), %rsi      # 0x9b60
movq %rax, %rdi
callq 0x3220
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq %r15, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
andl 0x18(%rax,%rcx), %r12d
orl $0x20, %r12d
movl %r12d, 0x18(%rax,%rcx)
leaq 0x44c2(%rip), %rsi      # 0x9103
movq %rax, %rdi
callq 0x3220
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r15, 0x10(%rax,%rcx)
leaq 0x4b2e(%rip), %rsi      # 0x978a
movq %rax, %rdi
callq 0x3220
leaq 0x4f49(%rip), %rsi      # 0x9bb4
movq %rax, %rdi
callq 0x3220
leaq 0x4b34(%rip), %rsi      # 0x97ae
movq %rax, %rdi
callq 0x3220
movq %rax, %rdi
movl %ebx, %esi
callq 0x3370
leaq 0x4b1d(%rip), %rsi      # 0x97b0
movq %rax, %rdi
callq 0x3220
leaq 0x4f10(%rip), %rbx      # 0x9bb2
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3220
leaq 0x4cd5(%rip), %rsi      # 0x9989
movq %rax, %rdi
callq 0x3220
leaq 0x4f36(%rip), %rsi      # 0x9bf9
movq %rax, %rdi
callq 0x3220
leaq 0x4f3d(%rip), %rsi      # 0x9c0f
movq %rax, %rdi
callq 0x3220
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3220
// File: /workspace/github_cpp_makefile_star2_O2/tplinderoth[P]introDist/introDist.cpp
// Function: expect2PopDist(double, double)
double expect2PopDist (double p1, double p2) {
	/*
	 * expected distance between two populations
	 */

	// expected genotypes under HWE
	double eg1 = 2.0*p1*(1.0-p1) + 2.0*p1*p1;
	double eg2 = 2.0*p2*(1.0-p2) + 2.0*p2*p2;
	return fabs(eg1 - eg2)/2.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movapd %xmm0, %xmm2
addsd %xmm0, %xmm2
movsd 0x3d4a(%rip), %xmm3     # 0x9008
movapd %xmm3, %xmm4
subsd %xmm0, %xmm4
mulsd %xmm2, %xmm0
mulsd %xmm2, %xmm4
addsd %xmm4, %xmm0
movapd %xmm1, %xmm2
addsd %xmm1, %xmm2
subsd %xmm1, %xmm3
mulsd %xmm2, %xmm1
mulsd %xmm2, %xmm3
addsd %xmm1, %xmm3
subsd %xmm3, %xmm0
andpd 0x3d6a(%rip), %xmm0     # 0x9060
mulsd 0x3d22(%rip), %xmm0     # 0x9020
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tplinderoth[P]introDist/introDist.cpp
// Function: calc3Dist(double, double, double, double)
double calc3Dist (double g1, double g2, double p1, double p2) {
	/*
	 * this calculates the average, expected distance between (possibly admixed) individuals and their population
	 * weighted by the distance between the distance between the (possibly admixed) individuals
	 *
	 * D_1 = (1-d(i1, i2)) * d({i1,p1}, {i2,p2})
	 *
	 * at site s:
	 * Distance between individuals: d(i1, i2) = |g(i1,s) - g(i2,s)|/2
	 * Average, expected distance between individual and pop: d({i1,p1}, {i1,p2}) = ( E[|g(i1,s) - g(p1,s)|] + E[|g(i2,s) - g(p2,s)|] )/4
	 *
	 * over N sites:
	 * D_N = 1/N * sum_from=1_to=N [ (1-d(i1,i2)) * d({i1,p1}, {i2,p2}) ]
	 */

	// expected genotypes under HWE
	double eg1 = 2.0*p1*(1.0-p1) + 2.0*p1*p1;
	double eg2 = 2.0*p2*(1.0-p2) + 2.0*p2*p2;

	// expected distance between individuals and populations
	double pdist = (fabs(g1-eg1) + fabs(g2-eg2))/4.0;

	// distance between individuals
	double idist = fabs(g1-g2)/2.0;

	// weighted distance statistic
	double d = (1.0-idist)*pdist;

	return (d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movapd %xmm2, %xmm4
addsd %xmm2, %xmm4
movsd 0x2446(%rip), %xmm6     # 0x9008
movapd %xmm6, %xmm5
movapd %xmm0, %xmm7
movapd 0x248d(%rip), %xmm8     # 0x9060
subsd %xmm1, %xmm0
andpd %xmm8, %xmm0
mulsd 0x245c(%rip), %xmm0     # 0x9040
addsd %xmm6, %xmm0
subsd %xmm2, %xmm6
mulsd %xmm4, %xmm2
mulsd %xmm4, %xmm6
addsd %xmm2, %xmm6
movapd %xmm3, %xmm2
addsd %xmm3, %xmm2
subsd %xmm3, %xmm5
mulsd %xmm2, %xmm3
mulsd %xmm2, %xmm5
addsd %xmm3, %xmm5
subsd %xmm6, %xmm7
andpd %xmm8, %xmm7
subsd %xmm5, %xmm1
andpd %xmm8, %xmm1
addsd %xmm1, %xmm7
mulsd 0x240a(%rip), %xmm7     # 0x9038
mulsd %xmm7, %xmm0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tplinderoth[P]introDist/generalUtils.cpp
// Function: getFILE(std::basic_fstream<char, std::char_traits<char>>&, char const*, char const*)
bool getFILE(std::fstream &fp, const char* fname, const char* mode)
{
	int writeFile = 0;
	if (strcmp(mode, "out") == 0)
	{
		writeFile = 1;
		if(writeFile && fexists(fname))
		{
			fprintf(stderr,"File already exists: %s\n",fname);
			return false;
		}

		fp.open(fname, std::ios::out);
	}
	else if (strcmp(mode, "app") == 0)
		fp.open(fname, std::ios::app);
	else if (strcmp(mode, "in") == 0)
		fp.open(fname, std::ios::in);

	if( !fp )
	{
		fprintf(stderr,"Error opening FILE handle for file: %s\n",fname);
		fp.close();
		return false;
	}
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x22fa(%rip), %rsi      # 0x9ca8
movq %rdx, %rdi
callq 0x32b0
testl %eax, %eax
je 0x79e5
leaq 0x2304(%rip), %rsi      # 0x9cc5
movq %r15, %rdi
callq 0x32b0
testl %eax, %eax
je 0x79f5
cmpb $0x69, (%r15)
jne 0x7a03
cmpb $0x6e, 0x1(%r15)
jne 0x7a03
cmpb $0x0, 0x2(%r15)
jne 0x7a03
pushq $0x8
jmp 0x79f7
movq %rbx, %rdi
callq 0x7a6b
testl %eax, %eax
jne 0x7a4b
pushq $0x10
jmp 0x79f7
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3210
movq (%r14), %rax
movq -0x18(%rax), %rax
movb $0x1, %r15b
testb $0x5, 0x20(%r14,%rax)
jne 0x7a23
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x55a6(%rip), %rax      # 0xcfd0
movq (%rax), %rdi
leaq 0x2295(%rip), %rsi      # 0x9cc9
xorl %r15d, %r15d
movq %rbx, %rdx
xorl %eax, %eax
callq 0x32c0
movq %r14, %rdi
callq 0x3050
jmp 0x7a15
movq 0x557e(%rip), %rax      # 0xcfd0
movq (%rax), %rdi
leaq 0x2250(%rip), %rsi      # 0x9cac
xorl %r15d, %r15d
movq %rbx, %rdx
xorl %eax, %eax
callq 0x32c0
jmp 0x7a15
// File: /workspace/github_cpp_makefile_star2_O2/tplinderoth[P]introDist/generalUtils.cpp
// Function: readChunk(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>>>>&, unsigned int*, int*, std::istream&)
bool readChunk (std::vector<std::string>& datavec, unsigned int* chunk, int* end, std::istream& is)
{
	unsigned int i = 0;
	std::string(line);
	size_t cap = 0;

	if (!datavec.empty())
	{
		cap = datavec.capacity();
		datavec.clear();
		if (datavec.capacity() < cap)
			datavec.reserve(cap);
	}
	while (i < *chunk)
	{
		if (getline(is, line))
		{
			datavec.push_back(line);
			++i;
		}
		else if (is.eof())
		{
			datavec.resize(i); // remove empty elements
			*end = 1;
			*chunk = i; // number of lines processed upon returning
			return(true);
		}
		else
		{
			fprintf(stderr, "Failed reading stream in readChunk function\n");
			return(false);
		}
	}
	return(true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r12
movq %rdx, -0x38(%rbp)
movq %rsi, -0x30(%rbp)
movq %rdi, %r15
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%rdi), %rax
cmpq 0x8(%rdi), %rax
je 0x7af6
movq 0x10(%r15), %rbx
subq %rax, %rbx
movq %r15, %rdi
callq 0x7e5c
movq 0x10(%r15), %rax
subq (%r15), %rax
cmpq %rbx, %rax
jae 0x7af6
sarq $0x5, %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7e6a
xorl %r13d, %r13d
leaq -0x58(%rbp), %rbx
movb $0x1, %r14b
movq -0x30(%rbp), %rax
cmpl (%rax), %r13d
jae 0x7b5e
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3080
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7b32
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7efe
incq %r13
jmp 0x7afd
movq (%r12), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%r12,%rax)
je 0x7b79
movq %r15, %rdi
movq %r13, %rsi
callq 0x7f3a
movq -0x38(%rbp), %rax
movl $0x1, (%rax)
movq -0x30(%rbp), %rax
movl %r13d, (%rax)
leaq -0x58(%rbp), %rdi
callq 0x3120
movl %r14d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5450(%rip), %rax      # 0xcfd0
movq (%rax), %rcx
leaq 0x2167(%rip), %rdi      # 0x9cf1
pushq $0x2c
popq %rsi
pushq $0x1
popq %rdx
callq 0x3400
xorl %r14d, %r14d
jmp 0x7b5e
jmp 0x7b9c
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x33a0
// File: /workspace/github_cpp_makefile_star2_O2/tplinderoth[P]introDist/generalUtils.cpp
// Function: split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char)
std::vector<std::string> split (const std::string& s, char delim)
{
        std::vector<std::string> elems;
        std::stringstream ss(s);
        std::string sholder;
        while (std::getline(ss, sholder, delim))
        {
                if (!sholder.empty())
                        elems.push_back(sholder);
        }
        return elems;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movl %edx, %r14d
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq -0x1c8(%rbp), %rdi
pushq $0x18
popq %rdx
callq 0x3320
leaq -0x30(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movsbl %r14b, %r14d
leaq -0x1c8(%rbp), %r15
leaq -0x40(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl %r14d, %edx
callq 0x33e0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7c31
cmpq $0x0, -0x38(%rbp)
je 0x7c01
movq %rbx, %rdi
movq %r12, %rsi
callq 0x7efe
jmp 0x7c01
leaq -0x40(%rbp), %rdi
callq 0x3120
leaq -0x1c8(%rbp), %rdi
callq 0x31a0
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x7c76
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x3120
leaq -0x1c8(%rbp), %rdi
callq 0x31a0
movq %rbx, %rdi
callq 0x7f72
movq %r14, %rdi
callq 0x33a0
// File: /workspace/github_cpp_makefile_star2_O2/tplinderoth[P]introDist/generalUtils.cpp
// Function: AssertStyleException::what() const
const char* AssertStyleException::what() const throw()
{
        std::stringstream message;
        message << "Assert type exception occurred:\n";
        if (_error) message << _error;
        return message.str().c_str();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, %rbx
leaq -0x1b8(%rbp), %rdi
callq 0x3180
leaq -0x1a8(%rbp), %r14
leaq 0x1fb3(%rip), %rsi      # 0x9d1e
movq %r14, %rdi
callq 0x3220
movq 0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x7d84
movq %r14, %rdi
callq 0x3220
leaq -0x1a0(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x3310
leaq -0x30(%rbp), %rdi
movq (%rdi), %rbx
callq 0x3120
leaq -0x1b8(%rbp), %rdi
callq 0x31a0
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rdi
callq 0x6f05
nop
// File: /workspace/github_cpp_makefile_star2_O2/tplinderoth[P]introDist/generalUtils.cpp
// Function: PreConditionException::what() const
const char* PreConditionException::what() const throw()
{
        std::stringstream message;
        message << "Precondition exception occurred:\n";
        if (_error) message << _error;
        return message.str().c_str();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, %rbx
leaq -0x1b8(%rbp), %rdi
callq 0x3180
leaq -0x1a8(%rbp), %r14
leaq 0x1f3c(%rip), %rsi      # 0x9d3f
movq %r14, %rdi
callq 0x3220
movq 0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x7e1c
movq %r14, %rdi
callq 0x3220
leaq -0x1a0(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x3310
leaq -0x30(%rbp), %rdi
movq (%rdi), %rbx
callq 0x3120
leaq -0x1b8(%rbp), %rdi
callq 0x31a0
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rdi
callq 0x6f05
nop
// File: /workspace/github_cpp_makefile_star2_O2/tdv[P]boss/boss/examples/construct_destroy/main.cpp
// Function: main
int main()
{
  try
  {
    Boss::Base<MyNs::Impl::Face_1_2_3>::Create(false);
    std::cout << std::endl;
    Boss::Base<MyNs::Impl::Face_1_2_3>::Create(true);
  }
  catch (std::exception const &e)
  {
    std::cerr << "Error: " << e.what() << std::endl;
  }
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0x7(%rsp), %rsi
movb $0x0, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x17120
leaq 0x10(%rsp), %rdi
callq 0x171b6
leaq 0xe13d3(%rip), %rdi     # 0xf8460
callq 0x83700
leaq 0x7(%rsp), %rsi
movb $0x1, (%rsi)
leaq 0x8(%rsp), %rdi
callq 0x17120
leaq 0x8(%rsp), %rdi
callq 0x171b6
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
jmp 0x170bc
jmp 0x170bc
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x17110
movq %rbx, %rdi
callq 0x18210
movq %rax, %rbx
leaq 0xe126a(%rip), %rdi     # 0xf8340
leaq 0xa3f27(%rip), %rsi     # 0xbb004
callq 0x83e20
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x83e20
movq %rax, %rdi
callq 0x83700
callq 0x18280
jmp 0x170ae
movq %rax, %rbx
callq 0x18280
movq %rbx, %rdi
callq 0xb8770
movq %rax, %rdi
callq 0x171c6
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/ProtocolServer.cpp
// Function: StartServer(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void StartServer(int port, string pArgsFile, string serverDataDir)
{
  CSocket *socket = new CSocket();
  if (Listen(socket, port))
  {
    ServerLog("accepted connection from client");
  }
  else
  {
    stringstream ss;
    ss << "failed to listen for client connections on port " << port;
    ServerLog(ss.str());
    return;
  }

  RunServerProtocol(socket, pArgsFile, serverDataDir);

  ServerLog("protocol execution completed");

  cout << endl
       << "bytes sent: " << socket->GetBytesSent() << endl;
  cout << "bytes received: " << socket->GetBytesReceived() << endl;

  socket->Close();

  delete socket;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
pushq $0x20
popq %rdi
callq 0x2240
orl $-0x1, (%rax)
andq $0x0, 0x18(%rax)
vxorps %xmm0, %xmm0, %xmm0
movq %rax, %rbx
movq %rax, %rdi
movl %ebp, %esi
vmovups %xmm0, 0x8(%rax)
callq 0x34cc
testb %al, %al
je 0x327a
leaq 0x2ea2(%rip), %rsi      # 0x602c
leaq 0x60(%rsp), %rdi
movq %rsp, %rdx
callq 0x20e0
leaq 0x60(%rsp), %rdi
callq 0x30bb
leaq 0x60(%rsp), %rdi
callq 0x20f0
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x22f0
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x22f0
leaq 0x40(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x257c
leaq 0x20(%rsp), %rdi
callq 0x20f0
leaq 0x40(%rsp), %rdi
callq 0x20f0
leaq 0x2e8b(%rip), %rsi      # 0x607d
leaq 0x60(%rsp), %rdi
movq %rsp, %rdx
callq 0x20e0
leaq 0x60(%rsp), %rdi
callq 0x30bb
leaq 0x60(%rsp), %rdi
callq 0x20f0
movq 0x5dbe(%rip), %r14      # 0x8fd8
movq %r14, %rdi
callq 0x2110
leaq 0x2e71(%rip), %rsi      # 0x609a
movq %rax, %rdi
callq 0x2220
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
callq 0x2110
leaq 0x2e5b(%rip), %rsi      # 0x60a7
movq %r14, %rdi
callq 0x2220
movq 0x10(%rbx), %rsi
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x34ac
movq %rbx, %rdi
callq 0x2200
jmp 0x32c6
leaq 0x60(%rsp), %rdi
callq 0x2170
leaq 0x70(%rsp), %rdi
leaq 0x2dbc(%rip), %rsi      # 0x604c
callq 0x2220
movq %rax, %rdi
movl %ebp, %esi
callq 0x2380
leaq 0x78(%rsp), %rsi
movq %rsp, %rdi
callq 0x2340
movq %rsp, %rdi
callq 0x30bb
movq %rsp, %rdi
callq 0x20f0
leaq 0x60(%rsp), %rdi
callq 0x2180
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3300
jmp 0x330f
movq %rsp, %rdi
movq %rax, %rbx
callq 0x20f0
jmp 0x3317
leaq 0x20(%rsp), %rdi
movq %rax, %rbx
callq 0x20f0
jmp 0x32f9
jmp 0x3314
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
jmp 0x3308
leaq 0x60(%rsp), %rdi
movq %rax, %rbx
callq 0x20f0
jmp 0x3321
movq %rax, %rbx
jmp 0x3321
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x2180
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O2/jBlinden[P]private-codis/ProtocolServer.cpp
// Function: main
int main(int argc, char **argv)
{
  if (argc < 4)
  {
    cout << "usage: ./ProtocolServer ProtocolArgsFile serverDataDir port" << endl;
    return 1;
  }

  srand(time(NULL));

  ServerLog("finished loading data from disk");

  int port = atoi(argv[3]);

  string pArgsFile(argv[1]);
  string serverDataDir(argv[2]);

  StartServer(port, pArgsFile, serverDataDir);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x88, %rsp
cmpl $0x3, %edi
jg 0x335a
movq 0x5c9a(%rip), %rdi      # 0x8fd8
leaq 0x2d73(%rip), %rsi      # 0x60b8
callq 0x2220
movq %rax, %rdi
callq 0x2110
pushq $0x1
popq %rax
jmp 0x341f
xorl %edi, %edi
movq %rsi, %rbx
callq 0x21f0
movl %eax, %edi
callq 0x2210
leaq 0x2d82(%rip), %rsi      # 0x60f4
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x20e0
leaq 0x8(%rsp), %rdi
callq 0x30bb
leaq 0x8(%rsp), %rdi
callq 0x20f0
movq 0x18(%rbx), %rdi
callq 0x2330
movq 0x8(%rbx), %rsi
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x20e0
movq 0x10(%rbx), %rsi
leaq 0x28(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x20e0
leaq 0x68(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x22f0
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x22f0
leaq 0x68(%rsp), %rsi
leaq 0x48(%rsp), %rdx
movl %ebp, %edi
callq 0x3140
leaq 0x48(%rsp), %rdi
callq 0x20f0
leaq 0x68(%rsp), %rdi
callq 0x20f0
leaq 0x28(%rsp), %rdi
callq 0x20f0
leaq 0x8(%rsp), %rdi
callq 0x20f0
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %rbp
retq
leaq 0x48(%rsp), %rdi
movq %rax, %rbx
callq 0x20f0
jmp 0x343b
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x20f0
jmp 0x344a
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x20f0
jmp 0x345d
jmp 0x345a
jmp 0x3469
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20f0
jmp 0x346c
movq %rax, %rbx
movq %rbx, %rdi
callq 0x2390
// File: /workspace/github_cpp_makefile_star2_O2/bummelbaerchen[P]e3dc/RscpExampleMain.cpp
// Function: ControlLoadData(SRscpFrameBuffer*, int, int)
int ControlLoadData(SRscpFrameBuffer * frameBuffer,int32_t Power,int32_t Mode ) {
    RscpProtocol protocol;
    SRscpValue rootValue;
    // The root container is create with the TAG ID 0 which is not used by any device.
    protocol.createContainerValue(&rootValue, 0);
    
    // request Power Meter information
    SRscpValue PMContainer;
//    Power = Power*-1;
    protocol.createContainerValue(&PMContainer, TAG_EMS_REQ_SET_POWER);
    protocol.appendValue(&PMContainer, TAG_EMS_REQ_SET_POWER_MODE,Mode);
    if (Mode > 0)
    protocol.appendValue(&PMContainer, TAG_EMS_REQ_SET_POWER_VALUE,Power);
    // append sub-container to root container
    protocol.appendValue(&rootValue, PMContainer);
    // free memory of sub-container as it is now copied to rootValue
    protocol.destroyValueData(PMContainer);
 
    
    
    
    // create buffer frame to send data to the S10
    protocol.createFrameAsBuffer(frameBuffer, rootValue.data, rootValue.length, true); // true to calculate CRC on for transfer
    // the root value object should be destroyed after the data is copied into the frameBuffer and is not needed anymore
    protocol.destroyValueData(rootValue);
    
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movl %esi, 0x14(%rsp)
movl %edx, 0x10(%rsp)
movq %rsp, %r14
movq %r14, %rdi
callq 0x66e8
leaq 0x18(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x29(%rsp), %rsi
movq %r14, %rdi
callq 0x6096
leaq 0xc(%rsp), %rdx
movl $0x1000030, (%rdx)      # imm = 0x1000030
movq %rsp, %rdi
leaq 0x18(%rsp), %rsi
callq 0x6096
leaq 0xc(%rsp), %rdx
movl $0x1000031, (%rdx)      # imm = 0x1000031
movq %rsp, %rdi
leaq 0x18(%rsp), %rsi
leaq 0x10(%rsp), %rcx
callq 0x60a6
cmpl $0x0, 0x10(%rsp)
jle 0x24d7
leaq 0xc(%rsp), %rdx
movl $0x1000032, (%rdx)      # imm = 0x1000032
movq %rsp, %rdi
leaq 0x18(%rsp), %rsi
leaq 0x14(%rsp), %rcx
callq 0x60a6
movq %rsp, %rdi
leaq 0x29(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x60c2
movq %rsp, %rdi
leaq 0x18(%rsp), %rsi
callq 0x734c
movq 0x30(%rsp), %rdx
movzwl 0x2e(%rsp), %ecx
movq %rsp, %rdi
pushq $0x1
popq %r8
movq %rbx, %rsi
callq 0x67c4
movq %rsp, %rdi
leaq 0x29(%rsp), %rsi
callq 0x734c
movq %rsp, %rdi
callq 0x66f4
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
jmp 0x2536
jmp 0x2536
jmp 0x2536
jmp 0x2536
movq %rax, %rbx
movq %rsp, %rdi
callq 0x66f4
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/bummelbaerchen[P]e3dc/RscpExampleMain.cpp
// Function: ControlLoadData2(SRscpFrameBuffer*, int)
int ControlLoadData2(SRscpFrameBuffer * frameBuffer,int32_t iPower) {
    RscpProtocol protocol;
    SRscpValue rootValue;
    uint32_t uPower;
    if (iPower < 0) uPower = 0; else if (iPower>e3dc_config.maximumLadeleistung) uPower = e3dc_config.maximumLadeleistung; else uPower = iPower;
    // The root container is create with the TAG ID 0 which is not used by any device.
    protocol.createContainerValue(&rootValue, 0);
    
    // request Power Meter information
    SRscpValue PMContainer;
    protocol.createContainerValue(&PMContainer, TAG_EMS_REQ_SET_POWER_SETTINGS);
    protocol.appendValue(&PMContainer, TAG_EMS_POWER_LIMITS_USED,true);
   protocol.appendValue(&PMContainer, TAG_EMS_MAX_CHARGE_POWER,uPower);
//    protocol.appendValue(&PMContainer, TAG_EMS_MAX_DISCHARGE_POWER,300);
//    protocol.appendValue(&PMContainer, TAG_EMS_DISCHARGE_START_POWER,70);
    // append sub-container to root container
    protocol.appendValue(&rootValue, PMContainer);
    // free memory of sub-container as it is now copied to rootValue
    protocol.destroyValueData(PMContainer);
    
    
    
    
    // create buffer frame to send data to the S10
    protocol.createFrameAsBuffer(frameBuffer, rootValue.data, rootValue.length, true); // true to calculate CRC on for transfer
    // the root value object should be destroyed after the data is copied into the frameBuffer and is not needed anymore
    protocol.destroyValueData(rootValue);
    
    return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movq %rsp, %rdi
callq 0x66e8
testl %ebp, %ebp
js 0x2570
movl 0x13236(%rip), %eax     # 0x1579c
cmpl %ebp, %eax
jge 0x2577
movl %eax, 0xc(%rsp)
jmp 0x257b
andl $0x0, 0xc(%rsp)
jmp 0x257b
movl %ebp, 0xc(%rsp)
leaq 0x18(%rsp), %rdx
andl $0x0, (%rdx)
movq %rsp, %rdi
leaq 0x29(%rsp), %rsi
callq 0x6096
leaq 0x14(%rsp), %rdx
movl $0x100008c, (%rdx)      # imm = 0x100008C
movq %rsp, %rdi
leaq 0x18(%rsp), %rsi
callq 0x6096
leaq 0x14(%rsp), %rdx
movl $0x1000100, (%rdx)      # imm = 0x1000100
leaq 0x13(%rsp), %rcx
movb $0x1, (%rcx)
movq %rsp, %rdi
leaq 0x18(%rsp), %rsi
callq 0x6122
leaq 0x14(%rsp), %rdx
movl $0x1000101, (%rdx)      # imm = 0x1000101
movq %rsp, %rdi
leaq 0x18(%rsp), %rsi
leaq 0xc(%rsp), %rcx
callq 0x613e
movq %rsp, %rdi
leaq 0x29(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x60c2
movq %rsp, %rdi
leaq 0x18(%rsp), %rsi
callq 0x734c
movq 0x30(%rsp), %rdx
movzwl 0x2e(%rsp), %ecx
movq %rsp, %rdi
pushq $0x1
popq %r8
movq %rbx, %rsi
callq 0x67c4
movq %rsp, %rdi
leaq 0x29(%rsp), %rsi
callq 0x734c
movq %rsp, %rdi
callq 0x66f4
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
jmp 0x2643
jmp 0x2643
jmp 0x2643
jmp 0x2643
movq %rax, %rbx
movq %rsp, %rdi
callq 0x66f4
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/bummelbaerchen[P]e3dc/RscpProtocol.cpp
// Function: RscpProtocol::setHeaderTimestamp(SRscpFrame*)
bool RscpProtocol::setHeaderTimestamp(SRscpFrame *frame) {
	// sanity check
	if(frame == NULL) {
		return false;
	}

	bool bTimeSet = false;
	// get linux timestamp
	struct timeval timeVal;
	gettimeofday(&timeVal, NULL);
	// set frame timestamp
	frame->header.timestamp.seconds = timeVal.tv_sec;
	frame->header.timestamp.nanoseconds = timeVal.tv_usec * 1000;

	return bTimeSet;
}

// Assembly:
testq %rsi, %rsi
je 0x6735
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x22a0
movq (%r14), %rax
movq %rax, 0x4(%rbx)
imull $0x3e8, 0x8(%r14), %eax # imm = 0x3E8
movl %eax, 0xc(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/bummelbaerchen[P]e3dc/AES.cpp
// Function: AES::KeyExpansion(unsigned char const*)
void AES::KeyExpansion(const unsigned char * key)
	{
	int i;
	uint32_t temp, * Wb = reinterpret_cast<uint32_t*>(W); // todo not portable - Endian problems
	if (Nk <= 6)
		{
		// todo - memcpy
		for (i = 0; i < 4*Nk; i++)
			W[i] = key[i];
		for (i = Nk; i < Nb*(Nr+1); i++)
			{
			temp = Wb[i-1];
			if ((i%Nk) == 0)
				temp = SubByte(RotByte(temp)) ^ Rcon[i/Nk];
			Wb[i] = Wb[i - Nk]^temp;
			}
		}
	else
		{
		// todo - memcpy
		for (i = 0; i < 4*Nk; i++)
			W[i] = key[i];
		for (i = Nk; i < Nb*(Nr+1); i++)
			{
			temp = Wb[i-1];
			if ((i%Nk) == 0)
				temp = SubByte(RotByte(temp)) ^ Rcon[i/Nk];
			else if ((i%Nk) == 4)
				temp = SubByte(temp);
			Wb[i] = Wb[i - Nk]^temp;
			}
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movslq 0x4(%rdi), %rbx
leal (,%rbx,4), %eax
cmpq $0x7, %rbx
jge 0x76b4
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
cmpq %rcx, %rax
je 0x7658
movb (%rsi,%rcx), %dl
movb %dl, 0xc(%r14,%rcx)
incq %rcx
jmp 0x7646
leaq 0xe281(%rip), %r15      # 0x158e0
movslq (%r14), %rax
movslq 0x8(%r14), %rcx
incq %rcx
imulq %rax, %rcx
cmpq %rcx, %rbx
jge 0x772d
movl 0x8(%r14,%rbx,4), %edi
movslq 0x4(%r14), %r12
movl %ebx, %eax
cltd
idivl %r12d
testl %edx, %edx
jne 0x769c
movl %eax, %ebp
roll $0x18, %edi
callq 0x773c
movl %eax, %edi
movslq %ebp, %rax
xorl (%r15,%rax,4), %edi
shlq $0x2, %r12
movq %r14, %rax
subq %r12, %rax
xorl 0xc(%rax,%rbx,4), %edi
movl %edi, 0xc(%r14,%rbx,4)
incq %rbx
jmp 0x765f
leaq 0xc(%r14), %r15
movl %eax, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x76ce
movb (%rsi,%rcx), %dl
movb %dl, 0xc(%r14,%rcx)
incq %rcx
jmp 0x76bc
movslq (%r14), %rax
movslq 0x8(%r14), %r12
incq %r12
imulq %rax, %r12
movl %ebx, %r13d
movq %r13, %r14
cmpq %r12, %r14
jge 0x772d
movl -0x4(%r15,%r13,4), %edi
movl %r14d, %eax
cltd
idivl %ebx
cmpl $0x4, %edx
je 0x7716
testl %edx, %edx
jne 0x771d
movl %eax, %ebp
roll $0x18, %edi
callq 0x773c
movl %eax, %edi
movslq %ebp, %rax
leaq 0xe1cf(%rip), %rcx      # 0x158e0
xorl (%rcx,%rax,4), %edi
jmp 0x771d
callq 0x773c
movl %eax, %edi
xorl (%r15), %edi
movl %edi, (%r15,%r13,4)
incq %r14
addq $0x4, %r15
jmp 0x76e2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/bummelbaerchen[P]e3dc/AES.cpp
// Function: (anonymous namespace)::SubByte(unsigned int)
uint32_t SubByte(uint32_t data)
	{ // does the SBox on this 4 byte data
	unsigned result = 0;
	result = byte_sub[data>>24];
	result <<= 8;
	result |= byte_sub[(data>>16)&255];
	result <<= 8;
	result |= byte_sub[(data>>8)&255];
	result <<= 8;
	result |= byte_sub[data&255];
	return result;
	}

// Assembly:
movl %edi, %eax
shrl $0x18, %eax
leaq 0x12298(%rip), %rcx     # 0x199e0
movzbl (%rax,%rcx), %eax
movl %edi, %edx
shrl $0x10, %edx
movl $0xff, %esi
andl %esi, %edx
movzbl (%rdx,%rcx), %edx
shll $0x10, %eax
shll $0x8, %edx
orl %eax, %edx
movl %edi, %eax
shrl $0x8, %eax
andl %esi, %eax
movzbl (%rax,%rcx), %r8d
orl %edx, %r8d
shll $0x8, %r8d
andl %esi, %edi
movzbl (%rdi,%rcx), %eax
orl %r8d, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/bummelbaerchen[P]e3dc/AES.cpp
// Function: AES::Encrypt(unsigned char const*, unsigned char*, unsigned int, AES::BlockMode)
void AES::Encrypt(const unsigned char * datain, unsigned char * dataout, uint32_t numBlocks, BlockMode mode)
	{
	if (0 == numBlocks)
		return;
	unsigned int blocksize = Nb*4;
	switch (mode)
		{
		case ECB :
			while (numBlocks)
				{
				EncryptBlock(datain,dataout);
				datain   += blocksize;
				dataout  += blocksize;
				--numBlocks;
				}
			break;
		case CBC :
			{
			unsigned char buffer[32]; // max blocksize
			memcpy(buffer,iv,blocksize); // clear out - todo - allow setting the Initialization Vector - needed for security
			while (numBlocks)
				{
				for (unsigned int pos = 0; pos < blocksize; ++pos)
					buffer[pos] ^= *datain++;
				EncryptBlock(buffer,dataout);
				memcpy(buffer,dataout,blocksize);
				dataout  += blocksize;
				--numBlocks;
				}
			}
			break;
		default :
			break;
		}
	}

// Assembly:
testl %ecx, %ecx
je 0xbe14
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl (%rdi), %eax
shll $0x2, %eax
cmpl $0x1, %r8d
je 0xbda5
testl %r8d, %r8d
jne 0xbe06
movl %eax, %r13d
subl $0x1, %ebx
jb 0xbe06
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x7812
addq %r13, %r15
addq %r13, %r14
jmp 0xbd8a
movq %r12, 0x8(%rsp)
leaq 0x1ec(%r12), %rsi
movl %eax, %r13d
leaq 0x10(%rsp), %rdi
movq %r13, %rdx
callq 0x2150
subl $0x1, %ebx
jb 0xbe06
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
cmpq %rbp, %r13
je 0xbde0
movb (%r15,%rbp), %al
xorb %al, 0x10(%rsp,%rbp)
incq %rbp
jmp 0xbdce
leaq 0x10(%rsp), %r12
movq %r12, %rsi
movq %r14, %rdx
callq 0x7812
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x2150
addq %r13, %r14
addq %rbp, %r15
jmp 0xbdc2
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/bummelbaerchen[P]e3dc/SocketConnection.cpp
// Function: SocketSendData(int, unsigned char const*, int)
int SocketSendData(int iSocket, const unsigned char * ucBuffer, int iLength)
{
    // sanity check
    if(iSocket < 0) {
        return iSocket;
    }

    int iSentBytes = 0;
    while(iLength)
    {
        long result = send(iSocket, ucBuffer, iLength, 0);
        if(result <= 0) {
            return -1;
        }
        iSentBytes += result;
        ucBuffer += result;
        iLength -= result;
    }
    return iSentBytes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebx
testl %edi, %edi
js 0x10d4e
movl %edx, %ebp
movq %rsi, %r14
xorl %r15d, %r15d
pushq $-0x1
popq %r12
testl %ebp, %ebp
je 0x10d4b
movslq %ebp, %rdx
movl %ebx, %edi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x20f0
addl %eax, %r15d
addq %rax, %r14
subl %eax, %ebp
testq %rax, %rax
jg 0x10d26
movl %r12d, %ebx
jmp 0x10d4e
movl %r15d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/IsaacLaw12[P]RayTracer/./src/Image.cpp
// Function: Image::set_dimensions(int, int)
void Image::set_dimensions(int width, int height){
    int scale = anti_alias + 1;
    orig_width = width;
    orig_height = height;
    image_width = width * scale;
    image_height = height * scale;
    red_pixels = Eigen::MatrixXd();
    green_pixels = Eigen::MatrixXd();
    blue_pixels = Eigen::MatrixXd();
    red_pixels.conservativeResize(image_width, image_height);
    green_pixels.conservativeResize(image_width, image_height);
    blue_pixels.conservativeResize(image_width, image_height);

    t_values = Eigen::MatrixXd();
    t_values.conservativeResize(image_width, image_height);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x4(%rdi), %eax
incl %eax
movl %esi, 0x8(%rdi)
movl %edx, 0xc(%rdi)
imull %eax, %esi
movl %esi, 0x10(%rdi)
imull %edx, %eax
movl %eax, 0x14(%rdi)
leaq 0x18(%rdi), %r14
movq 0x18(%rdi), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
andq $0x0, 0x28(%rbx)
callq 0x3300
leaq 0x30(%rbx), %r15
movq 0x30(%rbx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
andq $0x0, 0x40(%rbx)
callq 0x3300
leaq 0x48(%rbx), %r12
movq 0x48(%rbx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rbx)
andq $0x0, 0x58(%rbx)
callq 0x3300
movslq 0x10(%rbx), %rsi
movslq 0x14(%rbx), %rdx
movq %r14, %rdi
callq 0x461a
movslq 0x10(%rbx), %rsi
movslq 0x14(%rbx), %rdx
movq %r15, %rdi
callq 0x461a
movslq 0x10(%rbx), %rsi
movslq 0x14(%rbx), %rdx
movq %r12, %rdi
callq 0x461a
leaq 0xa8(%rbx), %r14
movq 0xa8(%rbx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0xa8(%rbx)
andq $0x0, 0xb8(%rbx)
callq 0x3300
movslq 0x10(%rbx), %rsi
movslq 0x14(%rbx), %rdx
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x461a
nop
// File: /workspace/github_cpp_makefile_star2_O2/IsaacLaw12[P]RayTracer/./src/Image.cpp
// Function: Image::Image(Image const&)
Image::Image(const Image&old_image){
    anti_alias = old_image.get_aa();
    int width = old_image.get_width();
    int height = old_image.get_height();
    set_dimensions(width, height);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movb $0x0, (%rdi)
addq $0x4, %rdi
movl $0xbc, %edx
xorl %esi, %esi
callq 0x3170
movl 0x4(%r14), %eax
movl %eax, 0x4(%rbx)
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
movq %rbx, %rdi
callq 0x3922
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, (%rsp)
leaq 0xa8(%rbx), %rdi
leaq 0x90(%rbx), %r15
leaq 0x78(%rbx), %r12
leaq 0x60(%rbx), %r13
leaq 0x48(%rbx), %rbp
leaq 0x30(%rbx), %r14
addq $0x18, %rbx
callq 0x4606
movq %r15, %rdi
callq 0x4606
movq %r12, %rdi
callq 0x4606
movq %r13, %rdi
callq 0x4606
movq %rbp, %rdi
callq 0x4606
movq %r14, %rdi
callq 0x4606
movq %rbx, %rdi
callq 0x4606
movq (%rsp), %rdi
callq 0x3490