LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/http/http.c
// Function: callback_readdata
static int
callback_readdata(void * cookie, int status)
{
	struct http_cookie * H = cookie;
	uint8_t * buf;
	size_t buflen;
	size_t waitlen;

	/*
	 * Did we fail to read?  (EOF counts as a failure in this case, since
	 * we know exactly how many bytes of data should be arriving.)
	 */
	if (status)
		return (fail(H));

	/* What data has arrived? */
	netbuf_read_peek(H->R, &buf, &buflen);

	/* Don't bite off more than we can chew. */
	if (buflen > H->readlen)
		buflen = H->readlen;

	/* Add this to our internal buffer. */
	if (addbody(H, buf, buflen))
		return (die(H));

	/* Consume the data. */
	netbuf_read_consume(H->R, buflen);

	/* Adjust our remaining-read-length value. */
	H->readlen -= buflen;

	/* Are we done reading this block? */
	if (H->readlen == 0) {
		/* Was this just one chunk from a chunked encoding? */
		if (H->chunked) {
			/* Strip the trailing EOL. */
			H->res.bodylen -= 2;

			/* Get the next chunk. */
			return (callback_chunkedheader(H, 0));
		}

		/* If not, just do the callback. */
		return (docallback(H));
	}

	/*
	 * Wait for the MIN(remaining read length, 1 MB) to arrive.  This is
	 * a compromise between performance (larger reads have less overhead)
	 * and saving memory (if we're reading a large block, we don't want
	 * to buffer the whole thing twice).
	 */
	if (H->readlen > 1024 * 1024)
		waitlen = 1024 * 1024;
	else
		waitlen = H->readlen;

	/* Wait for more data to arrive. */
	if (netbuf_read_wait(H->R, waitlen, callback_readdata, H))
		return (die(H));

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
testl %esi, %esi
je 0x9a31
movq 0x68(%rbx), %rdi
xorl %esi, %esi
callq *0x60(%rbx)
movl %eax, %ebp
movq %rbx, %rdi
callq 0x8f5d
jmp 0x9a77
movq 0x28(%rbx), %rdi
leaq 0x8(%rsp), %rsi
movq %rsp, %r14
movq %r14, %rdx
callq 0x9c29
movq 0x90(%rbx), %rax
cmpq %rax, (%r14)
jbe 0x9a55
movq %rax, (%rsp)
movq 0x8(%rsp), %rsi
movq (%rsp), %rdx
movq %rbx, %rdi
callq 0x9b09
testl %eax, %eax
je 0x9a82
movq %rbx, %rdi
callq 0x8f5d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x28(%rbx), %rdi
movq (%rsp), %rsi
callq 0x9eb4
movq 0x90(%rbx), %rax
subq (%rsp), %rax
movq %rax, 0x90(%rbx)
jne 0x9ac2
cmpl $0x0, 0x88(%rbx)
je 0x9ae9
addq $-0x2, 0xc0(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9684
movl %eax, %ebp
jmp 0x9a77
movl $0x100000, %esi         # imm = 0x100000
cmpq %rsi, %rax
cmovbq %rax, %rsi
movq 0x28(%rbx), %rdi
leaq -0xcc(%rip), %rdx       # 0x9a0d
movq %rbx, %rcx
callq 0x9c42
testl %eax, %eax
jne 0x9a6a
xorl %ebp, %ebp
jmp 0x9a77
movq 0x68(%rbx), %rdi
leaq 0xa8(%rbx), %rsi
callq *0x60(%rbx)
movl %eax, %ebp
movq $0x0, 0xc8(%rbx)
jmp 0x9a27
// File: /workspace/github_c_makefile_star2_O1/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 0xc0(%rdi), %rax
addq %rdx, %rax
movq 0x98(%rdi), %rcx
cmpq %rcx, %rax
ja 0x9ba4
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0xa0(%rdi), %r12
cmpq %r12, %rax
jbe 0x9b6f
addq %r12, %r12
cmpq %rax, %r12
cmovbeq %rax, %r12
cmpq %rcx, %r12
cmovaeq %rcx, %r12
movq 0xc8(%r14), %rdi
movq %r12, %rsi
callq 0x3590
testq %rax, %rax
je 0x9b9d
movq %rax, 0xc8(%r14)
movq %r12, 0xa0(%r14)
movq 0xc8(%r14), %rdi
addq 0xc0(%r14), %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 0x9b91
leaq 0x85ac(%rip), %rdi      # 0x12157
leaq 0x8277(%rip), %rsi      # 0x11e29
leaq 0x85cc(%rip), %rcx      # 0x12185
movl $0xbb, %edx
callq 0x3200
nop
// File: /workspace/github_c_makefile_star2_O1/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 0xb30f
leaq 0xd3c8(%rip), %rax      # 0x18670
movq %rsi, %rcx
xorl %r8d, %r8d
xorl %esi, %esi
shll $0x8, %esi
cmpq %rdx, %r8
jae 0xb2c2
movzbl (%rdi), %r9d
incq %rdi
orl %r9d, %esi
incq %r8
cmpq $0x3, %r8
jne 0xb2b0
xorl %r8d, %r8d
movb $0x3d, %r9b
cmpq %rdx, %r8
ja 0xb2e5
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 0xb2ce
leaq (%rcx,%r8), %rsi
movl $0x0, %r9d
subq $0x3, %rdx
cmovbq %r9, %rdx
ja 0xb2a8
addq %r8, %rcx
movq %rcx, %rsi
movb $0x0, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/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, %r12
movl $0x1, %eax
testb $0x3, %r12b
jne 0xb429
movq %rdx, %r15
movq %rdi, %r13
movq %rcx, 0x8(%rsp)
testq %r12, %r12
je 0xb38e
xorl %ebp, %ebp
xorl %r14d, %r14d
movsbl (%r13,%rbp), %ebx
testl %ebx, %ebx
je 0xb384
leaq 0xd317(%rip), %rdi      # 0x18670
movl %ebx, %esi
callq 0x3160
testq %rax, %rax
je 0xb384
xorl %eax, %eax
cmpb $0x3d, %bl
sete %al
setne %cl
addq %rax, %r14
setne %al
testb %al, %cl
jne 0xb384
incq %rbp
cmpq %rbp, %r12
jne 0xb348
jmp 0xb391
movl $0x1, %eax
jmp 0xb429
xorl %r14d, %r14d
cmpq $0x2, %r14
movl $0x1, %eax
ja 0xb429
movq %r14, 0x10(%rsp)
movq 0x8(%rsp), %rcx
movq $0x0, (%rcx)
testq %r12, %r12
je 0xb41d
leaq 0xd2b3(%rip), %rbp      # 0x18670
xorl %ebx, %ebx
xorl %eax, %eax
movl %eax, %r14d
shll $0x6, %r14d
movsbl (%r13,%rbx), %esi
movq %rbp, %rdi
callq 0x3160
subl %ebp, %eax
andl $0x3f, %eax
orl %r14d, %eax
incq %rbx
cmpq $0x4, %rbx
jne 0xb3c1
xorl %ecx, %ecx
movl %eax, %edx
shrl $0x10, %edx
movb %dl, (%r15,%rcx)
shll $0x8, %eax
incq %rcx
cmpq $0x3, %rcx
jne 0xb3e9
addq $0x4, %r13
addq $0x3, %r15
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
addq $0x3, %rax
movq %rax, (%rcx)
addq $-0x4, %r12
jne 0xb3bd
jmp 0xb41f
xorl %eax, %eax
subq 0x10(%rsp), %rax
movq %rax, (%rcx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xb908
leaq 0x1(%rdi), %rax
movzbl (%rdi), %ecx
cmpl $0x5c, %ecx
je 0xb8dd
cmpl $0x22, %ecx
jne 0xb8ff
jmp 0xb907
cmpq %rsi, %rax
je 0xb907
leaq 0x2(%rdi), %rax
cmpb $0x75, 0x1(%rdi)
jne 0xb8ff
movq %rsi, %rcx
subq %rax, %rcx
cmpq $0x4, %rcx
jl 0xb907
addq $0x6, %rdi
movq %rdi, %rax
movq %rax, %rdi
cmpq %rsi, %rax
jb 0xb8ca
retq
movq %rdi, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x6190(%rip), %rdx      # 0x12ba1
movq %rax, %rdi
movq %r14, %rsi
callq 0xb438
cmpb $0x22, (%rax)
jne 0xca5e
movq %rax, %r15
incq %rax
cmpq %r14, %rax
je 0xca5e
movzbl (%rax), %ecx
cmpl $0x22, %ecx
je 0xca5e
cmpl $0x23, %ecx
jne 0xca21
addq $0x2, %r15
cmpq %r14, %r15
je 0xca5e
movl $0x1, %r12d
cmpb $0x22, (%rax,%r12)
je 0xca9d
leaq (%rax,%r12), %rcx
incq %rcx
incq %r12
cmpq %r14, %rcx
jne 0xca48
leaq 0x6143(%rip), %rdi      # 0x12ba8
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x58ab
callq 0x3040
movl $0x0, (%rax)
leaq 0x6164(%rip), %rdi      # 0x12be4
callq 0x35e0
movq %rax, (%rbx)
testq %rax, %rax
jne 0xca92
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 0xca8d
movq %rax, %r14
leaq -0x1(%r12), %rdx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3280
movb $0x0, -0x1(%r14,%r12)
xorl %ebp, %ebp
jmp 0xca92
// File: /workspace/github_c_makefile_star2_O1/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        # 0xd86c
leaq 0x1b00c(%rip), %rcx     # 0x28798
movq %rax, (%rcx)
leaq 0x60f(%rip), %rax       # 0xdda5
leaq 0x1b003(%rip), %rcx     # 0x287a0
movq %rax, (%rcx)
leaq 0x61(%rip), %rax        # 0xd808
leaq 0x1affa(%rip), %rcx     # 0x287a8
movq %rax, (%rcx)
leaq 0x7f(%rip), %rax        # 0xd837
leaq 0x1aff1(%rip), %rcx     # 0x287b0
movq %rax, (%rcx)
movq %r9, %rdi
callq 0x35e0
testq %rax, %rax
je 0xd7f6
movq %rax, %rbp
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movq %rbx, %r8
movq %rax, %r9
callq 0x8c30
testq %rax, %rax
jne 0xd7f8
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_O1/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, 0x1ae2b(%rip)     # 0x288e0
je 0xdb13
testq %rdx, %rdx
je 0xdb32
js 0xdb51
movq %rdi, %rbx
cmpq $0x0, 0x20(%rdi)
jne 0xdb70
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 0xdb0e
leaq 0x96(%rip), %rdi        # 0xdb8f
movq %rbx, %rsi
xorl %edx, %edx
callq 0x44e4
movq %rax, 0x18(%rbx)
testq %rax, %rax
cmoveq %rax, %rbx
movq %rbx, %rax
popq %rbx
retq
leaq 0x56a0(%rip), %rdi      # 0x131ba
leaq 0x56a5(%rip), %rsi      # 0x131c6
leaq 0x56c7(%rip), %rcx      # 0x131ef
movl $0x23f, %edx            # imm = 0x23F
callq 0x3200
leaq 0x4af0(%rip), %rdi      # 0x12629
leaq 0x5686(%rip), %rsi      # 0x131c6
leaq 0x56a8(%rip), %rcx      # 0x131ef
movl $0x242, %edx            # imm = 0x242
callq 0x3200
leaq 0x4b58(%rip), %rdi      # 0x126b0
leaq 0x5667(%rip), %rsi      # 0x131c6
leaq 0x5689(%rip), %rcx      # 0x131ef
movl $0x245, %edx            # imm = 0x245
callq 0x3200
leaq 0x56e6(%rip), %rdi      # 0x1325d
leaq 0x5648(%rip), %rsi      # 0x131c6
leaq 0x566a(%rip), %rcx      # 0x131ef
movl $0x248, %edx            # imm = 0x248
callq 0x3200
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movq %rdi, %rbx
cmpl $0x0, 0x10(%rdi)
je 0xdbc5
cmpl $0x0, 0x50(%rbx)
jne 0xdbc5
cmpl $0x0, 0x88(%rbx)
je 0xdc68
cmpl $0x0, 0x14(%rbx)
je 0xdbde
cmpl $0x0, 0x54(%rbx)
jne 0xdbde
cmpl $0x0, 0x8c(%rbx)
je 0xdc88
cmpl $0x0, 0x10(%rbx)
je 0xdc2f
xorl %eax, %eax
cmpl $0x0, 0x14(%rbx)
jne 0xdc9f
cmpl $0x0, 0x54(%rbx)
jne 0xdc03
cmpl $0x0, 0x8c(%rbx)
je 0xdc9f
movl (%rbx), %edx
leaq 0x6c0(%rip), %rdi       # 0xe2cc
movq %rbx, %rsi
movl $0x1, %ecx
callq 0x48cc
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0xdc9f
movl $0x1, 0x14(%rbx)
xorl %eax, %eax
jmp 0xdc9f
cmpl $0x0, 0x50(%rbx)
jne 0xdc3e
cmpl $0x0, 0x88(%rbx)
je 0xdbe4
movl (%rbx), %edx
leaq 0x672(%rip), %rdi       # 0xe2b9
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x48cc
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0xdc9f
movl $0x1, 0x10(%rbx)
jmp 0xdbe4
movl (%rbx), %edi
xorl %esi, %esi
callq 0x4c77
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0xdc9f
movl $0x0, 0x10(%rbx)
jmp 0xdbc5
movl (%rbx), %edi
movl $0x1, %esi
callq 0x4c77
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
je 0xdca1
popq %rbx
retq
movl $0x0, 0x14(%rbx)
jmp 0xdbde
// File: /workspace/github_c_makefile_star2_O1/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, 0x1ac2a(%rip)     # 0x288e0
je 0xdd17
testq %rdx, %rdx
je 0xdd36
js 0xdd55
movq %rdi, %rbx
cmpq $0x0, 0x58(%rdi)
jne 0xdd74
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 0xdd12
leaq -0x16e(%rip), %rdi      # 0xdb8f
movq %rbx, %rsi
xorl %edx, %edx
callq 0x44e4
movq %rax, 0x18(%rbx)
testq %rax, %rax
cmoveq %rax, %rbx
movq %rbx, %rax
popq %rbx
retq
leaq 0x549c(%rip), %rdi      # 0x131ba
leaq 0x54a1(%rip), %rsi      # 0x131c6
leaq 0x554c(%rip), %rcx      # 0x13278
movl $0x288, %edx            # imm = 0x288
callq 0x3200
leaq 0x48ec(%rip), %rdi      # 0x12629
leaq 0x5482(%rip), %rsi      # 0x131c6
leaq 0x552d(%rip), %rcx      # 0x13278
movl $0x28b, %edx            # imm = 0x28B
callq 0x3200
leaq 0x4954(%rip), %rdi      # 0x126b0
leaq 0x5463(%rip), %rsi      # 0x131c6
leaq 0x550e(%rip), %rcx      # 0x13278
movl $0x28e, %edx            # imm = 0x28E
callq 0x3200
leaq 0x5572(%rip), %rdi      # 0x132ed
leaq 0x5444(%rip), %rsi      # 0x131c6
leaq 0x54ef(%rip), %rcx      # 0x13278
movl $0x291, %edx            # imm = 0x291
callq 0x3200
// File: /workspace/github_c_makefile_star2_O1/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 0xddf9
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0xddbc
callq 0x45d6
cmpq $0x0, 0x20(%rbx)
jne 0xde18
cmpq $0x0, 0x58(%rbx)
jne 0xde37
cmpl $0x0, 0x10(%rbx)
jne 0xde56
cmpl $0x0, 0x14(%rbx)
jne 0xde75
movq 0x8(%rbx), %rdi
callq 0x3410
movq 0x8(%rbx), %rdi
callq 0x31c0
movq %rbx, %rdi
popq %rbx
jmp 0x3450
leaq 0x5509(%rip), %rdi      # 0x13309
leaq 0x53bf(%rip), %rsi      # 0x131c6
leaq 0x5507(%rip), %rcx      # 0x13315
movl $0x2cf, %edx            # imm = 0x2CF
callq 0x3200
leaq 0x543e(%rip), %rdi      # 0x1325d
leaq 0x53a0(%rip), %rsi      # 0x131c6
leaq 0x54e8(%rip), %rcx      # 0x13315
movl $0x2d6, %edx            # imm = 0x2D6
callq 0x3200
leaq 0x54af(%rip), %rdi      # 0x132ed
leaq 0x5381(%rip), %rsi      # 0x131c6
leaq 0x54c9(%rip), %rcx      # 0x13315
movl $0x2d7, %edx            # imm = 0x2D7
callq 0x3200
leaq 0x54e9(%rip), %rdi      # 0x13346
leaq 0x5362(%rip), %rsi      # 0x131c6
leaq 0x54aa(%rip), %rcx      # 0x13315
movl $0x2da, %edx            # imm = 0x2DA
callq 0x3200
leaq 0x54de(%rip), %rdi      # 0x1335a
leaq 0x5343(%rip), %rsi      # 0x131c6
leaq 0x548b(%rip), %rcx      # 0x13315
movl $0x2db, %edx            # imm = 0x2DB
callq 0x3200
// File: /workspace/github_c_makefile_star2_O1/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 0xe427
xorl %eax, %eax
leaq 0xa2de(%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 0xe3f5
subq %rax, %rsi
movb $0x0, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xe475
xorl %ebx, %ebx
leaq 0xa27f(%rip), %r13      # 0x186d0
movsbl (%r15,%rbx), %esi
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testl %esi, %esi
je 0xe4c5
movq %r13, %rdi
callq 0x3160
testq %rax, %rax
je 0xe4c5
incq %rbx
cmpq %rbx, %rbp
jne 0xe451
cmpq $0x0, (%rsp)
je 0xe4c2
xorl %r12d, %r12d
leaq 0xa24a(%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 0xe488
jmp 0xe4c5
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_O1/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 0xe7e2
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 0xe7f1
movq %rbx, %rsi
jmp 0xe84f
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 0xef3e
addq %r13, %rbx
cmpq $0x40, %r12
jb 0xe845
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %rbp, %rcx
callq 0xef3e
addq $0x40, %rbx
addq $-0x40, %r12
cmpq $0x3f, %r12
ja 0xe826
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_O1/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 0xe8eb
movl $0x38, %edx
subq %rax, %rdx
leaq 0x4e5c(%rip), %rsi      # 0x13740
callq 0x3280
jmp 0xe931
movl $0x40, %edx
subq %rax, %rdx
leaq 0x4e46(%rip), %rsi      # 0x13740
callq 0x3280
leaq 0x100(%r15), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xef3e
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 0xef3e
xorl %eax, %eax
movl (%rbx,%rax,4), %ecx
bswapl %ecx
movl %ecx, (%r14,%rax,4)
incq %rax
cmpq $0x8, %rax
jne 0xe953
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xe4d8
leaq 0x70(%rsp), %r13
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0xe79a
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xe8aa
leaq 0x9c16(%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_O1/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 0xeaa8
movq %r9, %r12
movq %r15, %rdi
callq 0xe4d8
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0xe79a
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xe8aa
movl $0x20, %r13d
jmp 0xeaab
movq %rbp, %r12
movq %r15, %rdi
callq 0xe4d8
movaps 0x4a46(%rip), %xmm0     # 0x13500
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
testq %r13, %r13
je 0xeae4
xorl %eax, %eax
movb (%r12,%rax), %cl
xorb %cl, (%r14,%rax)
incq %rax
cmpq %rax, %r13
jne 0xead4
movl $0x40, %edx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rcx
callq 0xe79a
addq $0x68, %r15
movq %r15, %rdi
callq 0xe4d8
movaps 0x4a06(%rip), %xmm0     # 0x13510
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
testq %r13, %r13
je 0xeb34
xorl %eax, %eax
movb (%r12,%rax), %cl
xorb %cl, (%r14,%rax)
incq %rax
cmpq %rax, %r13
jne 0xeb24
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 0xe79a
// File: /workspace/github_c_makefile_star2_O1/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 0xea56
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0xe79a
movq %r15, %rdi
movq %rbp, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xebe9
leaq 0x9937(%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_O1/mati75[P]evilwm/bind.c
// Function: bind_reset
void bind_reset(void) {
	// unbind _all_ controls
	while (controls) {
		struct bind *b = controls->data;
		controls = list_delete(controls, b);
		free(b);
	}

	// then rebind what's configured
	for (int i = 0; i < NUM_CONTROL_BUILTINS; i++) {
		bind_control(control_builtins[i].ctl, control_builtins[i].func);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0xbca9(%rip), %rbx      # 0x10710
testq %rbx, %rbx
je 0x4a8f
movq 0x8(%rbx), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x87d5
movq %rax, %rbx
movq %rax, 0xbc8b(%rip)      # 0x10710
movq %r14, %rdi
callq 0x42d0
jmp 0x4a67
movl $0x8, %ebx
leaq 0xae75(%rip), %r14      # 0xf910
movq -0x8(%rbx,%r14), %rdi
movq (%rbx,%r14), %rsi
callq 0x4abe
addq $0x10, %rbx
cmpq $0x268, %rbx            # imm = 0x268
jne 0x4a9b
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/mati75[P]evilwm/bind.c
// Function: bind_modifier
void bind_modifier(const char *modname, const char *modstr) {
	if (!modstr)
		return;
	struct name_to_modifier *destm = modifier_by_name(modname);
	if (!destm)
		return;
	destm->value = 0;

	// parse modstr
	char *moddup = xstrdup(modstr);
	for (char *tmp = strtok(moddup, ",+"); tmp; tmp = strtok(NULL, ",+")) {
		// is this a modifier?
		struct name_to_modifier *m = modifier_by_name(tmp);
		if (m) {
			destm->value |= m->value;
			continue;
		}
	}
	free(moddup);
	if (!strcmp(modname, "altmask"))
		altmask = destm->value;
}

// Assembly:
testq %rsi, %rsi
je 0x4ea7
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %r13d, %r13d
leaq 0xb627(%rip), %rbp      # 0x103f0
xorl %r15d, %r15d
movq (%r15,%rbp), %rdi
movq %rbx, %rsi
callq 0x4540
testl %eax, %eax
je 0x4deb
addq $0x10, %r15
cmpq $0xc0, %r15
jne 0x4dcc
jmp 0x4df1
addq %rbp, %r15
movq %r15, %r13
testq %r13, %r13
je 0x4e99
movl $0x0, 0x8(%r13)
movq %r14, %rdi
callq 0xa128
leaq 0x6253(%rip), %rsi      # 0xb064
movq %rax, (%rsp)
movq %rax, %rdi
callq 0x4580
testq %rax, %rax
je 0x4e73
movq %rax, %r12
leaq 0x6238(%rip), %r15      # 0xb064
xorl %r14d, %r14d
movq (%r14,%rbp), %rdi
movq %r12, %rsi
callq 0x4540
testl %eax, %eax
je 0x4e51
addq $0x10, %r14
cmpq $0xc0, %r14
jne 0x4e2f
xorl %r14d, %r14d
jmp 0x4e54
addq %rbp, %r14
testq %r14, %r14
je 0x4e61
movl 0x8(%r14), %eax
orl %eax, 0x8(%r13)
xorl %edi, %edi
movq %r15, %rsi
callq 0x4580
movq %rax, %r12
testq %rax, %rax
jne 0x4e2c
movq (%rsp), %rdi
callq 0x42d0
leaq 0x61a9(%rip), %rsi      # 0xb02c
movq %rbx, %rdi
callq 0x4540
testl %eax, %eax
jne 0x4e99
movl 0x8(%r13), %eax
movl %eax, 0xb57f(%rip)      # 0x10418
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mati75[P]evilwm/bind.c
// Function: bind_grab_for_screen
void bind_grab_for_screen(struct screen *s) {
	// Release any previous grabs
	XUngrabKey(display.dpy, AnyKey, AnyModifier, s->root);

	for (struct list *l = controls; l; l = l->next) {
		struct bind *b = l->data;
		if (b->type == KeyPress) {
			grab_keysym(b->control.key, b->state, s->root);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rax
leaq 0xb878(%rip), %r12      # 0x10738
movq (%r12), %rdi
movq %rax, 0x10(%rsp)
movq 0x10(%rax), %rcx
xorl %esi, %esi
movl $0x8000, %edx           # imm = 0x8000
callq 0x4240
movq 0xb830(%rip), %r13      # 0x10710
testq %r13, %r13
je 0x4fc1
movl $0x1, %ebx
movq 0x8(%r13), %rax
cmpl $0x2, (%rax)
jne 0x4fb4
movq 0x8(%rax), %rsi
movl 0x10(%rax), %ebp
movq 0x10(%rsp), %rax
movq 0x10(%rax), %r14
movq (%r12), %rdi
callq 0x4610
movq (%r12), %rdi
movzbl %al, %r15d
movl %ebx, (%rsp)
movl %r15d, %esi
movl %ebp, %edx
movq %r14, %rcx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x4660
movq (%r12), %rdi
movl %ebp, %edx
orl $0x2, %edx
movl %ebx, (%rsp)
movl %r15d, %esi
movq %r14, %rcx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x4660
leaq 0xb986(%rip), %rax      # 0x108e8
movl (%rax), %edx
testl %edx, %edx
je 0x4fb4
movq (%r12), %rdi
orl %ebp, %edx
movl %ebx, (%rsp)
movl %r15d, %esi
movq %r14, %rcx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x4660
movq (%r12), %rdi
leaq 0xb955(%rip), %rax      # 0x108e8
orl (%rax), %ebp
orl $0x2, %ebp
movl %ebx, (%rsp)
movl %r15d, %esi
movl %ebp, %edx
movq %r14, %rcx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x4660
movq (%r13), %r13
testq %r13, %r13
jne 0x4eee
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mati75[P]evilwm/bind.c
// Function: bind_grab_for_client
void bind_grab_for_client(struct client *c) {
	// Button binds way less configurable than key binds for now.
	// Modifiers in the bind are ignored, and we ONLY use 'mask2' and
	// 'mask2+altmask'.

	for (struct list *l = controls; l; l = l->next) {
		struct bind *b = l->data;
		if (b->type == ButtonPress) {
			grab_button(b->control.button, grabmask2, c->parent);
			grab_button(b->control.button, grabmask2|altmask, c->parent);
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0xb734(%rip), %r14      # 0x10710
testq %r14, %r14
je 0x5022
movq %rdi, %rbx
movq 0x8(%r14), %r15
cmpl $0x4, (%r15)
jne 0x501a
movl 0x8(%r15), %edi
movl 0xb410(%rip), %esi      # 0x10408
movq 0x8(%rbx), %rdx
callq 0x5028
movl 0x8(%r15), %edi
movl 0xb40d(%rip), %esi      # 0x10418
orl 0xb3f7(%rip), %esi      # 0x10408
movq 0x8(%rbx), %rdx
callq 0x5028
movq (%r14), %r14
testq %r14, %r14
jne 0x4fe4
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/mati75[P]evilwm/bind.c
// Function: grab_button
static void grab_button(unsigned button, unsigned modifiers, Window w) {
	XGrabButton(display.dpy, button, modifiers, w,
		    False, ButtonPressMask | ButtonReleaseMask,
		    GrabModeAsync, GrabModeSync, None, None);
	XGrabButton(display.dpy, button, modifiers|LockMask, w,
		    False, ButtonPressMask | ButtonReleaseMask,
		    GrabModeAsync, GrabModeSync, None, None);
	if (numlockmask) {
		XGrabButton(display.dpy, button, modifiers|numlockmask, w,
			    False, ButtonPressMask | ButtonReleaseMask,
			    GrabModeAsync, GrabModeSync, None, None);
		XGrabButton(display.dpy, button, modifiers|numlockmask|LockMask, w,
			    False, ButtonPressMask | ButtonReleaseMask,
			    GrabModeAsync, GrabModeSync, None, None);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movl %edi, %r14d
leaq 0xb6f3(%rip), %r13      # 0x10738
movq (%r13), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
xorl %r15d, %r15d
movl %r15d, 0x8(%rsp)
movl $0x1, %r12d
movl %r12d, (%rsp)
movl %r14d, %esi
movl %ebp, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
movl $0xc, %r9d
callq 0x4620
movq (%r13), %rdi
movl %ebp, %edx
orl $0x2, %edx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl %r15d, 0x8(%rsp)
movl %r12d, (%rsp)
movl %r14d, %esi
movq %rbx, %rcx
xorl %r8d, %r8d
movl $0xc, %r9d
callq 0x4620
leaq 0xb83a(%rip), %r15      # 0x108e8
movl (%r15), %edx
testl %edx, %edx
je 0x5113
movq (%r13), %rdi
orl %ebp, %edx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
xorl %eax, %eax
movl %eax, 0x8(%rsp)
movl %r12d, (%rsp)
movl %r14d, %esi
movq %rbx, %rcx
xorl %r8d, %r8d
movl $0xc, %r9d
callq 0x4620
movq (%r13), %rdi
orl (%r15), %ebp
orl $0x2, %ebp
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
xorl %eax, %eax
movl %eax, 0x8(%rsp)
movl %r12d, (%rsp)
movl %r14d, %esi
movl %ebp, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
movl $0xc, %r9d
callq 0x4620
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mati75[P]evilwm/bind.c
// Function: bind_handle_key
void bind_handle_key(XKeyEvent *e) {
	KeySym key = XkbKeycodeToKeysym(display.dpy, e->keycode, 0, 0);

	for (struct list *l = controls; l; l = l->next) {
		struct bind *bind = l->data;
		if (bind->type == KeyPress && key == bind->control.key && (e->state & KEY_STATE_MASK & ~numlockmask) == (bind->state & ~numlockmask)) {
			void *sptr = NULL;
			if (bind->flags & FL_CLIENT) {
				sptr = current;
				if (!sptr)
					return;
			} else if (bind->flags & FL_SCREEN) {
				sptr = find_current_screen();
				if (!sptr)
					return;
			}
			bind->func(sptr, (XEvent *)e, bind->flags);
			break;
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xb608(%rip), %rax      # 0x10738
movq (%rax), %rdi
movzbl 0x54(%rbx), %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x4260
movq 0xb5c9(%rip), %rcx      # 0x10710
testq %rcx, %rcx
je 0x5181
leaq 0xb795(%rip), %rdx      # 0x108e8
movl (%rdx), %edx
notl %edx
movl $0xfd, %esi
movq 0x8(%rcx), %r14
cmpl $0x2, (%r14)
jne 0x5179
cmpq 0x8(%r14), %rax
jne 0x5179
movl 0x50(%rbx), %edi
andl %esi, %edi
xorl 0x10(%r14), %edi
testl %edx, %edi
je 0x5189
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x515c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl 0x20(%r14), %eax
btl $0x10, %eax
jb 0x519c
testw %ax, %ax
js 0x51ad
xorl %edi, %edi
jmp 0x51ba
leaq 0xb58d(%rip), %rax      # 0x10730
movq (%rax), %rdi
testq %rdi, %rdi
jne 0x51ba
jmp 0x5181
callq 0x9775
movq %rax, %rdi
testq %rax, %rax
je 0x5181
movq 0x18(%r14), %rax
movl 0x20(%r14), %edx
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O1/mati75[P]evilwm/bind.c
// Function: bind_handle_button
void bind_handle_button(XButtonEvent *e) {
	for (struct list *l = controls; l; l = l->next) {
		struct bind *bind = l->data;
		if (bind->type == ButtonPress && e->button == bind->control.button && (e->state & BUTTON_STATE_MASK & ~numlockmask) == (bind->state & ~numlockmask)) {
			void *sptr = NULL;
			if (bind->flags & FL_CLIENT) {
				sptr = find_client(e->window);
			} else if (bind->flags & FL_SCREEN) {
				sptr = find_current_screen();
			}
			if (!sptr)
				return;
			bind->func(sptr, (XEvent *)e, bind->flags);
			break;
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0xb537(%rip), %rax      # 0x10710
testq %rax, %rax
je 0x5222
movq %rdi, %rbx
movl 0xb221(%rip), %ecx      # 0x10408
notl %ecx
andl $0xfd, %ecx
leaq 0xb6f2(%rip), %rdx      # 0x108e8
movl (%rdx), %edx
notl %edx
movq 0x8(%rax), %r14
cmpl $0x4, (%r14)
jne 0x521a
movl 0x54(%rbx), %esi
cmpl 0x8(%r14), %esi
jne 0x521a
movl 0x50(%rbx), %esi
andl %ecx, %esi
xorl 0x10(%r14), %esi
testl %edx, %esi
je 0x522a
movq (%rax), %rax
testq %rax, %rax
jne 0x51fa
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl 0x20(%r14), %eax
btl $0x10, %eax
jb 0x523d
testw %ax, %ax
js 0x5248
xorl %eax, %eax
jmp 0x524d
movq 0x20(%rbx), %rdi
callq 0x53b0
jmp 0x524d
callq 0x9775
testq %rax, %rax
je 0x5222
movq 0x18(%r14), %rcx
movl 0x20(%r14), %edx
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rcx
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/mati75[P]evilwm/client.c
// Function: get_wm_normal_hints
long get_wm_normal_hints(struct client *c) {
	long flags;
	long dummy;
	XSizeHints *size = XAllocSizeHints();

	LOG_XENTER("XGetWMNormalHints(window=%lx)", (unsigned long)c->window);
	XGetWMNormalHints(display.dpy, c->window, size, &dummy);
	debug_wm_normal_hints(size);
	LOG_XLEAVE();

	flags = size->flags;

	if (flags & PMinSize) {
		c->min_width = size->min_width;
		c->min_height = size->min_height;
	} else {
		c->min_width = c->min_height = 0;
	}

	if (flags & PMaxSize) {
		c->max_width = size->max_width;
		c->max_height = size->max_height;
	} else {
		c->max_width = c->max_height = 0;
	}

	if (flags & PBaseSize) {
		c->base_width = size->base_width;
		c->base_height = size->base_height;
	} else {
		c->base_width = c->min_width;
		c->base_height = c->min_height;
	}

	c->width_inc = c->height_inc = 1;
	if (flags & PResizeInc) {
		c->width_inc = size->width_inc ? size->width_inc : 1;
		c->height_inc = size->height_inc ? size->height_inc : 1;
	}

	if (!(flags & PMinSize)) {
		c->min_width = c->base_width + c->width_inc;
		c->min_height = c->base_height + c->height_inc;
	}

	if (flags & PWinGravity) {
		c->win_gravity_hint = size->win_gravity;
	} else {
		c->win_gravity_hint = NorthWestGravity;
	}
	c->win_gravity = c->win_gravity_hint;

	XFree(size);
	return flags;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x4650
movq %rax, %r14
leaq 0xb4b1(%rip), %rax      # 0x10738
movq (%rax), %rdi
movq (%rbx), %rsi
leaq 0x8(%rsp), %rcx
movq %r14, %rdx
callq 0x4120
movq (%r14), %r15
testb $0x10, %r15b
jne 0x52ad
movq $0x0, 0x6c(%rbx)
jmp 0x52bb
movl 0x18(%r14), %eax
movl %eax, 0x6c(%rbx)
movl 0x1c(%r14), %eax
movl %eax, 0x70(%rbx)
testb $0x20, %r15b
jne 0x52cb
movq $0x0, 0x74(%rbx)
jmp 0x52d9
movl 0x20(%r14), %eax
movl %eax, 0x74(%rbx)
movl 0x24(%r14), %eax
movl %eax, 0x78(%rbx)
btl $0x8, %r15d
jb 0x52ef
movl 0x6c(%rbx), %eax
movl %eax, 0x84(%rbx)
leaq 0x70(%rbx), %rax
jmp 0x5300
movl 0x40(%r14), %eax
movl %eax, 0x84(%rbx)
movq %r14, %rax
addq $0x44, %rax
movl (%rax), %eax
movl %eax, 0x88(%rbx)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x7c(%rbx)
testb $0x40, %r15b
je 0x5339
movl 0x28(%r14), %eax
cmpl $0x1, %eax
adcl $0x0, %eax
movl %eax, 0x7c(%rbx)
movl 0x2c(%r14), %eax
cmpl $0x1, %eax
adcl $0x0, %eax
movl %eax, 0x80(%rbx)
testb $0x10, %r15b
jne 0x535a
movl 0x7c(%rbx), %eax
movl 0x80(%rbx), %ecx
addl 0x84(%rbx), %eax
movl %eax, 0x6c(%rbx)
addl 0x88(%rbx), %ecx
movl %ecx, 0x70(%rbx)
movl $0x1, %eax
btl $0x9, %r15d
jae 0x536a
movl 0x48(%r14), %eax
movl %eax, 0x8c(%rbx)
movl %eax, 0x90(%rbx)
movq %r14, %rdi
callq 0x4050
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/mati75[P]evilwm/client.c
// Function: find_client
struct client *find_client(Window w) {
	for (struct list *iter = clients_tab_order; iter; iter = iter->next) {
		struct client *c = iter->data;
		if (w == c->parent || w == c->window)
			return c;
	}
	return NULL;
}

// Assembly:
leaq 0xb361(%rip), %rcx      # 0x10718
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x53e1
movq 0x8(%rcx), %rax
cmpq %rdi, 0x8(%rax)
jne 0x53cd
xorl %esi, %esi
jmp 0x53d8
cmpq %rdi, (%rax)
setne %sil
cmovneq %rdx, %rax
movq %rax, %rdx
testb %sil, %sil
jne 0x53b7
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/mati75[P]evilwm/client.c
// Function: client_raise
void client_raise(struct client *c) {
	LOG_XDEBUG("XRaiseWindow(window=%lx,parent=%lx)\n", (unsigned long)c->window, (unsigned long)c->parent);
	XRaiseWindow(display.dpy, c->parent);
	clients_stacking_order = list_to_tail(clients_stacking_order, c);
	ewmh_set_net_client_list_stacking(c->screen);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xb046(%rip), %rax      # 0x10738
movq (%rax), %rdi
movq 0x8(%rbx), %rsi
callq 0x4180
movq 0xb023(%rip), %rdi      # 0x10728
movq %rbx, %rsi
callq 0x8859
movq %rax, 0xb014(%rip)      # 0x10728
movq 0x10(%rbx), %rdi
popq %rbx
jmp 0x7f36