LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/lbs/dispatch_request.c
// Function: dispatch_request_append
int
dispatch_request_append(struct dispatch_state * dstate,
    struct proto_lbs_request * R)
{
	struct workctl * writer = dstate->workers[dstate->nreaders];
	uint64_t blkno;

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

	/*
	 * If the block number provided is wrong, or there's a write in
	 * progress (in which case the requestor can't possibly know what
	 * the correct next block number is), send a failure response.
	 */
	if ((R->r.append.blkno != blkno) || (dstate->writer_busy != 0)) {
		dstate->npending--;
		if (proto_lbs_response_append(dstate->writeq, R->ID, 1,
		    (uint64_t)(-1)))
			goto err1;
		goto badblkno;
	}

	/* Give the writer the work. */
	dstate->writer_busy = 1;
	if (worker_assign(writer, 1, R->r.append.blkno, R->r.append.nblks,
	    R->r.append.buf, R->ID))
		goto err1;

	/* Free the request but NOT the buffer, since the thread owns that. */
	free(R);

	/* Success! */
	return (0);

badblkno:
	/* Free request AND included buffer. */
	free(R->r.append.buf);
	free(R);

	/* Success! */
	return (0);

err1:
	/* Free request AND included buffer. */
	free(R->r.append.buf);
	free(R);

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
movq (%rax,%rcx,8), %r14
movq 0x30(%rdi), %rdi
callq 0x47dc
cmpq $-0x1, %rax
je 0x3d38
cmpq %rax, 0x18(%rbx)
jne 0x3d1e
cmpl $0x0, 0x10(%r15)
je 0x3d67
decq 0x70(%r15)
movq 0x58(%r15), %rdi
movq (%rbx), %rsi
pushq $0x1
popq %rdx
pushq $-0x1
popq %rcx
callq 0xa2e0
testl %eax, %eax
je 0x3d4e
movq 0x20(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
pushq $-0x1
popq %rax
jmp 0x3d61
movq 0x20(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movl $0x1, 0x10(%r15)
movq 0x18(%rbx), %rdx
movl 0x10(%rbx), %ecx
movq 0x20(%rbx), %r8
movq (%rbx), %r9
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x4284
testl %eax, %eax
jne 0x3d38
jmp 0x3d57
// File: /workspace/github_c_makefile_star2_O2/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 0x3db6
decq 0x70(%r14)
movq 0x58(%r14), %rdi
movq (%rbx), %rsi
callq 0xa374
testl %eax, %eax
jne 0x3de2
xorl %ebp, %ebp
jmp 0x3de5
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq 0x8(%rax,%rcx,8), %rdi
movl $0x1, 0x14(%r14)
movq (%rbx), %r9
movq 0x10(%rbx), %rdx
pushq $0x2
popq %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x4284
testl %eax, %eax
je 0x3d9e
pushq $-0x1
popq %rbp
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x42cb
movl %eax, %edi
callq 0x2520
leaq 0x844b(%rip), %rdi      # 0xc702
movq %rax, %rsi
xorl %eax, %eax
callq 0x9ec8
callq 0x20a0
andl $0x0, (%rax)
jmp 0x4334
cmpl $0x0, 0x60(%rbx)
jne 0x4369
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 0x4346
movl %eax, %edi
callq 0x2520
leaq 0x84ac(%rip), %rdi      # 0xc7c6
movq %rax, %rsi
xorl %eax, %eax
callq 0x9ec8
callq 0x20a0
andl $0x0, (%rax)
movq %rbx, %rdi
callq 0x2370
pushq $-0x1
popq %rax
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 0x4365
movl %eax, %edi
callq 0x2520
leaq 0x83e2(%rip), %rdi      # 0xc742
jmp 0x42b7
xorl %eax, %eax
jmp 0x4337
leaq 0x83eb(%rip), %rdi      # 0xc75b
leaq 0x83f6(%rip), %rsi      # 0xc76d
leaq 0x83f8(%rip), %rcx      # 0xc776
movl $0xd1, %edx
callq 0x2220
// File: /workspace/github_c_makefile_star2_O2/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 0x43b7
leaq 0x834d(%rip), %rbx      # 0xc702
jmp 0x4419
cmpl $0x0, 0x60(%r14)
je 0x444b
cmpl $0x0, 0x64(%r14)
je 0x446a
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)
andl $0x0, 0x60(%r14)
movq %r14, %rdi
callq 0x2370
testl %eax, %eax
je 0x4447
leaq 0x8329(%rip), %rbx      # 0xc742
movl %eax, %edi
callq 0x2520
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x9ec8
callq 0x20a0
andl $0x0, (%rax)
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x4438
leaq 0x838c(%rip), %rdi      # 0xc7de
leaq 0x8314(%rip), %rsi      # 0xc76d
leaq 0x8390(%rip), %rcx      # 0xc7f0
movl $0x105, %edx            # imm = 0x105
callq 0x2220
leaq 0x83d9(%rip), %rdi      # 0xc84a
leaq 0x82f5(%rip), %rsi      # 0xc76d
leaq 0x8371(%rip), %rcx      # 0xc7f0
movl $0x106, %edx            # imm = 0x106
callq 0x2220
// File: /workspace/github_c_makefile_star2_O2/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 0x44bb
movl %eax, %edi
callq 0x2520
leaq 0x825b(%rip), %rdi      # 0xc702
movq %rax, %rsi
xorl %eax, %eax
callq 0x9ec8
callq 0x20a0
andl $0x0, (%rax)
jmp 0x44fa
movl $0x1, 0x68(%rbx)
leaq 0x30(%rbx), %r14
movq %r14, %rdi
callq 0x22d0
testl %eax, %eax
je 0x4505
movl %eax, %edi
callq 0x2520
leaq 0x82e6(%rip), %rdi      # 0xc7c6
movq %rax, %rsi
xorl %eax, %eax
callq 0x9ec8
callq 0x20a0
andl $0x0, (%rax)
movq %rbx, %rdi
callq 0x2370
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x2370
testl %eax, %eax
je 0x4521
movl %eax, %edi
callq 0x2520
leaq 0x8223(%rip), %rdi      # 0xc742
jmp 0x44a7
movq 0x28(%rbx), %rdi
xorl %esi, %esi
callq 0x2500
testl %eax, %eax
je 0x4543
movl %eax, %edi
callq 0x2520
leaq 0x831f(%rip), %rdi      # 0xc85d
jmp 0x44a7
movq %r14, %rdi
callq 0x2450
testl %eax, %eax
je 0x4562
movl %eax, %edi
callq 0x2520
leaq 0x8311(%rip), %rdi      # 0xc86e
jmp 0x44a7
movq %rbx, %rdi
callq 0x21d0
testl %eax, %eax
je 0x4581
movl %eax, %edi
callq 0x2520
leaq 0x830b(%rip), %rdi      # 0xc887
jmp 0x44a7
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
jmp 0x44fd
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/lbs/storage.c
// Function: storage_read
int
storage_read(struct storage_state * S, uint64_t blkno, uint8_t * buf)
{
	struct file_state * fs;
	size_t i;
	char * s = NULL;	/* free(NULL) simplifies error path. */
	struct timespec nstime;

	/* Grab a read lock. */
	if (storage_util_readlock(S))
		goto err0;

	/* Figure out if we have this block. */
	if ((blkno < S->minblk) || (blkno >= S->nextblk))
		goto enoent2;

	/* Figure out which file to read from, and at what position. */
	for (i = 0; ; i++) {
		fs = elasticqueue_get(S->files, i);
		assert(fs != NULL);
		if (blkno < fs->start + fs->len)
			break;
	}
	assert(fs->start <= blkno);

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

	/* Read the block. */
	if ((s = storage_util_mkpath(S, fs->start)) == NULL)
		goto err0;
	if (disk_read(s, (off_t)((blkno - fs->start) * S->blocklen),
	    S->blocklen, buf)) {
		/*
		 * If errno is ENOENT, we lost a race against the deleter
		 * thread.  The block does not exist.
		 */
		if (errno == ENOENT)
			goto enoent1;

		/* Anything else is an error. */
		goto err1;
	}
	free(s);

	/* Sleep the indicated duration. */
	if (S->latency) {
		nstime.tv_sec = 0;
		nstime.tv_nsec = S->latency;
		nanosleep(&nstime, NULL);
	}

	/* Success! */
	return (1);

enoent2:
	/* Release the lock. */
	if (storage_util_unlock(S))
		goto err1;
enoent1:
	free(s);

	/* This block is not available. */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
callq 0x4f98
pushq $-0x1
popq %rbx
testl %eax, %eax
jne 0x48e6
cmpq %r12, 0x68(%r14)
ja 0x48cf
cmpq %r12, 0x70(%r14)
jbe 0x48cf
xorl %r13d, %r13d
movq 0x60(%r14), %rdi
movq %r13, %rsi
callq 0x5603
testq %rax, %rax
je 0x4921
movq %rax, %rbp
movq (%rax), %rax
movq 0x8(%rbp), %rcx
addq %rax, %rcx
incq %r13
cmpq %r12, %rcx
jbe 0x4848
cmpq %r12, %rax
ja 0x4940
movq %r14, %rdi
callq 0x5006
testl %eax, %eax
jne 0x48e6
movq (%rbp), %rsi
movq %r14, %rdi
callq 0x503d
testq %rax, %rax
je 0x48e6
movq %rax, %r13
subq (%rbp), %r12
movq 0x8(%r14), %rdx
imulq %rdx, %r12
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rcx
callq 0x519d
testl %eax, %eax
je 0x48f7
callq 0x20a0
cmpl $0x2, (%rax)
jne 0x48de
movq %r13, %rdi
callq 0x2040
xorl %ebx, %ebx
jmp 0x48e6
movq %r14, %rdi
callq 0x5006
xorl %r13d, %r13d
testl %eax, %eax
je 0x48c3
movq %r13, %rdi
callq 0x2040
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x2040
movq 0x18(%r14), %rax
pushq $0x1
popq %rbx
testq %rax, %rax
je 0x48e6
leaq 0x8(%rsp), %rdi
andq $0x0, (%rdi)
movq %rax, 0x8(%rdi)
xorl %esi, %esi
callq 0x21e0
jmp 0x48e6
leaq 0x810f(%rip), %rdi      # 0xca37
leaq 0x8008(%rip), %rsi      # 0xc937
leaq 0x810c(%rip), %rcx      # 0xca42
movl $0xe5, %edx
callq 0x2220
leaq 0x8139(%rip), %rdi      # 0xca80
leaq 0x7fe9(%rip), %rsi      # 0xc937
leaq 0x80ed(%rip), %rcx      # 0xca42
movl $0xe9, %edx
callq 0x2220
// File: /workspace/github_c_makefile_star2_O2/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 0x4fcf
testl %eax, %eax
jne 0x4c56
movq 0x60(%rbx), %rdi
callq 0x55fe
cmpq $0x2, %rax
jb 0x4c0a
movq 0x60(%rbx), %rdi
xorl %esi, %esi
callq 0x5603
movq (%rax), %r15
movq 0x8(%rax), %rax
addq %r15, %rax
cmpq %r14, %rax
ja 0x4c0a
movq 0x60(%rbx), %rdi
callq 0x5579
movq 0x60(%rbx), %rdi
xorl %esi, %esi
callq 0x5603
movq (%rax), %rax
movq %rax, 0x68(%rbx)
movq %rbx, %rdi
callq 0x5006
testl %eax, %eax
jne 0x4c56
movq %rbx, %rdi
movq %r15, %rsi
callq 0x503d
testq %rax, %rax
je 0x4c56
movq %rax, %r15
movq %rax, %rdi
callq 0x20b0
testl %eax, %eax
jne 0x4c1a
movq %r15, %rdi
callq 0x2040
movq (%rbx), %rdi
callq 0x50a4
testl %eax, %eax
je 0x4b6d
jmp 0x4c56
movq %rbx, %rdi
callq 0x5006
testl %eax, %eax
jne 0x4c56
xorl %eax, %eax
jmp 0x4c59
callq 0x20a0
cmpl $0x0, (%rax)
je 0x4c3d
movq %rax, %rbx
leaq 0x7f34(%rip), %rdi      # 0xcb62
movq %r15, %rsi
xorl %eax, %eax
callq 0x9d39
andl $0x0, (%rbx)
jmp 0x4c4e
leaq 0x7f1e(%rip), %rdi      # 0xcb62
movq %r15, %rsi
xorl %eax, %eax
callq 0x9ec8
movq %r15, %rdi
callq 0x2040
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x4c95
movl %eax, %edi
callq 0x2520
leaq 0x7eef(%rip), %rdi      # 0xcb6d
movq %rax, %rsi
xorl %eax, %eax
callq 0x9ec8
callq 0x20a0
andl $0x0, (%rax)
pushq $-0x1
popq %rax
jmp 0x4ca8
movq 0x60(%rbx), %rdi
callq 0x561f
movq %rbx, %rdi
callq 0x2040
xorl %eax, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 0x7c07(%rip), %rsi      # 0xcc55
movq %rsp, %rdi
xorl %eax, %eax
callq 0x7cb4
cmpl $-0x1, %eax
je 0x5063
movq (%rsp), %rbx
jmp 0x5096
callq 0x20a0
cmpl $0x0, (%rax)
je 0x5086
movq %rax, %r14
leaq 0x714e(%rip), %rdi      # 0xc1c5
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x9d39
andl $0x0, (%r14)
jmp 0x5096
leaq 0x7138(%rip), %rdi      # 0xc1c5
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x9ec8
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0x50f7
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x50ab
leaq 0x8384(%rip), %rdi      # 0xd456
movq %rbx, %rsi
testl %eax, %eax
jne 0x50e2
xorl %eax, %eax
callq 0x9ec8
jmp 0x50ed
xorl %eax, %eax
callq 0x9d39
andl $0x0, (%r14)
pushq $-0x1
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl %eax, %ebp
movl %ebp, %edi
callq 0x2440
testl %eax, %eax
je 0x512a
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x50f9
leaq 0x7b4a(%rip), %rdi      # 0xcc64
movq %rbx, %rsi
testl %eax, %eax
jne 0x514d
xorl %eax, %eax
callq 0x9ec8
jmp 0x5158
movl %ebp, %edi
callq 0x2240
testl %eax, %eax
je 0x5196
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x512a
leaq 0x7b23(%rip), %rdi      # 0xcc6e
jmp 0x50d2
xorl %eax, %eax
callq 0x9d39
andl $0x0, (%r14)
movl %ebp, %edi
callq 0x2240
pushq $-0x1
popq %rbx
testl %eax, %eax
je 0x50f0
cmpl $0x0, (%r14)
je 0x5183
leaq 0x82f9(%rip), %rdi      # 0xd46c
xorl %eax, %eax
callq 0x9d39
andl $0x0, (%r14)
jmp 0x50f0
leaq 0x82e2(%rip), %rdi      # 0xd46c
xorl %eax, %eax
callq 0x9ec8
jmp 0x50f0
xorl %ebx, %ebx
jmp 0x50f0
// File: /workspace/github_c_makefile_star2_O2/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 0x53b6
movl $0x4c1, %esi            # imm = 0x4C1
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x2460
jmp 0x53c2
movl $0x401, %esi            # imm = 0x401
xorl %eax, %eax
callq 0x2460
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x53f6
callq 0x20a0
movq %rax, %rbp
movl (%rax), %eax
cmpl $0x4, %eax
je 0x539b
leaq 0x8077(%rip), %rdi      # 0xd456
testl %eax, %eax
jne 0x5477
movq %rbx, %rsi
xorl %eax, %eax
callq 0x9ec8
jmp 0x5485
movl %ebp, %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x8d94
cmpq %r15, %rax
jne 0x54a8
testl %r14d, %r14d
je 0x5446
movl %ebp, %edi
callq 0x2240
testl %eax, %eax
je 0x5499
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x5411
leaq 0x783c(%rip), %rdi      # 0xcc6e
testl %eax, %eax
je 0x53e7
movq %rbx, %rsi
xorl %eax, %eax
callq 0x9d39
andl $0x0, (%r14)
jmp 0x5485
movl %ebp, %edi
callq 0x2440
testl %eax, %eax
je 0x5411
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x5446
leaq 0x77fd(%rip), %rdi      # 0xcc64
movq %rbx, %rsi
testl %eax, %eax
jne 0x549d
xorl %eax, %eax
callq 0x9ec8
jmp 0x54a8
movq %rbx, %rsi
xorl %eax, %eax
callq 0x9d39
andl $0x0, (%rbp)
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x5488
xorl %eax, %eax
callq 0x9d39
andl $0x0, (%r14)
movl %ebp, %edi
callq 0x2240
pushq $-0x1
popq %rbx
testl %eax, %eax
je 0x5488
callq 0x20a0
cmpl $0x0, (%rax)
je 0x54d7
movq %rax, %r14
leaq 0x7fa2(%rip), %rdi      # 0xd46c
xorl %eax, %eax
callq 0x9d39
andl $0x0, (%r14)
jmp 0x5488
leaq 0x7f8e(%rip), %rdi      # 0xd46c
xorl %eax, %eax
callq 0x9ec8
jmp 0x5488
nop
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x9d8, %rsp            # imm = 0x9D8
movapd 0xe6b(%rip), %xmm0      # 0x2010
movq %rsp, %r14
movapd %xmm0, (%r14)
leaq 0x14(%rsp), %rbx
movq %rbx, %rdi
callq 0x1080
pushq $0x4
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1040
leaq 0xe5f(%rip), %rdi       # 0x202e
callq 0x1050
movw $0x5, %r12w
leaq 0xe40(%rip), %r14       # 0x2020
xorl %r15d, %r15d
xorl %r13d, %r13d
movl %r15d, %eax
xorl %edx, %edx
divw %r12w
cmpl $0xfffffc18, %r13d      # imm = 0xFFFFFC18
je 0x122b
imull $-0x5, %eax, %eax
movswl %ax, %ebp
addl $-0x4, %ebp
movq %rbx, %rdi
callq 0x1060
movq %r14, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x1070
cmpw %r13w, %bp
jne 0x1223
pushq $0xa
popq %rdi
callq 0x1030
decl %r13d
incl %r15d
jmp 0x11e6
leaq 0xe1d(%rip), %rdi       # 0x204f
callq 0x1050
xorl %ebx, %ebx
movw $0x5, %r12w
leaq 0x14(%rsp), %r14
leaq 0xddc(%rip), %r15       # 0x2026
xorl %r13d, %r13d
movl %ebx, %eax
xorl %edx, %edx
divw %r12w
cmpl $0xfffffc18, %r13d      # imm = 0xFFFFFC18
je 0x129d
imull $-0x5, %eax, %eax
movswl %ax, %ebp
addl $-0x4, %ebp
movq %r14, %rdi
callq 0x1060
movl %eax, %eax
cvtsi2sd %rax, %xmm0
mulsd 0xd8a(%rip), %xmm0      # 0x2008
movq %r15, %rdi
movb $0x1, %al
callq 0x1070
cmpw %r13w, %bp
jne 0x1296
pushq $0xa
popq %rdi
callq 0x1030
decl %r13d
incl %ebx
jmp 0x124d
xorl %eax, %eax
addq $0x9d8, %rsp            # imm = 0x9D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x4f86
movq %rbx, %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x30e0
testl %eax, %eax
jne 0x4f94
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x3405d(%rip), %rax     # 0x38ff8
movq (%rax), %r14
callq 0x3080
movl (%rax), %edi
callq 0x35b0
leaq 0x27173(%rip), %rsi     # 0x2c124
leaq 0x2719d(%rip), %rdx     # 0x2c155
movq %r14, %rdi
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x3330
pushq $0x1
popq %rdi
callq 0x3530
// File: /workspace/github_c_makefile_star2_O2/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 0x26e7e(%rip), %rsi     # 0x2d1c1
callq 0x3480
testq %rax, %rax
je 0x634f
popq %rbx
retq
movq 0x32ca2(%rip), %rax     # 0x38ff8
movq (%rax), %rdi
leaq 0x26220(%rip), %rsi     # 0x2c580
leaq 0x26242(%rip), %rdx     # 0x2c5a9
movq %rbx, %rcx
xorl %eax, %eax
callq 0x3330
pushq $0x1
popq %rdi
callq 0x3530
// File: /workspace/github_c_makefile_star2_O2/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), %ecx
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
movl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
andl 0x8(%rsi), %eax
cmpl %eax, %ecx
jne 0x91df
movq 0x10(%rdi), %rdx
movq 0x10(%rsi), %rsi
xorl %eax, %eax
xorl %edi, %edi
cmpq %rdi, %rcx
je 0x91e8
movl (%rsi,%rdi,4), %r8d
leaq 0x1(%rdi), %r9
cmpl %r8d, (%rdx,%rdi,4)
movq %r9, %rdi
je 0x91c9
seta %al
movzbl %al, %eax
sbbl $0x0, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/tsoding[P]x11-double-buffering/././db_xdbe.c
// Function: db_init
void db_init(DB *db, Display *display, Window window)
{
    int major_version_return, minor_version_return;
    if(XdbeQueryExtension(display, &major_version_return, &minor_version_return)) {
        printf("XDBE version %d.%d\n", major_version_return, minor_version_return);
    } else {
        fprintf(stderr, "XDBE is not supported!!!1\n");
        exit(1);
    }

    db->display = display;
    db->window = window;
    db->gc = XCreateGC(display, window, 0, NULL);
    db->back_buffer = XdbeAllocateBackBufferName(display, window, 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r15, %rdi
callq 0x1080
testl %eax, %eax
je 0x131f
movl 0xc(%rsp), %esi
movl 0x8(%rsp), %edx
leaq 0xd3d(%rip), %rdi       # 0x2020
xorl %eax, %eax
callq 0x1070
movq %r15, (%rbx)
movq %r14, 0x8(%rbx)
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1120
movq %rax, 0x10(%rbx)
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x10b0
movq %rax, 0x18(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x2cd2(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xd04(%rip), %rdi       # 0x2034
pushq $0x1a
popq %rsi
pushq $0x1
popq %rdx
callq 0x1180
pushq $0x1
popq %rdi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O2/tsoding[P]x11-double-buffering/././db_xdbe.c
// Function: db_swap_buffers
void db_swap_buffers(DB *db)
{
    XdbeSwapInfo swap_info;
    swap_info.swap_window = db->window;
    swap_info.swap_action = 0;
    XdbeSwapBuffers(db->display, &swap_info, 1);
}

// Assembly:
subq $0x18, %rsp
movq 0x8(%rdi), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movb $0x0, 0x8(%rsi)
movq (%rdi), %rdi
pushq $0x1
popq %rdx
callq 0x10d0
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/joltikneq80112v13/ref/joltik.c
// Function: set_block_number_in_tweak
static void set_block_number_in_tweak(uint8_t *tweak, const uint64_t block_no) {
    tweak[ 7] = (tweak[7]&0xf0) ^ ((block_no >> 48ULL) & 0xf);
    tweak[ 8] = ((block_no >> 40ULL) & 0xff);
    tweak[ 9] = ((block_no >> 32ULL) & 0xff);
    tweak[10] = ((block_no >> 24ULL) & 0xff);
    tweak[11] = ((block_no >> 16ULL) & 0xff);
    tweak[12] = ((block_no >>  8ULL) & 0xff);
    tweak[13] = ((block_no >>  0ULL) & 0xff);
}

// Assembly:
movq %rsi, %rax
movb 0x7(%rdi), %cl
andb $-0x10, %cl
movq %rsi, %rdx
shrq $0x30, %rdx
andb $0xf, %dl
orb %cl, %dl
movb %dl, 0x7(%rdi)
vpbroadcastq %rsi, %ymm0
vpsrlvq 0x19c8(%rip), %ymm0, %ymm0 # 0x3000
vpmovqb %ymm0, 0x8(%rdi)
movb %ah, 0xc(%rdi)
movb %al, 0xd(%rdi)
vzeroupper
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
pushq $0x8
popq %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x2fc8
movq %rax, %rbx
xorl %eax, %eax
leaq 0x8(%rsp), %r15
movq %rax, 0x8(%rsp)
cmpq $0x2710, %rax           # imm = 0x2710
jae 0x454b
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x300e
movq 0x8(%rsp), %rax
incq %rax
jmp 0x4526
xorl %esi, %esi
xorl %r14d, %r14d
movq %rsi, 0x8(%rsp)
cmpq 0x10(%rbx), %rsi
jae 0x4570
movq %rbx, %rdi
callq 0x3118
addq (%rax), %r14
movq 0x8(%rsp), %rsi
incq %rsi
jmp 0x4550
movq %rbx, %rdi
callq 0x323f
xorl %eax, %eax
cmpq $0x2fadcf8, %r14        # imm = 0x2FADCF8
setne %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x80, %rsp
pushq $0x8
popq %rdi
pushq $0x2
popq %rsi
callq 0x2fc8
movq %rax, %rbx
leaq 0x442e(%rip), %r14      # 0x89e0
movq %rsp, %r15
xorl %ebp, %ebp
cmpl $0x64, %ebp
je 0x4616
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 0x30b3
incl %ebp
jmp 0x45b7
leaq 0x43c3(%rip), %r14      # 0x89e0
movq %rsp, %r15
xorl %ebp, %ebp
movl %ebp, %eax
cmpq %rax, 0x10(%rbx)
jbe 0x4695
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
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3118
movq (%rax), %r12
movl $0x80, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2080
testl %eax, %eax
jne 0x46af
movq %r12, %rdi
callq 0x2030
incl %ebp
jmp 0x4622
movq %rbx, %rdi
callq 0x323f
xorl %eax, %eax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x432d(%rip), %rdi      # 0x89e3
leaq 0x434b(%rip), %rsi      # 0x8a08
leaq 0x4351(%rip), %rcx      # 0x8a15
pushq $0x45
popq %rdx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $0x8
popq %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x2fc8
movq %rax, %rbx
xorl %eax, %eax
movq %rsp, %r15
movq %rax, (%rsp)
movq %rbx, %rdi
cmpq $0x1869e, %rax          # imm = 0x1869E
ja 0x470d
movq %r15, %rsi
movq %r14, %rdx
callq 0x300e
movq (%rsp), %rax
incq %rax
jmp 0x46ea
callq 0x3131
pushq $0x1
popq %rbp
testl %eax, %eax
je 0x473f
movq (%rsp), %rsi
decq %rsi
movq %rsi, (%rsp)
cmpq 0x10(%rbx), %rsi
jb 0x473d
movq %rbx, %rdi
callq 0x3118
movq (%rsp), %rsi
cmpq (%rax), %rsi
je 0x471d
jmp 0x473f
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x4451(%rip), %rsi      # 0x8bb0
pushq $0x63
popq %rcx
movq %rsp, %rbx
movq %rbx, %rdi
rep  movsb (%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 0x7541
pushq $0x1
popq %rbx
testl %eax, %eax
jne 0x47d3
movq 0x298(%rsp), %r14
movq %rsp, %rdi
callq 0x20e0
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x2170
cmpq %r15, %rax
jne 0x47d3
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_O2/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 0x442b(%rip), %rsi      # 0x8c20
pushq $0xc
popq %rcx
movq %rsp, %rbx
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 0x7541
pushq $0x1
popq %rbx
testl %eax, %eax
jne 0x4889
pushq $0x10
popq %rdi
movq %rsp, %rdx
leaq 0x68(%rsp), %rcx
movq %rdi, %rsi
callq 0x7638
testl %eax, %eax
jne 0x4889
movq 0x298(%rsp), %r14
movq %rsp, %rdi
callq 0x20e0
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x2170
cmpq %r15, %rax
je 0x4889
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_O2/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 0x43d7(%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 0x7541
pushq $0x1
popq %rbx
testl %eax, %eax
jne 0x491c
pushq $0xb
popq %rdi
leaq 0x10(%rsp), %rdx
leaq 0xb0(%rsp), %rcx
movq %rdi, %rsi
callq 0x7638
testl %eax, %eax
jne 0x491c
leaq 0xb0(%rsp), %rdi
callq 0x76d9
testl %eax, %eax
je 0x4929
movl %ebx, %eax
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r14
retq
movq 0x300(%rsp), %rdi
testq %rdi, %rdi
je 0x491c
leaq 0x8(%rsp), %rcx
andq $0x0, (%rcx)
andq $0x0, (%rsp)
leaq 0x40e7(%rip), %rsi      # 0x8a32
pushq $0x4
popq %rdx
callq 0x2ae9
pushq $0x1
popq %rbx
testq %rax, %rax
je 0x491c
movq 0x8(%rsp), %rdx
leaq 0x4ae7(%rip), %rsi      # 0x944e
movq %rax, %rdi
callq 0x2080
testl %eax, %eax
jne 0x491c
movq 0x300(%rsp), %rdi
leaq 0x40b5(%rip), %rsi      # 0x8a37
pushq $0x2
popq %rdx
movq %rsp, %rcx
callq 0x2ae9
testq %rax, %rax
je 0x491c
movq (%rsp), %rdx
leaq 0x409d(%rip), %rsi      # 0x8a3a
movq %rax, %rdi
callq 0x2080
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x491c
// File: /workspace/github_c_makefile_star2_O2/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 0x435e(%rip), %rsi      # 0x8d20
pushq $0x74
popq %rcx
movq %rsp, %rbx
movq %rbx, %rdi
rep  movsb (%rsi), %es:(%rdi)
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 0x7541
pushq $0x1
popq %rbx
testl %eax, %eax
jne 0x4a48
pushq $0x10
popq %rdi
movq %rsp, %rdx
leaq 0x80(%rsp), %rcx
movq %rdi, %rsi
callq 0x7638
testl %eax, %eax
jne 0x4a48
movq 0x2c0(%rsp), %r14
movq %r14, %rdi
callq 0x20e0
cmpq $0x10, %rax
jne 0x4a48
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_O2/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 0x4336(%rip), %rsi      # 0x8da0
pushq $0x69
popq %rcx
movq %rsp, %rbx
movq %rbx, %rdi
rep  movsb (%rsi), %es:(%rdi)
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 0x7541
pushq $0x1
popq %rbx
testl %eax, %eax
jne 0x4b1d
pushq $0x6
popq %rdi
movq %rsp, %rdx
leaq 0x70(%rsp), %rcx
movq %rdi, %rsi
callq 0x7638
testl %eax, %eax
jne 0x4b1d
movq 0x2a0(%rsp), %r15
movq 0x2b0(%rsp), %r14
testq %r15, %r15
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x4b1d
movq %rsp, %rdi
callq 0x20e0
movq %rax, %r12
movq %r15, %rdi
movq %rax, %rsi
callq 0x2170
addq $-0x6, %r12
cmpq %r12, %rax
jne 0x4b1d
cmpq $0x0, 0x2b8(%rsp)
je 0x4b1d
leaq 0x3f31(%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_O2/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 0x42cf(%rip), %rsi      # 0x8e10
pushq $0x73
popq %rcx
movq %rsp, %rbx
movq %rbx, %rdi
rep  movsb (%rsi), %es:(%rdi)
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 0x7541
pushq $0x1
popq %rbx
testl %eax, %eax
jne 0x4bb5
movq 0x2a8(%rsp), %r14
movq %rsp, %rdi
callq 0x20e0
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x2170
cmpq %r15, %rax
jne 0x4bb5
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_O2/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
movq %rsi, %rbx
movslq %edi, %r14
pushq $0x1
popq %rbp
leaq 0x58(%rsp), %r15
leaq 0x8(%rsp), %r13
cmpq %r14, %rbp
jae 0x6230
movq (%rbx,%rbp,8), %rdi
leaq 0x1e7d(%rip), %rsi      # 0x8031
callq 0x4150
testq %rax, %rax
je 0x6244
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x6696
testl %eax, %eax
js 0x6212
movq %r12, %rdi
callq 0x4090
movq %r13, %rdi
callq 0x427c
movq %r15, %rdi
movq %r13, %rsi
callq 0x6a87
movq (%rbx,%rbp,8), %rsi
movq %r13, %rdi
xorl %edx, %edx
callq 0x5ed4
movq %r13, %rdi
callq 0x433b
movq %r15, %rdi
callq 0x6aec
incq %rbp
jmp 0x61a0
movq 0xeddf(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
movq (%rbx,%rbp,8), %rdx
leaq 0x24d5(%rip), %rsi      # 0x86fc
xorl %eax, %eax
callq 0x40f0
jmp 0x61d4
xorl %eax, %eax
addq $0x12a8, %rsp           # imm = 0x12A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xedad(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
movq (%rbx,%rbp,8), %rdx
leaq 0x247c(%rip), %rsi      # 0x86d5
xorl %eax, %eax
callq 0x40f0
pushq $0x1
popq %rax
jmp 0x6232
nopl (%rax)