LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/csMOOC[P]UIUC/EmulNet.cpp
// Function: EmulNet::operator=(EmulNet&)
EmulNet& EmulNet::operator =(EmulNet &anotherEmulNet) {
	int i, j;
	this->par = anotherEmulNet.par;
	this->enInited = anotherEmulNet.enInited;
	for ( i = 0; i < MAX_NODES; i++ ) {
		for ( j = 0; j < MAX_TIME; j++ ) {
			this->sent_msgs[i][j] = anotherEmulNet.sent_msgs[i][j];
			this->recv_msgs[i][j] = anotherEmulNet.recv_msgs[i][j];
		}
	}
	this->emulnet = anotherEmulNet.emulnet;
	return *this;
}

// Assembly:
movq %rdi, %rax
movq 0x8(%rsi), %rcx
movq %rcx, 0x8(%rdi)
movl 0x1b7e490(%rsi), %ecx
movl %ecx, 0x1b7e490(%rdi)
leaq 0x10(%rdi), %rcx
leaq 0xdbf250(%rsi), %rdx
xorl %edi, %edi
movl $0x3840, %r8d           # imm = 0x3840
xorl %r9d, %r9d
movl -0xdbf240(%rdx,%r9,4), %r10d
movl %r10d, (%rcx,%r9,4)
movl (%rdx,%r9,4), %r10d
movl %r10d, 0xdbf240(%rcx,%r9,4)
incq %r9
cmpq $0xe10, %r9             # imm = 0xE10
jne 0x34c1
incq %rdi
addq %r8, %rdx
addq %r8, %rcx
cmpq $0x3e8, %rdi            # imm = 0x3E8
jne 0x34be
movl 0x1b7e4a0(%rsi), %ecx
movl %ecx, 0x1b7e4a0(%rax)
movq 0x1b7e4a4(%rsi), %rcx
movq %rcx, 0x1b7e4a4(%rax)
testl %ecx, %ecx
jle 0x353a
movl %ecx, %ecx
addq $0x36fc96, %rcx         # imm = 0x36FC96
movq (%rsi,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
leaq -0x1(%rcx), %rdx
addq $-0x36fc96, %rcx        # imm = 0xFFC9036A
cmpq $0x1, %rcx
movq %rdx, %rcx
ja 0x351e
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/csMOOC[P]UIUC/EmulNet.cpp
// Function: EmulNet::ENrecv(Address*, int (*)(void*, char*, int), timeval*, int, void*)
int EmulNet::ENrecv(Address *myaddr, int (* enq)(void *, char *, int), struct timeval *t, int times, void *queue){
	// times is always assumed to be 1
	int i;
	char* tmp;
	int sz;
	en_msg *emsg;

	for( i = emulnet.currbuffsize - 1; i >= 0; i-- ) {
		emsg = emulnet.buff[i];

		if ( 0 == strcmp(emsg->to.addr, myaddr->addr) ) {
			sz = emsg->size;
			tmp = (char *) malloc(sz * sizeof(char));
			memcpy(tmp, (char *)(emsg+1), sz);

			emulnet.buff[i] = emulnet.buff[emulnet.currbuffsize-1];
			emulnet.currbuffsize--;

			(*enq)(queue, (char *)tmp, sz);

			free(emsg);

			int dst = *(int *)(myaddr->addr);
			int time = par->getcurrtime();

			assert(dst <= MAX_NODES);
			assert(time < MAX_TIME);

			recv_msgs[dst][time]++;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movslq 0x1b7e4a4(%rdi), %r14
testq %r14, %r14
jle 0x3865
movq %rsi, %r15
movq %rdi, %r12
leaq 0xdbf250(%rdi), %rax
movq %rax, (%rsp)
movq 0x1b7e4a8(%r12,%r14,8), %r13
leaq 0xa(%r13), %rdi
movq %r15, %rsi
callq 0x2250
testl %eax, %eax
jne 0x3854
movl (%r13), %eax
movslq %eax, %rbp
movq %rbp, %rdi
callq 0x2240
movq %rax, %rbx
leaq 0x10(%r13), %rsi
movq %rax, %rdi
movq %rbp, %rdx
callq 0x2130
movslq 0x1b7e4a4(%r12), %rax
leal -0x1(%rax), %ecx
movq 0x1b7e4a8(%r12,%rax,8), %rax
movq %rax, 0x1b7e4a8(%r12,%r14,8)
movl %ecx, 0x1b7e4a4(%r12)
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq *0x8(%rsp)
movq %r13, %rdi
callq 0x2210
movslq (%r15), %rbx
movq 0x8(%r12), %rdi
callq 0x4cf8
cmpq $0x3e9, %rbx            # imm = 0x3E9
jge 0x3895
cmpl $0xe10, %eax            # imm = 0xE10
jge 0x3876
cltq
imulq $0x3840, %rbx, %rcx     # imm = 0x3840
addq (%rsp), %rcx
incl (%rcx,%rax,4)
decq %r14
leaq 0x1(%r14), %rax
cmpq $0x1, %rax
ja 0x37b1
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x386f(%rip), %rdi      # 0x70ec
leaq 0x3825(%rip), %rsi      # 0x70a9
leaq 0x38b0(%rip), %rcx      # 0x713b
movl $0xaa, %edx
callq 0x20f0
leaq 0x388e(%rip), %rdi      # 0x712a
leaq 0x3806(%rip), %rsi      # 0x70a9
leaq 0x3891(%rip), %rcx      # 0x713b
movl $0xa9, %edx
callq 0x20f0
// File: /workspace/github_cpp_makefile_star2_O3/csMOOC[P]UIUC/EmulNet.cpp
// Function: EmulNet::ENcleanup()
int EmulNet::ENcleanup() {
	emulnet.nextid=0;
	int i, j;
	int sent_total, recv_total;

	FILE* file = fopen("msgcount.log", "w+");

	while(emulnet.currbuffsize > 0) {
		free(emulnet.buff[--emulnet.currbuffsize]);
	}

	for ( i = 1; i <= par->EN_GPSZ; i++ ) {
		fprintf(file, "node %3d ", i);
		sent_total = 0;
		recv_total = 0;

		for (j = 0; j < par->getcurrtime(); j++) {

			sent_total += sent_msgs[i][j];
			recv_total += recv_msgs[i][j];
			if (i != 67) {
				fprintf(file, " (%4d, %4d)", sent_msgs[i][j], recv_msgs[i][j]);
				if (j % 10 == 9) {
					fprintf(file, "\n         ");
				}
			}
			else {
				fprintf(file, "special %4d %4d %4d\n", j, sent_msgs[i][j], recv_msgs[i][j]);
			}
		}
		fprintf(file, "\n");
		fprintf(file, "node %3d sent_total %6u  recv_total %6u\n\n", i, sent_total, recv_total);
	}

	fclose(file);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r12
movl $0x0, 0x1b7e4a0(%rdi)
leaq 0x38c1(%rip), %rdi      # 0x7197
leaq 0x38c7(%rip), %rsi      # 0x71a4
callq 0x2200
movq %rax, %rbx
movl 0x1b7e4a4(%r12), %eax
testl %eax, %eax
jle 0x390a
decl %eax
movl %eax, 0x1b7e4a4(%r12)
movq 0x1b7e4b0(%r12,%rax,8), %rdi
callq 0x2210
jmp 0x38e5
movq 0x8(%r12), %rax
cmpl $0x0, 0x18(%rax)
jle 0x3a74
leaq 0xdc2a90(%r12), %rax
movq %rax, 0x10(%rsp)
movl $0x1, %eax
movq %r12, 0x20(%rsp)
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x3868(%rip), %rsi      # 0x71a7
movq %rax, 0x18(%rsp)
movq %rax, %rdx
xorl %eax, %eax
callq 0x2260
movq 0x8(%r12), %rdi
callq 0x4cf8
movl $0x0, %r13d
movl $0x0, %r15d
testl %eax, %eax
jle 0x3a24
xorl %ebp, %ebp
xorl %r15d, %r15d
xorl %r13d, %r13d
movq %rbp, %rax
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
mulq %rcx
movq 0x10(%rsp), %rax
movl -0xdbf240(%rax,%rbp,4), %r14d
movl (%rax,%rbp,4), %ebx
cmpq $0x43, 0x18(%rsp)
jne 0x39b9
movq 0x8(%rsp), %rdi
leaq 0x3820(%rip), %rsi      # 0x71c8
movl %ebp, %edx
movl %r14d, %ecx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x2260
jmp 0x3a06
shrq $0x3, %rdx
leaq (%rdx,%rdx,4), %rax
leaq 0x9(,%rax,2), %r12
movq 0x8(%rsp), %rdi
leaq 0x37dc(%rip), %rsi      # 0x71b1
movl %r14d, %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2260
cmpl %ebp, %r12d
movq 0x20(%rsp), %r12
jne 0x3a06
movl $0xa, %esi
movl $0x1, %edx
leaq 0x37c1(%rip), %rdi      # 0x71bd
movq 0x8(%rsp), %rcx
callq 0x2320
addl %r14d, %r13d
addl %ebx, %r15d
incq %rbp
movq 0x8(%r12), %rdi
callq 0x4cf8
cltq
cmpq %rax, %rbp
jl 0x3974
movl $0xa, %edi
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x2230
movq %rbx, %rdi
leaq 0x379d(%rip), %rsi      # 0x71dd
movq 0x18(%rsp), %r14
movl %r14d, %edx
movl %r13d, %ecx
movl %r15d, %r8d
xorl %eax, %eax
callq 0x2260
leaq 0x1(%r14), %rax
movq 0x8(%r12), %rcx
movslq 0x18(%rcx), %rcx
addq $0x3840, 0x10(%rsp)     # imm = 0x3840
cmpq %rcx, %r14
jl 0x3935
movq %rbx, %rdi
callq 0x2190
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/csMOOC[P]UIUC/Application.cpp
// Function: handler(int)
void handler(int sig) {
	void *array[10];
	size_t size;

	// get void*'s for all entries on the stack
	size = backtrace(array, 10);

	// print out all the frames to stderr
	fprintf(stderr, "Error: signal %d:\n", sig);
	backtrace_symbols_fd(array, size, STDERR_FILENO);
	exit(1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movl %edi, %ebx
movq %rsp, %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2280
movl %eax, %ebp
movq 0x7519(%rip), %rax      # 0xafd8
movq (%rax), %rdi
leaq 0x374b(%rip), %rsi      # 0x7214
movl %ebx, %edx
xorl %eax, %eax
callq 0x2260
movq %r14, %rdi
movl %ebp, %esi
movl $0x2, %edx
callq 0x22a0
movl $0x1, %edi
callq 0x2220
// File: /workspace/github_cpp_makefile_star2_O3/csMOOC[P]UIUC/Application.cpp
// Function: main
int main(int argc, char *argv[]) {
	//signal(SIGSEGV, handler);
	if ( argc != ARGS_COUNT ) {
		cout<<"Configuration (i.e., *.conf) file File Required"<<endl;
		return FAILURE;
	}

	// Create a new application object
	Application *app = new Application(argv[1]);
	// Call the run function
	app->run();
	// When done delete the application object
	delete(app);

	return SUCCESS;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x2, %edi
jne 0x3b25
movq %rsi, %r14
movl $0x48, %edi
callq 0x21a0
movq %rax, %rbx
movq 0x8(%r14), %rsi
movq %rax, %rdi
callq 0x3c0e
movq %rbx, %rdi
callq 0x3b8c
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
xorl %eax, %eax
jmp 0x3b6c
movq 0x74a4(%rip), %rbx      # 0xafd0
leaq 0x36f4(%rip), %rsi      # 0x7227
movl $0x2f, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movl $0x48, %esi
movq %rbx, %rdi
callq 0x21b0
movq %r14, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O3/csMOOC[P]UIUC/Application.cpp
// Function: Application::run()
int Application::run()
{
	int i;
	int timeWhenAllNodesHaveJoined = 0;
	// boolean indicating if all nodes have joined
	bool allNodesJoined = false;
	srand(time(NULL));

	// As time runs along
	for( par->globaltime = 0; par->globaltime < TOTAL_RUNNING_TIME; ++par->globaltime ) {
		// Run the membership protocol
		mp1Run();
		// Fail some nodes
		fail();
	}

	// Clean up
	en->ENcleanup();

	for(i=0;i<=par->EN_GPSZ-1;i++) {
		 mp1[i]->finishUpThisNode();
	}

	return SUCCESS;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %edi, %edi
callq 0x2150
movl %eax, %edi
callq 0x2170
movq 0x40(%rbx), %rax
movl $0x0, 0x28(%rax)
movq %rbx, %rdi
callq 0x3e8a
movq %rbx, %rdi
callq 0x40c4
movq 0x40(%rbx), %rax
movl 0x28(%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x28(%rax)
cmpl $0x2bb, %ecx            # imm = 0x2BB
jl 0x3bac
movq 0x28(%rbx), %rdi
callq 0x38b4
movq 0x40(%rbx), %rax
cmpl $0x0, 0x18(%rax)
jle 0x3c04
xorl %r14d, %r14d
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x284c
incq %r14
movq 0x40(%rbx), %rax
movslq 0x18(%rax), %rax
cmpq %rax, %r14
jl 0x3be7
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/csMOOC[P]UIUC/Application.cpp
// Function: Application::Application(char*)
Application::Application(char *infile) {
	int i;
	par = new Params();
	srand (time(NULL));
	par->setparams(infile);
	log = new Log(par);
	en = new EmulNet(par);
	mp1 = (MP1Node **) malloc(par->EN_GPSZ * sizeof(MP1Node *));

	/*
	 * Init all nodes
	 */
	for( i = 0; i < par->EN_GPSZ; i++ ) {
		Member *memberNode = new Member;
		memberNode->inited = false;
		Address *addressOfMemberNode = new Address();
		Address joinaddr;
		joinaddr = getjoinaddr();
		addressOfMemberNode = (Address *) en->ENinit(addressOfMemberNode, par->PORTNUM);
		mp1[i] = new MP1Node(memberNode, par, en, log, addressOfMemberNode);
		log->LOG(&(mp1[i]->getMemberNode()->addr), "APP");
		delete addressOfMemberNode;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x7107(%rip), %rax      # 0xad30
movq %rax, (%rdi)
movl $0x38, %edi
callq 0x21a0
movq %rax, %r15
movq %rax, %rdi
callq 0x4c38
movq %r15, 0x40(%rbx)
xorl %edi, %edi
callq 0x2150
movl %eax, %edi
callq 0x2170
movq 0x40(%rbx), %rdi
movq %r14, %rsi
callq 0x4c40
movl $0x18, %edi
callq 0x21a0
movq %rax, %r14
movq 0x40(%rbx), %rsi
movq %rax, %rdi
callq 0x47a4
movq %r14, 0x30(%rbx)
movl $0x1bb8e30, %edi        # imm = 0x1BB8E30
callq 0x21a0
movq %rax, %r14
movq 0x40(%rbx), %rsi
movq %rax, %rdi
callq 0x336c
movq %r14, 0x28(%rbx)
movq 0x40(%rbx), %rax
movslq 0x18(%rax), %r14
leaq (,%r14,8), %rdi
callq 0x2240
movq %rax, 0x38(%rbx)
testq %r14, %r14
jle 0x3d8f
leaq 0x3595(%rip), %r12      # 0x7257
xorl %r15d, %r15d
movl $0x98, %edi
callq 0x21a0
movq %rax, %r13
movq %rax, %rdi
callq 0x4212
movb $0x0, 0xe(%r13)
movl $0x6, %edi
callq 0x21a0
movq %rax, %r14
movl $0x1, 0xc(%rsp)
movw $0x0, 0x10(%rsp)
leaq 0x12(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x4d12
movq 0x28(%rbx), %rdi
movq 0x40(%rbx), %rax
movswl 0x30(%rax), %edx
movq %r14, %rsi
callq 0x3548
movq %rax, %rbp
movl $0x30, %edi
callq 0x21a0
movq %rax, %r14
movq 0x40(%rbx), %rdx
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %r8
movq %rax, %rdi
movq %r13, %rsi
movq %rbp, %r9
callq 0x25e6
movq 0x38(%rbx), %rax
movq %r14, (%rax,%r15,8)
movq 0x30(%rbx), %rdi
movq 0x38(%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0x20(%rax), %rsi
addq $0x8, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x47f0
movl $0x6, %esi
movq %rbp, %rdi
callq 0x21b0
incq %r15
movq 0x40(%rbx), %rax
movslq 0x18(%rax), %rax
cmpq %rax, %r15
jl 0x3cc5
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x1bb8e30, %esi        # imm = 0x1BB8E30
jmp 0x3dd4
movq %rax, %rbx
movl $0x18, %esi
jmp 0x3dd4
movq %rax, %rbx
movl $0x38, %esi
movq %r15, %rdi
jmp 0x3dd7
movq %rax, %rbx
movl $0x98, %esi
movq %r13, %rdi
jmp 0x3dd7
movq %rax, %rbx
movl $0x30, %esi
movq %r14, %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O3/csMOOC[P]UIUC/Application.cpp
// Function: Application::~Application()
Application::~Application() {
	delete log;
	delete en;
	for ( int i = 0; i < par->EN_GPSZ; i++ ) {
		delete mp1[i];
	}
	free(mp1);
	delete par;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x6f2e(%rip), %rax      # 0xad30
movq %rax, (%rdi)
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x3e14
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x3e23
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x40(%rbx), %rax
cmpl $0x0, 0x18(%rax)
jle 0x3e53
xorl %r14d, %r14d
movq 0x38(%rbx), %rcx
movq (%rcx,%r14,8), %rdi
testq %rdi, %rdi
je 0x3e47
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x40(%rbx), %rax
incq %r14
movslq 0x18(%rax), %rcx
cmpq %rcx, %r14
jl 0x3e30
movq 0x38(%rbx), %rdi
callq 0x2210
movq 0x40(%rbx), %rdi
movl $0x38, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/csMOOC[P]UIUC/Application.cpp
// Function: Application::fail()
void Application::fail() {
	int i, removed;

	// fail half the members at time t=400
	if( par->DROP_MSG && par->getcurrtime() == 50 ) {
		par->dropmsg = 1;
	}

	if( par->SINGLE_FAILURE && par->getcurrtime() == 100 ) {
		removed = (rand() % par->EN_GPSZ);
		#ifdef DEBUGLOG
		log->LOG(&mp1[removed]->getMemberNode()->addr, "Node failed at time=%d", par->getcurrtime());
		#endif
		mp1[removed]->getMemberNode()->bFailed = true;
	}
	else if( par->getcurrtime() == 100 ) {
		removed = rand() % par->EN_GPSZ/2;
		for ( i = removed; i < removed + par->EN_GPSZ/2; i++ ) {
			#ifdef DEBUGLOG
			log->LOG(&mp1[i]->getMemberNode()->addr, "Node failed at time = %d", par->getcurrtime());
			#endif
			mp1[i]->getMemberNode()->bFailed = true;
		}
	}

	if( par->DROP_MSG && par->getcurrtime() == 300) {
		par->dropmsg=0;
	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x40(%rdi), %rdi
cmpl $0x0, 0x20(%rdi)
je 0x40f1
callq 0x4cf8
movq 0x40(%rbx), %rdi
cmpl $0x32, %eax
jne 0x40f1
movl $0x1, 0x24(%rdi)
cmpl $0x0, 0x4(%rdi)
je 0x4159
callq 0x4cf8
cmpl $0x64, %eax
jne 0x4155
callq 0x2060
movq 0x40(%rbx), %rdi
cltd
idivl 0x18(%rdi)
movq 0x30(%rbx), %r14
movq 0x38(%rbx), %rax
movslq %edx, %r12
movq (%rax,%r12,8), %rax
movq 0x20(%rax), %r15
addq $0x8, %r15
callq 0x4cf8
leaq 0x3167(%rip), %rdx      # 0x7298
movq %r14, %rdi
movq %r15, %rsi
movl %eax, %ecx
xorl %eax, %eax
callq 0x47f0
movq 0x38(%rbx), %rax
movq (%rax,%r12,8), %rax
movq 0x20(%rax), %rax
movb $0x1, 0x10(%rax)
jmp 0x41e2
movq 0x40(%rbx), %rdi
callq 0x4cf8
cmpl $0x64, %eax
jne 0x41e2
callq 0x2060
movq 0x40(%rbx), %rdi
movl 0x18(%rdi), %ecx
cltd
idivl %ecx
cmpl $0x2, %ecx
jl 0x41e2
movl %edx, %ebp
shrl $0x1f, %ebp
addl %edx, %ebp
sarl %ebp
movslq %ebp, %r13
movq 0x38(%rbx), %rax
leaq 0x3121(%rip), %r14      # 0x72af
movq 0x30(%rbx), %r15
movq (%rax,%r13,8), %rax
movq 0x20(%rax), %r12
addq $0x8, %r12
callq 0x4cf8
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0x47f0
movq 0x38(%rbx), %rax
movq (%rax,%r13,8), %rcx
movq 0x20(%rcx), %rcx
movb $0x1, 0x10(%rcx)
incq %r13
movq 0x40(%rbx), %rdi
movl 0x18(%rdi), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
addl %ebp, %edx
movslq %edx, %rcx
cmpq %rcx, %r13
jl 0x418e
movq 0x40(%rbx), %rdi
cmpl $0x0, 0x20(%rdi)
je 0x4203
callq 0x4cf8
cmpl $0x12c, %eax            # imm = 0x12C
jne 0x4203
movq 0x40(%rbx), %rax
movl $0x0, 0x24(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/csMOOC[P]UIUC/Params.cpp
// Function: Params::setparams(char*)
void Params::setparams(char *config_file) {
	FILE *fp = fopen(config_file,"r");

	fscanf(fp,"MAX_NNB: %d", &MAX_NNB);
	fscanf(fp,"\nSINGLE_FAILURE: %d", &SINGLE_FAILURE);
	fscanf(fp,"\nDROP_MSG: %d", &DROP_MSG);
	fscanf(fp,"\nMSG_DROP_PROB: %lf", &MSG_DROP_PROB);

	//printf("Parameters of the test case: %d %d %d %lf\n", MAX_NNB, SINGLE_FAILURE, DROP_MSG, MSG_DROP_PROB);

	EN_GPSZ = MAX_NNB;
	STEP_RATE=.25;
	MAX_MSG_SIZE = 4000;
	globaltime = 0;
	dropmsg = 0;
	allNodesJoined = 0;
	for ( unsigned int i = 0; i < EN_GPSZ; i++ ) {
		allNodesJoined += i;
	}
	fclose(fp);
	return;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x2800(%rip), %rsi      # 0x7451
movq %rax, %rdi
callq 0x2200
movq %rax, %r14
leaq 0x27f0(%rip), %rsi      # 0x7453
xorl %ebp, %ebp
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2300
leaq 0x4(%rbx), %rdx
leaq 0x27e2(%rip), %rsi      # 0x745f
movq %r14, %rdi
xorl %eax, %eax
callq 0x2300
leaq 0x20(%rbx), %rdx
leaq 0x27e1(%rip), %rsi      # 0x7473
movq %r14, %rdi
xorl %eax, %eax
callq 0x2300
leaq 0x8(%rbx), %rdx
leaq 0x27da(%rip), %rsi      # 0x7481
movq %r14, %rdi
xorl %eax, %eax
callq 0x2300
movl (%rbx), %eax
movl %eax, 0x18(%rbx)
movabsq $0x3fd0000000000000, %rcx # imm = 0x3FD0000000000000
movq %rcx, 0x10(%rbx)
movl $0xfa0, 0x1c(%rbx)      # imm = 0xFA0
movq $0x0, 0x24(%rbx)
testl %eax, %eax
je 0x4ce9
leal -0x1(%rax), %ecx
leal -0x2(%rax), %edx
imulq %rcx, %rdx
shrq %rdx
leal (%rax,%rdx), %ebp
decl %ebp
movl %ebp, 0x2c(%rbx)
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2190
// File: /workspace/github_cpp_makefile_star2_O3/csMOOC[P]UIUC/Member.cpp
// Function: Member::Member(Member const&)
Member::Member(const Member &anotherMember) {
	this->addr = anotherMember.addr;
	this->inited = anotherMember.inited;
	this->inGroup = anotherMember.inGroup;
	this->bFailed = anotherMember.bFailed;
	this->nnb = anotherMember.nnb;
	this->heartbeat = anotherMember.heartbeat;
	this->pingCounter = anotherMember.pingCounter;
	this->timeOutCounter = anotherMember.timeOutCounter;
	this->memberList = anotherMember.memberList;
	this->myPos = anotherMember.myPos;
	this->mp1q = anotherMember.mp1q;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x5f99(%rip), %rax      # 0xad60
movq %rax, (%rdi)
leaq 0x28(%rdi), %r14
leaq 0x48(%rdi), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x38(%rdi)
movups %xmm0, 0x48(%rdi)
movups %xmm0, 0x58(%rdi)
movups %xmm0, 0x68(%rdi)
movups %xmm0, 0x78(%rdi)
movups %xmm0, 0x88(%rdi)
movq %r15, %rdi
xorl %esi, %esi
callq 0x4582
movzwl 0xc(%r12), %eax
movw %ax, 0xc(%rbx)
movl 0x8(%r12), %eax
movl %eax, 0x8(%rbx)
movb 0xe(%r12), %al
movb %al, 0xe(%rbx)
movb 0xf(%r12), %al
movb %al, 0xf(%rbx)
movb 0x10(%r12), %al
movb %al, 0x10(%rbx)
movl 0x14(%r12), %eax
movl %eax, 0x14(%rbx)
movq 0x18(%r12), %rax
movq %rax, 0x18(%rbx)
movq 0x20(%r12), %rax
movq %rax, 0x20(%rbx)
leaq 0x28(%r12), %rsi
movq %r14, %rdi
callq 0x4f10
movq 0x40(%r12), %rax
movq %rax, 0x40(%rbx)
addq $0x48, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x507e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r12
jmp 0x4e83
movq %rax, %r12
movq %r15, %rdi
callq 0x46de
movq (%r14), %rdi
testq %rdi, %rdi
je 0x4e97
movq 0x38(%rbx), %rsi
subq %rdi, %rsi
callq 0x21b0
movq %r12, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/client_files/client.cpp
// Function: close_handler(int)
void close_handler(int s){
	cout<<endl<<"Terminating.."<<endl;
	server_socket.closeConnection();
	KeyManager::destroyKeys();
	exit(s);

}

// Assembly:
pushq %rbx
movl %edi, %ebx
movq 0xb2aa(%rip), %rdi      # 0xffc0
callq 0x41e0
leaq 0x62e2(%rip), %rsi      # 0xb004
movq %rax, %rdi
callq 0x4420
movq %rax, %rdi
callq 0x41e0
leaq 0xb827(%rip), %rdi      # 0x10560
callq 0x6b44
callq 0xa154
movl %ebx, %edi
callq 0x4560
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/client_files/client.cpp
// Function: setup_sockaddr(char*, int)
struct sockaddr_in setup_sockaddr(char *ip,int port){

	struct sockaddr_in sv_addr;

	memset(&sv_addr,0,sizeof(sv_addr));

	sv_addr.sin_family = AF_INET;
	sv_addr.sin_port = htons(port);
	inet_pton(AF_INET,ip,&sv_addr.sin_addr);
	return sv_addr;

}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rax
leaq 0x4(%rsp), %rbx
movl $0x0, 0x8(%rbx)
movq $0x0, (%rbx)
movw $0x2, -0x4(%rbx)
rolw $0x8, %si
movw %si, -0x2(%rbx)
movl $0x2, %edi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x4850
movq -0x4(%rbx), %rax
movq 0x4(%rbx), %rdx
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/client_files/client.cpp
// Function: cmd_quit()
void cmd_quit(){

	cout<<"Closing Connection"<<endl;
	KeyManager::destroyKeys();
	server_socket.closeConnection();
	exit(0);

}

// Assembly:
pushq %rax
movq 0xb082(%rip), %rdi      # 0xffc0
leaq 0x61b3(%rip), %rsi      # 0xb0f8
callq 0x4420
movq %rax, %rdi
callq 0x41e0
callq 0xa154
leaq 0xb602(%rip), %rdi      # 0x10560
callq 0x6b44
xorl %edi, %edi
callq 0x4560
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/client_files/client.cpp
// Function: send_command(unsigned int)
bool send_command(uint32_t command){

	EncryptManager em;

	Chunk c;
	c.setInt(command);
	c.size = 4;

	EncryptedChunk ec;

	if(!em.EncryptUpdate(ec,c)) 	return false;
	if(!em.EncryptFinal(ec))		return false;

	if(!sendDataHMAC(server_socket,ec.getCipherText(),ec.size)){			//aggiorno il nonce
		cout<<"[Error] send"<<endl;
		return false;
	}

	return true;
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
movl %edi, 0xc(%rsp)
movq %rsp, %rdi
callq 0x7eb4
leaq 0x28(%rsp), %rdi
callq 0xa2d0
leaq 0x28(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0xa38c
movl $0x4, 0x38(%rsp)
leaq 0x10(%rsp), %rdi
callq 0xa3c2
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x7fb2
testb %al, %al
je 0x5036
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
callq 0x8030
testb %al, %al
je 0x5036
leaq 0x10(%rsp), %rdi
callq 0xa43e
movl 0x20(%rsp), %edx
leaq 0xb57e(%rip), %rdi      # 0x10560
movq %rax, %rsi
callq 0x71a2
movb $0x1, %bl
testb %al, %al
jne 0x5038
movq 0xafc9(%rip), %rbx      # 0xffc0
leaq 0x610d(%rip), %rsi      # 0xb10b
movl $0xc, %edx
movq %rbx, %rdi
callq 0x44e0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x4410
movsbl %al, %esi
movq 0xaf97(%rip), %rdi      # 0xffc0
callq 0x4040
movq %rax, %rdi
callq 0x42f0
xorl %ebx, %ebx
leaq 0x10(%rsp), %rdi
callq 0xa3d6
leaq 0x28(%rsp), %rdi
callq 0xa2e4
movq %rsp, %rdi
callq 0x7f3e
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
retq
jmp 0x505e
movq %rax, %rbx
jmp 0x5075
movq %rax, %rbx
jmp 0x507f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xa3d6
leaq 0x28(%rsp), %rdi
callq 0xa2e4
movq %rsp, %rdi
callq 0x7f3e
movq %rbx, %rdi
callq 0x47d0
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/client_files/client.cpp
// Function: cmd_get()
bool cmd_get(){

	//if(!server_socket.sendInt(GET_COMMAND)) return;
	if(!send_command(GET_COMMAND)) return false;
	string filename;
	cin >> setw(MAX_FILENAME_LENGTH) >> filename;

	//clears the overflow, if any
	pulisci_buff();

	string path(CLIENT_PATH);

	EncryptManager em;
	Chunk c;
	c.setPlainText((char*)filename.c_str(),false);		//i don't need to free memory
	c.size = filename.size()+1;

	EncryptedChunk ec;

	if(!em.EncryptUpdate(ec,c)) return false;
	if(!em.EncryptFinal(ec))	return false;


	if(!sendDataHMAC(server_socket,ec.getCipherText(),ec.size)) return false;			
	if(!ReceiveFile(path,filename,server_socket,public_key_rsa,true)){
		//cout << "[Error] ReceiveFile" << endl;
		return false;
	}
	else{
		//cout << "[LOG] ReceiveFile Correct" << endl;
		return true;
	}
	
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movl $0x2, %edi
callq 0x4f6a
testb %al, %al
je 0x59a3
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
movq 0xa72f(%rip), %rdi      # 0xffd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x64, 0x10(%rdi,%rax)
leaq 0x28(%rsp), %rsi
callq 0x45b0
movq 0xa70e(%rip), %rdi      # 0xffd0
movabsq $0x7fffffffffffffff, %rsi # imm = 0x7FFFFFFFFFFFFFFF
movl $0xa, %edx
callq 0x42b0
leaq 0x70(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x589d(%rip), %rsi      # 0xb183
leaq 0x58ac(%rip), %rdx      # 0xb199
leaq 0x60(%rsp), %rdi
callq 0x6a90
leaq 0x8(%rsp), %rdi
callq 0x7eb4
leaq 0x48(%rsp), %rdi
callq 0xa2d0
movq 0x28(%rsp), %rsi
leaq 0x48(%rsp), %rdi
xorl %edx, %edx
callq 0xa358
movl 0x30(%rsp), %eax
incl %eax
movl %eax, 0x58(%rsp)
leaq 0x10(%rsp), %rdi
callq 0xa3c2
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x7fb2
testb %al, %al
je 0x59a7
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x8030
testb %al, %al
je 0x59a7
leaq 0x10(%rsp), %rdi
callq 0xa43e
movl 0x20(%rsp), %edx
leaq 0xabf0(%rip), %rdi      # 0x10560
movq %rax, %rsi
callq 0x71a2
testb %al, %al
je 0x59a7
leaq 0xabdd(%rip), %rdx      # 0x10560
leaq 0xabce(%rip), %rcx      # 0x10558
leaq 0x60(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movl $0x1, %r8d
callq 0x8fcd
movl %eax, %ebx
jmp 0x59a9
xorl %ebx, %ebx
jmp 0x59f5
xorl %ebx, %ebx
leaq 0x10(%rsp), %rdi
callq 0xa3d6
leaq 0x48(%rsp), %rdi
callq 0xa2e4
leaq 0x8(%rsp), %rdi
callq 0x7f3e
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x59de
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4450
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x59f5
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4450
movl %ebx, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x5a06
movq %rax, %rbx
jmp 0x5a29
movq %rax, %rbx
jmp 0x5a33
movq %rax, %rbx
jmp 0x5a3d
jmp 0x5a17
movq %rax, %rbx
jmp 0x5a54
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xa3d6
leaq 0x48(%rsp), %rdi
callq 0xa2e4
leaq 0x8(%rsp), %rdi
callq 0x7f3e
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x5a54
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4450
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x5a6b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4450
movq %rbx, %rdi
callq 0x47d0
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/client_files/client.cpp
// Function: select_command(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool select_command(string &buffer){


	if(buffer.compare("!help") == 0){
		return cmd_help();
	} else if(buffer.compare("!list") == 0){
		return cmd_list();
	} else if(buffer.compare("!quit") == 0){
		cmd_quit();
		return true;							//will never reach here
	} else if(buffer.compare("!get") == 0){
		return cmd_get();
	} else if (buffer.compare("!upload") == 0){
		return cmd_upload();
	} else {
		cout<<">"<<buffer<<"<"<<endl;
		cout<<"Invalid Command"<<endl;
	//	exit(-1);
		pulisci_buff();
		return true;
	}


}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x5776(%rip), %rsi      # 0xb1f7
callq 0x4120
testl %eax, %eax
je 0x5baa
leaq 0x5768(%rip), %rsi      # 0xb1fd
movq %r14, %rdi
callq 0x4120
testl %eax, %eax
je 0x5bb9
leaq 0x5757(%rip), %rsi      # 0xb203
movq %r14, %rdi
callq 0x4120
testl %eax, %eax
je 0x5bdd
leaq 0x5746(%rip), %rsi      # 0xb209
movq %r14, %rdi
callq 0x4120
testl %eax, %eax
je 0x5bc5
leaq 0x5734(%rip), %rsi      # 0xb20e
movq %r14, %rdi
callq 0x4120
testl %eax, %eax
je 0x5bd1
movq 0xa4cf(%rip), %rbx      # 0xffc0
leaq 0x571e(%rip), %rsi      # 0xb216
movl $0x1, %edx
movq %rbx, %rdi
callq 0x44e0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x44e0
movq %rax, %r14
leaq 0x56fa(%rip), %rsi      # 0xb218
movl $0x1, %edx
movq %rax, %rdi
callq 0x44e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4410
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x42f0
leaq 0x56c1(%rip), %rsi      # 0xb21a
movl $0xf, %edx
movq %rbx, %rdi
callq 0x44e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4410
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x42f0
movq 0xa43c(%rip), %rdi      # 0xffd0
movabsq $0x7fffffffffffffff, %rsi # imm = 0x7FFFFFFFFFFFFFFF
movl $0xa, %edx
callq 0x42b0
jmp 0x5baf
callq 0x4e01
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x508f
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5867
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5527
callq 0x4f36
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/library/library.cpp
// Function: NetSocket::sendInt(int)
bool NetSocket::sendInt(int value){
	if(isClosed)
		return false;

	int status;
	uint32_t tosend;

	tosend = htonl(value);
	//status = send(sd, &tosend, sizeof(uint32_t), 0);
	status = sendto(this->socket, &tosend, sizeof(int32_t), 0,NULL,0);
	if(status < (int)sizeof(int32_t))	{
		perror("[Error] send");
		return false;
	}

	return (status==sizeof(uint32_t));

}

// Assembly:
cmpb $0x0, 0x4(%rdi)
je 0x6b65
xorl %eax, %eax
retq
pushq %rax
bswapl %esi
leaq 0x4(%rsp), %rax
movl %esi, (%rax)
movl (%rdi), %edi
movl $0x4, %edx
movq %rax, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4080
cmpl $0x3, %eax
jle 0x6b9b
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl $0x4, %eax
sete %al
addq $0x8, %rsp
retq
leaq 0x4569(%rip), %rdi      # 0xb10b
callq 0x43b0
xorl %eax, %eax
jmp 0x6b96
nop
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/library/library.cpp
// Function: NetSocket::utilitySend(char const*, unsigned int)
bool NetSocket::utilitySend(const char* buffer,uint32_t len){

	if(isClosed)
		return false;

	uint32_t inviati = 0;
	int32_t ret =  0;

	while(inviati < len){

		ret = sendto(this->socket,buffer+inviati,len-inviati,0,NULL,0);
		if(ret == -1){
			perror("[Error] send");
			return false;
		} 
		inviati += ret;
	}
	
	return (inviati == len);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
cmpb $0x0, 0x4(%rdi)
jne 0x6bf2
movl %edx, %ebp
testl %edx, %edx
je 0x6bed
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
movl (%r15), %edi
movl %ebx, %esi
addq %r14, %rsi
movl %ebp, %edx
subl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4080
cmpl $-0x1, %eax
je 0x6bff
addl %eax, %ebx
cmpl %ebp, %ebx
jb 0x6bc9
cmpl %ebp, %ebx
sete %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4505(%rip), %rdi      # 0xb10b
callq 0x43b0
xorl %ebx, %ebx
jmp 0x6bf2
nop
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/library/library.cpp
// Function: NetSocket::utilityRecv(char*, unsigned int)
bool NetSocket::utilityRecv(char* buffer,uint32_t len){
	uint32_t ricevuti = 0;
	int ret = 0;

	while(ricevuti < len){ 										//posso leggere meno byte
		ret = recvfrom(this->socket,buffer+ricevuti,len-ricevuti,0,NULL,0);
		if(ret == -1){
			perror("[Error] recv");
			return false;	
		}
		ricevuti += ret;
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movb $0x1, %bl
testl %edx, %edx
je 0x6c51
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
movl (%r15), %edi
movl %r12d, %esi
addq %r14, %rsi
movl %ebp, %edx
subl %r12d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4360
cmpl $-0x1, %eax
je 0x6c5c
addl %eax, %r12d
cmpl %ebp, %r12d
jb 0x6c29
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x47f6(%rip), %rdi      # 0xb459
callq 0x43b0
xorl %ebx, %ebx
jmp 0x6c51
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/library/library.cpp
// Function: NetSocket::recvInt(int&)
bool NetSocket::recvInt(int &val){

	int ret,tmp;

	ret = recvfrom(this->socket,&tmp,sizeof(uint32_t),0,NULL,0);
	if(ret < (int)sizeof(uint32_t)){
		perror("[Error] recv");
		return 0;
	}

	val = ntohl(tmp);

	return (ret == (int)sizeof(uint32_t));

}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movl (%rdi), %edi
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4360
cmpl $0x3, %eax
jle 0x6cde
movl 0xc(%rsp), %ecx
bswapl %ecx
movl %ecx, (%rbx)
cmpl $0x4, %eax
sete %al
addq $0x10, %rsp
popq %rbx
retq
leaq 0x4774(%rip), %rdi      # 0xb459
callq 0x43b0
xorl %eax, %eax
jmp 0x6cd8
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/library/library.cpp
// Function: get_file_list[abi:cxx11](char const*)
vector<string> get_file_list(const char* path){

	DIR* folder = opendir(path);
	struct dirent* dp;
	vector <string> result;

	while( (dp = readdir(folder)) != NULL){						//WARNING SICUREZZA
		char *filename = dp->d_name;
		if(filename[0] == '.')
			continue;
		result.push_back(filename);
	}

	closedir(folder);
	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x46b0
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
leaq 0x10(%rsp), %r13
movq %rsp, %r15
movq %r14, %rdi
callq 0x46c0
movq %rax, %r12
testq %rax, %rax
je 0x6d79
cmpb $0x2e, 0x13(%r12)
je 0x6d1f
addq $0x13, %r12
movq %r13, (%rsp)
movq %r12, %rdi
callq 0x41c0
leaq (%rax,%r12), %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x6a90
movq %rbx, %rdi
movq %r15, %rsi
callq 0x73f4
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x6d1f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4450
jmp 0x6d1f
movq %r14, %rdi
callq 0x4720
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x6daf
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x6db2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4450
jmp 0x6db2
movq %rax, %r14
movq %rbx, %rdi
callq 0x6942
movq %r14, %rdi
callq 0x47d0
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/library/library.cpp
// Function: split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<string> split (string s, string delimiter) {
    size_t pos_start = 0, pos_end, delim_len = delimiter.length();
    string token;
    vector<string> res;

    while ((pos_end = s.find (delimiter, pos_start)) != string::npos) {
        token = s.substr (pos_start, pos_end - pos_start);
        pos_start = pos_end + delim_len;
        res.push_back (token);
    }

    res.push_back (s.substr (pos_start));
    return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq 0x8(%rdx), %rax
movq %rax, 0x30(%rsp)
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
xorl %ebx, %ebx
movq %rbx, -0x8(%rax)
movb $0x0, (%rax)
movq %rbx, 0x10(%rdi)
xorps %xmm0, %xmm0
movq %rdi, 0x8(%rsp)
movups %xmm0, (%rdi)
leaq 0x10(%rsp), %r12
leaq 0x38(%rsp), %r13
movq (%r15), %rsi
movq 0x8(%r15), %rcx
movq %r14, %rdi
movq %rbx, %rdx
callq 0x47c0
cmpq $-0x1, %rax
je 0x6e77
movq %rax, %rbp
movq %rax, %rcx
subq %rbx, %rcx
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4460
movq %r13, %rdi
movq %r12, %rsi
callq 0x4570
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x6e60
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4450
addq 0x30(%rsp), %rbp
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x73ac
movq %rbp, %rbx
jmp 0x6e0a
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq $-0x1, %rcx
callq 0x4460
leaq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x73f4
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x6eb9
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4450
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x6ed5
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4450
movq 0x8(%rsp), %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x6f11
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4450
jmp 0x6f11
jmp 0x6f0e
jmp 0x6f0e
movq %rax, %r14
movq 0x8(%rsp), %rdi
callq 0x6942
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x6f37
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4450
movq %r14, %rdi
callq 0x47d0
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/library/library.cpp
// Function: sendIntHMAC(NetSocket&, int)
bool sendIntHMAC(NetSocket& sender_socket,int32_t value){

	if(!sender_socket.sendInt(value))
		return false;

	HMACManager hm;

	Chunk c;
	c.setPlainText((char*)&value,false);
	c.size = sizeof(uint32_t);
	hm.HMACUpdate(c);

	char *digest = hm.HMACFinal(LOCAL_NONCE);

	if(digest == NULL) return false;
	bool return_value;

	return_value = sender_socket.sendData(digest,HASH_SIZE);

	delete[] digest;

	return return_value;

}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl %esi, 0xc(%rsp)
callq 0x6b5c
testb %al, %al
je 0x6fbb
movq %rsp, %rdi
callq 0x8284
leaq 0x10(%rsp), %rdi
callq 0xa2d0
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rsi
xorl %edx, %edx
callq 0xa358
leaq 0x10(%rsp), %rsi
movl $0x4, 0x10(%rsi)
movq %rsp, %rdi
callq 0x832e
movq %rsp, %rdi
xorl %esi, %esi
callq 0x8398
movq %rax, %r14
testq %rax, %rax
je 0x6fbf
movq %rbx, %rdi
movq %r14, %rsi
movl $0x20, %edx
callq 0x6bac
movl %eax, %ebx
movq %r14, %rdi
callq 0x45c0
jmp 0x6fc1
xorl %ebx, %ebx
jmp 0x6fd3
xorl %ebx, %ebx
leaq 0x10(%rsp), %rdi
callq 0xa2e4
movq %rsp, %rdi
callq 0x8466
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
jmp 0x6fe6
jmp 0x6fe6
movq %rax, %rbx
jmp 0x6ff3
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xa2e4
movq %rsp, %rdi
callq 0x8466
movq %rbx, %rdi
callq 0x47d0
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/library/library.cpp
// Function: recvIntHMAC(NetSocket&, int&)
bool recvIntHMAC(NetSocket& receiver_socket,int32_t& value){

	if(!receiver_socket.recvInt(value))
		return false;

	char *received_digest = receiver_socket.recvData(HASH_SIZE);
	if(received_digest == NULL)
		return false;


	HMACManager hm;
	Chunk c;
	c.size = sizeof(uint32_t);
	c.setPlainText((char*)&value,false);

	hm.HMACUpdate(c);
	char *digest = hm.HMACFinal(REMOTE_NONCE);

	if(digest == NULL){
		return false;
	}

	bool result;

	if(CRYPTO_memcmp(received_digest,digest,HASH_SIZE)){
		cout<<"HASH DIVERSI"<<endl;
		cout<<"Ricevuto:"<<endl;
		//close connection
		result = false;
	} else {
		result = true;
	}

	delete[] digest;
	delete[] received_digest;
	return result;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %r15
callq 0x6ca4
testb %al, %al
je 0x7153
movl $0x20, %edi
callq 0x4030
movq %rax, %rbx
movq %r15, %rdi
movq %rax, %rsi
movl $0x20, %edx
callq 0x6c10
testb %al, %al
je 0x7153
leaq 0x8(%rsp), %rdi
callq 0x8284
leaq 0x10(%rsp), %rdi
callq 0xa2d0
leaq 0x10(%rsp), %rdi
movl $0x4, 0x10(%rdi)
movq %r14, %rsi
xorl %edx, %edx
callq 0xa358
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x832e
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0x8398
movq %rax, %r14
testq %rax, %rax
je 0x7157
movl $0x20, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x47e0
testl %eax, %eax
sete %bpl
je 0x7141
movq 0x8f04(%rip), %r15      # 0xffc0
leaq 0x43a3(%rip), %rsi      # 0xb466
movl $0xc, %edx
movq %r15, %rdi
callq 0x44e0
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x4410
movsbl %al, %esi
movq 0x8ed2(%rip), %rdi      # 0xffc0
callq 0x4040
movq %rax, %rdi
callq 0x42f0
movq 0x8ebe(%rip), %r15      # 0xffc0
leaq 0x436a(%rip), %rsi      # 0xb473
movl $0x9, %edx
movq %r15, %rdi
callq 0x44e0
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x4410
movsbl %al, %esi
movq 0x8e8c(%rip), %rdi      # 0xffc0
callq 0x4040
movq %rax, %rdi
callq 0x42f0
movq %r14, %rdi
callq 0x45c0
movq %rbx, %rdi
callq 0x45c0
jmp 0x7159
xorl %ebp, %ebp
jmp 0x716d
xorl %ebp, %ebp
leaq 0x10(%rsp), %rdi
callq 0xa2e4
leaq 0x8(%rsp), %rdi
callq 0x8466
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7183
movq %rax, %rbx
jmp 0x7190
jmp 0x7183
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xa2e4
leaq 0x8(%rsp), %rdi
callq 0x8466
movq %rbx, %rdi
callq 0x47d0
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/library/library.cpp
// Function: sendDataHMAC(NetSocket&, char const*, int)
bool sendDataHMAC(NetSocket& sender_socket,const char *data,int32_t length){

	if(!sendIntHMAC(sender_socket,length+HASH_SIZE))
		return false;

	if(!sender_socket.sendData(data,length)){
		return false;
	}

	HMACManager hmac;

	if(!hmac.HMACUpdate(data,length)) return false;

	char *digest = hmac.HMACFinal(LOCAL_NONCE);

	bool ret = sender_socket.sendData(digest,HASH_SIZE);

	delete[] digest;
	return ret;

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
leal 0x20(%r14), %esi
callq 0x6f3f
testb %al, %al
je 0x721d
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x6bac
testb %al, %al
je 0x721d
movq %rsp, %r12
movq %r12, %rdi
callq 0x8284
movq %r12, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x8370
testb %al, %al
je 0x7221
movq %rsp, %rdi
xorl %esi, %esi
callq 0x8398
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movl $0x20, %edx
callq 0x6bac
movl %eax, %ebx
testq %r14, %r14
je 0x7223
movq %r14, %rdi
callq 0x45c0
jmp 0x7223
xorl %ebx, %ebx
jmp 0x722b
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x8466
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x723d
jmp 0x723d
movq %rax, %rbx
movq %rsp, %rdi
callq 0x8466
movq %rbx, %rdi
callq 0x47d0
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/library/library.cpp
// Function: recvDataHMAC(NetSocket&, int&)
char* recvDataHMAC(NetSocket& receiver_socket,int32_t &length){

	if(!recvIntHMAC(receiver_socket,length))
		return false;

	length -= HASH_SIZE;

	char *data = receiver_socket.recvData(length);

	HMACManager hmac;
	if(!hmac.HMACUpdate(data,length)) return NULL;

	char *digest = hmac.HMACFinal(REMOTE_NONCE);

	if(digest == NULL) return NULL;

	char *received_digest = receiver_socket.recvData(HASH_SIZE);

	if(received_digest == NULL){
		delete[] digest;
		return NULL;
	}

	if(CRYPTO_memcmp(received_digest,digest,HASH_SIZE)){
		cout<<"HASH DIVERSI"<<endl;
		delete[] digest;
		delete[] received_digest;
		return NULL;
	}

	delete[] digest;
	delete[] received_digest;
	return data;


}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r12
callq 0x7003
testb %al, %al
je 0x7355
movl (%r14), %ebx
addl $-0x20, %ebx
movl %ebx, (%r14)
movq %rbx, %rdi
callq 0x4030
movq %rax, %r15
movq %r12, %rdi
movq %rax, %rsi
movl %ebx, %edx
callq 0x6c10
xorl %ebx, %ebx
testb %al, %al
cmovneq %r15, %rbx
movq %rsp, %r15
movq %r15, %rdi
callq 0x8284
movl (%r14), %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8370
testb %al, %al
je 0x7359
movq %rsp, %rdi
movl $0x1, %esi
callq 0x8398
movq %rax, %r14
testq %rax, %rax
je 0x7359
movl $0x20, %edi
callq 0x4030
movq %rax, %r15
movq %r12, %rdi
movq %rax, %rsi
movl $0x20, %edx
callq 0x6c10
testb %al, %al
je 0x735d
movl $0x20, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x47e0
testl %eax, %eax
je 0x734b
movq 0x8cb6(%rip), %rbx      # 0xffc0
leaq 0x4155(%rip), %rsi      # 0xb466
movl $0xc, %edx
movq %rbx, %rdi
callq 0x44e0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x4410
movsbl %al, %esi
movq 0x8c84(%rip), %rdi      # 0xffc0
callq 0x4040
movq %rax, %rdi
callq 0x42f0
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x45c0
jmp 0x7362
xorl %ebx, %ebx
jmp 0x7372
xorl %ebx, %ebx
jmp 0x736a
xorl %ebx, %ebx
movq %r14, %r15
movq %r15, %rdi
callq 0x45c0
movq %rsp, %rdi
callq 0x8466
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x7385
jmp 0x7385
movq %rax, %rbx
movq %rsp, %rdi
callq 0x8466
movq %rbx, %rdi
callq 0x47d0
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/library/WriteFileManager.cpp
// Function: WriteFileManager::WriteFileManager(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, unsigned long)
WriteFileManager::WriteFileManager(string &name, uint64_t size) : FileManager(name,size){
	if(file_exists()){
		original_file_name = file_name;
		string tmp(".tmp");
		string new_name = file_name + tmp;
		changeName(new_name);
	} else{
		original_file_name = "";
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
callq 0x7810
leaq 0x8370(%rip), %rax      # 0xfd40
movq %rax, (%rbx)
leaq 0x248(%rbx), %r14
leaq 0x258(%rbx), %r12
movq %r12, 0x248(%rbx)
movq $0x0, 0x250(%rbx)
movb $0x0, 0x258(%rbx)
movq %rbx, %rdi
callq 0x78dc
testb %al, %al
je 0x7a84
leaq 0x8(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x4220
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x3a80(%rip), %rsi      # 0xb4a5
leaq 0x3a7d(%rip), %rdx      # 0xb4a9
movq %rsp, %rdi
callq 0x6a90
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
movq %r15, %rsi
callq 0x69a0
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x7954
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7a6c
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4450
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x7a9f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4450
jmp 0x7a9f
movq 0x250(%rbx), %rdx
leaq 0x37e0(%rip), %rcx      # 0xb272
movq %r14, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x46e0
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r15
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7ad0
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4450
jmp 0x7ad0
movq %rax, %r15
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x7aed
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4450
jmp 0x7aed
jmp 0x7aea
movq %rax, %r15
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x7b01
movq (%r12), %rsi
incq %rsi
callq 0x4450
movq %rbx, %rdi
callq 0x795e
movq %r15, %rdi
callq 0x47d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/library/WriteFileManager.cpp
// Function: WriteFileManager::write(Chunk&)
file_status WriteFileManager::write(Chunk& c){ //write in append
	if(!openStream()){ // Check if stream its open
		return FILE_ERROR;
	}
	fs.write(c.getPlainText(), c.size); // Write new block in to the file
	if(!fs){
		return FILE_ERROR;
	}

	remaining_size -= c.size;
	closeStream();
	if(remaining_size <= 0){
		return END_OF_FILE;
	}
	return NO_ERRORS; // All good
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
callq *(%rax)
movl $0x2, %ebp
testb %al, %al
je 0x7c16
leaq 0x38(%rbx), %r15
movq %r14, %rdi
callq 0xa386
movslq 0x10(%r14), %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x45f0
movq 0x28(%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x48(%rbx,%rax)
jne 0x7c16
movslq 0x10(%r14), %rax
subq %rax, 0x240(%rbx)
movq %rbx, %rdi
callq 0x78a6
xorl %eax, %eax
cmpq $0x0, 0x240(%rbx)
sete %al
leal (%rax,%rax,2), %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/luigix25[P]SSLP/library/WriteFileManager.cpp
// Function: WriteFileManager::finalize(bool)
void WriteFileManager::finalize(bool error){
	if(error || remaining_size > 0){ // after error, remove file
		remove((const char*)file_name.c_str());
		return;
	}
	if(original_file_name != ""){ // end of write, substitute previous file with tmp
		remove((const char*)original_file_name.c_str());
		rename((const char*)file_name.c_str(),(const char*)original_file_name.c_str());
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
jne 0x7c6a
cmpq $0x0, 0x240(%rbx)
jne 0x7c6a
leaq 0x248(%rbx), %rdi
leaq 0x362e(%rip), %rsi      # 0xb272
callq 0x4120
testl %eax, %eax
je 0x7c74
movq 0x248(%rbx), %rdi
callq 0x4810
movq 0x8(%rbx), %rdi
movq 0x248(%rbx), %rsi
popq %rbx
jmp 0x4250
movq 0x8(%rbx), %rdi
popq %rbx
jmp 0x4810
popq %rbx
retq
nop