LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/check.c
// Function: jfsck_cleanup
static int jfsck_cleanup(const char *name, const char *jdir)
{
	char tfile[PATH_MAX*3];
	DIR *dir;
	struct dirent *dent;

	dir = opendir(jdir);
	if (dir == NULL && errno == ENOENT)
		/* it doesn't exist, so it's clean */
		return 0;
	else if (dir == NULL)
		return -1;

	for (errno = 0, dent = readdir(dir); dent != NULL;
			errno = 0, dent = readdir(dir)) {
		/* We only care about files we know, and ignore everything
		 * else. Note that transactions should have been removed by
		 * jfsck(), we will not do it to prevent accidental misuse */
		if (strcmp(dent->d_name, "lock"))
			continue;

		/* build the full path to the transaction file */
		memset(tfile, 0, PATH_MAX * 3);
		strcat(tfile, jdir);
		strcat(tfile, "/");
		strcat(tfile, dent->d_name);

		if (strlen(tfile) > PATH_MAX) {
			closedir(dir);
			return -1;
		}

		if (unlink(tfile) != 0) {
			closedir(dir);
			return -1;
		}
	}

	if (errno) {
		closedir(dir);
		return -1;
	}

	if (closedir(dir) != 0)
		return -1;

	if (rmdir(jdir) != 0)
		return -1;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3008, %rsp           # imm = 0x3008
movq %rdi, %rbx
callq 0x2120
movq %rax, %r14
callq 0x2070
movq %rax, %r15
testq %r14, %r14
je 0x3ef3
movl $0x0, (%r15)
movq %r14, %rdi
callq 0x2350
testq %rax, %rax
je 0x3ecb
movq %rax, %rbp
leaq 0x15e4(%rip), %r12      # 0x5433
movq %rsp, %r13
addq $0x13, %rbp
movq %rbp, %rdi
movq %r12, %rsi
callq 0x2290
testl %eax, %eax
jne 0x3eb4
movl $0x3000, %edx           # imm = 0x3000
movq %r13, %rdi
xorl %esi, %esi
callq 0x2200
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2510
movq %r13, %rdi
callq 0x2140
movw $0x2f, (%rsp,%rax)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2510
movq %r13, %rdi
callq 0x2140
cmpq $0x1001, %rax           # imm = 0x1001
jae 0x3f00
movq %r13, %rdi
callq 0x2090
testl %eax, %eax
jne 0x3f00
movl $0x0, (%r15)
movq %r14, %rdi
callq 0x2350
movq %rax, %rbp
testq %rax, %rax
jne 0x3e52
movl (%r15), %ebp
movq %r14, %rdi
callq 0x2240
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
orl %ebp, %ecx
jne 0x3f0d
movq %rbx, %rdi
callq 0x2130
movl %eax, %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
jmp 0x3f0d
xorl %eax, %eax
cmpl $0x2, (%r15)
setne %al
negl %eax
jmp 0x3f0d
movq %r14, %rdi
callq 0x2240
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x3008, %rsp           # imm = 0x3008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/journal.c
// Function: free_tid
static void free_tid(struct jfs *fs, unsigned int tid)
{
	unsigned int curid, i;
	char name[PATH_MAX];

	/* lock the whole file */
	plockf(fs->jfd, F_LOCKW, 0, 0);

	/* read the current max. curid */
	curid = *(fs->jmap);

	/* if we're the max tid, scan the directory looking up for the new
	 * max; the detailed description can be found in the "doc/" dir */
	if (tid == curid) {
		/* look up the new max. */
		for (i = curid - 1; i > 0; i--) {
			get_jtfile(fs, i, name);
			if (access(name, R_OK | W_OK) == 0) {
				break;
			} else if (errno != EACCES) {
				/* Real error, stop looking for a new max. It
				 * doesn't hurt us because it's ok if the max
				 * is higher than it could be */
				break;
			}
		}

		/* and save it */
		*(fs->jmap) = i;
	}

	plockf(fs->jfd, F_UNLOCK, 0, 0);
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movl %esi, %ebp
movq %rdi, %rbx
movl 0x1c(%rdi), %edi
movl $0x110, %esi            # imm = 0x110
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2480
movq 0x20(%rbx), %rax
movl (%rax), %r15d
cmpl %ebp, %r15d
jne 0x4148
leal -0x1(%r15), %r12d
movq %rsp, %r14
movl %r12d, %ebp
subl $0x1, %r12d
jb 0x413b
decl %r15d
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x22c0
movq %r14, %rdi
movl $0x6, %esi
callq 0x24c0
testl %eax, %eax
je 0x413f
callq 0x2070
cmpl $0xd, (%rax)
je 0x4105
jmp 0x4142
xorl %ebp, %ebp
jmp 0x4142
movl %r15d, %ebp
movq 0x20(%rbx), %rax
movl %ebp, (%rax)
movl 0x1c(%rbx), %edi
movl $0x10000, %esi          # imm = 0x10000
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2480
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/journal.c
// Function: journal_add_op
int journal_add_op(struct journal_op *jop, unsigned char *buf, size_t len,
		off_t offset)
{
	ssize_t rv;
	struct on_disk_ophdr ophdr;
	struct iovec iov[2];

	ophdr.len = len;
	ophdr.offset = offset;
	ophdr_hton(&ophdr);

	iov[0].iov_base = (void *) &ophdr;
	iov[0].iov_len = sizeof(ophdr);
	jop->csum = checksum_buf(jop->csum, (unsigned char *) &ophdr,
			sizeof(ophdr));

	iov[1].iov_base = (void *) buf;
	iov[1].iov_len = len;
	jop->csum = checksum_buf(jop->csum, buf, len);

	fiu_exit_on("jio/commit/tf_pre_addop");

	rv = swritev(jop->fd, iov, 2);
	if (rv != sizeof(ophdr) + len)
		goto error;

	fiu_exit_on("jio/commit/tf_addop");

	jop->numops++;

	return 0;

error:
	return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x4(%rsp), %r12
movq %rcx, 0x4(%r12)
movl %r14d, %eax
bswapl %eax
movl %eax, (%r12)
movq %rcx, %rdi
callq 0x25a0
movq %rax, 0x4(%r12)
leaq 0x10(%rsp), %r13
movq %r12, (%r13)
movq $0xc, 0x8(%r13)
movl 0x18(%rbx), %edi
movl $0xc, %edx
movq %r12, %rsi
callq 0x2230
movl %eax, 0x18(%rbx)
movq %r15, 0x10(%r13)
movq %r14, 0x18(%r13)
movl %eax, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2230
movl %eax, 0x18(%rbx)
movl 0x4(%rbx), %edi
movq %r13, %rsi
movl $0x2, %edx
callq 0x2420
movq %rax, %rcx
addq $0xc, %r14
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %r14, %rcx
jne 0x4201
incl 0x8(%rbx)
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/journal.c
// Function: journal_commit
int journal_commit(struct journal_op *jop)
{
	ssize_t rv;
	struct on_disk_ophdr ophdr;
	struct on_disk_trailer trailer;
	struct iovec iov[2];

	/* write the empty ophdr to mark there are no more operations, and
	 * then the trailer */
	ophdr.len = 0;
	ophdr.offset = 0;
	ophdr_hton(&ophdr);
	iov[0].iov_base = (void *) &ophdr;
	iov[0].iov_len = sizeof(ophdr);
	jop->csum = checksum_buf(jop->csum, (unsigned char *) &ophdr,
			sizeof(ophdr));

	trailer.checksum = jop->csum;
	trailer.numops = jop->numops;
	trailer_hton(&trailer);
	iov[1].iov_base = (void *) &trailer;
	iov[1].iov_len = sizeof(trailer);

	rv = swritev(jop->fd, iov, 2);
	if (rv != sizeof(ophdr) + sizeof(trailer))
		goto error;

	/* this is a simple but efficient optimization: instead of doing
	 * everything O_SYNC, we sync at this point only, this way we avoid
	 * doing a lot of very small writes; in case of a crash the
	 * transaction file is only useful if it's complete (ie. after this
	 * point) so we only flush here (both data and metadata) */
	if (fsync(jop->fd) != 0)
		goto error;
	if (fsync_dir(jop->fs->jdirfd) != 0)
		goto error;

	fiu_exit_on("jio/commit/tf_sync");

	return 0;

error:
	return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x14(%rsp), %r14
movl $0x0, (%r14)
movq $0x0, 0x4(%r14)
xorl %edi, %edi
callq 0x25a0
movq %rax, 0x4(%r14)
leaq 0x20(%rsp), %r15
movq %r14, (%r15)
movq $0xc, 0x8(%r15)
movl 0x18(%rbx), %edi
movl $0xc, %edx
movq %r14, %rsi
callq 0x2230
movl %eax, 0x18(%rbx)
leaq 0xc(%rsp), %rcx
movl %eax, 0x4(%rcx)
movl 0x8(%rbx), %edx
bswapl %edx
movl %edx, (%rcx)
bswapl %eax
movl %eax, 0x4(%rcx)
movq %rcx, 0x10(%r15)
movq $0x8, 0x18(%r15)
movl 0x4(%rbx), %edi
movq %r15, %rsi
movl $0x2, %edx
callq 0x2420
cmpq $0x14, %rax
jne 0x42bb
movl 0x4(%rbx), %edi
callq 0x2430
testl %eax, %eax
jne 0x42bb
movq 0x20(%rbx), %rax
movl 0x18(%rax), %edi
callq 0x42ce
testl %eax, %eax
je 0x42ca
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0x42c0
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/journal.c
// Function: journal_free
int journal_free(struct journal_op *jop, int do_unlink)
{
	int rv;

	if (!do_unlink) {
		rv = 0;
		goto exit;
	}

	rv = -1;

	if (unlink(jop->name)) {
		/* we do not want to leave a possibly complete transaction
		 * file around when the transaction was not commited and the
		 * unlink failed, so we attempt to truncate it, and if that
		 * fails we corrupt it as a last resort. */
		if (ftruncate(jop->fd, 0) != 0) {
			if (corrupt_journal_file(jop) != 0) {
				mark_broken(jop->fs);
				goto exit;
			}
		}
	}

	if (fsync_dir(jop->fs->jdirfd) != 0) {
		mark_broken(jop->fs);
		goto exit;
	}

	fiu_exit_on("jio/commit/pre_ok_free_tid");
	free_tid(jop->fs, jop->id);

	rv = 0;

exit:
	close(jop->fd);

	free(jop->name);
	free(jop);

	return rv;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %ebp, %ebp
testl %esi, %esi
je 0x43a6
movq 0x10(%rbx), %rdi
callq 0x2090
testl %eax, %eax
je 0x437f
movl 0x4(%rbx), %edi
xorl %esi, %esi
callq 0x21d0
testl %eax, %eax
je 0x437f
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, (%rsp)
movl 0x4(%rbx), %edi
xorl %esi, %esi
movl $0x2, %edx
callq 0x21f0
cmpq $-0x1, %rax
je 0x4379
movl 0x4(%rbx), %edi
movq %rsp, %rsi
movl $0x8, %edx
movq %rax, %rcx
callq 0x23f0
cmpq $0x8, %rax
jne 0x4379
movl 0x4(%rbx), %edi
callq 0x2080
testl %eax, %eax
je 0x437f
movq 0x20(%rbx), %rdi
jmp 0x4393
movq 0x20(%rbx), %rax
movl 0x18(%rax), %edi
callq 0x42ce
movq 0x20(%rbx), %rdi
testl %eax, %eax
je 0x439f
callq 0x43c8
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x43a6
movl (%rbx), %esi
callq 0x40cd
movl 0x4(%rbx), %edi
callq 0x2220
movq 0x10(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/journal.c
// Function: mark_broken
static int mark_broken(struct jfs *fs)
{
	char broken_path[PATH_MAX];
	int fd;

	snprintf(broken_path, PATH_MAX, "%s/broken", fs->jdir);
	fd = creat(broken_path, 0600);
	close(fd);

	return fd >= 0;
}

// Assembly:
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq 0x10(%rdi), %rcx
leaq 0x1063(%rip), %rdx      # 0x543e
movq %rsp, %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21b0
movq %rbx, %rdi
movl $0x180, %esi            # imm = 0x180
callq 0x2520
movl %eax, %edi
callq 0x2220
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/unix.c
// Function: jread
ssize_t jread(struct jfs *fs, void *buf, size_t count)
{
	ssize_t rv;
	off_t pos;

	pthread_mutex_lock(&(fs->lock));

	pos = lseek(fs->fd, 0, SEEK_CUR);

	plockf(fs->fd, F_LOCKR, pos, count);
	rv = spread(fs->fd, buf, count, pos);
	plockf(fs->fd, F_UNLOCK, pos, count);

	if (rv > 0)
		lseek(fs->fd, rv, SEEK_CUR);

	pthread_mutex_unlock(&(fs->lock));

	return rv;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
leaq 0x68(%rdi), %rbx
movq %rbx, %rdi
callq 0x2590
movl (%r14), %edi
xorl %esi, %esi
movl $0x1, %edx
callq 0x21f0
movq %rax, %r13
movl (%r14), %edi
movl $0x101, %esi            # imm = 0x101
movq %rax, %rdx
movq %r15, %rcx
callq 0x2480
movl (%r14), %edi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x22d0
movq %rax, %r12
movl (%r14), %edi
movl $0x10000, %esi          # imm = 0x10000
movq %r13, %rdx
movq %r15, %rcx
callq 0x2480
testq %r12, %r12
jle 0x4623
movl (%r14), %edi
movq %r12, %rsi
movl $0x1, %edx
callq 0x21f0
movq %rbx, %rdi
callq 0x2370
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/unix.c
// Function: jpread
ssize_t jpread(struct jfs *fs, void *buf, size_t count, off_t offset)
{
	ssize_t rv;

	plockf(fs->fd, F_LOCKR, offset, count);
	rv = spread(fs->fd, buf, count, offset);
	plockf(fs->fd, F_UNLOCK, offset, count);

	return rv;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl (%rdi), %edi
movl $0x101, %esi            # imm = 0x101
movq %rcx, %rdx
movq %r14, %rcx
callq 0x2480
movl (%r12), %edi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x22d0
movq %rax, %r15
movl (%r12), %edi
movl $0x10000, %esi          # imm = 0x10000
movq %rbx, %rdx
movq %r14, %rcx
callq 0x2480
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/unix.c
// Function: jreadv
ssize_t jreadv(struct jfs *fs, const struct iovec *vector, int count)
{
	ssize_t rv;
	off_t pos;

	pthread_mutex_lock(&(fs->lock));
	pos = lseek(fs->fd, 0, SEEK_CUR);
	if (pos < 0)
		return -1;

	plockf(fs->fd, F_LOCKR, pos, count);
	rv = readv(fs->fd, vector, count);
	plockf(fs->fd, F_UNLOCK, pos, count);

	pthread_mutex_unlock(&(fs->lock));

	return rv;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x68(%rdi), %rbx
movq %rbx, %rdi
callq 0x2590
movl (%r14), %edi
xorl %esi, %esi
movl $0x1, %edx
callq 0x21f0
testq %rax, %rax
js 0x4713
movq %rax, %r12
movl (%r14), %edi
movslq %ebp, %r13
movl $0x101, %esi            # imm = 0x101
movq %rax, %rdx
movq %r13, %rcx
callq 0x2480
movl (%r14), %edi
movq %r15, %rsi
movl %r13d, %edx
callq 0x2400
movq %rax, %r15
movl (%r14), %edi
movl $0x10000, %esi          # imm = 0x10000
movq %r12, %rdx
movq %r13, %rcx
callq 0x2480
movq %rbx, %rdi
callq 0x2370
movq %r15, %rax
jmp 0x471a
movq $-0x1, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/unix.c
// Function: jwrite
ssize_t jwrite(struct jfs *fs, const void *buf, size_t count)
{
	ssize_t rv;
	off_t pos;
	struct jtrans *ts;

	ts = jtrans_new(fs, 0);
	if (ts == NULL)
		return -1;

	pthread_mutex_lock(&(fs->lock));

	if (fs->open_flags & O_APPEND)
		pos = lseek(fs->fd, 0, SEEK_END);
	else
		pos = lseek(fs->fd, 0, SEEK_CUR);

	rv = jtrans_add_w(ts, buf, count, pos);
	if (rv < 0)
		goto exit;

	rv = jtrans_commit(ts);

	if (rv >= 0)
		lseek(fs->fd, count, SEEK_CUR);

exit:

	pthread_mutex_unlock(&(fs->lock));

	jtrans_free(ts);

	return (rv >= 0) ? count : rv;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r12
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x20d0
testq %rax, %rax
je 0x47aa
movq %rax, %r14
leaq 0x68(%r12), %r15
movq %r15, %rdi
callq 0x2590
btl $0xa, 0x2c(%r12)
movl (%r12), %edi
adcl $0x1, %ebp
xorl %esi, %esi
movl %ebp, %edx
callq 0x21f0
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x2300
testl %eax, %eax
js 0x47b3
movq %r14, %rdi
callq 0x24d0
movq %rax, %r13
testq %rax, %rax
js 0x47b6
movl (%r12), %edi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x21f0
jmp 0x47b6
movq $-0x1, %rbx
jmp 0x47cd
movslq %eax, %r13
movq %r15, %rdi
callq 0x2370
movq %r14, %rdi
callq 0x2170
testq %r13, %r13
cmovsq %r13, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/unix.c
// Function: jpwrite
ssize_t jpwrite(struct jfs *fs, const void *buf, size_t count, off_t offset)
{
	ssize_t rv;
	struct jtrans *ts;

	ts = jtrans_new(fs, 0);
	if (ts == NULL)
		return -1;

	rv = jtrans_add_w(ts, buf, count, offset);
	if (rv < 0)
		goto exit;

	rv = jtrans_commit(ts);

exit:
	jtrans_free(ts);

	return (rv >= 0) ? count : rv;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r12
xorl %esi, %esi
callq 0x20d0
testq %rax, %rax
je 0x4821
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x2300
testl %eax, %eax
js 0x482a
movq %r14, %rdi
callq 0x24d0
movq %rax, %r15
jmp 0x482d
movq $-0x1, %rbx
jmp 0x483c
movslq %eax, %r15
movq %r14, %rdi
callq 0x2170
testq %r15, %r15
cmovsq %r15, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/unix.c
// Function: jwritev
ssize_t jwritev(struct jfs *fs, const struct iovec *vector, int count)
{
	int i;
	size_t sum;
	ssize_t rv;
	off_t ipos, t;
	struct jtrans *ts;

	ts = jtrans_new(fs, 0);
	if (ts == NULL)
		return -1;

	pthread_mutex_lock(&(fs->lock));

	if (fs->open_flags & O_APPEND)
		ipos = lseek(fs->fd, 0, SEEK_END);
	else
		ipos = lseek(fs->fd, 0, SEEK_CUR);

	t = ipos;

	sum = 0;
	for (i = 0; i < count; i++) {
		rv = jtrans_add_w(ts, vector[i].iov_base,
				vector[i].iov_len, t);
		if (rv < 0)
			goto exit;

		sum += vector[i].iov_len;
		t += vector[i].iov_len;
	}

	rv = jtrans_commit(ts);

	if (rv >= 0)
		lseek(fs->fd, sum, SEEK_CUR);

exit:
	pthread_mutex_unlock(&(fs->lock));

	jtrans_free(ts);

	return (rv >= 0) ? sum : rv;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r15d
movq %rsi, %r13
movq %rdi, %r12
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x20d0
testq %rax, %rax
je 0x490c
movq %rax, %r14
leaq 0x68(%r12), %rdi
movq %rdi, 0x10(%rsp)
callq 0x2590
btl $0xa, 0x2c(%r12)
movq %r12, 0x8(%rsp)
movl (%r12), %edi
movl $0x0, %edx
adcl $0x1, %edx
xorl %esi, %esi
callq 0x21f0
testl %r15d, %r15d
jle 0x48e6
movq %rax, %rbp
movl %r15d, %r15d
shlq $0x4, %r15
xorl %r12d, %r12d
xorl %ebx, %ebx
movq (%r13,%r12), %rsi
movq 0x8(%r13,%r12), %rdx
movq %r14, %rdi
movq %rbp, %rcx
callq 0x2300
testl %eax, %eax
js 0x4915
movq 0x8(%r13,%r12), %rax
addq %rax, %rbx
addq %rax, %rbp
addq $0x10, %r12
cmpq %r12, %r15
jne 0x48b9
movq %r14, %rdi
callq 0x24d0
movq %rax, %r15
testq %rax, %rax
js 0x4918
movq 0x8(%rsp), %rax
movl (%rax), %edi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x21f0
jmp 0x4918
movq $-0x1, %rbx
jmp 0x4931
movslq %eax, %r15
movq 0x10(%rsp), %rdi
callq 0x2370
movq %r14, %rdi
callq 0x2170
testq %r15, %r15
cmovsq %r15, %rbx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/unix.c
// Function: jtruncate
int jtruncate(struct jfs *fs, off_t length)
{
	int rv;

	/* lock from length to the end of file */
	plockf(fs->fd, F_LOCKW, length, 0);
	rv = ftruncate(fs->fd, length);
	plockf(fs->fd, F_UNLOCK, length, 0);

	return rv;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %edi
movl $0x110, %esi            # imm = 0x110
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x2480
movl (%r14), %edi
movq %rbx, %rsi
callq 0x21d0
movl %eax, %ebp
movl (%r14), %edi
movl $0x10000, %esi          # imm = 0x10000
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x2480
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/unix.c
// Function: jlseek
off_t jlseek(struct jfs *fs, off_t offset, int whence)
{
	off_t rv;

	pthread_mutex_lock(&(fs->lock));
	rv = lseek(fs->fd, offset, whence);
	pthread_mutex_unlock(&(fs->lock));

	return rv;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x68(%rdi), %r12
movq %r12, %rdi
callq 0x2590
movl (%r15), %edi
movq %r14, %rsi
movl %ebx, %edx
callq 0x21f0
movq %rax, %rbx
movq %r12, %rdi
callq 0x2370
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/ansi.c
// Function: jfopen
struct jfs *jfopen(const char *path, const char *mode)
{
	int flags;
	int pos_at_the_beginning;
	struct jfs *fs;

	if (strlen(mode) < 1)
		return NULL;

	if (mode[0] == 'r') {
		pos_at_the_beginning = 1;
		if (strlen(mode) > 1 && strchr(mode, '+'))
			flags = O_RDWR;
		else
			flags = O_RDONLY;
	} else if (mode[0] == 'a') {
		if (strlen(mode) > 1 && strchr(mode, '+'))
			pos_at_the_beginning = 1;
		else
			pos_at_the_beginning = 0;
		flags = O_RDWR | O_CREAT | O_APPEND;
	} else if (mode[0] == 'w') {
		pos_at_the_beginning = 1;
		flags = O_RDWR | O_CREAT | O_TRUNC;
	} else {
		return NULL;
	}

	fs = jopen(path, flags, 0666, 0);
	if (fs == NULL)
		return NULL;

	if (pos_at_the_beginning)
		lseek(fs->fd, 0, SEEK_SET);
	else
		lseek(fs->fd, 0, SEEK_END);

	return fs;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2140
xorl %ebx, %ebx
testq %rax, %rax
je 0x4a73
movzbl (%r15), %ecx
cmpl $0x61, %ecx
je 0x4a23
cmpl $0x77, %ecx
je 0x4a1c
cmpl $0x72, %ecx
jne 0x4a73
cmpq $0x1, %rax
je 0x4a16
movq %r15, %rdi
movl $0x2b, %esi
callq 0x2180
movl $0x2, %esi
testq %rax, %rax
jne 0x4a4a
xorl %esi, %esi
xorl %ebx, %ebx
jmp 0x4a4a
movl $0x242, %esi            # imm = 0x242
jmp 0x4a4a
cmpq $0x1, %rax
je 0x4a40
movq %r15, %rdi
movl $0x2b, %esi
callq 0x2180
movl $0x442, %esi            # imm = 0x442
testq %rax, %rax
jne 0x4a4a
movl $0x2, %ebx
movl $0x442, %esi            # imm = 0x442
movq %r14, %rdi
movl $0x1b6, %edx            # imm = 0x1B6
xorl %ecx, %ecx
callq 0x22b0
testq %rax, %rax
je 0x4a71
movq %rax, %r14
movl (%rax), %edi
xorl %esi, %esi
movl %ebx, %edx
callq 0x21f0
movq %r14, %rbx
jmp 0x4a73
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/ansi.c
// Function: jfreopen
struct jfs *jfreopen(const char *path, const char *mode, struct jfs *stream)
{
	if (stream)
		jfclose(stream);

	stream = jfopen(path, mode);
	return stream;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
testq %rdx, %rdx
je 0x4ac1
movq %rdx, %r15
movq %rdx, %rdi
callq 0x2490
movq %r15, %rdi
callq 0x2040
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2310
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/ansi.c
// Function: jfeof
int jfeof(struct jfs *stream)
{
	/* ANSI expects that when an EOF is reached in any operation (like
	 * fread() or fwrite()) some internal flag is set, and this function
	 * can be used to check if it is set or unset.
	 * As we don't do that (it's pointless for this kind of I/O), this
	 * just checks if the file pointer is at the end of the file */

	off_t curpos, endpos;

	pthread_mutex_lock(&(stream->lock));

	curpos = lseek(jfileno(stream), 0, SEEK_CUR);
	endpos = lseek(jfileno(stream), 0, SEEK_END);

	lseek(jfileno(stream), curpos, SEEK_SET);

	pthread_mutex_unlock(&(stream->lock));

	if (curpos >= endpos)
		return 1;
	else
		return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x68(%rdi), %rbx
movq %rbx, %rdi
callq 0x2590
movl (%r14), %edi
xorl %esi, %esi
movl $0x1, %edx
callq 0x21f0
movq %rax, %r15
movl (%r14), %edi
xorl %esi, %esi
movl $0x2, %edx
callq 0x21f0
movq %rax, %r12
movl (%r14), %edi
movq %r15, %rsi
xorl %edx, %edx
callq 0x21f0
movq %rbx, %rdi
callq 0x2370
xorl %eax, %eax
cmpq %r12, %r15
setge %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/albertito[P]libjio/libjio/ansi.c
// Function: jfseek
int jfseek(struct jfs *stream, long offset, int whence)
{
	off_t pos;

	pthread_mutex_lock(&(stream->lock));
	pos = lseek(stream->fd, offset, whence);
	pthread_mutex_unlock(&(stream->lock));

	/* fseek returns 0 on success, -1 on error */
	if (pos == -1)
		return 1;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x68(%rdi), %r12
movq %r12, %rdi
callq 0x2590
movl (%r15), %edi
movq %r14, %rsi
movl %ebx, %edx
callq 0x21f0
movq %rax, %rbx
movq %r12, %rdi
callq 0x2370
xorl %eax, %eax
cmpq $-0x1, %rbx
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/openshmem-org[P]openshmem-examples/c/generic-rotput.c
// Function: main
int
main(void)
{
    int nextpe;
    int me, npes;
    int src;
    int *dest;

    shmem_init();
    me = shmem_my_pe();
    npes = shmem_n_pes();

    nextpe = (me + 1) % npes;

    src = nextpe;

    dest = (int *) shmem_malloc(sizeof(*dest));
    assert(dest != NULL);

    *dest = -1;
    shmem_barrier_all();

    shmem_put(dest, &src, 1, nextpe);

    shmem_barrier_all();

    printf("%4d: got %4d: ", me, *dest);
    if (*dest == me) {
        printf("CORRECT");
    }
    else {
        printf("WRONG, expected %d", me);
    }
    printf("\n");

    shmem_barrier_all();
    shmem_free(dest);
    shmem_finalize();

    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
callq 0x10c0
callq 0x1090
movl %eax, %r14d
callq 0x1070
movl %eax, %ecx
leal 0x1(%r14), %eax
cltd
idivl %ecx
movl %edx, %ebp
movl %edx, 0xc(%rsp)
movl $0x4, %edi
callq 0x10a0
testq %rax, %rax
je 0x129f
movq %rax, %rbx
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
callq 0x10b0
leaq 0xc(%rsp), %rsi
movl $0x1, %edx
movq %rbx, %rdi
movl %ebp, %ecx
callq 0x1030
callq 0x10b0
movl (%rbx), %edx
leaq 0xde9(%rip), %rdi       # 0x2031
movl %r14d, %esi
xorl %eax, %eax
callq 0x1040
cmpl %r14d, (%rbx)
jne 0x1267
leaq 0xde2(%rip), %rdi       # 0x2040
xorl %eax, %eax
callq 0x1040
jmp 0x1278
leaq 0xdda(%rip), %rdi       # 0x2048
movl %r14d, %esi
xorl %eax, %eax
callq 0x1040
movl $0xa, %edi
callq 0x1060
callq 0x10b0
movq %rbx, %rdi
callq 0x10d0
callq 0x1080
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xd5e(%rip), %rdi       # 0x2004
leaq 0xd64(%rip), %rsi       # 0x2011
leaq 0xd6e(%rip), %rcx       # 0x2022
movl $0x4d, %edx
callq 0x1050
// File: /workspace/github_c_makefile_star2_O1/motet-a[P]libforks/tests/child_exit_nonzero_status.c
// Function: main
int main() {
  libforks_ServerConn conn;

  check(libforks_start(&conn) == libforks_OK);

  int exit_fd;
  pid_t child_pid;

  libforks_Result r = libforks_fork(
    conn,
    &child_pid, // pid_ptr
    NULL, // socket_fd_ptr
    &exit_fd, // exit_fd_ptr
    child_main
  );
  check(r == libforks_OK);

  libforks_ExitEvent event;
  check(read(exit_fd, &event, sizeof event) == sizeof event);
  check(event.pid == child_pid);
  check(WIFEXITED(event.wait_status));
  check(WEXITSTATUS(event.wait_status) == 23);

  check(libforks_stop(conn) == libforks_OK);

  return 0;
}

// Assembly:
subq $0x18, %rsp
leaq 0x8(%rsp), %rdi
callq 0x17a7
testl %eax, %eax
jne 0x1388
movq 0x8(%rsp), %rdi
leaq 0x100(%rip), %r8        # 0x142a
movq %rsp, %rsi
leaq 0x4(%rsp), %rcx
xorl %edx, %edx
callq 0x21fb
testl %eax, %eax
jne 0x1399
movl 0x4(%rsp), %edi
leaq 0x10(%rsp), %rsi
movl $0x8, %edx
callq 0x10f0
cmpq $0x8, %rax
jne 0x13aa
movl 0x10(%rsp), %eax
cmpl (%rsp), %eax
jne 0x13bb
movl 0x14(%rsp), %eax
testb $0x7f, %al
jne 0x13cc
andl $0xff00, %eax           # imm = 0xFF00
cmpl $0x1700, %eax           # imm = 0x1700
jne 0x13dd
movq 0x8(%rsp), %rdi
callq 0x23b6
testl %eax, %eax
jne 0x13ee
xorl %eax, %eax
addq $0x18, %rsp
retq
leaq 0x1c75(%rip), %rdi      # 0x3004
movl $0xe, %esi
callq 0x13ff
leaq 0x1cab(%rip), %rdi      # 0x304b
movl $0x1a, %esi
callq 0x13ff
leaq 0x1cab(%rip), %rdi      # 0x305c
movl $0x1d, %esi
callq 0x13ff
leaq 0x1cce(%rip), %rdi      # 0x3090
movl $0x1e, %esi
callq 0x13ff
leaq 0x1cd4(%rip), %rdi      # 0x30a7
movl $0x1f, %esi
callq 0x13ff
leaq 0x1ce0(%rip), %rdi      # 0x30c4
movl $0x20, %esi
callq 0x13ff
leaq 0x1cf4(%rip), %rdi      # 0x30e9
movl $0x22, %esi
callq 0x13ff
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/main.c
// Function: hexval
static int
hexval(char c)
/*
 * Convert characters '0'..'9', 'A'..'F' and 'a'..'f' to 0..15
 */
{

	if (c >= '0' && c <= '9')
		return c - '0';
	if (c >= 'a' && c <= 'f')
		return c - 'a' + 10;
	if (c >= 'A' && c <= 'F')
		return c - 'A' + 10;
	fprintf(stderr, "Character %c is not a hexchar\n", c);
	exit(-1);
}

// Assembly:
leal -0x30(%rdi), %ecx
movl $0xffffffd0, %eax       # imm = 0xFFFFFFD0
cmpb $0xa, %cl
jb 0x4a15
leal -0x61(%rdi), %ecx
movl $0xffffffa9, %eax       # imm = 0xFFFFFFA9
cmpb $0x6, %cl
jb 0x4a15
leal -0x41(%rdi), %ecx
movl $0xffffffc9, %eax       # imm = 0xFFFFFFC9
cmpb $0x6, %cl
jae 0x4a18
addl %edi, %eax
retq
pushq %rax
callq 0x2339
nop
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: init_goedel
static void
init_goedel(FILE *out)
{
	int i;
	byte ten[L];

	/*
	 * Initialize the array with powers of ten
	 * We need them in the next function
	 */
	mp96_zero(ten);
	ten[L-1] = 10;
	mp96_one(powers_of_ten[0]);
	for (i=1; i<MAXDECIMALS; i++) {
		mp96_mul(powers_of_ten[i], powers_of_ten[i-1], ten);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0xc(%rsp), %rbx
movq %rbx, %rdi
callq 0x3880
movb $0xa, 0xb(%rbx)
leaq 0x8562(%rip), %r14      # 0xdd80
movq %r14, %rdi
callq 0x388f
movl $0x1c, %r12d
leaq 0xc(%r14), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3922
movq %r15, %r14
decq %r12
jne 0x582c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: print_goedel
static void
print_goedel(FILE *out, int boardno, hr_p hrp)
/*
 * Write out the internal 96 bit numbers as a decimal number
 *
 * Unlikely that anyone would ever want this in real life
 */
{
	dl_num *dnp = hrp->hr_value.hv_dnp;
	byte value[L];
	int i;
	int decimal;
	int zero_suppress;
	char outchar;

	mp96_assign(value, dnp->dn_num);
	zero_suppress = 1;
	for (i=MAXDECIMALS-1; i>=0; i--) {
		/*
		 * Since we do not have division we do repeated subtraction
		 */
		decimal = 0;
		while (mp96_cmp(value, powers_of_ten[i])>=0) {
			mp96_sub(value, value, powers_of_ten[i]);
			decimal++;
		}
		if (decimal) {
			outchar = decimal + '0';
			zero_suppress = 0;
		} else {
			/*
			 * Suppress leading zeroes
			 * Special case all zeroes also handled
			 * That will be the day....
			 */
			outchar = zero_suppress && i ? ' ' : '0';
		}
		putc(outchar, out);
		/*
		 * Intersperse with commas for readability
		 */
		if (i%3 == 0) {
			putc(i==0 ? '\n' : zero_suppress ? ' ' : ',', out);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x8(%rdx), %rsi
leaq 0xc(%rsp), %r14
movq %r14, %rdi
callq 0x38a2
movl $0x1, %ebp
movl $0x1c, %r12d
leaq (%r12,%r12,2), %rax
leaq 0x84f6(%rip), %rcx      # 0xdd80
leaq (%rcx,%rax,4), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x3908
xorl %r13d, %r13d
testl %eax, %eax
js 0x58be
movq %r14, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x38dd
incl %r13d
movq %r14, %rdi
movq %r15, %rsi
callq 0x3908
jmp 0x589c
testl %r13d, %r13d
je 0x58cb
addl $0x30, %r13d
xorl %ebp, %ebp
jmp 0x58e8
xorl %r13d, %r13d
testl %ebp, %ebp
sete %r13b
shll $0x4, %r13d
orl $0x20, %r13d
testq %r12, %r12
movl $0x30, %eax
cmovel %eax, %r13d
movsbl %r13b, %edi
movq %rbx, %rsi
callq 0x2160
imull $0xaaaaaaab, %r12d, %eax # imm = 0xAAAAAAAB
cmpl $0x55555555, %eax       # imm = 0x55555555
ja 0x5924
testl %ebp, %ebp
movl $0x20, %edi
movl $0x2c, %eax
cmovel %eax, %edi
testq %r12, %r12
movl $0xa, %eax
cmovel %eax, %edi
movq %rbx, %rsi
callq 0x2160
subq $0x1, %r12
jae 0x587f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: compute_stat
static void
compute_stat(FILE *out, int boardno, hr_p hrp)
/*
 * Compute statistics on this hand
 */
{
	dl_byh *dbhp = hrp->hr_value.hv_dbhp;
	int i, compass, card;
	int length, maxlength, suitlength[NCOMPASS][NSUIT];
	int hcp;

	for (compass=0; compass<NCOMPASS; compass++) {
		for (i=0; i<NSUIT; i++)
			suitlength[compass][i] = 0;
		hcp = 0;
		for (i=0; i<NCARDSPERHAND; i++) {
			/*
			 * Note the -1 to convert from 1..52 to 0..51
			 */
			card = dbhp->dh_hand[compass][i]-1;
			/*
			 * card/13 should be suit
			 */
			suitlength[compass][card/13]++;
			/*
			 * card%13 should be pip
			 */
			hcp += high_card_points[card%13];
		}
		stats.st_hcp[compass] += hcp;
		stats.st_hcpfreq[hcp]++;
		maxlength = 0;
		for (i=0; i<NSUIT; i++) {
			length = suitlength[compass][i];
			if (length > maxlength)
				maxlength = length;
			stats.st_sumsquare += length*length;
		}
		if (maxlength > stats.st_longestsuit)
			stats.st_longestsuit = maxlength;
		stats.st_lsuitfreq[compass][maxlength]++;
	}
	/*
	 * Now suitlength[][] contains all suit lengths for all hands
	 * 16 numbers in all.
	 * Statistics about distribution to be added here.
	 */
}

// Assembly:
pushq %r14
pushq %rbx
movq 0x8(%rdx), %rax
leaq -0x48(%rsp), %rcx
xorl %edx, %edx
xorps %xmm0, %xmm0
leaq 0x1e1d(%rip), %rsi      # 0x77b0
leaq 0x8542(%rip), %rdi      # 0xdedc
movq %rdx, %r8
shlq $0x4, %r8
addq %rsp, %r8
addq $-0x48, %r8
movaps %xmm0, (%r8)
movq $-0xd, %r10
xorl %r9d, %r9d
movzbl 0xd(%rax,%r10), %r11d
leal -0x1(%r11), %ebx
movslq %ebx, %rbx
imulq $0x4ec4ec4f, %rbx, %rbx # imm = 0x4EC4EC4F
movq %rbx, %r14
shrq $0x3f, %r14
sarq $0x22, %rbx
addl %r14d, %ebx
incl (%r8,%rbx,4)
leal (%rbx,%rbx,2), %r14d
leal (%rbx,%r14,4), %ebx
negl %ebx
addl %ebx, %r11d
decl %r11d
movslq %r11d, %r11
movslq (%rsi,%r11,4), %r11
movslq %r9d, %r9
addq %r11, %r9
incq %r10
jne 0x59b6
addl %r9d, 0x4(%rdi,%rdx,4)
incl 0x14(%rdi,%r9,4)
xorl %r9d, %r9d
movl 0x84ca(%rip), %r10d     # 0xdedc
xorl %r8d, %r8d
movl (%rcx,%r9,4), %r11d
cmpl %r8d, %r11d
cmovgl %r11d, %r8d
imull %r11d, %r11d
addl %r11d, %r10d
incq %r9
cmpq $0x4, %r9
jne 0x5a15
movl %r10d, 0x84a5(%rip)     # 0xdedc
cmpl 0x862a(%rip), %r8d      # 0xe068
jle 0x5a47
movl %r8d, 0x8621(%rip)      # 0xe068
movl %r8d, %r8d
imulq $0x38, %rdx, %r9
addq %rdi, %r9
incl 0xac(%r9,%r8,4)
incq %rdx
addq $0xd, %rax
addq $0x10, %rcx
cmpq $0x4, %rdx
jne 0x599a
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/hansvanstaveren[P]BigDeal/output.c
// Function: print_avg
static void
print_avg(FILE *out, int sum, int divisor, int decimals, char *termstr)
/*
 * Prevent use of floating point
 */
{
	int power_of_ten;
	int i;
	int result;

	power_of_ten = 1;
	for (i=0; i<decimals; i++)
		power_of_ten *= 10;

	sum *= power_of_ten;
	/*
	 * Make sure of proper rounding
	 */
	sum += divisor/2;
	result = sum/divisor;

	fprintf(out, "%d", result/power_of_ten);
	if (decimals) {
		fprintf(out, ".");
		for (i=0; i<decimals; i++) {
			result -= result/power_of_ten*power_of_ten;
			power_of_ten /= 10;
			fprintf(out, "%d", result/power_of_ten);
		}
	}
	fprintf(out, "%s", termstr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %ecx
movq %rdi, %r14
movl $0x1, %r13d
testl %ebp, %ebp
jle 0x6168
movl %ebp, %eax
addl %r13d, %r13d
leal (%r13,%r13,4), %r13d
decl %eax
jne 0x615c
imull %r13d, %esi
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
addl %esi, %eax
cltd
idivl %ecx
movl %eax, %r15d
cltd
idivl %r13d
leaq 0x1b97(%rip), %rsi      # 0x7d1f
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x2180
testl %ebp, %ebp
je 0x61eb
movl $0x2e, %edi
movq %r14, %rsi
callq 0x2120
testl %ebp, %ebp
jle 0x61eb
leaq 0x1b6f(%rip), %r12      # 0x7d1f
movl %r15d, %eax
cltd
idivl %r13d
movslq %r13d, %rax
imulq $0x66666667, %rax, %r13 # imm = 0x66666667
movq %r13, %rax
shrq $0x3f, %rax
sarq $0x22, %r13
addl %eax, %r13d
movl %edx, %r15d
movl %edx, %eax
cltd
idivl %r13d
movq %r14, %rdi
movq %r12, %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x2180
decl %ebp
jne 0x61b0
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20e0
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_16/sort.c
// Function: estrcmp
int estrcmp(const char *s1, const char *s2)
{
  while (*s1 != '\0' && *s2 != '\0')
  {
    if (directory)
    {
      while (*s1 != '\0' && !isalnum(*s1) && !isspace(*s1))
      {
        ++s1;
      }
      while (*s2 != '\0' && !isalnum(*s2) && !isspace(*s2))
      {
        ++s2;
      }
    }

    int result = fold ? tolower(*s1) - tolower(*s2) : *s1 - *s2;
    if (result == 0)
    {
      ++s1;
      ++s2;
    }
    else
    {
      return order * result;
    }
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x2ee1(%rip), %eax      # 0x4094
movl %eax, 0x4(%rsp)
movl 0x2ed2(%rip), %r15d     # 0x4090
movl 0x2e9b(%rip), %r12d     # 0x4060
xorl %eax, %eax
cmpb $0x0, (%r14)
je 0x1281
cmpb $0x0, (%rbx)
je 0x1281
cmpl $0x0, 0x4(%rsp)
je 0x1239
movb (%r14), %bpl
testb %bpl, %bpl
je 0x120d
callq 0x1090
movq (%rax), %rax
movsbq %bpl, %rcx
movzwl (%rax,%rcx,2), %ecx
testl $0x2008, %ecx           # imm = 0x2008
jne 0x120d
movb 0x1(%r14), %bpl
incq %r14
testb %bpl, %bpl
jne 0x11f1
movb (%rbx), %bpl
testb %bpl, %bpl
je 0x1239
callq 0x1090
movq (%rax), %rax
movsbq %bpl, %rcx
movzwl (%rax,%rcx,2), %ecx
testl $0x2008, %ecx           # imm = 0x2008
jne 0x1239
movb 0x1(%rbx), %bpl
incq %rbx
testb %bpl, %bpl
jne 0x121d
testl %r15d, %r15d
je 0x1256
callq 0x1080
movq (%rax), %rcx
movsbq (%r14), %rax
movl (%rcx,%rax,4), %eax
movsbq (%rbx), %rdx
subl (%rcx,%rdx,4), %eax
jmp 0x125f
movsbl (%r14), %eax
movsbl (%rbx), %ecx
subl %ecx, %eax
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
movl %r12d, %edx
imull %eax, %edx
addq %rcx, %rbx
addq %rcx, %r14
testl %eax, %eax
cmovnel %edx, %r13d
movl %r13d, %eax
je 0x11c5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/soso7885[P]OPCUA_example/demo_src/server_method.c
// Function: helloWorldMethod
static UA_StatusCode
helloWorldMethod(void *handle, const UA_NodeId objectId, size_t inputSize, const UA_Variant *input,
                 size_t outputSize, UA_Variant *output) {
        UA_String *inputStr = (UA_String*)input->data;
        UA_String tmp = UA_STRING_ALLOC("Hello ");
        if(inputStr->length > 0) {
            tmp.data = realloc(tmp.data, tmp.length + inputStr->length);
            memcpy(&tmp.data[tmp.length], inputStr->data, inputStr->length);
            tmp.length += inputStr->length;
        }
        UA_Variant_setScalarCopy(output, &tmp, &UA_TYPES[UA_TYPES_STRING]);
        UA_String_deleteMembers(&tmp);
        UA_LOG_INFO(logger, UA_LOGCATEGORY_SERVER, "Hello World was called");
        return UA_STATUSCODE_GOOD;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq 0x18(%rdx), %r14
leaq 0x8ab(%rip), %rdi       # 0x2109
callq 0x10d0
movq %rax, -0x28(%rbp)
movq %rdx, -0x20(%rbp)
movq (%r14), %rsi
testq %rsi, %rsi
je 0x189d
addq %rax, %rsi
movq %rdx, %rdi
callq 0x10e0
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %r15
leaq (%rax,%r15), %rdi
movq (%r14), %rdx
movq 0x8(%r14), %rsi
callq 0x10a0
addq (%r14), %r15
movq %r15, -0x28(%rbp)
movl $0x1b8, %r14d           # imm = 0x1B8
addq 0x272e(%rip), %r14      # 0x3fd8
leaq -0x28(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1090
movq %r15, %rdi
movq %r14, %rsi
callq 0x1070
movq 0x27da(%rip), %rcx      # 0x40a8
testq %rcx, %rcx
je 0x18e8
leaq 0x836(%rip), %rdx       # 0x2110
movl $0x2, %edi
movl $0x3, %esi
xorl %eax, %eax
callq *%rcx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/soso7885[P]OPCUA_example/demo_src/server_method.c
// Function: IncInt32ArrayValuesMethod
static UA_StatusCode
IncInt32ArrayValuesMethod(void *handle, const UA_NodeId objectId, size_t inputSize,
                          const UA_Variant *input, size_t outputSize, UA_Variant *output) {
	UA_Variant_setArrayCopy(output, input->data, 5, &UA_TYPES[UA_TYPES_INT32]);
	for(size_t i = 0; i< input->arrayLength; i++)
		((UA_Int32*)output->data)[i] = ((UA_Int32*)input->data)[i] + 1;
	return UA_STATUSCODE_GOOD;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %r8, %rbx
movq %rdx, %r14
movq 0x18(%rdx), %rsi
movl $0xc8, %ecx
addq 0x26c6(%rip), %rcx      # 0x3fd8
movl $0x5, %edx
movq %r8, %rdi
callq 0x1050
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x1942
movq 0x18(%r14), %rcx
movq 0x18(%rbx), %rdx
xorl %esi, %esi
movl (%rcx,%rsi,4), %edi
incl %edi
movl %edi, (%rdx,%rsi,4)
incq %rsi
cmpq %rsi, %rax
jne 0x1932
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/soso7885[P]OPCUA_example/demo_src/server_method.c
// Function: fooBarMethod
static UA_StatusCode
fooBarMethod(void *handle, const UA_NodeId objectId, size_t inputSize, const UA_Variant *input,
                 size_t outputSize, UA_Variant *output) {
	// Exactly the same as helloWorld, but returns foobar
        UA_String *inputStr = (UA_String*)input->data;
        UA_String tmp = UA_STRING_ALLOC("FooBar! ");
        if(inputStr->length > 0) {
            tmp.data = realloc(tmp.data, tmp.length + inputStr->length);
            memcpy(&tmp.data[tmp.length], inputStr->data, inputStr->length);
            tmp.length += inputStr->length;
        }
        UA_Variant_setScalarCopy(output, &tmp, &UA_TYPES[UA_TYPES_STRING]);
        UA_String_deleteMembers(&tmp);
        UA_LOG_INFO(logger, UA_LOGCATEGORY_SERVER, "Hello World was called");
        return UA_STATUSCODE_GOOD;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq 0x18(%rdx), %r14
leaq 0x7c3(%rip), %rdi       # 0x2127
callq 0x10d0
movq %rax, -0x28(%rbp)
movq %rdx, -0x20(%rbp)
movq (%r14), %rsi
testq %rsi, %rsi
je 0x19a3
addq %rax, %rsi
movq %rdx, %rdi
callq 0x10e0
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %r15
leaq (%rax,%r15), %rdi
movq (%r14), %rdx
movq 0x8(%r14), %rsi
callq 0x10a0
addq (%r14), %r15
movq %r15, -0x28(%rbp)
movl $0x1b8, %r14d           # imm = 0x1B8
addq 0x2628(%rip), %r14      # 0x3fd8
leaq -0x28(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1090
movq %r15, %rdi
movq %r14, %rsi
callq 0x1070
movq 0x26d4(%rip), %rcx      # 0x40a8
testq %rcx, %rcx
je 0x19ee
leaq 0x730(%rip), %rdx       # 0x2110
movl $0x2, %edi
movl $0x3, %esi
xorl %eax, %eax
callq *%rcx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/codeniko[P]CS214-Malloc-Free/Test7.c
// Function: main
void main()
{
    void* p = malloc(1);
    free(p);
    printf("p has been freed\n");
    free(p + 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0xeaa(%rip), %rbx       # 0x2004
movl $0x1, %edi
movq %rbx, %rsi
movl $0x6, %edx
callq 0x11a4
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
movl $0x7, %edx
callq 0x1304
leaq 0xe86(%rip), %rdi       # 0x200c
callq 0x1030
incq %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x9, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x1304
nop
// File: /workspace/github_c_makefile_star2_O1/janmojzis[P]mcencrypt/mckeypair.c
// Function: main
int main(int argc, char **argv) {

    if (!checkfd(5, POLLOUT)) die_usage(NAME, "write publickey failed", "5>publickey 9>secretkey");
    if (!checkfd(9, POLLOUT)) die_usage(NAME, "write secretkey failed", "5>publickey 9>secretkey");
    limits();
    if (crypto_kem_mceliece8192128sha512_keypair(pk, sk)) die_temp(NAME, "keypair failed");
    if (writeall(5, pk, sizeof pk) == -1) die_temp(NAME, "write publickey failed");
    if (fsyncfd(5) == -1) die_temp(NAME, "write publickey failed");
    if (writeall(9, sk, sizeof sk) == -1) die_temp(NAME, "write secretkey failed");
    if (fsyncfd(9) == -1) die_temp(NAME, "write secretkey failed");
    die(0);
}

// Assembly:
pushq %rax
movl $0x5, %edi
movl $0x4, %esi
callq 0x3978
testl %eax, %eax
jne 0x126e
leaq 0x5da9(%rip), %rdi      # 0x7004
leaq 0x5dac(%rip), %rsi      # 0x700e
leaq 0x5dbc(%rip), %rdx      # 0x7025
callq 0x467c
movl $0x9, %edi
movl $0x4, %esi
callq 0x3978
testl %eax, %eax
jne 0x129b
leaq 0x5d7c(%rip), %rdi      # 0x7004
leaq 0x5dae(%rip), %rsi      # 0x703d
leaq 0x5d8f(%rip), %rdx      # 0x7025
callq 0x467c
callq 0x5648
leaq 0x8e19(%rip), %rdi      # 0xa0c0
leaq 0x154612(%rip), %rsi    # 0x1558c0
callq 0x58f8
testl %eax, %eax
je 0x12ca
leaq 0x5d46(%rip), %rdi      # 0x7004
leaq 0x5d8f(%rip), %rsi      # 0x7054
callq 0x47a8
leaq 0x8def(%rip), %rsi      # 0xa0c0
movl $0x14b800, %edx         # imm = 0x14B800
movl $0x5, %edi
callq 0x6a44
cmpl $-0x1, %eax
jne 0x12f8
leaq 0x5d18(%rip), %rdi      # 0x7004
leaq 0x5d1b(%rip), %rsi      # 0x700e
callq 0x47a8
movl $0x5, %edi
callq 0x4d88
cmpl $-0x1, %eax
jne 0x131a
leaq 0x5cf6(%rip), %rdi      # 0x7004
leaq 0x5cf9(%rip), %rsi      # 0x700e
callq 0x47a8
leaq 0x15459f(%rip), %rsi    # 0x1558c0
movl $0x3700, %edx           # imm = 0x3700
movl $0x9, %edi
callq 0x6a44
cmpl $-0x1, %eax
jne 0x1348
leaq 0x5cc8(%rip), %rdi      # 0x7004
leaq 0x5cfa(%rip), %rsi      # 0x703d
callq 0x47a8
movl $0x9, %edi
callq 0x4d88
cmpl $-0x1, %eax
jne 0x136a
leaq 0x5ca6(%rip), %rdi      # 0x7004
leaq 0x5cd8(%rip), %rsi      # 0x703d
callq 0x47a8
xorl %edi, %edi
callq 0x485c
xorl %eax, %eax
popq %rcx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/KhuramAli[P]JAM-Benchmark/mpmc_queue_lock_synchronized/code06.cpp
// Function: main
int main()
{
	std::thread t1{produce};
	std::thread t1a{produce};
	std::thread t2{consume};
	std::thread t3{consume};
	t3.join();
	t1.join();
	t2.join();
	t1a.join();
	
	
	std::cout << sum << '\n';
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
leaq -0x10b(%rip), %rbx      # 0x130c
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x1504
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x1504
leaq -0x89(%rip), %rsi       # 0x13af
leaq 0x18(%rsp), %rdi
callq 0x1504
leaq -0x9a(%rip), %rsi       # 0x13af
leaq 0x10(%rsp), %rdi
callq 0x1504
leaq 0x10(%rsp), %rdi
callq 0x1150
leaq 0x28(%rsp), %rdi
callq 0x1150
leaq 0x18(%rsp), %rdi
callq 0x1150
leaq 0x20(%rsp), %rdi
callq 0x1150
movl 0x2cb7(%rip), %esi      # 0x4138
movq 0x2b50(%rip), %rdi      # 0x3fd8
callq 0x1160
leaq 0xf(%rsp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x10f0
cmpq $0x0, 0x10(%rsp)
jne 0x14f8
cmpq $0x0, 0x18(%rsp)
jne 0x14f8
cmpq $0x0, 0x20(%rsp)
jne 0x14f8
cmpq $0x0, 0x28(%rsp)
jne 0x14f8
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
retq
jmp 0x14d8
jmp 0x14e0
jmp 0x14e8
cmpq $0x0, 0x10(%rsp)
jne 0x14f8
cmpq $0x0, 0x18(%rsp)
jne 0x14f8
cmpq $0x0, 0x20(%rsp)
jne 0x14f8
cmpq $0x0, 0x28(%rsp)
jne 0x14f8
movq %rax, %rdi
callq 0x1170
callq 0x1030
nop
// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: show_image_normalized
void show_image_normalized(image im, const char *name)
{
    image c = copy_image(im);
    normalize_image(c);
    show_image(c, name, 1);
    free_image(c);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movl 0x60(%rsp), %eax
movl 0x64(%rsp), %ecx
movl 0x68(%rsp), %edx
movl 0x6c(%rsp), %esi
movq 0x70(%rsp), %r15
movl %eax, 0x20(%rsp)
movl %ecx, 0x24(%rsp)
movl %edx, 0x28(%rsp)
movl %esi, 0x2c(%rsp)
movq %r15, 0x30(%rsp)
imull %eax, %ecx
imull %edx, %ecx
movslq %ecx, %r12
pushq $0x4
popq %rsi
movq %r12, %rdi
callq 0x3260
movq %rax, %r14
movq %rax, 0x30(%rsp)
shlq $0x2, %r12
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x32c0
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x177d6
movq 0x65ba2(%rip), %rax     # 0x69ff8
movq (%rax), %rdi
leaq 0x512a9(%rip), %rsi     # 0x55709
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3280
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
pushq $0x3
popq %rsi
pushq $0x50
popq %rdx
movq %rbx, %rdi
callq 0x17a81
testq %r14, %r14
je 0x44a3
movq %r14, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3040
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq