LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/begriffs[P]pthread-test/pipe.c
// Function: pipe_result
bool pipe_result(struct pipe *p, long *result)
{
	struct stage *tail = p->tail;
	bool empty = false;

	pthread_mutex_lock(&p->mutex);
	{
		if (p->active <= 0)
			empty = true;
		else
			p->active--;
	}
	pthread_mutex_unlock(&p->mutex);

	if (empty)
		return false;

	pthread_mutex_lock(&tail->mutex);
	{
		while (!tail->data_ready)
			pthread_cond_wait(&tail->avail, &tail->mutex);
		*result          = tail->data;
		tail->data_ready = false;
		pthread_cond_signal(&tail->ready);
	}
	pthread_mutex_unlock(&tail->mutex);
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x30(%rdi), %rbx
callq 0x1100
movl 0x3c(%r15), %r12d
testl %r12d, %r12d
jle 0x1453
leal -0x1(%r12), %eax
movl %eax, 0x3c(%r15)
movq %r15, %rdi
callq 0x10a0
movq %rbx, %rdi
callq 0x1100
cmpb $0x0, 0x88(%rbx)
jne 0x1437
leaq 0x28(%rbx), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1040
cmpb $0x1, 0x88(%rbx)
jne 0x1423
movq 0x90(%rbx), %rax
movq %rax, (%r14)
movb $0x0, 0x88(%rbx)
leaq 0x58(%rbx), %rdi
callq 0x1080
jmp 0x1456
movq %r15, %rbx
testl %r12d, %r12d
setg %bpl
movq %rbx, %rdi
callq 0x10a0
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/begriffs[P]pthread-test/pipe.c
// Function: main
int main(void)
{
	struct pipe p;
	long value, result;
	char line[128];

	pipe_create(&p, 10);
	puts("Enter integer values, or '=' for next result");

	while (1)
	{
		printf("Data> ");
		if (fgets(line, sizeof line, stdin) == NULL)
			return 0;
		if (strlen(line) <= 1)
			continue;
		if (strlen(line) == 2 && *line == '=')
		{
			if (pipe_result(&p, &result))
				printf("Result is %ld\n", result);
			else
				puts("Pipe is empty");
		}
		else
		{
			if (sscanf(line, "%ld", &value) < 1)
				fprintf(stderr, "Enter an inter value\n");
			else
				pipe_start(&p, value);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
leaq 0x10(%rsp), %rdi
movl $0xa, %esi
callq 0x12f0
leaq 0xb6d(%rip), %rdi       # 0x2004
callq 0x1030
leaq 0xb8e(%rip), %rdi       # 0x2031
xorl %eax, %eax
callq 0x1060
movq 0x2b27(%rip), %r12      # 0x3fd8
movq (%r12), %rdx
leaq 0x50(%rsp), %rdi
movl $0x80, %esi
callq 0x1070
testq %rax, %rax
je 0x1580
leaq 0x50(%rsp), %rbx
leaq 0xb58(%rip), %r14       # 0x2031
leaq 0x10(%rsp), %r15
leaq 0xb70(%rip), %r13       # 0x2055
leaq 0x8(%rsp), %rbp
movq %rbx, %rdi
callq 0x1050
cmpq $0x2, %rax
jb 0x1553
jne 0x1524
cmpb $0x3d, 0x50(%rsp)
jne 0x1524
movq %r15, %rdi
movq %rsp, %rsi
callq 0x13dd
testb %al, %al
je 0x1547
movq (%rsp), %rsi
leaq 0xb1d(%rip), %rdi       # 0x2038
xorl %eax, %eax
callq 0x1060
jmp 0x1553
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x10c0
testl %eax, %eax
jle 0x1579
movq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x13af
jmp 0x1553
leaq 0xaf9(%rip), %rdi       # 0x2047
callq 0x1030
movq %r14, %rdi
xorl %eax, %eax
callq 0x1060
movq (%r12), %rdx
movq %rbx, %rdi
movl $0x80, %esi
callq 0x1070
testq %rax, %rax
jne 0x14ea
jmp 0x1580
callq 0x1120
jmp 0x1553
xorl %eax, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Cyan4973[P]FiniteStateEntropy/programs/probaGenerator.c
// Function: main
int main(int argc, char** argv)
{
    char* n;
    double proba = 0.;
    char  filename[] = "proba.bin";

    g_programName = argv[0];
    DISPLAY("Binary file generator\n");
    if (argc<2) badusage();

    n = argv[1];
    if ((*n>='0') && (*n<='9')) { proba += *n-'0'; n++; }
    if ((*n>='0') && (*n<='9')) { proba*=10; proba += *n-'0'; n++; }
    proba /= 100;

    createSampleFile(filename, proba);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movl %edi, %ebp
movabsq $0x69622e61626f7270, %rax # imm = 0x69622E61626F7270
movq %rax, 0x8(%rsp)
movw $0x6e, 0x10(%rsp)
movq (%rsi), %rax
movq %rax, 0x2f71(%rip)      # 0x4080
movq 0x2ee2(%rip), %r15      # 0x3ff8
movq (%r15), %rcx
leaq 0xf2f(%rip), %rdi       # 0x204f
pushq $0x16
popq %rsi
pushq $0x1
popq %rdx
callq 0x10c0
cmpl $0x1, %ebp
jle 0x118d
movq 0x8(%rbx), %rax
movsbl (%rax), %ecx
leal -0x30(%rcx), %edx
cmpb $0xa, %dl
adcq $0x0, %rax
cmpb $0xa, %dl
jb 0x114c
xorpd %xmm0, %xmm0
jmp 0x1153
addl $-0x30, %ecx
cvtsi2sd %ecx, %xmm0
movb (%rax), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x116e
mulsd 0xea5(%rip), %xmm0      # 0x2008
movzbl %al, %eax
cvtsi2sd %eax, %xmm1
addsd %xmm1, %xmm0
divsd 0xe9a(%rip), %xmm0      # 0x2010
leaq 0x8(%rsp), %rdi
callq 0x14ac
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq (%r15), %rcx
leaq 0xeef(%rip), %rdi       # 0x2086
pushq $0x15
popq %rbx
pushq $0x1
popq %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x10c0
callq 0x11d0
movq (%r15), %rcx
leaq 0xee4(%rip), %rdi       # 0x209c
movq %rbx, %rsi
movq %r14, %rdx
callq 0x10c0
callq 0x1060
pushq $0x1
popq %rdi
callq 0x10b0
// File: /workspace/github_c_makefile_star2_O1/Cyan4973[P]FiniteStateEntropy/programs/probaGenerator.c
// Function: usage
static int usage(void)
{
    DISPLAY("Usage :\n");
    DISPLAY("%s P%%\n", g_programName);
    DISPLAY("Example :\n");
    DISPLAY("%s 70%%\n", g_programName);
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x2e1d(%rip), %r14      # 0x3ff8
movq (%r14), %rcx
leaq 0xecd(%rip), %rdi       # 0x20b2
pushq $0x8
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x10c0
movq (%r14), %rdi
movq 0x2e83(%rip), %rdx      # 0x4080
leaq 0xeb7(%rip), %rsi       # 0x20bb
xorl %eax, %eax
callq 0x1070
movq (%r14), %rcx
leaq 0xeae(%rip), %rdi       # 0x20c3
pushq $0xa
popq %rsi
movq %rbx, %rdx
callq 0x10c0
movq (%r14), %rdi
movq 0x2e56(%rip), %rdx      # 0x4080
leaq 0xe9d(%rip), %rsi       # 0x20ce
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1070
// File: /workspace/github_c_makefile_star2_O1/Cyan4973[P]FiniteStateEntropy/programs/probaGenerator.c
// Function: createSampleFile
void createSampleFile(char* filename, double p)
{
    FILE* const foutput = fopen( filename, "wb" );
    if (foutput==NULL) {
        perror("dataGenerator:");
        exit(1);
    }
    {   void* const buffer = malloc(BUFFERSIZE);
        generate(buffer, BUFFERSIZE, p);
        fwrite(buffer, 1, BUFFERSIZE, foutput);
        free(buffer);
    }
    fclose(foutput);
    DISPLAY("File %s generated\n", filename);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
leaq 0xb5f(%rip), %rsi       # 0x2020
callq 0x1090
testq %rax, %rax
je 0x14e2
movsd 0x8(%rsp), %xmm0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x123f
addq $0x10, %rsp
popq %rbx
retq
callq 0x13a3
// File: /workspace/github_c_makefile_star2_O1/truenas[P]binaries/src/ixnvdimm.c
// Function: usage
static void
usage(const char *progname)
{

	fprintf(stderr, "usage: %s {nvdimm}\n", progname);
	fprintf(stderr, "       %s -F {nvdimm}\n", progname);
	fprintf(stderr, "       %s -d {nvdimm}\n", progname);
	fprintf(stderr, "       %s -f {firmware} [-I] {nvdimm}\n", progname);
	fprintf(stderr, "       %s -r [-h] {nvdimm} [{page} [{off}] | {reg}]\n", progname);
	fprintf(stderr, "       %s -w [-h] {nvdimm} ({page} {off} | {reg}) {val}\n", progname);
	exit(1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x65fd(%rip), %r14      # 0x8ff0
movq (%r14), %rdi
leaq 0x2678(%rip), %rsi      # 0x5075
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movq (%r14), %rdi
leaq 0x2678(%rip), %rsi      # 0x5089
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movq (%r14), %rdi
leaq 0x267b(%rip), %rsi      # 0x50a0
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movq (%r14), %rdi
leaq 0x267e(%rip), %rsi      # 0x50b7
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movq (%r14), %rdi
leaq 0x2691(%rip), %rsi      # 0x50de
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movq (%r14), %rdi
leaq 0x26b2(%rip), %rsi      # 0x5113
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movl $0x1, %edi
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O1/truenas[P]binaries/src/ixnvdimm.c
// Function: readsysfs
static uint32_t
readsysfs(const char *attr)
{
	char path[256];
	char buf[16];
	int fd, n;

	snprintf(path, sizeof(path), "/sys/bus/nd/devices/%s/nfit/%s",
	    nmem, attr);
	fd = open(path, O_RDONLY|O_CLOEXEC);
	if (fd < 0)
		err(EX_NOINPUT, "Can't open %s", path);
	n = read(fd, buf, sizeof(buf));
	close(fd);
	if (n < 0 || n >= sizeof(buf))
		err(EX_NOINPUT, "failed to read %s\n", path);
	buf[n] = 0;
	if (n && buf[n - 1] == '\n')
		buf[n - 1] = 0;
        return (strtoul(buf, NULL, 0));
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %r8
movq 0x6678(%rip), %rcx      # 0x9100
leaq 0x26f7(%rip), %rdx      # 0x5186
leaq 0x10(%rsp), %rbx
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20c0
movq %rbx, %rdi
movl $0x80000, %esi          # imm = 0x80000
xorl %eax, %eax
callq 0x2170
testl %eax, %eax
js 0x2b0c
movl %eax, %ebp
movq %rsp, %rsi
movl $0x10, %edx
movl %eax, %edi
callq 0x2100
movq %rax, %rbx
movl %ebp, %edi
callq 0x20f0
testl %ebx, %ebx
js 0x2b15
movslq %ebx, %rax
cmpq $0x10, %rax
jae 0x2b15
movb $0x0, (%rsp,%rax)
testl %ebx, %ebx
je 0x2af6
decl %ebx
movzbl (%rsp,%rbx), %eax
xorl %ecx, %ecx
cmpb $0xa, %al
cmovnel %eax, %ecx
movb %cl, (%rsp,%rbx)
movq %rsp, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2190
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %rbp
retq
leaq 0x24fa(%rip), %rsi      # 0x500d
jmp 0x2b1c
leaq 0x2689(%rip), %rsi      # 0x51a5
leaq 0x10(%rsp), %rdx
movl $0x42, %edi
xorl %eax, %eax
callq 0x2150
// File: /workspace/github_c_makefile_star2_O1/truenas[P]binaries/src/ixnvdimm.c
// Function: i2c_read
static uint8_t
i2c_read(int fd, uint8_t page, uint8_t off)
{
	uint8_t in_buf[2], out_buf[5];
	uint32_t status;

	in_buf[0] = page;
	in_buf[1] = off;
	if (calldsm(fd, 27, in_buf, sizeof(in_buf), out_buf, sizeof(out_buf)) < 5)
		err(EX_IOERR, "Can't read i2c (%0x, %0x)", page, off);
	status = le32dec(&out_buf[0]);
	if (status != 0)
		errx(EX_IOERR, "i2c read error (%0x, %0x): %x", page, off, status);
	return (out_buf[4]);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
leaq 0x6(%rsp), %rdx
movb %bpl, (%rdx)
movb %bl, 0x1(%rdx)
leaq 0x1(%rsp), %r8
movl $0x2, %ecx
movl $0x5, %r9d
movl $0x1b, %esi
callq 0x461f
cmpq $0x4, %rax
jle 0x2b74
movl 0x1(%rsp), %r8d
testl %r8d, %r8d
jne 0x2b8e
movb 0x5(%rsp), %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movzbl %bpl, %edx
movzbl %bl, %ecx
leaq 0x2636(%rip), %rsi      # 0x51b8
movl $0x4a, %edi
xorl %eax, %eax
callq 0x2150
movzbl %bpl, %edx
movzbl %bl, %ecx
leaq 0x2636(%rip), %rsi      # 0x51d2
movl $0x4a, %edi
xorl %eax, %eax
callq 0x2090
// File: /workspace/github_c_makefile_star2_O1/truenas[P]binaries/src/ixnvdimm.c
// Function: factory_default
static void
factory_default(int fd)
{
	uint8_t status[4];

	/* Factory default via DSM. */
	i2c_write(fd, 0, NVDIMM_MGT_CMD1, 1 << 1);
	memset(&status, 0xff, sizeof(status));
	if (calldsm(fd, 21, NULL, 0, status, sizeof(status)) != 4)
		err(EX_NOINPUT, "Can't call Reset to Factory Defaults DSM");
	if (le32dec(&status[0]) != 0)
		errx(EX_NOINPUT, "Reset to Factory Defaults DSM failed: %x",
		    le32dec(&status[0]));
	printf("Reset to Factory Defaults succeeded\n");
	fflush(stdout);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
xorl %esi, %esi
movl $0x41, %edx
movl $0x2, %ecx
callq 0x3b94
leaq 0xc(%rsp), %r8
movl $0xffffffff, (%r8)      # imm = 0xFFFFFFFF
movl $0x4, %r9d
movl %ebx, %edi
movl $0x15, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x461f
cmpq $0x4, %rax
jne 0x2c10
movl 0xc(%rsp), %edx
testl %edx, %edx
jne 0x2c23
leaq 0x3e6e(%rip), %rdi      # 0x6a65
callq 0x2070
movq 0x63bd(%rip), %rax      # 0x8fc0
movq (%rax), %rdi
addq $0x10, %rsp
popq %rbx
jmp 0x2160
leaq 0x25d9(%rip), %rsi      # 0x51f0
movl $0x42, %edi
xorl %eax, %eax
callq 0x2150
leaq 0x25ef(%rip), %rsi      # 0x5219
movl $0x42, %edi
xorl %eax, %eax
callq 0x2090
// File: /workspace/github_c_makefile_star2_O1/truenas[P]binaries/src/ixnvdimm.c
// Function: reg_parse
static int
reg_parse(const char *name, int *page, int *off, int *size)
{
	int i, l, o = -1;

	for (i = 0; regs[i].name != NULL; i++) {
		l = strlen(regs[i].name);
		if (strncmp(name, regs[i].name, l) != 0)
			continue;
		if (name[l] == 0)
			break;
		if (name[l] - '0' < regs[i].size) {
			o = name[l] - '0';
			break;
		}
	}
	if (regs[i].name == NULL)
		return (0);
	*page = regs[i].page;
	if (o >= 0) {
		*off = regs[i].off + o;
		*size = 1;
	} else {
		*off = regs[i].off;
		*size = regs[i].size;
	}
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, %r15
movq %rdi, %r12
leaq 0x1d85(%rip), %r13      # 0x584c
leaq 0x46a2(%rip), %rbx      # 0x8170
xorl %r14d, %r14d
movq %r13, %rdi
callq 0x2080
movslq %eax, %rbp
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x2050
testl %eax, %eax
jne 0x3aff
movsbl (%r12,%rbp), %ecx
testl %ecx, %ecx
je 0x3b10
addl $-0x30, %ecx
cmpl 0x8(%rbx), %ecx
jl 0x3b15
movq 0x28(%rbx), %r13
addq $0x18, %rbx
testq %r13, %r13
sete %r14b
jne 0x3ad1
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %eax, %eax
testb $0x1, %r14b
jne 0x3b4f
movl (%rbx), %edx
movl 0x4(%rbx), %eax
movl %edx, (%r15)
testl %ecx, %ecx
js 0x3b39
addl %ecx, %eax
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
movl $0x1, %eax
jmp 0x3b43
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
movl 0x8(%rbx), %eax
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/truenas[P]binaries/src/ixnvdimm.c
// Function: i2c_write
static void
i2c_write(int fd, uint8_t page, uint8_t off, uint8_t val)
{
	uint8_t in_buf[3], out_buf[4];
	uint32_t status;

	in_buf[0] = page;
	in_buf[1] = off;
	in_buf[2] = val;
	if (calldsm(fd, 28, in_buf, sizeof(in_buf), out_buf, sizeof(out_buf)) < 4)
		err(EX_IOERR, "Can't write i2c (%0x, %0x)", page, off);
	status = le32dec(&out_buf[0]);
	if (status != 0)
		errx(EX_IOERR, "i2c write error (%0x, %0x): %x", page, off, status);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
leaq 0x5(%rsp), %rdx
movb %bpl, (%rdx)
movb %bl, 0x1(%rdx)
movb %cl, 0x2(%rdx)
leaq 0x1(%rsp), %r8
movl $0x3, %ecx
movl $0x4, %r9d
movl $0x1c, %esi
callq 0x461f
cmpq $0x3, %rax
jle 0x3bda
movl 0x1(%rsp), %r8d
testl %r8d, %r8d
jne 0x3bf4
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movzbl %bpl, %edx
movzbl %bl, %ecx
leaq 0x265a(%rip), %rsi      # 0x6242
movl $0x4a, %edi
xorl %eax, %eax
callq 0x2150
movzbl %bpl, %edx
movzbl %bl, %ecx
leaq 0x265b(%rip), %rsi      # 0x625d
movl $0x4a, %edi
xorl %eax, %eax
callq 0x2090
// File: /workspace/github_c_makefile_star2_O1/truenas[P]binaries/src/ixnvdimm.c
// Function: calldsm
static ssize_t
calldsm(int fd, int func, void *in_buf, size_t in_size, void *out_buf,
    size_t out_size)
{
	struct nd_cmd_pkg *pkg;
	uint32_t fw_size;

	pkg = calloc(1, sizeof(*pkg) + in_size + out_size);
	pkg->nd_family = NVDIMM_FAMILY_MSFT;
	pkg->nd_command = func;
	pkg->nd_size_in = in_size;
	pkg->nd_size_out = out_size;
	pkg->nd_fw_size = 0;
	if (in_size)
		memcpy(&pkg->nd_payload[0], in_buf, in_size);
	if (ioctl(fd, ND_IOCTL_CALL, pkg) != 0)
		return (-1);
	fw_size = pkg->nd_fw_size;
	if (out_size)
		memcpy(out_buf, &pkg->nd_payload[in_size], out_size);
	free(pkg);
	return (fw_size);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, (%rsp)
movq %rcx, %r15
movq %rdx, %r13
movl %esi, %r14d
movl %edi, %ebp
leaq (%rcx,%r9), %rsi
addq $0x40, %rsi
movl $0x1, %edi
callq 0x2110
movq %rax, %r12
movq $0x3, (%rax)
movl %r14d, %eax
movq %rax, 0x8(%r12)
movl %r15d, 0x10(%r12)
movl %ebx, 0x14(%r12)
movl $0x0, 0x3c(%r12)
testq %r15, %r15
je 0x4688
leaq 0x40(%r12), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x2140
movl $0xc0404e0a, %esi       # imm = 0xC0404E0A
movl %ebp, %edi
movq %r12, %rdx
xorl %eax, %eax
callq 0x20e0
movq $-0x1, %r13
testl %eax, %eax
jne 0x46c5
movl 0x3c(%r12), %r13d
leaq (%r12,%r15), %rsi
addq $0x40, %rsi
movq (%rsp), %rdi
movq %rbx, %rdx
callq 0x2140
movq %r12, %rdi
callq 0x2030
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/perftests/serverpool/main.c
// Function: main
int
main(int argc, char * argv[])
{
	struct serverpool * SP;

	WARNP_INIT;

	/* Sanity-check. */
	if (argc != 2) {
		fprintf(stderr, "usage: test_serverpool %s\n", "<target>");
		exit(1);
	}

	/* Fork off a process to perform DNS lookups. */
	if ((SP = serverpool_create(argv[1], 5, 30)) == NULL) {
		warnp("Error launching DNS lookups");
		exit(1);
	}

	/* Call back every second for 2 minutes. */
	ticksleft = 120;
	done = 0;
	if (events_timer_register_double(callback_tick, SP, 1) == NULL) {
		warnp("events_timer_register_double");
		exit(1);
	}

	/* Wait until we're done. */
	if (events_spin(&done)) {
		warnp("Error in event loop");
		exit(1);
	}

	/* Shut down the DNS lookups. */
	serverpool_free(SP);

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

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x25a1
callq 0x4e70
cmpl $0x2, %ebp
jne 0x25d4
movq 0x8(%rbx), %rdi
movl $0x1e, %edx
movl $0x5, %esi
callq 0x5134
testq %rax, %rax
jne 0x25f8
callq 0x2090
cmpl $0x0, (%rax)
jne 0x263e
leaq 0x4a65(%rip), %rdi      # 0x7034
jmp 0x2686
movq 0x8a1d(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x4a2b(%rip), %rsi      # 0x7010
leaq 0x4a3f(%rip), %rdx      # 0x702b
xorl %eax, %eax
callq 0x21d0
jmp 0x26a6
movq %rax, %rbx
movl $0x78, 0x8e9f(%rip)     # 0xb4a4
movl $0x0, 0x8e99(%rip)      # 0xb4a8
leaq 0x9a(%rip), %rdi        # 0x26b0
movsd 0x49ea(%rip), %xmm0     # 0x7008
movq %rax, %rsi
callq 0x3a64
testq %rax, %rax
jne 0x264a
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2669
leaq 0x4a14(%rip), %rdi      # 0x7050
jmp 0x2686
movq %rax, %rbx
leaq 0x49ec(%rip), %rdi      # 0x7034
jmp 0x2699
leaq 0x8e57(%rip), %rdi      # 0xb4a8
callq 0x2a9d
testl %eax, %eax
jne 0x2675
movq %rbx, %rdi
callq 0x58bb
xorl %edi, %edi
callq 0x22c0
movq %rax, %rbx
leaq 0x49dd(%rip), %rdi      # 0x7050
jmp 0x2699
callq 0x2090
cmpl $0x0, (%rax)
jne 0x268f
leaq 0x49e7(%rip), %rdi      # 0x706d
xorl %eax, %eax
callq 0x500f
jmp 0x26a6
movq %rax, %rbx
leaq 0x49d4(%rip), %rdi      # 0x706d
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%rbx)
movl $0x1, %edi
callq 0x22c0
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/perftests/serverpool/main.c
// Function: callback_tick
static int
callback_tick(void * cookie)
{
	struct serverpool * SP = cookie;
	struct sock_addr * sa;
	char * s;

	/* Get an address from the pool. */
	if ((sa = serverpool_pick(SP)) == NULL) {
		warnp("serverpool_pick");
		goto err0;
	}

	/* Pretty-print it. */
	if ((s = sock_addr_prettyprint(sa)) == NULL) {
		warnp("sock_addr_prettyprint");
		goto err1;
	}
	printf("%s\n", s);

	/* Free string and address. */
	free(s);
	sock_addr_free(sa);

	/* Are we done yet? */
	if (--ticksleft > 0) {
		/* Schedule another callback. */
		if (events_timer_register_double(callback_tick, SP, 1)
		    == NULL) {
			warnp("events_timer_register_double");
			goto err0;
		}
	} else {
		/* We're done. */
		done = 1;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x5739
testq %rax, %rax
je 0x274c
movq %rax, %rbx
movq %rax, %rdi
callq 0x4c73
testq %rax, %rax
je 0x276f
movq %rax, %r15
movq %rax, %rdi
callq 0x20c0
movq %r15, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x4543
movl 0x8da9(%rip), %eax      # 0xb4a4
leal -0x1(%rax), %ecx
movl %ecx, 0x8da0(%rip)      # 0xb4a4
cmpl $0x2, %eax
jl 0x2793
leaq -0x64(%rip), %rdi       # 0x26b0
movsd 0x48ec(%rip), %xmm0     # 0x7008
movq %r14, %rsi
callq 0x3a64
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jne 0x27cc
callq 0x2090
cmpl $0x0, (%rax)
je 0x27d2
movq %rax, %rbx
leaq 0x4906(%rip), %rdi      # 0x7050
jmp 0x2760
callq 0x2090
cmpl $0x0, (%rax)
je 0x27a1
movq %rax, %rbx
leaq 0x4921(%rip), %rdi      # 0x7081
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%rbx)
jmp 0x27c7
callq 0x2090
cmpl $0x0, (%rax)
je 0x27b1
movq %rax, %r14
leaq 0x490e(%rip), %rdi      # 0x7091
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%r14)
jmp 0x27bf
movl $0x1, 0x8d0b(%rip)      # 0xb4a8
xorl %eax, %eax
jmp 0x27cc
leaq 0x48d9(%rip), %rdi      # 0x7081
xorl %eax, %eax
callq 0x500f
jmp 0x27c7
leaq 0x48d9(%rip), %rdi      # 0x7091
xorl %eax, %eax
callq 0x500f
movq %rbx, %rdi
callq 0x4543
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
leaq 0x4877(%rip), %rdi      # 0x7050
jmp 0x27a8
nop
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events.c
// Function: events_mkrec
struct eventrec *
events_mkrec(int (* func)(void *), void * cookie)
{
	struct eventrec * r;

	/* Allocate structure. */
	if ((r = mpool_eventrec_malloc()) == NULL)
		goto err0;

	/* Initialize. */
	r->func = func;
	r->cookie = cookie;

	/* Success! */
	return (r);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
incq 0x8a01(%rip)            # 0xb1e8
movq %rsi, %rbx
movq %rdi, %r14
movq 0x89dc(%rip), %rax      # 0xb1d0
testq %rax, %rax
je 0x2812
movq 0x89e0(%rip), %rcx      # 0xb1e0
leaq -0x1(%rax), %rdx
movq %rdx, 0x89c5(%rip)      # 0xb1d0
movq -0x8(%rcx,%rax,8), %rax
jmp 0x2842
incq 0x89d7(%rip)            # 0xb1f0
cmpl $0x0, 0x89d8(%rip)      # 0xb1f8
jne 0x2838
movq 0x89df(%rip), %rdi      # 0xb208
callq 0x6bc0
movl $0x1, 0x89c0(%rip)      # 0xb1f8
movl $0x10, %edi
callq 0x2220
testq %rax, %rax
je 0x2850
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
jmp 0x2852
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events.c
// Function: events_spin
int
events_spin(const int * done)
{
	int rc = 0;

	/* Loop until we're done or have a non-zero status. */
	while ((done[0] == 0) && (rc == 0) && (interrupt_requested == 0)) {
		/* Run events. */
		rc = events_run_internal();
	}

	/* Reset interrupt_requested after quitting the loop. */
	interrupt_requested = 0;

	/* Return status code. */
	return (rc);
}

// Assembly:
xorl %eax, %eax
cmpl $0x0, (%rdi)
jne 0x2ac6
cmpl $0x0, 0x8a05(%rip)      # 0xb4b0
jne 0x2ac6
pushq %rbx
movq %rdi, %rbx
callq 0x296e
movl %eax, %ecx
orl (%rbx), %ecx
jne 0x2ac5
cmpl $0x0, 0x89ed(%rip)      # 0xb4b0
je 0x2ab1
popq %rbx
movl $0x0, 0x89e0(%rip)      # 0xb4b0
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events.c
// Function: doevent
static inline int
doevent(struct eventrec * r)
{
	int rc;

	/* Invoke the callback. */
	rc = (r->func)(r->cookie);

	/* Free the event record. */
	mpool_eventrec_free(r);

	/* Return the status code from the callback. */
	return (rc);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rdi
callq *(%r14)
movl %eax, %ebx
movq 0x8683(%rip), %rax      # 0xb1d0
movq 0x8684(%rip), %r15      # 0xb1d8
cmpq %r15, %rax
jae 0x2b74
movq 0x8680(%rip), %rcx      # 0xb1e0
leaq 0x1(%rax), %rdx
movq %rdx, 0x8665(%rip)      # 0xb1d0
movq %r14, (%rcx,%rax,8)
jmp 0x2c07
movq 0x866d(%rip), %rax      # 0xb1e8
shrq $0x8, %rax
cmpq %rax, 0x866a(%rip)      # 0xb1f0
jbe 0x2bf5
testq %r15, %r15
je 0x2c13
movq %r15, %rdi
shlq $0x4, %rdi
callq 0x2220
testq %rax, %rax
je 0x2bf5
movq %rax, %r12
movq 0x8634(%rip), %r13      # 0xb1e0
shlq $0x3, %r15
movq %rax, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x21e0
cmpq 0x863b(%rip), %r13      # 0xb200
je 0x2bcf
movq %r13, %rdi
callq 0x2040
movq %r12, 0x860a(%rip)      # 0xb1e0
shlq 0x85fb(%rip)            # 0xb1d8
movq 0x85ec(%rip), %rax      # 0xb1d0
leaq 0x1(%rax), %rcx
movq %rcx, 0x85e1(%rip)      # 0xb1d0
movq %r14, (%r12,%rax,8)
jmp 0x2bfd
movq %r14, %rdi
callq 0x2040
xorps %xmm0, %xmm0
movups %xmm0, 0x85e1(%rip)     # 0xb1e8
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x44a6(%rip), %rdi      # 0x70c0
leaq 0x44b0(%rip), %rsi      # 0x70d1
leaq 0x44cb(%rip), %rcx      # 0x70f3
movl $0x5a, %edx
callq 0x2160
nop
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_immediate.c
// Function: events_immediate_register
void *
events_immediate_register(int (* func)(void *), void * cookie, int prio)
{
	struct eventrec * r;
	struct eventq * q;

	/* Sanity check. */
	assert((prio >= 0) && (prio < 32));

	/* Bundle into an eventrec record. */
	if ((r = events_mkrec(func, cookie)) == NULL)
		goto err0;

	/* Create a linked list node. */
	if ((q = mpool_eventq_malloc()) == NULL)
		goto err1;
	q->r = r;
	q->prio = prio;

	/* Add to the queue. */
	TAILQ_INSERT_TAIL(&heads[prio], q, entries);

	/* Update minq if necessary. */
	if (prio < minq)
		minq = prio;

	/* Success! */
	return (q);

err1:
	events_freerec(r);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x20, %edx
jae 0x2d07
movl %edx, %ebx
callq 0x27dc
testq %rax, %rax
je 0x2cfd
movq %rax, %r14
incq 0x87d5(%rip)            # 0xb430
movq 0x87b6(%rip), %rax      # 0xb418
testq %rax, %rax
je 0x2c80
movq 0x87ba(%rip), %rcx      # 0xb428
leaq -0x1(%rax), %rdx
movq %rdx, 0x879f(%rip)      # 0xb418
movq -0x8(%rcx,%rax,8), %rax
jmp 0x2cb0
incq 0x87b1(%rip)            # 0xb438
cmpl $0x0, 0x87b2(%rip)      # 0xb440
jne 0x2ca6
movq 0x87b9(%rip), %rdi      # 0xb450
callq 0x6bc0
movl $0x1, 0x879a(%rip)      # 0xb440
movl $0x20, %edi
callq 0x2220
testq %rax, %rax
je 0x2cf5
movq %r14, (%rax)
movl %ebx, 0x18(%rax)
leaq 0x8(%rax), %rcx
movq $0x0, 0x8(%rax)
movl %ebx, %edx
shlq $0x4, %rdx
leaq 0x853c(%rip), %rsi      # 0xb210
movq 0x8(%rdx,%rsi), %rdi
movq %rdi, 0x10(%rax)
movq %rax, (%rdi)
movq %rcx, 0x8(%rdx,%rsi)
cmpl %ebx, 0x8725(%rip)      # 0xb410
jle 0x2cff
movl %ebx, 0x871d(%rip)      # 0xb410
jmp 0x2cff
movq %r14, %rdi
callq 0x285a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x440d(%rip), %rdi      # 0x711b
leaq 0x4421(%rip), %rsi      # 0x7136
leaq 0x4443(%rip), %rcx      # 0x715f
movl $0x47, %edx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_immediate.c
// Function: events_immediate_cancel
void
events_immediate_cancel(void * cookie)
{
	struct eventq * q = cookie;
	int prio = q->prio;

	/* Remove it from the list. */
	TAILQ_REMOVE(&heads[prio], q, entries);

	/* Free the eventrec. */
	events_freerec(q->r);

	/* Return the node to the malloc pool. */
	mpool_eventq_free(q);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x2d44
movq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rax)
jmp 0x2d5c
movslq 0x18(%rbx), %rcx
movq 0x10(%rbx), %rdx
shlq $0x4, %rcx
leaq 0x84b9(%rip), %rsi      # 0xb210
movq %rdx, 0x8(%rcx,%rsi)
movq 0x10(%rbx), %rcx
movq %rax, (%rcx)
movq (%rbx), %rdi
callq 0x285a
movq 0x86a6(%rip), %rax      # 0xb418
movq 0x86a7(%rip), %r14      # 0xb420
cmpq %r14, %rax
jae 0x2d99
movq 0x86a3(%rip), %rcx      # 0xb428
leaq 0x1(%rax), %rdx
movq %rdx, 0x8688(%rip)      # 0xb418
movq %rbx, (%rcx,%rax,8)
jmp 0x2e2c
movq 0x8690(%rip), %rax      # 0xb430
shrq $0x8, %rax
cmpq %rax, 0x868d(%rip)      # 0xb438
jbe 0x2e1a
testq %r14, %r14
je 0x2e38
movq %r14, %rdi
shlq $0x4, %rdi
callq 0x2220
testq %rax, %rax
je 0x2e1a
movq %rax, %r15
movq 0x8657(%rip), %r12      # 0xb428
shlq $0x3, %r14
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x21e0
cmpq 0x865e(%rip), %r12      # 0xb448
je 0x2df4
movq %r12, %rdi
callq 0x2040
movq %r15, 0x862d(%rip)      # 0xb428
shlq 0x861e(%rip)            # 0xb420
movq 0x860f(%rip), %rax      # 0xb418
leaq 0x1(%rax), %rcx
movq %rcx, 0x8604(%rip)      # 0xb418
movq %rbx, (%r15,%rax,8)
jmp 0x2e22
movq %rbx, %rdi
callq 0x2040
xorps %xmm0, %xmm0
movups %xmm0, 0x8604(%rip)     # 0xb430
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x4281(%rip), %rdi      # 0x70c0
leaq 0x428b(%rip), %rsi      # 0x70d1
leaq 0x42a6(%rip), %rcx      # 0x70f3
movl $0x5a, %edx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_immediate.c
// Function: events_immediate_get
struct eventrec *
events_immediate_get(void)
{
	struct eventq * q;
	struct eventrec * r;

	/* Advance past priorities which have no events. */
	while ((minq < 32) && (TAILQ_EMPTY(&heads[minq])))
		minq++;

	/* Are there any events? */
	if (minq == 32)
		return (NULL);

	/*
	 * Remove the first node from the highest priority non-empty linked
	 * list.
	 */
	q = TAILQ_FIRST(&heads[minq]);
	TAILQ_REMOVE(&heads[minq], q, entries);

	/* Extract the eventrec. */
	r = q->r;

	/* Return the node to the malloc pool. */
	mpool_eventq_free(q);

	/* Return the eventrec. */
	return (r);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl 0x85aa(%rip), %ecx      # 0xb410
leaq 0x83a3(%rip), %rax      # 0xb210
cmpl $0x1f, %ecx
jg 0x2e9b
movq %rcx, %rdx
shlq $0x4, %rdx
addq %rax, %rdx
cmpq $0x0, (%rdx)
jne 0x2e9b
leal 0x1(%rcx), %esi
movl %esi, 0x8585(%rip)      # 0xb410
addq $0x10, %rdx
cmpl $0x1f, %ecx
movl %esi, %ecx
jl 0x2e7c
movl $0x20, %ecx
cmpl $0x20, %ecx
jne 0x2ea7
xorl %ebx, %ebx
jmp 0x2f99
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
addq $0x8, %rax
movq -0x8(%rax), %r14
movq 0x8(%r14), %rcx
leaq 0x10(%rcx), %rdx
testq %rcx, %rcx
cmoveq %rax, %rdx
movq 0x10(%r14), %rax
movq %rax, (%rdx)
movq 0x10(%r14), %rax
movq %rcx, (%rax)
movq (%r14), %rbx
movq 0x8539(%rip), %rax      # 0xb418
movq 0x853a(%rip), %r15      # 0xb420
cmpq %r15, %rax
jae 0x2f06
movq 0x8536(%rip), %rcx      # 0xb428
leaq 0x1(%rax), %rdx
movq %rdx, 0x851b(%rip)      # 0xb418
movq %r14, (%rcx,%rax,8)
jmp 0x2f99
movq 0x8523(%rip), %rax      # 0xb430
shrq $0x8, %rax
cmpq %rax, 0x8520(%rip)      # 0xb438
jbe 0x2f87
testq %r15, %r15
je 0x2fa6
movq %r15, %rdi
shlq $0x4, %rdi
callq 0x2220
testq %rax, %rax
je 0x2f87
movq %rax, %r12
movq 0x84ea(%rip), %r13      # 0xb428
shlq $0x3, %r15
movq %rax, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x21e0
cmpq 0x84f1(%rip), %r13      # 0xb448
je 0x2f61
movq %r13, %rdi
callq 0x2040
movq %r12, 0x84c0(%rip)      # 0xb428
shlq 0x84b1(%rip)            # 0xb420
movq 0x84a2(%rip), %rax      # 0xb418
leaq 0x1(%rax), %rcx
movq %rcx, 0x8497(%rip)      # 0xb418
movq %r14, (%r12,%rax,8)
jmp 0x2f8f
movq %r14, %rdi
callq 0x2040
xorps %xmm0, %xmm0
movups %xmm0, 0x8497(%rip)     # 0xb430
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x4113(%rip), %rdi      # 0x70c0
leaq 0x411d(%rip), %rsi      # 0x70d1
leaq 0x4138(%rip), %rcx      # 0x70f3
movl $0x5a, %edx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_network.c
// Function: growpollfd
static int
growpollfd(size_t fd)
{
	size_t new_fds_alloc;
	struct pollfd * new_fds;

	/* We should not be called if the descriptor is already listed. */
	assert(socketlist_get(S, fd)->pollpos == (size_t)(-1));

	/* Expand the pollfd allocation if needed. */
	if (fds_alloc == nfds) {
		new_fds_alloc = fds_alloc == 0 ? 16 : fds_alloc * 2;
		if (new_fds_alloc > SIZE_MAX / sizeof(struct pollfd)) {
			errno = ENOMEM;
			goto err0;
		}
		if ((new_fds = realloc(fds,
		    new_fds_alloc * sizeof(struct pollfd))) == NULL)
			goto err0;
		fds = new_fds;
		fds_alloc = new_fds_alloc;
	}

	/* Sanity-check. */
	assert(nfds < fds_alloc);
	assert(fd < INT_MAX);

	/* Initialize pollfd structure. */
	fds[nfds].fd = (int)fd;
	fds[nfds].events = 0;
	fds[nfds].revents = 0;

	/* Point at pollfd structure. */
	socketlist_get(S, fd)->pollpos = nfds;

	/* We now have one more pollfd structure. */
	nfds++;

	/* Success! */
	return (0);

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x18227(%rip), %rdi     # 0x1b4c0
movl $0x18, %edx
movq %rbx, %rsi
callq 0x5d0d
cmpq $-0x1, 0x10(%rax)
jne 0x336a
movq 0x18228(%rip), %rax     # 0x1b4e0
movq 0x18209(%rip), %r14     # 0x1b4c8
cmpq %r14, %rax
jne 0x3312
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x10, %r15d
cmovneq %rcx, %r15
movq %r15, %rax
shrq $0x3d, %rax
je 0x32eb
callq 0x2090
movl $0xc, (%rax)
jmp 0x335f
movq 0x181de(%rip), %rdi     # 0x1b4d0
leaq (,%r15,8), %rsi
callq 0x2270
testq %rax, %rax
je 0x335f
movq %rax, 0x181c5(%rip)     # 0x1b4d0
movq %r15, 0x181ce(%rip)     # 0x1b4e0
cmpq 0x181c7(%rip), %r14     # 0x1b4e0
jae 0x3389
cmpq $0x7fffffff, %rbx       # imm = 0x7FFFFFFF
jae 0x33a8
movq 0x181a1(%rip), %rax     # 0x1b4d0
movl %ebx, (%rax,%r14,8)
movl $0x0, 0x4(%rax,%r14,8)
movq 0x1817d(%rip), %rdi     # 0x1b4c0
movl $0x18, %edx
movq %rbx, %rsi
callq 0x5d0d
movq %r14, 0x10(%rax)
incq 0x1816d(%rip)           # 0x1b4c8
xorl %eax, %eax
jmp 0x3364
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3f03(%rip), %rdi      # 0x7274
leaq 0x3eab(%rip), %rsi      # 0x7223
leaq 0x3f24(%rip), %rcx      # 0x72a3
movl $0x8d, %edx
callq 0x2160
leaq 0x3f2a(%rip), %rdi      # 0x72ba
leaq 0x3e8c(%rip), %rsi      # 0x7223
leaq 0x3f05(%rip), %rcx      # 0x72a3
movl $0x9e, %edx
callq 0x2160
leaq 0x3f1c(%rip), %rdi      # 0x72cb
leaq 0x3e6d(%rip), %rsi      # 0x7223
leaq 0x3ee6(%rip), %rcx      # 0x72a3
movl $0x9f, %edx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_network.c
// Function: events_network_cancel
int
events_network_cancel(int s, int op)
{
	struct eventrec ** r;

	/* Initialize if necessary. */
	if (init())
		goto err0;

	/* Sanity-check socket number. */
	if (s < 0) {
		warn0("Invalid file descriptor for network event: %d", s);
		goto err0;
	}

	/* Sanity-check operation. */
	if ((op != EVENTS_NETWORK_OP_READ) &&
	    (op != EVENTS_NETWORK_OP_WRITE)) {
		warn0("Invalid operation for network event: %d", op);
		goto err0;
	}

	/* We have no events registered beyond the end of the array. */
	if ((size_t)(s) >= socketlist_getsize(S)) {
		errno = ENOENT;
		goto err0;
	}

	/* Look up the relevant event pointer. */
	if (op == EVENTS_NETWORK_OP_READ)
		r = &socketlist_get(S, (size_t)s)->reader;
	else
		r = &socketlist_get(S, (size_t)s)->writer;

	/* Check if we have an event. */
	if (*r == NULL) {
		errno = ENOENT;
		goto err0;
	}

	/* Free the event. */
	events_freerec(*r);
	*r = NULL;

	/* Clear the appropriate pollfd bit(s). */
	if (op == EVENTS_NETWORK_OP_READ)
		clearbit(socketlist_get(S, (size_t)s)->pollpos, POLLIN);
	else
		clearbit(socketlist_get(S, (size_t)s)->pollpos, POLLOUT);

	/* If that was the last remaining event, stop the clock. */
	if (nfds == 0)
		events_network_selectstats_stopclock();

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movl %edi, %r14d
callq 0x322e
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x34b6
testl %r14d, %r14d
js 0x33fb
cmpl $0x2, %ebp
jb 0x341c
leaq 0x3dd4(%rip), %rdi      # 0x71cb
movl %ebp, %esi
jmp 0x3405
leaq 0x3d9b(%rip), %rdi      # 0x719d
movl %r14d, %esi
xorl %eax, %eax
callq 0x500f
callq 0x2090
movl $0x0, (%rax)
jmp 0x34b6
movl %r14d, %r14d
movq 0x1809a(%rip), %rdi     # 0x1b4c0
movl $0x18, %esi
callq 0x5bcb
cmpq %r14, %rax
jbe 0x34ab
xorl %r12d, %r12d
testl %ebp, %ebp
setne %r12b
movq 0x1807b(%rip), %rdi     # 0x1b4c0
movl $0x18, %edx
movq %r14, %rsi
callq 0x5d0d
shll $0x3, %r12d
movq (%rax,%r12), %rdi
testq %rdi, %rdi
je 0x34ab
movq %rax, %r15
xorl %ebx, %ebx
testl %ebp, %ebp
setne %bl
callq 0x285a
movq $0x0, (%r15,%r12)
movq 0x18043(%rip), %rdi     # 0x1b4c0
movl $0x18, %edx
movq %r14, %rsi
callq 0x5d0d
movq 0x10(%rax), %rdi
leal (%rbx,%rbx,2), %esi
incl %esi
callq 0x34c1
xorl %ebx, %ebx
cmpq $0x0, 0x18026(%rip)     # 0x1b4c8
jne 0x34b6
callq 0x37e0
jmp 0x34b6
callq 0x2090
movl $0x2, (%rax)
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_network.c
// Function: clearbit
static void
clearbit(size_t pollpos, short bit)
{

	/* Clear the bit. */
	fds[pollpos].events &= (short)(~bit);
	fds[pollpos].revents &= (short)(~bit);

	/* Is this pollfd in the way? */
	if (fds[pollpos].events == 0) {
		/* Clear the descriptor's pollpos pointer. */
		socketlist_get(S,
		    (size_t)fds[pollpos].fd)->pollpos = (size_t)(-1);

		/* If this wasn't the last pollfd, move another one up. */
		if (pollpos != nfds - 1) {
			memcpy(&fds[pollpos], &fds[nfds-1],
			    sizeof(struct pollfd));
			socketlist_get(S,
			    (size_t)fds[pollpos].fd)->pollpos = pollpos;
		}

		/* Shrink the pollfd array. */
		nfds--;
	}
}

// Assembly:
notl %esi
movq 0x18006(%rip), %rax     # 0x1b4d0
andw %si, 0x6(%rax,%rdi,8)
andw %si, 0x4(%rax,%rdi,8)
je 0x34d7
retq
pushq %rbx
movq %rdi, %rbx
movq 0x17fde(%rip), %rdi     # 0x1b4c0
movslq (%rax,%rbx,8), %rsi
movl $0x18, %edx
callq 0x5d0d
movq $-0x1, 0x10(%rax)
movq 0x17fc9(%rip), %rax     # 0x1b4c8
leaq -0x1(%rax), %rcx
cmpq %rbx, %rcx
je 0x3530
movq 0x17fc1(%rip), %rcx     # 0x1b4d0
movq -0x8(%rcx,%rax,8), %rax
movq %rax, (%rcx,%rbx,8)
movq 0x17fa1(%rip), %rdi     # 0x1b4c0
movslq %eax, %rsi
movl $0x18, %edx
callq 0x5d0d
movq %rbx, 0x10(%rax)
decq 0x17f91(%rip)           # 0x1b4c8
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_network.c
// Function: events_network_select
int
events_network_select(const struct timeval * tv,
    const volatile sig_atomic_t * interrupt_requested)
{
	int timeout;

	/* Initialize if necessary. */
	if (init())
		goto err0;

	/*
	 * Convert timeout to an integer number of ms.  We round up in order
	 * to avoid creating busy loops when 0 < ${tv} < 1 ms.
	 */
	if (tv == NULL)
		timeout = -1;
	else if (tv->tv_sec >= INT_MAX / 1000)
		timeout = INT_MAX;
	else
		timeout = (int)(tv->tv_sec * 1000 + (tv->tv_usec + 999) / 1000);

	/* We're about to call poll! */
	events_network_selectstats_select();

	/* Poll. */
	while (poll(fds, (nfds_t)nfds, timeout) == -1) {
		/* EINTR is harmless, unless we've requested an interrupt. */
		if (errno == EINTR) {
			if (*interrupt_requested)
				break;
			continue;
		}

		/* Anything else is an error. */
		warnp("poll()");
		goto err0;
	}

	/* If we have any events registered, start the clock again. */
	if (nfds > 0)
		events_network_selectstats_startclock();

	/* Start scanning at the last registered descriptor and work down. */
	fdscanpos = nfds - 1;

	/* Success! */
	return (0);

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
callq 0x322e
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x3625
testq %r15, %r15
je 0x35a0
movq (%r15), %rax
movl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
cmpq $0x20c49a, %rax         # imm = 0x20C49A
jg 0x35a6
imull $0x3e8, %eax, %ecx      # imm = 0x3E8
movl $0x3e7, %eax            # imm = 0x3E7
addq 0x8(%r15), %rax
movabsq $0x20c49ba5e353f7cf, %rdx # imm = 0x20C49BA5E353F7CF
imulq %rdx
movq %rdx, %r14
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x7, %r14
addl %eax, %r14d
addl %ecx, %r14d
jmp 0x35a6
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
callq 0x37e8
movq 0x17f1e(%rip), %rdi     # 0x1b4d0
movq 0x17f0f(%rip), %rsi     # 0x1b4c8
movl %r14d, %edx
callq 0x2280
cmpl $-0x1, %eax
jne 0x35da
callq 0x2090
movq %rax, %r15
movl (%rax), %eax
cmpl $0x4, %eax
jne 0x35fe
cmpl $0x0, (%rbx)
je 0x35ab
cmpq $0x0, 0x17ee6(%rip)     # 0x1b4c8
je 0x35e9
callq 0x37b8
movq 0x17ed8(%rip), %rax     # 0x1b4c8
decq %rax
movq %rax, 0x17ede(%rip)     # 0x1b4d8
xorl %eax, %eax
jmp 0x3625
leaq 0x3bee(%rip), %rdi      # 0x71f3
testl %eax, %eax
jne 0x3612
xorl %eax, %eax
callq 0x500f
jmp 0x3620
xorl %eax, %eax
callq 0x4ef0
movl $0x0, (%r15)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_network.c
// Function: events_network_get
struct eventrec *
events_network_get(void)
{
	struct eventrec * r;

	/* We haven't found any events yet. */
	r = NULL;

	/* Scan through the pollfds looking for ready descriptors. */
	for (; fdscanpos < nfds; fdscanpos--) {
		/* Did we poll on an invalid descriptor? */
		assert((fds[fdscanpos].revents & POLLNVAL) == 0);

		/*
		 * If either POLLERR ("an exceptional condition") or POLLHUP
		 * ("has been disconnected") is set, then we should invoke
		 * whatever callbacks we have available.
		 */
		if (fds[fdscanpos].revents & (POLLERR | POLLHUP)) {
			fds[fdscanpos].revents &= ~(POLLERR | POLLHUP);
			fds[fdscanpos].revents |= fds[fdscanpos].events;
		}

		/* Are we ready for reading? */
		if (fds[fdscanpos].revents & POLLIN) {
			r = socketlist_get(S,
			    (size_t)fds[fdscanpos].fd)->reader;
			socketlist_get(S,
			    (size_t)fds[fdscanpos].fd)->reader = NULL;
			clearbit(fdscanpos, POLLIN);
			break;
		}

		/* Are we ready for writing? */
		if (fds[fdscanpos].revents & POLLOUT) {
			r = socketlist_get(S,
			    (size_t)fds[fdscanpos].fd)->writer;
			socketlist_get(S,
			    (size_t)fds[fdscanpos].fd)->writer = NULL;
			clearbit(fdscanpos, POLLOUT);
			break;
		}
	}

	/* If we're returning the last registered event, stop the clock. */
	if ((r != NULL) && (nfds == 0))
		events_network_selectstats_stopclock();

	/* Return the event we found, or NULL if we didn't find any. */
	return (r);
}

// Assembly:
pushq %rbx
movq 0x17e95(%rip), %rcx     # 0x1b4c8
movq 0x17e9e(%rip), %rax     # 0x1b4d8
cmpq %rcx, %rax
jae 0x368f
movq 0x17e8a(%rip), %rdx     # 0x1b4d0
xorl %ebx, %ebx
movzwl 0x6(%rdx,%rax,8), %esi
testb $0x20, %sil
jne 0x374a
testb $0x18, %sil
je 0x366a
andl $-0x39, %esi
orw 0x4(%rdx,%rax,8), %si
movw %si, 0x6(%rdx,%rax,8)
movzwl 0x6(%rdx,%rax,8), %esi
testb $0x1, %sil
jne 0x3696
testb $0x4, %sil
jne 0x36d7
decq %rax
movq %rax, 0x17e53(%rip)     # 0x1b4d8
cmpq %rcx, %rax
jb 0x3648
jmp 0x3731
xorl %ebx, %ebx
jmp 0x3731
movq 0x17e23(%rip), %rdi     # 0x1b4c0
movslq (%rdx,%rax,8), %rsi
movl $0x18, %edx
callq 0x5d0d
movq (%rax), %rbx
movq 0x17e0b(%rip), %rdi     # 0x1b4c0
movq 0x17e14(%rip), %rax     # 0x1b4d0
movq 0x17e15(%rip), %rcx     # 0x1b4d8
movslq (%rax,%rcx,8), %rsi
movl $0x18, %edx
callq 0x5d0d
movw $0x1, %cx
jmp 0x371b
movq 0x17de2(%rip), %rdi     # 0x1b4c0
movslq (%rdx,%rax,8), %rsi
movl $0x18, %edx
callq 0x5d0d
movq 0x8(%rax), %rbx
movq 0x17dc9(%rip), %rdi     # 0x1b4c0
movq 0x17dd2(%rip), %rax     # 0x1b4d0
movq 0x17dd3(%rip), %rcx     # 0x1b4d8
movslq (%rax,%rcx,8), %rsi
movl $0x18, %edx
callq 0x5d0d
addq $0x8, %rax
movw $0x4, %cx
movq $0x0, (%rax)
movq 0x17daf(%rip), %rdi     # 0x1b4d8
movzwl %cx, %esi
callq 0x34c1
testq %rbx, %rbx
je 0x3745
cmpq $0x0, 0x17d8a(%rip)     # 0x1b4c8
jne 0x3745
callq 0x37e0
movq %rbx, %rax
popq %rbx
retq
leaq 0x3aa9(%rip), %rdi      # 0x71fa
leaq 0x3acb(%rip), %rsi      # 0x7223
leaq 0x3aeb(%rip), %rcx      # 0x724a
movl $0x1b0, %edx            # imm = 0x1B0
callq 0x2160
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_network.c
// Function: events_network_shutdown
static void
events_network_shutdown(void)
{

	/* If we're not initialized, do nothing. */
	if (S == NULL)
		return;

	/* If we have any registered events, do nothing. */
	if (nfds > 0)
		return;

	/* Free the pollfd array. */
	free(fds);
	fds = NULL;
	fds_alloc = 0;

	/* Free the socket list. */
	socketlist_free(S);
	S = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x17d4c(%rip), %rbx     # 0x1b4c0
testq %rbx, %rbx
je 0x37af
cmpq $0x0, 0x17d47(%rip)     # 0x1b4c8
jne 0x37af
movq 0x17d46(%rip), %rdi     # 0x1b4d0
callq 0x2040
xorl %r14d, %r14d
movq %r14, 0x17d37(%rip)     # 0x1b4d0
movq %r14, 0x17d40(%rip)     # 0x1b4e0
movq %rbx, %rdi
callq 0x5b0d
movq %r14, 0x17d11(%rip)     # 0x1b4c0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_network_selectstats.c
// Function: events_network_selectstats_select
void
events_network_selectstats_select(void)
{
	struct timeval tnow;
	double t, d;

	/* If the clock is not running, return silently. */
	if (!running)
		return;

	/* If we can't get the current time, fail silently. */
	if (monoclock_get(&tnow))
		goto done;

	/* Compute inter-select duration in seconds. */
	t = timeval_diff(st, tnow);

	/* Adjust statistics.  We track running mean, variance * N, and max. */
	N += 1.0;
	d = t - mu;
	mu += d / N;
	M2 += d * (t - mu);
	if (max < t)
		max = t;

done:
	/* The clock is no longer running. */
	running = 0;
}

// Assembly:
cmpb $0x1, 0x17cf9(%rip)     # 0x1b4e8
jne 0x38ae
subq $0x18, %rsp
leaq 0x8(%rsp), %rdi
callq 0x3c0c
testl %eax, %eax
jne 0x38a3
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
subq 0x17cd4(%rip), %rax     # 0x1b4f0
cvtsi2sd %rax, %xmm1
subq 0x17cd0(%rip), %rcx     # 0x1b4f8
cvtsi2sd %rcx, %xmm0
mulsd 0x3aa3(%rip), %xmm0     # 0x72d8
addsd %xmm1, %xmm0
movsd 0x17cbf(%rip), %xmm1    # 0x1b500
addsd 0x37bf(%rip), %xmm1     # 0x7008
movsd %xmm1, 0x17caf(%rip)    # 0x1b500
movsd 0x17caf(%rip), %xmm2    # 0x1b508
movapd %xmm0, %xmm3
subsd %xmm2, %xmm3
movapd %xmm3, %xmm4
divsd %xmm1, %xmm4
addsd %xmm2, %xmm4
movsd %xmm4, 0x17c93(%rip)    # 0x1b508
movapd %xmm0, %xmm1
subsd %xmm4, %xmm1
mulsd %xmm3, %xmm1
addsd 0x17c87(%rip), %xmm1    # 0x1b510
movsd %xmm1, 0x17c7f(%rip)    # 0x1b510
ucomisd 0x17c7f(%rip), %xmm0    # 0x1b518
jbe 0x38a3
movsd %xmm0, 0x17c75(%rip)    # 0x1b518
movb $0x0, 0x17c3e(%rip)     # 0x1b4e8
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_network_selectstats.c
// Function: events_network_selectstats
void
events_network_selectstats(double * _n, double * _mu, double * _va,
    double * _max)
{

	/* Copy statistics out. */
	*_n = N;
	*_mu = mu;
	if (N > 1.0)
		*_va = M2 / (N - 1.0);
	else
		*_va = 0.0;
	*_max = max;

	/* Zero statistics. */
	N = mu = M2 = max = 0.0;
}

// Assembly:
movsd 0x17c49(%rip), %xmm0    # 0x1b500
movsd %xmm0, (%rdi)
movsd 0x17c45(%rip), %xmm1    # 0x1b508
movsd %xmm1, (%rsi)
movsd 0x17c41(%rip), %xmm1    # 0x1b510
movsd 0x3a09(%rip), %xmm2     # 0x72e0
addsd %xmm0, %xmm2
divsd %xmm2, %xmm1
movsd 0x3721(%rip), %xmm2     # 0x7008
cmpltsd %xmm0, %xmm2
andpd %xmm1, %xmm2
movlpd %xmm2, (%rdx)
movsd 0x17c1c(%rip), %xmm0    # 0x1b518
movsd %xmm0, (%rcx)
xorl %eax, %eax
movq %rax, 0x17c0f(%rip)     # 0x1b518
movq %rax, 0x17c00(%rip)     # 0x1b510
movq %rax, 0x17bf1(%rip)     # 0x1b508
movq %rax, 0x17be2(%rip)     # 0x1b500
retq
nop
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_timer.c
// Function: events_timer_register
void *
events_timer_register(int (* func)(void *), void * cookie,
    const struct timeval * timeo)
{
	struct eventrec * r;
	struct timerrec * t;
	struct timeval tv;

	/* Create the timer queue if it doesn't exist yet. */
	if (Q == NULL) {
		if ((Q = timerqueue_init()) == NULL)
			goto err0;

		/* Clean up the timer queue at exit. */
		if (atexit(events_timer_shutdown))
			goto err0;
	}

	/* Bundle into an eventrec record. */
	if ((r = events_mkrec(func, cookie)) == NULL)
		goto err0;

	/* Create a timer record. */
	if ((t = malloc(sizeof(struct timerrec))) == NULL)
		goto err1;
	t->r = r;
	memcpy(&t->tv_orig, timeo, sizeof(struct timeval));

	/* Compute the absolute timeout. */
	if (gettimeout(&tv, &t->tv_orig))
		goto err2;

	/* Add this to the timer queue. */
	if ((t->cookie = timerqueue_add(Q, &tv, t)) == NULL)
		goto err2;

	/* Success! */
	return (t);

err2:
	free(t);
err1:
	events_freerec(r);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x0, 0x17be6(%rip)     # 0x1b520
je 0x3991
movq %r14, %rdi
movq %rbx, %rsi
callq 0x27dc
testq %rax, %rax
je 0x39b2
movq %rax, %r14
movl $0x20, %edi
callq 0x2220
testq %rax, %rax
je 0x3987
movq %rax, %rbx
movq %r14, (%rax)
movq %rax, %rsi
addq $0x10, %rsi
movups (%r15), %xmm0
movups %xmm0, 0x10(%rax)
movq %rsp, %rdi
callq 0x3a11
testl %eax, %eax
je 0x39c1
movq %rbx, %rdi
callq 0x2040
movq %r14, %rdi
callq 0x285a
jmp 0x39b2
callq 0x5dc4
movq %rax, 0x17b83(%rip)     # 0x1b520
testq %rax, %rax
je 0x39b2
leaq 0x35(%rip), %rdi        # 0x39de
callq 0x6bc0
testl %eax, %eax
je 0x393c
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x17b58(%rip), %rdi     # 0x1b520
movq %rsp, %rsi
movq %rbx, %rdx
callq 0x5e35
movq %rax, 0x8(%rbx)
testq %rax, %rax
jne 0x39b4
jmp 0x397f