LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/s3/dispatch.c
// Function: dispatch_done
int
dispatch_done(struct dispatch_state * D)
{

	/* Sanity check. */
	assert(D->accepting == 0);
	assert(D->read_cookie == NULL);
	assert(D->ip_head == NULL);
	assert(D->ip_tail == NULL);

	/* Free the buffered reader for the connection. */
	netbuf_read_free(D->readq);

	/* Free the buffered writer for the connection. */
	netbuf_write_free(D->writeq);

	/* Close the connection. */
	while (close(D->sconn)) {
		if (errno == EINTR)
			continue;
		warnp("close");
		goto err0;
	}

	/* Free allocated memory. */
	free(D);

	/* Success! */
	return (0);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0x18(%rdi)
jne 0x37e4
movq %rdi, %rbx
cmpq $0x0, 0x30(%rdi)
jne 0x3803
cmpq $0x0, 0x8(%rbx)
jne 0x3822
cmpq $0x0, 0x10(%rbx)
jne 0x3841
movq 0x28(%rbx), %rdi
callq 0x6437
movq 0x20(%rbx), %rdi
callq 0x67ec
movl 0x1c(%rbx), %edi
callq 0x2200
testl %eax, %eax
je 0x37c2
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x3793
leaq 0xcec8(%rip), %rdi      # 0x1067d
testl %eax, %eax
jne 0x37ce
xorl %eax, %eax
callq 0x95ec
jmp 0x37d9
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
jmp 0x37dc
xorl %eax, %eax
callq 0x945d
andl $0x0, (%r14)
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xcb7c(%rip), %rdi      # 0x10367
leaq 0xcb87(%rip), %rsi      # 0x10379
leaq 0xcb8b(%rip), %rcx      # 0x10384
movl $0x1bc, %edx            # imm = 0x1BC
callq 0x21e0
leaq 0xcba5(%rip), %rdi      # 0x103af
leaq 0xcb68(%rip), %rsi      # 0x10379
leaq 0xcb6c(%rip), %rcx      # 0x10384
movl $0x1bd, %edx            # imm = 0x1BD
callq 0x21e0
leaq 0xcb9d(%rip), %rdi      # 0x103c6
leaq 0xcb49(%rip), %rsi      # 0x10379
leaq 0xcb4d(%rip), %rcx      # 0x10384
movl $0x1be, %edx            # imm = 0x1BE
callq 0x21e0
leaq 0xcb91(%rip), %rdi      # 0x103d9
leaq 0xcb2a(%rip), %rsi      # 0x10379
leaq 0xcb2e(%rip), %rcx      # 0x10384
movl $0x1bf, %edx            # imm = 0x1BF
callq 0x21e0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/s3/dispatch.c
// Function: request_dequeue
static void
request_dequeue(struct dispatch_state * D, struct request * R)
{

	/* Sanity-check linked list. */
	assert(D == R->D);

	/* Free the contents of the kivaloo-S3 request structure. */
	proto_s3_request_free(&R->R);

	/* Free extra allocations in the S3 request structure. */
	free(R->path);
	free(R->range);

	/* Remove from the linked list. */
	if (D->ip_head == R) {
		assert(R->prev == NULL);
		D->ip_head = R->next;
	} else {
		assert(R->prev != NULL);
		R->prev->next = R->next;
	}
	if (D->ip_tail == R) {
		assert(R->next == NULL);
		D->ip_tail = R->prev;
	} else {
		assert(R->next != NULL);
		R->next->prev = R->prev;
	}

	/* Free the request structure. */
	free(R);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq %rdi, (%rsi)
jne 0x3bc0
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x18(%rsi), %rdi
callq 0xa00b
movq 0x80(%rbx), %rdi
callq 0x2040
movq 0x88(%rbx), %rdi
callq 0x2040
movq 0x8(%rbx), %rax
cmpq %rbx, 0x8(%r14)
je 0x3b7e
testq %rax, %rax
je 0x3bd9
movq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rax)
jmp 0x3b91
testq %rax, %rax
jne 0x3c0b
movq 0x10(%rbx), %rcx
movq %rcx, 0x8(%r14)
xorl %eax, %eax
cmpq %rbx, 0x10(%r14)
je 0x3ba5
testq %rcx, %rcx
je 0x3bf2
addq $0x8, %rcx
movq %rcx, %r14
jmp 0x3bae
testq %rcx, %rcx
jne 0x3c24
addq $0x10, %r14
movq %rax, (%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2040
leaq 0xc8cb(%rip), %rdi      # 0x10492
leaq 0xc7ab(%rip), %rsi      # 0x10379
leaq 0xc8c7(%rip), %rcx      # 0x1049c
pushq $0x3e
jmp 0x3c3b
leaq 0xc90c(%rip), %rdi      # 0x104ec
leaq 0xc792(%rip), %rsi      # 0x10379
leaq 0xc8ae(%rip), %rcx      # 0x1049c
pushq $0x4c
jmp 0x3c3b
leaq 0xc913(%rip), %rdi      # 0x1050c
leaq 0xc779(%rip), %rsi      # 0x10379
leaq 0xc895(%rip), %rcx      # 0x1049c
pushq $0x53
jmp 0x3c3b
leaq 0xc8ca(%rip), %rdi      # 0x104dc
leaq 0xc760(%rip), %rsi      # 0x10379
leaq 0xc87c(%rip), %rcx      # 0x1049c
pushq $0x49
jmp 0x3c3b
leaq 0xc8d1(%rip), %rdi      # 0x104fc
leaq 0xc747(%rip), %rsi      # 0x10379
leaq 0xc863(%rip), %rcx      # 0x1049c
pushq $0x50
popq %rdx
callq 0x21e0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_s3/proto_s3_server.c
// Function: proto_s3_request_read
int
proto_s3_request_read(struct netbuf_read * R, struct proto_s3_request * req)
{
	struct wire_packet P;

	/* Try to grab a packet from the buffered reader. */
	if (wire_readpacket_peek(R, &P))
		goto err0;

	/* Do we have a packet? */
	if (P.buf == NULL)
		goto nopacket;

	/* Parse this packet. */
	if (proto_s3_request_parse(&P, req))
		goto err0;

	/* Consume the packet. */
	wire_readpacket_consume(R, &P);

	/* Success! */
	return (0);

nopacket:
	/* Record that no request was available. */
	req->type = PROTO_S3_NONE;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
callq 0xa9dc
pushq $-0x1
popq %rbp
testl %eax, %eax
jne 0x9ffa
movq 0x18(%rsp), %r15
testq %r15, %r15
je 0x9f72
movq 0x8(%rsp), %rax
movq %rax, (%r14)
movq 0x10(%rsp), %r12
cmpq $0x4, %r12
jb 0x9ffa
movq %r15, %rdi
callq 0xa190
movl %eax, 0x8(%r14)
movq %rsp, %rdx
movq $0x4, (%rdx)
movq %r15, %rdi
movq %r12, %rsi
callq 0xa195
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0x9ffa
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdi
movq %rsp, %rdx
callq 0xa195
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x9ff1
movq %rax, %r15
movl 0x8(%r14), %eax
cmpl $0x10030, %eax          # imm = 0x10030
je 0x9f7b
cmpl $0x10010, %eax          # imm = 0x10010
je 0x9f88
cmpl $0x10011, %eax          # imm = 0x10011
je 0x9fa7
cmpl $0x10020, %eax          # imm = 0x10020
je 0x9f7b
cmpl $0x10000, %eax          # imm = 0x10000
jne 0x9fe9
movq 0x10(%rsp), %r13
movq (%rsp), %rdi
leaq 0x4(%rdi), %r12
cmpq %r12, %r13
jb 0x9fe9
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
addq %rax, %rdi
callq 0xa190
movl %eax, 0x20(%r14)
movl %eax, %edi
leaq (%r12,%rdi), %rax
cmpq %rax, %r13
jne 0x9fe9
movq %rdi, %r13
callq 0x2340
movq %rax, 0x28(%r14)
testq %rax, %rax
je 0x9fe9
movq %r13, %rdx
movq 0x20(%rsp), %rsi
addq %r12, %rsi
movq %rax, %rdi
callq 0x22f0
jmp 0x9fda
orl $-0x1, 0x8(%r14)
xorl %ebp, %ebp
jmp 0x9ffa
movq 0x10(%rsp), %rax
cmpq (%rsp), %rax
je 0x9fda
jmp 0x9fe9
movq (%rsp), %rdi
leaq 0x4(%rdi), %rax
cmpq %rax, 0x10(%rsp)
jne 0x9fe9
addq 0x18(%rsp), %rdi
callq 0xa190
movl %eax, 0x20(%r14)
jmp 0x9fda
movq (%rsp), %r12
leaq 0x8(%r12), %rax
cmpq %rax, 0x10(%rsp)
jne 0x9fe9
movq 0x18(%rsp), %r15
leaq (%r15,%r12), %rdi
callq 0xa190
movl %eax, 0x20(%r14)
leaq (%r15,%r12), %rdi
addq $0x4, %rdi
callq 0xa190
movl %eax, 0x24(%r14)
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xad9c
jmp 0x9f77
movq %r15, %rdi
callq 0x2040
movq 0x10(%r14), %rdi
callq 0x2040
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_s3/proto_s3_server.c
// Function: proto_s3_request_free
void
proto_s3_request_free(struct proto_s3_request * req)
{

	/* If this is a PUT, free the malloced data buffer. */
	if (req->type == PROTO_S3_PUT)
		free(req->r.put.buf);

	/* Free the object and bucket names. */
	free(req->object);
	free(req->bucket);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x10000, 0x8(%rdi)     # imm = 0x10000
jne 0xa021
movq 0x28(%rbx), %rdi
callq 0x2040
movq 0x18(%rbx), %rdi
callq 0x2040
movq 0x10(%rbx), %rdi
popq %rbx
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_s3/proto_s3_server.c
// Function: proto_s3_response_status
int
proto_s3_response_status(struct netbuf_write * Q, uint64_t ID, int status)
{
	uint8_t * wbuf;

	/* Sanity check. */
	assert((status == 0) || ((status >= 100) && (status <= 599)));

	/* Get a packet data buffer. */
	if ((wbuf = wire_writepacket_getbuf(Q, ID, 4)) == NULL)
		goto err0;

	/* Write the packet data. */
	be32enc(&wbuf[0], (uint32_t)status);

	/* Finish the packet. */
	if (wire_writepacket_done(Q, wbuf, 4))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
testl %edx, %edx
sete %al
leal -0x64(%r14), %ecx
cmpl $0x1f4, %ecx            # imm = 0x1F4
setb %cl
orb %al, %cl
je 0xa090
movq %rdi, %rbx
pushq $0x4
popq %rdx
callq 0xae28
testq %rax, %rax
je 0xa081
rolw $0x8, %r14w
movw %r14w, 0x2(%rax)
andw $0x0, (%rax)
pushq $0x4
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xaef2
testl %eax, %eax
je 0xa086
pushq $-0x1
popq %rax
jmp 0xa088
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x79ee(%rip), %rdi      # 0x11a85
leaq 0x7a1d(%rip), %rsi      # 0x11abb
leaq 0x7a38(%rip), %rcx      # 0x11add
movl $0xbe, %edx
callq 0x21e0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_s3/proto_s3_server.c
// Function: proto_s3_response_data
int
proto_s3_response_data(struct netbuf_write * Q, uint64_t ID, int status,
    uint32_t len, const uint8_t * buf)
{
	uint8_t * wbuf;
	size_t rlen;

	/* Sanity check. */
	assert((status == 0) || ((status >= 100) && (status <= 599)));

	/* Compute the response length. */
	rlen = 8 + (((buf != NULL) && (len != (uint32_t)(-1))) ? len : 0);

	/* Get a packet data buffer. */
	if ((wbuf = wire_writepacket_getbuf(Q, ID, rlen)) == NULL)
		goto err0;

	/* Write the packet data. */
	be32enc(&wbuf[0], (uint32_t)status);
	be32enc(&wbuf[4], len);
	if ((buf != NULL) && (len != (uint32_t)(-1)))
		memcpy(&wbuf[8], buf, len);

	/* Finish the packet. */
	if (wire_writepacket_done(Q, wbuf, rlen))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %r13d
testl %edx, %edx
sete %al
leal -0x64(%r13), %ecx
cmpl $0x1f4, %ecx            # imm = 0x1F4
setb %cl
orb %al, %cl
je 0xa171
movq %rdi, %r15
movq %r8, (%rsp)
testq %r8, %r8
setne %al
cmpl $-0x1, %ebx
setne %r14b
andb %al, %r14b
leal 0x8(%rbx), %eax
testb %r14b, %r14b
pushq $0x8
popq %r12
cmovneq %rax, %r12
movq %r12, %rdx
callq 0xae28
testq %rax, %rax
je 0xa15b
movq %rax, %rbp
rolw $0x8, %r13w
movw %r13w, 0x2(%rax)
andw $0x0, (%rax)
movb %bl, 0x7(%rax)
movb %bh, 0x6(%rax)
movl %ebx, %eax
shrl $0x10, %eax
movb %al, 0x5(%rbp)
movl %ebx, %eax
shrl $0x18, %eax
movb %al, 0x4(%rbp)
testb %r14b, %r14b
je 0xa149
movq %rbp, %rdi
addq $0x8, %rdi
movl %ebx, %edx
movq (%rsp), %rsi
callq 0x22f0
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0xaef2
testl %eax, %eax
je 0xa160
pushq $-0x1
popq %rax
jmp 0xa162
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x790d(%rip), %rdi      # 0x11a85
leaq 0x793c(%rip), %rsi      # 0x11abb
leaq 0x799a(%rip), %rcx      # 0x11b20
movl $0xe3, %edx
callq 0x21e0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/proto_s3/proto_s3_server.c
// Function: mkstr
static char *
mkstr(uint8_t * buf, size_t len, size_t * pos)
{
	char * s;
	size_t slen;
	size_t i;

	/* Extract the string length. */
	if (len < *pos + 1)
		goto err0;
	slen = buf[*pos];
	*pos += 1;

	/* Make sure the string is not prematurely terminated. */
	if (len < *pos + slen)
		goto err0;
	for (i = 0; i < slen; i++)
		if (buf[*pos + i] == '\0')
			goto err0;

	/* Allocate space for string. */
	if ((s = malloc(slen + 1)) == NULL)
		goto err0;

	/* Copy and NUL-terminate string. */
	memcpy(s, &buf[*pos], slen);
	*pos += slen;
	s[slen] = '\0';

	/* Success! */
	return (s);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%rdx), %rcx
leaq 0x1(%rcx), %rax
cmpq %rsi, %rax
ja 0xa1c1
movq %rdx, %rbx
movq %rdi, %r15
movzbl (%rdi,%rcx), %r12d
movq %rax, (%rdx)
leaq (%rax,%r12), %r13
cmpq %rsi, %r13
jbe 0xa1d1
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
addq %rax, %r15
xorl %r14d, %r14d
xorl %eax, %eax
cmpq %rax, %r12
je 0xa1eb
cmpb $0x0, (%r15,%rax)
leaq 0x1(%rax), %rax
jne 0xa1d9
jmp 0xa1c4
leaq 0x1(%r12), %rdi
callq 0x2340
testq %rax, %rax
je 0xa1c1
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x22f0
movq %r13, (%rbx)
movb $0x0, (%r14,%r12)
jmp 0xa1c4
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/s3/s3_request_queue.c
// Function: s3_request_queue_init
struct s3_request_queue *
s3_request_queue_init(const char * key_id, const char * key_secret,
    const char * region, size_t conns)
{
	struct s3_request_queue * Q;

	/* Allocate a request queue structure. */
	if ((Q = malloc(sizeof(struct s3_request_queue))) == NULL)
		goto err0;

	/* Create a server pool structure. */
	if ((Q->SP = s3_serverpool_init()) == NULL)
		goto err1;

	/* Copy key_id and key_secret. */
	if ((Q->key_id = strdup(key_id)) == NULL)
		goto err2;
	if ((Q->key_secret = strdup(key_secret)) == NULL)
		goto err3;

	/* Copy region. */
	if ((Q->region = strdup(region)) == NULL)
		goto err4;

	/* No log file yet. */
	Q->logfile = NULL;

	/* No requests queued or in progress. */
	Q->reqsip = 0;
	Q->reqs_queued_head = Q->reqs_queued_tail = NULL;
	Q->reqs_ip_head = Q->reqs_ip_tail = NULL;

	/* Record the maximum number of simultaneous requests. */
	Q->reqsip_max = conns;

	/* Success! */
	return (Q);

err4:
	insecure_memzero(Q->key_secret, strlen(Q->key_secret));
	free(Q->key_secret);
err3:
	free(Q->key_id);
err2:
	s3_serverpool_free(Q->SP);
err1:
	free(Q);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r12
pushq $0x58
popq %rdi
callq 0x2340
testq %rax, %rax
je 0xa2e5
movq %rax, %rbx
callq 0xa6f0
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0xa2dd
movq %rax, %r14
movq %r12, %rdi
callq 0x24b0
movq %rax, (%rbx)
testq %rax, %rax
je 0xa2d5
movq %rax, %r12
movq %rbp, %rdi
callq 0x24b0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0xa2cd
movq %rax, %rbp
movq %r13, %rdi
callq 0x24b0
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0xa2ab
andq $0x0, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x40(%rbx)
andq $0x0, 0x50(%rbx)
movq %r15, 0x28(%rbx)
jmp 0xa2e7
movq %rbp, %rdi
callq 0x2170
leaq 0xe316(%rip), %rcx      # 0x185d0
movq (%rcx), %rcx
movq %rbp, %rdi
movq %rax, %rsi
callq *%rcx
movq %rbp, %rdi
callq 0x2040
movq %r12, %rdi
callq 0x2040
movq %r14, %rdi
callq 0xa905
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/s3/s3_request_queue.c
// Function: s3_request_queue
int
s3_request_queue(struct s3_request_queue * Q, struct s3_request * request,
    size_t maxrlen,
    int (* callback)(void *, struct http_response *), void * cookie)
{
	struct request * R;

	/* Bake a cookie. */
	if ((R = malloc(sizeof(struct request))) == NULL)
		goto err0;
	R->Q = Q;
	R->request = request;
	R->maxrlen = maxrlen;
	R->callback = callback;
	R->cookie = cookie;
	R->http_cookie = NULL;

	/* Add to the end of the pending-requests queue. */
	R->prev = Q->reqs_queued_tail;
	R->next = NULL;
	if (R->prev == NULL) {
		Q->reqs_queued_head = R;
	} else {
		R->prev->next = R;
	}
	Q->reqs_queued_tail = R;

	/* Poke the queue. */
	if (poke(Q))
		goto err1;

	/* Success! */
	return (0);

err1:
	/* Take R back off the pending-requests queue. */
	if (R->prev != NULL) {
		R->prev->next = NULL;
	} else {
		Q->reqs_queued_head = NULL;
	}
	Q->reqs_queued_tail = R->prev;

	/* Free the request structure. */
	free(R);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x60
popq %rdi
callq 0x2340
movq %rax, %r15
pushq $-0x1
popq %rax
testq %r15, %r15
je 0xa3a1
movq %r14, (%r15)
movq %rbx, 0x8(%r15)
movq %rbp, 0x10(%r15)
movq %r13, 0x18(%r15)
movq %r12, 0x20(%r15)
andq $0x0, 0x48(%r15)
movq 0x40(%r14), %rax
movq %rax, 0x50(%r15)
andq $0x0, 0x58(%r15)
leaq 0x58(%rax), %rcx
leaq 0x38(%r14), %rbx
testq %rax, %rax
cmoveq %rbx, %rcx
movq %r15, (%rcx)
movq %r15, 0x40(%r14)
movq %r14, %rdi
callq 0xa3b0
testl %eax, %eax
je 0xa39f
movq 0x50(%r15), %rax
leaq 0x58(%rax), %rcx
testq %rax, %rax
cmoveq %rbx, %rcx
andq $0x0, (%rcx)
movq %rax, 0x40(%r14)
movq %r15, %rdi
callq 0x2040
pushq $-0x1
popq %rax
jmp 0xa3a1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/s3/s3_request_queue.c
// Function: poke
static int
poke(struct s3_request_queue * Q)
{
	struct request * R;

	/* If no requests are queued, do nothing. */
	if (Q->reqs_queued_head == NULL)
		goto done;

	/* If we're at the in-progress limit, do nothing. */
	if (Q->reqsip == Q->reqsip_max)
		goto done;

	/* Sanity-check. */
	assert(Q->reqsip < Q->reqsip_max);

	/* Grab the request at the head of the queue. */
	R = Q->reqs_queued_head;

	/* Grab an S3 endpoint address. */
	if ((R->addrs[0] = s3_serverpool_pick(Q->SP)) == NULL)
		goto err0;
	R->addrs[1] = NULL;

	/* Record when we send this request. */
	if (monoclock_get(&R->t_start))
		goto err0;

	/* Launch the S3 request. */
	if ((R->http_cookie = s3_request(R->addrs, Q->key_id, Q->key_secret,
	    Q->region, R->request, R->maxrlen, callback_reqdone, R)) == NULL)
		goto err0;

	/* The number of in-progress requests has just increased. */
	Q->reqsip += 1;

	/* Remove from the pending queue... */
	if (R->next) {
		R->next->prev = NULL;
	} else {
		Q->reqs_queued_tail = NULL;
	}
	Q->reqs_queued_head = R->next;

	/* ... and place into the in-progress queue. */
	R->prev = Q->reqs_ip_tail;
	R->next = NULL;
	if (R->prev == NULL) {
		Q->reqs_ip_head = R;
	} else {
		R->prev->next = R;
	}
	Q->reqs_ip_tail = R;

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

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq 0x38(%rdi), %r14
xorl %ebp, %ebp
testq %r14, %r14
je 0xa47a
movq %rdi, %rbx
movq 0x28(%rdi), %rax
cmpq %rax, 0x30(%rdi)
je 0xa47a
jae 0xa481
movq 0x18(%rbx), %rdi
callq 0xa7ee
movq %rax, 0x38(%r14)
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0xa47a
andq $0x0, 0x40(%r14)
leaq 0x28(%r14), %rdi
callq 0x82bc
testl %eax, %eax
jne 0xa47a
leaq 0x38(%r14), %rdi
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rcx
movq 0x8(%r14), %r8
movq 0x10(%r14), %r9
leaq 0x137(%rip), %rax       # 0xa55a
pushq %r14
pushq %rax
callq 0xc47c
popq %rcx
popq %rdx
movq %rax, 0x48(%r14)
testq %rax, %rax
je 0xa47a
incq 0x30(%rbx)
movq 0x58(%r14), %rax
leaq 0x40(%rbx), %rcx
leaq 0x50(%rax), %rdx
testq %rax, %rax
cmoveq %rcx, %rdx
andq $0x0, (%rdx)
movq %rax, 0x38(%rbx)
movq 0x50(%rbx), %rax
movq %rax, 0x50(%r14)
andq $0x0, 0x58(%r14)
leaq 0x58(%rax), %rcx
leaq 0x48(%rbx), %rdx
testq %rax, %rax
cmoveq %rdx, %rcx
movq %r14, (%rcx)
movq %r14, 0x50(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x76f4(%rip), %rdi      # 0x11b7c
leaq 0x7707(%rip), %rsi      # 0x11b96
leaq 0x771d(%rip), %rcx      # 0x11bb3
movl $0xb8, %edx
callq 0x21e0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/s3/s3_request_queue.c
// Function: s3_request_queue_flush
void
s3_request_queue_flush(struct s3_request_queue * Q)
{
	struct request * R;

	/* Free the contents of the pending-requests queue. */
	while ((R = Q->reqs_queued_head) != NULL) {
		Q->reqs_queued_head = R->next;
		free(R);
	}
	Q->reqs_queued_tail = NULL;

	/* Cancel in-progress requests and free them. */
	while ((R = Q->reqs_ip_head) != NULL) {
		http_request_cancel(R->http_cookie);
		Q->reqs_ip_head = R->next;
		sock_addr_free(R->addrs[0]);
		free(R);
	}
	Q->reqs_ip_tail = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0xa4bf
movq 0x58(%rdi), %rax
movq %rax, 0x38(%rbx)
callq 0x2040
jmp 0xa4a7
andq $0x0, 0x40(%rbx)
movq 0x48(%rbx), %r14
testq %r14, %r14
je 0xa4f1
movq 0x48(%r14), %rdi
callq 0x55d9
movq 0x58(%r14), %rax
movq %rax, 0x48(%rbx)
movq 0x38(%r14), %rdi
callq 0x8b4b
movq %r14, %rdi
callq 0x2040
jmp 0xa4c4
andq $0x0, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/s3/s3_request_queue.c
// Function: s3_request_queue_free
void
s3_request_queue_free(struct s3_request_queue * Q)
{

	/* Flush the queue. */
	s3_request_queue_flush(Q);

	/* Free string allocated by strdup. */
	free(Q->region);

	/* Free the S3 keys. */
	insecure_memzero(Q->key_secret, strlen(Q->key_secret));
	free(Q->key_secret);
	free(Q->key_id);

	/* Free the server pool. */
	s3_serverpool_free(Q->SP);

	/* Free the request queue structure. */
	free(Q);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xa4a0
movq 0x10(%rbx), %rdi
callq 0x2040
movq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x2170
leaq 0xe0aa(%rip), %rcx      # 0x185d0
movq (%rcx), %rcx
movq %r14, %rdi
movq %rax, %rsi
callq *%rcx
movq 0x8(%rbx), %rdi
callq 0x2040
movq (%rbx), %rdi
callq 0x2040
movq 0x18(%rbx), %rdi
callq 0xa905
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/s3/s3_serverpool.c
// Function: s3_serverpool_add
int
s3_serverpool_add(struct s3_serverpool * SP,
    const struct sock_addr *sa, int ttl)
{
	S3_SERVERPOOL S = (S3_SERVERPOOL)SP;
	struct timeval tv;
	struct timeval * tvo;
	struct s3_endpoint ep;
	size_t i;

	/* Compute EOL for this endpoint. */
	if (monoclock_get(&tv))
		goto err0;
	tv.tv_sec += ttl;

	/* Look for the endpoint. */
	for (i = 0; i < serverpool_getsize(S); i++) {
		if (sock_addr_cmp(sa, serverpool_get(S, i)->sa) == 0) {
			/* Update the EOL and return. */
			tvo = &serverpool_get(S, i)->eol;
			if ((tvo->tv_sec < tv.tv_sec) ||
			    ((tvo->tv_sec == tv.tv_sec) &&
			     (tvo->tv_usec < tv.tv_usec))) {
				tvo->tv_sec = tv.tv_sec;
				tvo->tv_usec = tv.tv_usec;
			}
			return (0);
		}
	}

	/* Construct a new endpoint structure. */
	if ((ep.sa = sock_addr_dup(sa)) == NULL)
		goto err0;
	ep.eol.tv_sec = tv.tv_sec;
	ep.eol.tv_usec = tv.tv_usec;

	/* Add the new endpoint to the list. */
	if (serverpool_append(S, &ep, 1))
		goto err1;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
movq %rsp, %rdi
callq 0x82bc
pushq $-0x1
popq %rbx
testl %eax, %eax
jne 0xa7cf
movslq %ebp, %rax
addq %rax, (%rsp)
xorl %r12d, %r12d
movq %r14, %rdi
callq 0xa7de
cmpq %rax, %r12
jae 0xa757
movq %r14, %rdi
movq %r12, %rsi
callq 0xa7e6
movq (%rax), %rsi
movq %r15, %rdi
callq 0x9040
testl %eax, %eax
je 0xa794
incq %r12
jmp 0xa72b
movq %r15, %rdi
callq 0x9075
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0xa7cf
movaps (%rsp), %xmm0
leaq 0x18(%rsp), %rsi
movups %xmm0, 0x8(%rsi)
pushq $0x1
popq %rdx
pushq $0x18
popq %rcx
movq %r14, %rdi
callq 0xc036
testl %eax, %eax
je 0xa7b9
movq 0x18(%rsp), %rdi
callq 0x2040
jmp 0xa7cf
movq %r14, %rdi
movq %r12, %rsi
callq 0xa7e6
movq 0x8(%rax), %rdx
movq (%rsp), %rcx
cmpq %rcx, %rdx
jge 0xa7bd
movq 0x8(%rsp), %rdx
movq %rcx, 0x8(%rax)
movq %rdx, 0x10(%rax)
xorl %ebx, %ebx
jmp 0xa7cf
xorl %ebx, %ebx
cmpq %rcx, %rdx
jne 0xa7cf
movq 0x8(%rsp), %rdx
cmpq %rdx, 0x10(%rax)
jl 0xa7b1
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/s3/s3_serverpool.c
// Function: s3_serverpool_pick
struct sock_addr *
s3_serverpool_pick(struct s3_serverpool * SP)
{
	S3_SERVERPOOL S = (S3_SERVERPOOL)SP;
	struct timeval tv;
	struct timeval * tvo;
	struct sock_addr * sa;
	size_t i;

	/* If we have no endpoints, fail. */
	if (serverpool_getsize(S) == 0)
		goto err0;

	/* Delete expired endpoints; count down to avoid missing anything. */
	if (monoclock_get(&tv))
		goto err0;
	for (i = serverpool_getsize(S); i > 0; i--) {
		/* Is the EOL still in the future? */
		tvo = &serverpool_get(S, i - 1)->eol;
		if ((tvo->tv_sec > tv.tv_sec) ||
		    ((tvo->tv_sec == tv.tv_sec) &&
		     (tvo->tv_usec > tv.tv_usec)))
			continue;

		/* Is this the last remaining endpoint? */
		if (serverpool_getsize(S) == 1)
			continue;

		/* Delete this endpoint. */
		endpoint_free(S, i - 1);
	}

	/* Pick a (non-cryptographically) random endpoint. */
	i = (size_t)rand() % serverpool_getsize(S);

	/* Make a copy of the address. */
	if ((sa = sock_addr_dup(serverpool_get(S, i)->sa)) == NULL)
		goto err0;

	/* Return the address. */
	return (sa);

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

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0xa7de
testq %rax, %rax
je 0xa810
leaq 0x8(%rsp), %rdi
callq 0x82bc
testl %eax, %eax
je 0xa81a
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0xa7de
movq %rax, %r14
decq %r14
cmpq $-0x1, %r14
je 0xa86c
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa7e6
movq 0x8(%rsp), %rcx
cmpq %rcx, 0x8(%rax)
jg 0xa825
jne 0xa851
movq 0x10(%rax), %rax
cmpq 0x10(%rsp), %rax
jg 0xa825
movq %rbx, %rdi
callq 0xa7de
cmpq $0x1, %rax
je 0xa825
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa8a8
jmp 0xa825
callq 0x2510
movslq %eax, %r14
movq %rbx, %rdi
callq 0xa7de
movq %rax, %rcx
movq %r14, %rax
xorl %edx, %edx
divq %rcx
movq %rbx, %rdi
movq %rdx, %rsi
callq 0xa7e6
movq (%rax), %rdi
callq 0x9075
testq %rax, %rax
jne 0xa812
jmp 0xa810
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/s3/s3_serverpool.c
// Function: endpoint_free
static void
endpoint_free(S3_SERVERPOOL S, size_t i)
{

	/* Free the endpoint address. */
	sock_addr_free(serverpool_get(S, i)->sa);

	/*
	 * Copy the last endpoint over this one (if we're deleting the last
	 * endpoint in the array, this turns out to be a no-op, of course).
	 */
	memcpy(serverpool_get(S, i),
	    serverpool_get(S, serverpool_getsize(S) - 1),
	    sizeof(struct s3_endpoint));

	/* Delete the last endpoint (now that it's moved). */
	serverpool_shrink(S, 1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0xa7e6
movq (%rax), %rdi
callq 0x8b4b
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa7e6
movq %rax, %r14
movq %rbx, %rdi
callq 0xa7de
leaq -0x1(%rax), %rsi
movq %rbx, %rdi
callq 0xa7e6
movups (%rax), %xmm0
movups %xmm0, (%r14)
movq 0x10(%rax), %rax
movq %rax, 0x10(%r14)
pushq $0x1
popq %rsi
pushq $0x18
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xc0d1
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/s3/s3_serverpool.c
// Function: s3_serverpool_free
void
s3_serverpool_free(struct s3_serverpool * SP)
{
	S3_SERVERPOOL S = (S3_SERVERPOOL)SP;

	/* Delete endpoints. */
	while (serverpool_getsize(S) > 0)
		endpoint_free(S, 0);

	/* Free the elastic array. */
	serverpool_free(S);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rbx, %rdi
callq 0xa7de
testq %rax, %rax
je 0xa922
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa8a8
jmp 0xa909
movq %rbx, %rdi
popq %rbx
jmp 0xbf73
nop
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../lib/s3/s3_verifyetag.c
// Function: s3_verifyetag
int
s3_verifyetag(struct http_response * res)
{
	const char * etag;
	uint8_t etagmd5[16];
	uint8_t datamd5[16];

	/* Look for an ETag header. */
	etag = http_findheader(res->headers, res->nheaders, "ETag");

	/* If there is no header, return zero. */
	if (etag == NULL)
		return (0);

	/* Skip any leading whitespace. */
	while ((etag[0] == ' ') || (etag[0] == '\t'))
		etag++;

	/* It should be '"' <32 characters of hex> '"'. */
	if ((strlen(etag) != 34) || (etag[0] != '"') || (etag[33] != '"'))
		return (0);

	/* Characters 1--33 should be hex.  Parse them. */
	if (unhexify(&etag[1], etagmd5, 16))
		return (0);

	/* Compute the MD5 hash of the HTTP response body. */
	MD5_Buf(res->body, res->bodylen, datamd5);

	/* Check if the MD5 hash matches the parsed ETag. */
	if (memcmp(etagmd5, datamd5, 16))
		return (0);
	else
		return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdi
leaq 0x72ab(%rip), %rdx      # 0x11bf3
callq 0x56ac
xorl %ebx, %ebx
testq %rax, %rax
je 0xa9cc
movq %rax, %r15
movzbl (%r15), %ebp
cmpl $0x20, %ebp
je 0xa965
cmpl $0x9, %ebp
jne 0xa96a
incq %r15
jmp 0xa957
movq %r15, %rdi
callq 0x2170
cmpq $0x22, %rax
setne %al
cmpb $0x22, %bpl
setne %cl
orb %al, %cl
jne 0xa9cc
cmpb $0x22, 0x21(%r15)
jne 0xa9cc
incq %r15
movq %rsp, %rsi
pushq $0x10
popq %rdx
movq %r15, %rdi
callq 0xc3d7
testl %eax, %eax
jne 0xa9cc
movq 0x18(%r14), %rsi
movq 0x20(%r14), %rdi
leaq 0x10(%rsp), %rbx
movq %rbx, %rdx
callq 0xbca3
movdqa (%rsp), %xmm0
pcmpeqb (%rbx), %xmm0
pmovmskb %xmm0, %eax
xorl %ebx, %ebx
cmpl $0xffff, %eax           # imm = 0xFFFF
sete %bl
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/alg/md5.c
// Function: libcperciva_MD5_Update
void
MD5_Update(MD5_CTX * ctx, const void * in, size_t len)
{
	uint32_t bitlen[2];
	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[0] >> 3) & 0x3f;

	/* Convert the length into a number of bits. */
	bitlen[0] = ((uint32_t)len) << 3;
	bitlen[1] = (uint32_t)(len >> 29);

	/* Update number of bits. */
	if ((ctx->count[0] += bitlen[0]) < bitlen[0])
		ctx->count[1]++;
	ctx->count[1] += bitlen[1];

	/* 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);
	MD5_Transform(ctx->state, ctx->buf);
	src += 64 - r;
	len -= 64 - r;

	/* Perform complete blocks. */
	while (len >= 64) {
		MD5_Transform(ctx->state, src);
		src += 64;
		len -= 64;
	}

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdx, %rdx
je 0xb41f
movq %rsi, %rbx
movq %rdi, %r14
movl 0x10(%rdi), %eax
movl %eax, %ecx
shrl $0x3, %ecx
andl $0x3f, %ecx
leal (,%rdx,8), %esi
movq %rdx, %rdi
shrq $0x1d, %rdi
addl %eax, %esi
movl %esi, 0x10(%r14)
adcl %edi, 0x14(%r14)
pushq $0x40
popq %r13
subq %rcx, %r13
movq %rdx, %r15
leaq (%r14,%rcx), %rdi
addq $0x18, %rdi
subq %r13, %r15
jae 0xb429
movq %rbx, %rsi
jmp 0xb46a
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x18(%r14), %r12
movq %rbx, %rsi
movq %r13, %rdx
callq 0x22f0
movq %r14, %rdi
movq %r12, %rsi
callq 0xb478
addq %r13, %rbx
cmpq $0x40, %r15
jb 0xb461
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb478
addq $0x40, %rbx
addq $-0x40, %r15
jmp 0xb446
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x22f0
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/alg/md5.c
// Function: libcperciva_MD5_Final
void
MD5_Final(uint8_t digest[16], MD5_CTX * ctx)
{

	/* Add padding. */
	MD5_Pad(ctx);

	/* Write the hash. */
	le32enc_vect(digest, ctx->state, 16);

	/* Clear the context state. */
	insecure_memzero(ctx, sizeof(MD5_CTX));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x10, %rsi
movq %rsp, %r15
pushq $0x8
popq %r12
movq %r15, %rdi
movq %r12, %rdx
callq 0xbc8c
movl 0x10(%rbx), %eax
shrl $0x3, %eax
andl $0x3f, %eax
xorl %edx, %edx
cmpl $0x38, %eax
setae %dl
shll $0x6, %edx
orl $0x38, %edx
subl %eax, %edx
leaq 0xc9e5(%rip), %rsi      # 0x18630
movq %rbx, %rdi
callq 0xb3cc
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xb3cc
pushq $0x10
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xbc8c
leaq 0xc95a(%rip), %rax      # 0x185d0
movq (%rax), %rax
pushq $0x58
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/alg/md5.c
// Function: libcperciva_MD5_Buf
void
MD5_Buf(const void * in, size_t len, uint8_t digest[16])
{
	MD5_CTX ctx;

	MD5_Init(&ctx);
	MD5_Update(&ctx, in, len);
	MD5_Final(digest, &ctx);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdx, %rbx
movq %rsp, %r14
andq $0x0, 0x10(%r14)
movq %rsi, %rdx
movq %rdi, %rsi
movaps 0x611e(%rip), %xmm0     # 0x11de0
movaps %xmm0, (%r14)
movq %r14, %rdi
callq 0xb3cc
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbc07
addq $0x58, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/alg/md5.c
// Function: libcperciva_HMAC_MD5_Init
void
HMAC_MD5_Init(HMAC_MD5_CTX * ctx, const void * _k, size_t Klen)
{
	uint8_t pad[64];
	uint8_t khash[16];
	const uint8_t * K = _k;
	size_t i;

	/* If Klen > 64, the key is really MD5(K). */
	if (Klen > 64) {
		MD5_Init(&ctx->ictx);
		MD5_Update(&ctx->ictx, K, Klen);
		MD5_Final(khash, &ctx->ictx);
		K = khash;
		Klen = 16;
	}

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

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

	/* Clean the stack. */
	insecure_memzero(khash, 16);
	insecure_memzero(pad, 64);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
cmpq $0x41, %rdx
jb 0xbd2e
andq $0x0, 0x10(%r15)
pushq $0x10
popq %r12
movaps 0x60d5(%rip), %xmm0     # 0x11de0
movups %xmm0, (%r15)
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xb3cc
movq %rsp, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xbc07
movq %r12, %r14
andq $0x0, 0x10(%r15)
movaps 0x60a6(%rip), %xmm0     # 0x11de0
movups %xmm0, (%r15)
movaps 0x60ab(%rip), %xmm0     # 0x11df0
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
xorl %eax, %eax
cmpq %rax, %r14
je 0xbd6c
movb (%rbx,%rax), %cl
xorb %cl, 0x10(%rsp,%rax)
incq %rax
jmp 0xbd5b
leaq 0x10(%rsp), %r12
pushq $0x40
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0xb3cc
andq $0x0, 0x68(%r15)
leaq 0x58(%r15), %rdi
movaps 0x6051(%rip), %xmm0     # 0x11de0
movups %xmm0, 0x58(%r15)
movaps 0x6065(%rip), %xmm0     # 0x11e00
movaps %xmm0, 0x30(%r12)
movaps %xmm0, 0x20(%r12)
movaps %xmm0, 0x10(%r12)
movaps %xmm0, (%r12)
xorl %eax, %eax
cmpq %rax, %r14
je 0xbdc5
movb (%rbx,%rax), %cl
xorb %cl, 0x10(%rsp,%rax)
incq %rax
jmp 0xbdb4
leaq 0x10(%rsp), %rbx
pushq $0x40
popq %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0xb3cc
leaq 0xc7f0(%rip), %r15      # 0x185d0
movq (%r15), %rax
movq %rsp, %rdi
pushq $0x10
popq %rsi
callq *%rax
movq (%r15), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *%rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/alg/md5.c
// Function: libcperciva_HMAC_MD5_Final
void
HMAC_MD5_Final(uint8_t digest[16], HMAC_MD5_CTX * ctx)
{
	uint8_t ihash[16];

	/* Finish the inner MD5 operation. */
	MD5_Final(ihash, &ctx->ictx);

	/* Feed the inner hash to the outer MD5 operation. */
	MD5_Update(&ctx->octx, ihash, 16);

	/* Finish the outer MD5 operation. */
	MD5_Final(digest, &ctx->octx);

	/* Clean the stack. */
	insecure_memzero(ihash, 16);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %r15
movq %r15, %rdi
callq 0xbc07
addq $0x58, %rbx
pushq $0x10
popq %r12
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xb3cc
movq %r14, %rdi
movq %rbx, %rsi
callq 0xbc07
leaq 0xc785(%rip), %rax      # 0x185d0
movq (%rax), %rax
movq %r15, %rdi
movq %r12, %rsi
callq *%rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/9wm[P]9wm/9wm.c
// Function: timestamp
Time
timestamp(void)
{
	XEvent ev;

	if (curtime == CurrentTime) {
		XChangeProperty(dpy, screens[0].root, _9wm_running, _9wm_running, 8, PropModeAppend, (unsigned char *) "", 0);
		XMaskEvent(dpy, PropertyChangeMask, &ev);
		curtime = ev.xproperty.time;
	}
	return curtime;
}

// Assembly:
movl 0x892f(%rip), %eax      # 0xb9a8
testl %eax, %eax
jne 0x30e2
pushq %rbx
subq $0xc0, %rsp
movq 0x88fc(%rip), %rdi      # 0xb988
movq 0x898d(%rip), %rax      # 0xba20
movq 0x8(%rax), %rsi
movq 0x896a(%rip), %rcx      # 0xba08
leaq 0x4110(%rip), %rax      # 0x71b5
pushq $0x8
popq %r8
pushq $0x2
popq %r9
movq %rcx, %rdx
pushq $0x0
pushq %rax
callq 0x2370
popq %rcx
popq %rdx
movq 0x88c7(%rip), %rdi      # 0xb988
movq %rsp, %rbx
movl $0x400000, %esi         # imm = 0x400000
movq %rbx, %rdx
callq 0x2600
movl 0x30(%rbx), %eax
movl %eax, 0x88ce(%rip)      # 0xb9a8
addq $0xc0, %rsp
popq %rbx
cltq
retq
// File: /workspace/github_c_makefile_star2_O2/9wm[P]9wm/9wm.c
// Function: sendcmessage
void
sendcmessage(Window w, Atom a, long x, int isroot)
{
	XEvent ev;
	int status;
	long mask;

	memset(&ev, 0, sizeof(ev));
	ev.xclient.type = ClientMessage;
	ev.xclient.window = w;
	ev.xclient.message_type = a;
	ev.xclient.format = 32;
	ev.xclient.data.l[0] = x;
	ev.xclient.data.l[1] = timestamp();
	mask = 0L;
	if (isroot)
		mask = SubstructureRedirectMask;	/* magic! */
	status = XSendEvent(dpy, w, False, mask, &ev);
	if (status == 0)
		fprintf(stderr, "9wm: sendcmessage failed\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc0, %rsp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
xorl %ebx, %ebx
testl %ecx, %ecx
setne %bl
movq %rsp, %r13
movl $0xc0, %edx
movq %r13, %rdi
xorl %esi, %esi
callq 0x21d0
movl $0x21, (%r13)
movq %r14, 0x20(%r13)
movq %r12, 0x28(%r13)
movl $0x20, 0x30(%r13)
movq %r15, 0x38(%r13)
callq 0x3073
movq %rax, 0x40(%r13)
shll $0x14, %ebx
movq 0x8842(%rip), %rdi      # 0xb988
movq %r14, %rsi
xorl %edx, %edx
movq %rbx, %rcx
movq %r13, %r8
callq 0x2040
testl %eax, %eax
je 0x316b
addq $0xc0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x7e86(%rip), %rax      # 0xaff8
movq (%rax), %rcx
leaq 0x41f0(%rip), %rdi      # 0x736c
pushq $0x19
popq %rsi
pushq $0x1
popq %rdx
callq 0x2540
jmp 0x315a
// File: /workspace/github_c_makefile_star2_O2/9wm[P]9wm/9wm.c
// Function: sendconfig
void
sendconfig(c)
     Client *c;
{
	XConfigureEvent ce;

	ce.type = ConfigureNotify;
	ce.event = c->window;
	ce.window = c->window;
	ce.x = c->x;
	ce.y = c->y;
	ce.width = c->dx;
	ce.height = c->dy;
	ce.border_width = c->border;
	ce.above = None;
	ce.override_redirect = 0;
	XSendEvent(dpy, c->window, False, StructureNotifyMask, (XEvent *) & ce);
}

// Assembly:
subq $0x58, %rsp
movq %rsp, %r8
movl $0x16, (%r8)
movq (%rdi), %rsi
movq %rsi, 0x20(%r8)
movq %rsi, 0x28(%r8)
movups 0x28(%rdi), %xmm0
movups %xmm0, 0x30(%r8)
movl 0x38(%rdi), %eax
movl %eax, 0x40(%r8)
andq $0x0, 0x48(%r8)
andl $0x0, 0x50(%r8)
movq 0x87c5(%rip), %rdi      # 0xb988
movl $0x20000, %ecx          # imm = 0x20000
xorl %edx, %edx
callq 0x2040
addq $0x58, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/9wm[P]9wm/9wm.c
// Function: getevent
void
getevent(XEvent * e)
{
	int fd;
	fd_set rfds;
	struct timeval t;

	if (!signalled) {
		if (QLength(dpy) > 0) {
			XNextEvent(dpy, e);
			return;
		}
		fd = ConnectionNumber(dpy);
		FD_ZERO(&rfds);
		FD_SET(fd, &rfds);
		t.tv_sec = t.tv_usec = 0;
		if (select(fd + 1, &rfds, NULL, NULL, &t) == 1) {
			XNextEvent(dpy, e);
			return;
		}
		XFlush(dpy);

		do {
			FD_ZERO(&rfds);
			FD_SET(fd, &rfds);
			if (select(fd + 1, &rfds, NULL, NULL, NULL) == 1) {
				XNextEvent(dpy, e);
				return;
			}
		} while (errno == EINTR);
		if (!signalled) {
			perror("9wm: select failed");
			exit(1);
		}
	}
	fprintf(stderr, "9wm: exiting on signal\n");
	cleanup();
	exit(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
cmpl $0x0, 0x8833(%rip)      # 0xba28
jne 0x3300
movq %rdi, %rbx
movq 0x8783(%rip), %rdi      # 0xb988
cmpl $0x0, 0x88(%rdi)
jle 0x3225
movq %rbx, %rsi
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2330
pushq $0x1
popq %r15
movl 0x10(%rdi), %ebp
xorl %eax, %eax
cmpq $0x10, %rax
je 0x323f
andq $0x0, 0x10(%rsp,%rax,8)
incq %rax
jmp 0x322e
pushq $0x40
popq %rcx
movl %ebp, %eax
cltd
idivl %ecx
movslq %eax, %r12
shll $0x6, %eax
movl %ebp, %ecx
subl %eax, %ecx
shlq %cl, %r15
orq %r15, 0x10(%rsp,%r12,8)
incl %ebp
xorps %xmm0, %xmm0
movq %rsp, %r8
movaps %xmm0, (%r8)
leaq 0x10(%rsp), %rsi
movl %ebp, %edi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2300
movq 0x870c(%rip), %rdi      # 0xb988
cmpl $0x1, %eax
je 0x32d1
callq 0x2490
xorl %eax, %eax
leaq 0x10(%rsp), %r14
cmpq $0x10, %rax
jne 0x32bf
orq %r15, 0x10(%rsp,%r12,8)
movl %ebp, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2300
cmpl $0x1, %eax
je 0x32ca
callq 0x20a0
cmpl $0x4, (%rax)
movl $0x0, %eax
je 0x328d
jmp 0x32e9
andq $0x0, 0x10(%rsp,%rax,8)
incq %rax
jmp 0x328d
movq 0x86b7(%rip), %rdi      # 0xb988
movq %rbx, %rsi
callq 0x2330
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x8738(%rip)      # 0xba28
jne 0x3300
leaq 0x408d(%rip), %rdi      # 0x7386
callq 0x24b0
jmp 0x3321
movq 0x7cf1(%rip), %rax      # 0xaff8
movq (%rax), %rcx
leaq 0x4088(%rip), %rdi      # 0x7399
pushq $0x17
popq %rsi
pushq $0x1
popq %rdx
callq 0x2540
callq 0x3329
pushq $0x1
popq %rdi
callq 0x2530
// File: /workspace/github_c_makefile_star2_O2/9wm[P]9wm/9wm.c
// Function: cleanup
void
cleanup(void)
{
	Client *c, *cc[2], *next;
	XWindowChanges wc;
	int i;

	/*
	 * order of un-reparenting determines final stacking order... 
	 */
	cc[0] = cc[1] = 0;
	for (c = clients; c; c = next) {
		next = c->next;
		i = normal(c);
		c->next = cc[i];
		cc[i] = c;
	}

	for (i = 0; i < 2; i++) {
		for (c = cc[i]; c; c = c->next) {
			if (!withdrawn(c)) {
				gravitate(c, 1);
				XReparentWindow(dpy, c->window, c->screen->root, c->x, c->y);
			}
			wc.border_width = c->border;
			XConfigureWindow(dpy, c->window, CWBorderWidth, &wc);
		}
	}

	XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, timestamp());
	for (i = 0; i < num_screens; i++)
		cmapnofocus(&screens[i]);
	XCloseDisplay(dpy);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x8805(%rip), %rax      # 0xbb48
movq (%rax), %rax
testq %rax, %rax
je 0x336c
movq 0x18(%rax), %rcx
xorl %edx, %edx
cmpl $0x1, 0x98(%rax)
sete %dl
movq (%rsp,%rdx,8), %rsi
movq %rsi, 0x18(%rax)
movq %rax, (%rsp,%rdx,8)
movq %rcx, %rax
jmp 0x3346
pushq $0x10
popq %rbx
leaq 0x18(%rsp), %r14
pushq $0x1
popq %rbp
xorl %r12d, %r12d
cmpq $0x2, %r12
je 0x33eb
leaq (%rsp,%r12,8), %r15
movq (%r15), %r15
testq %r15, %r15
je 0x33e6
cmpl $0x0, 0x98(%r15)
je 0x33c4
movq %r15, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x45d3
movq 0x85df(%rip), %rdi      # 0xb988
movq (%r15), %rsi
movq 0xf8(%r15), %rax
movq 0x8(%rax), %rdx
movl 0x28(%r15), %ecx
movl 0x2c(%r15), %r8d
callq 0x2050
movl 0x38(%r15), %eax
movl %eax, 0x28(%rsp)
movq 0x85b5(%rip), %rdi      # 0xb988
movq (%r15), %rsi
movl %ebx, %edx
movq %r14, %rcx
callq 0x2030
addq $0x18, %r15
jmp 0x3384
incq %r12
jmp 0x337a
movq 0x8596(%rip), %rbx      # 0xb988
callq 0x3073
pushq $0x1
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %rax, %rcx
callq 0x25d0
xorl %ebx, %ebx
xorl %r14d, %r14d
movslq 0x8604(%rip), %rax      # 0xba18
cmpq %rax, %r14
jge 0x3436
movq 0x8600(%rip), %rdi      # 0xba20
addq %rbx, %rdi
xorl %eax, %eax
callq 0x4745
incq %r14
addq $0x178, %rbx            # imm = 0x178
jmp 0x340d
movq 0x854b(%rip), %rdi      # 0xb988
callq 0x25b0
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/9wm[P]9wm/event.c
// Function: unmap
void
unmap(XUnmapEvent * e)
{
	Client *c;

	curtime = CurrentTime;
	c = getclient(e->window, 0);
	if (c) {
		switch (c->state) {
		case IconicState:
			if (e->send_event) {
				unhidec(c, 0);
				withdraw(c);
			}
			break;
		case NormalState:
			if (c == current)
				nofocus();
			if (!c->reparenting)
				withdraw(c);
			break;
		}
		c->reparenting = 0;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x80bc(%rip), %rax      # 0xb9a8
andl $0x0, (%rax)
movq 0x28(%rdi), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x5576
testq %rax, %rax
je 0x3956
movq %rax, %rbx
movl 0x98(%rax), %eax
cmpl $0x1, %eax
je 0x3929
cmpl $0x3, %eax
jne 0x394f
cmpl $0x0, 0x10(%r14)
je 0x394f
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x5160
jmp 0x3945
leaq 0x8210(%rip), %rax      # 0xbb40
cmpq (%rax), %rbx
jne 0x393c
xorl %eax, %eax
callq 0x541d
cmpl $0x0, 0xa0(%rbx)
jne 0x394f
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4550
andl $0x0, 0xa0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/9wm[P]9wm/event.c
// Function: newwindow
void
newwindow(XCreateWindowEvent * e)
{
	Client *c;
	ScreenInfo *s;

	/*
	 * we don't set curtime as nothing here uses it 
	 */
	if (e->override_redirect)
		return;
	c = getclient(e->window, 1);
	if (c && c->window == e->window && (s = getscreen(e->parent))) {
		c->x = e->x;
		c->y = e->y;
		c->dx = e->width;
		c->dy = e->height;
		c->border = e->border_width;
		c->screen = s;
		if (c->parent == None)
			c->parent = c->screen->root;
	}
}

// Assembly:
cmpl $0x0, 0x44(%rdi)
je 0x3981
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
pushq $0x1
popq %rsi
xorl %eax, %eax
callq 0x5576
testq %rax, %rax
je 0x39dd
movq %rax, %r14
movq (%rax), %rax
cmpq 0x28(%rbx), %rax
jne 0x39dd
movq 0x20(%rbx), %rdi
xorl %eax, %eax
callq 0x303c
testq %rax, %rax
je 0x39dd
movups 0x30(%rbx), %xmm0
movups %xmm0, 0x28(%r14)
movl 0x40(%rbx), %ecx
movl %ecx, 0x38(%r14)
movq %rax, 0xf8(%r14)
cmpq $0x0, 0x8(%r14)
jne 0x39dd
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/9wm[P]9wm/event.c
// Function: destroy
void
destroy(Window w)
{
	Client *c;

	curtime = CurrentTime;
	c = getclient(w, 0);
	if (c == 0)
		return;

	rmclient(c);

	/*
	 * flush any errors generated by the window's sudden demise 
	 */
	ignore_badwindow = 1;
	XSync(dpy, False);
	ignore_badwindow = 0;
}

// Assembly:
pushq %rbx
leaq 0x7fbb(%rip), %rax      # 0xb9a8
andl $0x0, (%rax)
xorl %esi, %esi
xorl %eax, %eax
callq 0x5576
testq %rax, %rax
je 0x3a29
movq %rax, %rdi
xorl %eax, %eax
callq 0x55e7
leaq 0x8169(%rip), %rbx      # 0xbb78
movl $0x1, (%rbx)
leaq 0x7f6c(%rip), %rax      # 0xb988
movq (%rax), %rdi
xorl %esi, %esi
callq 0x23b0
andl $0x0, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/9wm[P]9wm/event.c
// Function: cmap
void
cmap(XColormapEvent * e)
{
	Client *c;
	int i;

	/*
	 * we don't set curtime as nothing here uses it 
	 */
	if (e->new) {
		c = getclient(e->window, 0);
		if (c) {
			c->cmap = e->colormap;
			if (c == current)
				cmapfocus(c);
		} else
			for (c = clients; c; c = c->next) {
				for (i = 0; i < c->ncmapwins; i++)
					if (c->cmapwins[i] == e->window) {
						c->wmcmaps[i] = e->colormap;
						if (c == current)
							cmapfocus(c);
						return;
					}
			}
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0x30(%rdi)
je 0x3cfb
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
xorl %eax, %eax
callq 0x5576
testq %rax, %rax
je 0x3ca1
movq 0x28(%rbx), %rcx
movq %rcx, 0xd8(%rax)
jmp 0x3cef
leaq 0x7ea0(%rip), %rax      # 0xbb48
movq (%rax), %rax
testq %rax, %rax
je 0x3cfb
movl 0xe0(%rax), %ecx
testl %ecx, %ecx
cmovlel %r14d, %ecx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x3cd9
movq 0xe8(%rax), %rsi
movq (%rsi,%rdx,8), %rsi
incq %rdx
cmpq 0x20(%rbx), %rsi
jne 0x3cbe
jmp 0x3cdf
addq $0x18, %rax
jmp 0x3ca8
movq 0x28(%rbx), %rcx
movq 0xf0(%rax), %rsi
movq %rcx, -0x8(%rsi,%rdx,8)
leaq 0x7e4a(%rip), %rcx      # 0xbb40
cmpq (%rcx), %rax
je 0x3d03
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x467f