LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/http/http.c
// Function: addbody
static int
addbody(struct http_cookie * H, uint8_t * buf, size_t buflen)
{
	size_t nalloc;
	uint8_t * nbuf;

	/* The caller should make sure we don't exceed the maximum length. */
	assert(H->res.bodylen + buflen <= H->res_bodylen_max);

	/* Reallocate if necessary. */
	if (H->res.bodylen + buflen > H->res_bodylen_alloc) {
		/* Double the buffer size. */
		nalloc = H->res_bodylen_alloc * 2;

		/* Increase if that isn't enough. */
		if (nalloc < H->res.bodylen + buflen)
			nalloc = H->res.bodylen + buflen;

		/* Decrease if we've gone too far. */
		if (nalloc > H->res_bodylen_max)
			nalloc = H->res_bodylen_max;

		/* Expand our memory allocation. */
		if ((nbuf = realloc(H->res.body, nalloc)) == NULL)
			goto err0;

		/* Record the new allocation and its size. */
		H->res.body = nbuf;
		H->res_bodylen_alloc = nalloc;
	}

	/* Copy the data into our (possibly expanded) buffer. */
	memcpy(&H->res.body[H->res.bodylen], buf, buflen);

	/* Record the increased data length. */
	H->res.bodylen += buflen;

	/* Success! */
	return (0);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x98(%rdi), %rax
movq 0xc0(%rdi), %rdi
leaq (%rdi,%rdx), %rcx
cmpq %rax, %rcx
ja 0x9a30
movq %rdx, %rbx
movq %rsi, %r15
movq 0xa0(%r14), %r12
cmpq %r12, %rcx
jbe 0x99ff
addq %r12, %r12
cmpq %rcx, %r12
cmovbeq %rcx, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
movq 0xc8(%r14), %rdi
movq %r12, %rsi
callq 0x3590
testq %rax, %rax
je 0x9a29
movq %rax, 0xc8(%r14)
movq %r12, 0xa0(%r14)
movq 0xc0(%r14), %rdi
jmp 0x9a06
movq 0xc8(%r14), %rax
addq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3280
addq %rbx, 0xc0(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x9a1d
leaq 0x8598(%rip), %rdi      # 0x11fcf
leaq 0x8263(%rip), %rsi      # 0x11ca1
leaq 0x85b8(%rip), %rcx      # 0x11ffd
movl $0xbb, %edx
callq 0x3200
nop
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/util/b64encode.c
// Function: b64encode
void
b64encode(const uint8_t * in, char * out, size_t len)
{
	uint32_t t;
	size_t j;

	/* Repeat {read up to 3 bytes; write 4 bytes} until we're done. */
	while (len) {
		/* Read up to 3 bytes. */
		for (t = 0, j = 0; j < 3; j++) {
			t <<= 8;
			if (j < len)
				t += *in++;
		}

		/* Write 4 bytes. */
		for (j = 0; j < 4; j++) {
			if (j <= len)
				*out++ = b64chars[(t >> 18) & 0x3f];
			else
				*out++ = '=';
			t <<= 6;
		}

		/* Adjust the remaining length. */
		if (len < 3)
			len = 0;
		else
			len -= 3;
	}

	/* NUL terminate. */
	*out++ = '\0';
}

// Assembly:
testq %rdx, %rdx
je 0xb1b4
leaq 0xd520(%rip), %rax      # 0x18670
movq %rsi, %rcx
xorl %r8d, %r8d
xorl %esi, %esi
shll $0x8, %esi
cmpq %rdx, %r8
jae 0xb16a
movzbl (%rdi), %r9d
incq %rdi
orl %r9d, %esi
incq %r8
cmpq $0x3, %r8
jne 0xb158
xorl %r8d, %r8d
movb $0x3d, %r9b
cmpq %rdx, %r8
ja 0xb18d
movl %esi, %r9d
shrl $0x12, %r9d
andl $0x3f, %r9d
movb (%r9,%rax), %r9b
movb %r9b, (%rcx,%r8)
shll $0x6, %esi
incq %r8
cmpq $0x4, %r8
jne 0xb176
leaq -0x3(%rdx), %r9
leaq (%rcx,%r8), %rsi
cmpq $0x3, %rdx
movq %r9, %rdx
ja 0xb150
addq %r8, %rcx
movq %rcx, %rsi
movb $0x0, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/util/b64encode.c
// Function: b64decode
int
b64decode(const char * in, size_t inlen, uint8_t * out, size_t * outlen)
{
	uint32_t t;
	ptrdiff_t pos;
	size_t deadbytes = 0;
	size_t i;

	/* We must have a multiple of 4 input bytes. */
	if (inlen % 4 != 0)
		goto bad;

	/* Check that we have valid input and count trailing '='s. */
	for (i = 0; i < inlen; i++) {
		/* Must be characters from our b64 character set. */
		if ((in[i] == '\0') || (strchr(b64chars, in[i]) == NULL))
			goto bad;

		/* Is this a '=' character? */
		if (in[i] == '=')
			deadbytes += 1;

		/* No non-'=' bytes after a '=' byte. */
		if ((in[i] != '=') && (deadbytes > 0))
			goto bad;
	}

	/* Can't have more than 2 trailing '=' bytes. */
	if (deadbytes > 2)
		goto bad;

	/* We have no output yet. */
	*outlen = 0;

	/* Loop until we run out of data. */
	while (inlen) {
		/* Parse 4 bytes. */
		for (t = 0, i = 0; i < 4; i++) {
			t <<= 6;
			pos = strchr(b64chars, in[i]) - b64chars;
			t += (uint32_t)(pos & 0x3f);
		}

		/* Output 3 bytes. */
		for (i = 0; i < 3; i++) {
			out[i] = (t >> 16) & 0xff;
			t <<= 8;
		}

		/* Adjust pointers and lengths for the completed block. */
		in += 4;
		inlen -= 4;
		out += 3;
		*outlen += 3;
	}

	/* Ignore dead bytes. */
	*outlen -= deadbytes;

	/* Success! */
	return (0);

bad:
	/* The input is not valid base-64 encoded text. */
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movl $0x1, %eax
testb $0x3, %r15b
jne 0xb2d3
xorl %eax, %eax
testq %r15, %r15
je 0xb2c7
movq %rdx, %r14
movq %rdi, %r12
movq %rcx, 0x8(%rsp)
xorl %ebp, %ebp
xorl %ebx, %ebx
movsbl (%r12,%rbp), %r13d
testl %r13d, %r13d
je 0xb2ce
leaq 0xd469(%rip), %rdi      # 0x18670
movl %r13d, %esi
callq 0x3160
testq %rax, %rax
je 0xb2ce
xorl %eax, %eax
cmpb $0x3d, %r13b
sete %al
setne %cl
addq %rax, %rbx
setne %al
testb %al, %cl
jne 0xb2ce
incq %rbp
cmpq %rbp, %r15
jne 0xb1f2
cmpq $0x2, %rbx
movl $0x1, %eax
ja 0xb2d3
movq 0x8(%rsp), %rcx
movq $0x0, (%rcx)
leaq 0xd414(%rip), %r13      # 0x18670
movq %r15, 0x10(%rsp)
xorl %ebp, %ebp
xorl %eax, %eax
movl %eax, %r15d
shll $0x6, %r15d
movsbl (%r12,%rbp), %esi
movq %r13, %rdi
callq 0x3160
subl %r13d, %eax
andl $0x3f, %eax
orl %r15d, %eax
incq %rbp
cmpq $0x4, %rbp
jne 0xb265
xorl %ecx, %ecx
movl %eax, %edx
shrl $0x10, %edx
movb %dl, (%r14,%rcx)
shll $0x8, %eax
incq %rcx
cmpq $0x3, %rcx
jne 0xb28d
addq $0x4, %r12
addq $0x3, %r14
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
addq $0x3, %rax
movq %rax, (%rcx)
movq 0x10(%rsp), %r15
addq $-0x4, %r15
jne 0xb25c
subq %rbx, %rax
movq %rax, (%rcx)
xorl %eax, %eax
jmp 0xb2d3
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/util/json.c
// Function: skip_string
static const uint8_t *
skip_string(const uint8_t * buf, const uint8_t * end)
{
	uint8_t ch;

	/* Advance past leading '"'. */
	buf++;

	/* Scan until we find a terminating '"' or run out of input. */
	while (buf < end) {
		ch = *buf++;
		if (ch == '"')
			break;
		if (ch == '\\') {
			if (buf == end)
				break;
			ch = *buf++;
			if (ch == 'u') {
				if (end - buf < 4)
					break;
				buf += 4;
			}
		}
	}

	/* Return our current position. */
	return (buf);
}

// Assembly:
incq %rdi
cmpq %rsi, %rdi
jae 0xb7b3
leaq 0x1(%rdi), %rax
movzbl (%rdi), %ecx
cmpl $0x5c, %ecx
je 0xb788
cmpl $0x22, %ecx
jne 0xb7aa
jmp 0xb7b2
cmpq %rsi, %rax
je 0xb7b2
leaq 0x2(%rdi), %rax
cmpb $0x75, 0x1(%rdi)
jne 0xb7aa
movq %rsi, %rcx
subq %rax, %rcx
cmpq $0x4, %rcx
jl 0xb7b2
addq $0x6, %rdi
movq %rdi, %rax
movq %rax, %rdi
cmpq %rsi, %rax
jb 0xb775
retq
movq %rdi, %rax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/dynamodb/dynamodb_request.c
// Function: dynamodb_request_extracterror
int
dynamodb_request_extracterror(struct http_response * res, char ** errstr)
{
	const uint8_t * buf = res->body;
	const uint8_t * end = res->body + res->bodylen;
	size_t len;

	/* Look for __type. */
	buf = json_find(buf, end, "__type");

	/*
	 * We should be pointing at the opening double-quote of a string;
	 * move past it.
	 */
	if (buf[0] != '"')
		goto bad;
	buf++;

	/* Find a '#' inside the double-quoted string and move past it. */
	for ( ; ; buf++) {
		if ((buf == end) || (buf[0] == '"'))
			goto bad;
		if (buf[0] == '#')
			break;
	}
	buf++;

	/* Find a '"' ending the double-quoted string. */
	for (len = 0; ; len++) {
		if (&buf[len] == end)
			goto bad;
		if (buf[len] == '"')
			break;
	}

	/* Duplicate the error string. */
	if ((*errstr = malloc(len + 1)) == NULL)
		goto err0;
	memcpy(*errstr, buf, len);
	(*errstr)[len] = '\0';

	/* Success! */
	return (0);

bad:
	warn0("DynamoDB sent HTTP 400 response without valid error string!");
	if ((*errstr = strdup("ErrorNotSpecified")) == NULL)
		goto err0;

	/* We successfully parsed; not our fault DynamoDB gave us garbage. */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq 0x20(%rdi), %rax
movq 0x18(%rdi), %r14
addq %rax, %r14
leaq 0x6180(%rip), %rdx      # 0x12a19
movq %rax, %rdi
movq %r14, %rsi
callq 0xb2e4
cmpb $0x22, (%rax)
jne 0xc8e6
movq %rax, %r15
incq %rax
cmpq %r14, %rax
je 0xc8e6
movzbl (%rax), %ecx
cmpl $0x22, %ecx
je 0xc8e6
cmpl $0x23, %ecx
jne 0xc8a9
addq $0x2, %r15
cmpq %r14, %r15
je 0xc8e6
movl $0x1, %r12d
cmpb $0x22, (%rax,%r12)
je 0xc925
leaq (%rax,%r12), %rcx
incq %rcx
incq %r12
cmpq %r14, %rcx
jne 0xc8d0
leaq 0x6133(%rip), %rdi      # 0x12a20
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x58d7
callq 0x3040
movl $0x0, (%rax)
leaq 0x6154(%rip), %rdi      # 0x12a5c
callq 0x35e0
movq %rax, (%rbx)
testq %rax, %rax
jne 0xc91a
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0x34c0
movq %rax, (%rbx)
testq %rax, %rax
je 0xc915
movq %rax, %r14
leaq -0x1(%r12), %rdx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3280
movb $0x0, -0x1(%r14,%r12)
xorl %ebp, %ebp
jmp 0xc91a
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/http/https.c
// Function: https_request
void *
https_request(struct sock_addr * const * addrs, struct http_request * request,
    size_t maxrlen, int (* callback)(void *, struct http_response *),
    void * cookie, const char * hostname)
{
	struct http_cookie * H;
	char * sslhost;

	/* Set function pointers. */
	network_ssl_open_func = network_ssl_open;
	network_ssl_close_func = network_ssl_close;
	netbuf_ssl_read_init_func = netbuf_ssl_read_init;
	netbuf_ssl_write_init_func = netbuf_ssl_write_init;

	/* Duplicate the hostname. */
	if ((sslhost = strdup(hostname)) == NULL)
		goto err0;

	/* Create an HTTP state. */
	if ((H = http_request2(addrs, request, maxrlen, callback,
	    cookie, sslhost)) == NULL)
		goto err1;

	/* Success! */
	return (H);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
leaq 0xe7(%rip), %rax        # 0xd6ec
leaq 0x1b18c(%rip), %rcx     # 0x28798
movq %rax, (%rcx)
leaq 0x61d(%rip), %rax       # 0xdc33
leaq 0x1b183(%rip), %rcx     # 0x287a0
movq %rax, (%rcx)
leaq 0x61(%rip), %rax        # 0xd688
leaq 0x1b17a(%rip), %rcx     # 0x287a8
movq %rax, (%rcx)
leaq 0x7f(%rip), %rax        # 0xd6b7
leaq 0x1b171(%rip), %rcx     # 0x287b0
movq %rax, (%rcx)
movq %r9, %rdi
callq 0x35e0
testq %rax, %rax
je 0xd676
movq %rax, %rbp
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movq %rbx, %r8
movq %rax, %r9
callq 0x8ac8
testq %rax, %rax
jne 0xd678
movq %rbp, %rdi
callq 0x3450
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/network_ssl/network_ssl.c
// Function: network_ssl_read
void *
network_ssl_read(struct network_ssl_ctx * ssl, uint8_t * buf,
    size_t buflen, size_t minread,
    int (* callback)(void *, ssize_t), void * cookie)
{

	/* We must be initialized before we get here. */
	assert(ctx != NULL);

	/* Make sure buflen is non-zero. */
	assert(buflen != 0);

	/* Sanity-check: # bytes must fit into a ssize_t. */
	assert(buflen <= SSIZE_MAX);

	/* Sanity-check: Must not have a read already in progress. */
	assert(ssl->read_callback == NULL);

	/* Record details of the pending request. */
	ssl->read_callback = callback;
	ssl->read_cookie = cookie;
	ssl->read_buf = buf;
	ssl->read_buflen = buflen;
	ssl->read_minlen = minread;
	ssl->read_bufpos = 0;
	ssl->read_needs_r = 0;
	ssl->read_needs_w = 0;

	/* Poke the SSL stack. */
	if (ssl->immediate_cookie == NULL) {
		if ((ssl->immediate_cookie = events_immediate_register(
		    callback_immediate, ssl, 0)) == NULL)
			goto err0;
	}

	/* Success! */
	return (ssl);

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

// Assembly:
pushq %rbx
cmpq $0x0, 0x1afab(%rip)     # 0x288e0
je 0xd993
testq %rdx, %rdx
je 0xd9b2
js 0xd9d1
movq %rdi, %rbx
cmpq $0x0, 0x20(%rdi)
jne 0xd9f0
movq %r8, 0x20(%rbx)
movq %r9, 0x28(%rbx)
movq %rsi, 0x30(%rbx)
movq %rdx, 0x38(%rbx)
movq %rcx, 0x40(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rbx)
cmpq $0x0, 0x18(%rbx)
jne 0xd98e
leaq 0x96(%rip), %rdi        # 0xda0f
movq %rbx, %rsi
xorl %edx, %edx
callq 0x44ec
movq %rax, 0x18(%rbx)
testq %rax, %rax
cmoveq %rax, %rbx
movq %rbx, %rax
popq %rbx
retq
leaq 0x5698(%rip), %rdi      # 0x13032
leaq 0x569d(%rip), %rsi      # 0x1303e
leaq 0x56bf(%rip), %rcx      # 0x13067
movl $0x23f, %edx            # imm = 0x23F
callq 0x3200
leaq 0x4ae8(%rip), %rdi      # 0x124a1
leaq 0x567e(%rip), %rsi      # 0x1303e
leaq 0x56a0(%rip), %rcx      # 0x13067
movl $0x242, %edx            # imm = 0x242
callq 0x3200
leaq 0x4b50(%rip), %rdi      # 0x12528
leaq 0x565f(%rip), %rsi      # 0x1303e
leaq 0x5681(%rip), %rcx      # 0x13067
movl $0x245, %edx            # imm = 0x245
callq 0x3200
leaq 0x56de(%rip), %rdi      # 0x130d5
leaq 0x5640(%rip), %rsi      # 0x1303e
leaq 0x5662(%rip), %rcx      # 0x13067
movl $0x248, %edx            # imm = 0x248
callq 0x3200
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/network_ssl/network_ssl.c
// Function: setupevents
static int
setupevents(struct network_ssl_ctx * ssl)
{

	/* Cancel network events if no longer needed. */
	if (ssl->waiting_r && !ssl->read_needs_r && !ssl->write_needs_r) {
		if (events_network_cancel(ssl->s, EVENTS_NETWORK_OP_READ))
			goto err0;
		ssl->waiting_r = 0;
	}
	if (ssl->waiting_w && !ssl->read_needs_w && !ssl->write_needs_w) {
		if (events_network_cancel(ssl->s, EVENTS_NETWORK_OP_WRITE))
			goto err0;
		ssl->waiting_w = 0;
	}

	/* Register network events if needed. */
	if (!ssl->waiting_r && (ssl->read_needs_r || ssl->write_needs_r)) {
		if (events_network_register(callback_read, ssl, ssl->s,
		    EVENTS_NETWORK_OP_READ))
			goto err0;
		ssl->waiting_r = 1;
	}
	if (!ssl->waiting_w && (ssl->read_needs_w || ssl->write_needs_w)) {
		if (events_network_register(callback_write, ssl, ssl->s,
		    EVENTS_NETWORK_OP_WRITE))
			goto err0;
		ssl->waiting_w = 1;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x10(%rdi), %eax
movl $0x0, %ebp
testl %eax, %eax
je 0xda53
cmpl $0x0, 0x50(%rbx)
je 0xda44
movl %eax, %ebp
jmp 0xda53
cmpl $0x0, 0x88(%rbx)
movl %eax, %ebp
je 0xdb12
movl 0x14(%rbx), %ecx
testl %ecx, %ecx
je 0xda8e
cmpl $0x0, 0x54(%rbx)
jne 0xda90
cmpl $0x0, 0x8c(%rbx)
jne 0xda90
movl (%rbx), %edi
movl $0x1, %esi
callq 0x4c89
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0xdb28
movl $0x0, 0x14(%rbx)
movl 0x10(%rbx), %ebp
xorl %ecx, %ecx
testl %ebp, %ebp
je 0xdad9
xorl %eax, %eax
testl %ecx, %ecx
jne 0xdb28
cmpl $0x0, 0x54(%rbx)
jne 0xdaad
cmpl $0x0, 0x8c(%rbx)
je 0xdb28
movl (%rbx), %edx
leaq 0x694(%rip), %rdi       # 0xe14a
movq %rbx, %rsi
movl $0x1, %ecx
callq 0x48e8
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0xdb28
movl $0x1, 0x14(%rbx)
xorl %eax, %eax
jmp 0xdb28
cmpl $0x0, 0x50(%rbx)
jne 0xdae8
cmpl $0x0, 0x88(%rbx)
je 0xda94
movl (%rbx), %edx
leaq 0x646(%rip), %rdi       # 0xe137
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x48e8
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0xdb28
movl $0x1, 0x10(%rbx)
movl 0x14(%rbx), %ecx
jmp 0xda94
movl (%rbx), %edi
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x4c89
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
je 0xdb2f
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl $0x0, 0x10(%rbx)
jmp 0xda53
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/network_ssl/network_ssl.c
// Function: network_ssl_write
void *
network_ssl_write(struct network_ssl_ctx * ssl, const uint8_t * buf,
    size_t buflen, size_t minwrite,
    int (* callback)(void *, ssize_t), void * cookie)
{

	/* We must be initialized before we get here. */
	assert(ctx != NULL);

	/* Make sure buflen is non-zero. */
	assert(buflen != 0);

	/* Sanity-check: # bytes must fit into a ssize_t. */
	assert(buflen <= SSIZE_MAX);

	/* Sanity-check: Must not have a write already in progress. */
	assert(ssl->write_callback == NULL);

	/* Record details of the pending request. */
	ssl->write_callback = callback;
	ssl->write_cookie = cookie;
	ssl->write_buf = buf;
	ssl->write_buflen = buflen;
	ssl->write_minlen = minwrite;
	ssl->write_bufpos = 0;
	ssl->write_needs_r = 0;
	ssl->write_needs_w = 0;

	/* Poke the SSL stack. */
	if (ssl->immediate_cookie == NULL) {
		if ((ssl->immediate_cookie = events_immediate_register(
		    callback_immediate, ssl, 0)) == NULL)
			goto err0;
	}

	/* Success! */
	return (ssl);

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

// Assembly:
pushq %rbx
cmpq $0x0, 0x1ad9c(%rip)     # 0x288e0
je 0xdba5
testq %rdx, %rdx
je 0xdbc4
js 0xdbe3
movq %rdi, %rbx
cmpq $0x0, 0x58(%rdi)
jne 0xdc02
movq %r8, 0x58(%rbx)
movq %r9, 0x60(%rbx)
movq %rsi, 0x68(%rbx)
movq %rdx, 0x70(%rbx)
movq %rcx, 0x78(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%rbx)
cmpq $0x0, 0x18(%rbx)
jne 0xdba0
leaq -0x17c(%rip), %rdi      # 0xda0f
movq %rbx, %rsi
xorl %edx, %edx
callq 0x44ec
movq %rax, 0x18(%rbx)
testq %rax, %rax
cmoveq %rax, %rbx
movq %rbx, %rax
popq %rbx
retq
leaq 0x5486(%rip), %rdi      # 0x13032
leaq 0x548b(%rip), %rsi      # 0x1303e
leaq 0x5536(%rip), %rcx      # 0x130f0
movl $0x288, %edx            # imm = 0x288
callq 0x3200
leaq 0x48d6(%rip), %rdi      # 0x124a1
leaq 0x546c(%rip), %rsi      # 0x1303e
leaq 0x5517(%rip), %rcx      # 0x130f0
movl $0x28b, %edx            # imm = 0x28B
callq 0x3200
leaq 0x493e(%rip), %rdi      # 0x12528
leaq 0x544d(%rip), %rsi      # 0x1303e
leaq 0x54f8(%rip), %rcx      # 0x130f0
movl $0x28e, %edx            # imm = 0x28E
callq 0x3200
leaq 0x555c(%rip), %rdi      # 0x13165
leaq 0x542e(%rip), %rsi      # 0x1303e
leaq 0x54d9(%rip), %rcx      # 0x130f0
movl $0x291, %edx            # imm = 0x291
callq 0x3200
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/network_ssl/network_ssl.c
// Function: network_ssl_close
void
network_ssl_close(struct network_ssl_ctx * ssl)
{

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

	/* Cancel a pending immediate event. */
	if (ssl->immediate_cookie)
		events_immediate_cancel(ssl->immediate_cookie);

	/* Must not have operations in progress. */
	assert(ssl->read_callback == NULL);
	assert(ssl->write_callback == NULL);

	/* It should be impossible for us to have any events registered. */
	assert(ssl->waiting_r == 0);
	assert(ssl->waiting_w == 0);

	/* Shut down and free the SSL context. */
	SSL_shutdown(ssl->ssl);
	SSL_free(ssl->ssl);

	/* Free our state structure. */
	free(ssl);
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0xdc87
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0xdc4a
callq 0x45de
cmpq $0x0, 0x20(%rbx)
jne 0xdca6
cmpq $0x0, 0x58(%rbx)
jne 0xdcc5
cmpl $0x0, 0x10(%rbx)
jne 0xdce4
cmpl $0x0, 0x14(%rbx)
jne 0xdd03
movq 0x8(%rbx), %rdi
callq 0x3410
movq 0x8(%rbx), %rdi
callq 0x31c0
movq %rbx, %rdi
popq %rbx
jmp 0x3450
leaq 0x54f3(%rip), %rdi      # 0x13181
leaq 0x53a9(%rip), %rsi      # 0x1303e
leaq 0x54f1(%rip), %rcx      # 0x1318d
movl $0x2cf, %edx            # imm = 0x2CF
callq 0x3200
leaq 0x5428(%rip), %rdi      # 0x130d5
leaq 0x538a(%rip), %rsi      # 0x1303e
leaq 0x54d2(%rip), %rcx      # 0x1318d
movl $0x2d6, %edx            # imm = 0x2D6
callq 0x3200
leaq 0x5499(%rip), %rdi      # 0x13165
leaq 0x536b(%rip), %rsi      # 0x1303e
leaq 0x54b3(%rip), %rcx      # 0x1318d
movl $0x2d7, %edx            # imm = 0x2D7
callq 0x3200
leaq 0x54d3(%rip), %rdi      # 0x131be
leaq 0x534c(%rip), %rsi      # 0x1303e
leaq 0x5494(%rip), %rcx      # 0x1318d
movl $0x2da, %edx            # imm = 0x2DA
callq 0x3200
leaq 0x54c8(%rip), %rdi      # 0x131d2
leaq 0x532d(%rip), %rsi      # 0x1303e
leaq 0x5475(%rip), %rcx      # 0x1318d
movl $0x2db, %edx            # imm = 0x2DB
callq 0x3200
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/util/hexify.c
// Function: hexify
void
hexify(const uint8_t * in, char * out, size_t len)
{
	char * p = out;
	size_t i;

	for (i = 0; i < len; i++) {
		*p++ = hexchars[in[i] >> 4];
		*p++ = hexchars[in[i] & 0x0f];
	}
	*p = '\0';
}

// Assembly:
testq %rdx, %rdx
je 0xe2a7
xorl %eax, %eax
leaq 0xa45e(%rip), %rcx      # 0x186d0
xorl %r8d, %r8d
movzbl (%rdi,%r8), %r9d
shrl $0x4, %r9d
movb (%r9,%rcx), %r9b
movb %r9b, (%rsi,%r8,2)
movzbl (%rdi,%r8), %r9d
andl $0xf, %r9d
movb (%r9,%rcx), %r9b
movb %r9b, 0x1(%rsi,%r8,2)
incq %r8
addq $-0x2, %rax
cmpq %r8, %rdx
jne 0xe275
subq %rax, %rsi
movb $0x0, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/util/hexify.c
// Function: unhexify
int
unhexify(const char * in, uint8_t * out, size_t len)
{
	size_t i;
	ptrdiff_t pos;

	/* Make sure we have at least 2 * ${len} hex characters. */
	for (i = 0; i < 2 * len; i++) {
		if ((in[i] == '\0') || (strchr(hexchars, in[i]) == NULL))
			goto err0;
	}

	/* Process all pairs of characters. */
	for (i = 0; i < len; i++) {
		/* Convert first character. */
		pos = strchr(hexchars, in[2 * i]) - hexchars;
		out[i] = (uint8_t)((pos & 0x0f) << 4);

		/* Convert second character. */
		pos = strchr(hexchars, in[2 * i + 1]) - hexchars;
		out[i] = (uint8_t)(out[i] + (pos & 0x0f));
	}

	/* Success! */
	return (0);

err0:
	/* Bad input string. */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, (%rsp)
movq %rdx, %rbp
addq %rdx, %rbp
je 0xe2f5
xorl %ebx, %ebx
leaq 0xa3ff(%rip), %r13      # 0x186d0
movsbl (%r15,%rbx), %esi
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testl %esi, %esi
je 0xe345
movq %r13, %rdi
callq 0x3160
testq %rax, %rax
je 0xe345
incq %rbx
cmpq %rbx, %rbp
jne 0xe2d1
cmpq $0x0, (%rsp)
je 0xe342
xorl %r12d, %r12d
leaq 0xa3ca(%rip), %r13      # 0x186d0
xorl %ebx, %ebx
movsbl (%r15,%rbx,2), %esi
movq %r13, %rdi
callq 0x3160
movq %rax, %rbp
shlb $0x4, %bpl
movb %bpl, (%r14,%rbx)
movsbl 0x1(%r15,%rbx,2), %esi
movq %r13, %rdi
callq 0x3160
andb $0xf, %al
orb %bpl, %al
movb %al, (%r14,%rbx)
incq %rbx
cmpq %rbx, (%rsp)
jne 0xe308
jmp 0xe345
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/alg/sha256.c
// Function: SHA256_Update_internal
static void
SHA256_Update_internal(SHA256_CTX * ctx, const void * in, size_t len,
    uint32_t tmp32[static restrict 72])
{
	uint32_t r;
	const uint8_t * src = in;

	/* Return immediately if we have nothing to do. */
	if (len == 0)
		return;

	/* Number of bytes left in the buffer from previous updates. */
	r = (ctx->count >> 3) & 0x3f;

	/* Update number of bits. */
	ctx->count += (uint64_t)(len) << 3;

	/* Handle the case where we don't need to perform any transforms. */
	if (len < 64 - r) {
		memcpy(&ctx->buf[r], src, len);
		return;
	}

	/* Finish the current block. */
	memcpy(&ctx->buf[r], src, 64 - r);
	SHA256_Transform(ctx->state, ctx->buf, &tmp32[0], &tmp32[64]);
	src += 64 - r;
	len -= 64 - r;

	/* Perform complete blocks. */
	while (len >= 64) {
		SHA256_Transform(ctx->state, src, &tmp32[0], &tmp32[64]);
		src += 64;
		len -= 64;
	}

	/* Copy left over data into buffer. */
	memcpy(ctx->buf, src, len);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0xe669
movq %rcx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq 0x20(%rdi), %rax
leaq (%rax,%rdx,8), %rcx
shrl $0x3, %eax
andl $0x3f, %eax
movq %rcx, 0x20(%rdi)
movl $0x40, %r13d
subl %eax, %r13d
movq %rdx, %r12
addq %rax, %rdi
addq $0x28, %rdi
subq %r13, %r12
jae 0xe678
movq %rbx, %rsi
jmp 0xe6d6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28(%r15), %rax
movq %rax, (%rsp)
movq %rbx, %rsi
movq %r13, %rdx
callq 0x3280
leaq 0x100(%r14), %rbp
movq %r15, %rdi
movq (%rsp), %rsi
movq %r14, %rdx
movq %rbp, %rcx
callq 0xedcd
addq %r13, %rbx
cmpq $0x40, %r12
jb 0xe6cc
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %rbp, %rcx
callq 0xedcd
addq $0x40, %rbx
addq $-0x40, %r12
cmpq $0x3f, %r12
ja 0xe6ad
movq (%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3280
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/alg/sha256.c
// Function: SHA256_Final_internal
static void
SHA256_Final_internal(uint8_t digest[32], SHA256_CTX * ctx,
    uint32_t tmp32[static restrict 72])
{

	/* Add padding. */
	SHA256_Pad(ctx, tmp32);

	/* Write the hash. */
	be32enc_vect(digest, ctx->state, 32);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movl 0x20(%rsi), %eax
shrl $0x3, %eax
andl $0x3f, %eax
leaq 0x28(%rsi), %r12
leaq (%rsi,%rax), %rdi
addq $0x28, %rdi
cmpl $0x37, %eax
ja 0xe772
movl $0x38, %edx
subq %rax, %rdx
leaq 0x4e65(%rip), %rsi      # 0x135d0
callq 0x3280
jmp 0xe7b8
movl $0x40, %edx
subq %rax, %rdx
leaq 0x4e4f(%rip), %rsi      # 0x135d0
callq 0x3280
leaq 0x100(%r15), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xedcd
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r12)
movups %xmm0, 0x10(%r12)
movups %xmm0, (%r12)
movq $0x0, 0x30(%r12)
movq 0x20(%rbx), %rax
bswapq %rax
movq %rax, 0x60(%rbx)
leaq 0x100(%r15), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xedcd
xorl %eax, %eax
movl (%rbx,%rax,4), %ecx
bswapl %ecx
movl %ecx, (%r14,%rax,4)
incq %rax
cmpq $0x8, %rax
jne 0xe7da
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/alg/sha256.c
// Function: libcperciva_SHA256_Buf
void
SHA256_Buf(const void * in, size_t len, uint8_t digest[32])
{
	SHA256_CTX ctx;
	uint32_t tmp32[72];

	SHA256_Init(&ctx);
	SHA256_Update_internal(&ctx, in, len, tmp32);
	SHA256_Final_internal(digest, &ctx, tmp32);

	/* Clean the stack. */
	insecure_memzero(&ctx, sizeof(SHA256_CTX));
	insecure_memzero(tmp32, sizeof(uint32_t) * 72);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0xe358
leaq 0x70(%rsp), %r13
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0xe621
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xe731
leaq 0x9d8f(%rip), %rbx      # 0x185d8
movq (%rbx), %rax
movl $0x68, %esi
movq %r12, %rdi
callq *%rax
movq (%rbx), %rax
movl $0x120, %esi            # imm = 0x120
movq %r13, %rdi
callq *%rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/alg/sha256.c
// Function: HMAC_SHA256_Init_internal
static void
HMAC_SHA256_Init_internal(HMAC_SHA256_CTX * ctx, const void * _k, size_t Klen,
    uint32_t tmp32[static restrict 72], uint8_t pad[static restrict 64],
    uint8_t khash[static restrict 32])
{
	const uint8_t * K = _k;
	size_t i;

	/* If Klen > 64, the key is really SHA256(K). */
	if (Klen > 64) {
		SHA256_Init(&ctx->ictx);
		SHA256_Update_internal(&ctx->ictx, K, Klen, tmp32);
		SHA256_Final_internal(khash, &ctx->ictx, tmp32);
		K = khash;
		Klen = 32;
	}

	/* Inner SHA256 operation is SHA256(K xor [block of 0x36] || data). */
	SHA256_Init(&ctx->ictx);
	memset(pad, 0x36, 64);
	for (i = 0; i < Klen; i++)
		pad[i] ^= K[i];
	SHA256_Update_internal(&ctx->ictx, pad, 64, tmp32);

	/* Outer SHA256 operation is SHA256(K xor [block of 0x5c] || hash). */
	SHA256_Init(&ctx->octx);
	memset(pad, 0x5c, 64);
	for (i = 0; i < Klen; i++)
		pad[i] ^= K[i];
	SHA256_Update_internal(&ctx->octx, pad, 64, tmp32);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r15
cmpq $0x41, %rdx
jb 0xe92f
movq %r9, %r12
movq %r15, %rdi
callq 0xe358
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0xe621
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xe731
movl $0x20, %r13d
jmp 0xe932
movq %rbp, %r12
movq %r15, %rdi
callq 0xe358
movaps 0x4a4f(%rip), %xmm0     # 0x13390
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
testq %r13, %r13
je 0xe96b
xorl %eax, %eax
movb (%r12,%rax), %cl
xorb %cl, (%r14,%rax)
incq %rax
cmpq %rax, %r13
jne 0xe95b
movl $0x40, %edx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rcx
callq 0xe621
addq $0x68, %r15
movq %r15, %rdi
callq 0xe358
movaps 0x4a0f(%rip), %xmm0     # 0x133a0
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
testq %r13, %r13
je 0xe9bb
xorl %eax, %eax
movb (%r12,%rax), %cl
xorb %cl, (%r14,%rax)
incq %rax
cmpq %rax, %r13
jne 0xe9ab
movl $0x40, %edx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe621
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/alg/sha256.c
// Function: libcperciva_HMAC_SHA256_Buf
void
HMAC_SHA256_Buf(const void * K, size_t Klen, const void * in, size_t len,
    uint8_t digest[32])
{
	HMAC_SHA256_CTX ctx;
	uint32_t tmp32[72];
	uint8_t tmp8[96];

	HMAC_SHA256_Init_internal(&ctx, K, Klen, tmp32, &tmp8[0], &tmp8[64]);
	HMAC_SHA256_Update_internal(&ctx, in, len, tmp32);
	HMAC_SHA256_Final_internal(digest, &ctx, tmp32, &tmp8[0]);

	/* Clean the stack. */
	insecure_memzero(&ctx, sizeof(HMAC_SHA256_CTX));
	insecure_memzero(tmp32, sizeof(uint32_t) * 72);
	insecure_memzero(tmp8, 96);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rdx
movq %rdi, %rsi
leaq 0x40(%rsp), %r9
leaq 0x60(%rsp), %rbp
leaq 0x130(%rsp), %r14
movq %rsp, %rbx
movq %rbp, %rdi
movq %r14, %rcx
movq %rbx, %r8
callq 0xe8dd
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0xe621
movq %r15, %rdi
movq %rbp, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xea70
leaq 0x9ab0(%rip), %r15      # 0x185d8
movq (%r15), %rax
movl $0xd0, %esi
movq %rbp, %rdi
callq *%rax
movq (%r15), %rax
movl $0x120, %esi            # imm = 0x120
movq %r14, %rdi
callq *%rax
movq (%r15), %rax
movl $0x60, %esi
movq %rbx, %rdi
callq *%rax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/quicklist.c
// Function: quicklistNodeAllowInsert
REDIS_STATIC int _quicklistNodeAllowInsert(const quicklistNode *node,
                                           const int fill, const size_t sz) {
    if (unlikely(!node))
        return 0;

    int ziplist_overhead;
    /* size of previous offset */
    if (sz < 254)
        ziplist_overhead = 1;
    else
        ziplist_overhead = 5;

    /* size of forward offset */
    if (sz < 64)
        ziplist_overhead += 1;
    else if (likely(sz < 16384))
        ziplist_overhead += 2;
    else
        ziplist_overhead += 5;

    /* new_sz overestimates if 'sz' encodes to an integer type */
    unsigned int new_sz = node->sz + sz + ziplist_overhead;
    if (likely(_quicklistNodeSizeMeetsOptimizationRequirement(new_sz, fill)))
        return 1;
    else if (!sizeMeetsSafetyLimit(new_sz))
        return 0;
    else if ((int)node->count < fill)
        return 1;
    else
        return 0;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x26d8a
xorl %ecx, %ecx
cmpq $0xfe, %rdx
setae %cl
cmpq $0x4000, %rdx           # imm = 0x4000
leal 0x3(,%rcx,4), %ecx
pushq $0xa
popq %r8
cmovbl %ecx, %r8d
cmpq $0x40, %rdx
pushq $0x2
popq %rcx
cmovael %r8d, %ecx
addl %ecx, %edx
addl 0x18(%rdi), %edx
cmpl $-0x5, %esi
jb 0x26d77
movl %edx, %ecx
movl %esi, %r8d
notl %r8d
leaq 0x952b3(%rip), %r9      # 0xbc020
cmpq %rcx, (%r9,%r8,8)
jb 0x26d77
pushq $0x1
popq %rax
retq
cmpl $0x2000, %edx           # imm = 0x2000
ja 0x26d8a
movzwl 0x1c(%rdi), %ecx
xorl %eax, %eax
cmpl %esi, %ecx
setl %al
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/quicklist.c
// Function: quicklistPushHead
int quicklistPushHead(quicklist *quicklist, void *value, size_t sz) {
    quicklistNode *orig_head = quicklist->head;
    if (likely(
            _quicklistNodeAllowInsert(quicklist->head, quicklist->fill, sz))) {
        quicklist->head->zl =
            ziplistPush(quicklist->head->zl, value, sz, ZIPLIST_HEAD);
        quicklistNodeUpdateSz(quicklist->head);
    } else {
        quicklistNode *node = quicklistCreateNode();
        node->zl = ziplistPush(ziplistNew(), value, sz, ZIPLIST_HEAD);

        quicklistNodeUpdateSz(node);
        _quicklistInsertNodeBefore(quicklist, quicklist->head, node);
    }
    quicklist->count++;
    quicklist->head->count++;
    return (orig_head != quicklist->head);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq (%rdi), %r14
movswl 0x1c(%rdi), %esi
movq %r14, %rdi
callq 0x26d20
testl %eax, %eax
je 0x26df0
movq 0x10(%r14), %rdi
movq %r12, %rsi
movl %r15d, %edx
xorl %ecx, %ecx
callq 0x3b65e
movq (%rbx), %rcx
movq %rax, 0x10(%rcx)
movq %rax, %rdi
callq 0x3bbc5
movq (%rbx), %rcx
movl %eax, 0x18(%rcx)
incq 0x10(%rbx)
incw 0x1c(%rcx)
xorl %eax, %eax
cmpq (%rbx), %r14
setne %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
pushq $0x20
popq %rdi
callq 0x382d1
movq %rax, %r13
andq $0x0, 0x10(%rax)
andl $0x0, 0x18(%rax)
movl $0xffe00000, %eax       # imm = 0xFFE00000
andl 0x1c(%r13), %eax
orl $0x90000, %eax          # imm = 0x90000
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
movl %eax, 0x1c(%r13)
callq 0x3ae98
movq %rax, %rdi
movq %r12, %rsi
movl %r15d, %edx
xorl %ecx, %ecx
callq 0x3b65e
movq %rax, 0x10(%r13)
movq %rax, %rdi
callq 0x3bbc5
movl %eax, 0x18(%r13)
movq (%rbx), %rsi
movq %rbx, %rdi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x2b8c6
movq (%rbx), %rcx
jmp 0x26dd6
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/quicklist.c
// Function: quicklistPushTail
int quicklistPushTail(quicklist *quicklist, void *value, size_t sz) {
    quicklistNode *orig_tail = quicklist->tail;
    if (likely(
            _quicklistNodeAllowInsert(quicklist->tail, quicklist->fill, sz))) {
        quicklist->tail->zl =
            ziplistPush(quicklist->tail->zl, value, sz, ZIPLIST_TAIL);
        quicklistNodeUpdateSz(quicklist->tail);
    } else {
        quicklistNode *node = quicklistCreateNode();
        node->zl = ziplistPush(ziplistNew(), value, sz, ZIPLIST_TAIL);

        quicklistNodeUpdateSz(node);
        _quicklistInsertNodeAfter(quicklist, quicklist->tail, node);
    }
    quicklist->count++;
    quicklist->tail->count++;
    return (orig_tail != quicklist->tail);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x8(%rdi), %r14
movswl 0x1c(%rdi), %esi
movq %r14, %rdi
callq 0x26d20
testl %eax, %eax
je 0x26ecc
movq 0x10(%r14), %rdi
pushq $0x1
popq %rcx
movq %r12, %rsi
movl %r15d, %edx
callq 0x3b65e
movq 0x8(%rbx), %rcx
movq %rax, 0x10(%rcx)
movq %rax, %rdi
callq 0x3bbc5
movq 0x8(%rbx), %rcx
movl %eax, 0x18(%rcx)
incq 0x10(%rbx)
incw 0x1c(%rcx)
xorl %eax, %eax
cmpq 0x8(%rbx), %r14
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x382d1
movq %rax, %r13
andq $0x0, 0x10(%rax)
andl $0x0, 0x18(%rax)
movl $0xffe00000, %eax       # imm = 0xFFE00000
andl 0x1c(%r13), %eax
orl $0x90000, %eax          # imm = 0x90000
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
movl %eax, 0x1c(%r13)
callq 0x3ae98
pushq $0x1
popq %rbp
movq %rax, %rdi
movq %r12, %rsi
movl %r15d, %edx
movl %ebp, %ecx
callq 0x3b65e
movq %rax, 0x10(%r13)
movq %rax, %rdi
callq 0x3bbc5
movl %eax, 0x18(%r13)
movq 0x8(%rbx), %rsi
movq %rbx, %rdi
movq %r13, %rdx
movl %ebp, %ecx
callq 0x2b8c6
movq 0x8(%rbx), %rcx
jmp 0x26eac
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/quicklist.c
// Function: quicklistReplaceAtIndex
int quicklistReplaceAtIndex(quicklist *quicklist, long index, void *data,
                            int sz) {
    quicklistEntry entry;
    if (likely(quicklistIndex(quicklist, index, &entry))) {
        /* quicklistIndex provides an uncompressed node */
        entry.node->zl = ziplistDelete(entry.node->zl, &entry.zi);
        entry.node->zl = ziplistInsert(entry.node->zl, entry.zi, data, sz);
        quicklistNodeUpdateSz(entry.node);
        quicklistCompress(quicklist, entry.node);
        return 1;
    } else {
        return 0;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movl %ecx, %ebp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rdx
callq 0x26fde
testl %eax, %eax
je 0x26fda
leaq 0x18(%rsp), %r15
movq -0x8(%r15), %rax
movq 0x10(%rax), %rdi
movq %r15, %rsi
callq 0x3b88c
movq -0x8(%r15), %rcx
movq %rax, 0x10(%rcx)
movq (%r15), %rsi
movq %rax, %rdi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x3b887
movq -0x8(%r15), %rcx
movq %rax, 0x10(%rcx)
movq %rax, %rdi
callq 0x3bbc5
movq -0x8(%r15), %rsi
movl %eax, 0x18(%rsi)
movl 0x1c(%rsi), %eax
btl $0x14, %eax
jb 0x26fb6
movq %rbx, %rdi
callq 0x2b79c
pushq $0x1
popq %rbx
jmp 0x26fcd
andl $0x30000, %eax          # imm = 0x30000
pushq $0x1
popq %rbx
cmpl $0x10000, %eax          # imm = 0x10000
jne 0x26fcd
movq %rsi, %rdi
callq 0x2b6ab
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x26fcd
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/quicklist.c
// Function: quicklistIndex
int quicklistIndex(const quicklist *quicklist, const long long idx,
                   quicklistEntry *entry) {
    quicklistNode *n;
    unsigned long long accum = 0;
    unsigned long long index;
    int forward = idx < 0 ? 0 : 1; /* < 0 -> reverse, 0+ -> forward */

    initEntry(entry);
    entry->quicklist = quicklist;

    if (!forward) {
        index = (-idx) - 1;
        n = quicklist->tail;
    } else {
        index = idx;
        n = quicklist->head;
    }

    if (index >= quicklist->count)
        return 0;

    while (likely(n)) {
        if ((accum + n->count) > index) {
            break;
        } else {
            D("Skipping over (%p) %u at accum %lld", (void *)n, n->count,
              accum);
            accum += n->count;
            n = forward ? n->next : n->prev;
        }
    }

    if (!n)
        return 0;

    D("Found node: %p at accum %llu, idx %llu, sub+ %llu, sub- %llu", (void *)n,
      accum, index, index - accum, (-index) - 1 + accum);

    entry->node = n;
    if (forward) {
        /* forward = normal head-to-tail offset. */
        entry->offset = index - accum;
    } else {
        /* reverse = need negative offset for tail-to-head, so undo
         * the result of the original if (index < 0) above. */
        entry->offset = (-index) - 1 + accum;
    }

    quicklistDecompressNodeForUse(entry->node);
    entry->zi = ziplistIndex(entry->node->zl, entry->offset);
    ziplistGet(entry->zi, &entry->value, &entry->sz, &entry->longval);
    /* The caller will use our result, so we don't re-compress here.
     * The caller can recompress or delete the node as needed. */
    return 1;
}

// Assembly:
movq %rsi, %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdx)
movq $-0x75bcd15, 0x20(%rdx) # imm = 0xF8A432EB
andq $0x0, 0x8(%rdx)
movabsq $0x75bcd1500000000, %rax # imm = 0x75BCD1500000000
movq %rax, 0x28(%rdx)
movq %rdi, (%rdx)
sarq $0x3f, %rsi
xorq %rcx, %rsi
xorl %eax, %eax
cmpq 0x10(%rdi), %rsi
jae 0x270d8
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rcx, %rdx
shrq $0x3f, %rdx
movq (%rdi,%rdx,8), %rdi
testq %rdi, %rdi
je 0x270cf
leaq 0x18(%rbx), %r14
leaq 0x10(%rbx), %r13
leaq 0x20(%rbx), %r15
leaq 0x28(%rbx), %r12
xorl %eax, %eax
testq %rcx, %rcx
setns %al
shll $0x3, %eax
xorl %edx, %edx
movzwl 0x1c(%rdi), %r8d
addq %rdx, %r8
cmpq %rsi, %r8
ja 0x27073
movq (%rdi,%rax), %rdi
movq %r8, %rdx
testq %rdi, %rdi
jne 0x27056
xorl %eax, %eax
jmp 0x270cf
movl %esi, %eax
notl %eax
addl %edx, %eax
subl %edx, %esi
testq %rcx, %rcx
movq %rdi, 0x8(%rbx)
cmovsl %eax, %esi
movl %esi, 0x2c(%rbx)
movl $0x30000, %eax          # imm = 0x30000
andl 0x1c(%rdi), %eax
cmpl $0x20000, %eax          # imm = 0x20000
jne 0x270ae
callq 0x2b72e
movq 0x8(%rbx), %rax
orl $0x100000, 0x1c(%rax)   # imm = 0x100000
movq 0x8(%rbx), %rdi
movl 0x2c(%rbx), %esi
movq 0x10(%rdi), %rdi
callq 0x3b680
movq %rax, (%r13)
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x3b7cf
pushq $0x1
popq %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/quicklist.c
// Function: quicklistGetIteratorAtIdx
quicklistIter *quicklistGetIteratorAtIdx(const quicklist *quicklist,
                                         const int direction,
                                         const long long idx) {
    quicklistEntry entry;

    if (quicklistIndex(quicklist, idx, &entry)) {
        quicklistIter *base = quicklistGetIterator(quicklist, direction);
        base->zi = NULL;
        base->current = entry.node;
        base->offset = entry.offset;
        return base;
    } else {
        return NULL;
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x8(%rsp), %rax
movq %rdx, %rsi
movq %rax, %rdx
callq 0x26fde
testl %eax, %eax
je 0x2711c
movq %r14, %rdi
movl %ebx, %esi
callq 0x2c471
andq $0x0, 0x10(%rax)
movq 0x10(%rsp), %rcx
movq %rcx, 0x8(%rax)
movslq 0x34(%rsp), %rcx
movq %rcx, 0x18(%rax)
jmp 0x2711e
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/quicklist.c
// Function: quicklistCreateNode
REDIS_STATIC quicklistNode *quicklistCreateNode(void) {
    quicklistNode *node;
    node = zmalloc(sizeof(*node));
    node->zl = NULL;
    node->count = 0;
    node->sz = 0;
    node->next = node->prev = NULL;
    node->encoding = QUICKLIST_NODE_ENCODING_RAW;
    node->container = QUICKLIST_NODE_CONTAINER_ZIPLIST;
    node->recompress = 0;
    return node;
}

// Assembly:
pushq %rax
movl $0x20, %edi
callq 0x382d1
movq $0x0, 0x10(%rax)
movl $0x0, 0x18(%rax)
movl $0xffe00000, %ecx       # imm = 0xFFE00000
andl 0x1c(%rax), %ecx
orl $0x90000, %ecx          # imm = 0x90000
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movl %ecx, 0x1c(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/quicklist.c
// Function: quicklistRelease
void quicklistRelease(quicklist *quicklist) {
    unsigned long len;
    quicklistNode *current, *next;

    current = quicklist->head;
    len = quicklist->len;
    while (len--) {
        next = current->next;

        zfree(current->zl);
        quicklist->count -= current->count;

        zfree(current);

        quicklist->len--;
        current = next;
    }
    zfree(quicklist);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x18(%rdi), %r15d
testq %r15, %r15
je 0x2b698
movq (%rbx), %r14
movq 0x8(%r14), %r12
movq 0x10(%r14), %rdi
callq 0x38413
movzwl 0x1c(%r14), %eax
subq %rax, 0x10(%rbx)
movq %r14, %rdi
callq 0x38413
decl 0x18(%rbx)
movq %r12, %r14
decq %r15
jne 0x2b66f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x38413
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/quicklist.c
// Function: _quicklistCompressNode
REDIS_STATIC int __quicklistCompressNode(quicklistNode *node) {
#ifdef REDIS_TEST
    node->attempted_compress = 1;
#endif

    /* Don't bother compressing small values */
    if (node->sz < MIN_COMPRESS_BYTES)
        return 0;

    quicklistLZF *lzf = zmalloc(sizeof(*lzf) + node->sz);

    /* Cancel if compression fails or doesn't compress small enough */
    if (((lzf->sz = lzf_compress(node->zl, node->sz, lzf->compressed,
                                 node->sz)) == 0) ||
        lzf->sz + MIN_COMPRESS_IMPROVE >= node->sz) {
        /* lzf_compress aborts/rejects compression if value not compressable. */
        zfree(lzf);
        return 0;
    }
    lzf = zrealloc(lzf, sizeof(*lzf) + lzf->sz);
    zfree(node->zl);
    node->zl = (unsigned char *)lzf;
    node->encoding = QUICKLIST_NODE_ENCODING_LZF;
    node->recompress = 0;
    return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x18(%rdi), %edi
xorl %ebp, %ebp
cmpq $0x30, %rdi
jb 0x2b727
addq $0x4, %rdi
callq 0x382d1
movq %rax, %r14
movq 0x10(%rbx), %rdi
movl 0x18(%rbx), %ecx
leaq 0x4(%rax), %rdx
movl %ecx, %esi
callq 0x27166
movl %eax, (%r14)
testl %eax, %eax
je 0x2b71f
leal 0x8(%rax), %ecx
cmpl 0x18(%rbx), %ecx
jae 0x2b71f
movl %eax, %esi
addq $0x4, %rsi
movq %r14, %rdi
callq 0x3837d
movq %rax, %r14
movq 0x10(%rbx), %rdi
callq 0x38413
movq %r14, 0x10(%rbx)
movl $0xffecffff, %eax       # imm = 0xFFECFFFF
andl 0x1c(%rbx), %eax
orl $0x20000, %eax          # imm = 0x20000
movl %eax, 0x1c(%rbx)
movl $0x1, %ebp
jmp 0x2b727
movq %r14, %rdi
callq 0x38413
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/quicklist.c
// Function: _quicklistDecompressNode
REDIS_STATIC int __quicklistDecompressNode(quicklistNode *node) {
#ifdef REDIS_TEST
    node->attempted_compress = 0;
#endif

    void *decompressed = zmalloc(node->sz);
    quicklistLZF *lzf = (quicklistLZF *)node->zl;
    if (lzf_decompress(lzf->compressed, lzf->sz, decompressed, node->sz) == 0) {
        /* Someone requested decompress, but we can't decompress.  Not good. */
        zfree(decompressed);
        return 0;
    }
    zfree(lzf);
    node->zl = decompressed;
    node->encoding = QUICKLIST_NODE_ENCODING_RAW;
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x18(%rdi), %edi
callq 0x382d1
movq %rax, %r14
movq 0x10(%rbx), %r15
leaq 0x4(%r15), %rdi
movl (%r15), %esi
movl 0x18(%rbx), %ecx
movq %rax, %rdx
callq 0x386fc
testl %eax, %eax
je 0x2b77e
movq %r15, %rdi
callq 0x38413
movq %r14, 0x10(%rbx)
movl $0xfffcffff, %eax       # imm = 0xFFFCFFFF
andl 0x1c(%rbx), %eax
orl $0x10000, %eax          # imm = 0x10000
movl %eax, 0x1c(%rbx)
movl $0x1, %eax
jmp 0x2b788
movq %r14, %rdi
callq 0x38413
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq