LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/monoclock.c
// Function: monoclock_get
int
monoclock_get(struct timeval * tv)
{
#if defined(USE_MONOTONIC) || defined(USE_REALTIME)
	struct timespec tp;
#endif

#ifdef USE_MONOTONIC
	if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) {
		tv->tv_sec = tp.tv_sec;
		tv->tv_usec = (suseconds_t)(tp.tv_nsec / 1000);
	} else if ((errno != ENOSYS) && (errno != EINVAL)) {
		warnp("clock_gettime(CLOCK_MONOTONIC)");
		goto err0;
	} else
#endif
#ifdef USE_REALTIME
	if (clock_gettime(CLOCK_REALTIME, &tp) == 0) {
		tv->tv_sec = tp.tv_sec;
		tv->tv_usec = (suseconds_t)(tp.tv_nsec / 1000);
	} else {
		warnp("clock_gettime(CLOCK_REALTIME)");
		goto err0;
	}
#else
	if (gettimeofday(tv, NULL)) {
		warnp("gettimeofday");
		goto err0;
	}
#endif

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
pushq $0x1
popq %rdi
movq %rsp, %rsi
callq 0x2100
testl %eax, %eax
je 0x3879
callq 0x2090
movq %rax, %r14
movl (%rax), %eax
testl %eax, %eax
je 0x3897
cmpl $0x16, %eax
je 0x385a
cmpl $0x26, %eax
jne 0x38a0
xorl %ebp, %ebp
movq %rsp, %rsi
xorl %edi, %edi
callq 0x2100
testl %eax, %eax
je 0x38b4
cmpl $0x0, (%r14)
je 0x38d0
leaq 0x3ab8(%rip), %rdi      # 0x732f
jmp 0x38a7
movq (%rsp), %rax
movq %rax, (%rbx)
movq 0x8(%rsp), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq %rax, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0x38e1
leaq 0x3a72(%rip), %rdi      # 0x7310
jmp 0x38d7
leaq 0x3a69(%rip), %rdi      # 0x7310
xorl %eax, %eax
callq 0x4919
andl $0x0, (%r14)
jmp 0x38de
movq (%rsp), %rax
movq %rax, (%rbx)
movq 0x8(%rsp), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq %rax, 0x8(%rbx)
jmp 0x38e1
leaq 0x3a58(%rip), %rdi      # 0x732f
xorl %eax, %eax
callq 0x4aa8
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/monoclock.c
// Function: monoclock_get_cputime
int
monoclock_get_cputime(struct timeval * tv)
{
	/* Use CLOCK_PROCESS_CPUTIME_ID if available. */
#ifdef CLOCK_PROCESS_CPUTIME_ID
	struct timespec tp;

	if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tp) == 0) {
		tv->tv_sec = tp.tv_sec;
		tv->tv_usec = (suseconds_t)(tp.tv_nsec / 1000);
	} else if ((errno != ENOSYS) && (errno != EINVAL)) {
		warnp("clock_gettime(CLOCK_PROCESS_CPUTIME_ID)");
		goto err0;
	} else
#endif
	/* Fall back to monoclock_get(). */
	if (monoclock_get(tv))
		goto err0;

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
pushq $0x2
popq %rdi
leaq 0x8(%rsp), %rsi
callq 0x2100
testl %eax, %eax
je 0x392d
callq 0x2090
movq %rax, %r14
movl (%rax), %eax
testl %eax, %eax
je 0x394c
cmpl $0x16, %eax
je 0x391f
cmpl $0x26, %eax
jne 0x395c
movq %rbx, %rdi
callq 0x3828
testl %eax, %eax
jne 0x396e
jmp 0x3948
movq 0x8(%rsp), %rax
movq %rax, (%rbx)
movq 0x10(%rsp), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq %rax, 0x8(%rbx)
xorl %eax, %eax
jmp 0x3971
leaq 0x39fa(%rip), %rdi      # 0x734d
xorl %eax, %eax
callq 0x4aa8
jmp 0x396e
leaq 0x39ea(%rip), %rdi      # 0x734d
xorl %eax, %eax
callq 0x4919
andl $0x0, (%r14)
pushq $-0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/monoclock.c
// Function: monoclock_getres
int
monoclock_getres(double * resd)
{
#if defined(USE_MONOTONIC) || defined(USE_REALTIME)
	struct timespec res;
#endif

#ifdef USE_MONOTONIC
	if (clock_getres(CLOCK_MONOTONIC, &res) == 0) {
		/* Convert clock resolution to a double. */
		*resd = (double)res.tv_sec + (double)res.tv_nsec * 0.000000001;
	} else if ((errno != ENOSYS) && (errno != EINVAL)) {
		warnp("clock_getres(CLOCK_MONOTONIC)");
		goto err0;
	} else
#endif
#ifdef USE_REALTIME
	if (clock_getres(CLOCK_REALTIME, &res) == 0) {
		/* Convert clock resolution to a double. */
		*resd = (double)res.tv_sec + (double)res.tv_nsec * 0.000000001;
	} else {
		warnp("clock_getres(CLOCK_REALTIME)");
		goto err0;
	}
#else
	/*
	 * We'll be using gettimeofday().  There is no standard way of getting
	 * the resolution of this clock, but it seems safe to assume that it
	 * ticks at a minimum rate of CLOCKS_PER_SEC Hz (even though that is
	 * defined in relation to the measurement of processor time usage, not
	 * wallclock time); on non-broken systems we'll be relying on
	 * clock_gettime and clock_getres anyway.
	 */
	*resd = 1.0 / CLOCKS_PER_SEC;
#endif

	/* Success! */
	return (0);

#if defined(USE_MONOTONIC) || defined(USE_REALTIME)
err0:
	/* Failure! */
	return (-1);
#endif
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
pushq $0x1
popq %rdi
leaq 0x8(%rsp), %rsi
callq 0x2230
testl %eax, %eax
je 0x39cb
callq 0x2090
movq %rax, %r14
movl (%rax), %eax
testl %eax, %eax
je 0x39ed
cmpl $0x16, %eax
je 0x39ac
cmpl $0x26, %eax
jne 0x39f6
leaq 0x8(%rsp), %rsi
xorl %edi, %edi
callq 0x2230
testl %eax, %eax
je 0x39cb
cmpl $0x0, (%r14)
je 0x3a0a
leaq 0x39ca(%rip), %rdi      # 0x7393
jmp 0x39fd
cvtsi2sdq 0x8(%rsp), %xmm0
cvtsi2sdq 0x10(%rsp), %xmm1
mulsd 0x3927(%rip), %xmm1     # 0x7308
addsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
xorl %eax, %eax
jmp 0x3a1b
leaq 0x3981(%rip), %rdi      # 0x7375
jmp 0x3a11
leaq 0x3978(%rip), %rdi      # 0x7375
xorl %eax, %eax
callq 0x4919
andl $0x0, (%r14)
jmp 0x3a18
leaq 0x3982(%rip), %rdi      # 0x7393
xorl %eax, %eax
callq 0x4aa8
pushq $-0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/sock.c
// Function: sock_resolve_one
struct sock_addr *
sock_resolve_one(const char * addr, int addport)
{
	struct sock_addr ** sas;
	struct sock_addr * sa;
	struct sock_addr ** sa_tmp;
	char * addr_alloc = NULL;

	/* Prepare the address to resolve. */
	if (addport &&
	    ((addr = addr_alloc = sock_addr_ensure_port(addr)) == NULL)) {
		warnp("sock_addr_ensure_port");
		goto err0;
	}

	/* Resolve target address. */
	if ((sas = sock_resolve(addr)) == NULL) {
		warnp("Error resolving socket address: %s", addr);
		goto err1;
	}

	/* Check that the array is not empty. */
	if (sas[0] == NULL) {
		warn0("No addresses found for %s", addr);
		goto err2;
	}

	/* If there's more than one address, give a warning. */
	if (sas[1] != NULL)
		warn0("Using the first of multiple addresses found for %s",
		    addr);

	/* Keep the address we want. */
	sa = sas[0];

	/* Free the other addresses and list. */
	for (sa_tmp = &sas[1]; *sa_tmp != NULL; sa_tmp++)
		sock_addr_free(*sa_tmp);
	free(sas);

	/* Clean up. */
	free(addr_alloc);

	/* Success! */
	return (sa);

err2:
	sock_addr_freelist(sas);
err1:
	free(addr_alloc);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r15
testl %esi, %esi
je 0x3f18
movq %r15, %rdi
callq 0x47ab
movq %rax, %r15
movq %rax, %rbx
testq %rax, %rax
jne 0x3f1a
callq 0x2090
cmpl $0x0, (%rax)
je 0x3ff4
movq %rax, %rbx
leaq 0x351b(%rip), %rdi      # 0x7421
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x4919
andl $0x0, (%rbx)
jmp 0x3fe7
xorl %ebx, %ebx
movq %r15, %rdi
callq 0x3a24
testq %rax, %rax
je 0x3f84
movq %rax, %r12
movq (%rax), %r14
testq %r14, %r14
je 0x3fa8
movq 0x8(%r12), %r13
testq %r13, %r13
je 0x3f55
leaq 0x3531(%rip), %rdi      # 0x7474
movq %r15, %rsi
xorl %eax, %eax
callq 0x4aa8
callq 0x2090
andl $0x0, (%rax)
movq %r12, %r15
addq $0x10, %r15
testq %r13, %r13
je 0x3f72
movq %r13, %rdi
callq 0x4007
movq (%r15), %r13
addq $0x8, %r15
jmp 0x3f5c
movq %r12, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
jmp 0x3fe7
callq 0x2090
cmpl $0x0, (%rax)
je 0x3fcb
movq %rax, %r14
leaq 0x349f(%rip), %rdi      # 0x7437
movq %r15, %rsi
xorl %eax, %eax
callq 0x4919
andl $0x0, (%r14)
jmp 0x3fdc
leaq 0x34ab(%rip), %rdi      # 0x745a
movq %r15, %rsi
xorl %eax, %eax
callq 0x4aa8
callq 0x2090
andl $0x0, (%rax)
movq %r12, %rdi
callq 0x4023
jmp 0x3fdc
leaq 0x3465(%rip), %rdi      # 0x7437
movq %r15, %rsi
xorl %eax, %eax
callq 0x4aa8
movq %rbx, %rdi
callq 0x2040
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x3426(%rip), %rdi      # 0x7421
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x4aa8
jmp 0x3fe7
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/sock.c
// Function: sock_addr_freelist
void
sock_addr_freelist(struct sock_addr ** sas)
{
	struct sock_addr ** p;

	/* Behave consistently with free(NULL). */
	if (sas == NULL)
		return;

	/* Free structures until we hit NULL. */
	for (p = sas; *p != NULL; p++)
		sock_addr_free(*p);

	/* Free the list. */
	free(sas);
}

// Assembly:
testq %rdi, %rdi
je 0x4054
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rdi, %r14
movq (%r14), %rdi
testq %rdi, %rdi
je 0x4045
callq 0x4007
addq $0x8, %r14
jmp 0x4032
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2040
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/sock.c
// Function: sock_listener
int
sock_listener(const struct sock_addr * sa)
{
	int s;
	int val = 1;

	/* Create a socket. */
	if ((s = socket(sa->ai_family, sa->ai_socktype, 0)) == -1) {
		warnp("socket(%d, %d)", sa->ai_family, sa->ai_socktype);
		goto err0;
	}

	/* Attempt to set SO_REUSEADDR. */
	if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val))) {
		/* ENOPROTOOPT is ok. */
		if (errno != ENOPROTOOPT) {
			warnp("setsockopt(SO_REUSEADDR)");
			goto err1;
		}
	}

	/* Bind the socket. */
	if (bind(s, sa->name, sa->namelen)) {
		warnp("Error binding socket");
		goto err1;
	}

	/* Mark the socket as listening. */
	if (listen(s, 10)) {
		warnp("Error marking socket as listening");
		goto err1;
	}

	/* Mark the socket as non-blocking. */
	if (fcntl(s, F_SETFL, O_NONBLOCK) == -1) {
		warnp("Error marking socket as non-blocking");
		goto err1;
	}

	/* Success! */
	return (s);

err1:
	if (close(s))
		warnp("close");
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movl $0x1, 0xc(%rsp)
movl (%rdi), %edi
movl 0x4(%r14), %esi
xorl %edx, %edx
callq 0x2360
cmpl $-0x1, %eax
je 0x40df
movl %eax, %ebx
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
leaq 0xc(%rsp), %rcx
pushq $0x4
popq %r8
movl %eax, %edi
callq 0x20e0
testl %eax, %eax
je 0x40b2
callq 0x2090
movq %rax, %r15
movl (%rax), %eax
testl %eax, %eax
je 0x414b
cmpl $0x5c, %eax
jne 0x4154
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
movl %ebx, %edi
callq 0x2290
testl %eax, %eax
je 0x411c
callq 0x2090
cmpl $0x0, (%rax)
je 0x4168
movq %rax, %r14
leaq 0x33f2(%rip), %rdi      # 0x74cf
jmp 0x413e
callq 0x2090
cmpl $0x0, (%rax)
movl (%r14), %esi
movl 0x4(%r14), %edx
je 0x4106
movq %rax, %rbx
leaq 0x33ad(%rip), %rdi      # 0x74a7
xorl %eax, %eax
callq 0x4919
andl $0x0, (%rbx)
jmp 0x4114
leaq 0x339a(%rip), %rdi      # 0x74a7
xorl %eax, %eax
callq 0x4aa8
pushq $-0x1
popq %rbx
jmp 0x41e8
pushq $0xa
popq %rsi
movl %ebx, %edi
callq 0x2250
testl %eax, %eax
je 0x4171
callq 0x2090
cmpl $0x0, (%rax)
je 0x419d
movq %rax, %r14
leaq 0x33a6(%rip), %rdi      # 0x74e4
xorl %eax, %eax
callq 0x4919
andl $0x0, (%r14)
jmp 0x41ab
leaq 0x3364(%rip), %rdi      # 0x74b6
jmp 0x41a4
leaq 0x335b(%rip), %rdi      # 0x74b6
xorl %eax, %eax
callq 0x4919
andl $0x0, (%r15)
jmp 0x41ab
leaq 0x3360(%rip), %rdi      # 0x74cf
jmp 0x41a4
pushq $0x4
popq %rsi
movl %ebx, %edi
movl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
callq 0x20f0
cmpl $-0x1, %eax
jne 0x41e8
callq 0x2090
cmpl $0x0, (%rax)
je 0x41f4
movq %rax, %r14
leaq 0x336b(%rip), %rdi      # 0x7506
jmp 0x413e
leaq 0x3340(%rip), %rdi      # 0x74e4
xorl %eax, %eax
callq 0x4aa8
movl %ebx, %edi
callq 0x2180
pushq $-0x1
popq %rbx
testl %eax, %eax
je 0x41e8
callq 0x2090
cmpl $0x0, (%rax)
je 0x41da
movq %rax, %r14
leaq 0x335e(%rip), %rdi      # 0x752b
xorl %eax, %eax
callq 0x4919
andl $0x0, (%r14)
jmp 0x41e8
leaq 0x334a(%rip), %rdi      # 0x752b
xorl %eax, %eax
callq 0x4aa8
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x330b(%rip), %rdi      # 0x7506
jmp 0x41a4
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/sock.c
// Function: sock_connect
int
sock_connect(struct sock_addr * const * sas)
{
	int s = -1;

	/* Iterate through the addresses provided. */
	for (; sas[0] != NULL; sas++) {
		/* Create a socket. */
		if ((s = socket(sas[0]->ai_family,
		    sas[0]->ai_socktype, 0)) == -1)
			continue;

		/* Attempt to connect. */
		if (connect(s, sas[0]->name, sas[0]->namelen) == 0)
			break;

		/* Close the socket; this address didn't work. */
		if (close(s))
			warnp("close");
	}

	/* Did we manage to connect? */
	if (sas[0] == NULL) {
		warn0("Could not connect");
		goto err0;
	}

	/* Mark the socket as non-blocking. */
	if (fcntl(s, F_SETFL, O_NONBLOCK) == -1) {
		warnp("Cannot make connection non-blocking");
		goto err1;
	}

	/* Success! */
	return (s);

err1:
	if (close(s))
		warnp("close");
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x331f(%rip), %r15      # 0x752b
movq (%r14), %rax
testq %rax, %rax
je 0x42b4
movl (%rax), %edi
movl 0x4(%rax), %esi
xorl %edx, %edx
callq 0x2360
cmpl $-0x1, %eax
je 0x4271
movl %eax, %ebx
movq (%r14), %rax
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
movl %ebx, %edi
callq 0x22d0
testl %eax, %eax
je 0x4277
movl %ebx, %edi
callq 0x2180
testl %eax, %eax
je 0x4271
callq 0x2090
cmpl $0x0, (%rax)
je 0x4267
movq %rax, %rbx
movq %r15, %rdi
xorl %eax, %eax
callq 0x4919
andl $0x0, (%rbx)
jmp 0x4271
movq %r15, %rdi
xorl %eax, %eax
callq 0x4aa8
addq $0x8, %r14
jmp 0x420c
cmpq $0x0, (%r14)
je 0x42b4
pushq $0x4
popq %rsi
movl %ebx, %edi
movl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
callq 0x20f0
cmpl $-0x1, %eax
jne 0x42cd
callq 0x2090
movq %rax, %r14
cmpl $0x0, (%rax)
je 0x42d5
leaq 0x329c(%rip), %rdi      # 0x7543
xorl %eax, %eax
callq 0x4919
andl $0x0, (%r14)
jmp 0x42e3
leaq 0x3276(%rip), %rdi      # 0x7531
xorl %eax, %eax
callq 0x4aa8
callq 0x2090
andl $0x0, (%rax)
pushq $-0x1
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3267(%rip), %rdi      # 0x7543
xorl %eax, %eax
callq 0x4aa8
movl %ebx, %edi
callq 0x2180
pushq $-0x1
popq %rbx
testl %eax, %eax
je 0x42cd
cmpl $0x0, (%r14)
je 0x430b
leaq 0x322d(%rip), %rdi      # 0x752b
xorl %eax, %eax
callq 0x4919
andl $0x0, (%r14)
jmp 0x42cd
leaq 0x3219(%rip), %rdi      # 0x752b
xorl %eax, %eax
callq 0x4aa8
jmp 0x42cd
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/sock_util.c
// Function: sock_addr_cmp
int
sock_addr_cmp(const struct sock_addr * sa1, const struct sock_addr * sa2)
{

	/* Family, socket type, and name length must match. */
	if ((sa1->ai_family != sa2->ai_family) ||
	    (sa1->ai_socktype != sa2->ai_socktype) ||
	    (sa1->namelen != sa2->namelen))
		return (1);

	/* The required length of the sockaddr must match. */
	if (memcmp(sa1->name, sa2->name, sa1->namelen) != 0)
		return (1);

	/* Everything matched. */
	return (0);
}

// Assembly:
movl (%rdi), %ecx
pushq $0x1
popq %rax
cmpl (%rsi), %ecx
jne 0x4530
movl 0x4(%rdi), %ecx
cmpl 0x4(%rsi), %ecx
jne 0x4530
movl 0x10(%rdi), %edx
cmpl 0x10(%rsi), %edx
jne 0x4530
pushq %rax
movq 0x8(%rdi), %rdi
movq 0x8(%rsi), %rsi
callq 0x2260
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/sock_util.c
// Function: sock_addr_dup
struct sock_addr *
sock_addr_dup(const struct sock_addr * sa)
{
	struct sock_addr * sa2;

	/* Allocate a struct sock_addr and copy fields. */
	if ((sa2 = malloc(sizeof(struct sock_addr))) == NULL)
		goto err0;
	sa2->ai_family = sa->ai_family;
	sa2->ai_socktype = sa->ai_socktype;
	sa2->namelen = sa->namelen;

	/* Allocate and copy the sockaddr. */
	if ((sa2->name = malloc(sa2->namelen)) == NULL)
		goto err1;
	memcpy(sa2->name, sa->name, sa2->namelen);

	/* Success! */
	return (sa2);

err1:
	free(sa2);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
pushq $0x18
popq %rdi
callq 0x2220
testq %rax, %rax
je 0x4581
movq %rax, %rbx
movq (%r14), %rax
movq %rax, (%rbx)
movl 0x10(%r14), %r15d
movl %r15d, 0x10(%rbx)
movq %r15, %rdi
callq 0x2220
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x4579
movq 0x8(%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x21e0
jmp 0x4583
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/sock_util.c
// Function: sock_addr_serialize
int
sock_addr_serialize(const struct sock_addr * sa,
    uint8_t ** buf, size_t * buflen)
{
	uint8_t * p;

	/* Compute buffer length and allocate buffer. */
	*buflen = 2 * sizeof(int) + sizeof(socklen_t) + sa->namelen;
	if ((p = *buf = malloc(*buflen)) == NULL)
		goto err0;

	/* Copy in data. */
	memcpy(p, &sa->ai_family, sizeof(int));
	p += sizeof(int);
	memcpy(p, &sa->ai_socktype, sizeof(int));
	p += sizeof(int);
	memcpy(p, &sa->namelen, sizeof(socklen_t));
	p += sizeof(socklen_t);
	memcpy(p, sa->name, sa->namelen);

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x10(%rdi), %edi
addq $0xc, %rdi
movq %rdi, (%rdx)
callq 0x2220
movq %rax, (%r14)
testq %rax, %rax
je 0x462a
movq (%rbx), %rcx
movq %rcx, (%rax)
movl 0x10(%rbx), %edx
movl %edx, 0x8(%rax)
addq $0xc, %rax
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x21e0
xorl %eax, %eax
jmp 0x462d
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/sock_util.c
// Function: sock_addr_deserialize
struct sock_addr *
sock_addr_deserialize(const uint8_t * buf, size_t buflen)
{
	struct sock_addr * sa;

	/* Sanity check. */
	if (buflen < 2 * sizeof(int) + sizeof(socklen_t))
		goto err0;

	/* Allocate a structure and copy in fields. */
	if ((sa = malloc(sizeof(struct sock_addr))) == NULL)
		goto err0;
	memcpy(&sa->ai_family, buf, sizeof(int));
	buf += sizeof(int);
	memcpy(&sa->ai_socktype, buf, sizeof(int));
	buf += sizeof(int);
	memcpy(&sa->namelen, buf, sizeof(socklen_t));
	buf += sizeof(socklen_t);

	/* Allocate and copy the sockaddr. */
	if (buflen != 2 * sizeof(int) + sizeof(socklen_t) + sa->namelen)
		goto err1;
	if ((sa->name = malloc(sa->namelen)) == NULL)
		goto err1;
	memcpy(sa->name, buf, sa->namelen);

	/* Success! */
	return (sa);

err1:
	free(sa);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpq $0xc, %rsi
jb 0x469d
movq %rsi, %r12
movq %rdi, %r14
pushq $0x18
popq %rdi
callq 0x2220
testq %rax, %rax
je 0x469d
movq %rax, %rbx
movq (%r14), %rax
movq %rax, (%rbx)
movl 0x8(%r14), %r15d
movl %r15d, 0x10(%rbx)
leaq 0xc(%r15), %rax
cmpq %r12, %rax
jne 0x4695
movq %r15, %rdi
callq 0x2220
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x4695
addq $0xc, %r14
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x21e0
jmp 0x469f
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/sock_util.c
// Function: sock_addr_prettyprint
char *
sock_addr_prettyprint(const struct sock_addr * sa)
{

	/* Handle different types of addresses differently. */
	switch (sa->ai_family) {
	case AF_INET:
		return (prettyprint_ipv4(sa->name, sa->namelen));
	case AF_INET6:
		return (prettyprint_ipv6(sa->name, sa->namelen));
	case AF_UNIX:
		return (prettyprint_unix((struct sockaddr_un *)(sa->name)));
	default:
		return (strdup("Unknown address"));
	}
}

// Assembly:
pushq %rbx
subq $0x60, %rsp
movl (%rdi), %eax
cmpl $0x1, %eax
je 0x4790
cmpl $0xa, %eax
je 0x4720
cmpl $0x2, %eax
jne 0x479a
cmpl $0x10, 0x10(%rdi)
jne 0x4785
movq 0x8(%rdi), %rax
movups (%rax), %xmm0
leaq 0x34(%rsp), %rsi
movaps %xmm0, -0x4(%rsi)
pushq $0x2
popq %rdi
leaq 0x10(%rsp), %rdx
pushq $0x10
popq %rcx
callq 0x2030
testq %rax, %rax
je 0x4785
movzwl 0x32(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %ecx
leaq 0x2fc8(%rip), %rsi      # 0x76da
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rdx
jmp 0x4772
cmpl $0x1c, 0x10(%rdi)
jne 0x4785
movq 0x8(%rdi), %rax
movups (%rax), %xmm0
movups 0xc(%rax), %xmm1
leaq 0x18(%rsp), %rsi
movups %xmm1, 0x4(%rsi)
movaps %xmm0, -0x8(%rsi)
pushq $0xa
popq %rdi
leaq 0x30(%rsp), %rdx
pushq $0x2e
popq %rcx
callq 0x2030
testq %rax, %rax
je 0x4785
movzwl 0x12(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %ecx
leaq 0x2f74(%rip), %rsi      # 0x76da
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rdx
xorl %eax, %eax
callq 0x5ca0
cmpl $-0x1, %eax
je 0x4787
movq 0x8(%rsp), %rbx
jmp 0x4787
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x60, %rsp
popq %rbx
retq
movq 0x8(%rdi), %rdi
addq $0x2, %rdi
jmp 0x47a1
leaq 0x2e82(%rip), %rdi      # 0x7623
addq $0x60, %rsp
popq %rbx
jmp 0x2300
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/sock_util.c
// Function: sock_addr_validate
int
sock_addr_validate(const char * addr)
{

	/* Sanity check. */
	assert(addr != NULL);

	/* Check for an empty address. */
	if (strlen(addr) == 0) {
		warn0("Empty socket address.");
		goto err0;
	}

	/* If this isn't a UNIX socket address, check for a missing hostname. */
	if ((addr[0] != '/') && (addr[0] == ':')) {
		warn0("No host in \"%s\"", addr);
		goto err0;
	}

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x487d
movq %rdi, %rsi
movzbl (%rdi), %ecx
cmpl $0x3a, %ecx
je 0x4862
xorl %eax, %eax
testl %ecx, %ecx
jne 0x487b
leaq 0x2e5b(%rip), %rdi      # 0x76b4
xorl %eax, %eax
callq 0x4aa8
jmp 0x4870
leaq 0x2e61(%rip), %rdi      # 0x76ca
xorl %eax, %eax
callq 0x4aa8
callq 0x2090
andl $0x0, (%rax)
pushq $-0x1
popq %rax
popq %rcx
retq
leaq 0x2daf(%rip), %rdi      # 0x7633
leaq 0x2db5(%rip), %rsi      # 0x7640
leaq 0x2dfd(%rip), %rcx      # 0x768f
movl $0x15e, %edx            # imm = 0x15E
callq 0x2160
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/warnp.c
// Function: warnp_setprogname
void
warnp_setprogname(const char * progname)
{
	const char * p;

	/* Free the name if we already have one. */
	free(name);

	/* Find the last segment of the program name. */
	for (p = progname; progname[0] != '\0'; progname++)
		if (progname[0] == '/')
			p = progname + 1;

	/* Copy the name string. */
	name = strdup(p);

	/* If we haven't already done so, register our exit handler. */
	if (initialized == 0) {
		atexit(warnp_atexit);
		initialized = 1;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x16c81(%rip), %rdi     # 0x1b528
callq 0x2040
leaq 0x1(%rbx), %rax
movzbl -0x1(%rax), %ecx
cmpl $0x2f, %ecx
je 0x48bf
testl %ecx, %ecx
jne 0x48c2
jmp 0x48c7
movq %rax, %rbx
incq %rax
jmp 0x48b0
movq %rbx, %rdi
callq 0x2300
movq %rax, 0x16c52(%rip)     # 0x1b528
cmpb $0x0, 0x16c53(%rip)     # 0x1b530
jne 0x48f2
leaq 0xe(%rip), %rdi         # 0x48f4
callq 0x6370
movb $0x1, 0x16c3e(%rip)     # 0x1b530
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/warnp.c
// Function: libcperciva_warn
void
warn(const char * fmt, ...)
{
	va_list ap;
	char msgbuf[WARNP_SYSLOG_MAX_LINE + 1];
	int saved_errno;

	/* Save errno in case it gets clobbered. */
	saved_errno = errno;

	va_start(ap, fmt);
	if (use_syslog == 0) {
		/* Stop other threads writing to stderr. */
		flockfile(stderr);

		/* Print to stderr. */
		fprintf(stderr, "%s", (name != NULL) ? name : "(unknown)");
		if (fmt != NULL) {
			fprintf(stderr, ": ");
			vfprintf(stderr, fmt, ap);
		}
		fprintf(stderr, ": %s\n", strerror(saved_errno));

		/* Allow other threads to write to stderr. */
		funlockfile(stderr);
	} else {
		/* Print to syslog. */
		if (fmt != NULL) {
			/* No need to print "${name}: "; syslog does it. */
			vsnprintf(msgbuf, WARNP_SYSLOG_MAX_LINE + 1, fmt, ap);
			syslog(syslog_priority, "%s: %s\n", msgbuf,
			    strerror(saved_errno));
		} else
			syslog(syslog_priority, "%s\n", strerror(saved_errno));
	}
	va_end(ap);

	/* Restore saved errno. */
	errno = saved_errno;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x10d8, %rsp           # imm = 0x10D8
movq %rdi, %r14
leaq 0x20(%rsp), %r15
movq %rsi, 0x8(%r15)
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x497d
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
callq 0x2090
movq %rax, %rbx
movl (%rax), %ebp
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsp)
leaq 0x1100(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r15, 0x10(%rsp)
cmpl $0x0, 0x16b86(%rip)     # 0x1b534
je 0x4a29
testq %r14, %r14
je 0x49f7
leaq 0xd0(%rsp), %r15
movq %rsp, %rcx
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
movq %r14, %rdx
callq 0x20d0
movl 0x6a81(%rip), %r14d     # 0xb458
movl %ebp, %edi
callq 0x2310
leaq 0x2d0a(%rip), %rsi      # 0x76ef
movl %r14d, %edi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x2240
jmp 0x4a19
movl 0x6a5a(%rip), %r14d     # 0xb458
movl %ebp, %edi
callq 0x2310
leaq 0x2ce7(%rip), %rsi      # 0x76f3
movl %r14d, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2240
movl %ebp, (%rbx)
addq $0x10d8, %rsp           # imm = 0x10D8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x65c8(%rip), %r15      # 0xaff8
movq (%r15), %rdi
callq 0x2190
movq (%r15), %rsi
movq 0x16ae6(%rip), %rax     # 0x1b528
testq %rax, %rax
leaq 0x2c96(%rip), %rdi      # 0x76e2
cmovneq %rax, %rdi
callq 0x2170
testq %r14, %r14
je 0x4a7d
movq (%r15), %rcx
leaq 0x2c88(%rip), %rdi      # 0x76ec
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
callq 0x22e0
movq (%r15), %rdi
movq %rsp, %rdx
movq %r14, %rsi
callq 0x22a0
movq (%r15), %r14
movl %ebp, %edi
callq 0x2310
leaq 0x2c63(%rip), %rsi      # 0x76f1
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x21d0
movq (%r15), %rdi
callq 0x2070
jmp 0x4a19
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/util/warnp.c
// Function: libcperciva_warnx
void
warnx(const char * fmt, ...)
{
	va_list ap;
	char msgbuf[WARNP_SYSLOG_MAX_LINE + 1];
	int saved_errno;

	/* Save errno in case it gets clobbered. */
	saved_errno = errno;

	va_start(ap, fmt);
	if (use_syslog == 0) {
		/* Stop other threads writing to stderr. */
		flockfile(stderr);

		/* Print to stderr. */
		fprintf(stderr, "%s", (name != NULL) ? name : "(unknown)");
		if (fmt != NULL) {
			fprintf(stderr, ": ");
			vfprintf(stderr, fmt, ap);
		}
		fprintf(stderr, "\n");

		/* Allow other threads to write to stderr. */
		funlockfile(stderr);
	} else {
		/* Print to syslog. */
		if (fmt != NULL) {
			/* No need to print "${name}: "; syslog does it. */
			vsnprintf(msgbuf, WARNP_SYSLOG_MAX_LINE + 1, fmt, ap);
			syslog(syslog_priority, "%s\n", msgbuf);
		} else
			syslog(syslog_priority, "\n");
	}
	va_end(ap);

	/* Restore saved errno. */
	errno = saved_errno;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x10d8, %rsp           # imm = 0x10D8
movq %rdi, %r14
leaq 0x20(%rsp), %r15
movq %rsi, 0x8(%r15)
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x4b0c
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
callq 0x2090
movq %rax, %rbx
movl (%rax), %ebp
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsp)
leaq 0x1100(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r15, 0x10(%rsp)
cmpl $0x0, 0x169f7(%rip)     # 0x1b534
je 0x4b9c
testq %r14, %r14
je 0x4b78
leaq 0xd0(%rsp), %r15
movq %rsp, %rcx
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
movq %r14, %rdx
callq 0x20d0
movl 0x68f3(%rip), %edi      # 0xb458
leaq 0x2b87(%rip), %rsi      # 0x76f3
movq %r15, %rdx
xorl %eax, %eax
callq 0x2240
jmp 0x4b8c
movl 0x68da(%rip), %edi      # 0xb458
leaq 0x2b70(%rip), %rsi      # 0x76f5
xorl %eax, %eax
callq 0x2240
movl %ebp, (%rbx)
addq $0x10d8, %rsp           # imm = 0x10D8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x6455(%rip), %r15      # 0xaff8
movq (%r15), %rdi
callq 0x2190
movq (%r15), %rsi
movq 0x16973(%rip), %rax     # 0x1b528
testq %rax, %rax
leaq 0x2b23(%rip), %rdi      # 0x76e2
cmovneq %rax, %rdi
callq 0x2170
testq %r14, %r14
jne 0x4be2
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x21b0
movq (%r15), %rdi
callq 0x2070
jmp 0x4b8c
movq (%r15), %rcx
leaq 0x2b00(%rip), %rdi      # 0x76ec
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
callq 0x22e0
movq (%r15), %rdi
movq %rsp, %rdx
movq %r14, %rsi
callq 0x22a0
jmp 0x4bcd
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/serverpool/serverpool.c
// Function: addaddr
static int
addaddr(struct serverpool * P, struct sock_addr * sa)
{
	struct serverpool_addr SPA;
	struct serverpool_addr * SPAp;
	size_t i;

	/* Do we already have this address? */
	for (i = 0; i < serverpool_addrs_getsize(P->A); i++) {
		SPAp = serverpool_addrs_get(P->A, i);
		if (sock_addr_cmp(sa, SPAp->sa) == 0) {
			/* Update EOL and generation number. */
			if (monoclock_get(&SPAp->eol))
				goto err0;
			SPAp->eol.tv_sec += P->ttl;
			SPAp->generation = P->generation;

			/* All done. */
			goto done;
		}
	}

	/* Copy address. */
	if ((SPA.sa = sock_addr_dup(sa)) == NULL)
		goto err0;

	/* Record EOL. */
	if (monoclock_get(&SPA.eol))
		goto err1;
	SPA.eol.tv_sec += P->ttl;

	/* Record generation. */
	SPA.generation = P->generation;

	/* Add this structure to the array. */
	if (serverpool_addrs_append(P->A, &SPA, 1))
		goto err1;

done:
	/* Success! */
	return (0);

err1:
	sock_addr_free(SPA.sa);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %r15d, %r15d
movq (%rbx), %rdi
callq 0x51b0
cmpq %rax, %r15
jae 0x502d
movq (%rbx), %rdi
movq %r15, %rsi
callq 0x51b8
movq %rax, %r12
movq (%rax), %rsi
movq %r14, %rdi
callq 0x44fc
incq %r15
testl %eax, %eax
jne 0x4fed
leaq 0x8(%r12), %rdi
callq 0x3828
testl %eax, %eax
je 0x507f
pushq $-0x1
popq %rbp
jmp 0x5093
movq %r14, %rdi
callq 0x4531
movq %rax, (%rsp)
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0x5093
leaq 0x8(%rsp), %rdi
callq 0x3828
testl %eax, %eax
jne 0x5074
movq 0x28(%rbx), %rax
movq %rsp, %rsi
addq %rax, 0x8(%rsi)
movq 0x30(%rbx), %rax
movq %rax, 0x18(%rsi)
movq (%rbx), %rdi
pushq $0x1
popq %rdx
pushq $0x20
popq %rcx
callq 0x55e2
testl %eax, %eax
je 0x5091
movq (%rsp), %rdi
callq 0x4007
jmp 0x5093
movq 0x28(%rbx), %rax
addq %rax, 0x8(%r12)
movq 0x30(%rbx), %rax
movq %rax, 0x18(%r12)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/serverpool/serverpool.c
// Function: callback_read_len
static int
callback_read_len(void * cookie, ssize_t readlen)
{
	struct serverpool * P = cookie;

	/* We should get -1 (error), 0 (EOF), or a size_t. */
	assert((readlen == -1) || (readlen == 0) ||
	    (readlen == sizeof(size_t)));

	/* Handle failures. */
	if (readlen == -1)
		goto err1;
	if (readlen == 0)
		goto eof;

	/* Sanity-check. */
	if (P->addrlen > SSIZE_MAX)
		goto err1;

	/* An address length of 0 indicates the end of a generation. */
	if (P->addrlen == 0) {
		P->generation++;

		/* Remove expired addresses from the pool. */
		if (pruneaddrs(P))
			goto err0;

		/* Read another address length. */
		if ((P->read_cookie = network_read(P->s,
		    (uint8_t *)&P->addrlen, sizeof(size_t), sizeof(size_t),
		    callback_read_len, P)) == NULL)
			goto err1;
	} else {
		/* Allocate space to hold the address. */
		if ((P->addr = malloc(P->addrlen)) == NULL)
			goto err0;

		/* Read the address. */
		if ((P->read_cookie = network_read(P->s, P->addr, P->addrlen,
		    P->addrlen, callback_read_addr, P)) == NULL)
			goto err1;
	}

	/* Success! */
	return (0);

eof:
	warn0("DNS lookup process died");

	/* Failure! */
	return (-1);

err1:
	warnp("Error reading address via socket");
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
pushq $-0x1
popq %rbx
cmpq $-0x1, %rsi
je 0x5154
testq %rsi, %rsi
je 0x5103
cmpq $0x8, %rsi
jne 0x5191
movq %rdi, %r14
leaq 0x10(%rdi), %r12
movq 0x10(%rdi), %r15
testq %r15, %r15
js 0x5154
je 0x511b
movq %r15, %rdi
callq 0x2220
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x5183
movl 0x8(%r14), %edi
leaq 0x27c(%rip), %r8        # 0x5374
movq %rax, %rsi
movq %r15, %rdx
movq %r15, %rcx
jmp 0x513f
leaq 0x271e(%rip), %rdi      # 0x7828
xorl %eax, %eax
callq 0x4aa8
callq 0x2090
andl $0x0, (%rax)
jmp 0x5183
incq 0x30(%r14)
movq %r14, %rdi
callq 0x523b
testl %eax, %eax
jne 0x5183
movl 0x8(%r14), %edi
leaq -0x94(%rip), %r8        # 0x50a2
pushq $0x8
popq %rcx
movq %r12, %rsi
movq %rcx, %rdx
movq %r14, %r9
callq 0x5948
movq %rax, 0x20(%r14)
testq %rax, %rax
je 0x5154
xorl %ebx, %ebx
jmp 0x5183
callq 0x2090
cmpl $0x0, (%rax)
je 0x5175
movq %rax, %r14
leaq 0x25be(%rip), %rdi      # 0x7726
xorl %eax, %eax
callq 0x4919
andl $0x0, (%r14)
jmp 0x5183
leaq 0x25aa(%rip), %rdi      # 0x7726
xorl %eax, %eax
callq 0x4aa8
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x2628(%rip), %rdi      # 0x77c0
leaq 0x25cb(%rip), %rsi      # 0x776a
leaq 0x265b(%rip), %rcx      # 0x7801
movl $0x9e, %edx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/serverpool/serverpool.c
// Function: serverpool_pick
struct sock_addr *
serverpool_pick(struct serverpool * P)
{
	size_t i;

	/* Get rid of any expired addresses. */
	if (pruneaddrs(P))
		goto err0;

	/* We should always have at least one address at this point. */
	assert(serverpool_addrs_getsize(P->A) > 0);

	/* Pick a (non-cryptographically) random address. */
	i = (size_t)rand() % serverpool_addrs_getsize(P->A);

	/* Return a copy of the address. */
	return (sock_addr_dup(serverpool_addrs_get(P->A, i)->sa));

err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x523b
testl %eax, %eax
je 0x51da
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%rbx), %rdi
callq 0x51b0
testq %rax, %rax
je 0x521c
callq 0x2340
movslq %eax, %r14
movq (%rbx), %rdi
callq 0x51b0
movq %rax, %rcx
movq %r14, %rax
xorl %edx, %edx
divq %rcx
movq (%rbx), %rdi
movq %rdx, %rsi
callq 0x51b8
movq (%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4531
leaq 0x2524(%rip), %rdi      # 0x7747
leaq 0x2540(%rip), %rsi      # 0x776a
leaq 0x2558(%rip), %rcx      # 0x7789
movl $0x1bc, %edx            # imm = 0x1BC
callq 0x2160
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/serverpool/serverpool.c
// Function: pruneaddrs
static int
pruneaddrs(struct serverpool * P)
{
	struct timeval tv;
	struct serverpool_addr * SPA;
	size_t i;

	/* We need to compare address EOLs against the current time. */
	if (monoclock_get(&tv))
		goto err0;

	/* Iterate through the pool. */
	for (i = 0; i < serverpool_addrs_getsize(P->A); i++) {
		SPA = serverpool_addrs_get(P->A, i);

		/*
		 * Keep anything from the current or immediately previous
		 * generation; we need both in case we're running just as
		 * we start reading addresses for a new generation.
		 */
		if ((SPA->generation == P->generation) ||
		    (SPA->generation == P->generation - 1))
			continue;

		/* Keep if the EOL hasn't expired. */
		if ((SPA->eol.tv_sec > tv.tv_sec) ||
		    ((SPA->eol.tv_sec == tv.tv_sec) &&
		     (SPA->eol.tv_usec > tv.tv_usec)))
			continue;

		/* Free this address. */
		sock_addr_free(SPA->sa);

		/* Replace this with the last structure. */
		memcpy(SPA, serverpool_addrs_get(P->A,
		    serverpool_addrs_getsize(P->A) - 1),
		    sizeof(struct serverpool_addr));

		/* Shrink the array (now that the last element has moved). */
		serverpool_addrs_shrink(P->A, 1);
	}

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3828
testl %eax, %eax
je 0x5270
pushq $-0x1
popq %r14
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
pushq $0x20
popq %r12
xorl %r13d, %r13d
movq (%rbx), %rdi
callq 0x51b0
cmpq %rax, %r13
jae 0x525e
movq (%rbx), %rdi
movq %r13, %rsi
callq 0x51b8
movq %rax, %rbp
movq 0x18(%rax), %rax
movq 0x30(%rbx), %rcx
cmpq %rcx, %rax
sete %dl
decq %rcx
cmpq %rcx, %rax
sete %al
orb %dl, %al
jne 0x5305
movq 0x8(%rsp), %rax
cmpq %rax, 0x8(%rbp)
jg 0x5305
jne 0x52c8
movq 0x10(%rbp), %rax
cmpq 0x10(%rsp), %rax
jg 0x5305
movq (%rbp), %rdi
callq 0x4007
movq (%rbx), %r15
movq %r15, %rdi
callq 0x51b0
leaq -0x1(%rax), %rsi
movq %r15, %rdi
callq 0x51b8
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm0, (%rbp)
movups %xmm1, 0x10(%rbp)
movq (%rbx), %rdi
pushq $0x1
popq %rsi
movq %r12, %rdx
callq 0x567d
incq %r13
jmp 0x527a
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/serverpool/serverpool.c
// Function: serverpool_free
void
serverpool_free(struct serverpool * P)
{
	size_t i;

	/* Behave consistently with free(NULL). */
	if (P == NULL)
		return;

	/* Signal the child process to die. */
	kill(P->pid, SIGTERM);

	/* Stop reading addresses. */
	network_read_cancel(P->read_cookie);

	/* Free the address buffer, if we have a read in progress. */
	free(P->addr);

	/* Free addresses. */
	for (i = serverpool_addrs_getsize(P->A); i > 0; i--)
		sock_addr_free(serverpool_addrs_get(P->A, i - 1)->sa);

	/* Free the list of addresses. */
	serverpool_addrs_free(P->A);

	/* Free the server pool. */
	free(P);
}

// Assembly:
testq %rdi, %rdi
je 0x5373
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0xc(%rdi), %edi
pushq $0xf
popq %rsi
callq 0x2210
movq 0x20(%rbx), %rdi
callq 0x5c1b
movq 0x18(%rbx), %rdi
callq 0x2040
movq (%rbx), %rdi
callq 0x51b0
movq %rax, %r14
decq %r14
movq (%rbx), %rdi
cmpq $-0x1, %r14
je 0x535f
movq %r14, %rsi
callq 0x51b8
movq (%rax), %rdi
callq 0x4007
jmp 0x5341
callq 0x551f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2040
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/serverpool/serverpool.c
// Function: callback_read_addr
static int
callback_read_addr(void * cookie, ssize_t readlen)
{
	struct serverpool * P = cookie;
	struct sock_addr * sa = NULL;

	/* We should get -1 (error), 0 (EOF), or a complete address. */
	assert((readlen == -1) || (readlen == 0) ||
	    ((readlen > 0) && ((size_t)readlen == P->addrlen)));

	/* Handle failures. */
	if (readlen == -1)
		goto err2;
	if (readlen == 0)
		goto eof;

	/* Parse the address. */
	if ((sa = sock_addr_deserialize(P->addr, P->addrlen)) == NULL)
		goto err0;

	/* Free the serialized address. */
	free(P->addr);
	P->addr = NULL;

	/* Add the address to the pool. */
	if (addaddr(P, sa))
		goto err1;

	/* Start reading another address. */
	if ((P->read_cookie = network_read(P->s, (uint8_t *)&P->addrlen,
	    sizeof(size_t), sizeof(size_t), callback_read_len, P)) == NULL)
		goto err2;

	/* Free the parsed address. */
	sock_addr_free(sa);

	/* Success! */
	return (0);

eof:
	warn0("DNS lookup process died");

	/* Failure! */
	return (-1);

err2:
	warnp("Error reading address via socket");
err1:
	sock_addr_free(sa);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
leaq 0x1(%rsi), %rax
cmpq $0x2, %rax
jb 0x5399
testq %rsi, %rsi
jle 0x5468
cmpq %rsi, 0x10(%r15)
jne 0x5468
pushq $-0x1
popq %rbx
cmpq $-0x1, %rsi
je 0x53c2
testq %rsi, %rsi
jne 0x53e6
leaq 0x247a(%rip), %rdi      # 0x7828
xorl %eax, %eax
callq 0x4aa8
callq 0x2090
andl $0x0, (%rax)
jmp 0x5460
xorl %r14d, %r14d
callq 0x2090
cmpl $0x0, (%rax)
je 0x544a
movq %rax, %r15
leaq 0x234d(%rip), %rdi      # 0x7726
xorl %eax, %eax
callq 0x4919
andl $0x0, (%r15)
jmp 0x5458
movq 0x10(%r15), %rsi
movq 0x18(%r15), %rdi
callq 0x4635
testq %rax, %rax
je 0x5460
movq %rax, %r14
movq 0x18(%r15), %rdi
callq 0x2040
andq $0x0, 0x18(%r15)
movq %r15, %rdi
movq %r14, %rsi
callq 0x4fd8
testl %eax, %eax
jne 0x5458
leaq 0x10(%r15), %rsi
movl 0x8(%r15), %edi
leaq -0x385(%rip), %r8       # 0x50a2
pushq $0x8
popq %rcx
movq %rcx, %rdx
movq %r15, %r9
callq 0x5948
movq %rax, 0x20(%r15)
testq %rax, %rax
je 0x53c5
movq %r14, %rdi
callq 0x4007
xorl %ebx, %ebx
jmp 0x5460
leaq 0x22d5(%rip), %rdi      # 0x7726
xorl %eax, %eax
callq 0x4aa8
movq %r14, %rdi
callq 0x4007
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x23d1(%rip), %rdi      # 0x7840
leaq 0x22f4(%rip), %rsi      # 0x776a
leaq 0x241b(%rip), %rcx      # 0x7898
movl $0xdb, %edx
callq 0x2160
nop
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/elasticarray.c
// Function: elasticarray_init
struct elasticarray *
elasticarray_init(size_t nrec, size_t reclen)
{
	struct elasticarray * EA;

	/* Sanity check. */
	assert(reclen > 0);

	/* Allocate structure. */
	if ((EA = malloc(sizeof(struct elasticarray))) == NULL)
		goto err0;

	/* The array is empty for now. */
	EA->size = EA->alloc = 0;
	EA->buf = NULL;

	/* Reallocate to the requested length. */
	if (elasticarray_resize(EA, nrec, reclen))
		goto err1;

	/* Success! */
	return (EA);

err1:
	elasticarray_free(EA);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x54d0
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x21c0
testq %rax, %rax
je 0x54c5
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x54ed
testl %eax, %eax
je 0x54c7
movq %rbx, %rdi
callq 0x551f
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x23e9(%rip), %rdi      # 0x78c0
leaq 0x23ed(%rip), %rsi      # 0x78cb
leaq 0x240f(%rip), %rcx      # 0x78f4
pushq $0x5a
popq %rdx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/elasticarray.c
// Function: elasticarray_append
int
elasticarray_append(struct elasticarray * EA,
    const void * buf, size_t nrec, size_t reclen)
{
	size_t bufpos = EA->size;
	size_t nsize;

	/* Check for overflow. */
	if ((nrec > SIZE_MAX / reclen) ||
	    (nrec * reclen > SIZE_MAX - EA->size)) {
		errno = ENOMEM;
		goto err0;
	}

	/* Resize the buffer. */
	nsize = EA->size + nrec * reclen;
	if (resize(EA, nsize))
		goto err0;

	/* Copy bytes in. */
	if (nrec > 0) {
		/* We shouldn't have requested a 0-size array. */
		assert(nsize > 0);

		/* Copy bytes in. */
		memcpy((uint8_t *)(EA->buf) + bufpos, buf, nrec * reclen);
	}

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r13
movq %rcx, %rax
mulq %rdx
jo 0x560d
movq %rcx, %rbx
movq %rdi, %r15
movq (%rdi), %r14
imulq %r13, %rbx
movq %r14, %r12
addq %rbx, %r12
jae 0x562c
callq 0x2090
movl $0xc, (%rax)
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rbp
movq %r15, %rdi
movq %r12, %rsi
callq 0x553b
testl %eax, %eax
jne 0x5618
movq %rbp, %rsi
xorl %ebp, %ebp
testq %r13, %r13
je 0x561b
testq %r12, %r12
je 0x565e
addq 0x10(%r15), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0x21e0
jmp 0x561b
leaq 0x22c6(%rip), %rdi      # 0x792b
leaq 0x225f(%rip), %rsi      # 0x78cb
leaq 0x22c2(%rip), %rcx      # 0x7935
movl $0xb9, %edx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/elasticarray.c
// Function: elasticarray_shrink
void
elasticarray_shrink(struct elasticarray * EA, size_t nrec, size_t reclen)
{
	size_t nsize;

	/* Figure out how much to keep. */
	if ((nrec > SIZE_MAX / reclen) ||
	    (nrec * reclen > EA->size))
		nsize = 0;
	else
		nsize = EA->size - nrec * reclen;

	/* Resize the buffer... */
	if (resize(EA, nsize)) {
		/*
		 * ... and if we fail to reallocate, just record the new
		 * length and continue using the old buffer.
		 */
		EA->size = nsize;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rcx
movq %rdi, %rbx
movq %rdx, %rax
mulq %rsi
jno 0x5694
xorl %r14d, %r14d
jmp 0x56a5
imulq %rsi, %rcx
movq (%rbx), %rax
xorl %r14d, %r14d
subq %rcx, %rax
cmovaeq %rax, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x553b
testl %eax, %eax
je 0x56b7
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/elasticarray.c
// Function: elasticarray_truncate
int
elasticarray_truncate(struct elasticarray * EA)
{
	void * nbuf;

	/*
	 * Truncating down to zero needs special handling due to some strange
	 * interpretations of what realloc(p, 0) should do if it fails to
	 * allocate zero bytes of memory.
	 */
	if (EA->size == 0) {
		free(EA->buf);
		EA->buf = NULL;
		EA->alloc = 0;
	} else if (EA->alloc > EA->size) {
		/* Reallocate to eliminate spare space if necessary. */
		if ((nbuf = realloc(EA->buf, EA->size)) == NULL)
			goto err0;
		EA->buf = nbuf;
		EA->alloc = EA->size;
	}

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rsi
testq %rsi, %rsi
je 0x56f0
xorl %ebp, %ebp
cmpq %rsi, 0x8(%rbx)
jbe 0x5707
movq 0x10(%rbx), %rdi
callq 0x2270
testq %rax, %rax
je 0x5704
movq %rax, 0x10(%rbx)
movq (%rbx), %rax
movq %rax, 0x8(%rbx)
jmp 0x5707
movq 0x10(%rbx), %rdi
callq 0x2040
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0x5707
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/elasticarray.c
// Function: elasticarray_export
int
elasticarray_export(struct elasticarray * EA, void ** buf, size_t * nrec,
    size_t reclen)
{

	/* Remove any spare space. */
	if (elasticarray_truncate(EA))
		goto err0;

	/* Return the buffer and number of records. */
	*buf = EA->buf;
	*nrec = elasticarray_getsize(EA, reclen);

	/*
	 * Free the elastic array structure -- but not its buffer, since we've
	 * passed the buffer out to the caller.
	 */
	free(EA);

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
callq 0x56bf
testl %eax, %eax
je 0x573f
pushq $-0x1
popq %r12
jmp 0x575d
movq 0x10(%rbx), %rax
movq %rax, (%r12)
movq (%rbx), %rax
xorl %r12d, %r12d
xorl %edx, %edx
divq %r15
movq %rax, (%r14)
movq %rbx, %rdi
callq 0x2040
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/elasticarray.c
// Function: elasticarray_exportdup
int
elasticarray_exportdup(const struct elasticarray * EA, void ** buf,
    size_t * nrec, size_t reclen)
{

	/* Allocate buffer for the caller's copy of the data. */
	if ((*buf = malloc(EA->size)) == NULL)
		goto err0;

	/* Copy the data in. */
	memcpy(*buf, EA->buf, EA->size);

	/* Tell the caller how many records we have. */
	*nrec = elasticarray_getsize(EA, reclen);

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r12
movq (%rdi), %r15
movq %r15, %rdi
callq 0x2220
movq %rax, (%r13)
testq %rax, %rax
je 0x57b4
movq 0x10(%r12), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x21e0
xorl %ecx, %ecx
movq %r15, %rax
xorl %edx, %edx
divq %r14
movq %rax, (%rbx)
jmp 0x57b7
pushq $-0x1
popq %rcx
movl %ecx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop