LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs/dispatch.c
// Function: dispatch_done
int
dispatch_done(struct dispatch_state * D)
{
	size_t i;
	int rc = 0;	/* No errors yet. */

	/* Shut down the worker threads. */
	for (i = 0; i < D->nreaders + 2; i++) {
		if (worker_kill(D->workers[i])) {
			warnp("Cannot destroy worker thread");
			rc = -1;
		}
	}
	free(D->workers);

	/* Stop reading work completion messages. */
	network_read_cancel(D->wakeup_cookie);

	/* Close the work completion message conduit. */
	while (close(D->spair[1])) {
		if (errno == EINTR)
			continue;
		warnp("close");
		rc = -1;
	}
	while (close(D->spair[0])) {
		if (errno == EINTR)
			continue;
		warnp("close");
		rc = -1;
	}

	/* Free allocated memory. */
	free(D->readers_idle);
	free(D);

	/* Return success, or failure if anything went wrong. */
	return (rc);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %ebp, %ebp
cmpq $-0x2, 0x8(%rdi)
je 0x3e8c
leaq 0x95f4(%rip), %r14      # 0xd42c
xorl %ebp, %ebp
xorl %r12d, %r12d
movq (%rbx), %rax
movq (%rax,%r12,8), %rdi
callq 0x4b24
testl %eax, %eax
je 0x3e7c
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3e6d
movq %rax, %r15
movq %r14, %rdi
xorl %eax, %eax
callq 0xacd8
movl $0x0, (%r15)
jmp 0x3e77
movq %r14, %rdi
xorl %eax, %eax
callq 0xadf7
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
incq %r12
movq 0x8(%rbx), %rax
addq $0x2, %rax
cmpq %rax, %r12
jb 0x3e3d
movq (%rbx), %rdi
callq 0x2040
movq 0x48(%rbx), %rdi
callq 0x83dc
leaq 0xa588(%rip), %r14      # 0xe42c
movl 0x3c(%rbx), %edi
callq 0x2240
testl %eax, %eax
je 0x3ee9
callq 0x20a0
movq %rax, %r15
movl (%rax), %eax
cmpl $0x4, %eax
je 0x3ea4
movq %r14, %rdi
testl %eax, %eax
jne 0x3ed4
xorl %eax, %eax
callq 0xadf7
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x3ea4
xorl %eax, %eax
callq 0xacd8
movl $0x0, (%r15)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x3ea4
leaq 0xa53c(%rip), %r14      # 0xe42c
movl 0x38(%rbx), %edi
callq 0x2240
testl %eax, %eax
je 0x3f30
callq 0x20a0
movq %rax, %r15
movl (%rax), %eax
cmpl $0x4, %eax
je 0x3ef0
movq %r14, %rdi
testl %eax, %eax
jne 0x3f1b
xorl %eax, %eax
callq 0xadf7
jmp 0x3f29
xorl %eax, %eax
callq 0xacd8
movl $0x0, (%r15)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x3ef0
movq 0x20(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs/dispatch_request.c
// Function: dispatch_request_params
int
dispatch_request_params(struct dispatch_state * dstate,
    struct proto_lbs_request * R)
{
	uint64_t blkno;

	/* Sanity check. */
	assert(dstate->blocklen <= UINT32_MAX);

	/* Figure out what the first available block number is. */
	if ((blkno = storage_nextblock(dstate->sstate)) == (uint64_t)(-1))
		goto err1;

	/* Send the response packet back. */
	dstate->npending--;
	if (proto_lbs_response_params(dstate->writeq, R->ID,
	    (uint32_t)dstate->blocklen, blkno))
		goto err1;

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

	/* Success! */
	return (0);

err1:
	free(R);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0x2c(%rdi)
jne 0x4183
movq %rsi, %rbx
movq %rdi, %r14
movq 0x30(%rdi), %rdi
callq 0x4ea6
cmpq $-0x1, %rax
je 0x4162
decq 0x70(%r14)
movq 0x58(%r14), %rdi
movq (%rbx), %rsi
movl 0x28(%r14), %edx
movq %rax, %rcx
callq 0xb040
testl %eax, %eax
je 0x4171
movq %rbx, %rdi
callq 0x2040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x417b
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x93e0(%rip), %rdi      # 0xd56a
leaq 0x93f8(%rip), %rsi      # 0xd589
leaq 0x9404(%rip), %rcx      # 0xd59c
movl $0x19, %edx
callq 0x2220
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs/dispatch_request.c
// Function: dispatch_request_get
int
dispatch_request_get(struct dispatch_state * dstate,
    struct proto_lbs_request * R)
{
	struct readq * rq;

	/* Add the read request to the pending read queue. */
	if ((rq = malloc(sizeof(struct readq))) == NULL)
		goto err1;
	rq->next = NULL;
	rq->reqID = R->ID;
	rq->blkno = R->r.get.blkno;
	if (dstate->readq_head == NULL)
		dstate->readq_head = rq;
	else
		*(dstate->readq_tail) = rq;
	dstate->readq_tail = &rq->next;

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

	/* Poke the queue. */
	if (dispatch_request_pokereadq(dstate))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x18, %edi
callq 0x2380
testq %rax, %rax
je 0x426d
movq $0x0, (%rax)
movq (%r14), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%r14), %rcx
movq %rcx, 0x10(%rax)
cmpq $0x0, 0x78(%rbx)
je 0x4277
movq 0x80(%rbx), %rcx
jmp 0x427b
movq %r14, %rdi
callq 0x2040
jmp 0x4299
leaq 0x78(%rbx), %rcx
movq %rax, (%rcx)
movq %rax, 0x80(%rbx)
movq %r14, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x42aa
testl %eax, %eax
je 0x42a0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x42a2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs/dispatch_request.c
// Function: dispatch_request_pokereadq
int
dispatch_request_pokereadq(struct dispatch_state * dstate)
{
	struct readq * R;
	struct workctl * reader;
	uint8_t * buf;

	/* Loop as long as we can launch a read. */
	while ((dstate->nreaders_idle > 0) && (dstate->readq_head != NULL)) {
		/* Grab the first read from the queue. */
		R = dstate->readq_head;

		/* Allocate a buffer to read the block into. */
		if ((buf = malloc(dstate->blocklen)) == NULL)
			goto err0;

		/* Grab an idle reader. */
		reader = dstate->workers[
		    dstate->readers_idle[dstate->nreaders_idle - 1]];
		dstate->nreaders_idle -= 1;

		/* Give the reader the work. */
		if (worker_assign(reader, 0, R->blkno, 0, buf, R->reqID))
			goto err1;

		/* Remove the work from the queue. */
		dstate->readq_head = R->next;

		/* Free the dequeued read queue entry. */
		free(R);
	}

	/* Success! */
	return (0);

err1:
	dstate->nreaders_idle += 1;
	free(buf);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x18(%rdi), %r12
testq %r12, %r12
je 0x4324
movq %rdi, %rbx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x78(%rbx), %r14
testq %r14, %r14
je 0x4324
movq 0x28(%rbx), %rdi
callq 0x2380
testq %rax, %rax
je 0x4326
movq %rax, %r15
movq (%rbx), %rax
movq 0x20(%rbx), %rcx
movq -0x8(%rcx,%r12,8), %rcx
decq %r12
movq (%rax,%rcx,8), %rdi
movq %r12, 0x18(%rbx)
movq 0x8(%r14), %r9
movq 0x10(%r14), %rdx
xorl %esi, %esi
xorl %ecx, %ecx
movq %r15, %r8
callq 0x490f
testl %eax, %eax
jne 0x4331
movq (%r14), %rax
movq %rax, 0x78(%rbx)
movq %r14, %rdi
callq 0x2040
movq 0x18(%rbx), %r12
testq %r12, %r12
jne 0x42c3
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
incq 0x18(%rbx)
movq %r15, %rdi
callq 0x2040
jmp 0x4326
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs/dispatch_request.c
// Function: dispatch_request_free
int
dispatch_request_free(struct dispatch_state * dstate,
    struct proto_lbs_request * R)
{
	struct workctl * deleter = dstate->workers[dstate->nreaders + 1];

	/* If the deleter is not busy, tell it to do something. */
	if (dstate->deleter_busy == 0) {
		/* Give the deleter the work. */
		dstate->deleter_busy = 1;
		if (worker_assign(deleter,
		    2, R->r.free.blkno, 0, NULL, R->ID))
			goto err1;
	}

	/*
	 * Send an ACK to the request.  FREEs are advisory, so we don't need
	 * to wait until we succeed before responding.
	 */
	dstate->npending--;
	if (proto_lbs_response_free(dstate->writeq, R->ID))
		goto err1;

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

	/* Success! */
	return (0);

err1:
	free(R);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, 0x14(%rdi)
je 0x4413
decq 0x70(%r14)
movq 0x58(%r14), %rdi
movq (%rbx), %rsi
callq 0xb2e3
testl %eax, %eax
jne 0x4441
xorl %ebp, %ebp
jmp 0x4446
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq 0x8(%rax,%rcx,8), %rdi
movl $0x1, 0x14(%r14)
movq (%rbx), %r9
movq 0x10(%rbx), %rdx
movl $0x2, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x490f
testl %eax, %eax
je 0x43fb
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs/worker.c
// Function: worker_assign
int
worker_assign(struct workctl * ctl, int op, uint64_t blkno, size_t nblks,
    uint8_t * buf, uint64_t reqID)
{
	int rc;

	/* Lock the control structure. */
	if ((rc = pthread_mutex_lock(&ctl->mtx)) != 0) {
		warn0("pthread_mutex_lock: %s", strerror(rc));
		goto err0;
	}

	/* Sanity check: The thread shouldn't be busy. */
	assert(ctl->haswork == 0);

	/* Record the work to be done. */
	ctl->op = op;
	ctl->blkno = blkno;
	ctl->nblks = nblks;
	ctl->buf = buf;
	ctl->reqID = reqID;

	/* The work isn't finished yet. */
	ctl->workdone = 0;

	/* Wake up the thread and unlock the control structure. */
	ctl->haswork = 1;
	if ((rc = pthread_cond_signal(&ctl->cv)) != 0) {
		warn0("pthread_cond_signal: %s", strerror(rc));
		goto err1;
	}
	if ((rc = pthread_mutex_unlock(&ctl->mtx)) != 0) {
		warn0("pthread_mutex_unlock: %s", strerror(rc));
		goto err0;
	}

	/* Success! */
	return (0);

err1:
	pthread_mutex_unlock(&ctl->mtx);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r14
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movl %esi, %ebp
movq %rdi, %rbx
callq 0x2550
testl %eax, %eax
je 0x4959
movl %eax, %edi
callq 0x2520
leaq 0x8d84(%rip), %rdi      # 0xd6c6
movq %rax, %rsi
xorl %eax, %eax
callq 0xadf7
callq 0x20a0
movl $0x0, (%rax)
jmp 0x49c5
cmpl $0x0, 0x60(%rbx)
jne 0x49fc
movl %ebp, 0x88(%rbx)
movq %r13, 0x90(%rbx)
movq %r12, 0x98(%rbx)
movq %r15, 0xa0(%rbx)
movq %r14, 0xa8(%rbx)
movq $0x1, 0x60(%rbx)
leaq 0x30(%rbx), %rdi
callq 0x22d0
testl %eax, %eax
je 0x49d9
movl %eax, %edi
callq 0x2520
leaq 0x8de2(%rip), %rdi      # 0xd78a
movq %rax, %rsi
xorl %eax, %eax
callq 0xadf7
callq 0x20a0
movl $0x0, (%rax)
movq %rbx, %rdi
callq 0x2370
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x2370
testl %eax, %eax
je 0x49f8
movl %eax, %edi
callq 0x2520
leaq 0x8d13(%rip), %rdi      # 0xd706
jmp 0x4942
xorl %eax, %eax
jmp 0x49ca
leaq 0x8d1c(%rip), %rdi      # 0xd71f
leaq 0x8d27(%rip), %rsi      # 0xd731
leaq 0x8d29(%rip), %rcx      # 0xd73a
movl $0xd1, %edx
callq 0x2220
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs/worker.c
// Function: worker_getdone
int
worker_getdone(struct workctl * ctl, int * op, uint64_t * blkno,
    size_t * nblks, uint8_t ** buf, uint64_t * reqID)
{
	int rc;

	/* Lock the control structure. */
	if ((rc = pthread_mutex_lock(&ctl->mtx)) != 0) {
		warn0("pthread_mutex_lock: %s", strerror(rc));
		goto err0;
	}

	/* Sanity check: This thread should have finished some work. */
	assert(ctl->haswork != 0);
	assert(ctl->workdone != 0);

	/* Copy out the work tuple. */
	*op = ctl->op;
	*blkno = ctl->blkno;
	*nblks = ctl->nblks;
	*buf = ctl->buf;
	*reqID = ctl->reqID;

	/* This thread no longer has work assigned to it. */
	ctl->haswork = 0;

	/* Unlock the thread control structure. */
	if ((rc = pthread_mutex_unlock(&ctl->mtx)) != 0) {
		warn0("pthread_mutex_unlock: %s", strerror(rc));
		goto err0;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r14
callq 0x2550
testl %eax, %eax
je 0x4a4a
leaq 0x8c7e(%rip), %rbx      # 0xd6c6
jmp 0x4aaf
cmpl $0x0, 0x60(%r14)
je 0x4ae6
cmpl $0x0, 0x64(%r14)
je 0x4b05
movl 0x88(%r14), %eax
movl %eax, (%rbp)
movq 0x90(%r14), %rax
movq %rax, (%r13)
movq 0x98(%r14), %rax
movq %rax, (%r12)
movq 0xa0(%r14), %rax
movq %rax, (%r15)
movq 0xa8(%r14), %rax
movq %rax, (%rbx)
movl $0x0, 0x60(%r14)
movq %r14, %rdi
callq 0x2370
testl %eax, %eax
je 0x4ae2
leaq 0x8c57(%rip), %rbx      # 0xd706
movl %eax, %edi
callq 0x2520
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xadf7
callq 0x20a0
movl $0x0, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x4ad3
leaq 0x8cb5(%rip), %rdi      # 0xd7a2
leaq 0x8c3d(%rip), %rsi      # 0xd731
leaq 0x8cb9(%rip), %rcx      # 0xd7b4
movl $0x105, %edx            # imm = 0x105
callq 0x2220
leaq 0x8d02(%rip), %rdi      # 0xd80e
leaq 0x8c1e(%rip), %rsi      # 0xd731
leaq 0x8c9a(%rip), %rcx      # 0xd7b4
movl $0x106, %edx            # imm = 0x106
callq 0x2220
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs/worker.c
// Function: worker_kill
int
worker_kill(struct workctl * ctl)
{
	int rc;

	/* Lock the control structure. */
	if ((rc = pthread_mutex_lock(&ctl->mtx)) != 0) {
		warn0("pthread_mutex_lock: %s", strerror(rc));
		goto err0;
	}

	/* Tell the thread to die, and wake it up. */
	ctl->suicide = 1;
	if ((rc = pthread_cond_signal(&ctl->cv)) != 0) {
		warn0("pthread_cond_signal: %s", strerror(rc));
		goto err1;
	}

	/* Unlock the control structure. */
	if ((rc = pthread_mutex_unlock(&ctl->mtx)) != 0) {
		warn0("pthread_mutex_unlock: %s", strerror(rc));
		goto err0;
	}

	/* Wait for the thread to die. */
	if ((rc = pthread_join(ctl->thr, NULL)) != 0) {
		warn0("pthread_join: %s", strerror(rc));
		goto err0;
	}

	/* Destroy condition variable. */
	if ((rc = pthread_cond_destroy(&ctl->cv)) != 0) {
		warn0("pthread_cond_destroy: %s", strerror(rc));
		goto err0;
	}

	/* Destroy mutex. */
	if ((rc = pthread_mutex_destroy(&ctl->mtx)) != 0) {
		warn0("pthread_mutex_destroy: %s", strerror(rc));
		goto err0;
	}

	/* Free the control structure. */
	free(ctl);

	/* Success! */
	return (0);

err1:
	pthread_mutex_unlock(&ctl->mtx);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2550
testl %eax, %eax
je 0x4b59
movl %eax, %edi
callq 0x2520
leaq 0x8b84(%rip), %rdi      # 0xd6c6
movq %rax, %rsi
xorl %eax, %eax
callq 0xadf7
callq 0x20a0
movl $0x0, (%rax)
jmp 0x4b9b
movl $0x1, 0x68(%rbx)
leaq 0x30(%rbx), %r14
movq %r14, %rdi
callq 0x22d0
testl %eax, %eax
je 0x4ba8
movl %eax, %edi
callq 0x2520
leaq 0x8c0c(%rip), %rdi      # 0xd78a
movq %rax, %rsi
xorl %eax, %eax
callq 0xadf7
callq 0x20a0
movl $0x0, (%rax)
movq %rbx, %rdi
callq 0x2370
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x2370
testl %eax, %eax
je 0x4bc7
movl %eax, %edi
callq 0x2520
leaq 0x8b44(%rip), %rdi      # 0xd706
jmp 0x4b42
movq 0x28(%rbx), %rdi
xorl %esi, %esi
callq 0x2500
testl %eax, %eax
je 0x4be9
movl %eax, %edi
callq 0x2520
leaq 0x8c3d(%rip), %rdi      # 0xd821
jmp 0x4b42
movq %r14, %rdi
callq 0x2450
testl %eax, %eax
je 0x4c08
movl %eax, %edi
callq 0x2520
leaq 0x8c2f(%rip), %rdi      # 0xd832
jmp 0x4b42
movq %rbx, %rdi
callq 0x21d0
testl %eax, %eax
je 0x4c27
movl %eax, %edi
callq 0x2520
leaq 0x8c29(%rip), %rdi      # 0xd84b
jmp 0x4b42
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
jmp 0x4ba0
nop
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs/storage.c
// Function: storage_delete
int
storage_delete(struct storage_state * S, uint64_t blkno)
{
	struct file_state * fs;
	uint64_t fileno;
	char * s;

	/* Loop until we don't need to delete anything. */
	do {
		/*
		 * First, figure out if we need to delete a file; if we do,
		 * remove it from the file queue.
		 */

		/* Grab a write lock. */
		if (storage_util_writelock(S))
			goto err0;

		/* If we have less than 2 files, don't delete anything. */
		if (elasticqueue_getlen(S->files) < 2)
			break;

		/* If the first file has blocks we need, don't delete. */
		fs = elasticqueue_get(S->files, 0);
		if (fs->start + fs->len > blkno)
			break;

		/* We want to delete the first file. */
		fileno = fs->start;

		/* Remove the file from the file queue. */
		elasticqueue_delete(S->files);

		/* Adjust our first-block-held value. */
		fs = elasticqueue_get(S->files, 0);
		S->minblk = fs->start;

		/* Release the lock. */
		if (storage_util_unlock(S))
			goto err0;

		/*
		 * Delete the file.  We don't need to worry about racing
		 * against the writer, since we will never delete the last
		 * file; and racing against readers is handled by readers
		 * treating ENOENT properly.
		 */
		if ((s = storage_util_mkpath(S, fileno)) == NULL)
			goto err0;
		if (unlink(s)) {
			warnp("unlink(%s)", s);
			goto err1;
		}
		free(s);

		/* Make sure the file deletion is flushed to disk. */
		if (disk_syncdir(S->storagedir))
			goto err0;
	} while (1);

	/* Release the write lock. */
	if (storage_util_unlock(S))
		goto err0;

	/* Success! */
	return (0);

err1:
	free(s);
err0:

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rbx, %rdi
callq 0x5708
testl %eax, %eax
jne 0x533e
movq 0x60(%rbx), %rdi
callq 0x5d90
cmpq $0x2, %rax
jb 0x52ef
movq 0x60(%rbx), %rdi
xorl %esi, %esi
callq 0x5d95
movq (%rax), %r15
movq 0x8(%rax), %rax
addq %r15, %rax
cmpq %r14, %rax
ja 0x52ef
movq 0x60(%rbx), %rdi
callq 0x5d01
movq 0x60(%rbx), %rdi
xorl %esi, %esi
callq 0x5d95
movq (%rax), %rax
movq %rax, 0x68(%rbx)
movq %rbx, %rdi
callq 0x5744
testl %eax, %eax
jne 0x533e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5780
testq %rax, %rax
je 0x533e
movq %rax, %r15
movq %rax, %rdi
callq 0x20b0
testl %eax, %eax
jne 0x52ff
movq %r15, %rdi
callq 0x2040
movq (%rbx), %rdi
callq 0x57e8
testl %eax, %eax
je 0x5252
jmp 0x533e
movq %rbx, %rdi
callq 0x5744
testl %eax, %eax
jne 0x533e
xorl %eax, %eax
jmp 0x5343
callq 0x20a0
cmpl $0x0, (%rax)
je 0x5325
movq %rax, %rbx
leaq 0x8813(%rip), %rdi      # 0xdb26
movq %r15, %rsi
xorl %eax, %eax
callq 0xacd8
movl $0x0, (%rbx)
jmp 0x5336
leaq 0x87fa(%rip), %rdi      # 0xdb26
movq %r15, %rsi
xorl %eax, %eax
callq 0xadf7
movq %r15, %rdi
callq 0x2040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs/storage.c
// Function: storage_done
int
storage_done(struct storage_state * S)
{
	int rc;

	/* Destroy the lock on the storage state. */
	if ((rc = pthread_rwlock_destroy(&S->lck)) != 0) {
		warn0("pthread_rwlock_destroy: %s", strerror(rc));
		goto err0;
	}

	/* Free the queue of file state structures. */
	elasticqueue_free(S->files);

	/* Free the storage state. */
	free(S);

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x28, %rdi
callq 0x2130
testl %eax, %eax
je 0x5384
movl %eax, %edi
callq 0x2520
leaq 0x87c9(%rip), %rdi      # 0xdb31
movq %rax, %rsi
xorl %eax, %eax
callq 0xadf7
callq 0x20a0
movl $0x0, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x5397
movq 0x60(%rbx), %rdi
callq 0x5db1
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs/storage_util.c
// Function: storage_util_mkpath
char *
storage_util_mkpath(struct storage_state * S, uint64_t fileno)
{
	char * s;

	/* Construct path. */
	if (asprintf(&s, "%s/blks_%016" PRIx64,
	    S->storagedir, fileno) == -1) {
		warnp("asprintf");
		goto err0;
	}

	/* Success! */
	return (s);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rcx
movq (%rdi), %rdx
leaq 0x8488(%rip), %rsi      # 0xdc19
movq %rsp, %rdi
xorl %eax, %eax
callq 0x8ba4
cmpl $-0x1, %eax
je 0x57a6
movq (%rsp), %rbx
jmp 0x57dc
callq 0x20a0
cmpl $0x0, (%rax)
je 0x57cc
movq %rax, %r14
leaq 0x7a0b(%rip), %rdi      # 0xd1c5
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xacd8
movl $0x0, (%r14)
jmp 0x57dc
leaq 0x79f2(%rip), %rdi      # 0xd1c5
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xadf7
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs/disk.c
// Function: disk_syncdir
int
disk_syncdir(const char * path)
{
	int fd;

	while ((fd = open(path, O_RDONLY)) == -1) {
		if (errno != EINTR) {
			warnp("open(%s)", path);
			goto err0;
		}
	}
	while (fsync(fd)) {
		if (errno != EINTR) {
			warnp("fsync(%s)", path);
			goto err1;
		}
	}
	while (close(fd)) {
		if (errno != EINTR) {
			warnp("close(%s)", path);
			goto err0;
		}
	}

	/* Success! */
	return (0);

err1:
	if (close(fd))
		warnp("close");
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2460
cmpl $-0x1, %eax
jne 0x5840
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x57ef
leaq 0x8c00(%rip), %rdi      # 0xe416
movq %rbx, %rsi
testl %eax, %eax
jne 0x5826
xorl %eax, %eax
callq 0xadf7
jmp 0x5834
xorl %eax, %eax
callq 0xacd8
movl $0x0, (%r14)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl %eax, %ebp
movl %ebp, %edi
callq 0x2440
testl %eax, %eax
je 0x5873
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x5842
leaq 0x83c5(%rip), %rdi      # 0xdc28
movq %rbx, %rsi
testl %eax, %eax
jne 0x5896
xorl %eax, %eax
callq 0xadf7
jmp 0x58a4
movl %ebp, %edi
callq 0x2240
testl %eax, %eax
je 0x58e7
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x5873
leaq 0x839e(%rip), %rdi      # 0xdc32
jmp 0x5816
xorl %eax, %eax
callq 0xacd8
movl $0x0, (%r14)
movl %ebp, %edi
callq 0x2240
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x5839
cmpl $0x0, (%r14)
je 0x58d4
leaq 0x8b6b(%rip), %rdi      # 0xe42c
xorl %eax, %eax
callq 0xacd8
movl $0x0, (%r14)
jmp 0x5839
leaq 0x8b51(%rip), %rdi      # 0xe42c
xorl %eax, %eax
callq 0xadf7
jmp 0x5839
xorl %ebx, %ebx
jmp 0x5839
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/lbs/disk.c
// Function: disk_write
int
disk_write(const char * path, int create, size_t nbytes, const uint8_t * buf,
    int nosync)
{
	int fd;

	/* Open or create the file, depending on ${creat}. */
	do {
		/* Attempt to open/create. */
		if (create) {
			fd = open(path, O_WRONLY | O_BINARY | O_APPEND |
			    O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
		} else {
			fd = open(path, O_WRONLY | O_BINARY | O_APPEND);
		}

		/* If we hit EINTR, try again. */
	} while ((fd == -1) && (errno == EINTR));

	/* If we failed to open the file, error out. */
	if (fd == -1) {
		warnp("open(%s)", path);
		goto err0;
	}

	/* Write from the buffer. */
	if (noeintr_write(fd, buf, nbytes) != (ssize_t)nbytes)
		goto err1;

	/* Ask to have the write flushed to disk. */
	if (nosync == 0) {
		while (fsync(fd)) {
			if (errno != EINTR) {
				warnp("fsync(%s)", path);
				goto err1;
			}
		}
	}

	/* Close the file. */
	while (close(fd)) {
		if (errno != EINTR) {
			warnp("close(%s)", path);
			goto err0;
		}
	}

	/* Success! */
	return (0);

err1:
	if (close(fd))
		warnp("close");
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r14d
movq %rcx, %r12
movq %rdx, %r15
movl %esi, %r13d
movq %rdi, %rbx
movq %rbx, %rdi
testl %r13d, %r13d
je 0x5b20
movl $0x4c1, %esi            # imm = 0x4C1
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x2460
jmp 0x5b2c
movl $0x401, %esi            # imm = 0x401
xorl %eax, %eax
callq 0x2460
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x5b60
callq 0x20a0
movq %rax, %rbp
movl (%rax), %eax
cmpl $0x4, %eax
je 0x5b05
leaq 0x88cd(%rip), %rdi      # 0xe416
testl %eax, %eax
jne 0x5be8
movq %rbx, %rsi
xorl %eax, %eax
callq 0xadf7
jmp 0x5bf9
movl %ebp, %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x9b94
cmpq %r15, %rax
jne 0x5c21
testl %r14d, %r14d
je 0x5bb7
movl %ebp, %edi
callq 0x2240
testl %eax, %eax
je 0x5c0f
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x5b7b
leaq 0x8092(%rip), %rdi      # 0xdc32
testl %eax, %eax
je 0x5b51
movq %rbx, %rsi
xorl %eax, %eax
callq 0xacd8
movl $0x0, (%r14)
jmp 0x5bf9
movl %ebp, %edi
callq 0x2440
testl %eax, %eax
je 0x5b7b
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x5bb7
leaq 0x8050(%rip), %rdi      # 0xdc28
movq %rbx, %rsi
testl %eax, %eax
jne 0x5c13
xorl %eax, %eax
callq 0xadf7
jmp 0x5c21
movq %rbx, %rsi
xorl %eax, %eax
callq 0xacd8
movl $0x0, (%rbp)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x5bfe
xorl %eax, %eax
callq 0xacd8
movl $0x0, (%r14)
movl %ebp, %edi
callq 0x2240
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x5bfe
callq 0x20a0
cmpl $0x0, (%rax)
je 0x5c55
movq %rax, %r14
leaq 0x87e7(%rip), %rdi      # 0xe42c
xorl %eax, %eax
callq 0xacd8
movl $0x0, (%r14)
jmp 0x5bfe
leaq 0x87d0(%rip), %rdi      # 0xe42c
xorl %eax, %eax
callq 0xadf7
jmp 0x5bfe
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/zpole[P]IICV/src/test_rand.c
// Function: main
int
main (int argc VL_UNUSED, char *argv[] VL_UNUSED)
{
  int i ;
  vl_uint32 init [4] = {0x123, 0x234, 0x345, 0x456} ;
  VlRand rand ;
  vl_rand_init (&rand) ;

  vl_rand_seed_by_array (&rand, init, sizeof(init)/sizeof(init[0])) ;

  printf("1000 outputs of vl_rand_uint32()\n");
  for (i=0; i<1000; i++) {
    printf("%10" VL_FL_INT32 "u ", vl_rand_uint32(&rand));
    if (i%5==4) printf("\n");
  }

  printf("\n1000 outputs of vl_rand_real2()\n");
  for (i=0; i<1000; i++) {
    printf("%10.8f ", vl_rand_real2(&rand));
    if (i%5==4) printf("\n");
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x9e0, %rsp            # imm = 0x9E0
movapd 0xe6d(%rip), %xmm0      # 0x2010
movq %rsp, %r14
movapd %xmm0, (%r14)
leaq 0x1c(%rsp), %rbx
movq %rbx, %rdi
callq 0x1080
movl $0x4, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1040
leaq 0xe5f(%rip), %rdi       # 0x202e
callq 0x1050
leaq 0xe45(%rip), %r14       # 0x2020
xorl %ebp, %ebp
xorl %r15d, %r15d
movzwl %bp, %eax
imull $0xcccd, %eax, %eax     # imm = 0xCCCD
shrl $0x12, %eax
leal (%rax,%rax,4), %eax
movl $0xfffffffc, %r12d      # imm = 0xFFFFFFFC
subl %eax, %r12d
movq %rbx, %rdi
callq 0x1060
movq %r14, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x1070
cmpw %r15w, %r12w
jne 0x121c
movl $0xa, %edi
callq 0x1030
decl %r15d
incl %ebp
cmpl $0xfffffc18, %r15d      # imm = 0xFFFFFC18
jne 0x11e0
leaq 0xe1e(%rip), %rdi       # 0x204f
callq 0x1050
xorl %ebp, %ebp
leaq 0x1c(%rsp), %rbx
leaq 0xde2(%rip), %r14       # 0x2026
xorl %r15d, %r15d
movzwl %bp, %eax
imull $0xcccd, %eax, %eax     # imm = 0xCCCD
shrl $0x12, %eax
leal (%rax,%rax,4), %eax
movl $0xfffffffc, %r12d      # imm = 0xFFFFFFFC
subl %eax, %r12d
movq %rbx, %rdi
callq 0x1060
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0xd8f(%rip), %xmm0      # 0x2008
movq %r14, %rdi
movb $0x1, %al
callq 0x1070
cmpw %r15w, %r12w
jne 0x1293
movl $0xa, %edi
callq 0x1030
decl %r15d
incl %ebp
cmpl $0xfffffc18, %r15d      # imm = 0xFFFFFC18
jne 0x1247
xorl %eax, %eax
addq $0x9e0, %rsp            # imm = 0x9E0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/oatk.c
// Function: make_dir
static int make_dir(char *dir)
{
    struct stat st = {0};
    if (stat(dir, &st) == -1) {
        int ret = mkdir(dir, 0700);
        if (ret) {
            fprintf(stderr, "[W::%s] create output directory '%s' failed: %s\n", __func__, dir, strerror(errno));
            exit(EXIT_FAILURE);
        }
        return 1;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
movq %rsp, %r14
xorl %ebp, %ebp
movl $0x90, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x3240
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3340
cmpl $-0x1, %eax
jne 0x6f9d
movq %rbx, %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x30e0
movl $0x1, %ebp
testl %eax, %eax
jne 0x6fab
movl %ebp, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
callq 0x39a2
nop
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/path_finder.c
// Function: fopen1
FILE *fopen1(char *fn)
{
    FILE *fo;
    fo = fopen(fn, "w");
    if (!fo) {
        fprintf(stderr, "[E::%s] failed to open file %s to write\n", __func__, fn);
        exit(EXIT_FAILURE);
    }
    return fo;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x2e08a(%rip), %rsi     # 0x361f1
callq 0x3480
testq %rax, %rax
je 0x8173
popq %rbx
retq
movq %rbx, %rdi
callq 0x3c2e
// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/path_finder.c
// Function: path_cmpfunc
static int path_cmpfunc(const void *a, const void *b)
{
    path_t *x, *y;
    x = (path_t *) a;
    y = (path_t *) b;
    if (x->nv != y->nv)
        return (x->nv > y->nv) - (x->nv < y->nv);

    uint32_t i, nv, *vx, *vy;
    nv = x->nv;
    vx = x->v;
    vy = y->v;

    for (i = 0; i < nv; ++i)
        if (vx[i] != vy[i])
            return (vx[i] > vy[i]) - (vx[i] < vy[i]);

    return 0;
}

// Assembly:
movl 0x8(%rdi), %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
andl 0x8(%rsi), %ecx
cmpl %ecx, %eax
jne 0xb354
testl %eax, %eax
je 0xb351
movq 0x10(%rdi), %rcx
movq 0x10(%rsi), %rdx
xorl %esi, %esi
movl (%rdx,%rsi,4), %edi
cmpl %edi, (%rcx,%rsi,4)
jne 0xb354
incq %rsi
cmpq %rsi, %rax
jne 0xb341
xorl %eax, %eax
retq
seta %al
movzbl %al, %eax
sbbl $0x0, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/qpfiffer[P]38-Moths/src/utests.c
// Function: test_vector
int test_vector() {
	vector *vec = vector_new(sizeof(uint64_t), 2);

	uint64_t i;
	for (i = 0; i < 10000; i++)
		vector_append(vec, &i, sizeof(i));

	uint64_t total = 0;
	for (i = 0; i < vec->count; i++) {
		uint64_t *j = (uint64_t *)vector_get(vec, i);
		total += *j;
	}

	vector_free(vec);

	if (total != 49995000)
		return 1;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl $0x8, %edi
movl $0x2, %esi
callq 0x3184
movq %rax, %rbx
leaq 0x8(%rsp), %r14
movq $0x0, (%r14)
movl $0x8, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x31c3
movq 0x8(%rsp), %rax
incq %rax
movq %rax, 0x8(%rsp)
cmpq $0x2710, %rax           # imm = 0x2710
jb 0x480e
movq $0x0, 0x8(%rsp)
cmpq $0x0, 0x10(%rbx)
je 0x4875
xorl %r14d, %r14d
xorl %esi, %esi
movq %rbx, %rdi
callq 0x32d3
addq (%rax), %r14
movq 0x8(%rsp), %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
cmpq 0x10(%rbx), %rsi
jb 0x4848
xorl %ebp, %ebp
cmpq $0x2fadcf8, %r14        # imm = 0x2FADCF8
setne %bpl
jmp 0x487a
movl $0x1, %ebp
movq %rbx, %rdi
callq 0x3418
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/qpfiffer[P]38-Moths/src/utests.c
// Function: test_vector_ptr_append
int test_vector_ptr_append() {
	vector *vec = vector_new(sizeof(uint64_t), 2);

	uint32_t i = 0;
	for (i = 0; i < 100; i++) {
		char buf[128] = {0};
		char *duped = NULL;
		snprintf(buf, sizeof(buf), "%u", i);
		duped = strndup(buf, sizeof(buf));

		vector_append_ptr(vec, duped);
	}

	for (i = 0; i < vec->count; i++) {
		char buf[128] = {0};
		snprintf(buf, sizeof(buf), "%u", i);

		char **str = (char **)vector_get(vec, i);

		assert(strncmp(buf, *str, sizeof(buf)) == 0);
		free(*str);
	}

	vector_free(vec);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl $0x8, %edi
movl $0x2, %esi
callq 0x3184
movq %rax, %rbx
leaq 0x4129(%rip), %r14      # 0x89e0
movq %rsp, %r15
xorl %ebp, %ebp
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)
movl $0x80, %esi
movq %r15, %rdi
movq %r14, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2130
movl $0x80, %esi
movq %r15, %rdi
callq 0x21b0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x326a
incl %ebp
cmpl $0x64, %ebp
jne 0x48bc
cmpq $0x0, 0x10(%rbx)
je 0x499f
leaq 0x40b9(%rip), %r14      # 0x89e0
movq %rsp, %r15
xorl %r12d, %r12d
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)
movl $0x80, %esi
movq %r15, %rdi
movq %r14, %rdx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x2130
movq %rbx, %rdi
movl %r12d, %esi
callq 0x32d3
movq (%rax), %r13
movl $0x80, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x2080
testl %eax, %eax
jne 0x49bb
movq %r13, %rdi
callq 0x2030
incl %r12d
cmpq %r12, 0x10(%rbx)
ja 0x492d
movq %rbx, %rdi
callq 0x3418
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4021(%rip), %rdi      # 0x89e3
leaq 0x403f(%rip), %rsi      # 0x8a08
leaq 0x4045(%rip), %rcx      # 0x8a15
movl $0x45, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O3/qpfiffer[P]38-Moths/src/utests.c
// Function: test_vector_reverse
int test_vector_reverse() {
	vector *vec = vector_new(sizeof(uint64_t), 2);

	uint64_t i;
	for (i = 0; i < 99999; i++)
		vector_append(vec, &i, sizeof(i));

	if (!vector_reverse(vec))
		return 1;

	for (i -= 1; i >= vec->count; i--) {
		uint64_t *j = (uint64_t *)vector_get(vec, i);
		if (i != *j)
			return 1;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl $0x8, %edi
movl $0x2, %esi
callq 0x3184
movq %rax, %rbx
leaq 0x8(%rsp), %r14
movq $0x0, (%r14)
movl $0x8, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x31c3
movq 0x8(%rsp), %rax
incq %rax
movq %rax, 0x8(%rsp)
cmpq $0x1869f, %rax          # imm = 0x1869F
jb 0x4a00
movq %rbx, %rdi
callq 0x32ec
movl $0x1, %ebp
testl %eax, %eax
je 0x4a5f
movq 0x8(%rsp), %rsi
decq %rsi
movq %rsi, 0x8(%rsp)
cmpq 0x10(%rbx), %rsi
jb 0x4a5d
movq %rbx, %rdi
callq 0x32d3
movq 0x8(%rsp), %rsi
cmpq (%rax), %rsi
je 0x4a3b
jmp 0x4a5f
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/qpfiffer[P]38-Moths/src/utests.c
// Function: test_request_without_body_is_parseable
int test_request_without_body_is_parseable() {
	const unsigned char req[] = " GET / HTTP/1.1\r\n"
		"User-Agent: curl/7.35.0\r\n"
		"Host: localhost:8080\r\n"
		"Content-Length: 6\r\n"
		"Accept: */*\r\n\r\n";
	m38_http_request request = {
		.verb = {0},
		.resource = {0},
		.matches = {{0}},
		.full_header = NULL,
		.body_len = 0,
		.full_body = NULL
	};

	int rc = m38_parse_request(req, strlen((char *)req), &request);
	if (rc != 0)
		return 1;

	if (strnlen(request.full_header, strlen((char *)req)) != strlen((char *)req))
		return 1;
	if (request.full_body != NULL || request.body_len != 0)
		return 1;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x2c0, %rsp            # imm = 0x2C0
leaq 0x4133(%rip), %rsi      # 0x8bb0
movq %rsp, %rbx
movl $0xc, %ecx
movq %rbx, %rdi
rep  movsq (%rsi), %es:(%rdi)
movb $0x0, 0x62(%rbx)
movw $0xa0d, 0x60(%rbx)      # imm = 0xA0D
leaq 0x68(%rsp), %r14
movl $0x258, %edx            # imm = 0x258
movq %r14, %rdi
xorl %esi, %esi
callq 0x2160
movq %rbx, %rdi
callq 0x20e0
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x7cb8
movl $0x1, %ebx
testl %eax, %eax
jne 0x4b00
movq 0x298(%rsp), %r14
movq %rsp, %rdi
callq 0x20e0
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x2170
cmpq %r15, %rax
jne 0x4b00
movq 0x2b0(%rsp), %rax
xorl %ebx, %ebx
orq 0x2a8(%rsp), %rax
setne %bl
movl %ebx, %eax
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/qpfiffer[P]38-Moths/src/utests.c
// Function: test_request_with_body_is_parseable_no_clength
int test_request_with_body_is_parseable_no_clength() {
	const unsigned char req[] = " GET / HTTP/1.1\r\n"
		"User-Agent: curl/7.35.0\r\n"
		"Host: localhost:8080\r\n"
		"Accept: */*\r\n\r\n"
		"{\"test\": \"asdf\"}";
	m38_http_request request = {
		.verb = {0},
		.resource = {0},
		.matches = {{0}},
		.full_header = NULL,
		.body_len = 0,
		.full_body = NULL
	};

	int rc = m38_parse_request(req, strlen((char *)req), &request);
	if (rc != 0)
		return 1;
	rc = m38_parse_body(strlen("{\"test\": \"asdf\"}"), 16, req, &request);
	if (rc != 0)
		return 1;

	if (strnlen(request.full_header, strlen((char *)req)) == strlen((char *)req))
		return 1;
	if (request.full_body == NULL || request.body_len <= 0)
		return 1;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x2c0, %rsp            # imm = 0x2C0
leaq 0x40fe(%rip), %rsi      # 0x8c20
movq %rsp, %rbx
movl $0xc, %ecx
movq %rbx, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x68(%rsp), %r14
movl $0x258, %edx            # imm = 0x258
movq %r14, %rdi
xorl %esi, %esi
callq 0x2160
movq %rbx, %rdi
callq 0x20e0
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x7cb8
movl $0x1, %ebx
testl %eax, %eax
jne 0x4bbe
movq %rsp, %rdx
leaq 0x68(%rsp), %rcx
movl $0x10, %edi
movl $0x10, %esi
callq 0x7dbb
testl %eax, %eax
jne 0x4bbe
movq 0x298(%rsp), %r14
movq %rsp, %rdi
callq 0x20e0
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x2170
cmpq %r15, %rax
je 0x4bbe
cmpq $0x0, 0x2a8(%rsp)
sete %al
cmpq $0x0, 0x2b0(%rsp)
sete %cl
orb %al, %cl
movzbl %cl, %ebx
movl %ebx, %eax
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/qpfiffer[P]38-Moths/src/utests.c
// Function: test_form_encoded_body
int test_form_encoded_body() {
	const unsigned char req[] = " GET / HTTP/1.1\r\n"
		"User-Agent: curl/7.35.0\r\n"
		"Host: localhost:8080\r\n"
		"Accept: */*\r\n"
		"Content-Type: application/x-www-form-urlencoded\r\n"
		"Content-Length: 11\r\n\r\n"
		"test=1&23=a";
	m38_http_request request = {
		.verb = {0},
		.resource = {0},
		.matches = {{0}},
		.full_header = NULL,
		.body_len = 0,
		.full_body = NULL,
		.form_elements = NULL
	};

	int rc = m38_parse_request(req, strlen((char *)req), &request);
	if (rc != 0)
		return 1;
	rc = m38_parse_body(strlen("test=1&23=a"), 11, req, &request);
	if (rc != 0)
		return 1;
	rc = m38_parse_form_encoded_body(&request);
	if (rc != 0)
		return 1;

	if (!request.form_elements)
		return 1;

	const char *test_value = NULL, *a_value = NULL;
	size_t test_size = 0, a_size = 0;
	if (!(test_value = sparse_dict_get(request.form_elements, "test", strlen("test"), &test_size)))
		return 1;
	if (strncmp(test_value, "1", test_size) != 0)
		return 1;
	if (!(a_value = sparse_dict_get(request.form_elements, "23", strlen("23"), &a_size)))
		return 1;
	if (strncmp(a_value, "asdf", a_size) != 0)
		return 1;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
leaq 0x40a2(%rip), %rsi      # 0x8c80
leaq 0x10(%rsp), %rbx
movl $0xa0, %edx
movq %rbx, %rdi
callq 0x2220
leaq 0xb0(%rsp), %r14
movl $0x258, %edx            # imm = 0x258
movq %r14, %rdi
xorl %esi, %esi
callq 0x2160
movq %rbx, %rdi
callq 0x20e0
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x7cb8
movl $0x1, %ebx
testl %eax, %eax
jne 0x4c57
leaq 0x10(%rsp), %rdx
leaq 0xb0(%rsp), %rcx
movl $0xb, %edi
movl $0xb, %esi
callq 0x7dbb
testl %eax, %eax
jne 0x4c57
leaq 0xb0(%rsp), %rdi
callq 0x7e67
testl %eax, %eax
je 0x4c64
movl %ebx, %eax
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r14
retq
movq 0x300(%rsp), %rdi
testq %rdi, %rdi
je 0x4c57
xorl %eax, %eax
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq %rax, (%rsp)
leaq 0x3dac(%rip), %rsi      # 0x8a32
movl $0x4, %edx
callq 0x2bf1
movl $0x1, %ebx
testq %rax, %rax
je 0x4c57
movq 0x8(%rsp), %rdx
leaq 0x47a8(%rip), %rsi      # 0x944e
movq %rax, %rdi
callq 0x2080
testl %eax, %eax
jne 0x4c57
movq 0x300(%rsp), %rdi
leaq 0x3d76(%rip), %rsi      # 0x8a37
movq %rsp, %rcx
movl $0x2, %edx
callq 0x2bf1
testq %rax, %rax
je 0x4c57
movq (%rsp), %rdx
leaq 0x3d5c(%rip), %rsi      # 0x8a3a
movq %rax, %rdi
callq 0x2080
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x4c57
// File: /workspace/github_c_makefile_star2_O3/qpfiffer[P]38-Moths/src/utests.c
// Function: test_request_with_body_is_parseable
int test_request_with_body_is_parseable() {
	const unsigned char req[] = " GET / HTTP/1.1\r\n"
		"User-Agent: curl/7.35.0\r\n"
		"Host: localhost:8080\r\n"
		"Accept: */*\r\n"
		"Content-Length: 16\r\n\r\n"
		"{\"test\": \"asdf\"}";
	m38_http_request request = {
		.verb = {0},
		.resource = {0},
		.matches = {{0}},
		.full_header = NULL,
		.body_len = 0,
		.full_body = NULL
	};

	int rc = m38_parse_request(req, strlen((char *)req), &request);
	if (rc != 0)
		return 1;
	rc = m38_parse_body(strlen("{\"test\": \"asdf\"}"), 16, req, &request);
	if (rc != 0)
		return 1;

	if (strlen((const char *)request.full_body) != 16)
		return 1;
	if (request.full_body == NULL || request.body_len != 16)
		return 1;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x2d8, %rsp            # imm = 0x2D8
leaq 0x401d(%rip), %rsi      # 0x8d20
movq %rsp, %rbx
movl $0xe, %ecx
movq %rbx, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl $0x7d2266, 0x70(%rbx)   # imm = 0x7D2266
leaq 0x80(%rsp), %r14
movl $0x258, %edx            # imm = 0x258
movq %r14, %rdi
xorl %esi, %esi
callq 0x2160
movq %rbx, %rdi
callq 0x20e0
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x7cb8
movl $0x1, %ebx
testl %eax, %eax
jne 0x4d99
movq %rsp, %rdx
leaq 0x80(%rsp), %rcx
movl $0x10, %edi
movl $0x10, %esi
callq 0x7dbb
testl %eax, %eax
jne 0x4d99
movq 0x2c0(%rsp), %r14
movq %r14, %rdi
callq 0x20e0
cmpq $0x10, %rax
jne 0x4d99
testq %r14, %r14
sete %al
cmpq $0x10, 0x2c8(%rsp)
setne %cl
orb %al, %cl
movzbl %cl, %ebx
movl %ebx, %eax
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/qpfiffer[P]38-Moths/src/utests.c
// Function: test_request_body_is_extracted
int test_request_body_is_extracted() {
	const unsigned char req[] = " GET / HTTP/1.1\r\n"
		"User-Agent: curl/7.35.0\r\n"
		"Host: localhost:8080\r\n"
		"Content-Length: 6\r\n"
		"Accept: */*\r\n\r\n"
		"Hello!";
	m38_http_request request = {
		.verb = {0},
		.resource = {0},
		.matches = {{0}},
		.full_header = NULL,
		.body_len = 0,
		.full_body = NULL
	};

	int rc = m38_parse_request(req, strlen((char *)req), &request);
	if (rc != 0)
		return 1;
	rc = m38_parse_body(strlen("Hello!"), 6, req, &request);
	if (rc != 0)
		return 1;

	if (request.full_header == NULL || request.full_body == NULL)
		return 1;
	if (strnlen(request.full_header, strlen((char *)req)) != strlen((char *)req) - 6)
		return 1;
	if (request.full_body == NULL || request.body_len <= 0)
		return 1;
	if (strcmp((char *)request.full_body, "Hello!") != 0)
		return 1;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x2c8, %rsp            # imm = 0x2C8
leaq 0x3fe5(%rip), %rsi      # 0x8da0
movq %rsp, %rbx
movl $0xd, %ecx
movq %rbx, %rdi
rep  movsq (%rsi), %es:(%rdi)
movb $0x0, 0x68(%rbx)
leaq 0x70(%rsp), %r14
movl $0x258, %edx            # imm = 0x258
movq %r14, %rdi
xorl %esi, %esi
callq 0x2160
movq %rbx, %rdi
callq 0x20e0
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x7cb8
movl $0x1, %ebx
testl %eax, %eax
jne 0x4e7b
movq %rsp, %rdx
leaq 0x70(%rsp), %rcx
movl $0x6, %edi
movl $0x6, %esi
callq 0x7dbb
testl %eax, %eax
jne 0x4e7b
movq 0x2a0(%rsp), %r15
movq 0x2b0(%rsp), %r14
testq %r15, %r15
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x4e7b
movq %rsp, %rdi
callq 0x20e0
movq %rax, %r12
movq %r15, %rdi
movq %rax, %rsi
callq 0x2170
addq $-0x6, %r12
cmpq %r12, %rax
jne 0x4e7b
cmpq $0x0, 0x2b8(%rsp)
je 0x4e7b
leaq 0x3bd3(%rip), %rsi      # 0x8a3f
movq %r14, %rdi
callq 0x21d0
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
movl %ebx, %eax
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/qpfiffer[P]38-Moths/src/utests.c
// Function: test_range_header_weird_case
int test_range_header_weird_case() {
	const unsigned char req[] = " GET / HTTP/1.1\r\n"
		"User-Agent: curl/7.35.0\r\n"
		"Host: localhost:8080\r\n"
		"Content-Length: 6\r\n"
		"Range: 0-32768\r\n" // bytes=0-32768 Limit: 32768 Offset: 0
		"Accept: */*\r\n\r\n";
	m38_http_request request = {
		.verb = {0},
		.resource = {0},
		.matches = {{0}},
		.full_header = NULL,
		.body_len = 0,
		.full_body = NULL
	};

	int rc = m38_parse_request(req, strlen((char *)req), &request);
	if (rc != 0)
		return 1;

	if (strnlen(request.full_header, strlen((char *)req)) != strlen((char *)req))
		return 1;
	if (request.full_body != NULL || request.body_len != 0)
		return 1;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x2d0, %rsp            # imm = 0x2D0
leaq 0x3f71(%rip), %rsi      # 0x8e10
movq %rsp, %rbx
movl $0xe, %ecx
movq %rbx, %rdi
rep  movsq (%rsi), %es:(%rdi)
movb $0x0, 0x72(%rbx)
movw $0xa0d, 0x70(%rbx)      # imm = 0xA0D
leaq 0x78(%rsp), %r14
movl $0x258, %edx            # imm = 0x258
movq %r14, %rdi
xorl %esi, %esi
callq 0x2160
movq %rbx, %rdi
callq 0x20e0
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x7cb8
movl $0x1, %ebx
testl %eax, %eax
jne 0x4f22
movq 0x2a8(%rsp), %r14
movq %rsp, %rdi
callq 0x20e0
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x2170
cmpq %r15, %rax
jne 0x4f22
movq 0x2c0(%rsp), %rax
xorl %ebx, %ebx
orq 0x2b8(%rsp), %rax
setne %bl
movl %ebx, %eax
addq $0x2d0, %rsp            # imm = 0x2D0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jtuu[P]quesler/src/disasm.c
// Function: main
int main(int argc, const char* argv[]) {
    for (size_t i = 1; i < (size_t) argc; i++) {
        FILE* fd = fopen(argv[i], "rb");
        if (fd == NULL) {
            fprintf(stderr, "error: failed to open input file \"%s\"\n", argv[i]);
            return 1;
        }

        QstBin bin;
        int ret = read_bin(fd, &bin);
        if (ret < 0) {
            fprintf(stderr, "error: failed to read input file \"%s\"\n", argv[i]);
        }

        fclose(fd);

        Chunk chunk;
        init_chunk(&chunk);
        bin_to_chunk(&bin, &chunk);

        disassemble_chunk(&chunk, argv[i], false);

        free_chunk(&chunk);
        free_bin(&bin);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x12a8, %rsp           # imm = 0x12A8
xorl %ebp, %ebp
cmpl $0x2, %edi
jb 0x7519
movq %rsi, %rbx
movslq %edi, %r14
decq %r14
addq $0x8, %rbx
leaq 0x58(%rsp), %r15
leaq 0x8(%rsp), %r12
xorl %ebp, %ebp
movq (%rbx), %rdi
leaq 0x2b8e(%rip), %rsi      # 0xa031
callq 0x4150
testq %rax, %rax
je 0x750c
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
callq 0x79ae
testl %eax, %eax
js 0x7502
movq %r13, %rdi
callq 0x4090
movq %r12, %rdi
callq 0x453c
movq %r15, %rdi
movq %r12, %rsi
callq 0x7de0
movq (%rbx), %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0x7154
movq %r12, %rdi
callq 0x461e
movq %r15, %rdi
callq 0x7e45
addq $0x8, %rbx
decq %r14
jne 0x7499
jmp 0x7519
movq %rbx, %rdi
callq 0x430a
jmp 0x74bf
movq %rbx, %rdi
callq 0x432e
movl $0x1, %ebp
movl %ebp, %eax
addq $0x12a8, %rsp           # imm = 0x12A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/ugobas[P]tnm/main_tnm.c
// Function: Allocate_memory
void Allocate_memory(struct Normal_Mode *NM,
		     struct Jacobian *J,
		     double ***Hessian,
		     int N_axes, int N_ref, int N_Cart,
		     int N_modes, int N_res)
{

  // Hessian
  *Hessian=Allocate_mat2_d(N_modes, N_modes);
  printf("Hessian allocated\n");

  // Kinematics:
  Allocate_Jacobian(J, N_axes, N_Cart);
  printf("Jacobian allocated\n");

  // Normal modes
  Allocate_Normal_modes(NM, N_modes, N_axes, N_Cart);
  printf("Normal modes allocated\n");

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl 0x40(%rsp), %r13d
movl %r13d, %edi
movl %r13d, %esi
callq 0x49804
movq %rax, (%r14)
leaq 0x4cda1(%rip), %rdi     # 0x55980
callq 0x2090
movq %r15, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x2321a
leaq 0x4cd9b(%rip), %rdi     # 0x55992
callq 0x2090
movq %r12, %rdi
movl %r13d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x235c4
leaq 0x4cd93(%rip), %rdi     # 0x559a5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2090