LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x24dc
cmpl $0x3, %ebp
jl 0x56ba
movq 0x596e(%rip), %r14      # 0xaff0
leaq 0x1c5c(%rip), %rsi      # 0x72e5
movl $0x2a, %edx
movq %r14, %rdi
callq 0x2200
movq (%rbx), %r15
testq %r15, %r15
je 0x5718
movq %r15, %rdi
callq 0x20b0
movq 0x5943(%rip), %rdi      # 0xaff0
movq %r15, %rsi
movq %rax, %rdx
callq 0x2200
jmp 0x5730
cmpl $0x2, %ebp
jne 0x5707
movq 0x8(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x59f6
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 0x5707
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
xorl %ebx, %ebx
leaq 0x28(%rsp), %rdi
callq 0x532e
jmp 0x582a
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x22e0
movq 0x58b9(%rip), %r14      # 0xaff0
leaq 0x1bd2(%rip), %rsi      # 0x7310
movl $0x6, %edx
movq %r14, %rdi
callq 0x2200
movq (%rbx), %r15
testq %r15, %r15
je 0x576f
movq %r15, %rdi
callq 0x20b0
movq 0x588e(%rip), %rdi      # 0xaff0
movq %r15, %rsi
movq %rax, %rdx
callq 0x2200
jmp 0x5787
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x22e0
movq 0x5862(%rip), %r14      # 0xaff0
leaq 0x1a5e(%rip), %rsi      # 0x71f3
movl $0x1, %edx
movq %r14, %rdi
callq 0x2200
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0x57c7
movq %rbx, %rdi
callq 0x20b0
movq 0x5836(%rip), %rdi      # 0xaff0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2200
jmp 0x57df
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x22e0
movq 0x580a(%rip), %rbx      # 0xaff0
leaq 0x1b2a(%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 0x57d8(%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 0x584b
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5866
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x50(%rsp), %rdi
callq 0x6258
leaq 0x48(%rsp), %rdi
callq 0x6258
leaq 0x40(%rsp), %rdi
callq 0x6258
leaq 0x28(%rsp), %rdi
callq 0x594a
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 0x58c3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x58c3
jmp 0x58c0
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x5a3e
movq %rbx, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x5ec3
movl %eax, %r13d
xorl %r14d, %r14d
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6408
testq %rdx, (%rax)
je 0x5eb9
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
callq 0x2190
cvttsd2si %xmm0, %eax
addl %eax, %ebp
incq %r14
cmpq %r13, %r14
jb 0x5e96
jmp 0x5ec5
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_O1/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 0x654e
decl %r14d
movslq %r14d, %r14
testl %ebp, %ebp
je 0x5fde
movl %ebp, %r12d
negl %r12d
cmovsl %ebp, %r12d
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6408
testb $0x1, %r12b
jne 0x5fc7
notq %rdx
andq (%rax), %rdx
jmp 0x5fca
orq (%rax), %rdx
movq %rdx, (%rax)
movl %r12d, %eax
shrl %eax
incq %r15
cmpl $0x2, %r12d
movl %eax, %r12d
jae 0x5fae
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6408
testl %ebp, %ebp
js 0x5ff5
notq %rdx
andq (%rax), %rdx
jmp 0x5ff8
orq (%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_O1/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 0x605c
cmpl $0x0, 0x18(%rbx)
je 0x60bf
movq 0x4f65(%rip), %r14      # 0xafc8
leaq 0x109c(%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 0x606c
cmpl 0x18(%rbx), %ebp
jne 0x606c
movq 0x4f02(%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_O1/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 0x624b
movq (%r14), %r14
xorl %r12d, %r12d
movzbl (%r14,%r12), %eax
cmpl $0x30, %eax
je 0x6236
cmpl $0x31, %eax
jne 0x6243
movb $0x1, %al
jmp 0x6238
xorl %eax, %eax
movq (%rbx), %rdi
movzbl %al, %esi
callq 0x6500
incq %r12
cmpq %r12, %r15
jne 0x6223
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/nus-comparch[P]cs5222-lab-prefetcher/example_prefetchers/stream_prefetcher.cc
// Function: l2_prefetcher_initialize
void l2_prefetcher_initialize(int cpu_num)
{
  printf("Streaming Prefetcher\n");
  // you can inspect these knob values from your code to see which configuration you're runnig in
  printf("Knobs visible from prefetcher: %d %d %d\n", knob_scramble_loads, knob_small_llc, knob_low_bandwidth);

  int i;
  for(i=0; i<STREAM_DETECTOR_COUNT; i++)
    {
      detectors[i].page = 0;
      detectors[i].direction = 0;
      detectors[i].confidence = 0;
      detectors[i].pf_index = -1;
    }

  replacement_index = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x98ea(%rip), %rdi      # 0x40b02d
callq 0x4010e0
movq $0x4ad2f0, %rax         # imm = 0x4AD2F0
movl (%rax), %esi
movq $0x411060, %rax         # imm = 0x411060
movl (%rax), %edx
movq $0x4ad2f4, %rax         # imm = 0x4AD2F4
movl (%rax), %ecx
leaq 0x989a(%rip), %rdi      # 0x40b004
xorl %eax, %eax
callq 0x401030
movl $0x10, %eax
leaq 0xca63(%rip), %rcx      # 0x40e1e0
xorps %xmm0, %xmm0
movups %xmm0, -0x10(%rax,%rcx)
movl $0xffffffff, (%rax,%rcx) # imm = 0xFFFFFFFF
addq $0x18, %rax
cmpq $0x610, %rax            # imm = 0x610
jne 0x401780
movl $0x0, 0xd03e(%rip)      # 0x40e7e0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x10, %rsp
movl $0x100000, %edi         # imm = 0x100000
movl $0x4, %esi
callq 0x3904
movq %rax, %rbx
movq %rax, %rdi
callq 0x3a28
movq %rax, %r14
callq 0x25f0
leaq 0x2067(%rip), %rdi      # 0x45c4
callq 0x26a3
movl %eax, %ebp
movq %r14, %rdi
movl $0x8, %esi
movl $0xffff, %edx           # imm = 0xFFFF
callq 0x3a9f
testl %eax, %eax
jne 0x259c
movq %r14, %rdi
movl $0x9, %esi
movl $0xffff00, %edx         # imm = 0xFFFF00
callq 0x3a9f
testl %eax, %eax
jne 0x259c
movq %r14, %rdi
callq 0x3abd
testl %eax, %eax
je 0x25d7
xorl %eax, %eax
cmpl $0xff00, 0xc(%rsp)      # imm = 0xFF00
sete %cl
andb %al, %cl
movzbl %cl, %esi
movl %ebp, %edi
xorl %edx, %edx
callq 0x281a
callq 0x28a2
movq %r14, %rdi
callq 0x3a6f
movq %rbx, %rdi
callq 0x3a01
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xc(%rsp), %rdx
movq %r14, %rdi
movl $0xa, %esi
callq 0x3a74
testl %eax, %eax
sete %al
jmp 0x259e
// File: /workspace/github_cpp_makefile_star2_O1/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 0x393d
movq %rax, %r14
movl $0x10, %edi
callq 0x2160
testq %rax, %rax
je 0x3935
movl %ebp, (%rax)
movl %ebx, 0x4(%rax)
movq %r14, 0x8(%rax)
jmp 0x393f
movq %r14, %rdi
callq 0x2130
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x39b5
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 0x39e8
leal (%rcx,%r9), %r11d
movl %r11d, %eax
xorl %edx, %edx
divl %ebx
testl %edx, %edx
jne 0x39e8
movl $0x2001, %r10d          # imm = 0x2001
cmpl (%rsi), %r11d
ja 0x39e8
testb %dil, %dil
je 0x39bd
testl %ecx, %ecx
je 0x39e5
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 0x399b
jmp 0x39e8
movl $0x1002, %r10d          # imm = 0x1002
jmp 0x39e9
testl %ecx, %ecx
je 0x39e5
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 0x39cb
jmp 0x39e8
xorl %r10d, %r10d
popq %rbx
movl %r10d, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/m8pple[P]arch2-2014-cw1/src/eie2ugs/mips_cpu.c
// Function: mips_cpu_create
mips_cpu_h mips_cpu_create(mips_mem_h mem)
{
	unsigned i;
	mips_cpu_h res=(mips_cpu_h)malloc(sizeof(struct mips_cpu_impl));

	res->mem=mem;

	res->pc=0;
	res->pcN=4;	// NOTE: why does this make sense?

	for( i=0;i<32;i++){
		res->regs[i]=0;
	}

	return res;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x90, %edi
callq 0x2160
movq %rbx, 0x88(%rax)
movabsq $0x400000000, %rcx      # imm = 0x400000000
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x28(%rax)
movups %xmm0, 0x38(%rax)
movups %xmm0, 0x48(%rax)
movups %xmm0, 0x58(%rax)
movups %xmm0, 0x68(%rax)
movups %xmm0, 0x78(%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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)
movl (%rdx), %eax
xorl %edx, %edx
divl (%rcx)
movl %eax, 0x18(%rdi)
leaq 0x20(%rdi), %rbx
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3702
leaq 0x38(%r14), %r15
movslq (%r12), %rsi
leaq 0xe(%rsp), %rdx
movq %r15, %rdi
callq 0x374c
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 0x37d6
movq %r13, (%rax)
movslq 0xc(%r14), %r13
testq %r13, %r13
jle 0x2a18
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 0x29d6
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r13
jmp 0x2a6a
jmp 0x2a2e
movq %rax, %r13
movq 0x80(%r14), %rdi
testq %rdi, %rdi
je 0x2a4c
movq 0x90(%r14), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x10(%rsp), %rdi
callq 0x3b22
movq (%r15), %rdi
testq %rdi, %rdi
je 0x2a6a
movq 0x48(%r14), %rsi
subq %rdi, %rsi
callq 0x21a0
movq (%rbx), %rdi
cmpq %rbx, %rdi
je 0x2a87
movq (%rdi), %r14
movl $0x18, %esi
callq 0x21a0
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x2a72
movq %r13, %rdi
callq 0x2280
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x552d(%rip), %rbx      # 0x7fd0
leaq 0x2640(%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 0x260b(%rip), %rsi      # 0x50fe
movl $0xe, %edx
movq %rbx, %rdi
callq 0x21c0
movq 0x20(%r14), %r13
addq $0x20, %r14
cmpq %r14, %r13
je 0x2b40
movq 0x54bc(%rip), %r15      # 0x7fd0
leaq 0x25f2(%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 0x2b1b
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_O1/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 0x2d31
movq %rdi, %rbx
leaq 0x18(%rsp), %r12
xorl %r14d, %r14d
movq 0x5436(%rip), %r15      # 0x7fd0
leaq 0x255a(%rip), %r13      # 0x50fb
movl $0x5, %edx
movq %r15, %rdi
leaq 0x2562(%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 0x2ce6
movl $0x1, %edx
movq %r15, %rdi
leaq 0x2542(%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 0x254f(%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 0x3c3a
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbp, %rdi
callq 0x21c0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
leaq 0x24b9(%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 0x2ca8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movl $0xf, %edx
movq %r15, %rdi
leaq 0x2468(%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 0x3b72
jmp 0x2d21
movl $0x4, %edx
movq %r15, %rdi
leaq 0x2423(%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 0x2ba1
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 0x2d5a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O1/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 0x5259(%rip), %r14      # 0x7fd0
leaq 0x23b9(%rip), %rsi      # 0x5137
movl $0x8, %edx
movq %r14, %rdi
callq 0x21c0
leaq 0x23ae(%rip), %rsi      # 0x5140
movl $0x10, %edx
movq %r14, %rdi
callq 0x21c0
leaq 0x23ab(%rip), %rsi      # 0x5151
movl $0xa, %edx
movq %r14, %rdi
callq 0x21c0
leaq 0x23a2(%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 0x2f20
movl $0x1, %r15d
xorl %ebp, %ebp
leaq 0x2350(%rip), %r12      # 0x5161
movl $0x2, %edx
movq %r14, %rdi
leaq 0x2347(%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 0x2ed8
movl $0x3, %edx
movq %r14, %rdi
leaq 0x2302(%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 0x22ce(%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 0x22a2(%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 0x2e11
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x37d6
movq %r14, (%rax)
movl $0x1, %ebp
leaq 0x4(%rsp), %rsi
movl %ebp, (%rsi)
movq %r15, %rdi
callq 0x3cca
movq (%rax), %rdi
movq %r14, %rsi
callq 0x3d2e
movl %ebp, 0x20(%r14)
movl 0x4(%rbx), %esi
movq %rbx, %rdi
callq 0x3d58
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3062
movq 0x4fb4(%rip), %rbx      # 0x7fd0
leaq 0x2161(%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 0x37d6
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x3d2e
movl (%r14), %eax
movl %eax, 0x20(%rbx)
movl 0x4(%r14), %esi
movq %r14, %rdi
callq 0x3d58
movq %r12, %rdi
movq %r15, %rsi
callq 0x37d6
movq %rbx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::Wait()
void Wait() {
            PCB* cpu_process = all_processes[CPU];

            // If the process has no children, nothing to wait for
            if (cpu_process->HasChildren()) {
                // If the process already has at least one zombie child, child disappears and parent keeps using CPU
                int PID_of_zombie_child = cpu_process->ProcessHasZombieChild();
                if (PID_of_zombie_child > 0) {  ///////////???
                    cpu_process->SetWaitingState(0);

                    // Delete the zombie child's children
                    DeleteChildren(all_processes[PID_of_zombie_child]);
                    
                    // Delete the zombie child
                    PCB* zombie = all_processes[PID_of_zombie_child];
                    PCB* parent = all_processes[zombie->GetParent()];

                    parent->RemoveChild(zombie);
                    all_processes.erase(PID_of_zombie_child);
                    delete zombie;
                    zombie = nullptr;
                }

                // If the process has no zombie children, remove the process from the ready queue and send process at front of ready queue to CPU
                else {
                    // Set process using CPU to waiting
                    cpu_process->SetWaitingState(1);
                    CPU = ready_queue.front();
                    ready_queue.pop_front();
                    // The waiting parent process will be added back to the end of the ready queue when one of its children exits.
                }
            }
        }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x50(%rdi), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x37d6
movq (%rax), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rdx
cmpq %rdx, %rcx
je 0x3384
movq (%rcx), %rsi
cmpb $0x1, 0x24(%rsi)
je 0x32a3
addq $0x8, %rcx
cmpq %rdx, %rcx
jne 0x328d
xorl %ecx, %ecx
jmp 0x32a5
movl (%rsi), %ecx
movl %ecx, 0x8(%rsp)
testl %ecx, %ecx
jle 0x331b
movb $0x0, 0x25(%rax)
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x37d6
movq (%rax), %rsi
movq %r14, %rdi
callq 0x3f56
movq %rbx, %rdi
movq %r15, %rsi
callq 0x37d6
movq (%rax), %r14
movl 0x20(%r14), %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movq %rbx, %rdi
callq 0x3cca
movq (%rax), %r15
movq 0x8(%r15), %rdi
movq 0x10(%r15), %rax
cmpq %rax, %rdi
je 0x3352
movq %rax, %rdx
subq %rdi, %rdx
addq $-0x8, %rdx
cmpq %r14, (%rdi)
je 0x333f
addq $0x8, %rdi
addq $-0x8, %rdx
cmpq %rax, %rdi
jne 0x3307
jmp 0x3352
movb $0x1, 0x25(%rax)
movq 0x20(%r14), %rbx
movl 0x10(%rbx), %eax
movl %eax, (%r14)
decq 0x30(%r14)
movq %rbx, %rdi
callq 0x2240
movl $0x18, %esi
movq %rbx, %rdi
jmp 0x337f
leaq 0x8(%rdi), %rsi
cmpq %rax, %rsi
je 0x334d
callq 0x2230
addq $-0x8, 0x10(%r15)
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x42b8
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4330
testq %r14, %r14
je 0x3384
movq %r14, %rdi
callq 0x40f4
movl $0x28, %esi
movq %r14, %rdi
callq 0x21a0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x33b2
movq %rdi, %rbx
cmpl 0xc(%rdi), %eax
jge 0x33b2
cmpl $0x1, (%rbx)
jne 0x3409
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x4c17(%rip), %rbx      # 0x7fd0
leaq 0x1deb(%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 0x43d6
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4166
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3461
movq %rdi, %r14
cmpl 0xc(%rdi), %eax
jge 0x3461
movq 0x38(%r14), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x421a
movq %r14, %rdi
movl %eax, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3d58
movq 0x4b68(%rip), %r14      # 0x7fd0
leaq 0x1d3c(%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_O1/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 0x3605
movq (%r15), %r14
testq %r14, %r14
je 0x35ff
movq %r14, %rdi
callq 0x45ea
movl $0x40, %esi
movq %r14, %rdi
callq 0x21a0
addq $0x8, %r15
jmp 0x35dd
movq 0x80(%rbx), %r14
movq 0x88(%rbx), %r15
cmpq %r15, %r14
je 0x3630
movq (%r14), %rdi
testq %rdi, %rdi
je 0x362a
movl $0xc, %esi
callq 0x21a0
addq $0x8, %r14
jmp 0x3613
movq 0x68(%rbx), %r14
leaq 0x58(%rbx), %r12
cmpq %r12, %r14
je 0x366b
movq 0x28(%r14), %r15
testq %r15, %r15
je 0x365b
movq %r15, %rdi
callq 0x40f4
movl $0x28, %esi
movq %r15, %rdi
callq 0x21a0
movq %r14, %rdi
callq 0x2120
movq %rax, %r14
cmpq %r12, %rax
jne 0x363d
movq 0x38(%rbx), %rax
cmpq %rax, 0x40(%rbx)
je 0x3679
movq %rax, 0x40(%rbx)
leaq 0x50(%rbx), %r14
movq 0x80(%rbx), %rax
cmpq %rax, 0x88(%rbx)
je 0x3694
movq %rax, 0x88(%rbx)
movq %r14, %rdi
callq 0x43a8
movq 0x80(%rbx), %rdi
testq %rdi, %rdi
je 0x36b7
movq 0x90(%rbx), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %r14, %rdi
callq 0x3b22
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x36d4
movq 0x48(%rbx), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x20(%rbx), %rdi
addq $0x20, %rbx
cmpq %rbx, %rdi
je 0x36f6
movq (%rdi), %r14
movl $0x18, %esi
callq 0x21a0
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x36e1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3d6a
movl %ebp, (%rbx)
jmp 0x3d8a
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_O1/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 0x4048
leaq 0x50(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0xc(%rsp), %r12
movq (%rbp), %r13
movq 0x8(%r13), %rax
cmpq 0x10(%r13), %rax
je 0x3fa4
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3f56
jmp 0x403a
movl (%r13), %eax
movl %eax, 0xc(%rsp)
movq 0x38(%rbx), %r15
cmpq 0x40(%rbx), %r15
je 0x3fc7
movq (%r15), %rdi
movq %r12, %rsi
callq 0x41d6
addq $0x8, %r15
jmp 0x3fb0
movl (%r13), %esi
movq 0x80(%rbx), %rax
movq 0x88(%rbx), %rcx
cmpq %rcx, %rax
je 0x3ffa
movq (%rax), %rdx
cmpl %esi, 0x8(%rdx)
jne 0x3ff4
movq $0x0, (%rdx)
movl $0x0, 0x8(%rdx)
addq $0x8, %rax
jmp 0x3fd9
movq %rbx, %rdi
callq 0x419c
movl (%r13), %eax
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x42b8
movq %r15, %rdi
movq %rax, %rsi
callq 0x4330
movq %r13, %rdi
callq 0x40f4
movl $0x28, %esi
movq %r13, %rdi
callq 0x21a0
addq $0x8, %rbp
cmpq 0x10(%r14), %rbp
jne 0x3f86
movq 0x8(%r14), %rax
cmpq %rax, 0x10(%r14)
je 0x4056
movq %rax, 0x10(%r14)
cmpb $0x0, 0x24(%r14)
jne 0x407e
leaq 0x50(%rbx), %r15
movl (%r14), %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movq %r15, %rdi
callq 0x42b8
movq %r15, %rdi
movq %rax, %rsi
callq 0x4330
movl (%r14), %eax
movl %eax, 0xc(%rsp)
movq 0x38(%rbx), %r12
cmpq 0x40(%rbx), %r12
je 0x40aa
leaq 0xc(%rsp), %r15
movq (%r12), %rdi
movq %r15, %rsi
callq 0x41d6
addq $0x8, %r12
cmpq 0x40(%rbx), %r12
jne 0x4094
movl (%r14), %esi
movq 0x80(%rbx), %rax
movq 0x88(%rbx), %rcx
cmpq %rcx, %rax
je 0x40dc
movq (%rax), %rdx
cmpl %esi, 0x8(%rdx)
jne 0x40d6
movq $0x0, (%rdx)
movl $0x0, 0x8(%rdx)
addq $0x8, %rax
jmp 0x40bb
movq %rbx, %rdi
callq 0x419c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4193
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_O1/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 0x41b4
cmpl %esi, 0x10(%rbx)
je 0x41b4
movq (%rbx), %rbx
jmp 0x41a5
cmpq %rax, %rbx
je 0x41d3
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_O1/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 0x41ef
movq %r14, %rdi
callq 0x421a
movq 0x28(%r14), %r15
addq $0x28, %r14
cmpq %r14, %r15
je 0x4214
movl 0x10(%r15), %eax
cmpl (%rbx), %eax
jne 0x420f
movq %r14, %rdi
movq %r15, %rsi
callq 0x4282
movq (%r15), %r15
jmp 0x41f7
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x427a
movq %rdi, %r14
leaq 0x28(%rdi), %r15
movq 0x28(%rdi), %rsi
cmpq %r15, %rsi
je 0x4257
movl 0x10(%rsi), %eax
movl %eax, (%r14)
addq $0x18, %rsi
leaq 0x8(%r14), %rdi
callq 0x20c0
movq 0x28(%r14), %rsi
movq %r15, %rdi
callq 0x4282
jmp 0x427a
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
movq 0x10(%r14), %rdx
addq $0x8, %r14
leaq 0xefc(%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_O1/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 0x4442
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 0x3c3a
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 0x4459
movq %rdx, 0x18(%rax)
movq 0x18(%rsp), %rcx
movq %rcx, 0x28(%rax)
jmp 0x4460
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 0x449f
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 0x44c1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2280
nop
// File: /workspace/github_cpp_makefile_star2_O1/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)
movl $0x0, (%rbx)
movl $0x64, 0x8(%rbx)
movl $0x28, 0xc(%rbx)
movabsq $0x500000005, %rax      # imm = 0x500000005
movq %rax, 0x10(%rbx)
movb $0x0, 0x20(%rbx)
movabsq $-0x4fffffffb, %rax     # imm = 0xFFFFFFFB00000005
movq %rax, 0x18(%rbx)
xorl %r14d, %r14d
leaq 0xdc2(%rip), %r12       # 0x200e
leaq 0xdb7(%rip), %r15       # 0x200a
movq 0x2d7e(%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 0x1340
testb %al, %al
movq %r15, %rsi
leaq 0xd7b(%rip), %rax       # 0x2004
cmovneq %rax, %rsi
movl $0x5, %edx
movq %r13, %rdi
callq 0x1080
movl -0x4c(%rbp), %eax
cmpl -0x44(%rbp), %eax
movq %r15, %rsi
leaq 0xd66(%rip), %rax       # 0x2010
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 0x1253
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq