LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/czmccrory[P]ManchesterBaby/baby.cpp
// Function: main
int main(int argc, char** argv) {
  ManchesterBaby mb;
  if(argc > 2) {
  	cerr<<"Invalid use of program. Run using either \"" << argv[0]
  		<<"\" or \"" <<argv[0]<<" "<< argv[1] << "\"." <<endl;
  		return 1;
  } else if (argc == 2) {
  	mb.setParamFile(argv[1]);
  	mb.menu();
  } else {
 	mb.menu();
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x28(%rsp), %rdi
callq 0x24cc
cmpl $0x3, %ebp
jl 0x568e
movq 0x599a(%rip), %r14      # 0xaff0
leaq 0x1c88(%rip), %rsi      # 0x72e5
movl $0x2a, %edx
movq %r14, %rdi
callq 0x2200
movq (%rbx), %r15
testq %r15, %r15
je 0x56ec
movq %r15, %rdi
callq 0x20b0
movq 0x596f(%rip), %rdi      # 0xaff0
movq %r15, %rsi
movq %rax, %rdx
callq 0x2200
jmp 0x5704
cmpl $0x2, %ebp
jne 0x56db
movq 0x8(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x59de
leaq 0x80(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x20e0
movb $0x1, 0xa0(%rsp)
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x56db
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
xorl %ebx, %ebx
leaq 0x28(%rsp), %rdi
callq 0x530c
jmp 0x57fe
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x22e0
movq 0x58e5(%rip), %r14      # 0xaff0
leaq 0x1bfe(%rip), %rsi      # 0x7310
movl $0x6, %edx
movq %r14, %rdi
callq 0x2200
movq (%rbx), %r15
testq %r15, %r15
je 0x5743
movq %r15, %rdi
callq 0x20b0
movq 0x58ba(%rip), %rdi      # 0xaff0
movq %r15, %rsi
movq %rax, %rdx
callq 0x2200
jmp 0x575b
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x22e0
movq 0x588e(%rip), %r14      # 0xaff0
leaq 0x1a8a(%rip), %rsi      # 0x71f3
movl $0x1, %edx
movq %r14, %rdi
callq 0x2200
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0x579b
movq %rbx, %rdi
callq 0x20b0
movq 0x5862(%rip), %rdi      # 0xaff0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2200
jmp 0x57b3
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x22e0
movq 0x5836(%rip), %rbx      # 0xaff0
leaq 0x1b56(%rip), %rsi      # 0x7317
movl $0x2, %edx
movq %rbx, %rdi
callq 0x2200
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq 0x5804(%rip), %rdi      # 0xaff0
callq 0x2030
movl $0x1, %ebx
movq %rax, %rdi
callq 0x2120
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x581f
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x583a
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x50(%rsp), %rdi
callq 0x6242
leaq 0x48(%rsp), %rdi
callq 0x6242
leaq 0x40(%rsp), %rdi
callq 0x6242
leaq 0x28(%rsp), %rdi
callq 0x592c
movl %ebx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5897
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x5897
jmp 0x5894
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x5a26
movq %rbx, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O3/czmccrory[P]ManchesterBaby/line.cpp
// Function: binToDec(std::vector<bool, std::allocator<bool>>*)
int binToDec(vector<bool> * bin)
{
	bool negative = bin->back(); //1/true means negative, 0/false means positive
  int length = bin->size();
  int decimal = 0;

  for (int i = 0; i < length -1; i++)
  {
    if (bin->at(i) == 1) //add value of 2^(length - i - 1)(value of its position in the binary number)
    {
      decimal += (static_cast<int>(pow(2, i)));
    }
  }

  if (negative) {
  	return 0-decimal;
  } else {
	return decimal;
  }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movl 0x18(%rdi), %ecx
leaq -0x1(%rcx), %r15
movq %rcx, %rdx
addq $0x3e, %rdx
testq %r15, %r15
cmovnsq %r15, %rdx
sarq $0x6, %rdx
leaq (%rax,%rdx,8), %rdx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
leaq 0x3f(%rsi), %rdi
andq %r15, %rdi
xorl %r8d, %r8d
cmpq %rsi, %rdi
setbe %r8b
movq -0x8(%rdx,%r8,8), %r12
subl (%rbx), %eax
leal (%rcx,%rax,8), %eax
decl %eax
testl %eax, %eax
jle 0x5ebb
movl %eax, %r13d
xorl %r14d, %r14d
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x63f2
testq %rdx, (%rax)
je 0x5eb1
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
callq 0x2190
cvttsd2si %xmm0, %eax
addl %eax, %ebp
incq %r14
cmpq %r13, %r14
jb 0x5e8e
jmp 0x5ebd
xorl %ebp, %ebp
movl %ebp, %eax
negl %eax
btq %r15, %r12
cmovael %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/czmccrory[P]ManchesterBaby/line.cpp
// Function: decToBin(int, int)
vector<bool>* decToBin(int dec, int numOfBits) 
{	
  vector<bool>* bin = new vector<bool>(numOfBits, 0); // vector to hold binary value (in this case size 8 for rule.)

  //const unsigned long long maxDec = pow(2,numOfBits)-1; //we are using operandWidth-bit numbers
   //with the last bit as the sign
  bool negative;
  if (dec < 0) {
  	negative = true;
	dec = 0 - dec;
  } else {
  	negative = false;
  }
  for (size_t i=numOfBits-1; dec>0; i--)
  {
    // take the remainder of the dec / 2 and save it to the vector
    // this value will always be 1 or 0
    (*bin).at(numOfBits-1-i) = dec%2;
    // update dec
    dec /= 2;
  }
  bin->at(numOfBits-1) = negative; //setting the 13th bit

  return bin;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %r14d
movl %edi, %ebp
movl $0x28, %edi
callq 0x21c0
movq %rax, %rbx
movslq %r14d, %rsi
leaq 0xf(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0xe(%rsp), %rcx
movq %rax, %rdi
callq 0x6538
decl %r14d
movslq %r14d, %r14
testl %ebp, %ebp
je 0x5fd1
movl %ebp, %r12d
negl %r12d
cmovsl %ebp, %r12d
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x63f2
testb $0x1, %r12b
jne 0x5fa6
notq %rdx
andq (%rax), %rdx
jmp 0x5fa9
orq (%rax), %rdx
movq %rdx, (%rax)
movl %r12d, %eax
shrl %eax
incq %r15
cmpl $0x2, %r12d
movl %eax, %r12d
jae 0x5f8d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x63f2
testl %ebp, %ebp
jns 0x5fdc
orq (%rax), %rdx
jmp 0x5fe2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x63f2
notq %rdx
andq (%rax), %rdx
movq %rdx, (%rax)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0x28, %esi
movq %rbx, %rdi
callq 0x21d0
movq %r14, %rdi
callq 0x2300
// File: /workspace/github_cpp_makefile_star2_O3/czmccrory[P]ManchesterBaby/line.cpp
// Function: printVector(std::vector<bool, std::allocator<bool>>*)
void printVector(vector<bool> * v) {
	vector<bool>::iterator it;
	for (it=v->begin(); it != v->end(); ++it) {
		cout << *it << "" <<flush;
	}
	cout <<flush;
	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r13
cmpq 0x10(%rdi), %r13
jne 0x6046
cmpl $0x0, 0x18(%rbx)
je 0x60a9
movq 0x4f7b(%rip), %r14      # 0xafc8
leaq 0x10b2(%rip), %r15      # 0x7106
xorl %ebp, %ebp
movq (%r13), %rax
xorl %esi, %esi
btq %rbp, %rax
setb %sil
movq %r14, %rdi
callq 0x22d0
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2200
movq %r12, %rdi
callq 0x2120
xorl %eax, %eax
cmpl $0x3f, %ebp
leal 0x1(%rbp), %ecx
sete %al
leaq (%r13,%rax,8), %r13
movl %ecx, %ebp
movl $0x0, %eax
cmovel %eax, %ebp
cmpq 0x10(%rbx), %r13
jne 0x6056
cmpl 0x18(%rbx), %ebp
jne 0x6056
movq 0x4f18(%rip), %rdi      # 0xafc8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2120
nop
// File: /workspace/github_cpp_makefile_star2_O3/czmccrory[P]ManchesterBaby/line.cpp
// Function: Line::set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Line::set(string s) {
	//cout << "trying to set(string) " << endl;
	//delete line;
	line = new vector<bool>; //use something else to empty it
	for (char &c : s) {
		if (c == '0') {
			line->push_back(0);
		} else if (c == '1'){ //anything that's not 0
			line->push_back(1);
		}
		//cout << c;
		//cout << static_cast<int>(c);
	}

	//cout <<endl;// << "all set. " <<endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x28, %edi
callq 0x21c0
xorl %ecx, %ecx
movq %rcx, (%rax)
movl %ecx, 0x8(%rax)
movq %rcx, 0x10(%rax)
movl %ecx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %rax, (%rbx)
movq 0x8(%r14), %r15
testq %r15, %r15
je 0x6235
movq (%r14), %r14
xorl %r12d, %r12d
movzbl (%r14,%r12), %eax
cmpl $0x30, %eax
je 0x6220
cmpl $0x31, %eax
jne 0x622d
movb $0x1, %al
jmp 0x6222
xorl %eax, %eax
movq (%rbx), %rdi
movzbl %al, %esi
callq 0x64ea
incq %r12
cmpq %r12, %r15
jne 0x620d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/m8pple[P]arch2-2014-cw1/src/eie2ugs/test_mips.cpp
// Function: main
int main()
{
	mips_mem_h mem=mips_mem_create_ram(
		1<<20,
		4
		);

	mips_cpu_h cpu=mips_cpu_create(mem);

	mips_test_begin_suite();

	int testId=mips_test_begin_test("and");
	int passed=0;

	
	mips_error err = mips_cpu_set_register(cpu, 8, 0x0000FFFFul);
	if(err==0)
		err = mips_cpu_set_register(cpu, 9, 0x00FFFF00ul);

	// and $10, $8, $9

	// TODO : work out the bit-wise encoding for the instruction.

	// TODO : Write it into mempory at a known address

	// TODO : Make sure the program-counter is at that address

	if(err==0)
		err=mips_cpu_step(cpu);

	uint32_t got;
	if(err==0)
		err = (mips_error)(err | mips_cpu_get_register(cpu, 10, &got));

	passed = (err == mips_Success) && (got==0x0000FF00);

	mips_test_end_test(testId, passed, NULL);

	mips_test_end_suite();

	mips_cpu_free(cpu);
	mips_mem_free(mem);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0x100000, %edi         # imm = 0x100000
movl $0x4, %esi
callq 0x390c
movq %rax, %rbx
movq %rax, %rdi
callq 0x3a28
movq %rax, %r14
callq 0x25f4
leaq 0x2068(%rip), %rdi      # 0x45c4
callq 0x26a7
movl %eax, %ebp
movq %r14, %rdi
movl $0x8, %esi
movl $0xffff, %edx           # imm = 0xFFFF
callq 0x3a9f
testl %eax, %eax
jne 0x258f
movq %r14, %rdi
movl $0x9, %esi
movl $0xffff00, %edx         # imm = 0xFFFF00
callq 0x3a9f
testl %eax, %eax
je 0x25bc
xorl %esi, %esi
movl %ebp, %edi
xorl %edx, %edx
callq 0x281e
callq 0x28a6
movq %r14, %rdi
callq 0x3a6f
movq %rbx, %rdi
callq 0x3a09
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x3abd
xorl %esi, %esi
testl %eax, %eax
jne 0x2591
leaq 0x4(%rsp), %r15
movq %r14, %rdi
movl $0xa, %esi
movq %r15, %rdx
callq 0x3a74
movl (%r15), %ecx
xorl $0xff00, %ecx           # imm = 0xFF00
xorl %esi, %esi
orl %eax, %ecx
sete %sil
jmp 0x2591
nop
// File: /workspace/github_cpp_makefile_star2_O3/m8pple[P]arch2-2014-cw1/src/shared/mips_mem_ram.cpp
// Function: mips_mem_create_ram
mips_mem_h mips_mem_create_ram(
	uint32_t cbMem,	//!< Total number of bytes of ram
	uint32_t blockSize	//!< Granularity in bytes
){
	uint8_t *data=(uint8_t*)malloc(cbMem);
	if(data==0)
		return 0;
	
	struct mips_mem_provider *mem=(struct mips_mem_provider*)malloc(sizeof(struct mips_mem_provider));
	if(mem==0){
		free(data);
		return 0;
	}
	
	mem->length=cbMem;
	mem->blockSize=blockSize;
	mem->data=data;
	
	return mem;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %ebp
movl %edi, %edi
callq 0x2160
testq %rax, %rax
je 0x3945
movq %rax, %r14
movl $0x10, %edi
callq 0x2160
testq %rax, %rax
je 0x393d
movl %ebp, (%rax)
movl %ebx, 0x4(%rax)
movq %r14, 0x8(%rax)
jmp 0x3947
movq %r14, %rdi
callq 0x2130
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/m8pple[P]arch2-2014-cw1/src/shared/mips_mem_ram.cpp
// Function: mips_mem_read_write(bool, mips_mem_provider*, unsigned int, unsigned int, unsigned char*)
static mips_error mips_mem_read_write(
	bool write,
    mips_mem_h mem,
    uint32_t address,
    uint32_t length,
    uint8_t *dataOut
)
{	
	if(mem==0)
		return mips_ErrorInvalidHandle;
	
	if(0 != (address%mem->blockSize) ){
		return mips_ExceptionInvalidAlignment;
	}
	if(0 != ((address+length)%mem->blockSize)){
		return mips_ExceptionInvalidAlignment;
	}
	if((address+length) > mem->length){	// A subtle bug here, maybe?
		return mips_ExceptionInvalidAddress;
	}
	
	if(write){
		for(unsigned i=0; i<length; i++){
			mem->data[address+i]=dataOut[i];
		}
	}else{
		for(unsigned i=0; i<length; i++){
			dataOut[i]=mem->data[address+i];
		}
	}
	return mips_Success;
}

// Assembly:
testq %rsi, %rsi
je 0x39bd
pushq %rbx
movl %edx, %r9d
movl 0x4(%rsi), %ebx
movl %edx, %eax
xorl %edx, %edx
divl %ebx
movl $0x2002, %r10d          # imm = 0x2002
testl %edx, %edx
jne 0x39f0
leal (%rcx,%r9), %r11d
movl %r11d, %eax
xorl %edx, %edx
divl %ebx
testl %edx, %edx
jne 0x39f0
movl $0x2001, %r10d          # imm = 0x2001
cmpl (%rsi), %r11d
ja 0x39f0
testb %dil, %dil
je 0x39c5
testl %ecx, %ecx
je 0x39ed
movl %ecx, %eax
movl %r9d, %ecx
xorl %r10d, %r10d
xorl %edx, %edx
movb (%r8,%rdx), %dil
movq 0x8(%rsi), %r9
leal (%rcx,%rdx), %r11d
movb %dil, (%r9,%r11)
incq %rdx
cmpq %rdx, %rax
jne 0x39a3
jmp 0x39f0
movl $0x1002, %r10d          # imm = 0x1002
jmp 0x39f1
testl %ecx, %ecx
je 0x39ed
movl %ecx, %eax
movl %r9d, %ecx
xorl %r10d, %r10d
xorl %edx, %edx
movq 0x8(%rsi), %rdi
leal (%rcx,%rdx), %r9d
movb (%rdi,%r9), %dil
movb %dil, (%r8,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0x39d3
jmp 0x39f0
xorl %r10d, %r10d
popq %rbx
movl %r10d, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::OperatingSystem(int&, unsigned int&, unsigned int&)
OperatingSystem(int & number_of_hard_disks_, unsigned int & RAM_, unsigned int & page_size_) : 
            CPU(1), 
            number_of_processes(1), 
            timestamp(0), 
            number_of_hard_disks(number_of_hard_disks_), 
            page_size(page_size_), 
            RAM(RAM_),
            number_of_frames(RAM_ / page_size_), 
            ready_queue(0), 
            hard_disks(number_of_hard_disks_), 
            frames(0) {
                
            // Creates initial process
            PCB* process_1 = new PCB{ number_of_processes };
            process_1->SetParent(1); //First process has no parent
            all_processes[number_of_processes] = process_1;

            // Initialize hard disks
            for (int i = 0; i < number_of_hard_disks; i++) {
                HardDisk* disk_ = new HardDisk{};
                hard_disks[i] = disk_;
            }
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r12
movq %rdi, %r14
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, (%rdi)
movl $0x0, 0x8(%rdi)
movl (%rsi), %eax
movl %eax, 0xc(%rdi)
movl (%rcx), %eax
movl %eax, 0x10(%rdi)
movl (%rdx), %eax
movl %eax, 0x14(%rdi)
xorl %edx, %edx
divl (%rcx)
movl %eax, 0x18(%rdi)
leaq 0x20(%rdi), %rbx
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3708
leaq 0x38(%r14), %r15
movslq (%r12), %rsi
leaq 0xe(%rsp), %rdx
movq %r15, %rdi
callq 0x3752
leaq 0x50(%r14), %r12
leaq 0x58(%r14), %rax
movl $0x0, 0x58(%r14)
movq $0x0, 0x60(%r14)
movq %rax, 0x68(%r14)
movq %rax, 0x70(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x78(%r14)
movups %xmm0, 0x88(%r14)
movl $0x28, %edi
movq %r12, 0x10(%rsp)
callq 0x2190
movq %rax, %r13
leaq 0x4(%r14), %rsi
movl (%rsi), %eax
movl %eax, (%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x16(%r13)
movups %xmm0, 0x8(%r13)
movl $0x1, 0x20(%r13)
movq %r12, %rdi
callq 0x37e0
movq %r13, (%rax)
movslq 0xc(%r14), %r13
testq %r13, %r13
jle 0x2a16
xorl %ebp, %ebp
xorl %r12d, %r12d
movl $0x40, %edi
callq 0x2190
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
leaq 0x18(%rax), %rcx
movq %rcx, 0x8(%rax)
movq %rbp, 0x10(%rax)
movb $0x0, 0x18(%rax)
movq %rax, %rcx
addq $0x28, %rcx
movq %rcx, 0x30(%rax)
movq %rcx, 0x28(%rax)
movq %rbp, 0x38(%rax)
movq (%r15), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
cmpq %r12, %r13
jne 0x29d4
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r13
jmp 0x2a68
jmp 0x2a2c
movq %rax, %r13
movq 0x80(%r14), %rdi
testq %rdi, %rdi
je 0x2a4a
movq 0x90(%r14), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x10(%rsp), %rdi
callq 0x3b2c
movq (%r15), %rdi
testq %rdi, %rdi
je 0x2a68
movq 0x48(%r14), %rsi
subq %rdi, %rsi
callq 0x21a0
movq (%rbx), %rdi
cmpq %rbx, %rdi
je 0x2a85
movq (%rdi), %r14
movl $0x18, %esi
callq 0x21a0
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x2a70
movq %r13, %rdi
callq 0x2280
nop
// File: /workspace/github_cpp_makefile_star2_O3/isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::Snapshot() const
void Snapshot() const {
            std::cout << "Process using CPU: " << CPU << std::endl;
            std::cout << "Ready Queue:  ";
            for (auto itr = ready_queue.begin(); itr != ready_queue.end(); ++itr) {
                std::cout <<  " <- " << *itr;
            }
            std::cout << std::endl;
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
movq 0x552f(%rip), %rbx      # 0x7fd0
leaq 0x2642(%rip), %rsi      # 0x50ea
movl $0x13, %edx
movq %rbx, %rdi
callq 0x21c0
movl (%r14), %esi
movq %rbx, %rdi
callq 0x2260
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
leaq 0x260d(%rip), %rsi      # 0x50fe
movl $0xe, %edx
movq %rbx, %rdi
callq 0x21c0
movq 0x20(%r14), %r13
addq $0x20, %r14
cmpq %r14, %r13
je 0x2b3e
movq 0x54be(%rip), %r15      # 0x7fd0
leaq 0x25f4(%rip), %r12      # 0x510d
movl $0x4, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x21c0
movl 0x10(%r13), %esi
movq %r15, %rdi
callq 0x2260
movq (%r13), %r13
cmpq %r14, %r13
jne 0x2b19
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::IOSnapshot() const
void IOSnapshot() const {
            for (int i = 0; i < number_of_hard_disks; i++) {
                std::cout << "Disk " << i << ": ";
                if (hard_disks[i]->DiskIsIdle()) {
                    std::cout << "idle" << std::endl;
                }
                else {
                    std::cout << "[" << hard_disks[i]->GetCurrentProcess() << " " << hard_disks[i]->GetCurrentFile() << "]" << std::endl;
                    std::cout << "Queue for disk " << i << ": ";
                    hard_disks[i]->PrintQueue();
                }
            }
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x0, 0xc(%rdi)
jle 0x2d2f
movq %rdi, %rbx
leaq 0x18(%rsp), %r12
xorl %r14d, %r14d
movq 0x5438(%rip), %r15      # 0x7fd0
leaq 0x255c(%rip), %r13      # 0x50fb
movl $0x5, %edx
movq %r15, %rdi
leaq 0x2564(%rip), %rsi      # 0x5112
callq 0x21c0
movq %r15, %rdi
movl %r14d, %esi
callq 0x2260
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x21c0
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rax
cmpl $-0x1, (%rax)
je 0x2ce4
movl $0x1, %edx
movq %r15, %rdi
leaq 0x2544(%rip), %rsi      # 0x5132
callq 0x21c0
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rax
movl (%rax), %esi
movq %r15, %rdi
callq 0x2260
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2551(%rip), %rsi      # 0x5168
callq 0x21c0
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rax
movq %r12, 0x8(%rsp)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x3c44
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbp, %rdi
callq 0x21c0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
leaq 0x24bb(%rip), %rsi      # 0x511d
callq 0x21c0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x2ca6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movl $0xf, %edx
movq %r15, %rdi
leaq 0x246a(%rip), %rsi      # 0x511f
callq 0x21c0
movq %r15, %rdi
movl %r14d, %esi
callq 0x2260
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x21c0
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3b7c
jmp 0x2d1f
movl $0x4, %edx
movq %r15, %rdi
leaq 0x2425(%rip), %rsi      # 0x5118
callq 0x21c0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
incq %r14
movslq 0xc(%rbx), %rax
cmpq %rax, %r14
jl 0x2b9f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x2d58
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O3/isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::MemorySnapshot()
void MemorySnapshot() {
            std::cout << "Frame   " << "Page Number     " << "pid       " << "ts" << std::endl;
            for (unsigned int i = 0; i < frames.size(); i++) {
                std::cout << "  " <<  i << "        ";
                if (frames[i]->pid_ != 0) {
                    std::cout << "   " << frames[i]->page_ << "          " << frames[i]->pid_ << "         " << frames[i]->timestamp_;
                }
                std::cout << std::endl;
            }
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x525b(%rip), %r14      # 0x7fd0
leaq 0x23bb(%rip), %rsi      # 0x5137
movl $0x8, %edx
movq %r14, %rdi
callq 0x21c0
leaq 0x23b0(%rip), %rsi      # 0x5140
movl $0x10, %edx
movq %r14, %rdi
callq 0x21c0
leaq 0x23ad(%rip), %rsi      # 0x5151
movl $0xa, %edx
movq %r14, %rdi
callq 0x21c0
leaq 0x23a4(%rip), %rsi      # 0x515c
movl $0x2, %edx
movq %r14, %rdi
callq 0x21c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x88(%rbx), %rax
cmpq 0x80(%rbx), %rax
je 0x2f1e
movl $0x1, %r15d
xorl %ebp, %ebp
leaq 0x2352(%rip), %r12      # 0x5161
movl $0x2, %edx
movq %r14, %rdi
leaq 0x2349(%rip), %rsi      # 0x5167
callq 0x21c0
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2100
movl $0x8, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21c0
movq 0x80(%rbx), %rax
movq (%rax,%rbp,8), %rax
cmpl $0x0, 0x8(%rax)
je 0x2ed6
movl $0x3, %edx
movq %r14, %rdi
leaq 0x2304(%rip), %rsi      # 0x5166
callq 0x21c0
movq 0x80(%rbx), %rax
movq (%rax,%rbp,8), %rax
movl 0x4(%rax), %esi
movq %r14, %rdi
callq 0x2260
movq %rax, %r13
movl $0xa, %edx
movq %rax, %rdi
leaq 0x22d0(%rip), %rsi      # 0x515f
callq 0x21c0
movq 0x80(%rbx), %rax
movq (%rax,%rbp,8), %rax
movl 0x8(%rax), %esi
movq %r13, %rdi
callq 0x2260
movq %rax, %r13
movl $0x9, %edx
movq %rax, %rdi
leaq 0x22a4(%rip), %rsi      # 0x5160
callq 0x21c0
movq 0x80(%rbx), %rax
movq (%rax,%rbp,8), %rax
movl (%rax), %esi
movq %r13, %rdi
callq 0x2260
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq 0x88(%rbx), %rax
subq 0x80(%rbx), %rax
movl %r15d, %ebp
sarq $0x3, %rax
incl %r15d
cmpq %rbp, %rax
ja 0x2e0f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::CreateProcess()
void CreateProcess() {
            PCB* new_process = new PCB{ ++number_of_processes };
            all_processes[number_of_processes] = new_process;
            
            // Parent process is 1
            all_processes[1]->AddChildProcess(new_process);
            new_process->SetParent(1);

            // Adds new process to ready queue
            AddToReadyQueue(number_of_processes);
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x28, %edi
callq 0x2190
movq %rax, %r14
leaq 0x4(%rbx), %rsi
movl 0x4(%rbx), %eax
incl %eax
movl %eax, 0x4(%rbx)
movl %eax, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movups %xmm0, 0x16(%r14)
leaq 0x50(%rbx), %r15
movq %r15, %rdi
callq 0x37e0
movq %r14, (%rax)
movl $0x1, %ebp
leaq 0x4(%rsp), %rsi
movl %ebp, (%rsi)
movq %r15, %rdi
callq 0x3cda
movq (%rax), %rdi
movq %r14, %rsi
callq 0x3d40
movl %ebp, 0x20(%r14)
movl 0x4(%rbx), %esi
movq %rbx, %rdi
callq 0x3d6a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::Fork()
void Fork() {
            if (CPU == 1) { // If fork called with no process in CPU
                std::cout << "There is no process in the CPU to fork" << std::endl;
            }
            else {
                PCB* new_process = new PCB(++number_of_processes);

                // Parent process is the process in the CPU that called fork
                all_processes[CPU]->AddChildProcess(new_process); 
                new_process->SetParent(CPU);

                // Add new process to ready queue
                AddToReadyQueue(number_of_processes);

                all_processes[number_of_processes] = new_process;
            }
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x1, (%rdi)
jne 0x3050
movq 0x4fc6(%rip), %rbx      # 0x7fd0
leaq 0x2173(%rip), %rsi      # 0x5184
movl $0x26, %edx
movq %rbx, %rdi
callq 0x21c0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2110
movq %rdi, %r14
movl $0x28, %edi
callq 0x2190
movq %rax, %rbx
leaq 0x4(%r14), %r15
movl 0x4(%r14), %eax
incl %eax
movl %eax, 0x4(%r14)
movl %eax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movups %xmm0, 0x16(%rbx)
leaq 0x50(%r14), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x37e0
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x3d40
movl (%r14), %eax
movl %eax, 0x20(%rbx)
movl 0x4(%r14), %esi
movq %r14, %rdi
callq 0x3d6a
movq %r12, %rdi
movq %r15, %rsi
callq 0x37e0
movq %rbx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::RequestDisk(int const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void RequestDisk(const int & disk_number, const std::string & file_name) {
            if ((disk_number < number_of_hard_disks) && (disk_number >= 0)) {
                // Process 1 should not use any disks/be added to any queues
                if (CPU != 1) {
                    hard_disks[disk_number]->Request(file_name, CPU);
                    // Remove from CPU and replace from ready queue
                    GetNextFromReadyQueue();
                }
            }
            else {
                std::cout << "There is no disk " << disk_number << std::endl;
            }
        }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movslq (%rsi), %rax
testq %rax, %rax
js 0x33b6
movq %rdi, %rbx
cmpl 0xc(%rdi), %eax
jge 0x33b6
cmpl $0x1, (%rbx)
jne 0x340d
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x4c13(%rip), %rbx      # 0x7fd0
leaq 0x1de7(%rip), %rsi      # 0x51ab
movl $0x11, %edx
movq %rbx, %rdi
callq 0x21c0
movl (%r14), %esi
movq %rbx, %rdi
callq 0x2260
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2110
movq 0x38(%rbx), %rcx
movq (%rcx,%rax,8), %rdi
movq %rdx, %rsi
movq %rbx, %rdx
callq 0x43f2
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x417c
nop
// File: /workspace/github_cpp_makefile_star2_O3/isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::RemoveProcessFromDisk(int const&)
void RemoveProcessFromDisk(const int & disk_number) {
            if ((disk_number < number_of_hard_disks) && (disk_number >= 0)) {
                int removed_pcb = hard_disks[disk_number]->RemoveProcess();
                AddToReadyQueue(removed_pcb);
            }
            else {
                std::cout << "There is no disk " << disk_number << std::endl;
            }
        }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movslq (%rsi), %rax
testq %rax, %rax
js 0x3465
movq %rdi, %r14
cmpl 0xc(%rdi), %eax
jge 0x3465
movq 0x38(%r14), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x4230
movq %r14, %rdi
movl %eax, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3d6a
movq 0x4b64(%rip), %r14      # 0x7fd0
leaq 0x1d38(%rip), %rsi      # 0x51ab
movl $0x11, %edx
movq %r14, %rdi
callq 0x21c0
movl (%rbx), %esi
movq %r14, %rdi
callq 0x2260
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2110
nop
// File: /workspace/github_cpp_makefile_star2_O3/isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::~OperatingSystem()
~OperatingSystem() {
            // Delete disks
            for (auto disk : hard_disks) {
                delete disk;
            }
            // Delete frames
            for (auto frame : frames) {
                delete frame;
            }
            // Delete all PCBs
            for (auto PCB : all_processes) {
                delete PCB.second;
            }

            hard_disks.clear();
            frames.clear();
            all_processes.clear();
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rdi), %r15
movq 0x40(%rdi), %r12
cmpq %r12, %r15
je 0x360f
movq (%r15), %r14
testq %r14, %r14
je 0x35fc
movq %r14, %rdi
callq 0x4606
movl $0x40, %esi
movq %r14, %rdi
callq 0x21a0
addq $0x8, %r15
jmp 0x35e7
movq 0x80(%rbx), %r14
movq 0x88(%rbx), %r15
cmpq %r15, %r14
je 0x3635
movq (%r14), %rdi
movl $0xc, %esi
callq 0x21a0
addq $0x8, %r14
jmp 0x361d
movq 0x68(%rbx), %r14
leaq 0x58(%rbx), %r12
cmpq %r12, %r14
je 0x3670
movq 0x28(%r14), %r15
testq %r15, %r15
je 0x3653
movq %r15, %rdi
callq 0x4104
movl $0x28, %esi
movq %r15, %rdi
callq 0x21a0
movq %r14, %rdi
callq 0x2120
movq %rax, %r14
cmpq %r12, %rax
jne 0x3642
movq 0x38(%rbx), %rax
cmpq %rax, 0x40(%rbx)
je 0x367e
movq %rax, 0x40(%rbx)
leaq 0x50(%rbx), %r14
movq 0x80(%rbx), %rax
cmpq %rax, 0x88(%rbx)
je 0x3699
movq %rax, 0x88(%rbx)
movq %r14, %rdi
callq 0x43c4
movq 0x80(%rbx), %rdi
testq %rdi, %rdi
je 0x36bc
movq 0x90(%rbx), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %r14, %rdi
callq 0x3b2c
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x36d9
movq 0x48(%rbx), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x20(%rbx), %rdi
addq $0x20, %rbx
cmpq %rbx, %rdi
je 0x36fb
movq (%rdi), %r14
movl $0x18, %esi
callq 0x21a0
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x36e6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::AddToReadyQueue(int)
void AddToReadyQueue(const int pid) {
            // First process goes straight to CPU
            if (CPU == 1) {
                CPU = pid;
            }
            // Otherwise process added to back of queue
            else {
                ready_queue.push_back(pid);
            }
        }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
cmpl $0x1, (%rdi)
jne 0x3d7c
movl %ebp, (%rbx)
jmp 0x3d9c
leaq 0x20(%rbx), %r14
movl $0x18, %edi
callq 0x2190
movl %ebp, 0x10(%rax)
movq %rax, %rdi
movq %r14, %rsi
callq 0x2040
incq 0x30(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::DeleteChildren(PCB*)
void DeleteChildren(PCB* pcb) {
            //Delete all children of the process pcb_to_delete
            for (auto itr = pcb->GetChildren().begin(); itr != pcb->GetChildren().end(); itr++) {
                PCB* child = (*itr);
                if (child->HasChildren()) {
                    DeleteChildren(child);
                }
                else {
                    RemoveFromDisks(child->GetPid());
                    RemoveFromFrames(child->GetPid());
                    RemoveFromReadyQueue(child->GetPid());

                    // Delete child from all_processes
                    all_processes.erase(child->GetPid());
                    delete child;
                    child = nullptr;
                }
            }

            pcb->ClearChildren();

            // Keep zombies around and delete later
            if (!pcb->IsZombieProcess()) {
                all_processes.erase(pcb->GetPid());
            }

            RemoveFromDisks(pcb->GetPid());
            RemoveFromFrames(pcb->GetPid());
            RemoveFromReadyQueue(pcb->GetPid());
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rbp
cmpq 0x10(%rsi), %rbp
je 0x4067
leaq 0x50(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0xc(%rsp), %r12
movq (%rbp), %r13
movq 0x8(%r13), %rax
cmpq 0x10(%r13), %rax
je 0x3fb6
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3f68
jmp 0x404c
movl (%r13), %eax
movl %eax, 0xc(%rsp)
movq 0x38(%rbx), %r15
cmpq 0x40(%rbx), %r15
je 0x3fd9
movq (%r15), %rdi
movq %r12, %rsi
callq 0x41ec
addq $0x8, %r15
jmp 0x3fc2
movl (%r13), %esi
movq 0x80(%rbx), %rax
movq 0x88(%rbx), %rcx
cmpq %rcx, %rax
je 0x400c
movq (%rax), %rdx
cmpl %esi, 0x8(%rdx)
jne 0x4006
movq $0x0, (%rdx)
movl $0x0, 0x8(%rdx)
addq $0x8, %rax
jmp 0x3feb
movq %rbx, %rdi
callq 0x41b2
movl (%r13), %eax
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x42ce
movq %r15, %rdi
movq %rax, %rsi
callq 0x434c
movq %r13, %rdi
callq 0x4104
movl $0x28, %esi
movq %r13, %rdi
callq 0x21a0
addq $0x8, %rbp
cmpq 0x10(%r14), %rbp
jne 0x3f98
movq 0x8(%r14), %rax
cmpq %rax, %rbp
je 0x4067
movq %rax, 0x10(%r14)
cmpb $0x0, 0x24(%r14)
jne 0x408f
leaq 0x50(%rbx), %r15
movl (%r14), %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movq %r15, %rdi
callq 0x42ce
movq %r15, %rdi
movq %rax, %rsi
callq 0x434c
movl (%r14), %esi
movl %esi, 0xc(%rsp)
movq 0x38(%rbx), %r12
cmpq 0x40(%rbx), %r12
je 0x40be
leaq 0xc(%rsp), %r15
movq (%r12), %rdi
movq %r15, %rsi
callq 0x41ec
addq $0x8, %r12
cmpq 0x40(%rbx), %r12
jne 0x40a5
movl (%r14), %esi
movq 0x80(%rbx), %rax
movq 0x88(%rbx), %rcx
cmpq %rcx, %rax
je 0x40ed
movq (%rax), %rdx
cmpl %esi, 0x8(%rdx)
jne 0x40e7
movq $0x0, (%rdx)
movl $0x0, 0x8(%rdx)
addq $0x8, %rax
jmp 0x40cc
movq %rbx, %rdi
callq 0x41b2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::GetNextFromReadyQueue()
void GetNextFromReadyQueue() {
            if (ready_queue.empty()) {
                CPU = 1;
            }
            else {
                CPU = ready_queue.front();
                ready_queue.pop_front();
            }
        }

// Assembly:
pushq %rbx
leaq 0x20(%rdi), %rax
movq 0x20(%rdi), %rbx
cmpq %rax, %rbx
je 0x41a9
movl 0x10(%rbx), %eax
movl %eax, (%rdi)
decq 0x30(%rdi)
movq %rbx, %rdi
callq 0x2240
movl $0x18, %esi
movq %rbx, %rdi
popq %rbx
jmp 0x21a0
movl $0x1, (%rdi)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::RemoveFromReadyQueue(int)
void RemoveFromReadyQueue(const int pid_) {
            auto pid_to_delete = std::find(ready_queue.begin(), ready_queue.end(), pid_);
            // If the item is in the ready queue, removes it
            if (pid_to_delete != ready_queue.end()) {
                ready_queue.erase(pid_to_delete);
            }
        }

// Assembly:
pushq %rbx
leaq 0x20(%rdi), %rax
movq 0x20(%rdi), %rbx
cmpq %rax, %rbx
je 0x41ca
cmpl %esi, 0x10(%rbx)
je 0x41ca
movq (%rbx), %rbx
jmp 0x41bb
cmpq %rax, %rbx
je 0x41e9
decq 0x30(%rdi)
movq %rbx, %rdi
callq 0x2240
movl $0x18, %esi
movq %rbx, %rdi
popq %rbx
jmp 0x21a0
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/isabellab3[P]OS-Simulation/./disk.h
// Function: HardDisk::Remove(int const&)
void Remove(const int & pid) {
            // If the process is using the disk
            if (current_process == pid) {
                RemoveProcess();
            }
            // If the process is in the io queue
            for (auto itr = io_queue.begin(); itr != io_queue.end(); itr++) {
                if ((*itr).first == pid) {
                    io_queue.erase(itr);
                }
            }
        }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %eax
cmpl (%rsi), %eax
jne 0x4205
movq %r14, %rdi
callq 0x4230
movq 0x28(%r14), %r15
addq $0x28, %r14
cmpq %r14, %r15
je 0x422a
movl 0x10(%r15), %eax
cmpl (%rbx), %eax
jne 0x4225
movq %r14, %rdi
movq %r15, %rsi
callq 0x4298
movq (%r15), %r15
jmp 0x420d
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/isabellab3[P]OS-Simulation/./disk.h
// Function: HardDisk::RemoveProcess()
int RemoveProcess() {
            int removed_process = current_process;
            if (!DiskIsIdle()) {
                // No process is waiting to use the disk; set idle
                if (io_queue.empty()) {
                    current_process = -1;
                    current_file = "";
                }

                // Otherwise let the next process on the queue use the disk
                else {
                    current_process = io_queue.front().first;
                    current_file = io_queue.front().second;
                    io_queue.pop_front();
                }
            }
            return removed_process;
        }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl (%rdi), %ebx
cmpl $-0x1, %ebx
je 0x4290
movq %rdi, %r14
leaq 0x28(%rdi), %r15
movq 0x28(%rdi), %rsi
cmpq %r15, %rsi
je 0x426d
movl 0x10(%rsi), %eax
movl %eax, (%r14)
addq $0x18, %rsi
leaq 0x8(%r14), %rdi
callq 0x20c0
movq 0x28(%r14), %rsi
movq %r15, %rdi
callq 0x4298
jmp 0x4290
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
movq 0x10(%r14), %rdx
addq $0x8, %r14
leaq 0xee6(%rip), %rcx       # 0x5169
movq %r14, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x2210
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/isabellab3[P]OS-Simulation/./disk.h
// Function: HardDisk::Request(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int const&)
void Request(const std::string & file_name, const int & pid) {
            // If there is no process using the disk already, it can go straight to the disk
            if (DiskIsIdle()) {
                current_process = pid;
                current_file = file_name;
            }
            // Otherwise add the process to the io queue
            else {
                io_queue.push_back(std::pair<int, std::string>(pid, file_name));
            }
        }

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
cmpl $-0x1, (%rdi)
je 0x445e
movl (%rdx), %eax
leaq 0x8(%rsp), %rdi
movl %eax, -0x8(%rdi)
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
movq %rax, %rsi
callq 0x3c44
movl $0x38, %edi
callq 0x2190
leaq 0x28(%rbx), %rsi
movl (%rsp), %ecx
movl %ecx, 0x10(%rax)
movq %rax, %rcx
addq $0x28, %rcx
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rdx
cmpq %r14, %rdx
je 0x4475
movq %rdx, 0x18(%rax)
movq 0x18(%rsp), %rcx
movq %rcx, 0x28(%rax)
jmp 0x447c
movl (%rdx), %eax
movl %eax, (%rbx)
addq $0x8, %rbx
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r14
jmp 0x20c0
movups (%r14), %xmm0
movups %xmm0, (%rcx)
movq 0x10(%rsp), %rcx
movq %rcx, 0x20(%rax)
movq %r14, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq %rax, %rdi
callq 0x2040
incq 0x38(%rbx)
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x44bb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x44dd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280
nop
// File: /workspace/github_cpp_makefile_star2_O3/lhartmann[P]orangepi-i2s-steppers/throttle_test.cpp
// Function: main
int main() {
	Throttle t;
	t.prepare(100, 40, 5, 5);
	for (int i=0; i<200; ++i) {
		cout
			<< i << " "
			<< (t.step() ? "STEP " : "     ")
			<< (t.done() ? "DONE " : "     ")
			<< t.acc << " "
			<< t.r << " "
			<< endl;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movabsq $0x5000000000, %rax     # imm = 0x5000000000
leaq -0x4c(%rbp), %rbx
movq %rax, (%rbx)
movaps 0xdfb(%rip), %xmm0      # 0x2010
movups %xmm0, 0x8(%rbx)
movb $0x0, 0x20(%rbx)
movabsq $-0x4fffffffb, %rax     # imm = 0xFFFFFFFB00000005
movq %rax, 0x18(%rbx)
xorl %r14d, %r14d
leaq 0xdf5(%rip), %r12       # 0x202a
leaq 0xdea(%rip), %r15       # 0x2026
movq 0x2d95(%rip), %rdi      # 0x3fd8
movl %r14d, %esi
callq 0x10a0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x1080
movq %rbx, %rdi
callq 0x132a
testb %al, %al
movq %r15, %rsi
leaq 0xdae(%rip), %rax       # 0x2020
cmovneq %rax, %rsi
movl $0x5, %edx
movq %r13, %rdi
callq 0x1080
movl -0x4c(%rbp), %eax
cmpl -0x44(%rbp), %eax
movq %r15, %rsi
leaq 0xd99(%rip), %rax       # 0x202c
cmoveq %rax, %rsi
movl $0x5, %edx
movq %r13, %rdi
callq 0x1080
movl -0x30(%rbp), %esi
movq %r13, %rdi
callq 0x10a0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x1080
movl -0x34(%rbp), %esi
movq %r13, %rdi
callq 0x1040
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x1080
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x1070
movsbl %al, %esi
movq %r13, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1050
incl %r14d
cmpl $0xc8, %r14d
jne 0x123c
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/waket[P]ThreadPool/ThreadPoolTask.cpp
// Function: ThreadPoolTask::start()
bool ThreadPoolTask::start() {
    startWorkersMutex.lock();
    isStarted = true;
    isStopWorker = false;
    for (int i = 0; i < workerCount; i++) {
        pthread_t pth;
        if (pthread_create(&pth, NULL, start_worker, (void*) this) != 0) {
            cout << "\tFailed to create new worker" << endl;
            isStarted = false;
            startWorkersMutex.unlock();
            return false;
        }
    }
    // Lock and wait till all the workers start
    cout << "\tLock and wait for All workers to get started" << endl;
    startWorkersCond.wait(startWorkersMutex.mutexPtr());
    startWorkersMutex.unlock();

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x158(%rdi), %rbx
movq %rbx, %rdi
callq 0x2290
movb $0x1, %bpl
movb %bpl, 0x180(%r14)
movb %bpl, 0x150(%r14)
movb $0x0, 0x152(%r14)
cmpq $0x0, 0x8(%r14)
je 0x3adb
xorl %r13d, %r13d
leaq -0x72a(%rip), %r15      # 0x3391
movq %rsp, %r12
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r14, %rcx
callq 0x2340
testl %eax, %eax
jne 0x3b36
incq %r13
cmpq %r13, 0x8(%r14)
ja 0x3abe
movq 0x44f6(%rip), %r15      # 0x7fd8
leaq 0x178f(%rip), %rsi      # 0x5278
movl $0x2d, %edx
movq %r15, %rdi
callq 0x2220
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
leaq 0x188(%r14), %rdi
movq %rbx, %rsi
callq 0x22b0
movb $0x0, 0x180(%r14)
jmp 0x3b88
movq 0x449b(%rip), %r15      # 0x7fd8
leaq 0x1717(%rip), %rsi      # 0x525b
movl $0x1c, %edx
movq %r15, %rdi
callq 0x2220
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
xorl %ebp, %ebp
movb %bpl, 0x150(%r14)
movb %bpl, 0x180(%r14)
movq %rbx, %rdi
callq 0x2150
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/waket[P]ThreadPool/ThreadPoolTask.cpp
// Function: ThreadPoolTask::wait()
bool ThreadPoolTask::wait() {
    //Lock by mutex before getting  the value of isShutdown
    stopMutex.lock();
    if(isShutdown) { //Don't wait. The Thread pool is already stopped
        assert(!isStarted);
        stopMutex.unlock();
        return true;
    }
     //Wait til the thread pool stops all the workers
    stopCond.wait(stopMutex.mutexPtr());
    stopMutex.unlock();
    return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0xf0(%rdi), %rbx
movq %rbx, %rdi
callq 0x2290
movb $0x1, 0x118(%r14)
cmpb $0x1, 0x151(%r14)
jne 0x3fd5
cmpb $0x1, 0x150(%r14)
jne 0x3fe4
leaq 0x14ed(%rip), %rdi      # 0x54aa
leaq 0x13b1(%rip), %rsi      # 0x5375
leaq 0x14ea(%rip), %rcx      # 0x54b5
movl $0xb6, %edx
callq 0x2100
leaq 0x120(%r14), %rdi
movq %rbx, %rsi
callq 0x22b0
movb $0x0, 0x118(%r14)
movq %rbx, %rdi
callq 0x2150
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/waket[P]ThreadPool/ThreadPoolTask.cpp
// Function: ThreadPoolTask::requestStop()
bool ThreadPoolTask::requestStop() {
    //Lock by mutex to avoid scheduling successive requestStop
    stopMutex.lock();
    if(isShutdown) { //Nothing to do. The thread pool is already stopped
        assert(!isStarted);
        stopMutex.unlock();
        return true;
    }
    stopMutex.unlock();
    //Stop all workers by creating new thread for asynchronous purpose
    pthread_t pth;
    if (pthread_create(&pth, NULL, stop_workers, (void*) this) != 0) {
        cout << "\tFailed to create thread to stop all the workers" << endl;
        return false;
    }
    return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xf0(%rdi), %r14
movq %r14, %rdi
callq 0x2290
movb $0x1, 0x118(%rbx)
cmpb $0x1, 0x151(%rbx)
jne 0x4050
cmpb $0x1, 0x150(%rbx)
je 0x40c6
movb $0x0, 0x118(%rbx)
movq %r14, %rdi
callq 0x2150
movb $0x1, %bl
jmp 0x40bc
movb $0x0, 0x118(%rbx)
movq %r14, %rdi
callq 0x2150
leaq -0x68(%rip), %rdx       # 0x3ffe
movq %rsp, %rdi
xorl %esi, %esi
movq %rbx, %rcx
callq 0x2340
testl %eax, %eax
sete %bl
je 0x40bc
movq 0x3f57(%rip), %r14      # 0x7fd8
leaq 0x146c(%rip), %rsi      # 0x54f4
movl $0x30, %edx
movq %r14, %rdi
callq 0x2220
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x13dd(%rip), %rdi      # 0x54aa
leaq 0x12a1(%rip), %rsi      # 0x5375
leaq 0x13f6(%rip), %rcx      # 0x54d1
movl $0xcb, %edx
callq 0x2100
nop
// File: /workspace/github_cpp_makefile_star2_O3/waket[P]ThreadPool/./ThreadPoolTask.h
// Function: Mutex::~Mutex()
~Mutex() {
        // It shall be safe to destroy an initialized mutex that is unlocked.
        // Attempting to destroy a locked mutex results in undefined behavior.
        if (isLocked) {
            unlock();
        }
        pthread_mutex_destroy(&mutxLock);
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movb 0x28(%rdi), %al
cmpb $0x1, %al
jne 0x42f3
movb $0x0, 0x28(%rbx)
movq %rbx, %rdi
callq 0x2150
movq %rbx, %rdi
popq %rbx
jmp 0x2240