LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_timer.c
// Function: gettimeout
static int
gettimeout(struct timeval * tv, const struct timeval * tdelta)
{

	if (monoclock_get(tv))
		goto err0;
	tv->tv_sec += tdelta->tv_sec;
	if ((tv->tv_usec += tdelta->tv_usec) >= 1000000) {
		tv->tv_usec -= 1000000;
		tv->tv_sec += 1;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x3c0c
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x3a5c
movq (%rbx), %rcx
addq (%r14), %rcx
movq 0x8(%rbx), %rdx
movq %rcx, (%rbx)
addq 0x8(%r14), %rdx
movq %rdx, 0x8(%rbx)
xorl %eax, %eax
cmpq $0xf4240, %rdx          # imm = 0xF4240
jl 0x3a5c
addq $-0xf4240, %rdx         # imm = 0xFFF0BDC0
movq %rdx, 0x8(%rbx)
incq %rcx
movq %rcx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_timer.c
// Function: events_timer_register_double
void *
events_timer_register_double(int (* func)(void *), void * cookie,
    double timeo)
{
	struct timeval tv;

	/* Convert timeo to a struct timeval. */
	tv.tv_sec = (time_t)timeo;
	tv.tv_usec = (suseconds_t)((timeo - (double)tv.tv_sec) * 1000000.0);

	/* Schedule the timeout. */
	return (events_timer_register(func, cookie, &tv));
}

// Assembly:
subq $0x18, %rsp
cvttsd2si %xmm0, %rax
cvtsi2sd %rax, %xmm1
leaq 0x8(%rsp), %rdx
subsd %xmm1, %xmm0
mulsd 0x3865(%rip), %xmm0     # 0x72e8
movq %rax, (%rdx)
cvttsd2si %xmm0, %rax
movq %rax, 0x8(%rdx)
callq 0x3920
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_timer.c
// Function: events_timer_min
int
events_timer_min(struct timeval ** timeo)
{
	struct timeval tnow;
	const struct timeval * tv;

	/* If we have no queue, we have no timers; return NULL. */
	if (Q == NULL) {
		*timeo = NULL;
		goto done;
	}

	/* Get the minimum timer from the queue. */
	tv = timerqueue_getmin(Q);

	/* If there are no timers, return NULL. */
	if (tv == NULL) {
		*timeo = NULL;
		goto done;
	}

	/* Allocate space for holding the returned timeval. */
	if ((*timeo = malloc(sizeof(struct timeval))) == NULL)
		goto err0;

	/* Get the current time... */
	if (monoclock_get(&tnow))
		goto err1;

	/* ... and compare it to the minimum timer. */
	if ((tnow.tv_sec > tv->tv_sec) ||
	    ((tnow.tv_sec == tv->tv_sec) && (tnow.tv_usec > tv->tv_usec))) {
		/* The timer has already expired, so return zero. */
		(*timeo)->tv_sec = 0;
		(*timeo)->tv_usec = 0;
	} else {
		/* Compute the difference. */
		(*timeo)->tv_sec = tv->tv_sec - tnow.tv_sec;
		(*timeo)->tv_usec = tv->tv_usec - tnow.tv_usec;
		if (tv->tv_usec < tnow.tv_usec) {
			(*timeo)->tv_usec += 1000000;
			(*timeo)->tv_sec -= 1;
		}
	}

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

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x17a16(%rip), %rdi     # 0x1b520
testq %rdi, %rdi
je 0x3b49
callq 0x5eb7
testq %rax, %rax
je 0x3b49
movq %rax, %r14
movl $0x10, %edi
callq 0x2220
movq %rax, (%rbx)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x3b52
movq %rsp, %rdi
callq 0x3c0c
testl %eax, %eax
je 0x3b5d
movq (%rbx), %rdi
callq 0x2040
jmp 0x3b52
movq $0x0, (%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq (%r14), %rax
subq (%rsp), %rax
jge 0x3b71
movq (%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
jmp 0x3b50
jne 0x3b7e
movq 0x8(%rsp), %rcx
cmpq 0x8(%r14), %rcx
jg 0x3b66
movq (%rbx), %rcx
movq %rax, (%rcx)
movq 0x8(%r14), %rdx
subq 0x8(%rsp), %rdx
movq %rdx, 0x8(%rcx)
movq 0x8(%r14), %rsi
xorl %ebp, %ebp
cmpq 0x8(%rsp), %rsi
jge 0x3b52
addq $0xf4240, %rdx          # imm = 0xF4240
movq %rdx, 0x8(%rcx)
decq %rax
movq %rax, (%rcx)
jmp 0x3b52
// File: /workspace/github_c_makefile_star2_O1/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
movq %rsp, %rsi
movl $0x1, %edi
callq 0x2100
testl %eax, %eax
je 0x3c5f
callq 0x2090
movq %rax, %r14
movl (%rax), %eax
testl %eax, %eax
je 0x3c8b
cmpl $0x16, %eax
je 0x3c40
cmpl $0x26, %eax
jne 0x3c94
xorl %ebp, %ebp
movq %rsp, %rsi
xorl %edi, %edi
callq 0x2100
testl %eax, %eax
je 0x3cab
cmpl $0x0, (%r14)
je 0x3cd5
leaq 0x36ba(%rip), %rdi      # 0x7317
jmp 0x3c9b
movq (%rsp), %rax
movq %rax, (%rbx)
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%rsp)
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
movq %rdx, 0x8(%rbx)
xorl %ebp, %ebp
jmp 0x3ce8
leaq 0x3666(%rip), %rdi      # 0x72f8
jmp 0x3cdc
leaq 0x365d(%rip), %rdi      # 0x72f8
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%r14)
jmp 0x3ce3
movq (%rsp), %rax
movq %rax, (%rbx)
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%rsp)
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
movq %rdx, 0x8(%rbx)
jmp 0x3ce8
leaq 0x363b(%rip), %rdi      # 0x7317
xorl %eax, %eax
callq 0x500f
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x8(%rsp), %rsi
movl $0x2, %edi
callq 0x2100
testl %eax, %eax
je 0x3d36
callq 0x2090
movq %rax, %r14
movl (%rax), %eax
testl %eax, %eax
je 0x3d63
cmpl $0x16, %eax
je 0x3d28
cmpl $0x26, %eax
jne 0x3d73
movq %rbx, %rdi
callq 0x3c0c
testl %eax, %eax
jne 0x3d88
jmp 0x3d5f
movq 0x8(%rsp), %rax
movq %rax, (%rbx)
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x10(%rsp)
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
movq %rdx, 0x8(%rbx)
xorl %eax, %eax
jmp 0x3d8d
leaq 0x35cb(%rip), %rdi      # 0x7335
xorl %eax, %eax
callq 0x500f
jmp 0x3d88
leaq 0x35bb(%rip), %rdi      # 0x7335
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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, %r14
leaq 0x8(%rsp), %rsi
movl $0x1, %edi
callq 0x2230
testl %eax, %eax
je 0x3de8
callq 0x2090
movq %rax, %rbx
movl (%rax), %eax
testl %eax, %eax
je 0x3e0b
cmpl $0x16, %eax
je 0x3dca
cmpl $0x26, %eax
jne 0x3e14
leaq 0x8(%rsp), %rsi
xorl %edi, %edi
callq 0x2230
testl %eax, %eax
je 0x3de8
cmpl $0x0, (%rbx)
je 0x3e2a
leaq 0x3595(%rip), %rdi      # 0x737b
jmp 0x3e1b
cvtsi2sdq 0x8(%rsp), %xmm0
cvtsi2sdq 0x10(%rsp), %xmm1
mulsd 0x34f2(%rip), %xmm1     # 0x72f0
addsd %xmm0, %xmm1
movsd %xmm1, (%r14)
xorl %eax, %eax
jmp 0x3e3d
leaq 0x354b(%rip), %rdi      # 0x735d
jmp 0x3e31
leaq 0x3542(%rip), %rdi      # 0x735d
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%rbx)
jmp 0x3e38
leaq 0x354a(%rip), %rdi      # 0x737b
xorl %eax, %eax
callq 0x500f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/util/parsenum.h
// Function: parsenum_signed
static inline intmax_t
parsenum_signed(const char * s, intmax_t min, intmax_t max, int base,
    int trailing)
{
	char * eptr;
	intmax_t val;

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

	val = strtoimax(s, &eptr, base);
	if (eptr == s || (!trailing && (*eptr != '\0')))
		errno = EINVAL;
	else if ((val < min) || (val > max)) {
		errno = ERANGE;
		val = 0;
	}
	return (val);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x423c
movq %rdi, %r14
movq %rsp, %r15
movq %r15, %rsi
movl $0xa, %edx
callq 0x2050
movq %rax, %rbx
movq (%r15), %rax
movl $0x16, %ebp
cmpq %r14, %rax
je 0x4227
cmpb $0x0, (%rax)
jne 0x4227
movq $-0x10000, %rax         # imm = 0xFFFF0000
movq %rbx, %rcx
addq %rax, %rcx
cmpq %rax, %rcx
ja 0x422e
movl $0x22, %ebp
xorl %ebx, %ebx
callq 0x2090
movl %ebp, (%rax)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x33ab(%rip), %rdi      # 0x75ee
leaq 0x33ae(%rip), %rsi      # 0x75f8
leaq 0x33c6(%rip), %rcx      # 0x7617
movl $0xa7, %edx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/util/sock.c
// Function: sock_resolve_ipv6
static struct sock_addr **
sock_resolve_ipv6(const char * addr, in_port_t p)
{
	struct sock_addr ** sas;
	struct sock_addr * sa;
	struct sockaddr_in6 * sin6;

	/* Allocate and populate a sockaddr_in6 structure. */
	if ((sin6 = calloc(1, sizeof(struct sockaddr_in6))) == NULL)
		goto err0;
	sin6->sin6_family = AF_INET6;
	sin6->sin6_port = htons(p);
	if (inet_pton(AF_INET6, addr, &sin6->sin6_addr) != 1) {
		warn0("Error parsing IP address: %s", addr);
		goto err1;
	}

	/* Allocate and populate our wrapper. */
	if ((sa = malloc(sizeof(struct sock_addr))) == NULL)
		goto err1;
	sa->ai_family = AF_INET6;
	sa->ai_socktype = SOCK_STREAM;
	sa->name = (struct sockaddr *)sin6;
	sa->namelen = sizeof(struct sockaddr_in6);

	/* Allocate and populate an array of pointers. */
	if ((sas = malloc(2 * sizeof(struct sock_addr *))) == NULL)
		goto err2;
	sas[0] = sa;
	sas[1] = NULL;

	/* Success! */
	return (sas);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movl $0x1, %edi
movl $0x1c, %esi
callq 0x21c0
testq %rax, %rax
je 0x4310
movq %rax, %rbx
rolw $0x8, %bp
movw $0xa, (%rax)
movw %bp, 0x2(%rax)
movq %rax, %rdx
addq $0x8, %rdx
movl $0xa, %edi
movq %r14, %rsi
callq 0x2200
cmpl $0x1, %eax
jne 0x42ec
movl $0x18, %edi
callq 0x2220
testq %rax, %rax
je 0x4308
movq %rax, %r14
movabsq $0x10000000a, %rax      # imm = 0x10000000A
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
movl $0x1c, 0x10(%r14)
movl $0x10, %edi
callq 0x2220
testq %rax, %rax
je 0x4317
movq %r14, (%rax)
movq $0x0, 0x8(%rax)
jmp 0x4312
leaq 0x3369(%rip), %rdi      # 0x765c
movq %r14, %rsi
xorl %eax, %eax
callq 0x500f
callq 0x2090
movl $0x0, (%rax)
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %r14, %rdi
callq 0x2040
jmp 0x4308
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/util/sock.c
// Function: sock_resolve_ipv4
static struct sock_addr **
sock_resolve_ipv4(const char * addr, in_port_t p)
{
	struct sock_addr ** sas;
	struct sock_addr * sa;
	struct sockaddr_in * sin;

	/* Allocate and populate a sockaddr_in structure. */
	if ((sin = calloc(1, sizeof(struct sockaddr_in))) == NULL)
		goto err0;
	sin->sin_family = AF_INET;
	sin->sin_port = htons(p);
	if (inet_pton(AF_INET, addr, &sin->sin_addr) != 1) {
		warn0("Error parsing IP address: %s", addr);
		goto err1;
	}

	/* Allocate and populate our wrapper. */
	if ((sa = malloc(sizeof(struct sock_addr))) == NULL)
		goto err1;
	sa->ai_family = AF_INET;
	sa->ai_socktype = SOCK_STREAM;
	sa->name = (struct sockaddr *)sin;
	sa->namelen = sizeof(struct sockaddr_in);

	/* Allocate and populate an array of pointers. */
	if ((sas = malloc(2 * sizeof(struct sock_addr *))) == NULL)
		goto err2;
	sas[0] = sa;
	sas[1] = NULL;

	/* Success! */
	return (sas);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movl $0x1, %edi
movl $0x10, %esi
callq 0x21c0
testq %rax, %rax
je 0x43d6
movq %rax, %rbx
rolw $0x8, %bp
movw $0x2, (%rax)
movw %bp, 0x2(%rax)
movq %rax, %rdx
addq $0x4, %rdx
movl $0x2, %edi
movq %r14, %rsi
callq 0x2200
cmpl $0x1, %eax
jne 0x43b2
movl $0x18, %edi
callq 0x2220
testq %rax, %rax
je 0x43ce
movq %rax, %r14
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, (%r14)
movq %rbx, 0x8(%r14)
movl $0x10, 0x10(%r14)
movl $0x10, %edi
callq 0x2220
testq %rax, %rax
je 0x43dd
movq %r14, (%rax)
movq $0x0, 0x8(%rax)
jmp 0x43d8
leaq 0x32a3(%rip), %rdi      # 0x765c
movq %r14, %rsi
xorl %eax, %eax
callq 0x500f
callq 0x2090
movl $0x0, (%rax)
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %r14, %rdi
callq 0x2040
jmp 0x43ce
// File: /workspace/github_c_makefile_star2_O1/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 0x4437
movq %r15, %rdi
callq 0x4d78
movq %rax, %r15
movq %rax, %rbx
testq %rax, %rax
jne 0x4439
callq 0x2090
cmpl $0x0, (%rax)
je 0x4530
movq %rax, %rbx
leaq 0x2fe7(%rip), %rdi      # 0x7409
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%rbx)
jmp 0x4523
xorl %ebx, %ebx
movq %r15, %rdi
callq 0x3e48
testq %rax, %rax
je 0x44ba
movq %rax, %r14
cmpq $0x0, (%rax)
je 0x44e1
cmpq $0x0, 0x8(%r14)
je 0x4476
leaq 0x2ffb(%rip), %rdi      # 0x745c
movq %r15, %rsi
xorl %eax, %eax
callq 0x500f
callq 0x2090
movl $0x0, (%rax)
movq (%r14), %r15
movq 0x8(%r14), %r12
testq %r12, %r12
je 0x44a8
movq %r14, %r13
addq $0x10, %r13
movq 0x8(%r12), %rdi
callq 0x2040
movq %r12, %rdi
callq 0x2040
movq (%r13), %r12
addq $0x8, %r13
testq %r12, %r12
jne 0x4489
movq %r14, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
jmp 0x4523
callq 0x2090
cmpl $0x0, (%rax)
je 0x4507
movq %rax, %r14
leaq 0x2f51(%rip), %rdi      # 0x741f
movq %r15, %rsi
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%r14)
jmp 0x4518
leaq 0x2f5a(%rip), %rdi      # 0x7442
movq %r15, %rsi
xorl %eax, %eax
callq 0x500f
callq 0x2090
movl $0x0, (%rax)
movq %r14, %rdi
callq 0x455f
jmp 0x4518
leaq 0x2f11(%rip), %rdi      # 0x741f
movq %r15, %rsi
xorl %eax, %eax
callq 0x500f
movq %rbx, %rdi
callq 0x2040
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x2ed2(%rip), %rdi      # 0x7409
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x500f
jmp 0x4523
// File: /workspace/github_c_makefile_star2_O1/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 0x45a2
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x4595
leaq 0x8(%rbx), %r15
movq 0x8(%r14), %rdi
callq 0x2040
movq %r14, %rdi
callq 0x2040
movq (%r15), %r14
addq $0x8, %r15
testq %r14, %r14
jne 0x4578
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2040
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4633
movl %eax, %ebx
leaq 0xc(%rsp), %rcx
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x20e0
testl %eax, %eax
je 0x4606
callq 0x2090
movq %rax, %r15
movl (%rax), %eax
testl %eax, %eax
je 0x46a9
cmpl $0x5c, %eax
jne 0x46b2
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
movl %ebx, %edi
callq 0x2290
testl %eax, %eax
je 0x4675
callq 0x2090
cmpl $0x0, (%rax)
je 0x46c9
movq %rax, %r14
leaq 0x2e86(%rip), %rdi      # 0x74b7
jmp 0x4699
callq 0x2090
cmpl $0x0, (%rax)
movl (%r14), %esi
movl 0x4(%r14), %edx
je 0x465d
movq %rax, %rbx
leaq 0x2e41(%rip), %rdi      # 0x748f
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%rbx)
jmp 0x466b
leaq 0x2e2b(%rip), %rdi      # 0x748f
xorl %eax, %eax
callq 0x500f
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x4750
movl %ebx, %edi
movl $0xa, %esi
callq 0x2250
testl %eax, %eax
je 0x46d2
callq 0x2090
cmpl $0x0, (%rax)
je 0x4700
movq %rax, %r14
leaq 0x2e33(%rip), %rdi      # 0x74cc
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%r14)
jmp 0x470e
leaq 0x2dee(%rip), %rdi      # 0x749e
jmp 0x4707
leaq 0x2de5(%rip), %rdi      # 0x749e
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%r15)
jmp 0x470e
leaq 0x2de7(%rip), %rdi      # 0x74b7
jmp 0x4707
movl %ebx, %edi
movl $0x4, %esi
movl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
callq 0x20f0
cmpl $-0x1, %eax
jne 0x4750
callq 0x2090
cmpl $0x0, (%rax)
je 0x475c
movq %rax, %r14
leaq 0x2df0(%rip), %rdi      # 0x74ee
jmp 0x4699
leaq 0x2dc5(%rip), %rdi      # 0x74cc
xorl %eax, %eax
callq 0x500f
movl %ebx, %edi
callq 0x2180
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x4750
callq 0x2090
cmpl $0x0, (%rax)
je 0x4742
movq %rax, %r14
leaq 0x2de1(%rip), %rdi      # 0x7513
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%r14)
jmp 0x4750
leaq 0x2dca(%rip), %rdi      # 0x7513
xorl %eax, %eax
callq 0x500f
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2d8b(%rip), %rdi      # 0x74ee
jmp 0x4707
// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %rax
testq %rax, %rax
je 0x47ec
leaq 0x2d94(%rip), %r15      # 0x7513
movl (%rax), %edi
movl 0x4(%rax), %esi
xorl %edx, %edx
callq 0x2360
movl %eax, %ebx
cmpl $-0x1, %eax
je 0x47dd
movq (%r14), %rax
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
movl %ebx, %edi
callq 0x22d0
testl %eax, %eax
je 0x47f1
movl %ebx, %edi
callq 0x2180
testl %eax, %eax
je 0x47dd
callq 0x2090
cmpl $0x0, (%rax)
je 0x47d3
movq %rax, %r12
movq %r15, %rdi
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%r12)
jmp 0x47dd
movq %r15, %rdi
xorl %eax, %eax
callq 0x500f
movq 0x8(%r14), %rax
addq $0x8, %r14
testq %rax, %rax
jne 0x477f
jmp 0x47f1
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpq $0x0, (%r14)
je 0x4833
movl %ebx, %edi
movl $0x4, %esi
movl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
callq 0x20f0
cmpl $-0x1, %eax
jne 0x4851
callq 0x2090
movq %rax, %r14
cmpl $0x0, (%rax)
je 0x485f
leaq 0x2d08(%rip), %rdi      # 0x752b
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%r14)
jmp 0x486d
leaq 0x2cdf(%rip), %rdi      # 0x7519
xorl %eax, %eax
callq 0x500f
callq 0x2090
movl $0x0, (%rax)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x2cc5(%rip), %rdi      # 0x752b
xorl %eax, %eax
callq 0x500f
movl %ebx, %edi
callq 0x2180
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x4851
cmpl $0x0, (%r14)
je 0x489a
leaq 0x2c89(%rip), %rdi      # 0x7513
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%r14)
jmp 0x4851
leaq 0x2c72(%rip), %rdi      # 0x7513
xorl %eax, %eax
callq 0x500f
jmp 0x4851
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %eax
cmpl (%rsi), %ecx
jne 0x4ada
movl 0x4(%rdi), %ecx
cmpl 0x4(%rsi), %ecx
jne 0x4ada
movl 0x10(%rdi), %edx
cmpl 0x10(%rsi), %edx
jne 0x4ada
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_O1/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
movl $0x18, %edi
callq 0x2220
testq %rax, %rax
je 0x4b33
movq %rax, %rbx
movl (%r14), %eax
movl %eax, (%rbx)
movl 0x4(%r14), %eax
movl %eax, 0x4(%rbx)
movl 0x10(%r14), %r15d
movl %r15d, 0x10(%rbx)
movq %r15, %rdi
callq 0x2220
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x4b2b
movq 0x8(%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x21e0
jmp 0x4b35
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4be5
movl (%rbx), %ecx
movl %ecx, (%rax)
movl 0x4(%rbx), %ecx
movl %ecx, 0x4(%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 0x4bea
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4c62
movq %rsi, %r12
movq %rdi, %r14
movl $0x18, %edi
callq 0x2220
testq %rax, %rax
je 0x4c62
movq %rax, %rbx
movl (%r14), %eax
movl %eax, (%rbx)
movl 0x4(%r14), %eax
movl %eax, 0x4(%rbx)
movl 0x8(%r14), %r15d
movl %r15d, 0x10(%rbx)
leaq 0xc(%r15), %rax
cmpq %r12, %rax
jne 0x4c5a
movq %r15, %rdi
callq 0x2220
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x4c5a
addq $0xc, %r14
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x21e0
jmp 0x4c64
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_O1/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 0x4d5d
cmpl $0xa, %eax
je 0x4ce9
cmpl $0x2, %eax
jne 0x4d67
cmpl $0x10, 0x10(%rdi)
jne 0x4d52
movq 0x8(%rdi), %rax
movups (%rax), %xmm0
leaq 0x34(%rsp), %rsi
movaps %xmm0, -0x4(%rsi)
leaq 0x10(%rsp), %rdx
movl $0x2, %edi
movl $0x10, %ecx
callq 0x2030
testq %rax, %rax
je 0x4d52
movzwl 0x32(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %ecx
leaq 0x2a55(%rip), %rsi      # 0x7730
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rdx
jmp 0x4d3f
cmpl $0x1c, 0x10(%rdi)
jne 0x4d52
movq 0x8(%rdi), %rax
movups (%rax), %xmm0
movups 0xc(%rax), %xmm1
leaq 0x18(%rsp), %rsi
movups %xmm1, 0x4(%rsi)
movaps %xmm0, -0x8(%rsi)
leaq 0x30(%rsp), %rdx
movl $0xa, %edi
movl $0x2e, %ecx
callq 0x2030
testq %rax, %rax
je 0x4d52
movzwl 0x12(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %ecx
leaq 0x29fd(%rip), %rsi      # 0x7730
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rdx
xorl %eax, %eax
callq 0x6458
cmpl $-0x1, %eax
je 0x4d54
movq 0x8(%rsp), %rbx
jmp 0x4d54
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x60, %rsp
popq %rbx
retq
movq 0x8(%rdi), %rdi
addq $0x2, %rdi
jmp 0x4d6e
leaq 0x290b(%rip), %rdi      # 0x7679
addq $0x60, %rsp
popq %rbx
jmp 0x2300
// File: /workspace/github_c_makefile_star2_O1/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 0x4e51
movq %rdi, %rsi
movzbl (%rdi), %ecx
cmpl $0x3a, %ecx
je 0x4e31
xorl %eax, %eax
testl %ecx, %ecx
jne 0x4e4f
leaq 0x28e2(%rip), %rdi      # 0x770a
xorl %eax, %eax
callq 0x500f
jmp 0x4e3f
leaq 0x28e8(%rip), %rdi      # 0x7720
xorl %eax, %eax
callq 0x500f
callq 0x2090
movl $0x0, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rcx
retq
leaq 0x2831(%rip), %rdi      # 0x7689
leaq 0x2837(%rip), %rsi      # 0x7696
leaq 0x287f(%rip), %rcx      # 0x76e5
movl $0x15e, %edx            # imm = 0x15E
callq 0x2160
// File: /workspace/github_c_makefile_star2_O1/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 0x166ad(%rip), %rdi     # 0x1b528
callq 0x2040
leaq 0x1(%rbx), %rax
movzbl -0x1(%rax), %ecx
cmpl $0x2f, %ecx
je 0x4e93
testl %ecx, %ecx
jne 0x4e96
jmp 0x4e9b
movq %rax, %rbx
incq %rax
jmp 0x4e84
movq %rbx, %rdi
callq 0x2300
movq %rax, 0x1667e(%rip)     # 0x1b528
cmpb $0x0, 0x1667f(%rip)     # 0x1b530
jne 0x4ec6
leaq 0xe(%rip), %rdi         # 0x4ec8
callq 0x6bc0
movb $0x1, 0x1666a(%rip)     # 0x1b530
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4f54
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, 0x165af(%rip)     # 0x1b534
je 0x5000
testq %r14, %r14
je 0x4fce
leaq 0xd0(%rsp), %r15
movq %rsp, %rcx
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
movq %r14, %rdx
callq 0x20d0
movl 0x64aa(%rip), %r14d     # 0xb458
movl %ebp, %edi
callq 0x2310
leaq 0x2789(%rip), %rsi      # 0x7745
movl %r14d, %edi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x2240
jmp 0x4ff0
movl 0x6483(%rip), %r14d     # 0xb458
movl %ebp, %edi
callq 0x2310
leaq 0x2766(%rip), %rsi      # 0x7749
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 %rsp, %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x2380
jmp 0x4ff0
// File: /workspace/github_c_makefile_star2_O1/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 0x5073
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, 0x16490(%rip)     # 0x1b534
je 0x5103
testq %r14, %r14
je 0x50df
leaq 0xd0(%rsp), %r15
movq %rsp, %rcx
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
movq %r14, %rdx
callq 0x20d0
movl 0x638c(%rip), %edi      # 0xb458
leaq 0x2676(%rip), %rsi      # 0x7749
movq %r15, %rdx
xorl %eax, %eax
callq 0x2240
jmp 0x50f3
movl 0x6373(%rip), %edi      # 0xb458
leaq 0x265f(%rip), %rsi      # 0x774b
xorl %eax, %eax
callq 0x2240
movl %ebp, (%rbx)
addq $0x10d8, %rsp           # imm = 0x10D8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %rsi
movq %r14, %rdi
callq 0x241c
jmp 0x50f3
// File: /workspace/github_c_makefile_star2_O1/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
movq (%rdi), %rdi
movl $0x20, %esi
callq 0x5bcb
testq %rax, %rax
je 0x5594
xorl %r15d, %r15d
movq (%rbx), %rdi
movl $0x20, %edx
movq %r15, %rsi
callq 0x5d0d
movq %rax, %r12
movq (%rax), %rsi
movq %r14, %rdi
callq 0x4aa4
testl %eax, %eax
je 0x55ec
incq %r15
movq (%rbx), %rdi
movl $0x20, %esi
callq 0x5bcb
cmpq %rax, %r15
jb 0x555d
movq %r14, %rdi
callq 0x4adb
movq %rax, (%rsp)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x5613
leaq 0x8(%rsp), %rdi
callq 0x3c0c
testl %eax, %eax
jne 0x55e1
movq 0x28(%rbx), %rax
movq %rsp, %rsi
addq %rax, 0x8(%rsi)
movq 0x30(%rbx), %rax
movq %rax, 0x18(%rsi)
movq (%rbx), %rdi
movl $0x1, %edx
movl $0x20, %ecx
callq 0x5bd4
testl %eax, %eax
je 0x5611
movq (%rsp), %rdi
callq 0x4543
jmp 0x5613
leaq 0x8(%r12), %rdi
callq 0x3c0c
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x5613
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_O1/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 %rbx
cmpq $-0x1, %rsi
je 0x56de
testq %rsi, %rsi
je 0x5680
cmpq $0x8, %rsi
jne 0x571a
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
movq 0x10(%rdi), %r15
testq %r15, %r15
js 0x56de
je 0x569b
movq %r15, %rdi
callq 0x2220
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x570f
movl 0x8(%rbx), %edi
leaq 0x2bf(%rip), %r8        # 0x5934
movq %rax, %rsi
movq %r15, %rdx
movq %r15, %rcx
jmp 0x56c9
leaq 0x21f7(%rip), %rdi      # 0x787e
xorl %eax, %eax
callq 0x500f
callq 0x2090
movl $0x0, (%rax)
jmp 0x570f
incq 0x30(%rbx)
movq %rbx, %rdi
callq 0x57c3
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x5714
movl 0x8(%rbx), %edi
leaq -0x9a(%rip), %r8        # 0x5622
movl $0x8, %edx
movl $0x8, %ecx
movq %r14, %rsi
movq %rbx, %r9
callq 0x5f4c
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x56de
xorl %eax, %eax
jmp 0x5714
callq 0x2090
cmpl $0x0, (%rax)
je 0x5701
movq %rax, %rbx
leaq 0x208a(%rip), %rdi      # 0x777c
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%rbx)
jmp 0x570f
leaq 0x2074(%rip), %rdi      # 0x777c
xorl %eax, %eax
callq 0x500f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
leaq 0x20f5(%rip), %rdi      # 0x7816
leaq 0x2098(%rip), %rsi      # 0x77c0
leaq 0x2128(%rip), %rcx      # 0x7857
movl $0x9e, %edx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O1/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 0x57c3
testl %eax, %eax
je 0x5753
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%rbx), %rdi
movl $0x20, %esi
callq 0x5bcb
testq %rax, %rax
je 0x57a4
callq 0x2340
movslq %eax, %r14
movq (%rbx), %rdi
movl $0x20, %esi
callq 0x5bcb
movq %rax, %rcx
movq %r14, %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %rsi
movq (%rbx), %rdi
movl $0x20, %edx
callq 0x5d0d
movq (%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4adb
leaq 0x1ff2(%rip), %rdi      # 0x779d
leaq 0x200e(%rip), %rsi      # 0x77c0
leaq 0x2026(%rip), %rcx      # 0x77df
movl $0x1bc, %edx            # imm = 0x1BC
callq 0x2160
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3c0c
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x58af
movq (%rbx), %rdi
movl $0x20, %esi
callq 0x5bcb
testq %rax, %rax
je 0x58ad
xorl %r14d, %r14d
movq (%rbx), %rdi
movl $0x20, %edx
movq %r14, %rsi
callq 0x5d0d
movq %rax, %r15
movq 0x18(%rax), %rax
movq 0x30(%rbx), %rcx
cmpq %rcx, %rax
sete %dl
decq %rcx
cmpq %rcx, %rax
sete %al
orb %dl, %al
jne 0x5894
movq 0x8(%rsp), %rax
cmpq %rax, 0x8(%r15)
jg 0x5894
jne 0x5849
movq 0x10(%r15), %rax
cmpq 0x10(%rsp), %rax
jg 0x5894
movq (%r15), %rdi
callq 0x4543
movq (%rbx), %r12
movl $0x20, %esi
movq %r12, %rdi
callq 0x5bcb
leaq -0x1(%rax), %rsi
movl $0x20, %edx
movq %r12, %rdi
callq 0x5d0d
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm0, (%r15)
movups %xmm1, 0x10(%r15)
movq (%rbx), %rdi
movl $0x1, %esi
movl $0x20, %edx
callq 0x5c78
incq %r14
movq (%rbx), %rdi
movl $0x20, %esi
callq 0x5bcb
cmpq %rax, %r14
jb 0x5803
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5933
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0xc(%rdi), %edi
movl $0xf, %esi
callq 0x2210
movq 0x20(%rbx), %rdi
callq 0x61f7
movq 0x18(%rbx), %rdi
callq 0x2040
movq (%rbx), %rdi
movl $0x20, %esi
callq 0x5bcb
testq %rax, %rax
je 0x591c
movq %rax, %r14
decq %r14
movq (%rbx), %rdi
movl $0x20, %edx
movq %r14, %rsi
callq 0x5d0d
movq (%rax), %rdi
callq 0x4543
addq $-0x1, %r14
jb 0x58fe
movq (%rbx), %rdi
callq 0x5b0d
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2040
retq