LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/mniip[P]sandbox/main.cpp
// Function: set_limits()
void set_limits()
{
	dup2(in_pipe[0], 0);
	dup2(out_pipe[1], 1);
	dup2(out_pipe[1], 2);
	close(in_pipe[0]);
	close(in_pipe[1]);
	close(out_pipe[0]);
	close(out_pipe[1]);

	if(conf_closefds)
	{
		DIR *fds = opendir("/proc/self/fd/");
		if(fds)
		{
			struct dirent *dent;
			while(dent = readdir(fds))
				if(atoi(dent->d_name) > 2)
					close(atoi(dent->d_name));
			closedir(fds);
		}
	}

	fflush(stdout);

	if(conf_clearenv)
		clearenv();
	for(std::vector<std::pair<std::string, std::string>>::const_iterator i = conf_setenv.begin(), end = conf_setenv.end(); i != end; i++)
		setenv(i->first.c_str(), i->second.c_str(), 1);
	for(std::vector<std::string>::const_iterator i = conf_unsetenv.begin(), end = conf_unsetenv.end(); i != end; i++)
		unsetenv(i->c_str());

	if(conf_chdir)
		chdir(conf_chdirto.c_str());

	struct rlimit limit;
	for(std::vector<std::pair<int, rlim_t>>::const_iterator i = conf_rlimit.begin(), end = conf_rlimit.end(); i != end; i++)
	{
		limit.rlim_max = limit.rlim_cur = i->second;
		setrlimit(i->first, &limit);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0xf56c(%rip), %rbx      # 0x14478
movl (%rbx), %edi
xorl %esi, %esi
callq 0x43b0
leaq 0xf564(%rip), %r14      # 0x14480
movl 0x4(%r14), %edi
movl $0x1, %esi
callq 0x43b0
movl 0x4(%r14), %edi
movl $0x2, %esi
callq 0x43b0
movl (%rbx), %edi
callq 0x47e0
movl 0x4(%rbx), %edi
callq 0x47e0
movl (%r14), %edi
callq 0x47e0
movl 0x4(%r14), %edi
callq 0x47e0
leaq 0xf589(%rip), %rax      # 0x144e8
cmpb $0x1, (%rax)
jne 0x4fa7
leaq 0xa58d(%rip), %rdi      # 0xf4f8
callq 0x4610
testq %rax, %rax
je 0x4fa7
movq %rax, %rbx
movq %rbx, %rdi
callq 0x4640
testq %rax, %rax
je 0x4f9f
addq $0x13, %rax
movq %rax, %rdi
callq 0x4670
cmpl $0x3, %eax
jl 0x4f78
movl %eax, %edi
callq 0x47e0
jmp 0x4f78
movq %rbx, %rdi
callq 0x46b0
movq 0xefda(%rip), %rax      # 0x13f88
movq (%rax), %rdi
callq 0x4470
leaq 0xf52c(%rip), %rax      # 0x144e9
cmpb $0x1, (%rax)
jne 0x4fc7
callq 0x41f0
leaq 0xf522(%rip), %rax      # 0x144f0
movq (%rax), %rbx
movq 0x8(%rax), %r14
cmpq %r14, %rbx
je 0x4ff1
movq (%rbx), %rdi
movq 0x20(%rbx), %rsi
movl $0x1, %edx
callq 0x4620
addq $0x40, %rbx
jmp 0x4fd5
leaq 0xf510(%rip), %rax      # 0x14508
movq (%rax), %rbx
movq 0x8(%rax), %r14
cmpq %r14, %rbx
je 0x5012
movq (%rbx), %rdi
callq 0x4550
addq $0x20, %rbx
jmp 0x4fff
leaq 0xf537(%rip), %rax      # 0x14550
cmpb $0x0, (%rax)
je 0x502d
leaq 0xf533(%rip), %rax      # 0x14558
movq (%rax), %rdi
callq 0x4600
leaq 0xf544(%rip), %rax      # 0x14578
movq (%rax), %r14
movq 0x8(%rax), %r15
cmpq %r15, %r14
je 0x5064
movq %rsp, %rbx
movq 0x8(%r14), %rax
movq %rax, (%rsp)
movq %rax, 0x8(%rsp)
movl (%r14), %edi
movq %rbx, %rsi
callq 0x4380
addq $0x10, %r14
cmpq %r15, %r14
jne 0x5043
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/mniip[P]sandbox/./fs.h
// Function: FsThread<TracedThread>::on_syscall_exit(Sandbox<TracedThread>&)
virtual void on_syscall_exit(Sandbox<T> &s)
	{
		SyscallInfo i(*this);
		if(restore_data.size())
		{
			i.emplace_array((void *)(uintptr_t)restore_addr, restore_data);
			restore_data.clear();
			after_replace_path(true);
		}
		if(ret_override)
		{
			i.ret() = ret_val;
			i.save();
			ret_override = false;
		}
		check_startup();
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, %rbx
addq $0x8, %rdi
leaq 0x40(%rsp), %rax
movq %rdi, 0xd8(%rax)
leaq 0xb2e9(%rip), %rcx      # 0x13ba0
movq %rcx, -0x8(%rax)
movw $0x0, 0xe0(%rax)
leaq 0x128(%rsp), %r14
movq %rax, (%r14)
movq $0xd8, 0x8(%r14)
movl $0x1, %esi
movq %r14, %rdx
callq 0xa7e6
cmpq $0x44, 0x8(%r14)
jne 0x89f2
movw $0x101, 0x120(%rsp)     # imm = 0x101
movl 0x40(%rsp), %eax
movq %rax, 0x18(%rsp)
movl 0x44(%rsp), %eax
movq %rax, 0x10(%rsp)
movl 0x48(%rsp), %eax
movq %rax, 0x8(%rsp)
movl 0x4c(%rsp), %eax
movq %rax, (%rsp)
movl 0x50(%rsp), %edi
movl 0x54(%rsp), %r8d
movl 0x58(%rsp), %r9d
movl 0x5c(%rsp), %r10d
movl 0x60(%rsp), %r11d
movl 0x64(%rsp), %r14d
movl 0x68(%rsp), %r15d
movl 0x6c(%rsp), %r12d
movl 0x70(%rsp), %r13d
movl 0x74(%rsp), %ebp
movl 0x78(%rsp), %edx
movl 0x7c(%rsp), %ecx
movl 0x80(%rsp), %eax
movq 0x18(%rsp), %rsi
movq %rsi, 0x68(%rsp)
movq 0x10(%rsp), %rsi
movq %rsi, 0x98(%rsp)
movq 0x8(%rsp), %rsi
movq %rsi, 0xa0(%rsp)
movq (%rsp), %rsi
movq %rsi, 0xa8(%rsp)
movq %rdi, 0xb0(%rsp)
movq %r8, 0x60(%rsp)
movq %r9, 0x90(%rsp)
movq %r10, 0xf8(%rsp)
movq %r11, 0x100(%rsp)
movq %r14, 0x108(%rsp)
movq %r15, 0x110(%rsp)
movq %r12, 0xb8(%rsp)
movq %r13, 0xc0(%rsp)
movq %rbp, 0xc8(%rsp)
movq %rdx, 0xd0(%rsp)
movq %rcx, 0xd8(%rsp)
movq %rax, 0xe0(%rsp)
jmp 0x8a02
cmpq $0x0, 0x70(%rsp)
jne 0x8a02
movb $0x1, 0x121(%rsp)
movq 0x30(%rbx), %rax
cmpq 0x28(%rbx), %rax
je 0x8a64
leaq 0x28(%rbx), %rsi
movq 0x20(%rbx), %r14
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x8e8a
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x8d62
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x8a48
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x43e0
movq 0x28(%rbx), %rax
cmpq %rax, 0x30(%rbx)
je 0x8a56
movq %rax, 0x30(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x1, %esi
callq *0x70(%rax)
cmpb $0x1, 0x10(%rbx)
jne 0x8a80
movq 0x18(%rbx), %rax
leaq 0x38(%rsp), %rdi
movq %rax, 0x58(%rdi)
callq 0x8ed6
movb $0x0, 0x10(%rbx)
callq 0xc2ea
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x8ab1
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x43e0
movq %rbx, %rdi
callq 0x4770
nop
// File: /workspace/github_cpp_makefile_star2_O1/mniip[P]sandbox/./arch/arch_base.h
// Function: SyscallInfoBase<regs_x86_64, unsigned long>::fetch_cstr(void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool fetch_cstr(void *addr, std::string &r)
	{
		long word;
		void *read_addr = (void *)((uintptr_t)addr & ~(sizeof word - 1));
		int off = (uintptr_t)addr & (sizeof word - 1);

		r = "";

		if(!thread.ptrace_peekdata(read_addr, word))
			return false;

		uint8_t b;
		do
		{
			b = ((uint8_t *)&word)[off];
			if(b)
				r.push_back(b);
			if(++off == sizeof word)
			{
				off = 0;
				read_addr = (void *)((long *)read_addr + 1);
				if(!thread.ptrace_peekdata(read_addr, word))
					return false;
			}
		}
		while(b);
		return true;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r14
movq %rsi, %r15
andq $-0x8, %r15
movq 0x8(%rdx), %rdx
leaq 0x6a55(%rip), %rcx      # 0xf563
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x4660
movq 0xe0(%r14), %rdi
movq %rsp, %rdx
movq %r15, %rsi
callq 0xa766
testb %al, %al
je 0x8b86
andl $0x7, %r12d
movq %rsp, %r13
movslq %r12d, %rax
movb (%rsp,%rax), %bpl
testb %bpl, %bpl
je 0x8b53
movsbl %bpl, %esi
movq %rbx, %rdi
callq 0x4360
incl %r12d
cmpl $0x8, %r12d
jne 0x8b79
addq $0x8, %r15
movq 0xe0(%r14), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0xa766
xorl %r12d, %r12d
testb %al, %al
je 0x8b83
testb %bpl, %bpl
jne 0x8b3b
movb $0x1, %r13b
jmp 0x8b86
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/mniip[P]sandbox/./arch/arch_base.h
// Function: SyscallInfoBase<regs_x86_64, unsigned long>::fetch_array(void*, unsigned long)
std::vector<uint8_t> fetch_array(void *addr, size_t length)
	{
		long word;
		void *read_addr = (void *)((uintptr_t)addr & ~(sizeof word - 1));
		int off = (uintptr_t)addr & (sizeof word - 1);
		
		std::vector<uint8_t> r;
		r.reserve(length);

		if(!thread.ptrace_peekdata(read_addr, word))
			return r;

		uint8_t b;
		for(size_t i = 0; i < length; i++)
		{
			b = ((uint8_t *)&word)[off];
			r.push_back(b);
			if(++off == sizeof word)
			{
				off = 0;
				read_addr = (void *)((long *)read_addr + 1);
				if(!thread.ptrace_peekdata(read_addr, word))
					return r;
			}
		}
		return r;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq %rcx, %rsi
callq 0x9082
movq %r13, %r12
andq $-0x8, %r12
movq 0xe0(%r15), %rdi
leaq 0x10(%rsp), %rdx
movq %r12, %rsi
callq 0xa766
testb %al, %al
je 0x8c78
testq %r14, %r14
je 0x8c78
andl $0x7, %r13d
leaq 0x10(%rsp), %rbp
movslq %r13d, %rax
movb 0x10(%rsp,%rax), %al
movb %al, 0xf(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x8c40
movb %al, (%rsi)
incq 0x8(%rbx)
jmp 0x8c4d
movq %rbx, %rdi
leaq 0xf(%rsp), %rdx
callq 0x9114
incl %r13d
cmpl $0x8, %r13d
jne 0x8c73
addq $0x8, %r12
movq 0xe0(%r15), %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0xa766
xorl %r13d, %r13d
testb %al, %al
je 0x8c78
decq %r14
jne 0x8c23
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8c8c
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x8ca3
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x43e0
movq %r14, %rdi
callq 0x4770
nop
// File: /workspace/github_cpp_makefile_star2_O1/mniip[P]sandbox/./arch/arch_base.h
// Function: SyscallInfoBase<regs_x86_64, unsigned long>::emplace_array(void*, std::vector<unsigned char, std::allocator<unsigned char>>)
bool emplace_array(void *addr, std::vector<uint8_t> array)
	{
		long word;
		void *write_addr = (void *)((uintptr_t)addr & ~(sizeof word - 1));
		int off = (uintptr_t)addr & (sizeof word - 1);

		if(off)
			if(!thread.ptrace_peekdata(write_addr, word))
				return false;

		size_t i = 0;
		while(write_addr < (char *)addr + array.size())
		{
			((uint8_t *)&word)[off] = array[i++];
			if(++off == sizeof word)
			{
				off = 0;
				if(!thread.ptrace_pokedata(write_addr, word))
					return false;
				write_addr = (void *)((long *)write_addr + 1);
				if(write_addr < (char *)addr + array.size() && write_addr > (char *)addr + array.size() - 8)
					if(!thread.ptrace_peekdata(write_addr, word))
						return false;
			}
		}
		return true;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %r12
andq $-0x8, %r12
movl %r14d, %ebp
andl $0x7, %ebp
je 0x8d9f
movq 0xe0(%r15), %rdi
movq %rsp, %rdx
movq %r12, %rsi
callq 0xa766
testb %al, %al
je 0x8e37
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
subq %rcx, %rax
addq %r14, %rax
cmpq %r12, %rax
setbe %al
jbe 0x8e39
xorl %r13d, %r13d
movb (%rcx,%r13), %al
movslq %ebp, %rbp
movb %al, (%rsp,%rbp)
incl %ebp
cmpl $0x8, %ebp
jne 0x8e1d
movq 0xe0(%r15), %rdi
movq (%rsp), %rdx
movq %r12, %rsi
callq 0xa7ae
xorl %ebp, %ebp
testb %al, %al
je 0x8e37
addq $0x8, %r12
movq 0x8(%rbx), %rax
subq (%rbx), %rax
leaq (%r14,%rax), %rcx
cmpq %rcx, %r12
jae 0x8e1d
addq %r14, %rax
addq $-0x8, %rax
cmpq %rax, %r12
jbe 0x8e1d
movq 0xe0(%r15), %rdi
movq %r12, %rsi
movq %rsp, %rdx
callq 0xa766
xorl %ebp, %ebp
testb %al, %al
je 0x8e37
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
subq %rcx, %rax
addq %r14, %rax
incq %r13
cmpq %rax, %r12
setae %al
jb 0x8dbb
jmp 0x8e39
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/mniip[P]sandbox/./arch/x86_64.h
// Function: SyscallInfo::save()
bool save()
    {
		if(is_compat_regset)
		{
			struct regs_x86_32 tmp;
			tmp.ebx = regs.rbx;
			tmp.ecx = regs.rcx;
			tmp.edx = regs.rdx;
			tmp.esi = regs.rsi;
			tmp.edi = regs.rdi;
			tmp.ebp = regs.rbp;
			tmp.eax = regs.rax;
			tmp.ds = regs.ds;
			tmp.es = regs.es;
			tmp.fs = regs.fs;
			tmp.gs = regs.gs;
			tmp.orig_eax = regs.orig_rax;
			tmp.eip = regs.rip;
			tmp.cs = regs.cs;
			tmp.eflags = regs.eflags;
			tmp.esp = regs.rsp;
			tmp.ss = regs.ss;
			struct iovec iov = { .iov_base = (void *)&tmp, .iov_len = sizeof tmp };
			return thread.ptrace_setregset(NT_PRSTATUS, iov);
		}
		else
		{
			struct iovec iov = { .iov_base = (void *)&regs, .iov_len = sizeof regs };
			return thread.ptrace_setregset(NT_PRSTATUS, iov);
		}
    }

// Assembly:
subq $0x58, %rsp
cmpb $0x1, 0xe8(%rdi)
jne 0x8f7f
movl 0x30(%rdi), %ecx
leaq 0x10(%rsp), %rax
movl %ecx, (%rax)
movl 0x60(%rdi), %ecx
movl %ecx, 0x4(%rax)
movl 0x68(%rdi), %ecx
movl %ecx, 0x8(%rax)
movl 0x70(%rdi), %ecx
movl %ecx, 0xc(%rax)
movl 0x78(%rdi), %ecx
movl %ecx, 0x10(%rax)
movl 0x28(%rdi), %ecx
movl %ecx, 0x14(%rax)
movl 0x58(%rdi), %ecx
movl %ecx, 0x18(%rax)
movl 0xc0(%rdi), %ecx
movl %ecx, 0x1c(%rax)
movl 0xc8(%rdi), %ecx
movl %ecx, 0x20(%rax)
movl 0xd0(%rdi), %ecx
movl %ecx, 0x24(%rax)
movl 0xd8(%rdi), %ecx
movl %ecx, 0x28(%rax)
movl 0x80(%rdi), %ecx
movl %ecx, 0x2c(%rax)
movl 0x88(%rdi), %ecx
movl %ecx, 0x30(%rax)
movl 0x90(%rdi), %ecx
movl %ecx, 0x34(%rax)
movl 0x98(%rdi), %ecx
movl %ecx, 0x38(%rax)
movl 0xa0(%rdi), %ecx
movl %ecx, 0x3c(%rax)
movl 0xa8(%rdi), %ecx
movl %ecx, 0x40(%rax)
movq %rsp, %rdx
movq %rax, (%rdx)
movq $0x44, 0x8(%rdx)
jmp 0x8f93
leaq 0x8(%rdi), %rax
leaq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq $0xd8, 0x8(%rdx)
movq 0xe0(%rdi), %rdi
movl $0x1, %esi
callq 0xa800
addq $0x58, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/mniip[P]sandbox/main.cpp
// Function: TracedThread::can_see_path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int&)
bool can_see_path(std::string path, int at, int &error)
	{
		std::string canon = canon_path_at(tid, at, path);
		for(std::vector<std::string>::const_iterator i = conf_see.begin(), end = conf_see.end(); i != end; i++)
			if(in_dir(*i, canon))
				return true;
//		if(canon == "/")
//			return true;
		if(conf_report)
			if(at == AT_FDCWD)
				printf("[See %s=%s]\n", path.c_str(), canon.c_str());
			else
				printf("[See (%d)%s=%s]\n", at, path.c_str(), canon.c_str());
		return false;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %edx, %r14d
movq %rsi, %r12
movl 0x8(%rdi), %ebp
leaq 0x88(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rsi), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %r15
movq %r15, %rdi
callq 0x8ff2
leaq 0x58(%rsp), %rdi
movl %ebp, %esi
movl %r14d, %edx
movq %r15, %rcx
callq 0xaa05
movl %r14d, 0xc(%rsp)
movq 0x78(%rsp), %rdi
cmpq %rbx, %rdi
je 0x954d
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x43e0
movq %r12, 0x50(%rsp)
leaq 0xafc7(%rip), %rax      # 0x14520
movq (%rax), %r14
movq 0x8(%rax), %rbx
cmpq %rbx, %r14
setne %bpl
je 0x960e
leaq 0x30(%rsp), %r15
leaq 0x10(%rsp), %r12
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x8ff2
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x8ff2
movq %r15, %rdi
movq %r12, %rsi
callq 0xb264
movl %eax, %r13d
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x95dc
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x43e0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x95f8
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x43e0
testb %r13b, %r13b
jne 0x9654
addq $0x20, %r14
cmpq %rbx, %r14
setne %bpl
jne 0x9577
leaq 0xafd4(%rip), %rax      # 0x145e9
cmpb $0x1, (%rax)
jne 0x9654
movq 0x50(%rsp), %rax
movq (%rax), %rdx
movq 0x58(%rsp), %rcx
movl 0xc(%rsp), %esi
cmpl $-0x64, %esi
jne 0x9646
leaq 0x5fec(%rip), %rdi      # 0xf623
movq %rdx, %rsi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x4060
jmp 0x9654
leaq 0x5fe3(%rip), %rdi      # 0xf630
xorl %eax, %eax
callq 0x4060
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x966f
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x43e0
andb $0x1, %bpl
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x78(%rsp), %rdi
jmp 0x96df
movq %rax, %r14
jmp 0x96b5
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x96b5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x43e0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x96d6
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x43e0
jmp 0x96d6
movq %rax, %r14
leaq 0x68(%rsp), %rbx
movq -0x10(%rbx), %rdi
cmpq %rbx, %rdi
je 0x96ef
movq (%rbx), %rsi
incq %rsi
callq 0x43e0
movq %r14, %rdi
callq 0x4770
nop
// File: /workspace/github_cpp_makefile_star2_O1/mniip[P]sandbox/sandbox.cpp
// Function: ThreadData::ptrace(int, void*, void*)
long ThreadData::ptrace(int request, void *addr, void *data)
{
	errno = 0;
	long result = ::ptrace((enum __ptrace_request)request, tid, addr, data);
	if(errno == ESRCH)
		throw ThreadGone(tid);
	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %rbx
callq 0x4050
movq %rax, %r12
movl $0x0, (%rax)
movl (%rbx), %esi
movl %ebp, %edi
movq %r15, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x4350
cmpl $0x3, (%r12)
je 0xa6c2
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x18, %edi
callq 0x41e0
movq %rax, %r14
movl (%rbx), %esi
movq %rax, %rdi
callq 0xa89a
leaq 0x9618(%rip), %rsi      # 0x13cf8
movq 0x98e9(%rip), %rdx      # 0x13fd0
movq %r14, %rdi
callq 0x4750
movq %rax, %rbx
movq %r14, %rdi
callq 0x42b0
movq %rbx, %rdi
callq 0x4770
// File: /workspace/github_cpp_makefile_star2_O1/mniip[P]sandbox/sandbox.cpp
// Function: ThreadData::set_options()
void ThreadData::set_options()
{
	if(!set_opts)
	{
		if(!ptrace_setoptions(PTRACE_O_EXITKILL | PTRACE_O_TRACECLONE | PTRACE_O_TRACEEXEC | PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK))
			panic_errno("ptrace SETOPTIONS");
		set_opts = true;
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
cmpb $0x0, 0x5(%rdi)
jne 0xa844
movq %rdi, %rbx
movl $0x10001e, %ecx         # imm = 0x10001E
movl $0x4200, %esi           # imm = 0x4200
xorl %edx, %edx
callq 0xa680
testq %rax, %rax
jne 0xa84c
movb $0x1, 0x5(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
retq
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5067(%rip), %rsi      # 0xf8c3
leaq 0x5071(%rip), %rdx      # 0xf8d4
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x9376
movq %rbx, %rdi
callq 0xa5a4
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xa892
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43e0
movq %rbx, %rdi
callq 0x4770
// File: /workspace/github_cpp_makefile_star2_O1/mniip[P]sandbox/path.cpp
// Function: read_link(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool read_link(std::string path, std::string &out)
{
	int fd = open(path.c_str(), O_PATH | O_NOFOLLOW);
	if(fd < 0)
		return false;
	struct stat stat;
	if(fstat(fd, &stat))
	{
		close(fd);
		return false;
	}
	if((stat.st_mode & S_IFMT) != S_IFLNK)
	{
		close(fd);
		return false;
	}
	size_t size = stat.st_size;
	if(!size)
		size++;
	char *buf = (char *)malloc(size + 1);
	ssize_t sz;
	while(1)
	{
		sz = readlinkat(fd, "", buf, size + 1);
		if(sz < 0)
		{
			close(fd);
			free(buf);
			return false;
		}
		if(sz > size)
		{
			size *= 2;
			buf = (char *)realloc(buf, size + 1);
		}
		else
			break;
	}
	close(fd);
	out.assign(buf, sz);
	free(buf);
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movq (%rdi), %rdi
xorl %r14d, %r14d
movl $0x220000, %esi         # imm = 0x220000
xorl %eax, %eax
callq 0x42c0
testl %eax, %eax
js 0xa9c8
movl %eax, %ebp
leaq 0x8(%rsp), %rsi
movl %eax, %edi
callq 0x4720
testl %eax, %eax
jne 0xa9be
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
cmpl $0xa000, %eax           # imm = 0xA000
jne 0xa9be
movq 0x38(%rsp), %r13
cmpq $0x1, %r13
adcq $0x0, %r13
leaq 0x1(%r13), %r15
movq %r15, %rdi
callq 0x4510
movq %rax, %r14
leaq 0x4c08(%rip), %rsi      # 0xf563
movl %ebp, %edi
movq %rax, %rdx
movq %r15, %rcx
callq 0x40c0
testq %rax, %rax
js 0xa9ad
movq %rax, %r12
leaq 0x4bec(%rip), %r15      # 0xf563
cmpq %r13, %r12
jbe 0xa9dd
leaq 0x1(,%r13,2), %r12
addq %r13, %r13
movq %r14, %rdi
movq %r12, %rsi
callq 0x4710
movq %rax, %r14
movl %ebp, %edi
movq %r15, %rsi
movq %rax, %rdx
movq %r12, %rcx
callq 0x40c0
movq %rax, %r12
testq %rax, %rax
jns 0xa977
movl %ebp, %edi
callq 0x47e0
movq %r14, %rdi
callq 0x4490
jmp 0xa9c5
movl %ebp, %edi
callq 0x47e0
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, %edi
callq 0x47e0
movq 0x8(%rbx), %rdx
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rcx
movq %r12, %r8
callq 0x4660
movq %r14, %rdi
callq 0x4490
movb $0x1, %r14b
jmp 0xa9c8
// File: /workspace/github_cpp_makefile_star2_O1/mniip[P]sandbox/wakeup.cpp
// Function: feed_data(int, int, bool, bool)
void feed_data(int from, int to, bool track, bool closeeof)
{
	const size_t BLOCK_SIZE = 4096;
	char buffer[BLOCK_SIZE];
	ssize_t bytes_read;
	while(0 < (bytes_read = read(from, buffer, BLOCK_SIZE)))
	{
		size_t done = 0;
		while(done < bytes_read)
		{
			ssize_t bytes_wrote = write(to, buffer + done, bytes_read - done);
			if(bytes_wrote <= 0)
			{
				printf("[Write error]\n");
				exit(0);
			}
			done += bytes_wrote;
			if(track)
				written += bytes_wrote;
		}
	}
	if(bytes_read < 0 && errno != EAGAIN)
	{
		printf("[Read error]\n");
		exit(0);
	}
	if(closeeof)
	{
		close_input = true;
		if(startup_over)
			close(to);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movl %ecx, 0xc(%rsp)
movl %edx, %r14d
movl %esi, %ebx
movl %edi, %r15d
leaq 0x10(%rsp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x45d0
movq %rax, %r12
testq %rax, %rax
jle 0xb3c4
leaq 0x10(%rsp), %r13
xorl %ebp, %ebp
leaq (%rsp,%rbp), %rsi
addq $0x10, %rsi
movq %r12, %rdx
subq %rbp, %rdx
movl %ebx, %edi
callq 0x4180
testq %rax, %rax
jle 0xb414
testb %r14b, %r14b
je 0xb3a4
addl %eax, 0x90f8(%rip)      # 0x1449c
addq %rax, %rbp
cmpq %r12, %rbp
jb 0xb37f
movl $0x1000, %edx           # imm = 0x1000
movl %r15d, %edi
movq %r13, %rsi
callq 0x45d0
movq %rax, %r12
testq %rax, %rax
jg 0xb37d
testq %r12, %r12
jns 0xb3d3
callq 0x4050
cmpl $0xb, (%rax)
jne 0xb427
cmpb $0x0, 0xc(%rsp)
je 0xb402
movb $0x1, 0x90bf(%rip)      # 0x144a0
cmpb $0x1, 0x90b0(%rip)      # 0x14498
jne 0xb402
movl %ebx, %edi
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x47e0
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x458e(%rip), %rdi      # 0xf9a9
callq 0x4650
xorl %edi, %edi
callq 0x44a0
leaq 0x456e(%rip), %rdi      # 0xf99c
jmp 0xb41b
// File: /workspace/github_cpp_makefile_star2_O1/mniip[P]sandbox/wakeup.cpp
// Function: check_startup()
void check_startup()
{
	if(!startup_over)
	{
		int buffer;
		if(ioctl(in_pipe[1], FIONREAD, &buffer))
			panic_errno("FIONREAD");
		if(buffer - written < 0)
		{
			if(close_input)
				close(in_pipe[1]);
			startup_over = true;
			set_timer();
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
cmpb $0x0, 0x81a0(%rip)      # 0x14498
jne 0xc388
movl 0x8178(%rip), %edi      # 0x1447c
leaq 0x4(%rsp), %rdx
movl $0x541b, %esi           # imm = 0x541B
xorl %eax, %eax
callq 0x4590
testl %eax, %eax
je 0xc35c
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x366a(%rip), %rsi      # 0xf993
leaq 0x366b(%rip), %rdx      # 0xf99b
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x9376
movq %rbx, %rdi
callq 0xa5a4
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xc35c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43e0
movl 0x4(%rsp), %eax
cmpl 0x8136(%rip), %eax      # 0x1449c
jge 0xc388
cmpb $0x1, 0x8131(%rip)      # 0x144a0
jne 0xc37c
movl 0x8105(%rip), %edi      # 0x1447c
callq 0x47e0
movb $0x1, 0x8115(%rip)      # 0x14498
callq 0xb482
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xc3aa
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43e0
movq %rbx, %rdi
callq 0x4770
// File: /workspace/github_cpp_makefile_star2_O1/mniip[P]sandbox/config.cpp
// Function: skip_block_until(std::basic_ifstream<char, std::char_traits<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
static void skip_block_until(std::ifstream &file, std::string until)
{
	std::string line;
	while(std::getline(file, line))
	{
		std::istringstream iss(line);
		std::string key;
		if(!(iss >> key)) continue;
		if(key == until) break;

		if(key == "ident")
			skip_block_until(file, "end");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rsi, (%rsp)
movq %rdi, %r14
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x18(%rsp), %rbx
leaq 0x48(%rsp), %r12
leaq 0x68(%rsp), %r13
leaq 0x28(%rsp), %rbp
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x43c0
movsbl %al, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x47a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xd201
movq %r13, %rdi
movq %r12, %rsi
movl $0x8, %edx
callq 0x4730
movq %rbx, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
callq 0x44d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xd1c2
movq 0x10(%rsp), %rdx
movq (%rsp), %rax
cmpq 0x8(%rax), %rdx
jne 0xd163
movb $0x1, %r15b
testq %rdx, %rdx
je 0xd1c5
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rsp), %rdi
callq 0x43f0
testl %eax, %eax
je 0xd1c5
leaq 0x8(%rsp), %rdi
leaq 0x28f9(%rip), %rsi      # 0xfa68
callq 0x4110
testl %eax, %eax
jne 0xd1c2
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %rbp, %r15
movq %rbp, %rdi
leaq 0x28df(%rip), %rsi      # 0xfa6e
leaq 0x28db(%rip), %rdx      # 0xfa71
callq 0x9376
movq %r14, %rdi
movq %r15, %rsi
callq 0xd081
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xd1c2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43e0
xorl %r15d, %r15d
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0xd1dc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43e0
movq %r13, %rdi
movq 0x6dd2(%rip), %rsi      # 0x13fb8
callq 0x45b0
leaq 0xe0(%rsp), %rdi
callq 0x4160
testb %r15b, %r15b
je 0xd0c1
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xd21d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x43e0
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xd255
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43e0
jmp 0xd255
jmp 0xd252
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0xd26c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43e0
movq 0x6d45(%rip), %rsi      # 0x13fb8
leaq 0x68(%rsp), %rdi
callq 0x45b0
leaq 0xe0(%rsp), %rdi
callq 0x4160
jmp 0xd291
jmp 0xd28e
movq %rax, %r14
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xd2ad
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x43e0
movq %r14, %rdi
callq 0x4770
nop
// File: /workspace/github_cpp_makefile_star2_O1/simap[P]ecctools/make_keys.cpp
// Function: printHex(unsigned char*, int)
void printHex(uint8_t * data, int len) {
  int i;
  printf("{\n\t");
  for(i=0; i<len-1; ++i) {
    printf("0x%02X, ", data[i]);
    if ((i+1) % 11 == 0)
      printf("\n\t");
  }
  printf("0x%02X};\n", data[i]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x4dc0(%rip), %rdi      # 0x6004
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1030
cmpl $0x2, %r14d
jl 0x12ae
decl %r14d
movl $0x1, %r15d
leaq 0x4da5(%rip), %r12      # 0x6008
xorl %ebp, %ebp
movq %r15, %rax
movabsq $0x2e8ba2e8ba2e8ba3, %rcx # imm = 0x2E8BA2E8BA2E8BA3
mulq %rcx
shrq %rdx
leal (%rdx,%rdx,4), %eax
leal (%rdx,%rax,2), %r13d
decl %r13d
movzbl (%rbx,%rbp), %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x1030
cmpl %ebp, %r13d
jne 0x12a3
leaq 0x4d69(%rip), %rdi      # 0x6005
xorl %eax, %eax
callq 0x1030
incq %rbp
incq %r15
cmpq %rbp, %r14
jne 0x1265
movzbl (%rbx,%rbp), %esi
leaq 0x4d58(%rip), %rdi      # 0x6011
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
// File: /workspace/github_cpp_makefile_star2_O1/simap[P]ecctools/make_keys.cpp
// Function: main
int main(int argc, char ** argv) {
  if (argc < 2) {
    fprintf(stderr, "Need a key name\n");
    return -1;
  }

  if (uECC_get_rng() == NULL) {
    fprintf(stderr, "Compiled without a random number generator!\n");
    return -1;
  }

  const struct uECC_Curve_t * curve = uECC_secp256k1();
  uint8_t private1[32];
  uint8_t public1[64];
  
  uECC_make_key(public1, private1, curve);


  char tmp[100];
  FILE * fp;

  sprintf(tmp, "%s.pub", argv[1]);
  fp = fopen (tmp, "wb");
  fwrite(public1, 64, 1, fp);
  fclose(fp);

  sprintf(tmp, "%s.key", argv[1]);
  fp = fopen (tmp, "wb");
  fwrite(private1, 32, 1, fp);
  fclose(fp);


  printf("const unsigned char private_key[] = ");
  printHex(private1, 32);

  printf("const unsigned char public_key[] = ");
  printHex(public1, 64);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
cmpl $0x1, %edi
jle 0x13ec
movq %rsi, %r12
callq 0x1408
testq %rax, %rax
je 0x13f3
callq 0x144a
leaq 0x20(%rsp), %rbx
movq %rsp, %r15
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x1452
movq 0x8(%r12), %rdx
leaq 0x4d39(%rip), %rsi      # 0x6059
leaq 0x60(%rsp), %r13
movq %r13, %rdi
xorl %eax, %eax
callq 0x1040
leaq 0x4d2a(%rip), %rbp      # 0x6060
movq %r13, %rdi
movq %rbp, %rsi
callq 0x10a0
movq %rax, %r14
movl $0x40, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq %rax, %rcx
callq 0x10d0
movq %r14, %rdi
callq 0x1080
movq 0x8(%r12), %rdx
leaq 0x4cf6(%rip), %rsi      # 0x6063
movq %r13, %rdi
xorl %eax, %eax
callq 0x1040
movq %r13, %rdi
movq %rbp, %rsi
callq 0x10a0
movq %rax, %r14
movl $0x20, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rax, %rcx
callq 0x10d0
movq %r14, %rdi
callq 0x1080
leaq 0x4cc1(%rip), %rdi      # 0x606a
xorl %eax, %eax
callq 0x1030
movq %r15, %rdi
movl $0x20, %esi
callq 0x122c
leaq 0x4ccb(%rip), %rdi      # 0x608f
xorl %eax, %eax
callq 0x1030
movq %rbx, %rdi
movl $0x40, %esi
callq 0x122c
xorl %eax, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x111c
jmp 0x13f8
callq 0x1100
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x13da
nop
// File: /workspace/github_cpp_makefile_star2_O1/eecs280staff[P]unit_test_framework/test/char_array.cpp
// Function: string_eq()
TEST(string_eq) {
    char arr[] = "spam";
    ASSERT_SEQUENCE_EQUAL("spam", "spam");
    ASSERT_SEQUENCE_EQUAL("spam", arr);
    ASSERT_SEQUENCE_EQUAL("spam", string("spam"));
    ASSERT_EQUAL("spam", string("spam"));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
leaq 0x28(%rsp), %rbx
movb $0x0, 0x4(%rbx)
movl $0x6d617073, (%rbx)     # imm = 0x6D617073
leaq 0x488a(%rip), %r14      # 0x70c5
leaq 0x4888(%rip), %rcx      # 0x70ca
movq %r14, %rdi
movq %r14, %rsi
movl $0xb, %edx
callq 0x3746
leaq 0x4897(%rip), %rcx      # 0x70f0
movq %r14, %rdi
movq %rbx, %rsi
movl $0xc, %edx
callq 0x3942
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x4850(%rip), %rdx      # 0x70c9
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x60b6
leaq 0x4838(%rip), %rdi      # 0x70c5
leaq 0x487f(%rip), %rcx      # 0x7113
leaq 0x8(%rsp), %rsi
movl $0xd, %edx
callq 0x3b3e
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x28ba
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x47fc(%rip), %rsi      # 0x70c5
leaq 0x47f9(%rip), %rdx      # 0x70c9
callq 0x60b6
leaq 0x47e9(%rip), %rdi      # 0x70c5
leaq 0x485e(%rip), %rcx      # 0x7141
leaq 0x8(%rsp), %rsi
movl $0xe, %edx
callq 0x3e98
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2909
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x2917
jmp 0x2933
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2936
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x2936
movq %rax, %rbx
movq %rbx, %rdi
callq 0x2310
// File: /workspace/github_cpp_makefile_star2_O1/eecs280staff[P]unit_test_framework/./unit_test_framework.hpp
// Function: void unit_test_framework::Assertions::assert_equal<char const (&) [5], std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(char const (&) [5], std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&&, int, char const*)
static void assert_equal(First&& first, Second&& second,
                             int line_number,
                             const char* assertion_text) {
      if (safe_equals<First, Second>::equals(first, second)) {
        return;
      }
      std::ostringstream reason;
      Diagnostic::print(reason, first);
      reason << " != ";
      Diagnostic::print(reason, second);
      throw TestFailure(reason.str(), line_number, assertion_text);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
movq %r15, %rsi
callq 0x2080
testl %eax, %eax
jne 0x3ed1
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x2250
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x400e
leaq 0x3272(%rip), %rsi      # 0x7166
leaq 0x28(%rsp), %rdi
movl $0x4, %edx
callq 0x2220
movq (%r14), %rsi
movq 0x8(%r14), %rdx
leaq 0x28(%rsp), %rdi
callq 0x2220
movl $0x30, %edi
callq 0x20f0
movq %rax, %r14
leaq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x22b0
movq %r14, %rax
addq $0x10, %rax
movq %rax, (%r14)
leaq 0x18(%rsp), %r15
movq -0x10(%r15), %rcx
cmpq %r15, %rcx
jne 0x3f51
movups (%r15), %xmm0
movups %xmm0, (%rax)
jmp 0x3f5d
movq %rcx, (%r14)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%r14)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%r14)
movq %r15, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movl %ebp, 0x20(%r14)
movq %rbx, 0x28(%r14)
leaq 0x5dc0(%rip), %rsi      # 0x9d48
leaq 0x63(%rip), %rdx        # 0x3ff2
movq %r14, %rdi
callq 0x22f0
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3fb1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
xorl %eax, %eax
jmp 0x3fba
movq %rax, %rbx
movb $0x1, %al
testb %al, %al
je 0x3fcb
movq %r14, %rdi
callq 0x2170
jmp 0x3fcb
movq %rax, %rbx
movq 0x5fee(%rip), %rsi      # 0x9fc0
leaq 0x28(%rsp), %rdi
callq 0x2110
leaq 0x98(%rsp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2310
nop
// File: /workspace/github_cpp_makefile_star2_O1/eecs280staff[P]unit_test_framework/./unit_test_framework.hpp
// Function: std::ostream& unit_test_framework::Diagnostic::print_helper<3ul>(std::ostream&, char const (&) [3ul], int, int)
static std::ostream& print_helper(std::ostream& os, const char (&arr)[N],
                                      int, int) {
      for (std::size_t i = 0; i < N; ++i) {
        if (!arr[i]) {
          return os << arr;
        }
      }
      return print_sequence_helper(os, arr);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x0, (%rsi)
je 0x4766
movq $-0x2, %rax
testq %rax, %rax
je 0x4756
leaq 0x1(%rax), %r15
cmpb $0x0, 0x3(%r14,%rax)
movq %r15, %rax
jne 0x4723
incq %r15
movq %r14, %rdi
callq 0x20d0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2220
cmpq $0x2, %r15
jb 0x477c
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x4786
movq %r14, %rdi
callq 0x20d0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2220
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tobias93[P]piano/./Audio.hpp
// Function: playFromSource(void*, void*, unsigned int, double, unsigned int, void*)
int playFromSource(void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, double streamTime, RtAudioStreamStatus status, void *userData)
{
    double * buffer = (double *) outputBuffer;
    AudioSource& source = *(AudioSource*)userData;

    if (status)
    {
        std::cerr << "Stream underflow detected!" << std::endl;
    }
    
    return source.fillBuffer(buffer, nBufferFrames);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movl %edx, %ebx
movq %rdi, %r15
testl %ecx, %ecx
je 0x2393
movq 0x2c91(%rip), %r12      # 0x4fe8
leaq 0xcf2(%rip), %rsi       # 0x3050
movl $0x1a, %edx
movq %r12, %rdi
callq 0x2170
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq (%r14), %rax
movq (%rax), %rax
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmpq *%rax
// File: /workspace/github_cpp_makefile_star2_O1/tobias93[P]piano/./Midi.hpp
// Function: process_midi(double, std::vector<unsigned char, std::allocator<unsigned char>>*, void*)
void process_midi(double deltatime, std::vector<unsigned char> * message_ptr, void * userData)
{
    if (userData == nullptr)
    {
        return;
    }
    MidiListener& listener = *(MidiListener *) userData;
    
    std::vector<unsigned char>& message = *message_ptr;
    if (message.size() != 3) {
        std::cout << "WARNING: Encountered malformed MIDI message." << std::endl;
        return;
    }

    unsigned char note = message[1];
    unsigned char velocity = message[2];

    if ((message[0] & 0xF0) == 0x80)
    {
        // Note Off
        listener.noteOff(note);
    }

    if ((message[0] & 0xF0) == 0x90)
    {
        // Note On
        listener.noteOn(note, velocity);
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x2412
movq %rdi, %r14
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
cmpq $0x3, %rcx
jne 0x241d
movq %rsi, %rbx
movb (%rax), %cl
movb 0x2(%rax), %r15b
andb $-0x10, %cl
negb %cl
movzbl 0x1(%rax), %ebp
jno 0x23ec
movq (%rbx), %rax
movq %rbx, %rdi
movl %ebp, %esi
callq *0x8(%rax)
movq (%r14), %rax
movb (%rax), %al
andb $-0x10, %al
cmpb $-0x70, %al
jne 0x2412
movq (%rbx), %rax
movq (%rax), %rax
movzbl %r15b, %edx
movq %rbx, %rdi
movl %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *%rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x2b94(%rip), %rbx      # 0x4fb8
leaq 0xc40(%rip), %rsi       # 0x306b
movl $0x2c, %edx
movq %rbx, %rdi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x20d0
// File: /workspace/github_cpp_makefile_star2_O1/tobias93[P]piano/./Audio.hpp
// Function: AudioPlayer::AudioPlayer()
AudioPlayer()
    {
        if ( dac.getDeviceCount() < 1 ) {
            throw std::runtime_error("No audio devices found.");
        }

        RtAudio::StreamParameters parameters;
        parameters.deviceId = dac.getDefaultOutputDevice();
        parameters.nChannels = 1;
        parameters.firstChannel = 0;


    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %esi, %esi
callq 0x2180
movabsq $0x10000005622, %rax    # imm = 0x10000005622
movq %rax, 0x8(%rbx)
movl $0x1, 0x10(%rbx)
movq $0x0, 0x18(%rbx)
movq (%rbx), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testl %eax, %eax
je 0x2764
movq (%rbx), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
popq %rbx
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x20a0
movq %rax, %r14
leaq 0x993(%rip), %rsi       # 0x310b
movq %rax, %rdi
callq 0x2080
movq 0x2869(%rip), %rsi      # 0x4ff0
movq 0x281a(%rip), %rdx      # 0x4fa8
movq %r14, %rdi
callq 0x21c0
movq %rax, %r15
jmp 0x27a6
movq %rax, %r15
movq %r14, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x20c0
movq %r15, %rdi
callq 0x21e0
jmp 0x27b8
movq %rax, %rdi
callq 0x2b50
// File: /workspace/github_cpp_makefile_star2_O1/tobias93[P]piano/./Midi.hpp
// Function: MidiIn::connect_interactive()
void connect_interactive()
    {
        unsigned int portc = midi_in.getPortCount();
        if (portc == 0)
        {
            throw std::runtime_error("No midi devices found.");
        }
        else if (portc == 1)
        {
            connect(0);
        }
        else 
        {
            std::cout << "Please select a midi device: " << std::endl;
            for (int i=0; i < portc; ++i)
            {
                std::cout << " (" << i << ") " << midi_in.getPortName(i) << std::endl;
            }
            int port=-1;
            while(port < 0 || port >= portc) 
            {
                std::cin >> port;
                std::cin.get();			
            }
            connect(port);          
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
cmpl $0x1, %eax
je 0x2931
movl %eax, %ebp
testl %eax, %eax
je 0x2949
movq 0x27c3(%rip), %r14      # 0x4fb8
leaq 0x93e(%rip), %rsi       # 0x313a
movl $0x1d, %edx
movq %r14, %rdi
callq 0x2170
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
xorl %r15d, %r15d
leaq 0x8(%rsp), %r12
movl $0x2, %edx
movq %r14, %rdi
leaq 0x911(%rip), %rsi       # 0x3158
callq 0x2170
movq %r14, %rdi
movl %r15d, %esi
callq 0x21d0
movq %rax, %r13
movl $0x2, %edx
movq %rax, %rdi
leaq 0x8f2(%rip), %rsi       # 0x315b
callq 0x2170
movq 0x8(%rbx), %rsi
movq (%rsi), %rax
movq %r12, %rdi
movl %r15d, %edx
callq *0x38(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r13, %rdi
callq 0x2170
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x28d6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
incl %r15d
cmpl %r15d, %ebp
jne 0x2838
leaq 0x8(%rsp), %r14
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
movq 0x26db(%rip), %r15      # 0x4fd0
movq %r15, %rdi
movq %r14, %rsi
callq 0x20b0
movq %r15, %rdi
callq 0x2190
movl 0x8(%rsp), %esi
testl %esi, %esi
sets %al
cmpl %ebp, %esi
setae %cl
orb %al, %cl
jne 0x28f5
movq %rbx, %rdi
callq 0x2e02
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
xorl %esi, %esi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2e02
movl $0x10, %edi
callq 0x20a0
movq %rax, %r14
leaq 0x7c6(%rip), %rsi       # 0x3123
movq %rax, %rdi
callq 0x2080
movq 0x2684(%rip), %rsi      # 0x4ff0
movq 0x2635(%rip), %rdx      # 0x4fa8
movq %r14, %rdi
callq 0x21c0
movq %rax, %rbx
movq %r14, %rdi
callq 0x20f0
jmp 0x29a7
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x29a7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x21e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tobias93[P]piano/./Audio.hpp
// Function: AudioPlayer::play()
void play()
    {
        if (source == nullptr) {
            throw std::logic_error("There is no source to play from.");
        }
        source->injectAudioSettings(&settins);

        if (!dac.isStreamOpen()) 
        {
            RtAudio::StreamParameters parameters;
            parameters.deviceId = dac.getDefaultOutputDevice();
            parameters.nChannels = settins.nrChannels;
            parameters.firstChannel = 0;
            dac.openStream(&parameters, NULL, RTAUDIO_FLOAT64, settins.sampleRate, &(settins.bufferFrames), &playFromSource, (void *)source );
        }

        dac.startStream();

    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x2a4a
movq %rdi, %rbx
leaq 0x8(%rdi), %rcx
movq %rcx, 0x8(%rax)
movq (%rdi), %rdi
cmpl $-0x32, 0x1bc(%rdi)
jne 0x2a39
movq $0x0, 0x2c(%rsp)
movl $0x0, 0x34(%rsp)
movq (%rdi), %rax
callq *0x30(%rax)
leaq 0x2c(%rsp), %rsi
movl %eax, (%rsi)
movl 0x10(%rbx), %eax
movl %eax, 0x4(%rsi)
movl $0x0, 0x8(%rsi)
movl 0x8(%rbx), %r8d
leaq 0xc(%rbx), %r9
movq 0x18(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movq %rax, 0x8(%rsp)
leaq -0x6ea(%rip), %rax      # 0x233c
movq %rax, (%rsp)
movl $0x20, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2070
movq (%rbx), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x20a0
movq %rax, %rbx
leaq 0x70d(%rip), %rsi       # 0x316b
movq %rax, %rdi
callq 0x21a0
movq 0x255b(%rip), %rsi      # 0x4fc8
movq 0x253c(%rip), %rdx      # 0x4fb0
movq %rbx, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x2b50
movq %rax, %r14
movq %rbx, %rdi
callq 0x20f0
movq %r14, %rdi
callq 0x21e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tobias93[P]piano/./Synth.hpp
// Function: SimpleSynth::fillBuffer(double*, unsigned int)
int fillBuffer(double * buffer, unsigned int nBufferFrames)
        {
            for (int i=0; i < nBufferFrames; ++i) 
            {
                buffer[i] = 0;

                unsigned int t = time_code + i;

                for (int n=0; n<max_concurrency; ++n)
                {
                    Note& note = notes[n];
                    double volume = (double)note.velocity / 256 * getEnvelopeVolume(note, synth, t);
                    double frequency = pow(2, (double)(note.note - 69) / 12) * 441;
                    double a = volume * sin((double)t / audio_settings->sampleRate * frequency * 2 * M_PI);
                    buffer[i] += a;
                }

            }
    
            time_code += nBufferFrames;
            return 0;
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movl %edx, 0x4(%rsp)
testl %edx, %edx
je 0x2c6c
movq %rsi, %r15
leaq 0x1c(%r14), %r12
leaq 0x98(%r14), %r13
movl 0x4(%rsp), %ecx
movq %rcx, 0x10(%rsp)
xorl %ebx, %ebx
movsd 0x47e(%rip), %xmm0      # 0x3018
movq $0x0, (%r15,%rbx,8)
movl 0x18(%r14), %ecx
addl %ebx, %ecx
movq %rcx, 0x20(%rsp)
xorps %xmm1, %xmm1
cvtsi2sd %rcx, %xmm1
mulsd 0x453(%rip), %xmm1      # 0x3010
movsd %xmm1, 0x18(%rsp)
xorl %ebp, %ebp
leaq (%r12,%rbp), %rsi
movzbl 0x25(%r14,%rbp), %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movq %r14, %rdi
movq %r13, %rdx
movq 0x20(%rsp), %rcx
callq 0x2d46
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movzbl 0x24(%r14,%rbp), %eax
addl $-0x45, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x40c(%rip), %xmm0      # 0x3020
callq 0x2140
movq 0x8(%r14), %rax
movl (%rax), %eax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
mulsd 0x18(%rsp), %xmm0
divsd %xmm1, %xmm0
callq 0x2040
mulsd 0x8(%rsp), %xmm0
addsd (%r15,%rbx,8), %xmm0
movsd %xmm0, (%r15,%rbx,8)
movsd 0x3c8(%rip), %xmm0      # 0x3018
addq $0xc, %rbp
cmpq $0x78, %rbp
jne 0x2bc5
incq %rbx
cmpq 0x10(%rsp), %rbx
jne 0x2b9a
movl 0x4(%rsp), %eax
addl %eax, 0x18(%r14)
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_O1/tobias93[P]piano/./Synth.hpp
// Function: SimpleSynth::noteOn(unsigned char, unsigned char)
void noteOn(unsigned char note, unsigned char velocity)
        {
            std::size_t oldest_note = 0;
            for (std::size_t i=1; i<max_concurrency; ++i) 
            {
                if (notes[oldest_note].pressed != notes[i].pressed) 
                {
                    if (!notes[i].pressed) {
                        oldest_note = i;
                    }
                }
                else if(notes[oldest_note].last_event_time_code > notes[i].last_event_time_code) 
                {
                    oldest_note = i;
                }
            }
            
            notes[oldest_note].last_event_time_code = time_code;
            notes[oldest_note].note = note;
            notes[oldest_note].velocity = velocity;
            notes[oldest_note].pressed = true;

        }

// Assembly:
leaq 0x1c(%rdi), %rax
leaq 0x2c(%rdi), %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
leaq (%r9,%r9,2), %r10
movb -0x4(%rcx), %r11b
cmpb %r11b, (%rax,%r10,4)
jne 0x2cbd
leaq (%rax,%r10,4), %r10
movl 0x4(%r10), %r11d
movq %r8, %r10
cmpl (%rcx), %r11d
ja 0x2cb8
movq %r9, %r10
movq %r10, %r9
jmp 0x2cc4
testb %r11b, %r11b
cmoveq %r8, %r9
incq %r8
addq $0xc, %rcx
cmpq $0xa, %r8
jne 0x2c97
movl 0x18(%rdi), %eax
leaq (%r9,%r9,2), %rcx
movl %eax, 0x20(%rdi,%rcx,4)
movb %sil, 0x24(%rdi,%rcx,4)
movb %dl, 0x25(%rdi,%rcx,4)
movb $0x1, 0x1c(%rdi,%rcx,4)
retq
nop