LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/mmcco[P]sljit/sljit_src/sljitNativeX86_64.c
// Function: emit_do_imm32
static int emit_do_imm32(struct sljit_compiler *compiler, u_char rex, u_char opcode, long imm)
{
	u_char *inst;
	int length = 1 + (rex ? 1 : 0) + sizeof(int);

	inst = ensure_buf(compiler, 1 + length);
	FAIL_IF(!inst);
	INC_SIZE(length);
	if (rex)
		*inst++ = rex;
	*inst++ = opcode;
	*(int*)inst = imm;
	return SLJIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %r15
xorl %r12d, %r12d
testl %esi, %esi
sete %r12b
movl %r12d, %esi
xorl $0x7, %esi
callq 0x15218
testq %rax, %rax
je 0x1f5c7
movl $0x6, %ecx
subl %r12d, %ecx
movb %cl, (%rax)
movl %ecx, %ecx
addq %rcx, 0x60(%r15)
testb %r14b, %r14b
je 0x1f5cc
movb %r14b, 0x1(%rax)
addq $0x2, %rax
jmp 0x1f5cf
movl (%r15), %eax
jmp 0x1f5d7
incq %rax
movb %bpl, (%rax)
movl %ebx, 0x1(%rax)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/chrispanag[P]operating-systems-scheduler/scheduler-shell.c
// Function: addNode
node* addNode(node* list, pid_t pid, char* name) {
  node* head = list;
  if (head == NULL) {
    head = newNode(0, pid, name);
    head->next = head;
    head->prev = head;
  } else {
    while (list->next != head) {
      list = list->next;
    }
    list->next = newNode(list->id + 1, pid, name);
    list->next->next = head;
    list->next->prev = list;
    head->prev = list->next;
  }
  return head;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
testq %rdi, %rdi
je 0x1592
movq %rdi, %rbx
movq %rdi, %rax
movq %rax, %r12
movq 0x18(%rax), %rax
cmpq %rbx, %rax
jne 0x154a
movl (%r12), %r13d
incl %r13d
movl $0x28, %edi
callq 0x11a0
movq %rax, %r15
movl %r13d, (%rax)
movl %ebp, 0x4(%rax)
movl $0x0, 0x10(%rax)
movq %r14, %rdi
callq 0x1220
movq %rax, 0x8(%r15)
movq %r15, 0x18(%r12)
movq %rbx, 0x18(%r15)
movq %r12, 0x20(%r15)
jmp 0x15bc
movl $0x28, %edi
callq 0x11a0
movq %rax, %rbx
xorl %eax, %eax
movl %eax, (%rbx)
movl %ebp, 0x4(%rbx)
movl %eax, 0x10(%rbx)
movq %r14, %rdi
callq 0x1220
movq %rax, 0x8(%rbx)
movq %rbx, 0x18(%rbx)
movq %rbx, %r15
movq %r15, 0x20(%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_O3/chrispanag[P]operating-systems-scheduler/scheduler-shell.c
// Function: printList
void printList(node* list) {
  node* head = list;
  char priority[5];
  do {
    if (list->priority) {
      strcpy(priority, "HIGH");
    } else {
      strcpy(priority, "LOW");
    }
    printf("id: %d\tpid: %d\tname: %s\tpriority: %s\n", list->id, list->pid, list->name, priority);
    list = list->next;
  } while (list != head);
  printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1a39(%rip), %r14      # 0x301d
movq %rsp, %r15
movq %rdi, %r12
cmpl $0x0, 0x10(%r12)
je 0x1600
movb $0x0, 0x4(%rsp)
movl $0x48474948, (%rsp)     # imm = 0x48474948
jmp 0x1607
movl $0x574f4c, (%rsp)       # imm = 0x574F4C
movl (%r12), %esi
movl 0x4(%r12), %edx
movq 0x8(%r12), %rcx
movq %r14, %rdi
movq %r15, %r8
xorl %eax, %eax
callq 0x10d0
movq 0x18(%r12), %r12
cmpq %rbx, %r12
jne 0x15ea
movl $0xa, %edi
callq 0x1060
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/chrispanag[P]operating-systems-scheduler/scheduler-shell.c
// Function: deleteNode
node* deleteNode(node* list, pid_t pid, int id) {
  // Search by pid
  node* head = list;
  if (id == -1) {
    if (list->pid == pid) {
      disconnectNode(list);
      head = list->next;
      free(list);
      return head;
    }
    list = list->next;
    while (list != head) {
      if (list->pid == pid) {
        disconnectNode(list);
        free(list);
        break;
      }
      list = list->next;
    }
  } else {
    // Search by id
    if (list->id == id) {
      list->next->prev = head->prev;
      head->prev->next = list->next;
      head = list->next;
      free(list);
      return head;
    }
    list = list->next;
    while (list != head) {
      if (list->id == id) {
        list->prev->next = list->next;
        list->next->prev = list->prev;
        free(list);
        break;
      }
      list = list->next;
    }
  }
  return head;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $-0x1, %edx
je 0x1675
cmpl %edx, (%rbx)
jne 0x168f
movq 0x20(%rbx), %rax
movq %rbx, %rdi
movq 0x18(%rbx), %rbx
movq %rax, 0x20(%rbx)
movq %rbx, 0x18(%rax)
jmp 0x16c2
cmpl %esi, 0x4(%rbx)
jne 0x16a1
movq 0x20(%rbx), %rax
movq %rbx, %rdi
movq 0x18(%rbx), %rbx
movq %rbx, 0x18(%rax)
movq %rax, 0x20(%rbx)
jmp 0x16c2
movq %rbx, %rdi
movq 0x18(%rdi), %rdi
cmpq %rbx, %rdi
je 0x16c7
cmpl %edx, (%rdi)
jne 0x1692
jmp 0x16b2
movq %rbx, %rdi
movq 0x18(%rdi), %rdi
cmpq %rbx, %rdi
je 0x16c7
cmpl %esi, 0x4(%rdi)
jne 0x16a4
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rcx
movq %rax, 0x18(%rcx)
movq %rcx, 0x20(%rax)
callq 0x1050
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/chrispanag[P]operating-systems-scheduler/scheduler-shell.c
// Function: accessNode
node* accessNode(node* list, pid_t pid, int id) {
  node* head = list;
  if (id == -1 && pid >= 0) {
    do {
      if (list->pid == pid) {
        return list;
      }
      list = list->next;
    } while (list != head);
    printf("Error: The node with pid: %d, doesn't exist!\n", pid);
  } else {
    do {
      if (list->id == id) {
        return list;
      }
      list = list->next;
    } while (list != head);
    printf("Error: The node with id: %d, doesn't exist!\n", id);
  }
  return NULL;
}

// Assembly:
pushq %rbx
cmpl $-0x1, %edx
sete %al
testl %esi, %esi
setns %cl
movq %rdi, %rbx
testb %al, %cl
je 0x16f8
cmpl %esi, 0x4(%rbx)
je 0x1717
movq 0x18(%rbx), %rbx
cmpq %rdi, %rbx
jne 0x16df
leaq 0x194f(%rip), %rdi      # 0x3043
xorl %ebx, %ebx
jmp 0x1710
cmpl %edx, (%rbx)
je 0x1717
movq 0x18(%rbx), %rbx
cmpq %rdi, %rbx
jne 0x16f8
leaq 0x1965(%rip), %rdi      # 0x3071
xorl %ebx, %ebx
movl %edx, %esi
xorl %eax, %eax
callq 0x10d0
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/chrispanag[P]operating-systems-scheduler/scheduler-shell.c
// Function: sched_create_task
static void sched_create_task(char *executable) {
	pid_t pid = fork();
	if (pid < 0) {
		// Error code
		perror("fork");
	} else if (pid == 0) {
		// Child process code
		free(proc_list);
		char *newargv[] = { executable, NULL, NULL, NULL };
		char *newenviron[] = { NULL };
		raise(SIGSTOP);
		execve(executable, newargv, newenviron);
		// Unreachable point. Execve only returns on error.
		perror("execve");
		exit(1);
	} else {
		// Parent Code
		proc_list = addNode(proc_list, pid, executable);
		nproc++;  /* number of proccesses goes here */
	}
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
callq 0x1250
testl %eax, %eax
js 0x1c56
movq 0x3511(%rip), %rdi      # 0x5148
je 0x1c67
movl %eax, %esi
movq %rbx, %rdx
callq 0x152f
movq %rax, 0x34fe(%rip)      # 0x5148
incl 0x3508(%rip)            # 0x5158
addq $0x30, %rsp
popq %rbx
retq
leaq 0x1472(%rip), %rdi      # 0x30cf
addq $0x30, %rsp
popq %rbx
jmp 0x11d0
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rcx
movq %rbx, %rdx
callq 0x1270
// File: /workspace/github_c_makefile_star2_O3/chrispanag[P]operating-systems-scheduler/scheduler-shell.c
// Function: do_shell
static void do_shell(char *executable, int wfd, int rfd) {
	char arg1[10], arg2[10];
	char *newargv[] = { executable, NULL, NULL, NULL };
	char *newenviron[] = { NULL };

	sprintf(arg1, "%05d", wfd);
	sprintf(arg2, "%05d", rfd);
	newargv[1] = arg1;
	newargv[2] = arg2;

	raise(SIGSTOP);
	execve(executable, newargv, newenviron);

	/* execve() only returns on error */
	perror("scheduler: child: execve");
	exit(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %ebp
movl %edi, %edx
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rbx
movaps %xmm0, 0x10(%rbx)
leaq 0x14d5(%rip), %rax      # 0x3173
movq %rax, (%rbx)
movq %rsp, %r15
movq $0x0, (%r15)
leaq 0x1422(%rip), %r12      # 0x30d4
leaq 0x16(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x11f0
leaq 0xc(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x11f0
movq %r13, 0x8(%rbx)
movq %r14, 0x10(%rbx)
movl $0x13, %edi
callq 0x1040
leaq 0x1482(%rip), %rdi      # 0x3173
movq %rbx, %rsi
movq %r15, %rdx
callq 0x1130
leaq 0x13d6(%rip), %rdi      # 0x30d9
callq 0x11d0
movl $0x1, %edi
callq 0x1200
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/./evec.h
// Function: evini
void* evini(size_t slt_size, size_t count)
{
    size_t store_bytes  = count * slt_size;
    size_t full_bytes = EV_HDR_BYTES + store_bytes;

    evhd_t *hdr = (evhd_t*)malloc(full_bytes);
    ifp(!hdr,
        EV_FAIL("No memory to init vector with %" PRId64 "B\n", full_bytes);
                return NULL;
    );


    memset(hdr,0x00,full_bytes);

    memcpy(hdr->magic1,EV_MAGIC1,sizeof(hdr->magic1));
    hdr->slt_size   = slt_size;
    hdr->slt_count  = count;
    hdr->obj_count  = 0;
    memcpy(hdr->magic2,EV_MAGIC2,sizeof(hdr->magic2));

    void *vec_start = (char*)hdr + EV_HDR_BYTES;
    return vec_start;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rbx
imulq %rdi, %rbx
addq $0x30, %rbx
movl $0x1, %edi
movq %rbx, %rsi
callq 0x10a0
testq %rax, %rax
je 0x1321
movabsq $0x434947414d5645, %rcx # imm = 0x434947414D5645
movq %rcx, (%rax)
movq %r15, 0x8(%rax)
movq %r14, 0x18(%rax)
movabsq $0x5645434947414d, %rcx # imm = 0x5645434947414D
movq %rcx, 0x28(%rax)
addq $0x30, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1e3d(%rip), %rax      # 0x3165
movq %rax, (%rsp)
leaq 0x1d3e(%rip), %rcx      # 0x3071
leaq 0x1d3d(%rip), %r8       # 0x3077
movl $0x1d3, %esi            # imm = 0x1D3
movq %rbx, %r9
xorl %eax, %eax
callq 0x1349
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/./evec.h
// Function: evhdrcheck
int _evhdrcheck(evhd_t* hdr)
{
    if(strncmp(hdr->magic1, EV_MAGIC1, sizeof(EV_MAGIC1)) != 0){
        EV_FAIL("Header magic 1 should be '%s' but found '%.*s'\n", EV_MAGIC1, sizeof(EV_MAGIC1), hdr->magic1);
        return -1;
    };
    if(strncmp(hdr->magic2, EV_MAGIC2, sizeof(EV_MAGIC2)) != 0){
        EV_FAIL("Header magic 2 should be '%s' but found '%.*s'\n", EV_MAGIC2, sizeof(EV_MAGIC2), hdr->magic2);
        return -1;
    };

    if(hdr->obj_count < 0){
        EV_FAIL("Object count cannot be less than zero!\n");
        return -1;
    }

    if(hdr->index < 0){
        EV_FAIL("Index value cannot be less than zero!\n");
        return -1;
    }

    if(hdr->slt_count < 0){
        EV_FAIL("Slot count cannot be less than zero\n");
        return -1;
    }

    if(hdr->obj_count > hdr->slt_count){
        EV_FAIL("More items in vector (%" PRId64 ") than there is space (%" PRId64 ")\n",
                hdr->obj_count,
                hdr->slt_count);
        return -1;
    }

    if(hdr->slt_size < 0){
        EV_FAIL("Slot size cannot be less than zero\n");
        return -1;
    }

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1c82(%rip), %rsi      # 0x309b
movl $0x8, %edx
callq 0x1040
testl %eax, %eax
jne 0x1486
leaq 0x28(%rbx), %r14
leaq 0x1c71(%rip), %rsi      # 0x30a3
movl $0x8, %edx
movq %r14, %rdi
callq 0x1040
testl %eax, %eax
jne 0x14b1
movq 0x10(%rbx), %r9
testq %r9, %r9
js 0x14e2
cmpq $0x0, 0x20(%rbx)
js 0x14fe
movq 0x18(%rbx), %rdx
testq %rdx, %rdx
js 0x151a
cmpq %rdx, %r9
ja 0x1536
cmpq $0x0, 0x8(%rbx)
js 0x1559
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
subq $0x8, %rsp
leaq 0x1cd4(%rip), %rdx      # 0x3165
leaq 0x1c13(%rip), %rcx      # 0x30ab
leaq 0x1c18(%rip), %r8       # 0x30b7
leaq 0x1bf5(%rip), %r9       # 0x309b
movl $0x1e8, %esi            # imm = 0x1E8
xorl %eax, %eax
pushq %rdx
pushq %rbx
jmp 0x14db
subq $0x8, %rsp
leaq 0x1ca9(%rip), %rdx      # 0x3165
leaq 0x1be8(%rip), %rcx      # 0x30ab
leaq 0x1c1d(%rip), %r8       # 0x30e7
leaq 0x1bd2(%rip), %r9       # 0x30a3
movl $0x1ec, %esi            # imm = 0x1EC
xorl %eax, %eax
pushq %rdx
pushq %r14
pushq $0x8
callq 0x1349
leaq 0x1bc2(%rip), %rcx      # 0x30ab
leaq 0x1c27(%rip), %r8       # 0x3117
leaq 0x1c6e(%rip), %r9       # 0x3165
movl $0x1f1, %esi            # imm = 0x1F1
jmp 0x1573
leaq 0x1ba6(%rip), %rcx      # 0x30ab
leaq 0x1c33(%rip), %r8       # 0x313f
leaq 0x1c52(%rip), %r9       # 0x3165
movl $0x1f6, %esi            # imm = 0x1F6
jmp 0x1573
leaq 0x1b8a(%rip), %rcx      # 0x30ab
leaq 0x1c3e(%rip), %r8       # 0x3166
leaq 0x1c36(%rip), %r9       # 0x3165
movl $0x1fb, %esi            # imm = 0x1FB
jmp 0x1573
leaq 0x1c28(%rip), %rdi      # 0x3165
leaq 0x1b67(%rip), %rcx      # 0x30ab
leaq 0x1c40(%rip), %r8       # 0x318b
movl $0x202, %esi            # imm = 0x202
xorl %eax, %eax
pushq %rdi
pushq %rdx
callq 0x1349
leaq 0x1b4b(%rip), %rcx      # 0x30ab
leaq 0x1c5a(%rip), %r8       # 0x31c1
leaq 0x1bf7(%rip), %r9       # 0x3165
movl $0x207, %esi            # imm = 0x207
xorl %eax, %eax
callq 0x1349
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/./evec.h
// Function: evgrow
void* _evgrow(void* vec)
{
    ifp(!vec,
        EV_FAIL("Cannot grow an empty vector!\n");
    );

    evhd_t* hdr = EV_HDR(vec);
    ifp(_evhdrcheck(hdr),
        EV_FAIL("Header sanity check failed\n");
                return NULL;
    );


    const size_t storage_bytes      = hdr->slt_size * hdr->slt_count;
    const size_t new_storage_bytes  = hdr->slt_count ? storage_bytes * EV_GROWTH_FACTOR :
                                      EV_INIT_COUNT * hdr->slt_size;
    const size_t full_bytes         = EV_HDR_BYTES + new_storage_bytes;

    hdr = realloc(hdr, full_bytes);
    if (!hdr){
        EV_FAIL("No memory to grow vector up to %" PRId64 "B\n", full_bytes);
        return NULL;
    }

    memset((char*)hdr + EV_HDR_BYTES + storage_bytes, 0x00, new_storage_bytes - storage_bytes);

    hdr->slt_count  = hdr->slt_count ? hdr->slt_count * EV_GROWTH_FACTOR : EV_INIT_COUNT;

    void *vec_start = (char*)hdr + EV_HDR_BYTES;

    return vec_start;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x161a
movq %rdi, %r15
leaq -0x30(%rdi), %r14
movq %r14, %rdi
callq 0x140b
testl %eax, %eax
jne 0x1636
movq -0x28(%r15), %rbx
movq -0x18(%r15), %rax
movq %rax, %r12
imulq %rbx, %r12
leaq (%r12,%r12), %rcx
shlq $0x3, %rbx
testq %rax, %rax
cmovneq %rcx, %rbx
leaq 0x30(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x10e0
testq %rax, %rax
je 0x1652
movq %rax, %r14
leaq (%rax,%r12), %rdi
addq $0x30, %rdi
movq %rax, %r15
addq $0x30, %r15
subq %r12, %rbx
xorl %esi, %esi
movq %rbx, %rdx
callq 0x1080
movq 0x18(%r14), %rax
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x8, %eax
cmovneq %rcx, %rax
movq %rax, 0x18(%r14)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1bc4(%rip), %rcx      # 0x31e5
leaq 0x1bc5(%rip), %r8       # 0x31ed
leaq 0x1b36(%rip), %r9       # 0x3165
movl $0x212, %esi            # imm = 0x212
jmp 0x1673
leaq 0x1ba8(%rip), %rcx      # 0x31e5
leaq 0x1bc7(%rip), %r8       # 0x320b
leaq 0x1b1a(%rip), %r9       # 0x3165
movl $0x217, %esi            # imm = 0x217
jmp 0x1673
leaq 0x1b0c(%rip), %rax      # 0x3165
movq %rax, (%rsp)
leaq 0x1b81(%rip), %rcx      # 0x31e5
leaq 0x1bbc(%rip), %r8       # 0x3227
movl $0x223, %esi            # imm = 0x223
movq %r15, %r9
xorl %eax, %eax
callq 0x1349
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/./evec.h
// Function: evpush
void* evpush(void* vec, void* obj, size_t obj_size)
{
    void* result = vec;
    if(!vec){
        //Get some memory
        result = evinisz(obj_size);
    }

    evhd_t* hdr = EV_HDR(result);
    ifp(_evhdrcheck(hdr),
        EV_FAIL("Header sanity check failed\n");
                return NULL;
    );

    //Sanity check
    ifp(obj_size > hdr->slt_size,
        EV_FAIL("Object size (%" PRId64 ") is larger than there is space (%" PRId64 ")\n",
                obj_size,
                hdr->slt_size);
                return NULL;
    );

    //Enough space?
    if(hdr->obj_count == hdr->slt_count){
        //Get some more
        result = _evgrow(result);
        hdr = EV_HDR(result);
    }

    void* next_obj = ((char*)result) + hdr->slt_size * hdr->obj_count;
    memcpy(next_obj,obj,obj_size);
    hdr->obj_count++;

    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rdi, %rdi
jne 0x16a0
movl $0x8, %esi
movq %rbx, %rdi
callq 0x12c4
movq %rax, %r15
leaq -0x30(%r15), %r12
movq %r12, %rdi
callq 0x140b
testl %eax, %eax
jne 0x1702
movq -0x28(%r15), %rdx
cmpq %rbx, %rdx
jb 0x1723
movq -0x20(%r15), %rax
cmpq -0x18(%r15), %rax
jne 0x16d5
movq %r15, %rdi
callq 0x157a
movq %rax, %r15
movq %rax, %r12
addq $-0x30, %r12
movq 0x10(%r12), %rdi
imulq 0x8(%r12), %rdi
addq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x10c0
incq 0x10(%r12)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1b43(%rip), %rcx      # 0x324c
leaq 0x1afb(%rip), %r8       # 0x320b
leaq 0x1a4e(%rip), %r9       # 0x3165
movl $0x23b, %esi            # imm = 0x23B
xorl %eax, %eax
callq 0x1349
leaq 0x1a3b(%rip), %rdi      # 0x3165
leaq 0x1b1b(%rip), %rcx      # 0x324c
leaq 0x1b1b(%rip), %r8       # 0x3253
movl $0x243, %esi            # imm = 0x243
movq %rbx, %r9
xorl %eax, %eax
pushq %rdi
pushq %rdx
callq 0x1349
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/./evec.h
// Function: evcnt
size_t evcnt(void* vec)
{
    if(!vec){
        return 0;
    };

    evhd_t *hdr =  EV_HDR(vec);
    ifp(_evhdrcheck(hdr),
        EV_FAIL("Header sanity check failed\n");
                return -1;
    );

    return hdr->obj_count;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x1765
movq %rdi, %rbx
addq $-0x30, %rdi
callq 0x140b
testl %eax, %eax
jne 0x1769
movq -0x20(%rbx), %rax
jmp 0x1767
xorl %eax, %eax
popq %rbx
retq
leaq 0x1b1a(%rip), %rcx      # 0x328a
leaq 0x1a94(%rip), %r8       # 0x320b
leaq 0x19e7(%rip), %r9       # 0x3165
movl $0x25e, %esi            # imm = 0x25E
xorl %eax, %eax
callq 0x1349
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/./evec.h
// Function: evpop
void evpop(void *vec)
{
    ifp(!vec,
        //Uh ohhh....
        EV_FAIL("Cannot pop a NULL vector\n");
        return;
    );

    evhd_t* hdr =  EV_HDR(vec);
    ifp(_evhdrcheck(hdr),
        EV_FAIL("Header sanity check failed\n");
        return;
    );

    if(hdr->obj_count)
        hdr->obj_count--;

}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x19b7
movq %rdi, %rbx
addq $-0x30, %rdi
callq 0x140b
testl %eax, %eax
jne 0x19d3
movq -0x20(%rbx), %rax
testq %rax, %rax
je 0x19b5
decq %rax
movq %rax, -0x20(%rbx)
popq %rbx
retq
leaq 0x19c2(%rip), %rcx      # 0x3380
leaq 0x19c1(%rip), %r8       # 0x3386
leaq 0x1799(%rip), %r9       # 0x3165
movl $0x2d5, %esi            # imm = 0x2D5
jmp 0x19ed
leaq 0x19a6(%rip), %rcx      # 0x3380
leaq 0x182a(%rip), %r8       # 0x320b
leaq 0x177d(%rip), %r9       # 0x3165
movl $0x2db, %esi            # imm = 0x2DB
xorl %eax, %eax
callq 0x1349
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/test.c
// Function: main
int main(void)
{

    for(int i = 0; tests[i].name != 0; i++){
        printf("Running test %i: %s ...", i+1, tests[i].name);
        int result = tests[i].run();
        printf("%s\n", result ? "Success" : "Fail");
        if(!result){
            return -1;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x339d(%rip), %r12      # 0x50a8
movl $0x1, %ebp
leaq 0x17c8(%rip), %r14      # 0x34df
leaq 0x17e1(%rip), %r13      # 0x34ff
leaq 0x17d2(%rip), %rbx      # 0x34f7
movq -0x8(%r12), %rdx
testq %rdx, %rdx
je 0x1d64
movq %r14, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x1070
xorl %eax, %eax
callq *(%r12)
movl %eax, %r15d
testl %eax, %eax
movq %rbx, %rdi
cmoveq %r13, %rdi
callq 0x1050
addq $0x10, %r12
incl %ebp
testl %r15d, %r15d
jne 0x1d25
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1d66
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/test.c
// Function: test1
static int test1()
{
    EV_DBG("test 1\n");
    int* a = evinit(int);
    if(evcnt(a) != 0) return 0;
    if(evvsz(a) != EV_INIT_COUNT) return 0;
    evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl $0x4, %edi
movl $0x8, %esi
callq 0x12c4
movq %rax, %rbx
movq %rax, %rdi
callq 0x1749
xorl %ebp, %ebp
testq %rax, %rax
jne 0x1db4
movq %rbx, %rdi
callq 0x1ab3
cmpq $0x8, %rax
jne 0x1db4
movq %rbx, %rdi
callq 0x1949
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/test.c
// Function: test2
static int test2()
{
    int* a = evinisz(128);
    if(evcnt(a) != 0) return 0;
    if(evvsz(a) != EV_INIT_COUNT) return 0;
    evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl $0x80, %edi
movl $0x8, %esi
callq 0x12c4
movq %rax, %rbx
movq %rax, %rdi
callq 0x1749
xorl %ebp, %ebp
testq %rax, %rax
jne 0x1dfc
movq %rbx, %rdi
callq 0x1ab3
cmpq $0x8, %rax
jne 0x1dfc
movq %rbx, %rdi
callq 0x1949
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/test.c
// Function: test3
static int test3()
{
    int* a = evini(128,64);
    if(evcnt(a) != 0) return 0;
    if(evvsz(a) != 64) return 0;
    evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl $0x80, %edi
movl $0x40, %esi
callq 0x12c4
movq %rax, %rbx
movq %rax, %rdi
callq 0x1749
xorl %ebp, %ebp
testq %rax, %rax
jne 0x1e44
movq %rbx, %rdi
callq 0x1ab3
cmpq $0x40, %rax
jne 0x1e44
movq %rbx, %rdi
callq 0x1949
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/test.c
// Function: test4
static int test4()
{
    int* a = evini(128,64);
    for(int i = 0; i < 1000; i++){
        evpsh(a,i);
    }

    for(int i = 0; i < 1000; i++){
        int* ai = evidx(a,i);
        if( *ai != i){ return 0;}
    }

    evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0x80, %edi
movl $0x40, %esi
callq 0x12c4
movq %rax, %rbx
xorl %ebp, %ebp
leaq 0x4(%rsp), %r14
movl %ebp, 0x4(%rsp)
movl $0x4, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x167a
movq %rax, %rbx
incl %ebp
cmpl $0x3e8, %ebp            # imm = 0x3E8
jne 0x1e6d
xorl %r14d, %r14d
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x178a
movl (%rax), %eax
cmpq %rax, %r15
jne 0x1ec0
incq %r15
cmpq $0x3e8, %r15            # imm = 0x3E8
jne 0x1e94
movq %rbx, %rdi
callq 0x1949
movl $0x1, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/test.c
// Function: test5
static int test5()
{
    char** a = evini(128,64);
    for(int i = 0; i < 1000; i++){
        evpsh(a,"AA");
    }

    for(int i = 0; i < 1000; i++){
        char* ai = evidx(a,i);
        if( strcmp(ai,"AA"))return 0;
    }

    evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0x80, %edi
movl $0x40, %esi
callq 0x12c4
movq %rax, %rbx
movl $0x3e8, %ebp            # imm = 0x3E8
leaq 0x162c(%rip), %r14      # 0x351f
movl $0x3, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x167a
movq %rax, %rbx
decl %ebp
jne 0x1ef3
xorl %r14d, %r14d
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x178a
cmpb $0x41, (%rax)
jne 0x1f46
cmpb $0x41, 0x1(%rax)
jne 0x1f46
cmpb $0x0, 0x2(%rax)
jne 0x1f46
incq %r15
cmpq $0x3e8, %r15            # imm = 0x3E8
jne 0x1f10
movq %rbx, %rdi
callq 0x1949
movl $0x1, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/test.c
// Function: test6
static int test6()
{
    char** a = NULL;
    char* str = "AA";
    for(int i = 0; i < 1000; i++){
        evpsh(a,str);
    }

    for(int i = 0; i < 1000; i++){
        char** ai = evidx(a,i);
        if( strcmp(*ai,str))return 0;
    }

    evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0x3e8, %ebp            # imm = 0x3E8
xorl %ebx, %ebx
leaq 0x15b6(%rip), %r15      # 0x351f
movq %rsp, %r14
movq %r15, (%rsp)
movl $0x8, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x167a
movq %rax, %rbx
decl %ebp
jne 0x1f6c
xorl %r14d, %r14d
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x178a
movq (%rax), %rax
cmpb $0x41, (%rax)
jne 0x1fc6
cmpb $0x41, 0x1(%rax)
jne 0x1fc6
cmpb $0x0, 0x2(%rax)
jne 0x1fc6
incq %r15
cmpq $0x3e8, %r15            # imm = 0x3E8
jne 0x1f8d
movq %rbx, %rdi
callq 0x1949
movl $0x1, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/test.c
// Function: test7
static int test7()
{
    char** a = NULL;
    char* strs[] = {
            "Test",
            "Best",
            "Rest",
            "Vector",
            "Victor",
            0
    };

    for(int i = 0; strs[i]; i++){
        evpsh(a, strs[i]);
    }

    for(int i = 0; i < evcnt(a); i++){
        if(strcmp(a[i],strs[i])) return 0;
    }

    a = evfree(a);
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
xorl %r12d, %r12d
leaq 0x2dda(%rip), %r15      # 0x4dc0
movq %rsp, %r14
xorl %ebx, %ebx
movq (%r12,%r15), %rax
movq %rax, (%rsp)
movl $0x8, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x167a
movq %rax, %rbx
addq $0x8, %r12
cmpq $0x28, %r12
jne 0x1feb
movq %rbx, %rdi
callq 0x1749
testq %rax, %rax
je 0x2047
xorl %r14d, %r14d
xorl %r12d, %r12d
movq (%rbx,%r12,8), %rdi
movq (%r15), %rsi
callq 0x10b0
testl %eax, %eax
jne 0x2055
incq %r12
movq %rbx, %rdi
callq 0x1749
addq $0x8, %r15
cmpq %r12, %rax
ja 0x2023
movq %rbx, %rdi
callq 0x1949
movl $0x1, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/test.c
// Function: test8
static int test8() {
    int* a = NULL;
    int ints[] = { 4,2,6,10,8 };
    int ints_srt[] = { 2,4,6,8,10 };
    const int ints_cnt = sizeof(ints)/sizeof(int);

#define REPEATS 1000
    for(int i = 0; i < REPEATS; i++){
        for(int j = 0; j < ints_cnt; j++){
            evpsh(a, ints[j]);
        }
    }

    if(evcnt(a) != REPEATS * ints_cnt) return 0;


    evsort(a,compare);

    //Remove duplicates
    for(int i = 1; i < evcnt(a); i++){
        if(a[i] == a[i-1]){
            evdel(a,i);
            i--;
        }
    }

    if(evcnt(a) != ints_cnt) {
        printf("%li != %i", evcnt(a) , ints_cnt);
        return 0;
    }

    for(int i =0; i < evcnt(a); i++){
        if(a[i] != ints_srt[i]) {
            printf("%i != %i", a[i], ints_srt[i]);
            return 0;
        }
    }

    a = evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %r15d, %r15d
leaq 0x14e7(%rip), %r12      # 0x3560
leaq 0x4(%rsp), %r14
xorl %ebx, %ebx
xorl %r13d, %r13d
movl (%r13,%r12), %eax
movl %eax, 0x4(%rsp)
movl $0x4, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x167a
movq %rax, %rbx
addq $0x4, %r13
cmpq $0x14, %r13
jne 0x2083
incl %r15d
cmpl $0x3e8, %r15d           # imm = 0x3E8
jne 0x2080
movq %rbx, %rdi
callq 0x1749
xorl %ebp, %ebp
cmpq $0x1388, %rax           # imm = 0x1388
jne 0x219f
leaq 0xde(%rip), %rsi        # 0x21b0
movq %rbx, %rdi
callq 0x1bfa
movq %rbx, %rdi
callq 0x1749
cmpq $0x2, %rax
jb 0x211f
movl $0x1, %ebp
movl $0x1, %r14d
movl (%rbx,%r14,4), %eax
movslq %ebp, %rcx
cmpl -0x4(%rbx,%rcx,4), %eax
jne 0x210d
decl %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19f4
incl %ebp
movslq %ebp, %r14
movq %rbx, %rdi
callq 0x1749
cmpq %r14, %rax
ja 0x20f3
movq %rbx, %rdi
callq 0x1749
movq %rax, %r14
movq %rbx, %rdi
callq 0x1749
cmpq $0x5, %r14
jne 0x2175
testq %rax, %rax
je 0x2166
leaq 0x143c(%rip), %r14      # 0x3580
xorl %r15d, %r15d
movl (%rbx,%r15,4), %esi
movl (%r14), %edx
cmpl %edx, %esi
jne 0x218f
incq %r15
movq %rbx, %rdi
callq 0x1749
addq $0x4, %r14
cmpq %r15, %rax
ja 0x2147
movq %rbx, %rdi
callq 0x1949
movl $0x1, %ebp
jmp 0x219f
leaq 0x13c3(%rip), %rdi      # 0x353f
xorl %ebp, %ebp
movq %rax, %rsi
movl $0x5, %edx
xorl %eax, %eax
callq 0x1070
jmp 0x219f
leaq 0x13b3(%rip), %rdi      # 0x3549
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1070
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/test.c
// Function: test9
static int test9()
{
    int* a = evini(128,64);
    for(int i = 0; i < 1000; i++){
        evpsh(a,i);
    }

    for(int i = 0; i < 999; i++){
        evdel(a,0);
        int* ai = evidx(a,0);
        if(*ai != i +1) return 0;
    }

    evdel(a,0);
    if(evcnt(a) != 0) return 0;

    evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0x80, %edi
movl $0x40, %esi
callq 0x12c4
movq %rax, %rbx
xorl %ebp, %ebp
leaq 0x4(%rsp), %r14
movl %ebp, 0x4(%rsp)
movl $0x4, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x167a
movq %rax, %rbx
incl %ebp
cmpl $0x3e8, %ebp            # imm = 0x3E8
jne 0x21d5
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x19f4
cmpl $0x3e7, %r15d           # imm = 0x3E7
je 0x2228
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x178a
movl (%rax), %eax
incl %r15d
cmpl %r15d, %eax
movl %eax, %r15d
je 0x21f9
jmp 0x2246
movq %rbx, %rdi
callq 0x1749
xorl %r14d, %r14d
testq %rax, %rax
jne 0x2246
movq %rbx, %rdi
callq 0x1949
movl $0x1, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/test.c
// Function: test10
static int test10()
{
    int* a = evini(sizeof(int), 0);
    for(int i = 0;i < 1000;i++){
        evpsh(a, i);
    }

    for(int i = 0;i < 999;i++){
        evpop(a);
        int* a0 = evidx(a,0);
        int* ac = evidx(a,evcnt(a) - 1);

        if(*a0 != 0) return 0;
        if(*ac != 999 - 1 - i) return 0;
    }

    evpop(a);
    if(evcnt(a) != 0) return 0;

    evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %r15d, %r15d
movl $0x4, %edi
xorl %esi, %esi
callq 0x12c4
movq %rax, %rbx
leaq 0x4(%rsp), %r14
movl %r15d, 0x4(%rsp)
movl $0x4, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x167a
movq %rax, %rbx
incl %r15d
cmpl $0x3e8, %r15d           # imm = 0x3E8
jne 0x2272
movl $0x3e6, %ebp            # imm = 0x3E6
movq %rbx, %rdi
callq 0x198f
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x178a
movq %rax, %r15
movq %rbx, %rdi
callq 0x1749
leaq -0x1(%rax), %rsi
movq %rbx, %rdi
callq 0x178a
cmpl $0x0, (%r15)
jne 0x22f9
cmpl (%rax), %ebp
jne 0x22f9
addl $-0x1, %ebp
jb 0x229b
movq %rbx, %rdi
callq 0x198f
movq %rbx, %rdi
callq 0x1749
testq %rax, %rax
jne 0x22f9
movq %rbx, %rdi
callq 0x1949
movl $0x1, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/test.c
// Function: test11
static int test11()
{
    int* a = evinisz(128);
    int* b = NULL;

    for(int i = 0; i < 1000; i++){
        evpsh(a,i);
    }

    b = evcpy(a);

    for(int i = 0; i < 1000; i++){
        int* ai = (int*)evidx(a,i);
        int* bi = (int*)evidx(b,i);

        //Check that these are indeed different peices of memory
        if(ai == bi) return 0;

        //But that they have the same value
        if(*ai != *bi) return 0;
    }

    evfree(a);
    evfree(b);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0x80, %edi
movl $0x8, %esi
callq 0x12c4
movq %rax, %rbx
xorl %ebp, %ebp
leaq 0x4(%rsp), %r14
movl %ebp, 0x4(%rsp)
movl $0x4, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x167a
movq %rax, %rbx
incl %ebp
cmpl $0x3e8, %ebp            # imm = 0x3E8
jne 0x232b
movq %rbx, %rdi
callq 0x1c6d
movq %rax, %r15
xorl %r14d, %r14d
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x178a
movq %rax, %r13
movq %r15, %rdi
movq %r12, %rsi
callq 0x178a
cmpq %rax, %r13
je 0x23a5
movl (%r13), %ecx
cmpl (%rax), %ecx
jne 0x23a5
incq %r12
cmpq $0x3e8, %r12            # imm = 0x3E8
jne 0x235d
movq %rbx, %rdi
callq 0x1949
movq %r15, %rdi
callq 0x1949
movl $0x1, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mgrosvenor[P]evec/test.c
// Function: test12
static int test12()
{
    int* a = NULL;
    size_t c = evcnt(a);
    if(c != 0){
        return 0;
    }

    int sum1    = 0;
    int first   = 0;
    int last    = 0;
    int r       = -1;
    for(int i = 0; i < 1000; i++){
        r = rand();
        if(i == 0){
            first = r;
        }

        evpsh(a,r);
        sum1 += r;
    }

    last = r;

    if(first != *(int*)evhead(a)){
        return 0;
    }

    if(last != *(int*)evtail(a)){
        return 0;
    }

    int sum2 = 0;
    eveach(a, ai){
        sum2 += *ai;
    }

    if(sum1 != sum2){
        return 0;
    }

    evfree(a);

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %r15d, %r15d
movl $0x3e8, %ebp            # imm = 0x3E8
xorl %r12d, %r12d
xorl %ebx, %ebx
movl %r15d, %r13d
callq 0x1110
movl %eax, %r14d
cmpl $0x3e8, %ebp            # imm = 0x3E8
cmovel %eax, %r15d
movl %eax, 0x4(%rsp)
movl $0x4, %edx
movq %rbx, %rdi
leaq 0x4(%rsp), %rsi
callq 0x167a
movq %rax, %rbx
addl %r14d, %r12d
decl %ebp
jne 0x23cf
movq %rbx, %rdi
callq 0x185f
xorl %ebp, %ebp
cmpl (%rax), %r13d
jne 0x2466
movq %rbx, %rdi
callq 0x1749
leaq -0x1(%rax), %rsi
movq %rbx, %rdi
callq 0x178a
cmpl (%rax), %r14d
jne 0x2466
movq %rbx, %rdi
callq 0x185f
xorl %ebp, %ebp
movl $0x0, %r14d
testq %rax, %rax
je 0x2454
xorl %r14d, %r14d
addl (%rax), %r14d
movq %rbx, %rdi
callq 0x18b4
testq %rax, %rax
jne 0x2444
cmpl %r14d, %r12d
jne 0x2466
movq %rbx, %rdi
callq 0x1949
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/vidarr[P]ringbuffer/test/cached_ringbuffer_test.c
// Function: test_cached_ringbuffer_create
void test_cached_ringbuffer_create() {

    Ringbuffer* buffer = 0;

    buffer = ringbuffer_create(1, 0, 0);
    assert(buffer);
    assert(capacity_func == buffer->capacity);
    assert(add_func == buffer->add);
    assert(pop_func == buffer->pop);
    assert(free_func == buffer->free);

    buffer = buffer->free(buffer);

    fprintf(stdout, "cached ringbuffer_create OK\n");

}

// Assembly:
pushq %rax
movl $0x1, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x119c
testq %rax, %rax
je 0x13e4
leaq -0x12c(%rip), %rcx      # 0x1257
cmpq %rcx, (%rax)
jne 0x1403
leaq -0x12b(%rip), %rcx      # 0x1264
cmpq %rcx, 0x8(%rax)
jne 0x1422
leaq -0xe3(%rip), %rcx       # 0x12bd
cmpq %rcx, 0x10(%rax)
jne 0x1441
leaq -0xd0(%rip), %rcx       # 0x12e1
cmpq %rcx, 0x18(%rax)
jne 0x1460
movq %rax, %rdi
callq 0x12e1
movq 0x3c0e(%rip), %rax      # 0x4fd8
movq (%rax), %rcx
leaq 0x1d08(%rip), %rdi      # 0x30dc
movl $0x1c, %esi
movl $0x1, %edx
popq %rax
jmp 0x1070
leaq 0x1c3b(%rip), %rdi      # 0x3026
leaq 0x1c3b(%rip), %rsi      # 0x302d
leaq 0x1c52(%rip), %rcx      # 0x304b
movl $0x5a, %edx
callq 0x1040
leaq 0x1c66(%rip), %rdi      # 0x3070
leaq 0x1c1c(%rip), %rsi      # 0x302d
leaq 0x1c33(%rip), %rcx      # 0x304b
movl $0x5b, %edx
callq 0x1040
leaq 0x1c69(%rip), %rdi      # 0x3092
leaq 0x1bfd(%rip), %rsi      # 0x302d
leaq 0x1c14(%rip), %rcx      # 0x304b
movl $0x5c, %edx
callq 0x1040
leaq 0x1c62(%rip), %rdi      # 0x30aa
leaq 0x1bde(%rip), %rsi      # 0x302d
leaq 0x1bf5(%rip), %rcx      # 0x304b
movl $0x5d, %edx
callq 0x1040
leaq 0x1c5b(%rip), %rdi      # 0x30c2
leaq 0x1bbf(%rip), %rsi      # 0x302d
leaq 0x1bd6(%rip), %rcx      # 0x304b
movl $0x5e, %edx
callq 0x1040
// File: /workspace/github_c_makefile_star2_O3/vidarr[P]ringbuffer/test/cached_ringbuffer_test.c
// Function: get_data_buffer
DataBuffer* get_data_buffer(Ringbuffer* cache, size_t min_length_bytes) {

    DataBuffer* db =  0;

    if(0 != cache) {
        db = cache->pop(cache);
    }

    if(0 == db) {
        db = calloc(1, sizeof(DataBuffer));
    }

    if(db->capacity_bytes < min_length_bytes) {
        if(0 != db->data) {
            free(db->data);
            db->data = 0;
        }
    }

    if(0 == db->data) {
        db->data = calloc(1, sizeof(min_length_bytes) * sizeof(uint8_t));
        db->capacity_bytes = min_length_bytes;
    }

    db->bytes_used = 0;

    return db;

}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
testq %rdi, %rdi
je 0x149b
callq *0x10(%rdi)
testq %rax, %rax
je 0x149b
movq %rax, %r14
movq (%rax), %rax
jmp 0x14af
movl $0x1, %edi
movl $0x18, %esi
callq 0x1050
movq %rax, %r14
xorl %eax, %eax
movq 0x10(%r14), %rdi
cmpq %rbx, %rax
jae 0x14c4
testq %rdi, %rdi
je 0x14c9
callq 0x1030
jmp 0x14c9
testq %rdi, %rdi
jne 0x14df
movl $0x1, %edi
movl $0x8, %esi
callq 0x1050
movq %rax, 0x10(%r14)
movq %rbx, (%r14)
movq $0x0, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/vidarr[P]ringbuffer/test/cached_ringbuffer_test.c
// Function: test_cached_free
void test_cached_free() {

    size_t frees_count = 0;

    Ringbuffer* cache =
        ringbuffer_create(50, free_data_buffer, &frees_count);

    Ringbuffer* buffer = ringbuffer_create(21, cache_free, cache);

    size_t i = 0;

    while(10 > frees_count) {
        /* just some abritrary data that has been allocated dynamically */
        ++i;
        /* We want to create really new data buffers, thus cache == 0 ... */
        DataBuffer* db = get_data_buffer(0, 13);
        buffer->add(buffer, db);
    };

    size_t initial_count = frees_count;

    /* Shift some elements out of cache into ringbuffer */
    for(i = 0; i < 3 * buffer->capacity(buffer); ++i) {
        DataBuffer* item = get_data_buffer(cache, i);
        assert(item);
        buffer->add(buffer, item);
    }

    assert(initial_count == frees_count);
    assert(0 == buffer->free(buffer));

    cache = cache->free(cache);

    fprintf(stdout, "free() OK: %zu\n", frees_count);

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsp, %r15
movq $0x0, (%r15)
leaq -0x43(%rip), %rsi       # 0x14f2
movl $0x32, %edi
movq %r15, %rdx
callq 0x119c
movq %rax, %rbx
leaq -0x211(%rip), %rsi      # 0x133b
movl $0x15, %edi
movq %rax, %rdx
callq 0x119c
movq %rax, %r14
movq (%r15), %r12
cmpq $0x9, %r12
ja 0x1585
movl $0xd, %esi
xorl %edi, %edi
callq 0x147f
movq %r14, %rdi
movq %rax, %rsi
callq *0x8(%r14)
movq (%rsp), %r12
cmpq $0xa, %r12
jb 0x1565
movq %r14, %rdi
callq *(%r14)
testq %rax, %rax
je 0x15bf
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x147f
testq %rax, %rax
je 0x15ff
movq %r14, %rdi
movq %rax, %rsi
callq *0x8(%r14)
incq %r15
movq %r14, %rdi
callq *(%r14)
leaq (%rax,%rax,2), %rax
cmpq %rax, %r15
jb 0x1593
cmpq (%rsp), %r12
jne 0x161e
movq %r14, %rdi
callq *0x18(%r14)
testq %rax, %rax
jne 0x163d
movq %rbx, %rdi
callq *0x18(%rbx)
movq 0x39fa(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
movq (%rsp), %rdx
leaq 0x1b61(%rip), %rsi      # 0x314d
xorl %eax, %eax
callq 0x1060
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1af3(%rip), %rdi      # 0x30f9
leaq 0x1a20(%rip), %rsi      # 0x302d
leaq 0x1aea(%rip), %rcx      # 0x30fe
movl $0xc8, %edx
callq 0x1040
leaq 0x1af1(%rip), %rdi      # 0x3116
leaq 0x1a01(%rip), %rsi      # 0x302d
leaq 0x1acb(%rip), %rcx      # 0x30fe
movl $0xcc, %edx
callq 0x1040
leaq 0x1aef(%rip), %rdi      # 0x3133
leaq 0x19e2(%rip), %rsi      # 0x302d
leaq 0x1aac(%rip), %rcx      # 0x30fe
movl $0xcd, %edx
callq 0x1040
// File: /workspace/github_c_makefile_star2_O3/vidarr[P]ringbuffer/test/cached_ringbuffer_test.c
// Function: main
int main(int argc, char** argv) {

    /* The interface tests */
    size_t free_count = 0;
    Ringbuffer* cache = ringbuffer_create(31, count_free, &free_count);
    free_item = cache_free;
    free_item_additional_arg = cache;

    test_ringbuffer_create();
    test_capacity();
    test_add();
    test_pop();
    cache->free(cache);
    cache = 0;

    /* Caching tests */
    test_cached_ringbuffer_create();
    test_cached_free();

}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x5c(%rip), %rsi        # 0x16d0
movl $0x1f, %edi
callq 0x119c
movq %rax, %rbx
leaq -0x34d(%rip), %rax      # 0x133b
leaq 0x39d1(%rip), %rcx      # 0x5060
movq %rax, (%rcx)
leaq 0x39cf(%rip), %rax      # 0x5068
movq %rbx, (%rax)
xorl %eax, %eax
callq 0x16d4
xorl %eax, %eax
callq 0x175d
xorl %eax, %eax
callq 0x17f7
xorl %eax, %eax
callq 0x1a68
movq %rbx, %rdi
callq *0x18(%rbx)
callq 0x1368
callq 0x151c
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]spiped/perftests/standalone-enc/fd_drain.c
// Function: fd_drain_internal
static int
fd_drain_internal(void * cookie)
{
	int fd = *((int *)cookie);
	uint8_t mybuf[FD_DRAIN_MAX_SIZE];
	ssize_t readlen;

	/* Loop until we hit EOF or an error. */
	do {
		readlen = read(fd, mybuf, FD_DRAIN_MAX_SIZE);
	} while (readlen > 0);

	/* Check for an error. */
	if (readlen == -1) {
		warnp("read");
		goto err0;
	}

	/* Success! */
	return (0);

err0:
	/* Failure!  This value will be the pid's exit code. */
	return (1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x4008, %rsp           # imm = 0x4008
movl (%rdi), %ebx
movq %rsp, %r14
movl $0x4000, %edx           # imm = 0x4000
movl %ebx, %edi
movq %r14, %rsi
callq 0x2150
testq %rax, %rax
jg 0x2acd
movq %rax, %rcx
xorl %eax, %eax
cmpq $-0x1, %rcx
jne 0x2b22
callq 0x2370
cmpl $0x0, (%rax)
je 0x2b0f
movq %rax, %rbx
leaq 0xc6bd(%rip), %rdi      # 0xf1bd
xorl %eax, %eax
callq 0xc0bc
movl $0x0, (%rbx)
jmp 0x2b1d
leaq 0xc6a7(%rip), %rdi      # 0xf1bd
xorl %eax, %eax
callq 0xc1db
movl $0x1, %eax
addq $0x4008, %rsp           # imm = 0x4008
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]spiped/perftests/standalone-enc/standalone_aesctr.c
// Function: standalone_aesctr
int
standalone_aesctr(const size_t * perfsizes, size_t num_perf,
    size_t nbytes_perftest, size_t nbytes_warmup)
{
	struct crypto_aes_key * k_aes;
	uint8_t kbuf[32];

	/* Report what we're doing. */
	printf("Testing AES-CTR\n");

	/* Initialize. */
	memset(kbuf, 0, 32);
	if ((k_aes = crypto_aes_key_expand(kbuf, 32)) == NULL)
		goto err0;

	/* Time the function. */
	if (perftest_buffers(nbytes_perftest, perfsizes, num_perf,
	    nbytes_warmup, 0, aesctr_init, aesctr_func, NULL, k_aes)) {
		warn0("perftest_buffers");
		goto err0;
	}

	/* Clean up. */
	crypto_aes_key_free(k_aes);

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %rbp
leaq 0xc71c(%rip), %rdi      # 0xf281
callq 0x20f0
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x10(%rdi)
movl $0x20, %esi
callq 0x886f
movl $0x1, %ebx
testq %rax, %rax
je 0x2be6
movq %rax, %r15
subq $0x8, %rsp
leaq 0x5cb(%rip), %rax       # 0x3164
leaq 0x57(%rip), %r9         # 0x2bf7
movq %r13, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
pushq %r15
pushq $0x0
pushq %rax
callq 0xbc40
addq $0x20, %rsp
testl %eax, %eax
je 0x2bdc
leaq 0xc6a8(%rip), %rdi      # 0xf270
xorl %eax, %eax
callq 0xc1db
callq 0x2370
movl $0x0, (%rax)
jmp 0x2be6
movq %r15, %rdi
callq 0x890f
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]spiped/perftests/standalone-enc/standalone_aesctr.c
// Function: aesctr_func
static int
aesctr_func(void * cookie, uint8_t * buf, size_t buflen, size_t nreps)
{
	struct crypto_aes_key * k_aes = cookie;
	size_t i;

	/* Do the hashing. */
	for (i = 0; i < nreps; i++) {
		/*
		 * In proto_crypt_enc(), we would append the length to buf,
		 * then encrypt the buffer + 4 bytes of length.  For
		 * simplicity, this test does not imitate that details.
		 */
		crypto_aesctr_buf(k_aes, i, buf, buf, buflen);
	}

	/* Success! */
	return (0);
}

// Assembly:
testq %rcx, %rcx
je 0x31a6
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0x93d4
incq %r13
cmpq %r13, %rbx
jne 0x3181
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
xorl %eax, %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]spiped/perftests/standalone-enc/standalone_aesctr_hmac.c
// Function: standalone_aesctr_hmac
int
standalone_aesctr_hmac(const size_t * perfsizes, size_t num_perf,
    size_t nbytes_perftest, size_t nbytes_warmup)
{
	struct aesctr_hmac_cookie aesctr_hmac_cookie;
	struct aesctr_hmac_cookie * ahc = &aesctr_hmac_cookie;
	HMAC_SHA256_CTX ctx;
	uint8_t kbuf[32];

	/* Report what we're doing. */
	printf("Testing HMAC_SHA256 with AES-CTR\n");

	/* Initialize. */
	ahc->ctx = &ctx;
	memset(kbuf, 0, 32);
	if ((ahc->k_aes = crypto_aes_key_expand(kbuf, 32)) == NULL)
		goto err0;

	/* Time the function. */
	if (perftest_buffers(nbytes_perftest, perfsizes, num_perf,
	    nbytes_warmup, 0, aesctr_hmac_init, aesctr_hmac_func, NULL, ahc)) {
		warn0("perftest_buffers");
		goto err0;
	}

	/* Clean up. */
	crypto_aes_key_free(ahc->k_aes);

	/* Success! */
	return (0);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r13
leaq 0xc0c2(%rip), %rdi      # 0xf291
callq 0x20f0
leaq 0x30(%rsp), %rax
movq %rax, (%rsp)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x10(%rdi)
movl $0x20, %esi
callq 0x886f
movq %rax, 0x8(%rsp)
movl $0x1, %ebx
testq %rax, %rax
je 0x3264
subq $0x8, %rsp
leaq 0x8(%rsp), %rax
leaq 0x600(%rip), %r10       # 0x3815
leaq 0x5b(%rip), %r9         # 0x3277
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
pushq %rax
pushq $0x0
pushq %r10
callq 0xbc40
addq $0x20, %rsp
testl %eax, %eax
je 0x3258
leaq 0xc02c(%rip), %rdi      # 0xf270
xorl %eax, %eax
callq 0xc1db
callq 0x2370
movl $0x0, (%rax)
jmp 0x3264
movq 0x8(%rsp), %rdi
callq 0x890f
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]spiped/perftests/standalone-enc/standalone_aesctr_hmac.c
// Function: aesctr_hmac_func
static int
aesctr_hmac_func(void * cookie, uint8_t * buf, size_t buflen, size_t nreps)
{
	struct aesctr_hmac_cookie * ahc = cookie;
	uint8_t hbuf[32];
	uint8_t pnum_exp[8];
	size_t i;

	/* Do the hashing. */
	for (i = 0; i < nreps; i++) {
		/*
		 * In proto_crypt_enc(), we would append the length to buf,
		 * then encrypt the buffer + 4 bytes of length.  After that,
		 * we'd hash the resulting (larger) buffer.  For simplicity,
		 * this test does not imitate those details.
		 */
		crypto_aesctr_buf(ahc->k_aes, i, buf, buf, buflen);
		HMAC_SHA256_Update(ahc->ctx, buf, buflen);
		be64enc(pnum_exp, i);
		HMAC_SHA256_Update(ahc->ctx, pnum_exp, 8);
	}
	HMAC_SHA256_Final(hbuf, ahc->ctx);

	/* Success! */
	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r15
testq %rcx, %rcx
je 0x3882
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
xorl %r13d, %r13d
leaq 0x8(%rsp), %rbp
movq 0x8(%r15), %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r12, %rcx
movq %r14, %r8
callq 0x93d4
movq (%r15), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x67bc
movq %r13, %rax
bswapq %rax
movq %rax, 0x8(%rsp)
movq (%r15), %rdi
movl $0x8, %edx
movq %rbp, %rsi
callq 0x67bc
incq %r13
cmpq %r13, %rbx
jne 0x383c
movq (%r15), %rsi
leaq 0x10(%rsp), %rdi
callq 0x67ec
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq