LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/marcellapantarotto[P]pseudoSO/memory.cpp
// Function: Memory::allocation(unsigned int, int)
unsigned int Memory::allocation(unsigned int qtd, int tipo_p){
	unsigned int offset = MAX_MEM;
	switch(tipo_p){
		case REAL_TIME:
			if(qtd > MAX_REAL){
				offset = 1025;
				return offset;
			}
			offset = verification(qtd,START,MAX_REAL);
		  break;
		default:
			if(qtd > USER_MAX){
				offset = 1025;
				return offset;
			}
			offset = verification(qtd,MAX_REAL,MAX_MEM);
			break;
	}

	if(offset!=MAX_MEM)
		for(int i=offset;i<qtd + offset;i++){
			memoir[i] = 1;
		}
	return offset;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl $0x401, %ecx            # imm = 0x401
testl %edx, %edx
je 0x2bab
cmpl $0x3c0, %ebx            # imm = 0x3C0
ja 0x2bef
pushq $0x40
popq %rdx
movq %r14, %rdi
movl %ebx, %esi
movl $0x400, %ecx            # imm = 0x400
jmp 0x2bba
cmpl $0x40, %ebx
ja 0x2bef
pushq $0x40
popq %rcx
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x2bfa
movl $0x400, %ecx            # imm = 0x400
cmpl $0x400, %eax            # imm = 0x400
je 0x2bef
addl %eax, %ebx
movslq %eax, %rcx
pushq $0x1
popq %rdx
cmpl %ecx, %ebx
jbe 0x2bed
movq %rcx, %rsi
shrq $0x6, %rsi
movq %rdx, %rdi
shlq %cl, %rdi
orq %rdi, (%r14,%rsi,8)
incq %rcx
jmp 0x2bd3
movl %eax, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/marcellapantarotto[P]pseudoSO/memory.cpp
// Function: Memory::verification(unsigned int, unsigned int, unsigned int)
unsigned int Memory::verification(unsigned int qtd, unsigned int start, unsigned int end){
	unsigned int offset = MAX_MEM;
	int j;

	for(int i = start; i < end; i++) {
		j = i;
		while (memoir[j] == 0 && j < qtd + i) j++;
		if (j == qtd + i){
			offset = i;
			break;
		}
		else i = j;
	}
	return offset;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movl %ecx, %r8d
leal 0x1(%rsi), %r9d
movabsq $0x1, %r10
cmpl %r8d, %edx
jae 0x2c4e
movl %edx, %eax
leal (%rax,%rsi), %edx
movslq %eax, %rbx
movl %eax, %r14d
xorl %r11d, %r11d
leaq (%rbx,%r11), %rcx
movq %r10, %r15
shlq %cl, %r15
leal (%r14,%r11), %ebp
incq %r11
cmpl %ebp, %edx
jbe 0x2c43
shrq $0x6, %rcx
andq (%rdi,%rcx,8), %r15
je 0x2c24
leal (%rax,%r11), %edx
cmpl %r11d, %r9d
jne 0x2c11
jmp 0x2c53
movl $0x400, %eax            # imm = 0x400
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/marcellapantarotto[P]pseudoSO/memory.cpp
// Function: Memory::deallocation(unsigned int, unsigned int)
void Memory::deallocation(unsigned int offset,unsigned int qtd){
	int i = offset;
	while(i<qtd+offset) {
		memoir[i] = 0;
		i++;
	};
}

// Assembly:
addl %esi, %edx
movslq %esi, %rcx
pushq $-0x2
popq %rax
cmpl %ecx, %edx
jbe 0x2c7c
movq %rcx, %rsi
shrq $0x6, %rsi
movq %rax, %r8
rolq %cl, %r8
andq %r8, (%rdi,%rsi,8)
incq %rcx
jmp 0x2c62
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/marcellapantarotto[P]pseudoSO/resource.cpp
// Function: InitializeSemaphores()
void InitializeSemaphores()
{
	// sem_init() inicializa o semáforo
	// primeiro argumento determina se o semáforo é compartilhado ou não:
	// 			0 = compartilhado entre threas de um processo; !0 = compartilhado entre pocessos
	// segundo argumento indica o valor do semáforo
	sem_init(&scanner, 0, 1);
	sem_init(&printer, 0, 2);
	sem_init(&modem, 0, 1);
	sem_init(&sata, 0, 2);
	return;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
leaq 0x54be(%rip), %rdi      # 0x8148
pushq $0x1
popq %rbx
xorl %esi, %esi
movl %ebx, %edx
callq 0x2110
leaq 0x54cb(%rip), %rdi      # 0x8168
pushq $0x2
popq %rbp
xorl %esi, %esi
movl %ebp, %edx
callq 0x2110
leaq 0x54d8(%rip), %rdi      # 0x8188
xorl %esi, %esi
movl %ebx, %edx
callq 0x2110
leaq 0x54e8(%rip), %rdi      # 0x81a8
xorl %esi, %esi
movl %ebp, %edx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/marcellapantarotto[P]pseudoSO/scheduler.cpp
// Function: Scheduler::fillQueue()
void Scheduler::fillQueue() {
	int i = 0;
	Process p;

	while(i < (int)processes.size() && processes[i].getInitTime() < clock + 1) {
		p = processes[i];
		addEndQueue(p);
		i++;
	}

	processes.erase(processes.begin(),processes.begin()+i);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %r15
leaq 0x8(%rdi), %r14
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x8(%r15), %rsi
movq 0x10(%r15), %rax
subq %rsi, %rax
shrq $0x5, %rax
cltq
cmpq %rax, %r12
jge 0x2dce
addq %rbx, %rsi
movq %rsi, %rdi
callq 0x2a0e
movq 0x8(%r15), %rsi
cmpl (%r15), %eax
jg 0x2dce
movups (%rsi,%rbx), %xmm0
movups 0x10(%rsi,%rbx), %xmm1
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
movaps -0x40(%rbp), %xmm0
movaps -0x30(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0x2d1e
incq %r12
addq $0x20, %rbx
jmp 0x2d71
addq %rsi, %rbx
movq %r14, %rdi
movq %rbx, %rdx
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x37be
// File: /workspace/github_cpp_makefile_star2_O2/marcellapantarotto[P]pseudoSO/scheduler.cpp
// Function: Scheduler::executesProcess(Process&)
void Scheduler::executesProcess(Process& p) {
	switch(p.getPriority()){
		case REAL_TIME:
			clock += p.getExecutionTime();
			sleep(p.getExecutionTime()-QUANTUM);
			p.setExecutionTime(0);
			break;

		case USER_P1:
		case USER_P2:
		case USER_P3:
			p.gives();
			clock += QUANTUM;
			break;

		default:			// percorre até o final do processo
			int i = 0;
			while(!p.getBlockedResource()) {
				p.gives();
				i++;
			}
			clock += QUANTUM*i;
			sleep((QUANTUM*i - 1));
			p.setExecutionTime(p.getExecutionTime() - QUANTUM*i);
			break;
	}
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x29f6
leal -0x1(%rax), %ecx
cmpl $0x3, %ecx
jae 0x2e1e
movq %rbx, %rdi
callq 0x2a4e
incl (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jne 0x2e44
movq %rbx, %rdi
callq 0x2a16
addl %eax, (%r14)
movq %rbx, %rdi
callq 0x2a16
leal -0x1(%rax), %edi
callq 0x20f0
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x2e7e
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x2a46
testl %eax, %eax
jne 0x2e60
movq %rbx, %rdi
callq 0x2a4e
decl %r15d
jmp 0x2e47
subl %r15d, (%r14)
movl %r15d, %edi
notl %edi
callq 0x20f0
movq %rbx, %rdi
callq 0x2a16
addl %eax, %r15d
movq %rbx, %rdi
movl %r15d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2a1a
nop
// File: /workspace/github_cpp_makefile_star2_O2/marcellapantarotto[P]pseudoSO/scheduler.cpp
// Function: Scheduler::nextProcess(Process*)
bool Scheduler::nextProcess(Process *p) {
	if(!realTIME.empty() && realTIME.front().getInitTime() <= clock) {
		*p = realTIME.front();
		realTIME.pop();	// remove o próximo elemento
		return true;
	}

	if(!userP1.empty() && userP1.front().getInitTime() <= clock) {
		*p = userP1.front();
		userP1.pop();
		return true;
	}

	if(!userP2.empty() && userP2.front().getInitTime() <= clock) {
		*p = userP2.front();
		userP2.pop();
		return true;
	}

	if(!userP3.empty() && userP3.front().getInitTime() <= clock) {
		*p = userP3.front();
		userP3.pop();
		return true;
	}

	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x120(%rdi), %rdi
cmpq %rdi, 0x140(%rbx)
je 0x2ed0
callq 0x2a0e
cmpl (%rbx), %eax
jle 0x2f19
movq 0x30(%rbx), %rdi
cmpq %rdi, 0x50(%rbx)
je 0x2ee3
callq 0x2a0e
cmpl (%rbx), %eax
jle 0x2f29
movq 0x80(%rbx), %rdi
cmpq %rdi, 0xa0(%rbx)
je 0x2efc
callq 0x2a0e
cmpl (%rbx), %eax
jle 0x2f33
movq 0xd0(%rbx), %rdi
cmpq %rdi, 0xf0(%rbx)
je 0x2f15
callq 0x2a0e
cmpl (%rbx), %eax
jle 0x2f40
xorl %eax, %eax
jmp 0x2f6b
leaq 0x120(%rbx), %rax
addq $0x110, %rbx            # imm = 0x110
jmp 0x2f4e
leaq 0x30(%rbx), %rax
addq $0x20, %rbx
jmp 0x2f4e
leaq 0x80(%rbx), %rax
addq $0x70, %rbx
jmp 0x2f4e
leaq 0xd0(%rbx), %rax
addq $0xc0, %rbx
movq (%rax), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
movq %rbx, %rdi
callq 0x4592
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/marcellapantarotto[P]pseudoSO/scheduler.cpp
// Function: Scheduler::dispatcher(Process&)
void Scheduler::dispatcher(Process& p) {
	cout << "\n Dispatcher =>" << '\n';
	cout << p << endl;
	executesProcess(p);
	displayExecution(p);
	sleep(QUANTUM);
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x4df6(%rip), %r15      # 0x7fd0
leaq 0x1f86(%rip), %rsi      # 0x5167
movq %r15, %rdi
callq 0x2170
pushq $0xa
popq %rsi
movq %rax, %rdi
callq 0x2190
movq %r15, %rdi
movq %r14, %rsi
callq 0x2870
movq %rax, %rdi
callq 0x20d0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2de8
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
movaps -0x40(%rbp), %xmm0
movaps -0x30(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x324e
pushq $0x1
popq %rdi
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x20f0
// File: /workspace/github_cpp_makefile_star2_O2/marcellapantarotto[P]pseudoSO/scheduler.cpp
// Function: Scheduler::displayExecution(Process)
void Scheduler::displayExecution(Process p) {
	cout << "\n  Process " << p.getPID() << " => " << endl;
	cout << "\tPriority: " << p.getPriority() << endl;
	cout << "\tTime Since Arrival: " << clock - p.getInitTime() << endl;
	cout << "\tTime Left To Execute: " << p.getExecutionTime() << endl;
	cout << "\tHolds Any Resources: ";

	switch(p.getBlockedResource()) {
		case WITHOUT_RESOURCES:
			cout << "No";
			break;
		case PRINTER:
			cout << "Printer";
			break;
		case SCANNER:
			cout << "Scanner";
			break;
		case SATA:
			cout << "Sata";
			break;
		case MODEM:
			cout << "Modem";
			break;
	}
	cout << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r15
movq 0x4d6d(%rip), %rbx      # 0x7fd0
leaq 0x1f0d(%rip), %rsi      # 0x5177
movq %rbx, %rdi
callq 0x2170
movq %rax, %r12
leaq 0x10(%rbp), %r14
movq %r14, %rdi
callq 0x29ee
movq %r12, %rdi
movl %eax, %esi
callq 0x2230
leaq 0x1ef1(%rip), %rsi      # 0x5183
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x1da6(%rip), %rsi      # 0x504f
movq %rbx, %rdi
callq 0x2170
movq %rax, %r12
movq %r14, %rdi
callq 0x29f6
movq %r12, %rdi
movl %eax, %esi
callq 0x2230
movq %rax, %rdi
callq 0x20d0
leaq 0x1eb3(%rip), %rsi      # 0x5188
movq %rbx, %rdi
callq 0x2170
movq %rax, %r12
movl (%r15), %r15d
movq %r14, %rdi
callq 0x2a0e
subl %eax, %r15d
movq %r12, %rdi
movl %r15d, %esi
callq 0x2230
movq %rax, %rdi
callq 0x20d0
leaq 0x1e96(%rip), %rsi      # 0x519e
movq %rbx, %rdi
callq 0x2170
movq %rax, %r15
movq %r14, %rdi
callq 0x2a16
movq %r15, %rdi
movl %eax, %esi
callq 0x2230
movq %rax, %rdi
callq 0x20d0
leaq 0x1e82(%rip), %rsi      # 0x51b6
movq %rbx, %rdi
callq 0x2170
movq %r14, %rdi
callq 0x2a46
cmpl $0x4, %eax
ja 0x3365
movl %eax, %eax
leaq 0x1f7e(%rip), %rcx      # 0x52d0
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movq 0x4c70(%rip), %rdi      # 0x7fd0
callq 0x2170
movq 0x4c64(%rip), %rdi      # 0x7fd0
callq 0x20d0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/bchu7796[P]p2p-file-sharing/client.cpp
// Function: main
int main(void){
    client client_instance;
    if(client_instance.execute()!= 0){
        perror("server execution fault");
    }
    return 0;
}

// Assembly:
pushq %rax
leaq 0x7(%rsp), %rdi
callq 0x4df8
testl %eax, %eax
jne 0x362f
xorl %eax, %eax
popq %rcx
retq
leaq 0x39ce(%rip), %rdi      # 0x7004
callq 0x3220
jmp 0x362b
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/bchu7796[P]p2p-file-sharing/peers.cpp
// Function: client::file_list_request()
int client::file_list_request(){
    /*
    send:
        request type
    receive:
        number of file a client can download
        a list of file name
        a list of file length
    */
    int peer_fd;
    const uint32_t request_type = 1;
    uint16_t number_of_file;
    std::string file_name;
    uint32_t file_length;

    //create socket
    if((peer_fd = socket(AF_INET, SOCK_STREAM , 0)) < 0){
        perror("Failed to create socket"); 
        exit(0);
    }

    //connect to server
    if(connect(peer_fd,(struct sockaddr*) &server_address, sizeof(server_address)) < 0){
        perror("Failed to connect"); 
        exit(0);
    }
    //get files a client can download
    send(peer_fd, &request_type, sizeof(request_type), 0);
    recv(peer_fd, &number_of_file, sizeof(number_of_file), 0);
    for(int i = 0; i < number_of_file; i++){
        recv(peer_fd, &file_name, sizeof(file_name), 0);
        recv(peer_fd, &file_length, sizeof(file_length), 0);
        std::cout << file_name << ": "<< file_length <<" bytes";
        if(i != number_of_file - 1){
            std::cout<<", ";
        }
    }
    std::cout << std::endl;
    close(peer_fd);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl $0x1, 0x14(%rsp)
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x3060
testl %eax, %eax
js 0x3933
movl %eax, %ebx
leaq 0x7a7b(%rip), %rsi      # 0xb2b8
pushq $0x10
popq %rdx
movl %eax, %edi
callq 0x3210
testl %eax, %eax
js 0x393c
leaq 0x14(%rsp), %rsi
pushq $0x4
popq %rdx
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x3160
leaq 0xe(%rsp), %rsi
pushq $0x2
popq %rdx
xorl %r13d, %r13d
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x30d0
leaq 0x18(%rsp), %r14
movq 0x7750(%rip), %rbp      # 0xafd0
leaq 0x3818(%rip), %r15      # 0x709f
leaq 0x37df(%rip), %r12      # 0x706d
movzwl 0xe(%rsp), %eax
cmpl %eax, %r13d
jae 0x3905
movl %ebx, %edi
movq %r14, %rsi
pushq $0x20
popq %rdx
xorl %ecx, %ecx
callq 0x30d0
movl %ebx, %edi
leaq 0x10(%rsp), %rsi
pushq $0x4
popq %rdx
xorl %ecx, %ecx
callq 0x30d0
movq %rbp, %rdi
movq %r14, %rsi
callq 0x3250
movq %rax, %rdi
movq %r15, %rsi
callq 0x32a0
movl 0x10(%rsp), %esi
movq %rax, %rdi
callq 0x31c0
movq %rax, %rdi
movq %r12, %rsi
callq 0x32a0
movzwl 0xe(%rsp), %eax
decl %eax
cmpl %eax, %r13d
je 0x3900
movq %rbp, %rdi
leaq 0x3779(%rip), %rsi      # 0x7074
callq 0x32a0
incl %r13d
jmp 0x388e
movq 0x76c4(%rip), %rdi      # 0xafd0
callq 0x3150
movl %ebx, %edi
callq 0x34c0
leaq 0x18(%rsp), %rdi
callq 0x3110
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x36e1(%rip), %rdi      # 0x701b
jmp 0x3943
leaq 0x36f0(%rip), %rdi      # 0x7033
callq 0x3220
xorl %edi, %edi
callq 0x3300
jmp 0x3951
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3440
// File: /workspace/github_cpp_makefile_star2_O2/bchu7796[P]p2p-file-sharing/peers.cpp
// Function: client::split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, char)
void client::split(const std::string& s, std::vector<std::string>& parameters, const char delim = ' ') {
    parameters.clear();
    std::istringstream iss(s);
    std::string temp;

    while (std::getline(iss, temp, delim)) {
        parameters.emplace_back(std::move(temp));
    }
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdx, %rdi
callq 0x5060
leaq 0x28(%rsp), %r14
pushq $0x8
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3400
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movsbl %bpl, %ebp
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x3460
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3c0a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5068
jmp 0x3be2
leaq 0x8(%rsp), %rdi
callq 0x3110
leaq 0x28(%rsp), %rdi
callq 0x3130
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3110
leaq 0x28(%rsp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3440
nop
// File: /workspace/github_cpp_makefile_star2_O2/bchu7796[P]p2p-file-sharing/peers.cpp
// Function: client::write_log(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<chunk, std::allocator<chunk>>)
int client::write_log(std::string file_name, std::vector<chunk> chunks){
    std::ofstream log;
    log.open((file_name + ".log").c_str());
    for(int i = 0; i < chunks.size(); i++){
        if(chunks[i].is_possessed == true){
            log<<chunks[i].index<<"\n";
        }
    }
    log.close();
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x20(%rsp), %rdi
callq 0x3410
leaq 0x33f1(%rip), %rdx      # 0x7086
movq %rsp, %rdi
movq %r14, %rsi
callq 0x50a4
movq (%rsp), %rsi
leaq 0x20(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x3030
movq %rsp, %rdi
callq 0x3110
pushq $0x4
popq %r12
xorl %r13d, %r13d
leaq 0x20(%rsp), %r14
leaq 0x33bf(%rip), %r15      # 0x708b
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %r13, %rcx
jbe 0x3d07
cmpb $0x1, (%rax,%r12)
jne 0x3cfe
movl -0x4(%rax,%r12), %esi
movq %r14, %rdi
callq 0x31c0
movq %rax, %rdi
movq %r15, %rsi
callq 0x32a0
incq %r13
addq $0x20, %r12
jmp 0x3ccc
leaq 0x20(%rsp), %rdi
callq 0x3370
leaq 0x20(%rsp), %rdi
callq 0x33a0
xorl %eax, %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x3d3f
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3110
jmp 0x3d42
jmp 0x3d3f
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x33a0
movq %rbx, %rdi
callq 0x3440
// File: /workspace/github_cpp_makefile_star2_O2/bchu7796[P]p2p-file-sharing/peers.cpp
// Function: client::read_log(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<chunk, std::allocator<chunk>>&, int)
int client::read_log(std::string file_name, std::vector<chunk>& chunks, int file_length){
    std::ifstream log;
    std::ofstream download_file;
    char buffer[10];
    std::string log_line;
    std::vector<std::string> elements;

    
    if(!file_exist(file_name + ".log")){
        /*
        download_file.open(file_name);
        for(int i=0; i < file_length; i++){
            download_file << "0";
        }
        download_file.close();
        */
        return 0;
    }
    

    log.open((file_name + ".log").c_str());
    
    while(log.getline(buffer, 10)){
        log_line = buffer;
        std::stringstream s(log_line);
        int index = 0;
        s >> index;
        chunks[index].is_possessed = true;
        std::stringstream().swap(s);
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x798, %rsp            # imm = 0x798
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x208(%rsp), %rdi
callq 0x32f0
leaq 0x410(%rsp), %rdi
callq 0x3410
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
leaq 0x32db(%rip), %rdx      # 0x7086
leaq 0x60(%rsp), %rdi
movq %r14, %rsi
callq 0x50a4
leaq 0x60(%rsp), %r15
movq %r15, %rsi
callq 0x3c4c
movl %eax, %ebp
movq %r15, %rdi
callq 0x3110
testb %bpl, %bpl
je 0x3eb2
leaq 0x32a7(%rip), %rdx      # 0x7086
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
callq 0x50a4
movq 0x80(%rsp), %rsi
leaq 0x208(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x31a0
leaq 0x80(%rsp), %r14
movq %r14, %rdi
callq 0x3110
leaq 0x56(%rsp), %r12
pushq $0xa
popq %r13
leaq 0x30(%rsp), %rbp
leaq 0x610(%rsp), %r15
leaq 0x208(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x30b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3eb2
movq %rbp, %rdi
movq %r12, %rsi
callq 0x3490
movq %r14, %rdi
movq %rbp, %rsi
pushq $0x18
popq %rdx
callq 0x33c0
andl $0x0, 0xc(%rsp)
movq %r14, %rdi
leaq 0xc(%rsp), %rsi
callq 0x3190
movslq 0xc(%rsp), %rax
movq (%rbx), %rcx
shlq $0x5, %rax
movb $0x1, 0x4(%rcx,%rax)
movq %r15, %rdi
callq 0x31d0
movq %r15, %rdi
movq %r14, %rsi
callq 0x3470
movq %r15, %rdi
callq 0x31e0
movq %r14, %rdi
callq 0x31e0
jmp 0x3e2d
leaq 0x10(%rsp), %rdi
callq 0x50dc
leaq 0x30(%rsp), %rdi
callq 0x3110
leaq 0x410(%rsp), %rdi
callq 0x33a0
leaq 0x208(%rsp), %rdi
callq 0x3070
xorl %eax, %eax
addq $0x798, %rsp            # imm = 0x798
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x3110
jmp 0x3f3a
jmp 0x3f37
jmp 0x3f37
movq %rax, %rbx
jmp 0x3f5b
movq %rax, %rbx
leaq 0x610(%rsp), %rdi
callq 0x31e0
jmp 0x3f28
jmp 0x3f25
jmp 0x3f37
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x31e0
jmp 0x3f3a
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x50dc
leaq 0x30(%rsp), %rdi
callq 0x3110
leaq 0x410(%rsp), %rdi
callq 0x33a0
leaq 0x208(%rsp), %rdi
callq 0x3070
movq %rbx, %rdi
callq 0x3440
// File: /workspace/github_cpp_makefile_star2_O2/bchu7796[P]p2p-file-sharing/peers.cpp
// Function: client::select_chunk(std::vector<chunk, std::allocator<chunk>>)
std::vector<int> client::select_chunk(std::vector<chunk> chunks){
    std::vector<int> min;
    int min_number = INT_MAX;
    int min_index = 0;
    bool flag = false;
    for(int i = 0; i<4; i++){
        for(int j=0; j<chunks.size(); j++){
            if((chunks[j].peers.size() < min_number) && (!chunks[j].is_possessed)){
                min_number = chunks[j].peers.size();
                min_index = j;
                flag = true;
            }
        }
        if(flag){
            min.push_back(min_index);
            chunks[min_index].is_possessed = true;
            min_number = INT_MAX;
            flag = false;
        }
    }
    return min;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
andq $0x0, 0x10(%rdi)
leaq 0x4(%rsp), %r15
andl $0x0, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ebp, %ebp
cmpl $0x4, %ebp
je 0x400f
movq (%r14), %rcx
movq 0x8(%r14), %rdx
subq %rcx, %rdx
sarq $0x5, %rdx
addq $0x10, %rcx
xorl %esi, %esi
xorl %edi, %edi
cmpq %rsi, %rdx
je 0x3fe4
movq (%rcx), %r8
subq -0x8(%rcx), %r8
sarq $0x3, %r8
movslq %eax, %r9
cmpq %r9, %r8
jae 0x3fdb
cmpb $0x0, -0xc(%rcx)
jne 0x3fdb
movl %esi, 0x4(%rsp)
movb $0x1, %dil
movl %r8d, %eax
incq %rsi
addq $0x20, %rcx
jmp 0x3fb3
testb $0x1, %dil
je 0x400b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x50fe
movslq 0x4(%rsp), %rax
movq (%r14), %rcx
shlq $0x5, %rax
movb $0x1, 0x4(%rcx,%rax)
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
incl %ebp
jmp 0x3f98
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x5ab4
movq %r14, %rdi
callq 0x3440
// File: /workspace/github_cpp_makefile_star2_O2/bchu7796[P]p2p-file-sharing/peers.cpp
// Function: client::combine_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
int client::combine_file(std::string file_name, int chunk_number){
    std::ifstream read;
    std::ofstream write(file_name);
    std::string temp_file_name;
    std::string index_string;
    std::stringstream ss;
    char buffer[CHUNK_SIZE];

    for(int i = 0; i < chunk_number; i++){
        ss << i;
        ss >> index_string;
        temp_file_name = file_name + index_string; 
        read.open(temp_file_name);
        read.read(buffer, sizeof(buffer));
        write << buffer;
        std::stringstream().swap(ss);
        read.close();
        remove(temp_file_name.c_str());
    }
    write.close();
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb68, %rsp            # imm = 0xB68
movl %edx, %r13d
movq %rsi, %r14
leaq 0x3d0(%rsp), %rdi
callq 0x32f0
leaq 0x1d0(%rsp), %rdi
pushq $0x10
popq %rdx
movq %r14, (%rsp)
movq %r14, %rsi
callq 0x34a0
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ebp, %ebp
movb %bpl, (%rax)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %bpl, (%rax)
leaq 0x48(%rsp), %rdi
callq 0x31d0
testl %r13d, %r13d
cmovlel %ebp, %r13d
leaq 0x5d8(%rsp), %r15
leaq 0x28(%rsp), %r14
leaq 0x3d0(%rsp), %rbx
leaq 0x760(%rsp), %r12
cmpl %ebp, %r13d
je 0x43fd
leaq 0x58(%rsp), %rdi
movl %ebp, %esi
callq 0x3420
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3330
movq %r15, %rdi
movq (%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x512f
movq %r14, %rdi
movq %r15, %rsi
callq 0x3310
movq %r15, %rdi
callq 0x3110
movq %rbx, %rdi
movq %r14, %rsi
pushq $0x8
popq %rdx
callq 0x3230
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3320
leaq 0x1d0(%rsp), %rdi
movq %r12, %rsi
callq 0x32a0
movq %r15, %rdi
callq 0x31d0
movq %r15, %rdi
leaq 0x48(%rsp), %rsi
callq 0x3470
movq %r15, %rdi
callq 0x31e0
movq %rbx, %rdi
callq 0x3050
movq 0x28(%rsp), %rdi
callq 0x3450
incl %ebp
jmp 0x4351
leaq 0x1d0(%rsp), %rdi
callq 0x3370
leaq 0x48(%rsp), %rdi
callq 0x31e0
leaq 0x8(%rsp), %rdi
callq 0x3110
leaq 0x28(%rsp), %rdi
callq 0x3110
leaq 0x1d0(%rsp), %rdi
callq 0x33a0
leaq 0x3d0(%rsp), %rdi
callq 0x3070
xorl %eax, %eax
addq $0xb68, %rsp            # imm = 0xB68
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4478
movq %rax, %rbx
jmp 0x4485
movq %rax, %rbx
jmp 0x44a6
jmp 0x4478
jmp 0x4478
movq %rax, %rbx
leaq 0x5d8(%rsp), %rdi
callq 0x31e0
jmp 0x447b
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x31e0
leaq 0x8(%rsp), %rdi
callq 0x3110
leaq 0x28(%rsp), %rdi
callq 0x3110
leaq 0x1d0(%rsp), %rdi
callq 0x33a0
leaq 0x3d0(%rsp), %rdi
callq 0x3070
movq %rbx, %rdi
callq 0x3440
nop
// File: /workspace/github_cpp_makefile_star2_O2/bchu7796[P]p2p-file-sharing/peers.cpp
// Function: client::register_chunk(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
int client::register_chunk(std::string file_name, int index){
    int peer_fd;
    std::string file = file_name;
    int chunk_index = index;
    std::string response_message;
    //create socket
    if((peer_fd = socket(AF_INET, SOCK_STREAM , 0)) < 0){
        perror("Failed to create socket"); 
        return -1;
    }

    //connect to server
    if(connect(peer_fd,(struct sockaddr*) &server_address, sizeof(server_address)) < 0){
        perror("Failed to connect"); 
        return -1;
    }

    //send request to the server
    uint32_t request_type = 3;
    uint16_t port = PORT;
    send(peer_fd, &request_type, sizeof(request_type), 0);
    send(peer_fd, &file, sizeof(file), 0);
    send(peer_fd, &chunk_index, sizeof(chunk_index), 0);
    send(peer_fd, &port, sizeof(port), 0);

    if(recv(peer_fd, &response_message, sizeof(response_message), 0) < 0){
        perror("No response from server");
        return -1;
    }
    std::cout<<response_message<<std::endl;
    return 0;
}

// Assembly:
pushq %rbx
subq $0x50, %rsp
movl %edx, %ebx
leaq 0x30(%rsp), %rdi
callq 0x3360
movl %ebx, 0x8(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x3060
testl %eax, %eax
js 0x45b0
movl %eax, %ebx
leaq 0x6db8(%rip), %rsi      # 0xb2b8
pushq $0x10
popq %rdx
movl %eax, %edi
callq 0x3210
testl %eax, %eax
js 0x45b9
leaq 0xc(%rsp), %rsi
movl $0x3, (%rsi)
movw $0x1f92, 0x6(%rsp)      # imm = 0x1F92
pushq $0x4
popq %rdx
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x3160
leaq 0x30(%rsp), %rsi
pushq $0x20
popq %rdx
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x3160
leaq 0x8(%rsp), %rsi
pushq $0x4
popq %rdx
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x3160
leaq 0x6(%rsp), %rsi
pushq $0x2
popq %rdx
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x3160
leaq 0x10(%rsp), %rsi
pushq $0x20
popq %rdx
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x30d0
testq %rax, %rax
js 0x45c2
movq 0x6a50(%rip), %rdi      # 0xafd0
leaq 0x10(%rsp), %rsi
callq 0x3250
xorl %ebx, %ebx
movq %rax, %rdi
callq 0x3150
leaq 0x10(%rsp), %rdi
callq 0x3110
leaq 0x30(%rsp), %rdi
callq 0x3110
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
retq
leaq 0x2a64(%rip), %rdi      # 0x701b
jmp 0x45c9
leaq 0x2a73(%rip), %rdi      # 0x7033
jmp 0x45c9
leaq 0x2ad9(%rip), %rdi      # 0x70a2
callq 0x3220
pushq $-0x1
popq %rbx
jmp 0x4594
jmp 0x45d5
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3110
leaq 0x30(%rsp), %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3440
// File: /workspace/github_cpp_makefile_star2_O2/bchu7796[P]p2p-file-sharing/peers.cpp
// Function: client::user_interface()
void client::user_interface(){
    char buffer[1024];
    while(1){
        std::string command;
        std::cout<<">";
        std::cin.getline(buffer, 1024);
        command = buffer;
        parse_command(command);
    }
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
movq 0x6320(%rip), %rbx      # 0xafd0
leaq 0x2433(%rip), %r14      # 0x70ea
movq 0x6322(%rip), %r15      # 0xafe0
leaq 0x40(%rsp), %r12
movq %rsp, %r13
leaq 0x20(%rsp), %rbp
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
andq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32a0
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
movq %r12, %rsi
callq 0x30b0
movq %r13, %rdi
movq %r12, %rsi
callq 0x3490
movq %rbp, %rdi
movq %r13, %rsi
callq 0x3360
movq %rbp, %rsi
callq 0x4a52
movq %rbp, %rdi
callq 0x3110
movq %r13, %rdi
callq 0x3110
jmp 0x4ccb
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3110
jmp 0x4d3c
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3440
// File: /workspace/github_cpp_makefile_star2_O2/bchu7796[P]p2p-file-sharing/peers.cpp
// Function: client::handle_request(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
void client::handle_request(int process_fd, std::string file_name, int chunk_index){
    char buffer[CHUNK_SIZE];
    std::ifstream upload_file;
    int chunk_size = CHUNK_SIZE;

    upload_file.open(file_name);
    upload_file.seekg(chunk_size * chunk_index, std::ios::beg);
    upload_file.read(buffer, sizeof(buffer));

    send(process_fd, &buffer, sizeof(buffer), 0);
    upload_file.close();
    close(process_fd);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x618, %rsp            # imm = 0x618
movl %ecx, %ebp
movq %rdx, %r14
movl %esi, %ebx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x32f0
pushq $0x8
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x3230
shll $0xa, %ebp
movslq %ebp, %rsi
leaq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x3350
leaq 0x8(%rsp), %rdi
leaq 0x210(%rsp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x3320
leaq 0x210(%rsp), %rsi
movl $0x400, %edx            # imm = 0x400
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x3160
leaq 0x8(%rsp), %rdi
callq 0x3050
movl %ebx, %edi
callq 0x34c0
leaq 0x8(%rsp), %rdi
callq 0x3070
addq $0x618, %rsp            # imm = 0x618
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3070
movq %rbx, %rdi
callq 0x3440
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa_test.cpp
// Function: Pattern::Pattern(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, unsigned int)
Pattern(const std::string& _pattern, bool ignore_tab, usint ignore) :
    pattern(_pattern), weight(1), range(EMPTY_PAIR), steps(0), docc(0)
  {
    if(ignore_tab)
    {
      usint pos = this->pattern.find('\t');
      this->weight = atoi(this->pattern.substr(0, pos).c_str());
      this->pattern = this->pattern.substr(pos + 1);
    }
    else if(ignore > 0)
    {
      this->weight = atoi(this->pattern.substr(0, ignore).c_str());
      this->pattern = this->pattern.substr(ignore);
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movq %rdi, %rbx
callq 0x3350
movl $0x1, 0x20(%rbx)
movq $0x1, 0x24(%rbx)
andq $0x0, 0x2c(%rbx)
testl %r14d, %r14d
je 0x651e
pushq $0x9
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3310
movq %rax, %r14
movl %r14d, %ecx
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3280
leaq 0x8(%rsp), %r15
movq (%r15), %rdi
callq 0x33c0
movl %eax, 0x20(%rbx)
movq %r15, %rdi
callq 0x34e8
incl %r14d
leaq 0x8(%rsp), %rdi
pushq $-0x1
popq %rcx
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3280
jmp 0x6562
testl %ebp, %ebp
je 0x657a
movl %ebp, %r14d
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %r14, %rcx
callq 0x3280
leaq 0x8(%rsp), %r15
movq (%r15), %rdi
callq 0x33c0
movl %eax, 0x20(%rbx)
movq %r15, %rdi
callq 0x34e8
leaq 0x8(%rsp), %rdi
pushq $-0x1
popq %rcx
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3280
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32c0
movq %r14, %rdi
callq 0x34e8
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x658b
jmp 0x658b
jmp 0x658b
movq %rax, %r14
movq %rbx, %rdi
callq 0x34e8
movq %r14, %rdi
callq 0x3470
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/adaptive_samples.cpp
// Function: CSA::AdaptiveSamples::addSample(std::pair<unsigned int, unsigned int>)
void
AdaptiveSamples::addSample(sample_type sample)
{
  key_type i = this->hash(sample.first);
  if(this->samples[i].first >= this->index.getSize()) { this->items++; }
  else if(this->use_candidates) { this->addCandidate(this->samples[i]); }
  this->samples[i] = sample;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x10c08
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movl %eax, %r15d
movl (%rcx,%r15,8), %eax
cmpl 0x4(%rdx), %eax
jae 0x107e0
cmpb $0x1, 0x34(%r14)
jne 0x107e4
movq (%rcx,%r15,8), %rsi
movq %r14, %rdi
callq 0x10e4e
movq 0x8(%r14), %rcx
jmp 0x107e4
incl 0x14(%r14)
movq %rbx, %rax
shrq $0x20, %rax
movl %ebx, (%rcx,%r15,8)
movl %eax, 0x4(%rcx,%r15,8)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/adaptive_samples.cpp
// Function: CSA::AdaptiveSamples::~AdaptiveSamples()
AdaptiveSamples::~AdaptiveSamples()
{
  delete[] samples; samples = 0;
  delete[] candidate_samples; candidate_samples = 0;
  delete   regular_samples; regular_samples = 0;
  delete[] window; window = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x1080f
callq 0x32f0
andq $0x0, 0x8(%rbx)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x10822
callq 0x32f0
andq $0x0, 0x18(%rbx)
movq 0x28(%rbx), %r14
testq %r14, %r14
je 0x10838
movq %r14, %rdi
callq 0xd1d8
pushq $0x30
popq %rsi
movq %r14, %rdi
callq 0x3270
andq $0x0, 0x28(%rbx)
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x10856
callq 0x32f0
andq $0x0, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/adaptive_samples.cpp
// Function: CSA::AdaptiveSamples::reportSize() const
usint
AdaptiveSamples::reportSize() const
{
  usint temp = sizeof(*this) + this->size * sizeof(sample_type);
  if(this->use_candidates) { temp += this->size * sizeof(sample_type); }
  if(this->half_greedy) { temp += this->regular_samples->reportSize(); }
  if(this->promote_probability > 0.0) { temp += this->window_size * sizeof(key_type); }
  return temp;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movl 0x10(%rdi), %eax
leal (,%rax,8), %ecx
xorl %ebx, %ebx
cmpb $0x0, 0x34(%rdi)
cmovel %ebx, %ecx
leal (%rcx,%rax,8), %ebp
addl $0x60, %ebp
cmpb $0x1, 0x35(%rdi)
jne 0x108f3
movq 0x28(%r14), %rdi
callq 0xd4a6
addl %eax, %ebp
movsd 0x38(%r14), %xmm0
movl 0x40(%r14), %eax
shll $0x2, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
cmoval %eax, %ebx
addl %ebp, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/adaptive_samples.cpp
// Function: CSA::AdaptiveSamples::report() const
void
AdaptiveSamples::report() const
{
  std::cout << "Adaptive samples:" << std::endl;
  std::cout << "Size:     " << this->reportSize() / (double)MEGABYTE << " MB" << std::endl;
  std::cout << "Load:     " << this->getLoad() << " (" << this->getPrimaryLoad() << " / " << this->getCandidateLoad() << ")" << std::endl;

  std::cout << "Options: ";
  if(this->use_candidates) { std::cout << " candidates"; }
  if(this->half_greedy) { std::cout << " half-greedy"; }
  if(this->promote_probability > 0.0)
  {
    std::cout << " random(" << this->promote_probability << ", " << this->window_size << ")";
  }
  std::cout << std::endl;

  std::cout << std::endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x176ad(%rip), %r14     # 0x27fd0
leaq 0xa430(%rip), %rsi      # 0x1ad5a
movq %r14, %rdi
callq 0x3240
movq %rax, %rdi
callq 0x3110
leaq 0xa42b(%rip), %rsi      # 0x1ad6c
movq %r14, %rdi
callq 0x3240
movq %rax, %r15
movq %rbx, %rdi
callq 0x108c2
movl %eax, %eax
cvtsi2sd %rax, %xmm0
mulsd 0x96a5(%rip), %xmm0     # 0x1a008
movq %r15, %rdi
callq 0x33f0
leaq 0x993e(%rip), %rsi      # 0x1a2b0
movq %rax, %rdi
callq 0x3240
movq %rax, %rdi
callq 0x3110
leaq 0xa3ee(%rip), %rsi      # 0x1ad77
movq %r14, %rdi
callq 0x3240
movq %rax, %r15
movq %rbx, %rdi
callq 0x10878
movq %r15, %rdi
callq 0x33f0
leaq 0xa497(%rip), %rsi      # 0x1ae42
movq %rax, %rdi
callq 0x3240
movl 0x14(%rbx), %ecx
cvtsi2sd %rcx, %xmm0
movl 0x10(%rbx), %ecx
cvtsi2sd %rcx, %xmm1
divsd %xmm1, %xmm0
movq %rax, %rdi
callq 0x33f0
leaq 0xa0b9(%rip), %rsi      # 0x1aa8f
movq %rax, %rdi
callq 0x3240
movl 0x20(%rbx), %ecx
cvtsi2sd %rcx, %xmm0
movl 0x10(%rbx), %ecx
cvtsi2sd %rcx, %xmm1
divsd %xmm1, %xmm0
movq %rax, %rdi
callq 0x33f0
leaq 0x97f1(%rip), %rsi      # 0x1a1f2
movq %rax, %rdi
callq 0x3240
movq %rax, %rdi
callq 0x3110
leaq 0xa36a(%rip), %rsi      # 0x1ad82
movq %r14, %rdi
callq 0x3240
cmpb $0x1, 0x34(%rbx)
jne 0x10a39
movq 0x175a3(%rip), %rdi     # 0x27fd0
leaq 0xa358(%rip), %rsi      # 0x1ad8c
callq 0x3240
cmpb $0x1, 0x35(%rbx)
jne 0x10a52
movq 0x1758a(%rip), %rdi     # 0x27fd0
leaq 0xa34b(%rip), %rsi      # 0x1ad98
callq 0x3240
movsd 0x38(%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x10aaa
movq 0x17568(%rip), %rdi     # 0x27fd0
leaq 0xa336(%rip), %rsi      # 0x1ada5
callq 0x3240
movsd 0x38(%rbx), %xmm0
movq %rax, %rdi
callq 0x33f0
leaq 0x98d5(%rip), %rsi      # 0x1a35d
movq %rax, %rdi
callq 0x3240
movl 0x40(%rbx), %esi
movq %rax, %rdi
callq 0x3180
leaq 0x9750(%rip), %rsi      # 0x1a1f2
movq %rax, %rdi
callq 0x3240
movq 0x1751f(%rip), %rbx     # 0x27fd0
movq %rbx, %rdi
callq 0x3110
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3110
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/adaptive_samples.cpp
// Function: CSA::AdaptiveSamples::secondaryHash(unsigned int)
AdaptiveSamples::key_type
AdaptiveSamples::secondaryHash(key_type key)
{
  key = (key + 0x7ed55d16) + (key << 12);
  key = (key ^ 0xc761c23c) ^ (key >> 19);
  key = (key + 0x165667b1) + (key << 5);
  key = (key + 0xd3a2646c) ^ (key << 9);
  key = (key + 0xfd7046c5) + (key << 3);
  key = (key ^ 0xb55a4f09) ^ (key >> 16);
  return key % this->size;
}

// Assembly:
movl %esi, %eax
shll $0xc, %eax
addl %esi, %eax
addl $0x7ed55d16, %eax       # imm = 0x7ED55D16
movl %eax, %ecx
shrl $0x13, %ecx
xorl %eax, %ecx
xorl $0xc761c23c, %ecx       # imm = 0xC761C23C
movl %ecx, %eax
shll $0x5, %eax
leal (%rcx,%rax), %edx
shll $0x9, %edx
addl %ecx, %eax
addl $0xe9f8cc1d, %eax       # imm = 0xE9F8CC1D
addl $0xaccf6200, %edx       # imm = 0xACCF6200
xorl %eax, %edx
leal (%rdx,%rdx,8), %ecx
addl $0xfd7046c5, %ecx       # imm = 0xFD7046C5
movl %ecx, %eax
shrl $0x10, %eax
xorl %ecx, %eax
xorl $0xb55a4f09, %eax       # imm = 0xB55A4F09
xorl %edx, %edx
divl 0x10(%rdi)
movl %edx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/adaptive_samples.cpp
// Function: CSA::AdaptiveSamples::trySample(std::pair<unsigned int, unsigned int>, unsigned int)
void
AdaptiveSamples::trySample(sample_type sample, usint offset)
{
  if(this->promote_probability > 0.0)
  {
    double temp = (this->promote_probability * this->window_size * offset) / this->sum;
    if(rand() / (RAND_MAX + 1.0) >= temp) { return; }
  }

  if(this->use_candidates) { this->addCandidate(sample); }
  else                     { this->addSample(sample); }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movsd 0x38(%rdi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x10ce3
movl 0x40(%r14), %eax
movl 0x48(%r14), %ecx
cvtsi2sd %rax, %xmm1
mulsd %xmm1, %xmm0
movl %edx, %eax
cvtsi2sd %rax, %xmm1
mulsd %xmm0, %xmm1
cvtsi2sd %rcx, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
callq 0x30b0
cvtsi2sd %eax, %xmm0
mulsd 0xa04c(%rip), %xmm0     # 0x1ad28
ucomisd (%rsp), %xmm0
jae 0x10d0e
cmpb $0x1, 0x34(%r14)
jne 0x10cfc
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x10e4e
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x107a4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/adaptive_samples.cpp
// Function: CSA::AdaptiveSamples::locate(std::pair<unsigned int, unsigned int>, bool)
usint*
AdaptiveSamples::locate(pair_type range, bool steps)
{
  if(length(range) == 0) { return 0; }

  usint* data = new usint[length(range)];
  for(usint i = 0, j = range.first; j <= range.second; i++, j++)
  {
    data[i] = this->locate(j, steps);
  }

  return data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rsi, %r12
shrq $0x20, %r12
movl %r12d, %eax
subl %ebx, %eax
xorl %r13d, %r13d
incl %eax
jne 0x10d4c
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %edx, %ebp
movq %rdi, %r14
movl %eax, %edi
shlq $0x2, %rdi
callq 0x3030
movq %rax, %r15
movzbl %bpl, %ebp
leal (%rbx,%r13), %esi
cmpl %r12d, %esi
ja 0x10d3a
movq %r14, %rdi
movl %ebp, %edx
callq 0x10ac6
movl %r13d, %ecx
movl %eax, (%r15,%rcx,4)
incl %r13d
jmp 0x10d63
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/adaptive_samples.cpp
// Function: CSA::AdaptiveSamples::display(std::pair<unsigned int, unsigned int>, unsigned char*)
void
AdaptiveSamples::display(pair_type range, uchar* data)
{
  if(!(this->supportsDisplay()) || isEmpty(range) || range.second >= this->index.getSize() || data == 0) { return; }

  pair_type res = this->regular_samples->inverseSA(range.first);
  usint i = res.first, pos = res.second;
  for(; i < range.first; i++)
  {
    pos = this->index.psi(pos);
    this->index.convertToSAIndex(pos);
  }
  for(; i <= range.second; i++)
  {
    data[i - range.first] = this->index.getCharacter(pos);
    pos = this->index.psi(pos);
    this->index.convertToSAIndex(pos);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbp
movq %rsi, %r13
shrq $0x20, %r13
cmpl %r13d, %ebp
setbe %al
andb 0x35(%rdi), %al
cmpb $0x1, %al
jne 0x10e3e
movq %rdx, %rbx
testq %rdx, %rdx
je 0x10e3e
movq %rdi, %r15
movq (%rdi), %rax
cmpl %r13d, 0x4(%rax)
jbe 0x10e3e
movq 0x28(%r15), %rdi
movl %ebp, %esi
callq 0xd4ea
movq %rax, %r12
shrq $0x20, %r12
movq %rax, (%rsp)
movl %eax, %r14d
cmpl %ebp, %r14d
jae 0x10dfb
movq (%r15), %rdi
movl %r12d, %esi
callq 0xb2ec
movl %eax, %r12d
movq (%r15), %rax
subl 0x820(%rax), %r12d
incl %r14d
jmp 0x10dd9
movq (%rsp), %rax
cmpl %ebp, %eax
movl %ebp, %r14d
cmoval %eax, %r14d
negl %ebp
cmpl %r13d, %r14d
ja 0x10e3e
movq (%r15), %rdi
movl %r12d, %esi
callq 0xb3c8
leal (%r14,%rbp), %ecx
movb %al, (%rbx,%rcx)
movq (%r15), %rdi
movl %r12d, %esi
callq 0xb2ec
movl %eax, %r12d
movq (%r15), %rax
subl 0x820(%rax), %r12d
incl %r14d
jmp 0x10e0a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/venGaza[P]starwars/src/main.cpp
// Function: main
int main() {
    welcomeMessage();
    
    Game game;
    while (!game.getExitGame()) {
        game.menu();
        game.resetGame();
    }
    
    cout << "Have a great holiday and may the force be with you! Make sure to check out "
         << "Star Wars: The Last Jedi" << endl << endl;
    
    return 0;
}

// Assembly:
pushq %rbx
subq $0x50, %rsp
callq 0x265c
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x42ac
movq %rbx, %rdi
callq 0x4a18
testb %al, %al
jne 0x2601
movq %rbx, %rdi
callq 0x432c
movq %rbx, %rdi
callq 0x4a1c
jmp 0x25e3
movq 0x99c8(%rip), %rdi      # 0xbfd0
leaq 0x39f5(%rip), %rsi      # 0x6004
callq 0x2150
leaq 0x3a35(%rip), %rsi      # 0x6050
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20b0
movq %rax, %rdi
callq 0x20b0
leaq 0x8(%rsp), %rdi
callq 0x4316
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
retq
jmp 0x2647
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4316
movq %rbx, %rdi
callq 0x2230
// File: /workspace/github_cpp_makefile_star2_O2/venGaza[P]starwars/src/StartSpace.cpp
// Function: StartSpace::StartSpace()
StartSpace::StartSpace() {
    Space::roomName = "Blast Site";
    Space::roomDescription= "It looks like an explosion just took place here. You don't remember what happened though.";
    
    Space::top = new Corridor;
    Space::top->setBottom(this);
    Space::bottom = new SnokeSpace;
    Space::bottom->setTop(this);
    Space::left = nullptr;
    Space::right = new CoreReactor;
    Space::right->setLeft(this);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x59f8
leaq 0x9404(%rip), %rax      # 0xbab0
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
leaq 0x3e4a(%rip), %rsi      # 0x6504
callq 0x2250
leaq 0x28(%rbx), %rdi
leaq 0x3a87(%rip), %rsi      # 0x6151
callq 0x2250
pushq $0x68
popq %rdi
callq 0x2160
movq %rax, %r15
movq %rax, %rdi
callq 0x3ab8
movq %r15, 0x48(%rbx)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5afc
pushq $0x68
popq %rdi
callq 0x2160
movq %rax, %r15
movq %rax, %rdi
callq 0x2a3c
movq %r15, 0x50(%rbx)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5af6
andq $0x0, 0x60(%rbx)
pushq $0x70
popq %rdi
callq 0x2160
movq %rax, %r15
movq %rax, %rdi
callq 0x2d50
movq %r15, 0x58(%rbx)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5b02
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
pushq $0x70
jmp 0x274e
jmp 0x2749
movq %rax, %r14
pushq $0x68
popq %rsi
movq %r15, %rdi
callq 0x2170
jmp 0x275c
movq %rax, %r14
movq %rbx, %rdi
callq 0x5a80
movq %r14, %rdi
callq 0x2230
// File: /workspace/github_cpp_makefile_star2_O2/venGaza[P]starwars/src/StartSpace.cpp
// Function: StartSpace::StartSpace(Space*, Space*, Space*, Space*)
StartSpace::StartSpace(Space* top, Space* bottom, Space* left, Space* right) {
    this->Space::top = top;
    this->Space::bottom = bottom;
    this->Space::left = left;
    this->Space::right = right;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
callq 0x59f8
leaq 0x9320(%rip), %rax      # 0xbab0
movq %rax, (%r13)
movq %r12, 0x48(%r13)
movq %r15, 0x50(%r13)
movq %r14, 0x60(%r13)
movq %rbx, 0x58(%r13)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/venGaza[P]starwars/src/StartSpace.cpp
// Function: StartSpace::printChoices()
void StartSpace::printChoices() {
    cout << "1) North - Mysterious Room" << endl
         << "2) East - Core Reactor"  << endl
         << "3) South - Mysterious Room" << endl
         << "4) Item Inventory " << endl
         << "5) Look around" << endl << endl;
}

// Assembly:
pushq %rax
movq 0x97a6(%rip), %rdi      # 0xbfd0
leaq 0x397a(%rip), %rsi      # 0x61ab
callq 0x2150
movq %rax, %rdi
callq 0x20b0
leaq 0x3981(%rip), %rsi      # 0x61c6
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20b0
leaq 0x3981(%rip), %rsi      # 0x61dd
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20b0
leaq 0x3985(%rip), %rsi      # 0x61f8
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20b0
leaq 0x3981(%rip), %rsi      # 0x620b
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20b0
movq %rax, %rdi
popq %rax
jmp 0x20b0
nop