LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/dasJ[P]sd-zfs/src/zfs-util.c
// Function: zfs_get_mountpoint
int zfs_get_mountpoint(char *dataset, char **mountpoint) {
	int status;
	char *cmdline[] = { ZFS_CMD, "get", "-Ho", "value", "mountpoint", dataset, NULL };

	status = executeZfs(1, mountpoint, cmdline);
	if (status != 0) {
		fprintf(stderr, "zfs returned %d\n", status);
	}
	if (*mountpoint != NULL) {
		(*mountpoint)[strlen(*mountpoint) - 1] = '\0';
	}
	return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
leaq 0xa09e9(%rip), %rax     # 0x4a3208
leaq -0x50(%rbp), %rcx
movq %rax, (%rcx)
leaq 0xa0a57(%rip), %rax     # 0x4a3284
movq %rax, 0x8(%rcx)
leaq 0xa0a53(%rip), %rax     # 0x4a328b
movq %rax, 0x10(%rcx)
leaq 0xa0a9c(%rip), %rax     # 0x4a32df
movq %rax, 0x18(%rcx)
leaq 0xa0a6a(%rip), %rax     # 0x4a32b8
movq %rax, 0x20(%rcx)
movq %rdi, 0x28(%rcx)
movq $0x0, 0x30(%rcx)
leaq 0xa099a(%rip), %rdi     # 0x4a31ff
movl $0x1, %esi
movq %rbx, %rdx
callq 0x401f40
movl %eax, %r14d
testl %eax, %eax
jne 0x40289a
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x40288e
movq %rbx, %rdi
callq 0x4010e0
movb $0x0, -0x1(%rbx,%rax)
movl %r14d, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq $0x4d3708, %rax         # imm = 0x4D3708
movq (%rax), %rdi
leaq 0xa0a18(%rip), %rsi     # 0x4a32c3
movl %r14d, %edx
xorl %eax, %eax
callq 0x40c8b0
jmp 0x402879
// File: /workspace/github_c_makefile_star2_O1/dasJ[P]sd-zfs/src/zfs-util.c
// Function: zfs_clone_snap
int zfs_clone_snap(char *snapshot, char *datasetTarget, char *mountpoint) {
	int status;
	char **cmdline;
	char *mountpointParam;

	mountpointParam = malloc((strlen("org.zol:mountpoint=") + strlen(mountpoint) + 1) * sizeof(char));
	strcpy(mountpointParam, "org.zol:mountpoint=");
	strcat(mountpointParam, mountpoint);

	cmdline = (char*[]) { ZFS_CMD, "clone",
		"-o", "canmount=noauto",
		"-o", "mountpoint=none",
		"-o", mountpointParam, snapshot, datasetTarget, NULL };

	status = executeZfs(0, NULL, cmdline);
	free(mountpointParam);
	if (status != 0) {
		fprintf(stderr, "zfs returned %d\n", status);
	}

	return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %rdi
callq 0x4010e0
leaq 0x14(%rax), %rdi
callq 0x420f00
movq %rax, %rbx
movups 0xa09fb(%rip), %xmm0    # 0x4a32e5
movups %xmm0, (%rax)
movl $0x3d746e, 0x10(%rax)   # imm = 0x3D746E
movq %rax, %rdi
movq %r12, %rsi
callq 0x401058
leaq 0xa0902(%rip), %rax     # 0x4a3208
leaq -0x78(%rbp), %rcx
movq %rax, (%rcx)
leaq 0xa09e5(%rip), %rax     # 0x4a32f9
movq %rax, 0x8(%rcx)
leaq 0xa0728(%rip), %rax     # 0x4a3047
movq %rax, 0x10(%rcx)
leaq 0xa09d5(%rip), %rdx     # 0x4a32ff
movq %rdx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0xa09d6(%rip), %rdx     # 0x4a330f
movq %rdx, 0x28(%rcx)
movq %rax, 0x30(%rcx)
movq %rbx, 0x38(%rcx)
movq %r15, 0x40(%rcx)
movq %r14, 0x48(%rcx)
movq $0x0, 0x50(%rcx)
leaq 0xa08a3(%rip), %rdi     # 0x4a31ff
xorl %esi, %esi
xorl %edx, %edx
callq 0x401f40
movl %eax, %r14d
movq %rbx, %rdi
callq 0x421240
testl %r14d, %r14d
jne 0x402985
movl %r14d, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq $0x4d3708, %rax         # imm = 0x4D3708
movq (%rax), %rdi
leaq 0xa092d(%rip), %rsi     # 0x4a32c3
movl %r14d, %edx
xorl %eax, %eax
callq 0x40c8b0
jmp 0x402975
// File: /workspace/github_c_makefile_star2_O1/dasJ[P]sd-zfs/src/zfs-util.c
// Function: zfs_get_alt_mp
int zfs_get_alt_mp(char *dataset, char **mountpoint) {
	int status;
	char *cmdline[] = { ZFS_CMD, "get", "-Ho", "value", "org.zol:mountpoint", dataset, NULL };

	status = executeZfs(1, mountpoint, cmdline);
	if (*mountpoint != NULL) {
		(*mountpoint)[strlen(*mountpoint) - 1] = '\0';
	}
	return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
leaq 0xa0851(%rip), %rax     # 0x4a3208
leaq -0x50(%rbp), %rcx
movq %rax, (%rcx)
leaq 0xa08bf(%rip), %rax     # 0x4a3284
movq %rax, 0x8(%rcx)
leaq 0xa08bb(%rip), %rax     # 0x4a328b
movq %rax, 0x10(%rcx)
leaq 0xa0904(%rip), %rax     # 0x4a32df
movq %rax, 0x18(%rcx)
leaq 0xa0939(%rip), %rax     # 0x4a331f
movq %rax, 0x20(%rcx)
movq %rdi, 0x28(%rcx)
movq $0x0, 0x30(%rcx)
leaq 0xa0802(%rip), %rdi     # 0x4a31ff
movl $0x1, %esi
movq %r14, %rdx
callq 0x401f40
movl %eax, %ebx
movq (%r14), %r14
testq %r14, %r14
je 0x402a22
movq %r14, %rdi
callq 0x4010e0
movb $0x0, -0x1(%r14,%rax)
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/evanwire[P]GitClone/server.c
// Function: readFile
char* readFile(char* fileName){
  //Finding file's size
  struct stat st;
  stat(fileName, &st);
  int size = st.st_size;

  char* file_contents = malloc(size * sizeof(char));
  if(!file_contents){
    printf("\nError: was unable to use malloc(). Please try again.\n");
    exit(1);
  }
  memset(file_contents, 0, size);

  int file_fd = open(fileName, O_RDONLY);

  int bytes_read = read(file_fd, file_contents, size);
  file_contents[bytes_read] = '\0';
  close(file_fd);
  return file_contents;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rdi, %r15
leaq -0xa8(%rbp), %rbx
movq %rbx, %rsi
callq 0x1140
movslq 0x30(%rbx), %r14
movq %r14, %rdi
callq 0x11d0
testq %rax, %rax
je 0x33b8
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x10d0
movq %r15, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x10f0
movl %eax, %r15d
movl %eax, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x11f0
cltq
movb $0x0, (%rbx,%rax)
movl %r15d, %edi
callq 0x12b0
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x133f(%rip), %rdi      # 0x46fe
callq 0x1230
movl $0x1, %edi
callq 0x11a0
// File: /workspace/github_c_makefile_star2_O1/evanwire[P]GitClone/server.c
// Function: hashIt
char* hashIt(char* input){
  unsigned char digest[MD5_DIGEST_LENGTH];
  MD5(input, strlen(input), digest);
  int i;
  char * result=(char*)malloc(33*sizeof(char));
  memset(result,'\0',33);
  for(i = 0; i < MD5_DIGEST_LENGTH; i++){
     sprintf(result+2*i, "%02x", digest[i]);
  }

  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x10b0
leaq -0x30(%rbp), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1240
movl $0x21, %edi
callq 0x11d0
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movb $0x0, 0x20(%rax)
leaq 0xef4(%rip), %r14       # 0x430a
movq %rax, %r15
xorl %r12d, %r12d
movzbl -0x30(%rbp,%r12), %edx
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1060
incq %r12
addq $0x2, %r15
cmpq $0x10, %r12
jne 0x341c
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/bin2tap/bin2tap.c
// Function: str2int
int str2int (char *str, int *num) {
	int i=0;

	*num = 0;
	while (str[i] != 0) {
		if (str[i] <= '9' && str[i] >= '0') {
			*num *= 10;
			*num += str[i++] - '0';
		}
		else 
			return 1;
	}
	return 0;
}

// Assembly:
movl $0x0, (%rsi)
movb (%rdi), %cl
testb %cl, %cl
je 0x1370
incq %rdi
xorl %eax, %eax
addb $-0x30, %cl
cmpb $0x9, %cl
ja 0x1373
addl %eax, %eax
leal (%rax,%rax,4), %eax
movl %eax, (%rsi)
movsbl -0x1(%rdi), %ecx
addl %ecx, %eax
addl $-0x30, %eax
movl %eax, (%rsi)
movb (%rdi), %cl
incq %rdi
testb %cl, %cl
jne 0x134d
xorl %eax, %eax
retq
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe.c
// Function: pipe_reserve
void pipe_reserve(pipe_generic_t* gen, size_t count)
{
    pipe_t* p = PIPIFY(gen);

    count *= __pipe_elem_size(p); // now `count' is in "bytes" instead of "elements".

    if(count == 0)
        count = DEFAULT_MINCAP;

    size_t max_cap = p->max_cap;

    WHILE_LOCKED(
        if(unlikely(count <= bytes_in_use(make_snapshot(p))))
            break;

        p->min_cap = min(count, max_cap);
        resize_buffer(p, count);
    );
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
imulq (%rdi), %rsi
testq %rsi, %rsi
pushq $0x20
popq %r15
cmovneq %rsi, %r15
movq 0x10(%rdi), %r13
leaq 0x70(%rdi), %r14
movq %r14, %rdi
callq 0x1160
leaq 0x48(%rbx), %r12
movq %r12, %rdi
callq 0x1160
movq %rbx, %rdi
callq 0x1573
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %rdx
movq 0x18(%rbx), %rsi
addq %rcx, %rsi
subq %rsi, %rax
addq %rdx, %rax
subq %rcx, %rdx
cmovbeq %rax, %rdx
subq (%rbx), %rdx
cmpq %rdx, %r15
jbe 0x1206
cmpq %r13, %r15
cmovbq %r15, %r13
movq %r13, 0x8(%rbx)
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2157
movq %rbx, %rdi
callq 0x1573
movq %r12, %rdi
callq 0x10e0
movq %r14, %rdi
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x10e0
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe.c
// Function: pipe_new
pipe_t* pipe_new(size_t elem_size, size_t original_limit)
{
    assertume(elem_size != 0);

    if(elem_size == 0)
        return NULL;

    pipe_t* p = malloc(sizeof *p);

    assert(DEFAULT_MINCAP >= 1);

    size_t cap = DEFAULT_MINCAP * elem_size;
    char*  buf = malloc(cap);

    // Change the limit from being in "elements" to being in "bytes", and make
    // room for the sentinel element.
    size_t limit = (original_limit + 1) * elem_size;

    if(unlikely(p == NULL || buf == NULL))
        return free(p), free(buf), NULL;

    *p = (pipe_t) {
        .elem_size  = elem_size,
        .min_cap = cap,
        .max_cap = original_limit ? next_pow2(max(limit, cap)) : ~(size_t)0,

        .buffer = buf,
        .bufend = buf + cap,
        .begin  = buf,
        .end    = buf + elem_size,

        // Since we're issuing a pipe_t, it counts as both a producer and a
        // consumer since it can issue new instances of both. Therefore, the
        // refcounts both start at 1; not the intuitive 0.
        .producer_refcount = 1,
        .consumer_refcount = 1,
    };

    mutex_init(&p->begin_lock);
    mutex_init(&p->end_lock);

    cond_init(&p->just_pushed);
    cond_init(&p->just_popped);

    check_invariants(p);

    return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x1508
movq %rsi, %r13
movq %rdi, %r14
movl $0xf8, %edi
callq 0x10f0
movq %rax, %rbx
movq %r14, %r12
shlq $0x5, %r12
movq %r12, %rdi
callq 0x10f0
movq %rax, %r15
testq %rbx, %rbx
je 0x14f4
testq %r15, %r15
je 0x14f4
testq %r13, %r13
je 0x1456
incq %r13
imulq %r14, %r13
cmpq %r12, %r13
cmovbeq %r12, %r13
movq %r13, %rdi
callq 0x1527
jmp 0x145d
movq $-0x1, %rax
leaq (%r15,%r12), %rcx
movq %r15, %rdx
addq %r14, %rdx
movq %r14, (%rbx)
movq %r12, 0x8(%rbx)
movq %rax, 0x10(%rbx)
movq %r15, 0x18(%rbx)
movq %rcx, 0x20(%rbx)
movq %r15, 0x28(%rbx)
movq %rdx, 0x30(%rbx)
movl $0x1, %eax
movq %rax, 0x38(%rbx)
movq %rax, 0x40(%rbx)
leaq 0x48(%rbx), %r14
leaq 0x70(%rbx), %r15
leaq 0x98(%rbx), %r12
movq %rbx, %r13
addq $0xc8, %r13
movl $0xb0, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x10a0
movq %r14, %rdi
xorl %esi, %esi
callq 0x1150
movq %r15, %rdi
xorl %esi, %esi
callq 0x1150
movq %r12, %rdi
xorl %esi, %esi
callq 0x10d0
movq %r13, %rdi
xorl %esi, %esi
callq 0x10d0
movq %rbx, %rdi
callq 0x1573
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x1030
movq %r15, %rdi
callq 0x1030
xorl %ebx, %ebx
jmp 0x14e7
leaq 0x2cb7(%rip), %rdi      # 0x41c6
leaq 0x2b49(%rip), %rsi      # 0x405f
leaq 0x2b49(%rip), %rcx      # 0x4066
movl $0x223, %edx            # imm = 0x223
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe.c
// Function: pipe_producer_new
pipe_producer_t* pipe_producer_new(pipe_t* p)
{
    mutex_lock(&p->begin_lock);
        p->producer_refcount++;
    mutex_unlock(&p->begin_lock);

    return (pipe_producer_t*)p;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x48(%rdi), %r14
movq %r14, %rdi
callq 0x1160
incq 0x38(%rbx)
movq %r14, %rdi
callq 0x10e0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe.c
// Function: pipe_consumer_new
pipe_consumer_t* pipe_consumer_new(pipe_t* p)
{
    mutex_lock(&p->end_lock);
        p->consumer_refcount++;
    mutex_unlock(&p->end_lock);

    return (pipe_consumer_t*)p;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x70(%rdi), %r14
movq %r14, %rdi
callq 0x1160
incq 0x40(%rbx)
movq %r14, %rdi
callq 0x10e0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe.c
// Function: pipe_free
void pipe_free(pipe_t* p)
{
    size_t new_producer_refcount,
           new_consumer_refcount;

    mutex_lock(&p->begin_lock);
        assertume(p->producer_refcount > 0);
        new_producer_refcount = --p->producer_refcount;
    mutex_unlock(&p->begin_lock);

    mutex_lock(&p->end_lock);
        assertume(p->consumer_refcount > 0);
        new_consumer_refcount = --p->consumer_refcount;
    mutex_unlock(&p->end_lock);

    if(unlikely(new_consumer_refcount == 0))
    {
        p->buffer = (free(p->buffer), NULL);

        if(likely(new_producer_refcount > 0))
            cond_broadcast(&p->just_popped);
        else
            deallocate(p);
    }
    else if(unlikely(new_producer_refcount == 0))
        cond_broadcast(&p->just_pushed);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x48(%rdi), %r15
movq %r15, %rdi
callq 0x1160
movq 0x38(%rbx), %r14
testq %r14, %r14
je 0x1886
decq %r14
movq %r14, 0x38(%rbx)
movq %r15, %rdi
callq 0x10e0
leaq 0x70(%rbx), %r15
movq %r15, %rdi
callq 0x1160
movq 0x40(%rbx), %r12
testq %r12, %r12
je 0x18a5
leaq -0x1(%r12), %rax
movq %rax, 0x40(%rbx)
movq %r15, %rdi
callq 0x10e0
decq %r12
je 0x185f
testq %r14, %r14
je 0x186c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rbx, %rdi
movq %r14, %rsi
callq 0x122b
jmp 0x1853
addq $0x98, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1040
leaq 0x27fa(%rip), %rdi      # 0x4087
leaq 0x27cb(%rip), %rsi      # 0x405f
leaq 0x2805(%rip), %rcx      # 0x40a0
movl $0x27c, %edx            # imm = 0x27C
callq 0x1090
leaq 0x280d(%rip), %rdi      # 0x40b9
leaq 0x27ac(%rip), %rsi      # 0x405f
leaq 0x27e6(%rip), %rcx      # 0x40a0
movl $0x281, %edx            # imm = 0x281
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe.c
// Function: deallocate
static void deallocate(pipe_t* p)
{
    assertume(p->producer_refcount == 0);
    assertume(p->consumer_refcount == 0);

    mutex_destroy(&p->begin_lock);
    mutex_destroy(&p->end_lock);

    cond_destroy(&p->just_pushed);
    cond_destroy(&p->just_popped);

    free(p->buffer);
    free(p);
}

// Assembly:
pushq %rbx
cmpq $0x0, 0x38(%rdi)
jne 0x1912
movq %rdi, %rbx
cmpq $0x0, 0x40(%rdi)
jne 0x1931
leaq 0x48(%rbx), %rdi
callq 0x1080
leaq 0x70(%rbx), %rdi
callq 0x1080
leaq 0x98(%rbx), %rdi
callq 0x1110
leaq 0xc8(%rbx), %rdi
callq 0x1110
movq 0x18(%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
popq %rbx
jmp 0x1030
leaq 0x29c2(%rip), %rdi      # 0x42db
leaq 0x273f(%rip), %rsi      # 0x405f
leaq 0x29ce(%rip), %rcx      # 0x42f5
movl $0x269, %edx            # imm = 0x269
callq 0x1090
leaq 0x2829(%rip), %rdi      # 0x4161
leaq 0x2720(%rip), %rsi      # 0x405f
leaq 0x29af(%rip), %rcx      # 0x42f5
movl $0x26a, %edx            # imm = 0x26A
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe.c
// Function: pipe_producer_free
void pipe_producer_free(pipe_producer_t* handle)
{
    pipe_t* p = PIPIFY(handle);
    size_t new_producer_refcount;

    mutex_lock(&p->begin_lock);
        assertume(p->producer_refcount > 0);
        new_producer_refcount = --p->producer_refcount;
    mutex_unlock(&p->begin_lock);

    if(unlikely(new_producer_refcount == 0))
    {
        size_t consumer_refcount;

        mutex_lock(&p->end_lock);
            consumer_refcount = p->consumer_refcount;
        mutex_unlock(&p->end_lock);

        // If there are still consumers, wake them up if they're waiting on
        // input from a producer. Otherwise, since we're the last handle
        // altogether, we can free the pipe.
        if(likely(consumer_refcount > 0))
            cond_broadcast(&p->just_pushed);
        else
            deallocate(p);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x48(%rdi), %r14
movq %r14, %rdi
callq 0x1160
movq 0x38(%rbx), %r15
testq %r15, %r15
je 0x1992
leaq -0x1(%r15), %rax
movq %rax, 0x38(%rbx)
movq %r14, %rdi
callq 0x10e0
decq %r15
je 0x1988
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x126d
jmp 0x1982
leaq 0x26ee(%rip), %rdi      # 0x4087
leaq 0x26bf(%rip), %rsi      # 0x405f
leaq 0x272b(%rip), %rcx      # 0x40d2
movl $0x298, %edx            # imm = 0x298
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe.c
// Function: pipe_pop
size_t pipe_pop(pipe_consumer_t* p, void* target, size_t count)
{
    size_t elem_size = __pipe_elem_size(PIPIFY(p));

    size_t bytes_left  = count*elem_size;
    size_t bytes_popped = 0;
    size_t ret = -1;

    do {
        ret = __pipe_pop(PIPIFY(p), target, bytes_left);
        target = (void*)((char*)target + ret);
        bytes_popped += ret;
        bytes_left   -= ret;
    } while(ret != 0 && bytes_left);

    return bytes_popped / elem_size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %r13
imulq %r13, %rbx
xorl %r12d, %r12d
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1e05
addq %rax, %r12
testq %rax, %rax
je 0x1df3
addq %rax, %r14
subq %rax, %rbx
jne 0x1dd5
movq %r12, %rax
xorl %edx, %edx
divq %r13
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe.c
// Function: resize_buffer
static snapshot_t resize_buffer(pipe_t* p, size_t new_size)
{
    check_invariants(p);

    const size_t max_cap   = p->max_cap,
                 min_cap   = p->min_cap,
                 elem_size = __pipe_elem_size(p);

    assertume(new_size >= bytes_in_use(make_snapshot(p)));
    assertume(new_size + elem_size > new_size); // overflow
    new_size += elem_size; // include sentinel

    if(unlikely(new_size >= max_cap))
        new_size = max_cap;

    if(new_size <= min_cap)
        return make_snapshot(p);

    char* new_buf = malloc(new_size);
    p->end = copy_pipe_into_new_buf(make_snapshot(p), new_buf);

    p->begin  =
    p->buffer = (free(p->buffer), new_buf);

    p->bufend = new_buf + new_size;

    check_invariants(p);

    return make_snapshot(p);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
movq %rsi, %rdi
callq 0x1573
movq 0x18(%r14), %rdi
movq 0x20(%r14), %r8
movq 0x28(%r14), %r15
movq 0x30(%r14), %rbp
movq %r8, %rcx
subq %rdi, %rcx
subq %r15, %rcx
addq %rbp, %rcx
movq %rbp, %r12
subq %r15, %r12
cmovaq %r12, %rcx
movq (%r14), %rsi
subq %rsi, %rcx
cmpq %rbx, %rcx
ja 0x22b3
leaq (%rsi,%rbx), %r13
cmpq %rbx, %r13
jbe 0x22d2
movq 0x10(%r14), %rdx
movq 0x8(%r14), %rcx
cmpq %rdx, %r13
jae 0x22ab
cmpq %rcx, %r13
jbe 0x2203
movq %r8, 0x10(%rsp)
movq %rdi, (%rsp)
movq %r13, %rdi
callq 0x10f0
movq %rax, %rbx
cmpq %rbp, %r15
jae 0x221d
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x10c0
addq %rbx, %r12
movq %r12, %rbp
movq (%rsp), %r15
jmp 0x224e
movq 0x8(%rsp), %rax
movq %rdi, (%rax)
movq %r8, 0x8(%rax)
movq %r15, 0x10(%rax)
movq %rbp, 0x18(%rax)
movq %rsi, 0x20(%rax)
jmp 0x229c
movq 0x10(%rsp), %r12
subq %r15, %r12
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x10c0
addq %rbx, %r12
movq (%rsp), %r15
subq %r15, %rbp
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x10c0
addq %r12, %rbp
movq %rbp, 0x30(%r14)
movq %r15, %rdi
callq 0x1030
movq %rbx, 0x18(%r14)
movq %rbx, 0x28(%r14)
addq %r13, %rbx
movq %rbx, 0x20(%r14)
movq %r14, %rdi
callq 0x1573
movq 0x18(%r14), %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%r14), %rcx
movq %rcx, 0x8(%rax)
movq 0x28(%r14), %rcx
movq %rcx, 0x10(%rax)
movq 0x30(%r14), %rcx
movq %rcx, 0x18(%rax)
movq (%r14), %rcx
movq %rcx, 0x20(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r13
jmp 0x21cb
leaq 0x2152(%rip), %rdi      # 0x440c
leaq 0x1d9e(%rip), %rsi      # 0x405f
leaq 0x216f(%rip), %rcx      # 0x4437
movl $0x2e9, %edx            # imm = 0x2E9
callq 0x1090
leaq 0x2189(%rip), %rdi      # 0x4462
leaq 0x1d7f(%rip), %rsi      # 0x405f
leaq 0x2150(%rip), %rcx      # 0x4437
movl $0x2ea, %edx            # imm = 0x2EA
callq 0x1090
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe_test.c
// Function: double_elems
static void double_elems(const void* elems, size_t count, pipe_producer_t* out, void* aux)
{
    UNUSED_PARAMETER(aux);

    if(count == 0)
        return;

    testdata_t outbuffer[count];

    memcpy(outbuffer, elems, count*sizeof(testdata_t));

    for(size_t i = 0; i < count; ++i)
        outbuffer[i].new *= 2;

    pipe_push(out, outbuffer, count);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
testq %rsi, %rsi
je 0x2908
movq %rdx, %r14
movq %rdi, %rsi
movq %rsp, %r12
movq %rsp, %r15
leaq 0xf(,%rbx,8), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
leaq (,%rbx,8), %rdx
movq %r15, %rdi
callq 0x10c0
xorl %eax, %eax
shll 0x4(%r15,%rax,8)
incq %rax
cmpq %rax, %rbx
jne 0x28ea
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1db0
movq %r12, %rsp
leaq -0x20(%rbp), %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe_test.c
// Function: test_issue_5
DEF_TEST(issue_5)
{
  static const int NUM = 32;
  pipe_t* pipe = pipe_new(sizeof(int), 0);
  pipe_producer_t* p = pipe_producer_new(pipe);
  pipe_consumer_t* c = pipe_consumer_new(pipe);
  pipe_free(pipe);

  int data[NUM];
  for(int i=0; i < NUM; ++i)
    data[i] = i;
  pipe_push(p, data, NUM);
  pipe_producer_free(p);

  int buf[NUM];
  size_t ret = pipe_pop(c, buf, NUM);
  assert(ret == NUM);
  for(int i=0; i < NUM; ++i)
    assert(buf[i] == data[i]);

  pipe_consumer_free(c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
xorl %r12d, %r12d
movl $0x4, %edi
xorl %esi, %esi
callq 0x13f0
movq %rax, %r15
movq %rax, %rdi
callq 0x17a0
movq %rax, %r14
movq %r15, %rdi
callq 0x17ca
movq %rax, %rbx
movq %r15, %rdi
callq 0x17f4
movl %r12d, -0xa0(%rbp,%r12,4)
incq %r12
cmpq $0x20, %r12
jne 0x29bc
leaq -0xa0(%rbp), %rsi
movl $0x20, %edx
movq %r14, %rdi
callq 0x1db0
movq %r14, %rdi
callq 0x1950
movq %rsp, %r14
addq $-0x80, %r14
movq %r14, %rsp
movl $0x20, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1db9
cmpq $0x20, %rax
jne 0x2a55
xorl %eax, %eax
movl (%r14,%rax,4), %ecx
cmpl -0xa0(%rbp,%rax,4), %ecx
jne 0x2a36
incq %rax
cmpq $0x20, %rax
jne 0x2a0b
movq %rbx, %rdi
callq 0x19b1
leaq -0x20(%rbp), %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c17(%rip), %rdi      # 0x4654
leaq 0x1b0a(%rip), %rsi      # 0x454e
leaq 0x1bf5(%rip), %rcx      # 0x4640
movl $0xf7, %edx
callq 0x1090
leaq 0x1bd9(%rip), %rdi      # 0x4635
leaq 0x1aeb(%rip), %rsi      # 0x454e
leaq 0x1bd6(%rip), %rcx      # 0x4640
movl $0xf5, %edx
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe_test.c
// Function: test_issue_6_b
DEF_TEST(issue_6_b)
{
  static const int NUM = 16;
  pipe_t* pipe = pipe_new(sizeof(int), NUM * 2);
  pipe_reserve(PIPE_GENERIC(pipe), NUM);
  pipe_producer_t* p = pipe_producer_new(pipe);
  pipe_consumer_t* c = pipe_consumer_new(pipe);
  pipe_free(pipe);

  int data[NUM];
  for(int i=0; i < NUM; ++i)
    data[i] = i;
  pipe_push(p, data, NUM);
  pipe_producer_free(p);

  int buf[NUM];
  size_t ret = pipe_pop(c, buf, NUM);
  assert(ret == NUM);
  for(int i=0; i < NUM; ++i)
    assert(buf[i] == data[i]);

  pipe_consumer_free(c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movl $0x4, %edi
movl $0x20, %esi
callq 0x13f0
movq %rax, %r15
movl $0x10, %esi
movq %rax, %rdi
callq 0x1180
movq %r15, %rdi
callq 0x17a0
movq %rax, %r14
movq %r15, %rdi
callq 0x17ca
movq %rax, %rbx
movq %r15, %rdi
callq 0x17f4
xorl %eax, %eax
movl %eax, -0x60(%rbp,%rax,4)
incq %rax
cmpq $0x10, %rax
jne 0x2bb7
leaq -0x60(%rbp), %rsi
movl $0x10, %edx
movq %r14, %rdi
callq 0x1db0
movq %r14, %rdi
callq 0x1950
movq %rsp, %r14
addq $-0x40, %r14
movq %r14, %rsp
movl $0x10, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1db9
cmpq $0x10, %rax
jne 0x2c44
xorl %eax, %eax
movl (%r14,%rax,4), %ecx
cmpl -0x60(%rbp,%rax,4), %ecx
jne 0x2c25
incq %rax
cmpq $0x10, %rax
jne 0x2bff
movq %rbx, %rdi
callq 0x19b1
leaq -0x18(%rbp), %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a28(%rip), %rdi      # 0x4654
leaq 0x191b(%rip), %rsi      # 0x454e
leaq 0x1a42(%rip), %rcx      # 0x467c
movl $0x128, %edx            # imm = 0x128
callq 0x1090
leaq 0x19ea(%rip), %rdi      # 0x4635
leaq 0x18fc(%rip), %rsi      # 0x454e
leaq 0x1a23(%rip), %rcx      # 0x467c
movl $0x126, %edx            # imm = 0x126
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe_test.c
// Function: process_pipe_issue_6_c
static void* process_pipe_issue_6_c(void* param)
{
  static const int NUM = 32;
  issue_6_t* v = (issue_6_t *)param;

  //printf("Consumer waiting for a bit ...\n");
  //printf("Consumer starts to read pipe ...\n");
  thread_sleep(1);
  assert(v->writing); // producer still writing, blocked from finishing
  int buf[NUM];
  size_t ret = pipe_pop(v->c, buf, NUM);
  assert(ret == NUM);
  for(int i=0; i < NUM; ++i)
    assert(buf[i] == i);

  v->read = NUM;
  pipe_consumer_free(v->c);
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x1, %edi
callq 0x1140
cmpl $0x0, 0x8(%rbx)
je 0x2cea
movq %rsp, %r14
addq $-0x80, %r14
movq %r14, %rsp
movq (%rbx), %rdi
movl $0x20, %edx
movq %r14, %rsi
callq 0x1db9
cmpq $0x20, %rax
jne 0x2d09
xorl %eax, %eax
movl (%r14,%rax,4), %ecx
cmpq %rcx, %rax
jne 0x2ccb
incq %rax
cmpq $0x20, %rax
jne 0x2c9f
movl $0x20, 0xc(%rbx)
movq (%rbx), %rdi
callq 0x19b1
xorl %eax, %eax
leaq -0x10(%rbp), %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1a1a(%rip), %rdi      # 0x46ec
leaq 0x1875(%rip), %rsi      # 0x454e
leaq 0x19e7(%rip), %rcx      # 0x46c7
movl $0x15d, %edx            # imm = 0x15D
callq 0x1090
leaq 0x19cb(%rip), %rdi      # 0x46bc
leaq 0x1856(%rip), %rsi      # 0x454e
leaq 0x19c8(%rip), %rcx      # 0x46c7
movl $0x158, %edx            # imm = 0x158
callq 0x1090
leaq 0x1925(%rip), %rdi      # 0x4635
leaq 0x1837(%rip), %rsi      # 0x454e
leaq 0x19a9(%rip), %rcx      # 0x46c7
movl $0x15b, %edx            # imm = 0x15B
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe_util.c
// Function: pipe_connect
void pipe_connect(pipe_consumer_t* in,
                  pipe_processor_t proc, void* aux,
                  pipe_producer_t* out)
{
    assert(in);
    assert(out);
    assert(proc);

    connect_data_t* d = malloc(sizeof *d);

    *d = (connect_data_t) {
        .in = in,
        .proc = proc,
        .aux = aux,
        .out = out
    };

    thread_create(&process_pipe, d);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2da9
movq %rcx, %rbx
testq %rcx, %rcx
je 0x2dc8
movq %rsi, %r15
testq %rsi, %rsi
je 0x2de7
movq %rdx, %r14
movq %rdi, %r12
movl $0x20, %edi
callq 0x10f0
movq %r12, (%rax)
movq %r15, 0x8(%rax)
movq %r14, 0x10(%rax)
movq %rbx, 0x18(%rax)
leaq 0x76(%rip), %rdx        # 0x2e06
movq %rsp, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x1100
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x17f1(%rip), %rdi      # 0x45a1
leaq 0x19b1(%rip), %rsi      # 0x4768
leaq 0x19b6(%rip), %rcx      # 0x4774
movl $0x61, %edx
callq 0x1090
leaq 0x17fe(%rip), %rdi      # 0x45cd
leaq 0x1992(%rip), %rsi      # 0x4768
leaq 0x1997(%rip), %rcx      # 0x4774
movl $0x62, %edx
callq 0x1090
leaq 0x19d8(%rip), %rdi      # 0x47c6
leaq 0x1973(%rip), %rsi      # 0x4768
leaq 0x1978(%rip), %rcx      # 0x4774
movl $0x63, %edx
callq 0x1090
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe_util.c
// Function: process_pipe
static void* process_pipe(void* param)
{
    connect_data_t p = *(connect_data_t*)param;
    free(param);

    char* buf = malloc(DEFAULT_BUFFER_SIZE * pipe_elem_size(PIPE_GENERIC(p.in)));

    size_t elems_read;

    while((elems_read = pipe_pop(p.in, buf, DEFAULT_BUFFER_SIZE)))
        p.proc(buf, elems_read, p.out, p.aux);

    p.proc(NULL, 0, NULL, p.aux);

    free(buf);

    pipe_consumer_free(p.in);
    pipe_producer_free(p.out);

    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%rdi), %r14
movq 0x8(%rdi), %r13
movq 0x10(%rdi), %r15
movq 0x18(%rdi), %rbx
callq 0x1030
movq %r14, %rdi
callq 0x13ec
shlq $0x7, %rax
movq %rax, %rdi
callq 0x10f0
movq %rax, %r12
movl $0x80, %edx
movq %r14, %rdi
movq %rax, %rsi
callq 0x1db9
testq %rax, %rax
je 0x2e6b
movq %r12, %rdi
movq %rax, %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq *%r13
movl $0x80, %edx
movq %r14, %rdi
movq %r12, %rsi
jmp 0x2e45
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %r15, %rcx
callq *%r13
movq %r12, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x19b1
movq %rbx, %rdi
callq 0x1950
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe_util.c
// Function: pipe_parallel
pipeline_t pipe_parallel(size_t           instances,
                         size_t           in_size,
                         pipe_processor_t proc,
                         void*            aux,
                         size_t           out_size)
{
    pipe_t* in  = pipe_new(in_size,  0),
          * out = pipe_new(out_size, 0);

    while(instances--)
        pipe_connect(pipe_consumer_new(in),
                     proc, aux,
                     pipe_producer_new(out));

    pipeline_t ret = {
        .in  = pipe_producer_new(in),
        .out = pipe_consumer_new(out)
    };

    pipe_free(in);
    pipe_free(out);

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %r13
movq %rsi, %rdi
xorl %esi, %esi
callq 0x13f0
movq %rax, %rbx
movq %r12, %rdi
xorl %esi, %esi
callq 0x13f0
movq %rax, %r12
testq %r13, %r13
je 0x2efa
movq %rbx, %rdi
callq 0x17ca
movq %rax, %rbp
movq %r12, %rdi
callq 0x17a0
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rax, %rcx
callq 0x2d4d
decq %r13
jne 0x2ed1
movq %rbx, %rdi
callq 0x17a0
movq %rax, %r14
movq %r12, %rdi
callq 0x17ca
movq %rax, %r15
movq %rbx, %rdi
callq 0x17f4
movq %r12, %rdi
callq 0x17f4
movq %r14, %rax
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe_util.c
// Function: pipe_pipeline
pipeline_t pipe_pipeline(size_t first_size, ...)
{
    va_list va;
    va_start(va, first_size);

    pipe_t* p = pipe_new(first_size, 0);

    pipeline_t ret = va_pipe_pipeline(pipe_trivial_pipeline(p), va);

    pipe_free(p);

    va_end(va);

    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
leaq 0x20(%rsp), %r10
movq %rsi, 0x8(%r10)
movq %rdx, 0x10(%r10)
movq %rcx, 0x18(%r10)
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0x2f95
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rbx
movq %r10, 0x10(%rbx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rbx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rbx)
xorl %esi, %esi
callq 0x13f0
movq %rax, %r14
movq %rax, %rdi
callq 0x17a0
movq %rax, %r15
movq %r14, %rdi
callq 0x17ca
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x3001
movq %rax, %rbx
movq %rdx, %r15
movq %r14, %rdi
callq 0x17f4
movq %rbx, %rax
movq %r15, %rdx
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/pipe_util.c
// Function: va_pipe_pipeline
static pipeline_t va_pipe_pipeline(pipeline_t result_so_far,
                                   va_list args)
{
    pipe_processor_t proc = va_arg(args, pipe_processor_t);

    if(proc == NULL)
        return result_so_far;

    void*  aux       = va_arg(args, void*);
    size_t pipe_size = va_arg(args, size_t);

    if(pipe_size == 0)
    {
        pipe_consumer_free(result_so_far.out);
        result_so_far.out = NULL;
        return result_so_far;
    }

    pipe_t* pipe = pipe_new(pipe_size, 0);

    pipe_connect(result_so_far.out , proc, aux, pipe_producer_new(pipe));
    result_so_far.out = pipe_consumer_new(pipe);

    pipe_free(pipe);

    return va_pipe_pipeline(result_so_far, args);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdx), %ecx
cmpq $0x28, %rcx
ja 0x302c
movq %rcx, %rax
addq 0x10(%r15), %rax
addl $0x8, %ecx
movl %ecx, (%r15)
jmp 0x3038
movq 0x8(%r15), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%r15)
movq (%rax), %r12
testq %r12, %r12
je 0x30ee
movl (%r15), %ecx
cmpq $0x28, %rcx
ja 0x305c
movq %rcx, %rax
addq 0x10(%r15), %rax
addl $0x8, %ecx
movl %ecx, (%r15)
jmp 0x3068
movq 0x8(%r15), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%r15)
movq (%rax), %r13
movl (%r15), %ecx
cmpq $0x28, %rcx
ja 0x3083
movq %rcx, %rax
addq 0x10(%r15), %rax
addl $0x8, %ecx
movl %ecx, (%r15)
jmp 0x308f
movq 0x8(%r15), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%r15)
movq (%rax), %rdi
testq %rdi, %rdi
je 0x30e3
xorl %esi, %esi
callq 0x13f0
movq %rax, %rbp
movq %rax, %rdi
callq 0x17a0
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rax, %rcx
callq 0x2d4d
movq %rbp, %rdi
callq 0x17ca
movq %rax, %r14
movq %rbp, %rdi
callq 0x17f4
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3001
movq %rax, %rbx
movq %rdx, %r14
jmp 0x30ee
movq %r14, %rdi
callq 0x19b1
xorl %r14d, %r14d
movq %rbx, %rax
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/cgaebel[P]pipe/thread_ring.c
// Function: main
int main(int argc, char** argv)
{
    if(argc != 2)
    {
        printf("Usage: %s [N]\nN = the number of times to pass around a token.\n", argv[0]);
        return 255;
    }

    int passes = atoi(argv[1]);

    pipe_t* last_pipe = pipe_new(sizeof(int), 0);

    pipe_producer_t* first = pipe_producer_new(last_pipe);

    for(int i = 0; i < THREADS - 1; ++i)
    {
        thread_context_t* ctx = contexts + i;

        ctx->threadnumber = i + 1;

        ctx->in = pipe_consumer_new(last_pipe);
        pipe_free(last_pipe);

        last_pipe = pipe_new(sizeof(int), 0);
        ctx->out = pipe_producer_new(last_pipe);

        spawn_thread(ctx);
    }

    contexts[THREADS-1] = (thread_context_t) {
        .threadnumber = THREADS,
        .in = pipe_consumer_new(last_pipe),
        .out = first
    };

    pipe_free(last_pipe);

    spawn_thread(contexts + THREADS - 1);

    pipe_push(first, &passes, 1);

    pthread_join(thread, NULL);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x2, %edi
jne 0x3215
movq 0x8(%rsi), %rdi
callq 0x1120
movl %eax, 0x4(%rsp)
movl $0x4, %edi
xorl %esi, %esi
callq 0x13f0
movq %rax, %r14
movq %rax, %rdi
callq 0x17a0
movq %rax, %rbx
leaq 0x3f9a(%rip), %r15      # 0x70e0
movq $-0x7, %rbp
leaq 0x404c(%rip), %r12      # 0x71a0
leaq 0xe3(%rip), %r13        # 0x323e
leal 0x8(%rbp), %eax
movl %eax, (%r15)
movq %r14, %rdi
callq 0x17ca
movq %rax, 0x8(%r15)
movq %r14, %rdi
callq 0x17f4
movl $0x4, %edi
xorl %esi, %esi
callq 0x13f0
movq %rax, %r14
movq %rax, %rdi
callq 0x17a0
movq %rax, 0x10(%r15)
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %rcx
callq 0x1100
addq $0x18, %r15
incq %rbp
jne 0x315b
movq %r14, %rdi
callq 0x17ca
movl $0x8, 0x3fcd(%rip)      # 0x7188
leaq 0x3fc6(%rip), %r15      # 0x7188
movq %rax, 0x3fc7(%rip)      # 0x7190
movq %rbx, 0x3fc8(%rip)      # 0x7198
movq %r14, %rdi
callq 0x17f4
leaq 0x3fc1(%rip), %rdi      # 0x71a0
leaq 0x58(%rip), %rdx        # 0x323e
xorl %r14d, %r14d
xorl %esi, %esi
movq %r15, %rcx
callq 0x1100
leaq 0x4(%rsp), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x1db0
movq 0x3f94(%rip), %rdi      # 0x71a0
xorl %esi, %esi
callq 0x1130
jmp 0x322c
movq (%rsi), %rsi
leaq 0x15ac(%rip), %rdi      # 0x47cb
xorl %eax, %eax
callq 0x1070
movl $0xff, %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_O1/cgaebel[P]pipe/thread_ring.c
// Function: thread_func
static void* thread_func(void* context)
{
    thread_context_t* ctx = context;

    int n = 0;

    while(pipe_pop(ctx->in, &n, 1))
    {
        if(n == 0)
        {
            printf("%i\n", ctx->threadnumber);
            break;
        }

        --n;

        pipe_push(ctx->out, &n, 1);
    }

    pipe_producer_free(ctx->out);
    pipe_consumer_free(ctx->in);

    return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4(%rsp), %rsi
movl $0x0, (%rsi)
movq 0x8(%rdi), %rdi
movl $0x1, %edx
callq 0x1db9
testq %rax, %rax
je 0x32af
leaq 0x4(%rsp), %r14
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0x329f
decl %eax
movl %eax, 0x4(%rsp)
movq 0x10(%rbx), %rdi
movl $0x1, %edx
movq %r14, %rsi
callq 0x1db0
movq 0x8(%rbx), %rdi
movl $0x1, %edx
movq %r14, %rsi
callq 0x1db9
testq %rax, %rax
jne 0x3268
jmp 0x32af
movl (%rbx), %esi
leaq 0x1562(%rip), %rdi      # 0x480a
xorl %eax, %eax
callq 0x1070
movq 0x10(%rbx), %rdi
callq 0x1950
movq 0x8(%rbx), %rdi
callq 0x19b1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/abstract.c
// Function: janet_abstract_begin
void *janet_abstract_begin(const JanetAbstractType *atype, size_t size) {
    JanetAbstractHead *header = janet_gcalloc(JANET_MEMORY_NONE,
                                sizeof(JanetAbstractHead) + size);
    header->size = size;
    header->type = atype;
    return (void *) & (header->data);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
addq $0x20, %rsi
xorl %edi, %edi
callq 0x2bb18
movq %rbx, 0x18(%rax)
movq %r14, 0x10(%rax)
addq $0x20, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/abstract.c
// Function: janet_abstract_begin_threaded
void *janet_abstract_begin_threaded(const JanetAbstractType *atype, size_t size) {
    JanetAbstractHead *header = janet_malloc(sizeof(JanetAbstractHead) + size);
    if (NULL == header) {
        JANET_OUT_OF_MEMORY;
    }
    janet_vm.next_collection += size + sizeof(JanetAbstractHead);
    header->gc.flags = JANET_MEMORY_THREADED_ABSTRACT;
    header->gc.data.next = NULL; /* Clear memory for address sanitizers */
    header->gc.data.refcount = 1;
    header->size = size;
    header->type = atype;
    void *abstract = (void *) & (header->data);
    janet_table_put(&janet_vm.threaded_abstracts, janet_wrap_abstract(abstract), janet_wrap_false());
    return abstract;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x20(%rsi), %r12
movq %r12, %rdi
callq 0x12770
testq %rax, %rax
je 0x145a4
movq %rax, %rbx
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
addq %r12, 0xa8(%rax)
movl $0xd, (%rbx)
movq $0x0, 0x8(%rbx)
movl $0x1, 0x8(%rbx)
movq %r15, 0x18(%rbx)
movq %r14, 0x10(%rbx)
addq $0x20, %rbx
leaq 0x268(%rax), %r14
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %rbx, %rdi
callq 0x4f9f2
movq %rax, %r15
movabsq $-0x7000000000000, %rdi # imm = 0xFFF9000000000000
callq 0x4f95a
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x481b3
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x12c80
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/abstract.c
// Function: janet_os_mutex_init
void janet_os_mutex_init(JanetOSMutex *mutex) {
    pthread_mutexattr_t attr;
    pthread_mutexattr_init(&attr);
    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
    pthread_mutex_init((pthread_mutex_t *) mutex, &attr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq -0x14(%rbp), %r14
movq %r14, %rdi
callq 0x12ad0
movq %r14, %rdi
movl $0x1, %esi
callq 0x123a0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x12bb0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/array.c
// Function: janet_array_impl
static void janet_array_impl(JanetArray *array, int32_t capacity) {
    Janet *data = NULL;
    if (capacity > 0) {
        janet_vm.next_collection += capacity * sizeof(Janet);
        data = (Janet *) janet_malloc(sizeof(Janet) * (size_t) capacity);
        if (NULL == data) {
            JANET_OUT_OF_MEMORY;
        }
    }
    array->count = 0;
    array->capacity = capacity;
    array->data = data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
testl %esi, %esi
jle 0x14711
movl %r14d, %r15d
shlq $0x3, %r15
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
addq %r15, 0xa8(%rax)
movq %r15, %rdi
callq 0x12770
testq %rax, %rax
jne 0x14713
callq 0x12cae
xorl %eax, %eax
movl $0x0, 0x10(%rbx)
movl %r14d, 0x14(%rbx)
movq %rax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/array.c
// Function: janet_array_n
JanetArray *janet_array_n(const Janet *elements, int32_t n) {
    JanetArray *array = janet_gcalloc(JANET_MEMORY_ARRAY, sizeof(JanetArray));
    array->capacity = n;
    array->count = n;
    array->data = janet_malloc(sizeof(Janet) * (size_t) n);
    if (!array->data) {
        JANET_OUT_OF_MEMORY;
    }
    safe_memcpy(array->data, elements, sizeof(Janet) * n);
    return array;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
movl $0x20, %esi
movl $0x3, %edi
callq 0x2bb18
movq %rax, %r14
movl %r15d, 0x14(%rax)
movl %r15d, 0x10(%rax)
movslq %r15d, %r15
shlq $0x3, %r15
movq %r15, %rdi
callq 0x12770
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x147b8
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x49017
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x12cdc
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/array.c
// Function: janet_array_ensure
void janet_array_ensure(JanetArray *array, int32_t capacity, int32_t growth) {
    Janet *newData;
    Janet *old = array->data;
    if (capacity <= array->capacity) return;
    int64_t new_capacity = ((int64_t) capacity) * growth;
    if (new_capacity > INT32_MAX) new_capacity = INT32_MAX;
    capacity = (int32_t) new_capacity;
    newData = janet_realloc(old, capacity * sizeof(Janet));
    if (NULL == newData) {
        JANET_OUT_OF_MEMORY;
    }
    janet_vm.next_collection += (capacity - array->capacity) * sizeof(Janet);
    array->data = newData;
    array->capacity = capacity;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpl %esi, 0x14(%rdi)
jge 0x1482e
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movslq %esi, %rax
movslq %edx, %r15
imulq %rax, %r15
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %r15
cmovgeq %rax, %r15
movslq %r15d, %rsi
shlq $0x3, %rsi
callq 0x12850
testq %rax, %rax
je 0x14837
movq %rax, %r14
movslq 0x14(%rbx), %rax
movslq %r15d, %r15
movq %r15, %r12
subq %rax, %r12
shlq $0x3, %r12
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
addq %r12, 0xa8(%rax)
movq %r14, 0x18(%rbx)
movl %r15d, 0x14(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x12d0a
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/array.c
// Function: janet_array_setcount
void janet_array_setcount(JanetArray *array, int32_t count) {
    if (count < 0)
        return;
    if (count > array->count) {
        int32_t i;
        janet_array_ensure(array, count, 1);
        for (i = array->count; i < count; i++) {
            array->data[i] = janet_wrap_nil();
        }
    }
    array->count = count;
}

// Assembly:
testl %esi, %esi
js 0x148b2
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl %esi, -0x2c(%rbp)
cmpl %esi, 0x10(%rdi)
jge 0x1489d
movq %r14, %rdi
movl -0x2c(%rbp), %ebx
movl %ebx, %esi
movl $0x1, %edx
callq 0x147bd
movslq 0x10(%r14), %r12
cmpl %r12d, %ebx
jle 0x1489d
movl -0x2c(%rbp), %r13d
subl %r12d, %r13d
movabsq $-0x77fffffffffff, %r15 # imm = 0xFFF8800000000001
movq 0x18(%r14), %rbx
movq %r15, %rdi
callq 0x4f95a
movq %rax, (%rbx,%r12,8)
incq %r12
decl %r13d
jne 0x14885
movl -0x2c(%rbp), %eax
movl %eax, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/array.c
// Function: janet_array_push
void janet_array_push(JanetArray *array, Janet x) {
    if (array->count == INT32_MAX) {
        janet_panic("array overflow");
    }
    int32_t newcount = array->count + 1;
    janet_array_ensure(array, newcount, 2);
    array->data[array->count] = x;
    array->count = newcount;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl 0x10(%rdi), %r15d
cmpl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
je 0x148fb
movq %rsi, %r14
movq %rdi, %rbx
incl %r15d
movl %r15d, %esi
movl $0x2, %edx
callq 0x147bd
movq 0x18(%rbx), %rax
movslq 0x10(%rbx), %rcx
movq %r14, (%rax,%rcx,8)
movl %r15d, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3d758(%rip), %rdi     # 0x5205a
callq 0x19263
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/array.c
// Function: janet_array_pop
Janet janet_array_pop(JanetArray *array) {
    if (array->count) {
        return array->data[--array->count];
    } else {
        return janet_wrap_nil();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq 0x10(%rdi), %rax
testq %rax, %rax
je 0x14926
movq 0x18(%rdi), %rcx
leaq -0x1(%rax), %rdx
movl %edx, 0x10(%rdi)
movq -0x8(%rcx,%rax,8), %rax
popq %rbp
retq
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
popq %rbp
jmp 0x4f95a
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/array.c
// Function: janet_array_peek
Janet janet_array_peek(JanetArray *array) {
    if (array->count) {
        return array->data[array->count - 1];
    } else {
        return janet_wrap_nil();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq 0x10(%rdi), %rax
testq %rax, %rax
je 0x1494e
movq 0x18(%rdi), %rcx
movq -0x8(%rcx,%rax,8), %rax
popq %rbp
retq
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
popq %rbp
jmp 0x4f95a
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/asm.c
// Function: janet_disasm_bytecode
static Janet janet_disasm_bytecode(JanetFuncDef *def) {
    JanetArray *bcode = janet_array(def->bytecode_length);
    for (int32_t i = 0; i < def->bytecode_length; i++) {
        bcode->data[i] = janet_asm_decode_instruction(def->bytecode[i]);
    }
    bcode->count = def->bytecode_length;
    return janet_wrap_array(bcode);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movl 0x70(%rdi), %edi
callq 0x146a0
movq %rax, %rbx
movl 0x70(%r14), %eax
testl %eax, %eax
jle 0x16b7e
xorl %r15d, %r15d
movq 0x18(%rbx), %r12
movq 0x28(%r14), %rax
movl (%rax,%r15,4), %edi
callq 0x164b0
movq %rax, (%r12,%r15,8)
incq %r15
movslq 0x70(%r14), %rax
cmpq %rax, %r15
jl 0x16b5d
movl %eax, 0x10(%rbx)
movabsq $-0x4800000000000, %rsi # imm = 0xFFFB800000000000
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4f9f2