LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]spiped/tests/pushbits/main.c
// Function: echo_stdin_stdout
static int
echo_stdin_stdout(void)
{
	pthread_t thread;
	int rc;

	/* Start echoing. */
	if (pushbits(STDIN_FILENO, STDOUT_FILENO, &thread)) {
		warnp("pushbits");
		goto err0;
	}

	/*
	 * Wait a short while, then cancel the thread.  Note that if stdin
	 * returned an EOF, the thread might have already stopped, and
	 * certainly will not be running after a second.  This is particularly
	 * relevant if running the tests inside a virtualization or container
	 * framework.
	 */
	sleep(1);
	if ((rc = pthread_cancel(thread)) != 0) {
		/*
		 * These tests ignore an ESRCH error returned by
		 * pthread_cancel.  According to the POSIX standard, a
		 * thread ID should still be valid after pthread_exit has
		 * been invoked by the thread if pthread_join() has not yet
		 * been called.  However, many platforms return ESRCH in
		 * this situation.
		 */
		if (rc != ESRCH) {
			warn0("pthread_cancel: %s", strerror(rc));
			goto err0;
		}
	}

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

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
xorl %edi, %edi
movl $0x1, %esi
leaq -0x10(%rbp), %rdx
callq 0x3c80
cmpl $0x0, %eax
je 0x2e09
jmp 0x2dcf
callq 0x2080
cmpl $0x0, (%rax)
je 0x2df4
leaq 0x3422(%rip), %rdi      # 0x6202
movb $0x0, %al
callq 0x4e40
callq 0x2080
movl $0x0, (%rax)
jmp 0x2e02
leaq 0x3407(%rip), %rdi      # 0x6202
movb $0x0, %al
callq 0x5090
jmp 0x2e04
jmp 0x2e9a
movl $0x1, %edi
callq 0x22e0
movq -0x10(%rbp), %rdi
callq 0x22d0
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x2e54
cmpl $0x3, -0x14(%rbp)
je 0x2e52
jmp 0x2e2c
movl -0x14(%rbp), %edi
callq 0x22b0
movq %rax, %rsi
leaq 0x33e4(%rip), %rdi      # 0x6222
movb $0x0, %al
callq 0x5090
callq 0x2080
movl $0x0, (%rax)
jmp 0x2e9a
jmp 0x2e54
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2290
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x2e91
jmp 0x2e6b
movl -0x14(%rbp), %edi
callq 0x22b0
movq %rax, %rsi
leaq 0x338e(%rip), %rdi      # 0x620b
movb $0x0, %al
callq 0x5090
callq 0x2080
movl $0x0, (%rax)
jmp 0x2e9a
movl $0x0, -0x4(%rbp)
jmp 0x2ea1
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]spiped/tests/pushbits/../../spipe/pushbits.c
// Function: pushbits
int
pushbits(int in, int out, pthread_t * thr)
{
	struct push * P;
	int rc;

	/* Allocate structure. */
	if ((P = malloc(sizeof(struct push))) == NULL)
		goto err0;
	P->in = in;
	P->out = out;

	/* Create thread. */
	if ((rc = pthread_create_blocking_np(thr, NULL, workthread, P)) != 0) {
		warn0("pthread_create_blocking_np: %s", strerror(rc));
		goto err1;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x2008, %edi           # imm = 0x2008
callq 0x21e0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x3ca8
jmp 0x3d1c
movl -0x8(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2000(%rax)
movl -0xc(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2004(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq 0x5b(%rip), %rdx        # 0x3d30
callq 0x52d0
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
je 0x3d0a
jmp 0x3ce4
movl -0x24(%rbp), %edi
callq 0x22b0
movq %rax, %rsi
leaq 0x25ae(%rip), %rdi      # 0x62a4
movb $0x0, %al
callq 0x5090
callq 0x2080
movl $0x0, (%rax)
jmp 0x3d13
movl $0x0, -0x4(%rbp)
jmp 0x3d23
movq -0x20(%rbp), %rdi
callq 0x2030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]spiped/tests/pushbits/../../spipe/pushbits.c
// Function: workthread
static void *
workthread(void * cookie)
{
	struct push * P = cookie;
	ssize_t readlen;

	/* Set up cleanup function. */
	pthread_cleanup_push(workthread_cleanup, P);

	/* Infinite loop unless we hit EOF or an error. */
	do {
		/* Read data and die on error. */
		if ((readlen = read(P->in, P->buf, BUFSIZ)) == -1) {
			if (errno == EINTR)
				continue;
			warnp("Error reading");
			exit(1);
		}

		/* If we hit EOF, exit the loop. */
		if (readlen == 0)
			break;

		/* Write the data back out. */
		if (noeintr_write(P->out, &P->buf, (size_t)readlen)
		    != readlen) {
			warnp("Error writing");
			exit(1);
		}
	} while (1);

	/* Clean up. */
	pthread_cleanup_pop(1);

	/* We're done. */
	return (NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0x172(%rip), %rax       # 0x3ec0
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
callq 0x22c0
movl %eax, -0x94(%rbp)
movslq -0x94(%rbp), %rax
cmpq $0x0, %rax
je 0x3d97
movq -0x88(%rbp), %rax
movq -0x90(%rbp), %rdi
callq *%rax
leaq -0x80(%rbp), %rdi
callq 0x2200
leaq -0x80(%rbp), %rdi
callq 0x2280
jmp 0x3da2
movq -0x10(%rbp), %rax
movl 0x2000(%rax), %edi
movq -0x10(%rbp), %rsi
movl $0x2000, %edx           # imm = 0x2000
callq 0x2160
movq %rax, -0x18(%rbp)
cmpq $-0x1, %rax
jne 0x3e14
callq 0x2080
cmpl $0x4, (%rax)
jne 0x3dd3
jmp 0x3e7d
jmp 0x3dd5
callq 0x2080
cmpl $0x0, (%rax)
je 0x3dfa
leaq 0x24dd(%rip), %rdi      # 0x62c3
movb $0x0, %al
callq 0x4e40
callq 0x2080
movl $0x0, (%rax)
jmp 0x3e08
leaq 0x24c2(%rip), %rdi      # 0x62c3
movb $0x0, %al
callq 0x5090
jmp 0x3e0a
movl $0x1, %edi
callq 0x2270
cmpq $0x0, -0x18(%rbp)
jne 0x3e1d
jmp 0x3e89
movq -0x10(%rbp), %rax
movl 0x2004(%rax), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x4c60
cmpq -0x18(%rbp), %rax
je 0x3e7b
jmp 0x3e3c
callq 0x2080
cmpl $0x0, (%rax)
je 0x3e61
leaq 0x2484(%rip), %rdi      # 0x62d1
movb $0x0, %al
callq 0x4e40
callq 0x2080
movl $0x0, (%rax)
jmp 0x3e6f
leaq 0x2469(%rip), %rdi      # 0x62d1
movb $0x0, %al
callq 0x5090
jmp 0x3e71
movl $0x1, %edi
callq 0x2270
jmp 0x3e7d
movb $0x1, %al
testb $0x1, %al
jne 0x3da2
jmp 0x3e89
jmp 0x3e8b
jmp 0x3e8d
jmp 0x3e8f
leaq -0x80(%rbp), %rdi
callq 0x2110
movq -0x88(%rbp), %rax
movq -0x90(%rbp), %rdi
callq *%rax
xorl %eax, %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]spiped/tests/pushbits/../../spipe/pushbits.c
// Function: workthread_cleanup
static void
workthread_cleanup(void * cookie)
{
	struct push * P = cookie;

	/*
	 * Try to shut down the descriptor we're writing to.  Ignore ENOTSOCK,
	 * since it might, indeed, not be a socket.
	 */
	if (shutdown(P->out, SHUT_WR)) {
		if (errno != ENOTSOCK) {
			warnp("Error shutting down socket");
			exit(1);
		}
	}

	/* Free our parameters. */
	free(P);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x2004(%rax), %edi
movl $0x1, %esi
callq 0x20e0
cmpl $0x0, %eax
je 0x3f3a
callq 0x2080
cmpl $0x58, (%rax)
je 0x3f38
jmp 0x3ef9
callq 0x2080
cmpl $0x0, (%rax)
je 0x3f1e
leaq 0x23d5(%rip), %rdi      # 0x62df
movb $0x0, %al
callq 0x4e40
callq 0x2080
movl $0x0, (%rax)
jmp 0x3f2c
leaq 0x23ba(%rip), %rdi      # 0x62df
movb $0x0, %al
callq 0x5090
jmp 0x3f2e
movl $0x1, %edi
callq 0x2270
jmp 0x3f3a
movq -0x10(%rbp), %rdi
callq 0x2030
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]spiped/liball/../lib/util/pthread_create_blocking_np.c
// Function: wrapped_thread
static void *
wrapped_thread(void * cookie)
{
	struct wrapped_cookie * U = cookie;
	void * (*start_routine)(void *);
	void * arg;
	int rc;

	/*
	 * Copy the user-supplied parameters, because U will not be valid
	 * after we signal the parent thread that we have started running.
	 */
	start_routine = U->start_routine;
	arg = U->arg;

	/* Lock mutex. */
	if ((rc = pthread_mutex_lock(&U->mutex)))
		goto err1;

	/* Set the "running" flag and signal the condition variable. */
	U->running = 1;
	if ((rc = pthread_cond_signal(&U->cond)))
		goto err2;

	/* Unlock mutex.  This allows the parent thread to free U. */
	if ((rc = pthread_mutex_unlock(&U->mutex)))
		goto err1;

	/* Run the desired routine. */
	return (start_routine(arg));

err2:
	/*
	 * Don't record any errors in this clean-up; the existing value of rc
	 * is more important.
	 */
	pthread_mutex_unlock(&U->mutex);
err1:
	/* If there was an error, then we can still write to U. */
	U->rc_sync = rc;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
callq 0x2300
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
je 0x5502
jmp 0x5558
movq -0x18(%rbp), %rax
movl $0x1, 0x68(%rax)
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
callq 0x2180
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
je 0x5524
jmp 0x554b
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
callq 0x21d0
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
je 0x553b
jmp 0x5558
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rdi
callq *%rax
movq %rax, -0x8(%rbp)
jmp 0x556a
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
callq 0x21d0
movl -0x2c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x6c(%rax)
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/bench/bulk_insert/main.c
// Function: bulkinsert
static int
bulkinsert(struct wire_requestqueue * Q, FILE * f)
{
	struct bulkinsert_state C;
	uint8_t buf[40];	/* dummy */

	/* Initialize. */
	C.Q = Q;
	C.f = f;
	C.Nip = 0;
	C.failed = 0;
	C.done = 0;
	C.Ndone = 0;
	C.Ndone_saved = 0;

	/* Allocate key and value structures. */
	memset(buf, 0, 40);
	if ((C.key = kvldskey_create(buf, 40)) == NULL)
		goto err0;
	if ((C.val = kvldskey_create(buf, 40)) == NULL)
		goto err1;

	/* Send an initial batch of 4096 requests. */
	if (sendbatch(&C))
		goto err2;

	/* Wait until we've finished. */
	if (events_spin(&C.done) || C.failed) {
		warnp("SET request failed");
		goto err2;
	}

	/* Free the key and value structures. */
	kvldskey_free(C.val);
	kvldskey_free(C.key);

	/* Success! */
	return (0);

err2:
	kvldskey_free(C.val);
err1:
	kvldskey_free(C.key);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movl $0x0, -0x50(%rbp)
movl $0x0, -0x4c(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x2190
leaq -0x90(%rbp), %rdi
movl $0x28, %esi
callq 0x6dc0
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x266c
jmp 0x271a
leaq -0x90(%rbp), %rdi
movl $0x28, %esi
callq 0x6dc0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x268c
jmp 0x2711
leaq -0x68(%rbp), %rdi
callq 0x2730
cmpl $0x0, %eax
je 0x269c
jmp 0x2708
leaq -0x68(%rbp), %rdi
addq $0x1c, %rdi
callq 0x2dc0
cmpl $0x0, %eax
jne 0x26b4
cmpl $0x0, -0x50(%rbp)
je 0x26ed
jmp 0x26b6
callq 0x20a0
cmpl $0x0, (%rax)
je 0x26db
leaq 0xc9fb(%rip), %rdi      # 0xf0c2
movb $0x0, %al
callq 0x6930
callq 0x20a0
movl $0x0, (%rax)
jmp 0x26e9
leaq 0xc9e0(%rip), %rdi      # 0xf0c2
movb $0x0, %al
callq 0x6b80
jmp 0x26eb
jmp 0x2708
movq -0x20(%rbp), %rdi
callq 0x2040
movq -0x28(%rbp), %rdi
callq 0x2040
movl $0x0, -0x4(%rbp)
jmp 0x2721
movq -0x20(%rbp), %rdi
callq 0x2040
movq -0x28(%rbp), %rdi
callq 0x2040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/bench/bulk_insert/main.c
// Function: sendbatch
static int
sendbatch(struct bulkinsert_state * C)
{

	while (C->Nip < 4096) {
		/* Try to read a key-value pair. */
		if (fread(C->key->buf, 40, 1, C->f) < 1)
			break;
		if (fread(C->val->buf, 40, 1, C->f) < 1)
			break;

		/* Send the request. */
		if (proto_kvlds_request_set(C->Q, C->key, C->val,
		    callback_done, C))
			goto err0;
		C->Nip += 1;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x1000, 0x10(%rax)     # imm = 0x1000
jae 0x27e7
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
addq $0x1, %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movl $0x28, %esi
movl $0x1, %edx
callq 0x20c0
cmpq $0x1, %rax
jae 0x2779
jmp 0x27e7
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x1, %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movl $0x28, %esi
movl $0x1, %edx
callq 0x20c0
cmpq $0x1, %rax
jae 0x27a4
jmp 0x27e7
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdx
movq -0x10(%rbp), %r8
leaq 0x3a(%rip), %rcx        # 0x2800
callq 0x7210
cmpl $0x0, %eax
je 0x27d2
jmp 0x27f0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
jmp 0x273c
movl $0x0, -0x4(%rbp)
jmp 0x27f7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/bench/bulk_insert/main.c
// Function: printperf
static void
printperf(struct bulkinsert_state * C)
{
	struct timeval tv_now;
	double T;
	uint64_t N;

	/* Get current time. */
	if (monoclock_get(&tv_now)) {
		warnp("Error reading clock");
		return;
	}

	/* Compute time difference. */
	T = timeval_diff(C->tv_saved, tv_now);

	/* Compute number of requests between then and now. */
	N = C->Ndone - C->Ndone_saved;

	/* Everything completed before now was before 10 s. */
	if (T > 10.0) {
		T = 10.0;
		N -= 1;
	}

	/* Avoid microsecond precision rounding resulting in divide-by-0. */
	if (T < 0.000001)
		T = 0.000001;

	/*
	 * Print requests per second.  Skip this if we handled less than 4096
	 * requests, since that could be a burst of responses from a single
	 * bundle.
	 */
	if (N >= 4096)
		printf("%zu %.0f\n", C->Ndone_saved, (double)N / T);

	/* We've printed this performance point. */
	C->Ndone_saved = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x49a0
cmpl $0x0, %eax
je 0x2a16
jmp 0x29dc
callq 0x20a0
cmpl $0x0, (%rax)
je 0x2a01
leaq 0xc6e8(%rip), %rdi      # 0xf0d5
movb $0x0, %al
callq 0x6930
callq 0x20a0
movl $0x0, (%rax)
jmp 0x2a0f
leaq 0xc6cd(%rip), %rdi      # 0xf0d5
movb $0x0, %al
callq 0x6b80
jmp 0x2a11
jmp 0x2b01
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
subq 0x30(%rcx), %rax
cvtsi2sd %rax, %xmm1
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
subq 0x38(%rcx), %rax
cvtsi2sd %rax, %xmm0
movsd 0xc5d0(%rip), %xmm2     # 0xf010
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rcx
subq 0x28(%rcx), %rax
movq %rax, -0x28(%rbp)
movsd -0x20(%rbp), %xmm0
movsd 0xc59a(%rip), %xmm1     # 0xf008
ucomisd %xmm1, %xmm0
jbe 0x2a8d
movsd 0xc58c(%rip), %xmm0     # 0xf008
movsd %xmm0, -0x20(%rbp)
movq -0x28(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x28(%rbp)
movsd 0xc57b(%rip), %xmm0     # 0xf010
ucomisd -0x20(%rbp), %xmm0
jbe 0x2aa9
movsd 0xc56c(%rip), %xmm0     # 0xf010
movsd %xmm0, -0x20(%rbp)
cmpq $0x1000, -0x28(%rbp)    # imm = 0x1000
jb 0x2af5
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rsi
movaps 0xc55e(%rip), %xmm1     # 0xf020
movq -0x28(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xc55d(%rip), %xmm1     # 0xf030
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
divsd -0x20(%rbp), %xmm0
leaq 0xc5fb(%rip), %rdi      # 0xf0e9
movb $0x1, %al
callq 0x2150
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/debugger.c
// Function: read_piped_input
void read_piped_input ()
{
    int read_bytes;

    piped_input_len = 0;

    int flags = fcntl(0, F_GETFD, 0);
    fcntl(0, F_SETFL, flags | O_NONBLOCK);

    while (piped_input_len < PIPED_INPUT_SIZE) {
        read_bytes = read(0,
                          &(piped_input[piped_input_len]),
                          PIPED_INPUT_SIZE - piped_input_len);
        if (read_bytes <= 0)
            break;
        piped_input_len += read_bytes;
    }

    fclose(stdin);
    freopen("/dev/tty", "r+b", stdin);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq $0x0, 0x9dcd(%rip) # 0xc1c0
xorl %edx, %edx
movl $0x1, %esi
movl %edx, %edi
movb $0x0, %al
callq 0x20d0
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %edx
orl $0x800, %edx            # imm = 0x800
xorl %edi, %edi
movl $0x4, %esi
movb $0x0, %al
callq 0x20d0
cmpq $0x2000, 0x9d98(%rip) # imm = 0x2000
jae 0x246a
leaq 0x9d9f(%rip), %rsi      # 0xc1d0
addq 0x9d88(%rip), %rsi      # 0xc1c0
movl $0x2000, %edx           # imm = 0x2000
subq 0x9d7c(%rip), %rdx      # 0xc1c0
xorl %edi, %edi
callq 0x2190
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jg 0x2456
jmp 0x246a
movslq -0x4(%rbp), %rax
addq 0x9d5f(%rip), %rax      # 0xc1c0
movq %rax, 0x9d58(%rip)      # 0xc1c0
jmp 0x241d
movq 0x9b67(%rip), %rax      # 0xbfd8
movq (%rax), %rdi
callq 0x20f0
movq 0x9b58(%rip), %rax      # 0xbfd8
movq (%rax), %rdx
leaq 0x6b7a(%rip), %rdi      # 0x9004
leaq 0x6b7c(%rip), %rsi      # 0x900d
callq 0x2160
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/debugger.c
// Function: debug_next
int debug_next (struct _vm * vm)
{
    int error = vm_step(vm);

    switch (error) {
    case VM_HALTED :
        printf("VM Halted\n");
        break;
    case VM_BAD_INSTRUCTION :
        printf("VM Encountered Bad Instruction\n");
        break;
    }

    return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x73c0
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
subl $0x1, %eax
je 0x252f
jmp 0x2525
movl -0x10(%rbp), %eax
subl $0x2, %eax
je 0x253f
jmp 0x254d
leaq 0x6adb(%rip), %rdi      # 0x9011
movb $0x0, %al
callq 0x2130
jmp 0x254d
leaq 0x6ad6(%rip), %rdi      # 0x901c
movb $0x0, %al
callq 0x2130
movl -0xc(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/debugger.c
// Function: debug_step
int debug_step (struct _vm * vm)
{
    int depth = 0;
    int error = 0;

    if (vm_opcode(vm) == OP_CALL)
        depth = 1;
    else
        return debug_next(vm);

    while (depth > 0) {
        error = debug_next(vm);
        if (error)
            return error;
        if (vm_opcode(vm) == OP_CALL)
            depth++;
        else if (vm_opcode(vm) == OP_RET)
            depth--;
    }

    return debug_next(vm);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7390
movzbl %al, %eax
cmpl $0x27, %eax
jne 0x2594
movl $0x1, -0x14(%rbp)
jmp 0x25a2
movq -0x10(%rbp), %rdi
callq 0x2500
movl %eax, -0x4(%rbp)
jmp 0x260a
jmp 0x25a4
cmpl $0x0, -0x14(%rbp)
jle 0x25fe
movq -0x10(%rbp), %rdi
callq 0x2500
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x25c4
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x260a
movq -0x10(%rbp), %rdi
callq 0x7390
movzbl %al, %eax
cmpl $0x27, %eax
jne 0x25e0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x25fc
movq -0x10(%rbp), %rdi
callq 0x7390
movzbl %al, %eax
cmpl $0x29, %eax
jne 0x25fa
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x25fc
jmp 0x25a4
movq -0x10(%rbp), %rdi
callq 0x2500
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/debugger.c
// Function: debug_memory
int debug_memory (struct _vm * vm, const char * command)
{
    int address = vm->regs[REG_SP];
    int length  = 8;
    int matched;
    int i;

    matched = sscanf(command, "m %x %d", &address, &length);
    if (matched == -1) {
        matched = sscanf(command, "memory %x %d", &address, &length);
    }

    printf("%04x: ", address);
    for (i = 0; i < length; i++) {
        if (address + i >= 0x10000)
            break;
        printf("%02x", vm->mem[address + i]);
        if (((i + 1) % 16 == 0) && (i + 1 < length))
            printf("\n%04x: ", address + i + 1);
        else if ((i + 1) % 8 == 0)
            printf("  ");
        else if ((i + 1) % 2 == 0)
            printf(" ");
    }

    printf("\n");

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x1a(%rax), %eax
movl %eax, -0x14(%rbp)
movl $0x8, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x69ef(%rip), %rsi      # 0x903c
leaq -0x14(%rbp), %rdx
leaq -0x18(%rbp), %rcx
movb $0x0, %al
callq 0x2210
movl %eax, -0x1c(%rbp)
cmpl $-0x1, -0x1c(%rbp)
jne 0x2682
movq -0x10(%rbp), %rdi
leaq 0x69d4(%rip), %rsi      # 0x9044
leaq -0x14(%rbp), %rdx
leaq -0x18(%rbp), %rcx
movb $0x0, %al
callq 0x2210
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %esi
leaq 0x69cb(%rip), %rdi      # 0x9057
movb $0x0, %al
callq 0x2130
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x2769
movl -0x14(%rbp), %eax
addl -0x20(%rbp), %eax
cmpl $0x10000, %eax          # imm = 0x10000
jl 0x26b8
jmp 0x2769
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x14(%rbp), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %esi
leaq 0x697e(%rip), %rdi      # 0x9051
movb $0x0, %al
callq 0x2130
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl $0x10, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x2711
movl -0x20(%rbp), %eax
addl $0x1, %eax
cmpl -0x18(%rbp), %eax
jge 0x2711
movl -0x14(%rbp), %esi
addl -0x20(%rbp), %esi
addl $0x1, %esi
leaq 0x694e(%rip), %rdi      # 0x9056
movb $0x0, %al
callq 0x2130
jmp 0x2759
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x2734
leaq 0x6933(%rip), %rdi      # 0x905e
movb $0x0, %al
callq 0x2130
jmp 0x2757
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x2755
leaq 0x6911(%rip), %rdi      # 0x905f
movb $0x0, %al
callq 0x2130
jmp 0x2757
jmp 0x2759
jmp 0x275b
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x269a
leaq 0x6994(%rip), %rdi      # 0x9104
movb $0x0, %al
callq 0x2130
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/debugger.c
// Function: set_breakpoint
void set_breakpoint (const char * command)
{
    int break_i;
    uint16_t addr;

    if (    (sscanf(command, "b %hx", &addr) == -1)
         && (sscanf(command, "break %hx", &addr) == -1))
        return;

    for (break_i = 0; break_i < BREAKPOINTS_SIZE; break_i++) {
        if (breakpoints[break_i] == -1) {
            breakpoints[break_i] = addr;
            printf("breakpoint set: %hx\n", addr);
            if (break_i < BREAKPOINTS_SIZE - 1)
                breakpoints[break_i + 1] = -1;
            return;
        }
    }

    printf("breakpoint not set, max breakpoints already set\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x68ca(%rip), %rsi      # 0x9061
leaq -0xe(%rbp), %rdx
movb $0x0, %al
callq 0x2210
cmpl $-0x1, %eax
jne 0x27c4
movq -0x8(%rbp), %rdi
leaq 0x68b5(%rip), %rsi      # 0x9067
leaq -0xe(%rbp), %rdx
movb $0x0, %al
callq 0x2210
cmpl $-0x1, %eax
jne 0x27c4
jmp 0x2840
movl $0x0, -0xc(%rbp)
cmpl $0x20, -0xc(%rbp)
jge 0x2832
movslq -0xc(%rbp), %rcx
leaq 0xba04(%rip), %rax      # 0xe1e0
cmpl $-0x1, (%rax,%rcx,4)
jne 0x2825
movzwl -0xe(%rbp), %edx
movslq -0xc(%rbp), %rcx
leaq 0xb9ef(%rip), %rax      # 0xe1e0
movl %edx, (%rax,%rcx,4)
movzwl -0xe(%rbp), %esi
leaq 0x6872(%rip), %rdi      # 0x9071
movb $0x0, %al
callq 0x2130
cmpl $0x1f, -0xc(%rbp)
jge 0x2823
movl -0xc(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0xb9c4(%rip), %rax      # 0xe1e0
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
jmp 0x2840
jmp 0x2827
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x27cb
leaq 0x684d(%rip), %rdi      # 0x9086
movb $0x0, %al
callq 0x2130
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/debugger.c
// Function: debug_continue
void debug_continue (struct _vm * vm)
{
    int break_i;
    int breakpoint_found = 0;

    if (vm->halted) {
        printf("VM Halted\n");
        return;
    }
    while ((vm->halted == 0) && (breakpoint_found == 0)) {
        vm_step(vm);
        for (break_i = 0; break_i < BREAKPOINTS_SIZE; break_i++) {
            if (breakpoints[break_i] == -1)
                break;
            if (breakpoints[break_i] == vm->regs[REG_IP]) {
                printf("breakpoint: %s\n", vm_ins_str(vm));
                breakpoint_found = 1;
                break;
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x24(%rax)
je 0x2880
leaq 0x679d(%rip), %rdi      # 0x9011
movb $0x0, %al
callq 0x2130
jmp 0x291c
jmp 0x2882
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x24(%rcx)
movb %al, -0x11(%rbp)
jne 0x289b
cmpl $0x0, -0x10(%rbp)
sete %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
testb $0x1, %al
jne 0x28a4
jmp 0x291c
movq -0x8(%rbp), %rdi
callq 0x73c0
movl $0x0, -0xc(%rbp)
cmpl $0x20, -0xc(%rbp)
jge 0x2917
movslq -0xc(%rbp), %rcx
leaq 0xb91b(%rip), %rax      # 0xe1e0
cmpl $-0x1, (%rax,%rcx,4)
jne 0x28cd
jmp 0x2917
movslq -0xc(%rbp), %rcx
leaq 0xb908(%rip), %rax      # 0xe1e0
movl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movzwl 0x16(%rcx), %ecx
cmpl %ecx, %eax
jne 0x290a
movq -0x8(%rbp), %rdi
callq 0x7310
movq %rax, %rsi
leaq 0x67bd(%rip), %rdi      # 0x90b7
movb $0x0, %al
callq 0x2130
movl $0x1, -0x10(%rbp)
jmp 0x2917
jmp 0x290c
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x28b4
jmp 0x2882
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/debugger.c
// Function: dump_core
void dump_core (struct _vm * vm)
{
    FILE * fh;

    fh = fopen("core", "wb");
    if (fh == NULL) {
        fprintf(stderr, "could not open file core\n");
        return;
    }

    fwrite (vm->mem, 1, 65536, fh);

    fclose(fh);

    printf("core written to file 'core'\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x6784(%rip), %rdi      # 0x90c7
leaq 0x6782(%rip), %rsi      # 0x90cc
callq 0x2290
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x2974
movq 0x9697(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x6764(%rip), %rsi      # 0x90cf
movb $0x0, %al
callq 0x21c0
jmp 0x29a5
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
movl $0x10000, %edx          # imm = 0x10000
callq 0x22b0
movq -0x10(%rbp), %rdi
callq 0x20f0
leaq 0x674b(%rip), %rdi      # 0x90e9
movb $0x0, %al
callq 0x2130
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/instruction.c
// Function: ins_reg_str
const char * ins_reg_str (uint8_t reg) {
    switch (reg) {
    case REG_0  : return "r0";
    case REG_1  : return "r1";
    case REG_2  : return "r2";
    case REG_3  : return "r3";
    case REG_4  : return "r4";
    case REG_5  : return "r5";
    case REG_6  : return "r6";
    case REG_7  : return "r7";
    case REG_SP : return "rsp";
    case REG_BP : return "rbp";
    case REG_IP : return "rip";
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dil, %al
movb %al, -0x9(%rbp)
movzbl -0x9(%rbp), %eax
movq %rax, -0x18(%rbp)
subq $0xa, %rax
ja 0x2d72
movq -0x18(%rbp), %rax
leaq 0x6469(%rip), %rcx      # 0x9140
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x688d(%rip), %rax      # 0x9574
movq %rax, -0x8(%rbp)
jmp 0x2d7a
leaq 0x6880(%rip), %rax      # 0x9577
movq %rax, -0x8(%rbp)
jmp 0x2d7a
leaq 0x6876(%rip), %rax      # 0x957a
movq %rax, -0x8(%rbp)
jmp 0x2d7a
leaq 0x686c(%rip), %rax      # 0x957d
movq %rax, -0x8(%rbp)
jmp 0x2d7a
leaq 0x6862(%rip), %rax      # 0x9580
movq %rax, -0x8(%rbp)
jmp 0x2d7a
leaq 0x6858(%rip), %rax      # 0x9583
movq %rax, -0x8(%rbp)
jmp 0x2d7a
leaq 0x684e(%rip), %rax      # 0x9586
movq %rax, -0x8(%rbp)
jmp 0x2d7a
leaq 0x6844(%rip), %rax      # 0x9589
movq %rax, -0x8(%rbp)
jmp 0x2d7a
leaq 0x683a(%rip), %rax      # 0x958c
movq %rax, -0x8(%rbp)
jmp 0x2d7a
leaq 0x6831(%rip), %rax      # 0x9590
movq %rax, -0x8(%rbp)
jmp 0x2d7a
leaq 0x6828(%rip), %rax      # 0x9594
movq %rax, -0x8(%rbp)
jmp 0x2d7a
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/lexer.c
// Function: lexer_append
void lexer_append (struct _lexer * lexer, struct _token * token)
{
//    printf("new token: %d %s\n", token->type, token_str(token));
    if (lexer->last == NULL) {
        lexer->first = token;
        lexer->last  = token;
    }
    else {
        lexer->last->next = token;
        lexer->last = token;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x33c0
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x33dc
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/token.c
// Function: token_create
struct _token * token_create (int type, const char * str, int line)
{
    struct _token * token = (struct _token *) malloc(sizeof(struct _token));
    token->type = type;
    token->next = NULL;
    token->line = line;

    if (str == NULL)
        token->str = NULL;
    else {
        token->str = (char *) malloc(strlen(str) + 1);
        strcpy(token->str, str);
        token->str[strlen(str)] = '\0';
    }

    return token;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x18, %edi
callq 0x21f0
movq %rax, -0x20(%rbp)
movl -0x4(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x10(%rax)
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
cmpq $0x0, -0x10(%rbp)
jne 0x5734
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
jmp 0x5785
movq -0x10(%rbp), %rdi
callq 0x2100
movq %rax, %rdi
addq $0x1, %rdi
callq 0x21f0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x20a0
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2100
movq %rax, %rcx
movq -0x28(%rbp), %rax
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/token.c
// Function: token_str
const char * token_str (struct _token * token)
{
    if (ins_reg_str(token->type) != NULL)
        return ins_reg_str(token->type);
    if (ins_opcode_str(token->type) != NULL)
        return ins_opcode_str(token->type);
    if (token->type == TOK_NEWLINE)
        return "NEWLINE";
    if (token->type == TOK_COMMA)
        return ",";
    return token->str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movzbl %al, %edi
callq 0x2cb0
cmpq $0x0, %rax
je 0x5804
movq -0x10(%rbp), %rax
movl (%rax), %eax
movzbl %al, %edi
callq 0x2cb0
movq %rax, -0x8(%rbp)
jmp 0x5864
movq -0x10(%rbp), %rax
movl (%rax), %eax
movzbl %al, %edi
callq 0x2d80
cmpq $0x0, %rax
je 0x582c
movq -0x10(%rbp), %rax
movl (%rax), %eax
movzbl %al, %edi
callq 0x2d80
movq %rax, -0x8(%rbp)
jmp 0x5864
movq -0x10(%rbp), %rax
cmpl $0x70, (%rax)
jne 0x5842
leaq 0x3e28(%rip), %rax      # 0x9664
movq %rax, -0x8(%rbp)
jmp 0x5864
movq -0x10(%rbp), %rax
cmpl $0x71, (%rax)
jne 0x5858
leaq 0x3e1a(%rip), %rax      # 0x966c
movq %rax, -0x8(%rbp)
jmp 0x5864
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/linenoise.c
// Function: linenoise
char *linenoise(const char *prompt) {
    char buf[LINENOISE_MAX_LINE];
    int count;

    if (isUnsupportedTerm()) {
        size_t len;

        printf("%s",prompt);
        fflush(stdout);
        if (fgets(buf,LINENOISE_MAX_LINE,stdin) == NULL) return NULL;
        len = strlen(buf);
        while(len && (buf[len-1] == '\n' || buf[len-1] == '\r')) {
            len--;
            buf[len] = '\0';
        }
        return strdup(buf);
    } else {
        count = linenoiseRaw(buf,LINENOISE_MAX_LINE,prompt);
        if (count == -1) return NULL;
        return strdup(buf);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1030, %rsp           # imm = 0x1030
movq %rdi, -0x10(%rbp)
callq 0x5a10
cmpl $0x0, %eax
je 0x59c0
movq -0x10(%rbp), %rsi
leaq 0x3d52(%rip), %rdi      # 0x961a
movb $0x0, %al
callq 0x2130
movq 0x66fa(%rip), %rax      # 0xbfd0
movq (%rax), %rdi
callq 0x2200
leaq -0x1010(%rbp), %rdi
movq 0x66ec(%rip), %rax      # 0xbfd8
movq (%rax), %rdx
movl $0x1000, %esi           # imm = 0x1000
callq 0x21a0
cmpq $0x0, %rax
jne 0x590c
movq $0x0, -0x8(%rbp)
jmp 0x59fe
leaq -0x1010(%rbp), %rdi
callq 0x2100
movq %rax, -0x1020(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x1020(%rbp)
movb %al, -0x1021(%rbp)
je 0x597c
movq -0x1020(%rbp), %rax
subq $0x1, %rax
movsbl -0x1010(%rbp,%rax), %ecx
movb $0x1, %al
cmpl $0xa, %ecx
movb %al, -0x1022(%rbp)
je 0x5970
movq -0x1020(%rbp), %rax
subq $0x1, %rax
movsbl -0x1010(%rbp,%rax), %eax
cmpl $0xd, %eax
sete %al
movb %al, -0x1022(%rbp)
movb -0x1022(%rbp), %al
movb %al, -0x1021(%rbp)
movb -0x1021(%rbp), %al
testb $0x1, %al
jne 0x5988
jmp 0x59ae
movq -0x1020(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x1020(%rbp)
movq -0x1020(%rbp), %rax
movb $0x0, -0x1010(%rbp,%rax)
jmp 0x591f
leaq -0x1010(%rbp), %rdi
callq 0x22c0
movq %rax, -0x8(%rbp)
jmp 0x59fe
leaq -0x1010(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0x1000, %esi           # imm = 0x1000
callq 0x5aa0
movl %eax, -0x1014(%rbp)
cmpl $-0x1, -0x1014(%rbp)
jne 0x59ee
movq $0x0, -0x8(%rbp)
jmp 0x59fe
leaq -0x1010(%rbp), %rdi
callq 0x22c0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x1030, %rsp           # imm = 0x1030
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/linenoise.c
// Function: linenoiseRaw
static int linenoiseRaw(char *buf, size_t buflen, const char *prompt) {
    int fd = STDIN_FILENO;
    int count;

    if (buflen == 0) {
        errno = EINVAL;
        return -1;
    }
    if (!isatty(STDIN_FILENO)) {
        if (fgets(buf, buflen, stdin) == NULL) return -1;
        count = strlen(buf);
        if (count && buf[count-1] == '\n') {
            count--;
            buf[count] = '\0';
        }
    } else {
        if (enableRawMode(fd) == -1) return -1;
        count = linenoisePrompt(fd, buf, buflen, prompt);
        disableRawMode(fd);
        printf("\n");
    }
    return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x5ad9
callq 0x2070
movl $0x16, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5b98
xorl %edi, %edi
callq 0x20b0
cmpl $0x0, %eax
jne 0x5b4f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %esi
movq 0x64e2(%rip), %rax      # 0xbfd8
movq (%rax), %rdx
callq 0x21a0
cmpq $0x0, %rax
jne 0x5b10
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5b98
movq -0x10(%rbp), %rdi
callq 0x2100
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0x5b4d
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
jne 0x5b4d
movl -0x28(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movslq -0x28(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x5b92
movl -0x24(%rbp), %edi
callq 0x5fd0
cmpl $-0x1, %eax
jne 0x5b65
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5b98
movl -0x24(%rbp), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x60b0
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %edi
callq 0x68a0
leaq 0x3579(%rip), %rdi      # 0x9104
movb $0x0, %al
callq 0x2130
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/linenoise.c
// Function: linenoiseAddCompletion
void linenoiseAddCompletion(linenoiseCompletions *lc, char *str) {
    size_t len = strlen(str);
    char *copy = malloc(len+1);
    memcpy(copy,str,len+1);
    lc->cvec = realloc(lc->cvec,sizeof(char*)*(lc->len+1));
    lc->cvec[lc->len++] = copy;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2100
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x1, %rdi
callq 0x21f0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x1, %rdx
callq 0x21e0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
addq $0x1, %rsi
shlq $0x3, %rsi
callq 0x2230
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/linenoise.c
// Function: linenoiseHistoryAdd
int linenoiseHistoryAdd(const char *line) {
    char *linecopy;

    if (history_max_len == 0) return 0;
    if (history == NULL) {
        history = malloc(sizeof(char*)*history_max_len);
        if (history == NULL) return 0;
        memset(history,0,(sizeof(char*)*history_max_len));
    }
    linecopy = strdup(line);
    if (!linecopy) return 0;
    if (history_len == history_max_len) {
        free(history[0]);
        memmove(history,history+1,sizeof(char*)*(history_max_len-1));
        history_len--;
    }
    history[history_len] = linecopy;
    history_len++;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpl $0x0, 0x64fd(%rip)      # 0xc180
jne 0x5c91
movl $0x0, -0x4(%rbp)
jmp 0x5d7d
cmpq $0x0, 0x85c7(%rip)      # 0xe260
jne 0x5ce1
movslq 0x64de(%rip), %rdi      # 0xc180
shlq $0x3, %rdi
callq 0x21f0
movq %rax, 0x85ae(%rip)      # 0xe260
cmpq $0x0, 0x85a6(%rip)      # 0xe260
jne 0x5cc8
movl $0x0, -0x4(%rbp)
jmp 0x5d7d
movq 0x8591(%rip), %rdi      # 0xe260
movslq 0x64aa(%rip), %rdx      # 0xc180
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x2150
movq -0x10(%rbp), %rdi
callq 0x22c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x5cfe
movl $0x0, -0x4(%rbp)
jmp 0x5d7d
movl 0x856c(%rip), %eax      # 0xe270
cmpl 0x6476(%rip), %eax      # 0xc180
jne 0x5d51
movq 0x854d(%rip), %rax      # 0xe260
movq (%rax), %rdi
callq 0x2040
movq 0x853e(%rip), %rdi      # 0xe260
movq 0x8537(%rip), %rsi      # 0xe260
addq $0x8, %rsi
movl 0x644d(%rip), %eax      # 0xc180
subl $0x1, %eax
movslq %eax, %rdx
shlq $0x3, %rdx
callq 0x2250
movl 0x8528(%rip), %eax      # 0xe270
addl $-0x1, %eax
movl %eax, 0x851f(%rip)      # 0xe270
movq -0x18(%rbp), %rdx
movq 0x8504(%rip), %rax      # 0xe260
movslq 0x850d(%rip), %rcx      # 0xe270
movq %rdx, (%rax,%rcx,8)
movl 0x8503(%rip), %eax      # 0xe270
addl $0x1, %eax
movl %eax, 0x84fa(%rip)      # 0xe270
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/linenoise.c
// Function: linenoiseHistorySetMaxLen
int linenoiseHistorySetMaxLen(int len) {
    char **new;

    if (len < 1) return 0;
    if (history) {
        int tocopy = history_len;

        new = malloc(sizeof(char*)*len);
        if (new == NULL) return 0;
        if (len < tocopy) tocopy = len;
        memcpy(new,history+(history_max_len-tocopy), sizeof(char*)*tocopy);
        free(history);
        history = new;
    }
    history_max_len = len;
    if (history_len > history_max_len)
        history_len = history_max_len;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
cmpl $0x1, -0x8(%rbp)
jge 0x5dad
movl $0x0, -0x4(%rbp)
jmp 0x5e5a
cmpq $0x0, 0x84ab(%rip)      # 0xe260
je 0x5e30
movl 0x84b3(%rip), %eax      # 0xe270
movl %eax, -0x14(%rbp)
movslq -0x8(%rbp), %rdi
shlq $0x3, %rdi
callq 0x21f0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x5de1
movl $0x0, -0x4(%rbp)
jmp 0x5e5a
movl -0x8(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x5def
movl -0x8(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq 0x8466(%rip), %rsi      # 0xe260
movl 0x6380(%rip), %eax      # 0xc180
subl -0x14(%rbp), %eax
cltq
shlq $0x3, %rax
addq %rax, %rsi
movslq -0x14(%rbp), %rdx
shlq $0x3, %rdx
callq 0x21e0
movq 0x8440(%rip), %rdi      # 0xe260
callq 0x2040
movq -0x10(%rbp), %rax
movq %rax, 0x8430(%rip)      # 0xe260
movl -0x8(%rbp), %eax
movl %eax, 0x6347(%rip)      # 0xc180
movl 0x8431(%rip), %eax      # 0xe270
cmpl 0x633b(%rip), %eax      # 0xc180
jle 0x5e53
movl 0x6333(%rip), %eax      # 0xc180
movl %eax, 0x841d(%rip)      # 0xe270
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/linenoise.c
// Function: linenoiseHistorySave
int linenoiseHistorySave(char *filename) {
    FILE *fp = fopen(filename,"w");
    int j;
    
    if (fp == NULL) return -1;
    for (j = 0; j < history_len; j++)
        fprintf(fp,"%s\n",history[j]);
    fclose(fp);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x39ed(%rip), %rsi      # 0x9874
callq 0x2290
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x5ea0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5eee
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x83c0(%rip), %eax      # 0xe270
jge 0x5ede
movq -0x18(%rbp), %rdi
movq 0x83a3(%rip), %rax      # 0xe260
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x31f7(%rip), %rsi      # 0x90c3
movb $0x0, %al
callq 0x21c0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x5ea7
movq -0x18(%rbp), %rdi
callq 0x20f0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/linenoise.c
// Function: refreshLine
static void refreshLine(int fd, const char *prompt, char *buf, size_t len, size_t pos, size_t cols) {
    char seq[64];
    size_t plen = strlen(prompt);
    
    while((plen+pos) >= cols) {
        buf++;
        len--;
        pos--;
    }
    while (plen+len > cols) {
        len--;
    }

    /* Cursor to left edge */
    snprintf(seq,64,"\x1b[0G");
    if (write(fd,seq,strlen(seq)) == -1) return;
    /* Write the prompt and the current buffer content */
    if (write(fd,prompt,strlen(prompt)) == -1) return;
    if (write(fd,buf,len) == -1) return;
    /* Erase to right */
    snprintf(seq,64,"\x1b[0K");
    if (write(fd,seq,strlen(seq)) == -1) return;
    /* Move cursor to original position. */
    snprintf(seq,64,"\x1b[0G\x1b[%dC", (int)(pos+plen));
    if (write(fd,seq,strlen(seq)) == -1) return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2100
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
addq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x6c03
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x6bcf
jmp 0x6c05
movq -0x78(%rbp), %rax
addq -0x20(%rbp), %rax
cmpq -0x30(%rbp), %rax
jbe 0x6c21
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x6c05
leaq -0x70(%rbp), %rdi
movl $0x40, %esi
leaq 0x2c58(%rip), %rdx      # 0x9889
movb $0x0, %al
callq 0x2140
movl -0x4(%rbp), %eax
movl %eax, -0x84(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x2100
movl -0x84(%rbp), %edi
movq -0x80(%rbp), %rsi
movq %rax, %rdx
callq 0x20e0
cmpq $-0x1, %rax
jne 0x6c6f
jmp 0x6d73
movl -0x4(%rbp), %eax
movl %eax, -0x94(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2100
movl -0x94(%rbp), %edi
movq -0x90(%rbp), %rsi
movq %rax, %rdx
callq 0x20e0
cmpq $-0x1, %rax
jne 0x6cac
jmp 0x6d73
movl -0x4(%rbp), %edi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x20e0
cmpq $-0x1, %rax
jne 0x6cc7
jmp 0x6d73
leaq -0x70(%rbp), %rdi
movl $0x40, %esi
leaq 0x2bb7(%rip), %rdx      # 0x988e
movb $0x0, %al
callq 0x2140
movl -0x4(%rbp), %eax
movl %eax, -0xa4(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x2100
movl -0xa4(%rbp), %edi
movq -0xa0(%rbp), %rsi
movq %rax, %rdx
callq 0x20e0
cmpq $-0x1, %rax
jne 0x6d18
jmp 0x6d73
leaq -0x70(%rbp), %rdi
movq -0x28(%rbp), %rax
addq -0x78(%rbp), %rax
movl %eax, %ecx
movl $0x40, %esi
leaq 0x2b61(%rip), %rdx      # 0x9893
movb $0x0, %al
callq 0x2140
movl -0x4(%rbp), %eax
movl %eax, -0xb4(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x2100
movl -0xb4(%rbp), %edi
movq -0xb0(%rbp), %rsi
movq %rax, %rdx
callq 0x20e0
cmpq $-0x1, %rax
jne 0x6d73
jmp 0x6d73
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/endeav0r[P]hvm/src/vm.c
// Function: vm_create
struct _vm * vm_create (unsigned char * mem)
{
    struct _vm * vm;
    int i;

    vm = (struct _vm *) malloc(sizeof(struct _vm));
    vm->mem = (unsigned char *) malloc(VM_MEMSIZE);
    memcpy(vm->mem, mem, VM_MEMSIZE);

    for (i = 0; i < 11; i++) vm->regs[i] = 0;
    vm->regs[REG_IP] = 0;
    vm->regs[REG_SP] = 0xfff8;
    vm->flags = 0;
    vm->halted = 0;

    return vm;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x128, %edi            # imm = 0x128
callq 0x21f0
movq %rax, -0x10(%rbp)
movl $0x10000, %edi          # imm = 0x10000
callq 0x21f0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
movl $0x10000, %edx          # imm = 0x10000
callq 0x21e0
movl $0x0, -0x14(%rbp)
cmpl $0xb, -0x14(%rbp)
jge 0x6e8a
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movw $0x0, 0x8(%rax,%rcx,2)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6e6a
movq -0x10(%rbp), %rax
movw $0x0, 0x16(%rax)
movq -0x10(%rbp), %rax
movw $0xfff8, 0x1a(%rax)     # imm = 0xFFF8
movq -0x10(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x24(%rax)
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop