LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0xae24
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_O1/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 0xae9a
movq %rdi, %rbx
movl $0x4, %edx
callq 0xbdc4
testq %rax, %rax
je 0xae89
rolw $0x8, %r14w
movw %r14w, 0x2(%rax)
movw $0x0, (%rax)
movl $0x4, %edx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbe92
testl %eax, %eax
je 0xae90
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xae92
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x7c49(%rip), %rdi      # 0x12aea
leaq 0x7c78(%rip), %rsi      # 0x12b20
leaq 0x7c93(%rip), %rcx      # 0x12b42
movl $0xbe, %edx
callq 0x21e0
// File: /workspace/github_c_makefile_star2_O1/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 0xaf80
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
movl $0x8, %r12d
cmovneq %rax, %r12
movq %r12, %rdx
callq 0xbdc4
testq %rax, %rax
je 0xaf68
movq %rax, %rbp
rolw $0x8, %r13w
movw %r13w, 0x2(%rax)
movw $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 0xaf56
movq %rbp, %rdi
addq $0x8, %rdi
movl %ebx, %edx
movq (%rsp), %rsi
callq 0x22e0
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0xbe92
testl %eax, %eax
je 0xaf6f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xaf71
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7b63(%rip), %rdi      # 0x12aea
leaq 0x7b92(%rip), %rsi      # 0x12b20
leaq 0x7bf0(%rip), %rcx      # 0x12b85
movl $0xe3, %edx
callq 0x21e0
// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdx), %rax
leaq 0x1(%rax), %r13
cmpq %rsi, %r13
ja 0xb016
movq %rdx, %rbx
movq %rdi, %r15
movzbl (%rdi,%rax), %r12d
movq %r13, (%rdx)
leaq (%r12,%r13), %rbp
cmpq %rsi, %rbp
ja 0xb016
testq %r12, %r12
je 0xafe9
leaq (%r15,%r13), %rax
xorl %r14d, %r14d
xorl %ecx, %ecx
cmpb $0x0, (%rax,%rcx)
je 0xb019
incq %rcx
cmpq %rcx, %r12
jne 0xafdb
leaq 0x1(%r12), %rdi
callq 0x2330
testq %rax, %rax
je 0xb016
movq %rax, %r14
addq %r13, %r15
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x22e0
movq %rbp, (%rbx)
movb $0x0, (%r14,%r12)
jmp 0xb019
xorl %r14d, %r14d
movq %r14, %rax
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/../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
movl $0x58, %edi
callq 0x2330
testq %rax, %rax
je 0xb0fb
movq %rax, %rbx
callq 0xb534
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0xb0f3
movq %rax, %r14
movq %r12, %rdi
callq 0x24a0
movq %rax, (%rbx)
testq %rax, %rax
je 0xb0eb
movq %rax, %r12
movq %rbp, %rdi
callq 0x24a0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0xb0e3
movq %rax, %rbp
movq %r13, %rdi
callq 0x24a0
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0xb0c1
xorl %eax, %eax
movq %rax, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x40(%rbx)
movq %rax, 0x50(%rbx)
movq %r15, 0x28(%rbx)
jmp 0xb0fd
movq %rbp, %rdi
callq 0x2170
leaq 0xe500(%rip), %rcx      # 0x195d0
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 0xb7aa
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_O1/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, (%rsp)
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, %rbx
movl $0x60, %edi
callq 0x2330
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xb1c4
movq %rax, %r14
movq %rbx, (%rax)
movq %r12, 0x8(%rax)
movq %rbp, 0x10(%rax)
movq %r13, 0x18(%rax)
movq (%rsp), %rax
movq %rax, 0x20(%r14)
xorl %r15d, %r15d
movq %r15, 0x48(%r14)
movq 0x40(%rbx), %rax
movq %rax, 0x50(%r14)
movq %r15, 0x58(%r14)
leaq 0x58(%rax), %rcx
leaq 0x38(%rbx), %r12
testq %rax, %rax
cmoveq %r12, %rcx
movq %r14, (%rcx)
movq %r14, 0x40(%rbx)
movq %rbx, %rdi
callq 0xb1d6
testl %eax, %eax
je 0xb1c4
movq 0x50(%r14), %rax
leaq 0x58(%rax), %rcx
testq %rax, %rax
cmoveq %r12, %rcx
movq $0x0, (%rcx)
movq %rax, 0x40(%rbx)
movq %r14, %rdi
callq 0x2040
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %r15d, %eax
addq $0x8, %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/../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 %r15
pushq %r14
pushq %rbx
movq 0x38(%rdi), %r15
xorl %r14d, %r14d
testq %r15, %r15
je 0xb2a9
movq %rdi, %rbx
movq 0x28(%rdi), %rax
cmpq %rax, 0x30(%rdi)
je 0xb2a9
jae 0xb2b2
movq 0x18(%rbx), %rdi
callq 0xb65a
movq %rax, 0x38(%r15)
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xb2a9
movq $0x0, 0x40(%r15)
leaq 0x28(%r15), %rdi
callq 0x8f50
testl %eax, %eax
jne 0xb2a9
leaq 0x38(%r15), %rdi
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rcx
movq 0x8(%r15), %r8
movq 0x10(%r15), %r9
leaq 0x144(%rip), %rax       # 0xb395
pushq %r15
pushq %rax
callq 0xd510
addq $0x10, %rsp
movq %rax, 0x48(%r15)
testq %rax, %rax
je 0xb2a9
incq 0x30(%rbx)
movq 0x58(%r15), %rax
leaq 0x40(%rbx), %rcx
leaq 0x50(%rax), %rdx
testq %rax, %rax
cmoveq %rcx, %rdx
xorl %r14d, %r14d
movq %r14, (%rdx)
movq %rax, 0x38(%rbx)
movq 0x50(%rbx), %rax
movq %rax, 0x50(%r15)
movq %r14, 0x58(%r15)
leaq 0x58(%rax), %rcx
leaq 0x48(%rbx), %rdx
testq %rax, %rax
cmoveq %rdx, %rcx
movq %r15, (%rcx)
movq %r15, 0x50(%rbx)
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x7928(%rip), %rdi      # 0x12be1
leaq 0x793b(%rip), %rsi      # 0x12bfb
leaq 0x7951(%rip), %rcx      # 0x12c18
movl $0xb8, %edx
callq 0x21e0
// File: /workspace/github_c_makefile_star2_O1/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(%rdi), %rdi
testq %rdi, %rdi
je 0xb2f4
movq 0x58(%rdi), %rax
movq %rax, 0x38(%rbx)
callq 0x2040
movq 0x38(%rbx), %rdi
jmp 0xb2dc
movq $0x0, 0x40(%rbx)
movq 0x48(%rbx), %r14
testq %r14, %r14
je 0xb329
movq 0x48(%r14), %rdi
callq 0x5ed1
movq 0x58(%r14), %rax
movq %rax, 0x48(%rbx)
movq 0x38(%r14), %rdi
callq 0x9947
movq %r14, %rdi
callq 0x2040
jmp 0xb2fc
movq $0x0, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xb2d1
movq 0x10(%rbx), %rdi
callq 0x2040
movq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x2170
leaq 0xe26f(%rip), %rcx      # 0x195d0
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 0xb7aa
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x8(%rsp), %rdi
callq 0x8f50
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0xb576
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movslq %ebp, %rax
addq %rax, 0x8(%rsp)
movl $0x18, %esi
movq %r14, %rdi
callq 0xd09b
testq %rax, %rax
je 0xb5c7
xorl %r12d, %r12d
movl $0x18, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0xd1dd
movq (%rax), %rsi
movq %r15, %rdi
callq 0x9ea8
testl %eax, %eax
je 0xb60c
incq %r12
movl $0x18, %esi
movq %r14, %rdi
callq 0xd09b
cmpq %rax, %r12
jb 0xb593
movq %r15, %rdi
callq 0x9edf
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0xb567
movups 0x8(%rsp), %xmm0
leaq 0x18(%rsp), %rsi
movups %xmm0, 0x8(%rsi)
movl $0x1, %edx
movl $0x18, %ecx
movq %r14, %rdi
callq 0xd0a4
testl %eax, %eax
je 0xb637
movq 0x18(%rsp), %rdi
callq 0x2040
jmp 0xb567
movl $0x18, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0xd1dd
movq 0x8(%rax), %rdx
movq 0x8(%rsp), %rcx
cmpq %rcx, %rdx
jge 0xb63e
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rcx
movq %rcx, 0x10(%rax)
xorl %ebx, %ebx
jmp 0xb567
xorl %ebx, %ebx
cmpq %rcx, %rdx
jne 0xb567
movq 0x10(%rax), %rdx
cmpq 0x10(%rsp), %rdx
jge 0xb567
jmp 0xb62a
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x18, %esi
callq 0xd09b
testq %rax, %rax
je 0xb681
leaq 0x8(%rsp), %rdi
callq 0x8f50
testl %eax, %eax
je 0xb68b
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movl $0x18, %esi
movq %rbx, %rdi
callq 0xd09b
testq %rax, %rax
je 0xb6ef
movq %rax, %r14
decq %r14
movl $0x18, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd1dd
movq 0x8(%rsp), %rcx
cmpq %rcx, 0x8(%rax)
jg 0xb6e9
jne 0xb6cb
movq 0x10(%rax), %rax
cmpq 0x10(%rsp), %rax
jg 0xb6e9
movl $0x18, %esi
movq %rbx, %rdi
callq 0xd09b
cmpq $0x1, %rax
je 0xb6e9
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb735
addq $-0x1, %r14
jb 0xb6a3
callq 0x2500
movslq %eax, %r14
movl $0x18, %esi
movq %rbx, %rdi
callq 0xd09b
movq %rax, %rcx
movq %r14, %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %rsi
movl $0x18, %edx
movq %rbx, %rdi
callq 0xd1dd
movq (%rax), %rdi
callq 0x9edf
testq %rax, %rax
jne 0xb683
jmp 0xb681
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x18, %edx
callq 0xd1dd
movq (%rax), %rdi
callq 0x9947
movl $0x18, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd1dd
movq %rax, %r14
movl $0x18, %esi
movq %rbx, %rdi
callq 0xd09b
leaq -0x1(%rax), %rsi
movl $0x18, %edx
movq %rbx, %rdi
callq 0xd1dd
movups (%rax), %xmm0
movups %xmm0, (%r14)
movq 0x10(%rax), %rax
movq %rax, 0x10(%r14)
movl $0x1, %esi
movl $0x18, %edx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xd148
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x18, %esi
callq 0xd09b
testq %rax, %rax
je 0xb7d1
movq %rbx, %rdi
xorl %esi, %esi
callq 0xb735
movl $0x18, %esi
movq %rbx, %rdi
jmp 0xb7b3
movq %rbx, %rdi
popq %rbx
jmp 0xcfdd
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x7460(%rip), %rdx      # 0x12c58
callq 0x5fa7
xorl %ebx, %ebx
testq %rax, %rax
je 0xb87e
movq %rax, %r15
movzbl (%r15), %ebp
cmpl $0x20, %ebp
je 0xb815
cmpl $0x9, %ebp
jne 0xb81a
incq %r15
jmp 0xb807
movq %r15, %rdi
callq 0x2170
cmpq $0x22, %rax
setne %al
cmpb $0x22, %bpl
setne %cl
orb %al, %cl
jne 0xb87e
cmpb $0x22, 0x21(%r15)
jne 0xb87e
incq %r15
movq %rsp, %rsi
movl $0x10, %edx
movq %r15, %rdi
callq 0xd463
testl %eax, %eax
jne 0xb87e
movq 0x18(%r14), %rsi
movq 0x20(%r14), %rdi
leaq 0x10(%rsp), %rbx
movq %rbx, %rdx
callq 0xcce0
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
nop
// File: /workspace/github_c_makefile_star2_O1/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 0xc45c
movq %rsi, %rbx
movq %rdi, %r14
movl 0x10(%rdi), %esi
movl %esi, %eax
shrl $0x3, %eax
andl $0x3f, %eax
leal (,%rdx,8), %edi
movq %rdx, %rcx
shrq $0x1d, %rcx
addl %esi, %edi
movl %edi, 0x10(%r14)
jae 0xc438
incl 0x14(%r14)
addl %ecx, 0x14(%r14)
movl $0x40, %r13d
subq %rax, %r13
movq %rdx, %r15
movl %eax, %eax
leaq (%r14,%rax), %rdi
addq $0x18, %rdi
subq %r13, %r15
jae 0xc466
movq %rbx, %rsi
jmp 0xc4ab
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x18(%r14), %r12
movq %rbx, %rsi
movq %r13, %rdx
callq 0x22e0
movq %r14, %rdi
movq %r12, %rsi
callq 0xc4b9
addq %r13, %rbx
cmpq $0x40, %r15
jb 0xc4a2
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc4b9
addq $0x40, %rbx
addq $-0x40, %r15
cmpq $0x3f, %r15
ja 0xc489
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x22e0
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
movl 0x10(%rbx,%rax,4), %ecx
movl %ecx, (%rsp,%rax,4)
incq %rax
cmpq $0x2, %rax
jne 0xcc6b
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 0xc995(%rip), %rsi      # 0x19630
movq %rbx, %rdi
callq 0xc3ff
movq %rsp, %rsi
movl $0x8, %edx
movq %rbx, %rdi
callq 0xc3ff
xorl %eax, %eax
movl (%rbx,%rax,4), %ecx
movl %ecx, (%r14,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0xccb5
leaq 0xc904(%rip), %rax      # 0x195d0
movq (%rax), %rax
movl $0x58, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O1/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 %rsi, %rdx
movq %rdi, %rsi
movq %rsp, %r14
movq $0x0, 0x10(%r14)
movaps 0x614e(%rip), %xmm0     # 0x12e50
movups %xmm0, (%r14)
movq %r14, %rdi
callq 0xc3ff
movq %rbx, %rdi
movq %r14, %rsi
callq 0xcc5f
addq $0x58, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xcd70
movq $0x0, 0x10(%r15)
movaps 0x6106(%rip), %xmm0     # 0x12e50
movups %xmm0, (%r15)
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xc3ff
movq %rsp, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xcc5f
movl $0x10, %r14d
movq $0x0, 0x10(%r15)
movaps 0x60d1(%rip), %xmm0     # 0x12e50
movups %xmm0, (%r15)
movaps 0x60d6(%rip), %xmm0     # 0x12e60
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
testq %r14, %r14
je 0xcdb4
xorl %eax, %eax
movb (%rbx,%rax), %cl
xorb %cl, 0x10(%rsp,%rax)
incq %rax
cmpq %rax, %r14
jne 0xcda5
leaq 0x10(%rsp), %r12
movl $0x40, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0xc3ff
leaq 0x58(%r15), %rdi
movq $0x0, 0x68(%r15)
movaps 0x6074(%rip), %xmm0     # 0x12e50
movups %xmm0, 0x58(%r15)
movaps 0x6088(%rip), %xmm0     # 0x12e70
movaps %xmm0, 0x30(%r12)
movaps %xmm0, 0x20(%r12)
movaps %xmm0, 0x10(%r12)
movaps %xmm0, (%r12)
testq %r14, %r14
je 0xce15
xorl %eax, %eax
movb (%rbx,%rax), %cl
xorb %cl, 0x10(%rsp,%rax)
incq %rax
cmpq %rax, %r14
jne 0xce06
leaq 0x10(%rsp), %rbx
movl $0x40, %edx
movq %rbx, %rsi
callq 0xc3ff
leaq 0xc7a2(%rip), %r14      # 0x195d0
movq (%r14), %rax
movq %rsp, %rdi
movl $0x10, %esi
callq *%rax
movq (%r14), %rax
movl $0x40, %esi
movq %rbx, %rdi
callq *%rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %r15
movq %r15, %rdi
callq 0xcc5f
addq $0x58, %rbx
movl $0x10, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc3ff
movq %r14, %rdi
movq %rbx, %rsi
callq 0xcc5f
leaq 0xc737(%rip), %rax      # 0x195d0
movq (%rax), %rax
movl $0x10, %esi
movq %r15, %rdi
callq *%rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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:
cmpl $0x0, 0x855e(%rip)      # 0xb998
jne 0x34a7
pushq %rbx
subq $0xc0, %rsp
movq 0x852d(%rip), %rdi      # 0xb978
movq 0x85be(%rip), %rax      # 0xba10
movq 0x8(%rax), %rsi
movq 0x859b(%rip), %rcx      # 0xb9f8
leaq 0x3d51(%rip), %rax      # 0x71b5
movq %rcx, %rdx
movl $0x8, %r8d
movl $0x2, %r9d
pushq $0x0
pushq %rax
callq 0x2360
addq $0x10, %rsp
movq 0x84f2(%rip), %rdi      # 0xb978
movq %rsp, %rbx
movl $0x400000, %esi         # imm = 0x400000
movq %rbx, %rdx
callq 0x25f0
movl 0x30(%rbx), %eax
movl %eax, 0x84f9(%rip)      # 0xb998
addq $0xc0, %rsp
popq %rbx
movslq 0x84ea(%rip), %rax      # 0xb998
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3433
movq %rax, 0x40(%r13)
shll $0x14, %ebx
movq 0x8468(%rip), %rdi      # 0xb978
movq %r14, %rsi
xorl %edx, %edx
movq %rbx, %rcx
movq %r13, %r8
callq 0x2040
testl %eax, %eax
je 0x3535
addq $0xc0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x2706
jmp 0x3524
// File: /workspace/github_c_makefile_star2_O1/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)
movl 0x28(%rdi), %eax
movl %eax, 0x30(%r8)
movl 0x2c(%rdi), %eax
movl %eax, 0x34(%r8)
movl 0x30(%rdi), %eax
movl %eax, 0x38(%r8)
movl 0x34(%rdi), %eax
movl %eax, 0x3c(%r8)
movl 0x38(%rdi), %eax
movl %eax, 0x40(%r8)
movq $0x0, 0x48(%r8)
movl $0x0, 0x50(%r8)
movq 0x83e9(%rip), %rdi      # 0xb978
movl $0x20000, %ecx          # imm = 0x20000
xorl %edx, %edx
callq 0x2040
addq $0x58, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x90, %rsp
cmpl $0x0, 0x8456(%rip)      # 0xba18
jne 0x36dc
movq %rdi, %rbx
movq 0x83a6(%rip), %rdi      # 0xb978
cmpl $0x0, 0x88(%rdi)
jg 0x36c3
movl 0x10(%rdi), %r14d
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, 0x70(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
leal 0x3f(%r14), %eax
testl %r14d, %r14d
cmovnsl %r14d, %eax
movl %eax, %edx
andl $-0x40, %edx
movl %r14d, %ecx
subl %edx, %ecx
movl $0x1, %r12d
shlq %cl, %r12
sarl $0x6, %eax
movslq %eax, %r13
orq %r12, (%rsp,%r13,8)
incl %r14d
leaq 0x80(%rsp), %r8
movaps %xmm0, (%r8)
movl %r14d, %edi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x22f0
movq 0x8326(%rip), %rdi      # 0xb978
cmpl $0x1, %eax
je 0x36c3
callq 0x2480
movq %rsp, %r15
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
orq %r12, (%rsp,%r13,8)
movl %r14d, %edi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x22f0
cmpl $0x1, %eax
je 0x36bc
callq 0x20a0
cmpl $0x4, (%rax)
je 0x365f
cmpl $0x0, 0x8363(%rip)      # 0xba18
jne 0x36dc
callq 0x2752
movq 0x82b5(%rip), %rdi      # 0xb978
movq %rbx, %rsi
callq 0x2320
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x2728
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x8440(%rip), %rax      # 0xbb38
movq (%rax), %rax
testq %rax, %rax
je 0x3724
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
testq %rcx, %rcx
jne 0x3700
leaq 0x18(%rsp), %rbx
xorl %r15d, %r15d
movq (%rsp,%r15,8), %r14
testq %r14, %r14
je 0x3795
cmpl $0x0, 0x98(%r14)
je 0x3770
movq %r14, %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x49a1
movq 0x8223(%rip), %rdi      # 0xb978
movq (%r14), %rsi
movq 0xf8(%r14), %rax
movq 0x8(%rax), %rdx
movl 0x28(%r14), %ecx
movl 0x2c(%r14), %r8d
callq 0x2050
movl 0x38(%r14), %eax
movl %eax, 0x28(%rsp)
movq 0x81f9(%rip), %rdi      # 0xb978
movq (%r14), %rsi
movl $0x10, %edx
movq %rbx, %rcx
callq 0x2030
movq 0x18(%r14), %r14
jmp 0x3730
leaq 0x1(%r15), %rax
testq %r15, %r15
movq %rax, %r15
je 0x372c
movq 0x81d0(%rip), %rbx      # 0xb978
callq 0x3433
movl $0x1, %esi
movq %rbx, %rdi
movl $0x1, %edx
movq %rax, %rcx
callq 0x25c0
cmpl $0x0, 0x823f(%rip)      # 0xba08
jle 0x37f7
xorl %ebx, %ebx
xorl %r14d, %r14d
movq 0x8239(%rip), %rdi      # 0xba10
addq %rbx, %rdi
xorl %eax, %eax
callq 0x4afd
incq %r14
movslq 0x821d(%rip), %rax      # 0xba08
addq $0x178, %rbx            # imm = 0x178
cmpq %rax, %r14
jl 0x37d0
movq 0x817a(%rip), %rdi      # 0xb978
callq 0x25a0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/9wm[P]9wm/event.c
// Function: mapreq
void
mapreq(XMapRequestEvent * e)
{
	Client *c;
	int i;

	curtime = CurrentTime;
	c = getclient(e->window, 0);
	trace("mapreq", c, e);

	if (c == 0 || c->window != e->window) {
		/*
		 * workaround for stupid NCDware 
		 */
		fprintf(stderr, "9wm: bad mapreq c %p w %x, rescanning\n", (void *) c, (int) e->window);
		for (i = 0; i < num_screens; i++)
			scanwins(&screens[i]);
		c = getclient(e->window, 0);
		if (c == 0 || c->window != e->window) {
			fprintf(stderr, "9wm: window not found after rescan\n");
			return;
		}
	}

	switch (c->state) {
	case WithdrawnState:
		if (c->parent == c->screen->root) {
			if (!manage(c, 0))
				return;
			break;
		}
		XReparentWindow(dpy, c->window, c->parent, BORDER - 1, BORDER - 1);
		XAddToSaveSet(dpy, c->window);
		/*
		 * fall through... 
		 */
	case NormalState:
		XMapWindow(dpy, c->window);
		XMapRaised(dpy, c->parent);
		top(c);
		setwstate(c, NormalState);
		if (c->trans != None && current && c->trans == current->window)
			active(c);
		break;
	case IconicState:
		unhidec(c, 1);
		break;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x7e7f(%rip), %rax      # 0xb998
movl $0x0, (%rax)
movq 0x28(%rdi), %rdi
addq $0x28, %r14
xorl %esi, %esi
xorl %eax, %eax
callq 0x58e1
movq %rax, %rbx
testq %rax, %rax
je 0x3c36
movq (%rbx), %rax
cmpq (%r14), %rax
jne 0x3c36
movl 0x98(%rbx), %eax
cmpl $0x3, %eax
je 0x3b84
cmpl $0x1, %eax
je 0x3bc5
testl %eax, %eax
jne 0x3c48
movq 0x8(%rbx), %rdx
movq 0xf8(%rbx), %rax
cmpq 0x8(%rax), %rdx
jne 0x3b9a
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4340
movq %rbx, %rdi
movl $0x1, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x54f5
leaq 0x7dd7(%rip), %r14      # 0xb978
movq (%r14), %rdi
movq (%rbx), %rsi
leaq 0x7772(%rip), %rax      # 0xb320
movl (%rax), %ecx
decl %ecx
movl %ecx, %r8d
callq 0x2050
movq (%r14), %rdi
movq (%rbx), %rsi
callq 0x2430
leaq 0x7dac(%rip), %r14      # 0xb978
movq (%r14), %rdi
movq (%rbx), %rsi
callq 0x24c0
movq (%r14), %rdi
movq 0x8(%rbx), %rsi
callq 0x2340
movq %rbx, %rdi
xorl %eax, %eax
callq 0x587d
movq %rbx, %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x4dc3
movq 0x10(%rbx), %rax
testq %rax, %rax
setne %dl
leaq 0x7f23(%rip), %rcx      # 0xbb30
movq (%rcx), %rcx
testq %rcx, %rcx
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x3c48
cmpq (%rcx), %rax
jne 0x3c48
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x56e6
movq %rsp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2783
testb $0x1, %al
je 0x3c50
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%rsp), %rbx
jmp 0x3b48
// File: /workspace/github_c_makefile_star2_O1/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 0x7d31(%rip), %rax      # 0xb998
movl $0x0, (%rax)
movq 0x28(%rdi), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x58e1
testq %rax, %rax
je 0x3cd7
movq %rax, %rbx
movl 0x98(%rax), %eax
cmpl $0x1, %eax
je 0x3ca7
cmpl $0x3, %eax
jne 0x3ccd
cmpl $0x0, 0x10(%r14)
je 0x3ccd
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x54f5
jmp 0x3cc3
leaq 0x7e82(%rip), %rax      # 0xbb30
cmpq (%rax), %rbx
jne 0x3cba
xorl %eax, %eax
callq 0x5785
cmpl $0x0, 0xa0(%rbx)
jne 0x3ccd
movq %rbx, %rdi
xorl %eax, %eax
callq 0x48e9
movl $0x0, 0xa0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3ce6
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x58e1
testq %rax, %rax
je 0x3d57
movq %rax, %r14
movq (%rax), %rax
cmpq 0x28(%rbx), %rax
jne 0x3d57
movq 0x20(%rbx), %rdi
xorl %eax, %eax
callq 0x340c
testq %rax, %rax
je 0x3d57
movl 0x30(%rbx), %ecx
movl %ecx, 0x28(%r14)
movl 0x34(%rbx), %ecx
movl %ecx, 0x2c(%r14)
movl 0x38(%rbx), %ecx
movl %ecx, 0x30(%r14)
movl 0x3c(%rbx), %ecx
movl %ecx, 0x34(%r14)
movl 0x40(%rbx), %ecx
movl %ecx, 0x38(%r14)
movq %rax, 0xf8(%r14)
cmpq $0x0, 0x8(%r14)
jne 0x3d57
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7c31(%rip), %rax      # 0xb998
movl $0x0, (%rax)
xorl %esi, %esi
xorl %eax, %eax
callq 0x58e1
testq %rax, %rax
je 0x3da9
movq %rax, %rdi
xorl %eax, %eax
callq 0x59ab
leaq 0x7ddc(%rip), %rbx      # 0xbb68
movl $0x1, (%rbx)
leaq 0x7bdf(%rip), %rax      # 0xb978
movq (%rax), %rdi
xorl %esi, %esi
callq 0x23a0
movl $0x0, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
cmpl $0x0, 0x30(%rdi)
je 0x3fdb
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x58e1
testq %rax, %rax
je 0x3f84
movq 0x28(%rbx), %rcx
movq %rcx, 0xd8(%rax)
jmp 0x3fcf
leaq 0x7bad(%rip), %rax      # 0xbb38
movq (%rax), %rax
testq %rax, %rax
je 0x3fdb
movslq 0xe0(%rax), %rcx
testq %rcx, %rcx
jle 0x3fba
movq 0xe8(%rax), %rsi
movq 0x20(%rbx), %rdi
xorl %edx, %edx
cmpq %rdi, (%rsi,%rdx,8)
je 0x3fc0
incq %rdx
cmpq %rdx, %rcx
jne 0x3fac
movq 0x18(%rax), %rax
jmp 0x3f8e
movq 0x28(%rbx), %rcx
movq 0xf0(%rax), %rsi
movq %rcx, (%rsi,%rdx,8)
leaq 0x7b5a(%rip), %rcx      # 0xbb30
cmpq (%rcx), %rax
je 0x3fdd
popq %rbx
retq
movq %rax, %rdi
xorl %eax, %eax
popq %rbx
jmp 0x4a43
// File: /workspace/github_c_makefile_star2_O1/9wm[P]9wm/event.c
// Function: property
void
property(XPropertyEvent * e)
{
	Atom a;
	int delete;
	Client *c;

	/*
	 * we don't set curtime as nothing here uses it 
	 */
	a = e->atom;
	delete = (e->state == PropertyDelete);
	c = getclient(e->window, 0);
	if (c == 0)
		return;

	switch (a) {
	case XA_WM_ICON_NAME:
		if (c->iconname != 0)
			XFree((char *) c->iconname);
		c->iconname = delete ? 0 : getprop(c->window, a);
		setlabel(c);
		renamec(c, c->label);
		return;
	case XA_WM_NAME:
		if (c->name != 0)
			XFree((char *) c->name);
		c->name = delete ? 0 : getprop(c->window, a);
		setlabel(c);
		renamec(c, c->label);
		return;
	case XA_WM_TRANSIENT_FOR:
		gettrans(c);
		return;
	}
	if (a == _9wm_hold_mode) {
		c->hold = getiprop(c->window, _9wm_hold_mode);
		if (c == current)
			draw_border(c, 1);
	} else if (a == wm_colormaps) {
		getcmaps(c);
		if (c == current)
			cmapfocus(c);
	} else if (a == wm_protocols) {
		getproto(c);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq 0x20(%rdi), %rax
movq 0x28(%rdi), %r14
movl 0x38(%rdi), %ebp
movq %rax, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x58e1
testq %rax, %rax
je 0x4147
movq %rax, %rbx
cmpq $0x44, %r14
je 0x405c
cmpq $0x27, %r14
je 0x4042
cmpq $0x25, %r14
jne 0x406a
movq 0xd0(%rbx), %rdi
testq %rdi, %rdi
je 0x4032
callq 0x2170
cmpl $0x1, %ebp
jne 0x40c8
xorl %eax, %eax
jmp 0x40d7
movq 0xc8(%rbx), %rdi
testq %rdi, %rdi
je 0x4053
callq 0x2170
cmpl $0x1, %ebp
jne 0x40b0
xorl %eax, %eax
jmp 0x40bf
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x48b3
leaq 0x798f(%rip), %rax      # 0xba00
movq (%rax), %rsi
cmpq %rsi, %r14
jne 0x40fd
movq (%rbx), %rdi
xorl %eax, %eax
callq 0x4db9
movl %eax, 0xa4(%rbx)
leaq 0x7a9c(%rip), %rax      # 0xbb30
cmpq (%rax), %rbx
jne 0x4147
movq %rbx, %rdi
movl $0x1, %esi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x5653
movq (%rbx), %rdi
movl $0x27, %esi
xorl %eax, %eax
callq 0x4d53
movq %rax, 0xc8(%rbx)
jmp 0x40de
movq (%rbx), %rdi
movl $0x25, %esi
xorl %eax, %eax
callq 0x4d53
movq %rax, 0xd0(%rbx)
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4c4c
movq 0xb0(%rbx), %rsi
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x552b
leaq 0x78c4(%rip), %rax      # 0xb9c8
cmpq (%rax), %r14
jne 0x412d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4b13
leaq 0x7a16(%rip), %rax      # 0xbb30
cmpq (%rax), %rbx
jne 0x4147
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x4a43
leaq 0x787c(%rip), %rax      # 0xb9b0
cmpq (%rax), %r14
jne 0x4147
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x4e5e
popq %rbx
popq %r14
popq %rbp
retq