LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon.cpp
// Function: beaconSource::getExternal(address const&, unsigned long, unsigned long)
beaconExternalStats &beaconSource::getExternal(const address &baddr, uint64_t now, uint64_t ts) {
	ExternalSources::iterator k = externalSources.find(baddr);
	if (k == externalSources.end()) {
		externalSources.insert(make_pair(baddr, beaconExternalStats()));
		k = externalSources.find(baddr);

		k->second.age = 0;

		if (verbose) {
			char tmp[64];
			info("Adding external source (%s) %s", name.c_str(), baddr.to_string(tmp, sizeof(tmp)));
		}
	}

	beaconExternalStats &stats = k->second;

	stats.lastupdate = now;

	return stats;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x2f8(%rdi), %r12
movq %r12, %rdi
callq 0x976c
movq %rax, %r13
leaq 0x300(%r15), %rax
cmpq %rax, %r13
jne 0x6cd6
xorl %eax, %eax
leaq 0x80(%rsp), %r13
movq %rax, -0x4a(%r13)
xorps %xmm0, %xmm0
movups %xmm0, -0x58(%r13)
movups %xmm0, -0x68(%r13)
movups %xmm0, -0x40(%r13)
movups %xmm0, -0x30(%r13)
movq %rax, -0x22(%r13)
movb %al, -0x18(%r13)
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
leaq 0xa0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq %rax, -0x8(%rbp)
movb %al, (%rbp)
leaq 0xb0(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %r14, %rsi
callq 0x8cb2
leaq 0xb0(%rsp), %rsi
movq %r12, %rdi
callq 0x97d0
leaq 0x1c8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6c28
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x33d0
leaq 0x1a8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6c49
movq 0x1a8(%rsp), %rsi
incq %rsi
callq 0x33d0
movq 0x90(%rsp), %rdi
cmpq %rbp, %rdi
je 0x6c66
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x33d0
movq 0x70(%rsp), %rdi
cmpq %r13, %rdi
je 0x6c80
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x33d0
movq %r12, %rdi
movq %r14, %rsi
callq 0x976c
movq %rax, %r13
movl $0x0, 0xa8(%rax)
cmpl $0x0, 0xb899(%rip)      # 0x12538
je 0x6cd6
movq 0x290(%r15), %r15
leaq 0xb0(%rsp), %rsi
movl $0x40, %edx
movq %r14, %rdi
movl $0x1, %ecx
callq 0xa4ca
leaq 0x60ec(%rip), %rdi      # 0xcdb5
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x40b4
movq %rbx, 0xa0(%r13)
addq $0xa0, %r13
movq %r13, %rax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x7b50
jmp 0x6d0e
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x7b94
movq %rbx, %rdi
callq 0x35d0
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon.cpp
// Function: beaconSource::update(unsigned char, unsigned int, unsigned long, unsigned long, unsigned long, bool)
void beaconSource::update(uint8_t ttl, uint32_t seqnum, uint64_t timestamp, uint64_t now, uint64_t recvts, bool ssm) {
	if (verbose > 2)
		info("beacon(%s%s) update %u, %llu, %llu",
			name.c_str(), (ssm ? "/SSM" : ""), seqnum, timestamp, now);

	beaconMcastState *st = ssm ? &SSM : &ASM;

	st->update(ttl, seqnum, timestamp, now, recvts);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %r15
movl %edx, %ebp
movq %rdi, %r13
movb 0x40(%rsp), %bl
cmpl $0x3, 0xb7f7(%rip)      # 0x12538
jl 0x6d82
movl %esi, 0x4(%rsp)
movq 0x290(%r13), %rsi
leaq 0x60a2(%rip), %rax      # 0xcdf7
leaq 0x54e7(%rip), %rdx      # 0xc243
testb %bl, %bl
cmovneq %rax, %rdx
leaq 0x606b(%rip), %rdi      # 0xcdd4
movl %ebp, %ecx
movq %r15, %r8
movq %r9, %r12
movq %r14, %r9
xorl %eax, %eax
callq 0x40b4
movl 0x4(%rsp), %esi
movq %r12, %r9
leaq 0xa0(%r13), %rax
addq $0x198, %r13            # imm = 0x198
testb %bl, %bl
cmoveq %rax, %r13
movzbl %sil, %esi
movq %r13, %rdi
movl %ebp, %edx
movq %r15, %rcx
movq %r14, %r8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6db8
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon.cpp
// Function: dumpStats(_IO_FILE*, char const*, Stats const&, unsigned long, int, bool)
void dumpStats(FILE *fp, const char *tag, const Stats &s, uint64_t now, int sttl, bool diff) {
	fprintf(fp, "\t\t\t\t<%s", tag);
	if (!diff)
		fprintf(fp, " ttl=\"%i\"", s.rttl);
	else if (sttl)
		fprintf(fp, " ttl=\"%i\"", sttl - s.rttl);
	fprintf(fp, " rptage=\"%u\"", (uint32_t)((now - s.lastupdate) / 1000));
	fprintf(fp, " loss=\"%.1f\"", s.avgloss * 100);
	fprintf(fp, " delay=\"%.3f\"", fabs(s.avgdelay));
	if (s.avgdelay < 0) {
		fprintf(fp, " future=\"true\"");
	}
	fprintf(fp, " jitter=\"%.3f\"", s.avgjitter);
	fprintf(fp, " ooo=\"%.3f\"", s.avgooo * 100);
	fprintf(fp, " dup=\"%.3f\"", s.avgdup * 100);
	fprintf(fp, " />\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r9d, %r12d
movl %r8d, %ebp
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %rdx
movq %rdi, %rbx
leaq 0x5e16(%rip), %rsi      # 0xcdfc
xorl %eax, %eax
callq 0x34e0
testl %r12d, %r12d
je 0x6fff
testl %ebp, %ebp
je 0x7017
movzbl 0x25(%r14), %eax
subl %eax, %ebp
jmp 0x7004
movzbl 0x25(%r14), %ebp
leaq 0x5df9(%rip), %rsi      # 0xce04
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x34e0
subq 0x8(%r14), %r15
shrq $0x3, %r15
movabsq $0x20c49ba5e353f7cf, %rcx # imm = 0x20C49BA5E353F7CF
movq %r15, %rax
mulq %rcx
shrq $0x4, %rdx
leaq 0x5dd4(%rip), %rsi      # 0xce0e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x34e0
movss 0x18(%r14), %xmm0
mulss 0x510a(%rip), %xmm0     # 0xc15c
cvtss2sd %xmm0, %xmm0
leaq 0x5dbe(%rip), %rsi      # 0xce1b
movq %rbx, %rdi
movb $0x1, %al
callq 0x34e0
movss 0x10(%r14), %xmm0
andps 0x502c(%rip), %xmm0     # 0xc0a0
cvtss2sd %xmm0, %xmm0
leaq 0x5da9(%rip), %rsi      # 0xce28
movq %rbx, %rdi
movb $0x1, %al
callq 0x34e0
xorps %xmm0, %xmm0
ucomiss 0x10(%r14), %xmm0
jbe 0x70ac
leaq 0x5d9c(%rip), %rdi      # 0xce36
movl $0xe, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x3650
xorps %xmm0, %xmm0
cvtss2sd 0x14(%r14), %xmm0
leaq 0x5d89(%rip), %rsi      # 0xce45
movq %rbx, %rdi
movb $0x1, %al
callq 0x34e0
movss 0x20(%r14), %xmm0
mulss 0x5088(%rip), %xmm0     # 0xc15c
cvtss2sd %xmm0, %xmm0
leaq 0x5d75(%rip), %rsi      # 0xce54
movq %rbx, %rdi
movb $0x1, %al
callq 0x34e0
movss 0x506b(%rip), %xmm0     # 0xc15c
mulss 0x1c(%r14), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x5d5e(%rip), %rsi      # 0xce60
movq %rbx, %rdi
movb $0x1, %al
callq 0x34e0
leaq 0x615e(%rip), %rdi      # 0xd271
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3650
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon.cpp
// Function: resolve_tok(char const*, bool)
static const param_tok *resolve_tok(const char *arg, bool longonly) {
	for (int j = 0; param_format[j].sf != NULL; j++) {
		if (param_format[j].lf && !strcmp(arg, param_format[j].lf))
			return &param_format[j];

		if (longonly)
			continue;

		if (!strcmp(arg, param_format[j].sf))
			return &param_format[j];
	}

	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, 0x4(%rsp)
movq %rdi, %r14
leaq 0xa8ca(%rip), %rbp      # 0x11a10
leaq 0x61d6(%rip), %r12      # 0xd323
xorl %r13d, %r13d
xorl %ebx, %ebx
movq %rbp, %r15
movq 0x10(%r13,%rbp), %rsi
testq %rsi, %rsi
je 0x716b
movq %r14, %rdi
callq 0x34d0
testl %eax, %eax
je 0x71a5
cmpb $0x0, 0x4(%rsp)
jne 0x7181
movq %r14, %rdi
movq %r12, %rsi
callq 0x34d0
testl %eax, %eax
je 0x71af
incq %rbx
movq %rbx, %r15
shlq $0x5, %r15
addq %rbp, %r15
movq 0x28(%r13,%rbp), %r12
addq $0x20, %r13
cmpq $0x360, %r13            # imm = 0x360
jne 0x7155
xorl %r15d, %r15d
jmp 0x71af
leaq 0xa864(%rip), %r15      # 0x11a10
addq %r13, %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon.cpp
// Function: check_option_value(param_tok const*, char const*, char const*)
static void check_option_value(const param_tok *tok, const char *lp,
	const char *value)
{
	if (tok == NULL)
		fatal("Unknown option `%s`", lp);
	else if (tok->param == REQ_ARG && value == NULL)
		fatal("Parameter `%s` requires an argument.", lp);
	else if (tok->param == NO_ARG && value != NULL)
		fatal("Parameter `%s` doesn't accept an argument.", lp);
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x71ed
movl 0x18(%rdi), %eax
cmpl $0x1, %eax
setne %cl
testq %rdx, %rdx
setne %dil
orb %cl, %dil
je 0x71f6
testl %eax, %eax
setne %al
testq %rdx, %rdx
sete %cl
orb %al, %cl
je 0x71ff
popq %rax
retq
leaq 0x5d73(%rip), %rdi      # 0xcf67
jmp 0x7206
leaq 0x5d7e(%rip), %rdi      # 0xcf7b
jmp 0x7206
leaq 0x5d9a(%rip), %rdi      # 0xcfa0
xorl %eax, %eax
callq 0x4147
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon.cpp
// Function: check_good_string(char const*, char const*)
static const char *check_good_string(const char *what, const char *value) {
	int l = strlen(value);

	for (int i = 0; i < l; i++) {
		if (!isprint(value[i])) {
			fprintf(stderr, "Invalid `%s` string.\n", what);
			exit(1);
		}
	}

	return value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x3180
movq %rax, %r15
testl %r15d, %r15d
jle 0x786d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %r12d, %r12d
movsbl (%r14,%r12), %edi
callq 0x35e0
testl %eax, %eax
je 0x787c
incq %r12
cmpq %r12, %r15
jne 0x7857
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x3767
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon.cpp
// Function: parse_bool(char const*, char const*, bool)
static bool parse_bool(const char *name, const char *arg, bool def) {
	if (arg == NULL)
		return def;

	if (!strcasecmp(arg, "yes"))
		return true;
	else if (!strcasecmp(arg, "true"))
		return true;
	else if (!strcasecmp(arg, "1"))
		return true;
	else if (!strcasecmp(arg, "no"))
		return false;
	else if (!strcasecmp(arg, "false"))
		return false;
	else if (!strcasecmp(arg, "0"))
		return false;

	fatal("%s: Expected one of \'yes\', \'true\', \'no\' or \'false\'.");
	return false;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x7905
movq %rdi, %rbx
leaq 0x5805(%rip), %rsi      # 0xd09b
callq 0x3400
movb $0x1, %bpl
testl %eax, %eax
je 0x7907
leaq 0x57f6(%rip), %rsi      # 0xd09f
movq %rbx, %rdi
callq 0x3400
testl %eax, %eax
je 0x7907
leaq 0x57e8(%rip), %rsi      # 0xd0a4
movq %rbx, %rdi
callq 0x3400
testl %eax, %eax
je 0x7907
leaq 0x57d7(%rip), %rsi      # 0xd0a6
movq %rbx, %rdi
callq 0x3400
testl %eax, %eax
je 0x7901
leaq 0x57c7(%rip), %rsi      # 0xd0a9
movq %rbx, %rdi
callq 0x3400
testl %eax, %eax
je 0x7901
leaq 0x486f(%rip), %rsi      # 0xc164
movq %rbx, %rdi
callq 0x3400
testl %eax, %eax
jne 0x7910
xorl %ebp, %ebp
jmp 0x7907
movl %esi, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x5798(%rip), %rdi      # 0xd0af
xorl %eax, %eax
callq 0x4147
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon.cpp
// Function: parse_u32(char const*, char const*)
static uint32_t parse_u32(const char *name, const char *arg) {
	uint32_t result;
	char *end;

	result = strtoul(arg, &end, 10);
	if (end[0] != 0)
		fatal("%s: Expected unsigned integer.", name);

	return result;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %r14
movq %rsi, %rdi
movq %r14, %rsi
movl $0xa, %edx
callq 0x3130
movq (%r14), %rcx
cmpb $0x0, (%rcx)
jne 0x7948
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x57a8(%rip), %rdi      # 0xd0f7
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4147
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon.cpp
// Function: update_taccum()
static void update_taccum() {
	uint64_t now = get_timestamp();
	int32_t diff = now - (int64_t)lastclk;

	assert(now >= lastclk);

	lastclk = now;
	taccum += diff;
}

// Assembly:
pushq %rax
callq 0xa61c
movq 0xaf1a(%rip), %rcx      # 0x12880
cmpq %rcx, %rax
jb 0x797e
movl %eax, %edx
subl %ecx, %edx
movq %rax, 0xaf0a(%rip)      # 0x12880
addl %edx, 0xaf0c(%rip)      # 0x12888
popq %rax
retq
leaq 0x57cb(%rip), %rdi      # 0xd150
leaq 0x57d3(%rip), %rsi      # 0xd15f
leaq 0x57d8(%rip), %rcx      # 0xd16b
movl $0x3a9, %edx            # imm = 0x3A9
callq 0x3260
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon.cpp
// Function: send_nprobe(address const&, unsigned int&)
static int send_nprobe(const address &addr, uint32_t &seq) {
	int len;

	len = build_probe(buffer, bufferLen, seq, get_time_of_day());
	seq++;

	len = sendto(mcastSock, buffer, len, 0, addr.saddr(), addr.addrlen());
	if (len > 0)
		bytesSent += len;
	return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %ebp
callq 0xa148
leaq 0xaf24(%rip), %r15      # 0x128e0
movq %r15, %rdi
movl $0x2000, %esi           # imm = 0x2000
movl %ebp, %edx
movq %rax, %rcx
callq 0xadaa
incl (%rbx)
movl 0xae7e(%rip), %ebx      # 0x12854
movslq %eax, %r12
movq %r14, %rdi
callq 0x9eb8
movq %rax, %r13
movq %r14, %rdi
callq 0x9ebc
movl %ebx, %edi
movq %r15, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
movq %r13, %r8
movl %eax, %r9d
callq 0x3040
testl %eax, %eax
jle 0x7a0b
addl %eax, 0xceed(%rip)      # 0x148f8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon_posix.cpp
// Function: MulticastStartup()
void MulticastStartup() {
	int sock = socket(AF_INET, SOCK_DGRAM, 0);
	if (sock > 0) {
		_loc_group_filter flt;
		memset(&flt, 0, sizeof(flt));
		socklen_t fltlen = sizeof(flt);

		// Check if OS supports MCAST_FILTER

		if (getsockopt(sock, IPPROTO_IP, MCAST_FILTER, &flt, &fltlen) == 0
				&& errno != ENOPROTOOPT) {
			if (verbose)
				info("Using new Multicast Filter API");

			_McastListen = _McastListenNewAPI;
		}

		close(sock);
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x30d0
testl %eax, %eax
jle 0x9b3b
movl %eax, %ebx
leaq 0x8(%rsp), %r14
movl $0x110, %edx            # imm = 0x110
movq %r14, %rdi
xorl %esi, %esi
callq 0x31f0
leaq 0x4(%rsp), %r8
movl $0x110, (%r8)           # imm = 0x110
movl %ebx, %edi
xorl %esi, %esi
movl $0x30, %edx
movq %r14, %rcx
callq 0x32b0
testl %eax, %eax
jne 0x9b34
callq 0x3030
cmpl $0x5c, (%rax)
je 0x9b34
leaq 0x8a25(%rip), %rax      # 0x12538
cmpl $0x0, (%rax)
je 0x9b26
leaq 0x3a78(%rip), %rdi      # 0xd597
xorl %eax, %eax
callq 0x40b4
leaq 0x19(%rip), %rax        # 0x9b46
movq %rax, 0x8894(%rip)      # 0x123c8
movl %ebx, %edi
callq 0x3660
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon_posix.cpp
// Function: McastListenNewAPI(int, address const&)
int _McastListenNewAPI(int sock, const address &grpaddr) {
	_loc_group_req grp;

	memset(&grp, 0, sizeof(grp));
	grp.gr_interface = mcastInterface;

	set_address(grp.gr_group, grpaddr);

	return setsockopt(sock, grpaddr.optlevel(), MCAST_JOIN_GROUP, &grp, sizeof(grp));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rsi, %r14
movl %edi, %ebx
leaq 0x8(%rsp), %r15
movl $0x88, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x31f0
leaq 0x89ce(%rip), %rax      # 0x12540
movl (%rax), %eax
movl %eax, (%r15)
movzwl (%r14), %eax
cmpl $0xa, %eax
je 0x9b8b
cmpl $0x2, %eax
jne 0x9b9e
movups (%r14), %xmm0
jmp 0x9b99
movups (%r14), %xmm0
movups 0xc(%r14), %xmm1
movups %xmm1, 0x14(%r15)
movups %xmm0, 0x8(%r15)
xorl %ecx, %ecx
cmpw $0xa, %ax
movl $0x29, %esi
cmovnel %ecx, %esi
leaq 0x8(%rsp), %rcx
movl %ebx, %edi
movl $0x2a, %edx
movl $0x88, %r8d
callq 0x3600
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon_posix.cpp
// Function: McastListenOldAPI(int, address const&)
int _McastListenOldAPI(int sock, const address &grpaddr) {
	if (grpaddr.family() == AF_INET6) {
		ipv6_mreq mreq;
		mreq.ipv6mr_interface = mcastInterface;
		mreq.ipv6mr_multiaddr = grpaddr.v6()->sin6_addr;

		return setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq));
	} else {
		ip_mreq mreq;
		memset(&mreq, 0, sizeof(mreq));
		// Specifying the interface doesn't work, there's ip_mreqn in linux..
		// but what about other OSs? -hugo
		mreq.imr_multiaddr = grpaddr.v4()->sin_addr;

		return setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq));
	}
}

// Assembly:
subq $0x18, %rsp
cmpw $0xa, (%rsi)
jne 0x9c11
leaq 0x8950(%rip), %rax      # 0x12540
movl (%rax), %eax
movq %rsp, %rcx
movl %eax, 0x10(%rcx)
movups 0x8(%rsi), %xmm0
movaps %xmm0, (%rcx)
movl $0x29, %esi
movl $0x14, %edx
movl $0x14, %r8d
jmp 0x9c2d
movq %rsp, %rcx
movq $0x0, (%rcx)
movl 0x4(%rsi), %eax
movl %eax, (%rcx)
xorl %esi, %esi
movl $0x23, %edx
movl $0x8, %r8d
callq 0x3600
addq $0x18, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon_posix.cpp
// Function: SSMJoinLeave(int, int, address const&, address const&)
static int SSMJoinLeave(int sock, int type, const address &grpaddr, const address &srcaddr) {
	_loc_group_source_req req;
	memset(&req, 0, sizeof(req));

	req.gsr_interface = mcastInterface;

	set_address(req.gsr_group, grpaddr);
	set_address(req.gsr_source, srcaddr);

	return setsockopt(sock, srcaddr.optlevel(), type, &req, sizeof(req));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ebx
movl %edi, %ebp
leaq 0x8(%rsp), %r12
movl $0x108, %edx            # imm = 0x108
movq %r12, %rdi
xorl %esi, %esi
callq 0x31f0
leaq 0x88b2(%rip), %rax      # 0x12540
movl (%rax), %eax
movl %eax, (%r12)
movzwl (%r15), %eax
cmpl $0xa, %eax
je 0x9ca8
cmpl $0x2, %eax
jne 0x9cbd
movups (%r15), %xmm0
jmp 0x9cb7
movups (%r15), %xmm0
movups 0xc(%r15), %xmm1
movups %xmm1, 0x14(%r12)
movups %xmm0, 0x8(%r12)
leaq 0x90(%rsp), %rcx
movzwl (%r14), %eax
cmpl $0xa, %eax
je 0x9cd9
cmpl $0x2, %eax
jne 0x9ce9
movups (%r14), %xmm0
jmp 0x9ce6
movups (%r14), %xmm0
movups 0xc(%r14), %xmm1
movups %xmm1, 0xc(%rcx)
movups %xmm0, (%rcx)
xorl %ecx, %ecx
cmpw $0xa, %ax
movl $0x29, %esi
cmovnel %ecx, %esi
leaq 0x8(%rsp), %rcx
movl %ebp, %edi
movl %ebx, %edx
movl $0x108, %r8d            # imm = 0x108
callq 0x3600
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon_posix.cpp
// Function: SetHops(int, address const&, int)
bool SetHops(int sock, const address &addr, int ttl) {
	if (addr.optlevel() == IPPROTO_IPV6) {
		if (setsockopt(sock, addr.optlevel(), IPV6_MULTICAST_HOPS, &ttl, sizeof(ttl)) != 0) {
			return false;
		}
	} else {
		TTLType _ttl = ttl;

		if (setsockopt(sock, addr.optlevel(), IP_MULTICAST_TTL, &_ttl, sizeof(_ttl)) != 0) {
			return false;
		}
	}

	return true;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edx, 0x8(%rsp)
cmpw $0xa, (%rsi)
jne 0x9eff
leaq 0x8(%rsp), %rcx
movl $0x29, %esi
movl $0x12, %edx
movl $0x4, %r8d
callq 0x3600
testl %eax, %eax
je 0x9f1e
xorl %ebx, %ebx
jmp 0x9f20
leaq 0xc(%rsp), %rcx
movl %edx, (%rcx)
xorl %ebx, %ebx
xorl %esi, %esi
movl $0x21, %edx
movl $0x4, %r8d
callq 0x3600
testl %eax, %eax
jne 0x9f20
movb $0x1, %bl
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon_posix.cpp
// Function: RequireToAddress(int, address const&)
bool RequireToAddress(int sock, const address &addr) {
#ifdef IPV6_PKTINFO
	if (addr.family() == AF_INET6) {
		int on = 1;
		return setsockopt(sock, IPPROTO_IPV6, IPV6_PKTINFO, &on, sizeof(on)) == 0;
	}
#endif

	return true;
}

// Assembly:
movb $0x1, %al
cmpw $0xa, (%rsi)
jne 0x9f81
pushq %rax
leaq 0x4(%rsp), %rcx
movl $0x1, (%rcx)
movl $0x29, %esi
movl $0x32, %edx
movl $0x4, %r8d
callq 0x3600
testl %eax, %eax
sete %al
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon_posix.cpp
// Function: address::parse(char const*, bool, bool)
bool address::parse(const char *str, bool multicast, bool addport) {
	char tmp[128];
	strncpy(tmp, str, sizeof(tmp));

	char *port = strchr(tmp, '/');
	if (port) {
		*port = 0;
		port ++;
	} else if (addport) {
		port = (char *)defaultPort;
	}

	int cres;
	addrinfo hint, *rres, *res;
	memset(&hint, 0, sizeof(hint));

	hint.ai_family = forceFamily;
	hint.ai_socktype = SOCK_DGRAM;

	if ((cres = getaddrinfo(*tmp ? tmp : 0, port, &hint, &rres)) != 0) {
		info("getaddrinfo failed: %s", gai_strerror(cres));
		return false;
	}

	for (res = rres; res; res = res->ai_next) {
		set(res->ai_addr);
		if (multicast) {
			if (is_multicast())
				break;
		} else if (!is_unspecified())
			break;
	}

	freeaddrinfo(rres);

	if (!res) {
		info("Failed to resolve %s", tmp);
		return false;
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %ecx, %ebp
movl %edx, %ebx
movq %rdi, %r14
leaq 0x10(%rsp), %r15
movl $0x80, %edx
movq %r15, %rdi
callq 0x31c0
movq %r15, %rdi
movl $0x2f, %esi
callq 0x3160
testq %rax, %rax
je 0xa2d8
movb $0x0, (%rax)
incq %rax
jmp 0xa2eb
testb %bpl, %bpl
je 0xa2e9
leaq 0x771c(%rip), %rax      # 0x11a00
movq (%rax), %rax
jmp 0xa2eb
xorl %eax, %eax
xorps %xmm0, %xmm0
leaq 0x90(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
leaq 0x8438(%rip), %rcx      # 0x12740
movl (%rcx), %ecx
movl %ecx, 0x4(%rdx)
movl $0x2, 0x8(%rdx)
xorl %ecx, %ecx
cmpb $0x0, 0x10(%rsp)
cmoveq %rcx, %r15
leaq 0x8(%rsp), %rcx
movq %r15, %rdi
movq %rax, %rsi
callq 0x3490
testl %eax, %eax
je 0xa34b
movl %eax, %edi
callq 0x34c0
leaq 0x3327(%rip), %rdi      # 0xd668
xorl %ebx, %ebx
movq %rax, %rsi
jmp 0xa3dd
movq 0x8(%rsp), %r15
testq %r15, %r15
je 0xa3c7
leaq 0x8(%r14), %r12
movl 0x4(%r14), %ebp
movq %r15, %r13
movq 0x18(%r13), %rcx
movzwl (%rcx), %eax
movw %ax, (%r14)
cmpl $0xa, %eax
jne 0xa37b
movups 0x8(%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0xa382
movl 0x4(%rcx), %ebp
movl %ebp, 0x4(%r14)
movzwl 0x2(%rcx), %ecx
movw %cx, 0x2(%r14)
testb %bl, %bl
je 0xa3a2
cmpl $0x2, %eax
je 0xa3b0
cmpl $0xa, %eax
jne 0xa3be
cmpb $-0x1, (%r12)
jne 0xa3be
jmp 0xa3f8
movq %r14, %rdi
callq 0xa42a
testb %al, %al
jne 0xa3be
jmp 0xa3f8
movl %ebp, %eax
andl $0xf0, %eax
cmpl $0xe0, %eax
je 0xa3f8
movq 0x28(%r13), %r13
testq %r13, %r13
jne 0xa360
movq %r15, %rdi
callq 0x34a0
leaq 0x32a9(%rip), %rdi      # 0xd67f
xorl %ebx, %ebx
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x40b4
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x34a0
movb $0x1, %bl
jmp 0xa3e4
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon_posix.cpp
// Function: address::set(sockaddr const*)
void address::set(const sockaddr *sa) {
	stor.ss_family = sa->sa_family;
	if (stor.ss_family == AF_INET6) {
		v6()->sin6_addr = ((const sockaddr_in6 *)sa)->sin6_addr;
		v6()->sin6_port = ((const sockaddr_in6 *)sa)->sin6_port;
	} else {
		v4()->sin_addr = ((const sockaddr_in *)sa)->sin_addr;
		v4()->sin_port = ((const sockaddr_in *)sa)->sin_port;
	}
}

// Assembly:
movzwl (%rsi), %eax
movw %ax, (%rdi)
cmpw $0xa, %ax
jne 0xa41a
movups 0x8(%rsi), %xmm0
movups %xmm0, 0x8(%rdi)
jmp 0xa420
movl 0x4(%rsi), %eax
movl %eax, 0x4(%rdi)
movzwl 0x2(%rsi), %eax
movw %ax, 0x2(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon_posix.cpp
// Function: address::is_unspecified() const
bool address::is_unspecified() const {
	if (stor.ss_family == AF_INET6)
		return IN6_IS_ADDR_UNSPECIFIED(&v6()->sin6_addr);
	else if (stor.ss_family == AF_INET)
		return v4()->sin_addr.s_addr == 0;
	return true;
}

// Assembly:
movzwl (%rdi), %ecx
cmpl $0x2, %ecx
je 0xa453
movb $0x1, %al
cmpl $0xa, %ecx
jne 0xa45a
xorl %eax, %eax
cmpl $0x0, 0x8(%rdi)
jne 0xa45a
cmpl $0x0, 0xc(%rdi)
jne 0xa45a
cmpl $0x0, 0x10(%rdi)
jne 0xa45a
cmpl $0x0, 0x14(%rdi)
jmp 0xa457
cmpl $0x0, 0x4(%rdi)
sete %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon_posix.cpp
// Function: address::set_addr(char const*)
bool address::set_addr(const char *addr) {
	if (stor.ss_family == AF_INET) {
		if (inet_pton(AF_INET, addr, &v4()->sin_addr) <= 0)
			return false;
	} else if (stor.ss_family == AF_INET6) {
		if (inet_pton(AF_INET6, addr, &v6()->sin6_addr) <= 0)
			return false;
	} else {
		return false;
	}

	return true;
}

// Assembly:
pushq %rax
movq %rdi, %rdx
movzwl (%rdi), %eax
cmpl $0xa, %eax
je 0xa478
cmpl $0x2, %eax
jne 0xa48e
addq $0x4, %rdx
movl $0x2, %edi
jmp 0xa481
addq $0x8, %rdx
movl $0xa, %edi
callq 0x3630
testl %eax, %eax
jle 0xa48e
movb $0x1, %al
jmp 0xa490
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon_posix.cpp
// Function: address::to_string(char*, unsigned long, bool) const
char *address::to_string(char *str, size_t len, bool printport) const {
	uint16_t port;

	if (stor.ss_family == AF_INET6) {
		inet_ntop(AF_INET6, &v6()->sin6_addr, str, len);
		port = ntohs(v6()->sin6_port);
	} else if (stor.ss_family == AF_INET) {
		inet_ntop(AF_INET, &v4()->sin_addr, str, len);
		port = ntohs(v4()->sin_port);
	} else {
		return NULL;
	}

	if (printport)
		snprintf(str + strlen(str), len - strlen(str), "/%u", port);

	return str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movzwl (%rdi), %edi
cmpl $0xa, %edi
je 0xa4f5
cmpl $0x2, %edi
jne 0xa53b
movl $0x2, %edi
movl $0x4, %esi
jmp 0xa4fa
movl $0x8, %esi
addq %r15, %rsi
movq %rbx, %rdx
movl %r14d, %ecx
callq 0x33f0
testb %bpl, %bpl
je 0xa53d
movzwl 0x2(%r15), %ebp
rolw $0x8, %bp
movq %rbx, %rdi
callq 0x3180
leaq (%rbx,%rax), %rdi
subq %rax, %r14
movzwl %bp, %ecx
leaq 0x3165(%rip), %rdx      # 0xd694
movq %r14, %rsi
xorl %eax, %eax
callq 0x3560
jmp 0xa53d
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon_posix.cpp
// Function: address::is_equal(address const&) const
bool address::is_equal(const address &a) const {
	if (stor.ss_family != a.stor.ss_family)
		return false;
	if (stor.ss_family == AF_INET6)
		return memcmp(&v6()->sin6_addr, &a.v6()->sin6_addr, sizeof(in6_addr)) == 0;
	else if (stor.ss_family == AF_INET)
		return v4()->sin_addr.s_addr == a.v4()->sin_addr.s_addr;
	return false;
}

// Assembly:
movzwl (%rdi), %eax
cmpw (%rsi), %ax
jne 0xa5dd
cmpl $0x2, %eax
je 0xa5e0
cmpl $0xa, %eax
jne 0xa5dd
movdqu 0x8(%rdi), %xmm0
movdqu 0x8(%rsi), %xmm1
pcmpeqb %xmm0, %xmm1
pmovmskb %xmm1, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jmp 0xa5e6
xorl %eax, %eax
retq
movl 0x4(%rdi), %eax
cmpl 0x4(%rsi), %eax
sete %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon_posix.cpp
// Function: dbeacon_daemonize(char const*)
int
dbeacon_daemonize(const char *pidfile)
{
	if (chdir("/") < 0)
		return -1;

	int ch = fork();
	if (ch < 0)
		return -1;

	/* exit parent */
	if (ch != 0)
		_exit(0);

	/* child, lets prepare for daemonizing */

	int null = open("/dev/null", O_RDWR);
	if (null >= 0) {
		dup2(null, 0);
		dup2(null, 1);
		dup2(null, 2);
	}

	umask(022);
	setsid();

	if (pidfile) {
		FILE *f = fopen(pidfile, "w");
		if (f) {
			fprintf(f, "%u\n", getpid());
			fclose(f);
		} else {
			d_log(LOG_ERR, "Failed to open PID file to write.");
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x303f(%rip), %rdi      # 0xd698
callq 0x3510
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0xa71e
callq 0x30e0
testl %eax, %eax
js 0xa71e
jne 0xa725
leaq 0x3015(%rip), %rdi      # 0xd69a
xorl %ebx, %ebx
movl $0x2, %esi
xorl %eax, %eax
callq 0x3290
testl %eax, %eax
js 0xa6ba
movl %eax, %ebp
movl %eax, %edi
xorl %esi, %esi
callq 0x3370
movl %ebp, %edi
movl $0x1, %esi
callq 0x3370
movl %ebp, %edi
movl $0x2, %esi
callq 0x3370
movl $0x12, %edi
callq 0x35f0
callq 0x3410
testq %r14, %r14
je 0xa71e
leaq 0x285b(%rip), %rsi      # 0xcf30
movq %r14, %rdi
callq 0x3430
testq %rax, %rax
je 0xa709
movq %rax, %r14
callq 0x3500
leaq 0x2fb3(%rip), %rsi      # 0xd6a4
xorl %ebx, %ebx
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x34e0
movq %r14, %rdi
callq 0x33b0
jmp 0xa71e
leaq 0x2f98(%rip), %rsi      # 0xd6a8
xorl %ebx, %ebx
movl $0x3, %edi
xorl %eax, %eax
callq 0x3fdb
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
xorl %edi, %edi
callq 0x35a0
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/dbeacon_posix.cpp
// Function: get_local_address_for(address const&)
address get_local_address_for(const address &remote)
{
	int tmpSock = socket(remote.family(), SOCK_DGRAM, 0);
	if (tmpSock < 0) {
		perror("Failed to create socket to discover local addr");
		exit(-1);
	}

	if (connect(tmpSock, remote.saddr(), remote.addrlen()) != 0) {
		perror("Failed to connect multicast socket");
		exit(-1);
	}

	address result(remote.family());
	if (result.fromsocket(tmpSock) < 0) {
		perror("getsockname");
		exit(-1);
	}

	close(tmpSock);
	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movzwl (%rsi), %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x30d0
testl %eax, %eax
js 0xa7dd
movl %eax, %ebp
cmpw $0xa, (%r14)
movl $0x1c, %r12d
movl $0x10, %r15d
movl $0x10, %edx
cmovel %r12d, %edx
movl %eax, %edi
movq %r14, %rsi
callq 0x3310
testl %eax, %eax
jne 0xa7e2
movzwl (%r14), %eax
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movups %xmm0, 0x70(%rbx)
movups %xmm0, 0x60(%rbx)
movups %xmm0, 0x50(%rbx)
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movw %ax, (%rbx)
cmpw $0xa, %ax
cmovel %r12d, %r15d
leaq 0xc(%rsp), %rdx
movl %r15d, (%rdx)
movl %ebp, %edi
movq %rbx, %rsi
callq 0x3360
testl %eax, %eax
js 0xa7e7
movl %ebp, %edi
callq 0x3660
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x37e0
callq 0x37b6
callq 0x37cb
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/protocol.cpp
// Function: write_tlv_stats(unsigned char*, int, int&, unsigned char, unsigned int, int, beaconMcastState const&)
static bool write_tlv_stats(uint8_t *buff, int maxlen, int &ptr, uint8_t type,
			uint32_t age, int sttl, const beaconMcastState &st) {
	if (!write_tlv_start(buff, maxlen, ptr, type, 20))
		return false;

	uint8_t *b = buff + ptr;

	write_u32(b + 0, st.s.timestamp);
	write_u32(b + 4, age);

	b[8] = (sttl ? sttl : defaultTTL) - st.s.rttl;

	write_f(b + 9, st.s.avgdelay);
	write_f(b + 13, st.s.avgjitter);

	/* average loss in 0..255 range */
	b[17] = (uint8_t)(st.s.avgloss * 0xff);
	b[18] = st.s.avgdup > 10. ? 0xff : ((uint8_t)ceil(st.s.avgdup * 25.5));
	b[19] = (uint8_t)(st.s.avgooo * 0xff);

	ptr += 20;

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movslq (%rdx), %rax
leal 0x16(%rax), %edx
cmpl %esi, %edx
jg 0xad9e
movq %rdi, %r14
movq 0x30(%rsp), %r12
movb %cl, (%rdi,%rax)
movslq (%rbx), %rax
movb $0x14, 0x1(%rdi,%rax)
movslq (%rbx), %rax
leaq 0x2(%rax), %r15
movl %r15d, (%rbx)
movl 0x28(%r12), %ecx
bswapl %ecx
movl %ecx, 0x2(%rdi,%rax)
bswapl %r8d
movl %r8d, 0x6(%rdi,%rax)
testl %r9d, %r9d
jne 0xad1d
leaq 0x143e(%rip), %rcx      # 0xc158
movl (%rcx), %r9d
subb 0x4d(%r12), %r9b
movb %r9b, 0xa(%r14,%rax)
movl 0x38(%r12), %ecx
bswapl %ecx
movl %ecx, 0xb(%r14,%rax)
movl 0x3c(%r12), %ecx
bswapl %ecx
movl %ecx, 0xf(%r14,%rax)
movss 0x40(%r12), %xmm0
mulss 0x29ce(%rip), %xmm0     # 0xd71c
cvttss2si %xmm0, %ecx
movb %cl, 0x13(%r14,%rax)
movss 0x44(%r12), %xmm0
movb $-0x1, %al
ucomiss 0x29b9(%rip), %xmm0     # 0xd720
ja 0xad7e
cvtss2sd %xmm0, %xmm0
mulsd 0x29b3(%rip), %xmm0     # 0xd728
callq 0x30a0
cvttsd2si %xmm0, %eax
movb %al, 0x12(%r14,%r15)
movss 0x48(%r12), %xmm0
mulss 0x298a(%rip), %xmm0     # 0xd71c
cvttss2si %xmm0, %eax
movb %al, 0x13(%r14,%r15)
addl $0x14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/ssmping.cpp
// Function: SetupSSMPing()
int SetupSSMPing() {
	address addr(beaconUnicastAddr.family());

	if (!addr.set_port(4321))
		return -1;

	ssmPingSocket = SetupSocket(addr, true, false);
	if (ssmPingSocket < 0)
		return -1;

	if (!SetHops(ssmPingSocket, addr, 64)) {
		close(ssmPingSocket);
		return -1;
	}

	if (!RequireToAddress(ssmPingSocket, addr)) {
		close(ssmPingSocket);
		return -1;
	}

	assert(SSMPingV4Addr.set_addr(SSMPingV4ResponseChannel));
	assert(SSMPingV6Addr.set_addr(SSMPingV6ResponseChannel));

	ListenTo(ssmPingSocket, handle_ssmping);

	return 0;
}

// Assembly:
pushq %rbx
subq $0x80, %rsp
leaq 0x6e5d(%rip), %rdi      # 0x124b8
callq 0x9c38
movq %rsp, %rbx
movq %rbx, %rdi
movl %eax, %esi
callq 0xa260
movq %rbx, %rdi
movl $0x10e1, %esi           # imm = 0x10E1
callq 0xa492
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testb %al, %al
je 0xb714
movq %rsp, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x9d2b
movl %eax, 0x6d34(%rip)      # 0x123d0
testl %eax, %eax
js 0xb714
movq %rsp, %rsi
movl %eax, %edi
movl $0x40, %edx
callq 0x9ece
movl 0x6d1b(%rip), %edi      # 0x123d0
testb %al, %al
je 0xb70f
movq %rsp, %rsi
callq 0x9f4f
testb %al, %al
je 0xb709
leaq 0x92cc(%rip), %rdi      # 0x14998
leaq 0x214f(%rip), %rsi      # 0xd822
callq 0xa45c
testb %al, %al
je 0xb71f
leaq 0x9235(%rip), %rdi      # 0x14918
leaq 0x2147(%rip), %rsi      # 0xd831
callq 0xa45c
testb %al, %al
je 0xb73e
movl 0x6cd7(%rip), %edi      # 0x123d0
leaq 0x5d(%rip), %rsi        # 0xb75d
callq 0x5b94
xorl %ebx, %ebx
jmp 0xb714
movl 0x6cc1(%rip), %edi      # 0x123d0
callq 0x3660
movl %ebx, %eax
addq $0x80, %rsp
popq %rbx
retq
leaq 0x207b(%rip), %rdi      # 0xd7a1
leaq 0x20a5(%rip), %rsi      # 0xd7d2
leaq 0x20aa(%rip), %rcx      # 0xd7de
movl $0x47, %edx
callq 0x3260
leaq 0x20ac(%rip), %rdi      # 0xd7f1
leaq 0x2086(%rip), %rsi      # 0xd7d2
leaq 0x208b(%rip), %rcx      # 0xd7de
movl $0x48, %edx
callq 0x3260
// File: /workspace/github_cpp_makefile_star2_O3/hugosantos[P]dbeacon/ssmping.cpp
// Function: handle_ssmping(int, Message const&)
static void handle_ssmping(int s, const Message &msg)
{
	if (msg.buffer[0] != SSMPING_REQUEST || msg.len > maxSSMPingMessage)
		return;

	if (verbose > 1) {
		char tmp[64];
		info("Got SSM Ping Request from %s",
			msg.from.to_string(tmp, sizeof(tmp)));
	}

	msg.buffer[0] = SSMPING_ANSWER;

	if (SendTo(s, msg.buffer, msg.len, msg.to, msg.from) < 0)
		return;

	address mcastDest(msg.from.family() == AF_INET6 ?
			SSMPingV6Addr : SSMPingV4Addr);
	mcastDest.set_port(msg.from.port());

	SendTo(s, msg.buffer, msg.len, msg.to, mcastDest);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq 0x110(%rsi), %rax
cmpb $0x51, (%rax)
jne 0xb848
movq %rsi, %r14
cmpq $0x3e8, 0x118(%rsi) # imm = 0x3E8
ja 0xb848
movl %edi, %ebx
leaq 0x6da0(%rip), %rcx      # 0x12538
cmpl $0x2, (%rcx)
jl 0xb7ca
movq %rsp, %rsi
movl $0x40, %edx
movq %r14, %rdi
movl $0x1, %ecx
callq 0xa4ca
leaq 0x2088(%rip), %rdi      # 0xd841
movq %rax, %rsi
xorl %eax, %eax
callq 0x40b4
movq 0x110(%r14), %rax
movb $0x41, (%rax)
movq 0x110(%r14), %rsi
movl 0x118(%r14), %edx
leaq 0x80(%r14), %r15
movl %ebx, %edi
movq %r15, %rcx
movq %r14, %r8
callq 0xa191
testl %eax, %eax
js 0xb848
movq %r14, %rdi
callq 0x9c38
cmpl $0xa, %eax
leaq 0x9113(%rip), %rax      # 0x14918
leaq 0x918c(%rip), %rsi      # 0x14998
cmoveq %rax, %rsi
movq %rsp, %r12
movq %r12, %rdi
callq 0xa286
movq %r14, %rdi
callq 0xa4ac
movq %r12, %rdi
movl %eax, %esi
callq 0xa492
movq 0x110(%r14), %rsi
movl 0x118(%r14), %edx
movl %ebx, %edi
movq %r15, %rcx
movq %r12, %r8
callq 0xa191
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/Marcos30004347[P]JSS-with-VNS/main.cpp
// Function: total_cost(std::vector<unsigned int, std::allocator<unsigned int>>)
unsigned total_cost(solution s) {
  vector<unsigned> positions(costs.size(), 0);
  vector<unsigned> job_time(costs.size(), 0);
  vector<unsigned> machine_time(costs[0].size(), 0);

  for(unsigned j : s) {
    unsigned o = positions[j];
    unsigned m = ops[j][o].machine;
    unsigned time = costs[j][m] + max(job_time[j], machine_time[m]);
    job_time[j] = time;
    machine_time[m] = time;
    positions[j]++;
  }

  unsigned total = 0;
  for(unsigned m : machine_time)
    total = max(total, m);

  return total;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movq 0x4bea(%rip), %rsi      # 0x7130
subq 0x4bdb(%rip), %rsi      # 0x7128
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %r15 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r15, %rsi
xorl %r12d, %r12d
leaq -0x58(%rbp), %rdx
movl %r12d, (%rdx)
leaq -0x70(%rbp), %rdi
leaq -0x40(%rbp), %r14
movq %r14, %rcx
callq 0x3d74
movq 0x4bb0(%rip), %rsi      # 0x7130
subq 0x4ba1(%rip), %rsi      # 0x7128
sarq $0x3, %rsi
imulq %r15, %rsi
movl %r12d, (%r14)
leaq -0x58(%rbp), %rdi
leaq -0x40(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x3d74
movq 0x4b7e(%rip), %rax      # 0x7128
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x2, %rsi
leaq -0x28(%rbp), %rdx
movl $0x0, (%rdx)
leaq -0x40(%rbp), %rdi
leaq -0x21(%rbp), %rcx
callq 0x3d74
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq %rcx, %rax
je 0x2639
movq -0x70(%rbp), %rdx
movq 0x4b5d(%rip), %rsi      # 0x7140
movq 0x4b3e(%rip), %rdi      # 0x7128
movq -0x58(%rbp), %r8
movq -0x40(%rbp), %r9
movl (%rax), %r10d
movl (%rdx,%r10,4), %r11d
leaq (,%r10,8), %rbx
leaq (%rbx,%rbx,2), %rbx
movq (%rsi,%rbx), %r14
movl (%r14,%r11,8), %r11d
movl (%r8,%r10,4), %r14d
movl (%r9,%r11,4), %r15d
cmpl %r15d, %r14d
cmoval %r14d, %r15d
movq (%rdi,%rbx), %rbx
addl (%rbx,%r11,4), %r15d
movl %r15d, (%r8,%r10,4)
movl %r15d, (%r9,%r11,4)
incl (%rdx,%r10,4)
addq $0x4, %rax
cmpq %rcx, %rax
jne 0x25f2
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x265f
xorl %edx, %edx
movq %rdi, %rcx
movl (%rcx), %ebx
cmpl %ebx, %edx
cmoval %edx, %ebx
addq $0x4, %rcx
movl %ebx, %edx
cmpq %rax, %rcx
jne 0x264b
jmp 0x2661
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x2672
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x2687
movq -0x48(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x269c
movq -0x60(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x26c8
movq -0x48(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
jmp 0x26c8
movq %rax, %rbx
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x26dd
movq -0x60(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O3/Marcos30004347[P]JSS-with-VNS/main.cpp
// Function: permutate(std::vector<unsigned int, std::allocator<unsigned int>>&)
solution permutate(solution &s) {
  unsigned size = s.size();
	int pos1 = 1 + rand() % (size / 4);
	int pos2 = pos1 + 1 + rand() % (size / 4);
	int pos3 = pos2 + 1 + rand() % (size / 4);

	int i;
  solution s_;

	for (i = 0; i < pos1; i++)
    s_.push_back(s[i]);
	for (i = pos3; i < size; i++)
    s_.push_back(s[i]);
	for (i = pos2; i < pos3; i++)
    s_.push_back(s[i]);
	for (i = pos1; i < pos2; i++)
    s_.push_back(s[i]);

  return s_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %r15
subq (%rsi), %r15
shrq $0x2, %r15
callq 0x2060
movq %r15, -0x40(%rbp)
movl %r15d, %r13d
shrl $0x2, %r13d
xorl %r12d, %r12d
xorl %edx, %edx
divl %r13d
movl %edx, %r15d
callq 0x2060
xorl %edx, %edx
divl %r13d
leal (%r15,%rdx), %eax
movq %rax, -0x30(%rbp)
leal (%r15,%rdx), %eax
addl $0x2, %eax
movl %eax, -0x34(%rbp)
callq 0x2060
xorl %edx, %edx
divl %r13d
movq -0x30(%rbp), %rax
addl %edx, %eax
addl $0x3, %eax
movl %eax, -0x30(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq $-0x1, %r13
movq (%r14), %rdx
addq %r12, %rdx
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x2787
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x278f
movq %rbx, %rdi
callq 0x408e
incq %r13
addq $0x4, %r12
cmpq %r15, %r13
jb 0x2769
movl -0x30(%rbp), %eax
cmpl -0x40(%rbp), %eax
movl -0x34(%rbp), %r13d
jae 0x27df
movslq -0x30(%rbp), %r12
leaq (,%r12,4), %rdx
addq (%r14), %rdx
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x27ce
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x27d6
movq %rbx, %rdi
callq 0x408e
incq %r12
cmpl -0x40(%rbp), %r12d
jb 0x27ab
cmpl -0x30(%rbp), %r13d
jge 0x281c
movl %r13d, %r12d
leaq (,%r12,4), %rdx
addq (%r14), %rdx
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x280b
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x2813
movq %rbx, %rdi
callq 0x408e
incq %r12
cmpl %r12d, -0x30(%rbp)
jg 0x27e8
incl %r15d
cmpl %r13d, %r15d
jae 0x285d
movl %r15d, %r15d
movl %r13d, %r12d
leaq (,%r15,4), %rdx
addq (%r14), %rdx
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x284d
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x2855
movq %rbx, %rdi
callq 0x408e
incq %r15
cmpq %r12, %r15
jb 0x282a
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2875
jmp 0x2875
jmp 0x2875
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x288c
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2140
movq %r14, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O3/Marcos30004347[P]JSS-with-VNS/main.cpp
// Function: argmin(std::vector<unsigned int, std::allocator<unsigned int>>, unsigned int&, unsigned int)
solution argmin(solution s, unsigned& k, unsigned p) {
  solution s_ = s;
  for(int i=0; i<p; i++) {
    solution tmp;

    switch (k) {
    case 1: tmp = opt_2(s); break;
    case 2: tmp = opt_3(s); break;
    default: break;
    }

    if(total_cost(tmp) < total_cost(s_))
      s_ = tmp;
  }

  return s_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %ecx, %r14d
movq %rdx, -0x50(%rbp)
movq %rdi, %rbx
movq %rsi, -0x48(%rbp)
callq 0x3dfc
testl %r14d, %r14d
je 0x3059
leaq -0x98(%rbp), %r12
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x50(%rbp), %rax
movl (%rax), %eax
cmpl $0x2, %eax
je 0x2f6c
cmpl $0x1, %eax
jne 0x2fcb
leaq -0xc8(%rbp), %r15
movq %r15, %rdi
movq -0x48(%rbp), %rsi
callq 0x3dfc
leaq -0x80(%rbp), %rdi
movq %r15, %rsi
callq 0x2894
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x80(%rbp), %rax
movq %rax, -0x40(%rbp)
movups -0x78(%rbp), %xmm0
movups %xmm0, -0x38(%rbp)
testq %rdi, %rdi
je 0x2f57
subq %rdi, %rsi
callq 0x2140
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x2fcb
movq -0xb8(%rbp), %rsi
jmp 0x2fc3
leaq -0xb0(%rbp), %r15
movq %r15, %rdi
movq -0x48(%rbp), %rsi
callq 0x3dfc
leaq -0x80(%rbp), %rdi
movq %r15, %rsi
callq 0x2919
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x80(%rbp), %rax
movq %rax, -0x40(%rbp)
movups -0x78(%rbp), %xmm0
movups %xmm0, -0x38(%rbp)
testq %rdi, %rdi
je 0x2fb0
subq %rdi, %rsi
callq 0x2140
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x2fcb
movq -0xa0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
leaq -0x68(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x3dfc
leaq -0x68(%rbp), %rdi
callq 0x252d
movl %eax, %r15d
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3dfc
movq %r12, %rdi
callq 0x252d
movl %eax, %r13d
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x3015
movq -0x88(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x302a
movq -0x58(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
cmpl %r13d, %r15d
jae 0x303b
movq %rbx, %rdi
leaq -0x40(%rbp), %rsi
callq 0x3e7c
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x3050
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
decl %r14d
jne 0x2ef0
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x30aa
movq %rax, %r14
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x30c7
movq -0xa0(%rbp), %rsi
jmp 0x30bf
jmp 0x30aa
movq %rax, %r14
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x30b2
movq -0x88(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
jmp 0x30b2
movq %rax, %r14
jmp 0x30c7
movq %rax, %r14
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x30c7
movq -0x58(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x30dc
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x30f0
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2140
movq %r14, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O3/Marcos30004347[P]JSS-with-VNS/main.cpp
// Function: sequential_neighborhood_change_step(std::vector<unsigned int, std::allocator<unsigned int>>&, std::vector<unsigned int, std::allocator<unsigned int>>&, unsigned int&)
void sequential_neighborhood_change_step(solution &s, solution &s_, unsigned &k) {
  if(total_cost(s_) < total_cost(s)) {
    s = s_;
    k = 1;
  } else
    k = k + 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq -0x58(%rbp), %r12
movq %r12, %rdi
callq 0x3dfc
movq %r12, %rdi
callq 0x252d
movl %eax, %r12d
leaq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x3dfc
leaq -0x40(%rbp), %rdi
callq 0x252d
movl %eax, %r13d
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x3156
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x316b
movq -0x48(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
cmpl %r13d, %r12d
jae 0x3182
movq %r15, %rdi
movq %r14, %rsi
callq 0x3e7c
movl $0x1, %eax
jmp 0x3186
movl (%rbx), %eax
incl %eax
movl %eax, (%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x31b4
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
jmp 0x31b4
movq %rax, %rbx
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x31c9
movq -0x48(%rbp), %rsi
subq %rdi, %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x21d0