LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../libcperciva/util/sock_util.c
// Function: sock_addr_duplist
struct sock_addr **
sock_addr_duplist(struct sock_addr * const * sas)
{
	struct sock_addr ** sas2;
	size_t i;

	/* Count socket addresses. */
	for (i = 0; sas[i] != NULL; i++)
		continue;

	/* Allocate the list to hold addresses plus a NULL terminator. */
	if ((sas2 = malloc((i + 1) * sizeof(struct sock_addr *))) == NULL)
		goto err0;

	/* Duplicate addresses and NULL-terminate. */
	for (i = 0; sas[i] != NULL; i++) {
		if ((sas2[i] = sock_addr_dup(sas[i])) == NULL)
			goto err1;
	}
	sas2[i] = NULL;

	/* Success! */
	return (sas2);

err1:
	/*
	 * Regardless of how many addresses we managed to duplicate before
	 * failing and being sent here, we have a valid socket address list,
	 * since the erroring sock_addr_dup call NULL-terminated it for us;
	 * so we can free it and its constituent addresses easily.
	 */
	sock_addr_freelist(sas2);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x5e73
jmp 0x5e65
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x5e54
movq -0x20(%rbp), %rdi
addq $0x1, %rdi
shlq $0x3, %rdi
callq 0x2240
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x5e90
jmp 0x5eff
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x5edc
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x5d90
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rdx
movq %rax, (%rcx,%rdx,8)
cmpq $0x0, %rax
jne 0x5ecc
jmp 0x5ef6
jmp 0x5ece
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x5e98
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5f07
movq -0x18(%rbp), %rdi
callq 0x5580
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %ecx
addq $0xc, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x2240
movq -0x18(%rbp), %rcx
movq %rax, (%rcx)
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x5f67
jmp 0x5fd4
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x10(%rcx), %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %edx
callq 0x2200
movl $0x0, -0x4(%rbp)
jmp 0x5fdb
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0xc, -0x18(%rbp)
jae 0x600c
jmp 0x60d0
movl $0x18, %edi
callq 0x2240
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x6025
jmp 0x60d0
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x10(%rcx), %ecx
addq $0xc, %rcx
cmpq %rcx, %rax
je 0x6085
jmp 0x60c7
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %edi
callq 0x2240
movq -0x20(%rbp), %rcx
movq %rax, 0x8(%rcx)
cmpq $0x0, %rax
jne 0x60a3
jmp 0x60c7
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %edx
callq 0x2200
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x60d8
movq -0x20(%rbp), %rdi
callq 0x2040
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
subl $0x1, %eax
je 0x6158
jmp 0x610c
movl -0x14(%rbp), %eax
subl $0x2, %eax
je 0x6120
jmp 0x6116
movl -0x14(%rbp), %eax
subl $0xa, %eax
je 0x613c
jmp 0x616b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %esi
callq 0x6190
movq %rax, -0x8(%rbp)
jmp 0x617b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %esi
callq 0x6240
movq %rax, -0x8(%rbp)
jmp 0x617b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x62f0
movq %rax, -0x8(%rbp)
jmp 0x617b
leaq 0x4607(%rip), %rdi      # 0xa779
callq 0x2320
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../libcperciva/util/sock_util.c
// Function: prettyprint_ipv4
static char *
prettyprint_ipv4(struct sockaddr * name, size_t namelen)
{
	struct sockaddr_in sa_in;
	char addr[INET_ADDRSTRLEN];
	char * s;

	/* Check name length. */
	if (namelen != sizeof(struct sockaddr_in))
		return (NULL);

	/* Copy into buffer for alignment. */
	memcpy(&sa_in, name, namelen);

	/* Convert IP address to string. */
	if (inet_ntop(AF_INET, &sa_in.sin_addr, addr, sizeof(addr)) == NULL)
		return (NULL);

	/* Construct address string. */
	if (asprintf(&s, "[%s]:%d", addr, ntohs(sa_in.sin_port)) == -1)
		return (NULL);

	/* Success! */
	return (s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x10, -0x18(%rbp)
je 0x61b1
movq $0x0, -0x8(%rbp)
jmp 0x622e
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x28(%rbp), %rdi
callq 0x2200
leaq -0x28(%rbp), %rsi
addq $0x4, %rsi
leaq -0x40(%rbp), %rdx
movl $0x2, %edi
movl $0x10, %ecx
callq 0x2030
cmpq $0x0, %rax
jne 0x61ed
movq $0x0, -0x8(%rbp)
jmp 0x622e
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movzwl -0x26(%rbp), %edi
callq 0x2290
movq -0x50(%rbp), %rdx
movzwl %ax, %ecx
leaq -0x48(%rbp), %rdi
leaq 0x4620(%rip), %rsi      # 0xa830
movb $0x0, %al
callq 0x8730
cmpl $-0x1, %eax
jne 0x6226
movq $0x0, -0x8(%rbp)
jmp 0x622e
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../libcperciva/util/sock_util.c
// Function: prettyprint_ipv6
static char *
prettyprint_ipv6(struct sockaddr * name, size_t namelen)
{
	struct sockaddr_in6 sa_in6;
	char addr[INET6_ADDRSTRLEN];
	char * s;

	/* Check name length. */
	if (namelen != sizeof(struct sockaddr_in6))
		return (NULL);

	/* Copy into buffer for alignment. */
	memcpy(&sa_in6, name, namelen);

	/* Convert IPv6 address to string. */
	if (inet_ntop(AF_INET6, &sa_in6.sin6_addr, addr, sizeof(addr)) == NULL)
		return (NULL);

	/* Construct address string. */
	if (asprintf(&s, "[%s]:%d", addr, ntohs(sa_in6.sin6_port)) == -1)
		return (NULL);

	/* Success! */
	return (s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x1c, -0x18(%rbp)
je 0x6264
movq $0x0, -0x8(%rbp)
jmp 0x62e1
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x34(%rbp), %rdi
callq 0x2200
leaq -0x34(%rbp), %rsi
addq $0x8, %rsi
leaq -0x70(%rbp), %rdx
movl $0xa, %edi
movl $0x2e, %ecx
callq 0x2030
cmpq $0x0, %rax
jne 0x62a0
movq $0x0, -0x8(%rbp)
jmp 0x62e1
leaq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
movzwl -0x32(%rbp), %edi
callq 0x2290
movq -0x80(%rbp), %rdx
movzwl %ax, %ecx
leaq -0x78(%rbp), %rdi
leaq 0x456d(%rip), %rsi      # 0xa830
movb $0x0, %al
callq 0x8730
cmpl $-0x1, %eax
jne 0x62d9
movq $0x0, -0x8(%rbp)
jmp 0x62e1
movq -0x78(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../libcperciva/util/sock_util.c
// Function: sock_addr_ensure_port
char *
sock_addr_ensure_port(const char * addr)
{
	char * bind_addr;
	char * cr;

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

	/* Where is the right-most colon in $addr? */
	cr = strrchr(addr, ':');

	/* Figure out what type of address $addr is. */
	if (cr == addr) {
		/*
		 * If the right-most colon is the first char, it's not a valid
		 * address, but we'll strdup it anyway.
		 */
		bind_addr = strdup(addr);
	} else if (addr[0] == '/') {
		/* It's a Unix domain socket and doesn't need a port number. */
		bind_addr = strdup(addr);
	} else if (addr[0] != '[') {
		/* It's a hostname... */
		if (cr == NULL) {
			/* ... without any port number, so we add ":0". */
			if (asprintf(&bind_addr, "%s:0", addr) == -1)
				goto err0;
		} else {
			/* ... which already has a port number. */
			bind_addr = strdup(addr);
		}
	} else {
		/* addr[0] == '[', so it's an address... */
		if ((cr == NULL) || (cr[-1] != ']')) {
			/* ... without a port number, so we add ":0". */
			if (asprintf(&bind_addr, "%s:0", addr) == -1)
				goto err0;
		} else {
			/* ... which already has a port number. */
			bind_addr = strdup(addr);
		}
	}

	/* Success! */
	return (bind_addr);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x6325
jmp 0x6344
leaq 0x445d(%rip), %rdi      # 0xa789
leaq 0x4463(%rip), %rsi      # 0xa796
movl $0x127, %edx            # imm = 0x127
leaq 0x4477(%rip), %rcx      # 0xa7b6
callq 0x2180
movq -0x10(%rbp), %rdi
movl $0x3a, %esi
callq 0x2170
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jne 0x6372
movq -0x10(%rbp), %rdi
callq 0x2320
movq %rax, -0x18(%rbp)
jmp 0x6417
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x6390
movq -0x10(%rbp), %rdi
callq 0x2320
movq %rax, -0x18(%rbp)
jmp 0x6415
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5b, %eax
je 0x63d1
cmpq $0x0, -0x20(%rbp)
jne 0x63c2
movq -0x10(%rbp), %rdx
leaq -0x18(%rbp), %rdi
leaq 0x442e(%rip), %rsi      # 0xa7e0
movb $0x0, %al
callq 0x8730
cmpl $-0x1, %eax
jne 0x63c0
jmp 0x6421
jmp 0x63cf
movq -0x10(%rbp), %rdi
callq 0x2320
movq %rax, -0x18(%rbp)
jmp 0x6413
cmpq $0x0, -0x20(%rbp)
je 0x63e5
movq -0x20(%rbp), %rax
movsbl -0x1(%rax), %eax
cmpl $0x5d, %eax
je 0x6404
movq -0x10(%rbp), %rdx
leaq -0x18(%rbp), %rdi
leaq 0x43ec(%rip), %rsi      # 0xa7e0
movb $0x0, %al
callq 0x8730
cmpl $-0x1, %eax
jne 0x6402
jmp 0x6421
jmp 0x6411
movq -0x10(%rbp), %rdi
callq 0x2320
movq %rax, -0x18(%rbp)
jmp 0x6413
jmp 0x6415
jmp 0x6417
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6429
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x6455
jmp 0x6474
leaq 0x432d(%rip), %rdi      # 0xa789
leaq 0x4333(%rip), %rsi      # 0xa796
movl $0x15e, %edx            # imm = 0x15E
leaq 0x4376(%rip), %rcx      # 0xa7e5
callq 0x2180
movq -0x10(%rbp), %rdi
callq 0x2120
cmpq $0x0, %rax
jne 0x64a0
jmp 0x6485
leaq 0x437e(%rip), %rdi      # 0xa80a
movb $0x0, %al
callq 0x6810
callq 0x20a0
movl $0x0, (%rax)
jmp 0x64e2
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
je 0x64d9
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
jne 0x64d9
jmp 0x64ba
movq -0x10(%rbp), %rsi
leaq 0x435b(%rip), %rdi      # 0xa820
movb $0x0, %al
callq 0x6810
callq 0x20a0
movl $0x0, (%rax)
jmp 0x64e2
movl $0x0, -0x4(%rbp)
jmp 0x64e9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x18025(%rip), %rdi     # 0x1e538
callq 0x2040
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x6554
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x6544
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x6546
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x6520
movq -0x10(%rbp), %rdi
callq 0x2320
movq %rax, 0x17fd4(%rip)     # 0x1e538
cmpl $0x0, 0x17fd5(%rip)     # 0x1e540
jne 0x6583
leaq 0x1c(%rip), %rdi        # 0x6590
callq 0x9380
movl $0x1, 0x17fbd(%rip)     # 0x1e540
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../libcperciva/util/warnp.c
// Function: warnp_atexit
static void
warnp_atexit(void)
{

	/* Clean up writing to the syslog (if applicable). */
	if (use_syslog)
		closelog();

	free(name);
	name = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x0, 0x17fa9(%rip)     # 0x1e544
je 0x65a2
callq 0x2080
movq 0x17f8f(%rip), %rdi     # 0x1e538
callq 0x2040
movq $0x0, 0x17f7f(%rip) # 0x1e538
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x7270
movq %rax, %rcx
movq -0x50(%rbp), %rax
cmpq %rcx, %rax
jae 0x6ec1
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x48(%rbp), %rsi
callq 0x7290
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rax
movq (%rax), %rsi
callq 0x5d00
cmpl $0x0, %eax
jne 0x6eae
movq -0x40(%rbp), %rdi
addq $0x8, %rdi
callq 0x4630
cmpl $0x0, %eax
je 0x6e88
jmp 0x6f36
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x40(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x6f24
jmp 0x6eb0
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x6e28
movq -0x18(%rbp), %rdi
callq 0x5d90
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x6ed6
jmp 0x6f36
leaq -0x38(%rbp), %rdi
addq $0x8, %rdi
callq 0x4630
cmpl $0x0, %eax
je 0x6eea
jmp 0x6f2d
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x38(%rbp), %rsi
movl $0x1, %edx
callq 0x7590
cmpl $0x0, %eax
je 0x6f22
jmp 0x6f2d
jmp 0x6f24
movl $0x0, -0x4(%rbp)
jmp 0x6f3d
movq -0x38(%rbp), %rdi
callq 0x5540
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/serverpool/serverpool.c
// Function: forkdns
static pid_t
forkdns(const char * target, int readfd, int writefd, unsigned int freq)
{
	pid_t pid;
	struct sock_addr ** sas;
	uint8_t * addr;
	size_t addrlen;
	size_t i;

	/* Fork a child to perform the DNS lookups. */
	if ((pid = fork()) != 0)
		return (pid);

	/*
	 * In child process.  Close read socket so that we will notice if we
	 * try to write after the parent dies.
	 */
	if (close(readfd))
		warnp("close");

	/* Become a session leader. */
	setsid();

	/*
	 * Infinite loop doing DNS lookups and writing them to our parent via
	 * the socket, sleeping ${freq} seconds between each lookup.
	 */
	for (;; sleep(freq)) {
		/*
		 * Perform a DNS lookup.  Keep going if it fails; we don't
		 * want to die as a result of a temporary network glitch.
		 */
		if ((sas = sock_resolve(target)) == NULL)
			continue;

		/* Send each address over. */
		for (i = 0; sas[i] != NULL; i++) {
			/* Serialize the address. */
			if (sock_addr_serialize(sas[i], &addr, &addrlen))
				goto die;

			/* Send it to our parent. */
			if (noeintr_write(writefd, &addrlen,
			    sizeof(addrlen)) == -1)
				goto die;
			if (noeintr_write(writefd, addr, addrlen) == -1)
				goto die;

			/* Free the serialized address. */
			free(addr);
		}

		/* Free the list of addresses. */
		sock_addr_freelist(sas);

		/* Send a zero over to denote the end of a generation. */
		addrlen = 0;
		if (noeintr_write(writefd, &addrlen, sizeof(addrlen)) == -1)
			goto die;
	}

	/* NOTREACHED */

die:
	_exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
callq 0x2350
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
je 0x6f7b
movl -0x18(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
movl -0xc(%rbp), %edi
callq 0x21a0
cmpl $0x0, %eax
je 0x6fc1
jmp 0x6f8a
callq 0x20a0
cmpl $0x0, (%rax)
je 0x6faf
leaq 0x35db(%rip), %rdi      # 0xa576
movb $0x0, %al
callq 0x65c0
callq 0x20a0
movl $0x0, (%rax)
jmp 0x6fbd
leaq 0x35c0(%rip), %rdi      # 0xa576
movb $0x0, %al
callq 0x6810
jmp 0x6fbf
jmp 0x6fc1
callq 0x21c0
movq -0x8(%rbp), %rdi
callq 0x4950
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x6fde
jmp 0x708c
movq $0x0, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x7060
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x5f20
cmpl $0x0, %eax
je 0x7018
jmp 0x7099
movl -0x10(%rbp), %edi
leaq -0x30(%rbp), %rsi
movl $0x8, %edx
callq 0x8870
cmpq $-0x1, %rax
jne 0x7031
jmp 0x7099
movl -0x10(%rbp), %edi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x8870
cmpq $-0x1, %rax
jne 0x7049
jmp 0x7099
movq -0x28(%rbp), %rdi
callq 0x2040
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x6fe6
movq -0x20(%rbp), %rdi
callq 0x5580
movq $0x0, -0x30(%rbp)
movl -0x10(%rbp), %edi
leaq -0x30(%rbp), %rsi
movl $0x8, %edx
callq 0x8870
cmpq $-0x1, %rax
jne 0x708a
jmp 0x7099
jmp 0x708c
movl -0x14(%rbp), %edi
callq 0x2340
jmp 0x6fc6
movl $0x1, %edi
callq 0x20b0
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7390
cmpl $0x0, %eax
je 0x72fc
jmp 0x7374
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x7270
cmpq $0x0, %rax
jbe 0x7310
jmp 0x732f
leaq 0x3586(%rip), %rdi      # 0xa89d
leaq 0x35a2(%rip), %rsi      # 0xa8c0
movl $0x1bc, %edx            # imm = 0x1BC
leaq 0x35b5(%rip), %rcx      # 0xa8df
callq 0x2180
callq 0x2360
cltq
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x7270
movq %rax, %rcx
movq -0x20(%rbp), %rax
xorl %edx, %edx
divq %rcx
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x7290
movq (%rax), %rdi
callq 0x5d90
movq %rax, -0x8(%rbp)
jmp 0x737c
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x4630
cmpl $0x0, %eax
je 0x73af
jmp 0x74d6
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x7270
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
jae 0x74cd
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x7290
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x30(%rcx), %rax
je 0x741a
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x30(%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jne 0x741f
jmp 0x74bc
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x20(%rbp), %rax
jg 0x7449
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x20(%rbp), %rax
jne 0x744b
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x18(%rbp), %rax
jle 0x744b
jmp 0x74bc
movq -0x28(%rbp), %rax
movq (%rax), %rdi
callq 0x5540
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x7270
movq -0x48(%rbp), %rdi
movq %rax, %rsi
subq $0x1, %rsi
callq 0x7290
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x1, %esi
callq 0x7750
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x73b7
movl $0x0, -0x4(%rbp)
jmp 0x74dd
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x7508
jmp 0x7589
movq -0x8(%rbp), %rax
movl 0xc(%rax), %edi
movl $0xf, %esi
callq 0x2230
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x8420
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2040
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x7270
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jbe 0x7574
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
subq $0x1, %rsi
callq 0x7290
movq (%rax), %rdi
callq 0x5540
movq -0x10(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x7543
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x72c0
movq -0x8(%rbp), %rdi
callq 0x2040
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
cmpq $-0x1, -0x18(%rbp)
je 0x7603
cmpq $0x0, -0x18(%rbp)
je 0x7603
cmpq $0x0, -0x18(%rbp)
jle 0x7605
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x7605
jmp 0x7624
leaq 0x338a(%rip), %rdi      # 0xa996
leaq 0x32ad(%rip), %rsi      # 0xa8c0
movl $0xdb, %edx
leaq 0x33cf(%rip), %rcx      # 0xa9ee
callq 0x2180
cmpq $-0x1, -0x18(%rbp)
jne 0x7630
jmp 0x76fd
cmpq $0x0, -0x18(%rbp)
jne 0x763c
jmp 0x76d9
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x5ff0
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x7660
jmp 0x773f
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2040
movq -0x20(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x6e10
cmpl $0x0, %eax
je 0x7690
jmp 0x7736
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x20(%rbp), %rsi
addq $0x10, %rsi
movq -0x20(%rbp), %r9
movl $0x8, %ecx
leaq -0x5ff(%rip), %r8       # 0x70b0
movq %rcx, %rdx
callq 0x8150
movq -0x20(%rbp), %rcx
movq %rax, 0x20(%rcx)
cmpq $0x0, %rax
jne 0x76c7
jmp 0x76fd
movq -0x28(%rbp), %rdi
callq 0x5540
movl $0x0, -0x4(%rbp)
jmp 0x7746
jmp 0x76db
leaq 0x329c(%rip), %rdi      # 0xa97e
movb $0x0, %al
callq 0x6810
callq 0x20a0
movl $0x0, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7746
jmp 0x76ff
callq 0x20a0
cmpl $0x0, (%rax)
je 0x7724
leaq 0x316c(%rip), %rdi      # 0xa87c
movb $0x0, %al
callq 0x65c0
callq 0x20a0
movl $0x0, (%rax)
jmp 0x7732
leaq 0x3151(%rip), %rdi      # 0xa87c
movb $0x0, %al
callq 0x6810
jmp 0x7734
jmp 0x7736
movq -0x28(%rbp), %rdi
callq 0x5540
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jbe 0x7799
jmp 0x77b8
leaq 0x3276(%rip), %rdi      # 0xaa16
leaq 0x327a(%rip), %rsi      # 0xaa21
movl $0x5a, %edx
leaq 0x3297(%rip), %rcx      # 0xaa4a
callq 0x2180
movl $0x18, %edi
callq 0x2240
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x77ce
jmp 0x781c
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x7830
cmpl $0x0, %eax
je 0x7809
jmp 0x7813
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7824
movq -0x20(%rbp), %rdi
callq 0x78b0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/elasticarray.c
// Function: elasticarray_resize
int
elasticarray_resize(struct elasticarray * EA, size_t nrec, size_t reclen)
{

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

	/* Resize the buffer. */
	if (resize(EA, nrec * reclen))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq $-0x1, %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x20(%rbp)
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jbe 0x7874
callq 0x20a0
movl $0xc, (%rax)
jmp 0x7896
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
imulq -0x20(%rbp), %rsi
callq 0x78f0
cmpl $0x0, %eax
je 0x788d
jmp 0x7896
movl $0x0, -0x4(%rbp)
jmp 0x789d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/elasticarray.c
// Function: elasticarray_free
void
elasticarray_free(struct elasticarray * EA)
{

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

	free(EA->buf);
	free(EA);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x78c5
jmp 0x78db
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2040
movq -0x8(%rbp), %rdi
callq 0x2040
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/elasticarray.c
// Function: resize
static int
resize(struct elasticarray * EA, size_t nsize)
{
	size_t nalloc;
	void * nbuf;

	/* Figure out how large an allocation we want. */
	if (EA->alloc < nsize) {
		/* We need to enlarge the buffer. */
		nalloc = EA->alloc * 2;

		/*
		 * Handle if nalloc is not large enough to hold nsize, which can
		 * happen when: 1) EA->alloc is small enough that EA->alloc * 2
		 * is still smaller than nsize, or 2) EA->alloc is large enough
		 * that EA->alloc * 2 wraps around, becoming smaller than nsize.
		 */
		if (nalloc < nsize)
			nalloc = nsize;
	} else if (EA->alloc / 4 > nsize) {
		/* We need to shrink the buffer. */
		nalloc = nsize * 2;
	} else {
		nalloc = EA->alloc;
	}

	/*
	 * Resizing 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 (nalloc == 0) {
		/* We can only get here if we set nsize to 0. */
		assert(nsize == 0);

		free(EA->buf);
		EA->buf = NULL;
		EA->alloc = 0;
	} else if (nalloc != EA->alloc) {
		/* Reallocate to a nonzero size if necessary. */
		if ((nbuf = realloc(EA->buf, nalloc)) == NULL)
			goto err0;
		EA->buf = nbuf;
		EA->alloc = nalloc;
	}

	/* Record the new array size. */
	EA->size = nsize;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x18(%rbp), %rax
jae 0x7931
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x792f
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x795e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
shrq $0x2, %rax
cmpq -0x18(%rbp), %rax
jbe 0x7950
movq -0x18(%rbp), %rax
shlq %rax
movq %rax, -0x20(%rbp)
jmp 0x795c
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x795e
cmpq $0x0, -0x20(%rbp)
jne 0x79b4
cmpq $0x0, -0x18(%rbp)
jne 0x796e
jmp 0x798d
leaq 0x3163(%rip), %rdi      # 0xaad8
leaq 0x30a5(%rip), %rsi      # 0xaa21
movl $0x36, %edx
leaq 0x315b(%rip), %rcx      # 0xaae3
callq 0x2180
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2040
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
jmp 0x79f9
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
je 0x79f7
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x2280
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x79df
jmp 0x7a0d
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x79f9
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x7a14
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $-0x1, %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x28(%rbp)
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq %rcx, %rax
ja 0x7aa2
movq -0x20(%rbp), %rax
imulq -0x28(%rbp), %rax
movq -0x10(%rbp), %rdx
movq $-0x1, %rcx
subq (%rdx), %rcx
cmpq %rcx, %rax
jbe 0x7ab2
callq 0x20a0
movl $0xc, (%rax)
jmp 0x7b33
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
imulq -0x28(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x78f0
cmpl $0x0, %eax
je 0x7add
jmp 0x7b33
cmpq $0x0, -0x20(%rbp)
jbe 0x7b2a
cmpq $0x0, -0x38(%rbp)
jbe 0x7aed
jmp 0x7b0c
leaq 0x2f8d(%rip), %rdi      # 0xaa81
leaq 0x2f26(%rip), %rsi      # 0xaa21
movl $0xb9, %edx
leaq 0x2f84(%rip), %rcx      # 0xaa8b
callq 0x2180
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
addq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
imulq -0x28(%rbp), %rdx
callq 0x2200
movl $0x0, -0x4(%rbp)
jmp 0x7b3a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq $-0x1, %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x18(%rbp)
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
ja 0x7b99
movq -0x10(%rbp), %rax
imulq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jbe 0x7ba3
movq $0x0, -0x20(%rbp)
jmp 0x7bba
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
imulq -0x18(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x78f0
cmpl $0x0, %eax
je 0x7bd7
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x7c1d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2040
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
jmp 0x7c6b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jbe 0x7c69
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x2280
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x7c4e
jmp 0x7c74
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x7c6b
movl $0x0, -0x4(%rbp)
jmp 0x7c7b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7be0
cmpl $0x0, %eax
je 0x7ce8
jmp 0x7d20
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x7a20
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x2040
movl $0x0, -0x4(%rbp)
jmp 0x7d27
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2240
movq -0x18(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x7d63
jmp 0x7d9e
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
callq 0x2200
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x7a20
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x7da5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/timerqueue.c
// Function: timerqueue_init
struct timerqueue *
timerqueue_init(void)
{
	struct timerqueue * Q;

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

	/* Allocate heap. */
	if ((Q->H = ptrheap_init(compar, setreccookie, Q)) == NULL)
		goto err1;

	/* Success! */
	return (Q);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x8, %edi
callq 0x2240
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
jne 0x7dce
jmp 0x7e07
movq -0x10(%rbp), %rdx
leaq 0x47(%rip), %rdi        # 0x7e20
leaq 0x80(%rip), %rsi        # 0x7e60
callq 0x8990
movq -0x10(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x7df4
jmp 0x7dfe
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7e0f
movq -0x10(%rbp), %rdi
callq 0x2040
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/timerqueue.c
// Function: timerqueue_add
void *
timerqueue_add(struct timerqueue * Q, const struct timeval * tv, void * ptr)
{
	struct timerrec * r;

	/* Allocate (timeval, ptr) pair record. */
	if ((r = malloc(sizeof(struct timerrec))) == NULL)
		goto err0;

	/* Fill in values. */
	memcpy(&r->tv, tv, sizeof(struct timeval));
	r->ptr = ptr;

	/*
	 * Add the record to the heap.  The value r->rc will be filled in
	 * by setreccookie which will be called by ptrheap_add.
	 */
	if (ptrheap_add(Q->H, r))
		goto err1;

	/* Success! */
	return (r);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x20, %edi
callq 0x2240
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x7eba
jmp 0x7f06
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x8d30
cmpl $0x0, %eax
je 0x7ef3
jmp 0x7efd
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7f0e
movq -0x28(%rbp), %rdi
callq 0x2040
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../libcperciva/datastruct/timerqueue.c
// Function: timerqueue_getmin
const struct timeval *
timerqueue_getmin(struct timerqueue * Q)
{
	struct timerrec * r;

	/* Get the minimum element from the heap. */
	r = ptrheap_getmin(Q->H);

	/* If we have an element, return its timeval; otherwise, NULL. */
	if (r != NULL)
		return (&r->tv);
	else
		return (NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x8ee0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x7fdd
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7fe5
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop