LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]rbtree/rbtree.c
// Function: printorder
static int printorder(rbtree_t *tree, rbnode_t *n,
	rbtree_iterate_func_t iteration, void *state)
{
	int r;
	if (!rbnode_is_nil(n->left)) {
		if ((r = (*iteration)(tree, n->left, state)) != 0)
			return r;
	}
	if (!rbnode_is_nil(n->right)) {
		if ((r = (*iteration)(tree, n->right, state)) != 0)
			return r;
	}
	if (!rbnode_is_nil(n->left)) {
		if ((r = printorder(tree, n->left, iteration, state)) != 0)
			return r;
	}
	if (!rbnode_is_nil(n->right)) {
		if ((r = printorder(tree, n->right, iteration, state)) != 0)
			return r;
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq 0x10(%rsi), %rsi
testq %rsi, %rsi
je 0x198b
movq %r15, %rdi
movq %rbx, %rdx
callq *%r14
testl %eax, %eax
jne 0x19dc
movq 0x18(%r12), %rsi
testq %rsi, %rsi
je 0x19a2
movq %r15, %rdi
movq %rbx, %rdx
callq *%r14
testl %eax, %eax
jne 0x19dc
movq 0x10(%r12), %rsi
testq %rsi, %rsi
je 0x19be
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1961
testl %eax, %eax
jne 0x19dc
movq 0x18(%r12), %rsi
testq %rsi, %rsi
je 0x19da
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1961
testl %eax, %eax
jne 0x19dc
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]rbtree/rbtree.c
// Function: inner_clear
static int inner_clear(rbnode_t *root, rbnode_free_func_t free_func, void *state)
{
    int r;
    if (!rbnode_is_nil(root->left)) {
        if ((r = inner_clear(root->left, free_func, state)) != 0)
            return r;
        root->left = rbnode_nil;
    }
    if (!rbnode_is_nil(root->right)) {
        if ((r = inner_clear(root->right, free_func, state)) != 0)
            return r;
        root->right = rbnode_nil;
    }
    free_func(root, state);
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %rax
movq %rdi, %r14
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x1a2d
movq %rax, %rsi
movq %rbx, %rdx
movq %rax, %r15
callq 0x19fd
movq %r15, %rax
movq $0x0, 0x10(%r14)
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x1a4f
movq %rax, %rsi
movq %rbx, %rdx
movq %rax, %r15
callq 0x19fd
movq %r15, %rax
movq $0x0, 0x18(%r14)
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]rbtree/example/example1.c
// Function: main
int main(int argc, char **argv)
{
	rbtree_t tree = RBTREE_INIT(keycmp);
	int i;
	rbnode_t *n;
	
	/* insert */
	for(i = 0; i < 10; i++) {
		n = malloc(sizeof(rbnode_t));
		n->key = itop(i);
		rbtree_insert(&tree, n);
	}
	
	/* lookup */
	n = rbtree_lookup(&tree, itop(5));
	if (n)
		printf("Find %d.\n", ptoi(n->key));
	else
		printf("5 not exist.\n");
	
	/* delete */
	rbtree_remove(&tree, n);
	
	/* print */
	printf("parent node color   dir\n");
	rbtree_foreach_inorder(&tree, print_node, NULL);
	
	free_rbtree(&tree);
	
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movups 0x236e(%rip), %xmm0     # 0x3dd8
movq %rsp, %rbx
movaps %xmm0, (%rbx)
xorl %r14d, %r14d
movl $0x28, %edi
callq 0x1070
movq %r14, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x117c
incq %r14
cmpq $0xa, %r14
jne 0x1a73
movq %rsp, %rdi
movl $0x5, %esi
callq 0x13d8
movq %rax, %rbx
testq %rax, %rax
je 0x1abb
movl (%rbx), %esi
leaq 0x552(%rip), %rdi       # 0x2004
xorl %eax, %eax
callq 0x1060
jmp 0x1ac7
leaq 0x582(%rip), %rdi       # 0x2044
callq 0x1050
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1414
leaq 0x575(%rip), %rdi       # 0x2051
callq 0x1050
leaq 0x2b(%rip), %rsi        # 0x1b13
movq %r14, %rdi
xorl %edx, %edx
callq 0x1853
leaq 0x92(%rip), %rsi        # 0x1b8b
movq %r14, %rdi
xorl %edx, %edx
callq 0x18bb
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]rbtree/example/example1.c
// Function: print_node
static int print_node(rbtree_t *tree, rbnode_t *n, void *state)
{
	if (rbnode_is_root(n)) {
		printf("       %4d %5s\n",
			ptoi(n->key),
			rbnode_is_red(n) ? "red" : "black");
	}
	else {
		printf("%6d %4d %5s %5s\n",
			ptoi(n->parent->key),
			ptoi(n->key),
			rbnode_is_red(n) ? "red" : "black",
			rbnode_is_right(n) ? "right" : "left");
	}
	return 0;
}

// Assembly:
pushq %rax
movq 0x20(%rsi), %rdi
testq %rdi, %rdi
je 0x1b5f
movl (%rdi), %eax
movl (%rsi), %edx
cmpl $0x1, 0x8(%rsi)
leaq 0x4f2(%rip), %r8        # 0x201e
leaq 0x4ef(%rip), %rcx       # 0x2022
cmoveq %r8, %rcx
cmpq %rsi, 0x18(%rdi)
leaq 0x4f7(%rip), %rsi       # 0x2039
leaq 0x4f6(%rip), %r8        # 0x203f
cmoveq %rsi, %r8
leaq 0x4d4(%rip), %rdi       # 0x2028
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
jmp 0x1b87
movl (%rsi), %eax
cmpl $0x1, 0x8(%rsi)
leaq 0x4b2(%rip), %rcx       # 0x201e
leaq 0x4af(%rip), %rdx       # 0x2022
cmoveq %rcx, %rdx
leaq 0x490(%rip), %rdi       # 0x200e
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x118c
movq 0x8(%rbx), %rax
movb (%rax), %cl
addb $-0x30, %cl
cmpb $0xa, %cl
adcq $0x0, %rax
cmpb $0xa, %cl
jb 0x114b
xorpd %xmm0, %xmm0
jmp 0x1152
movsbl %cl, %ecx
cvtsi2sd %ecx, %xmm0
movb (%rax), %al
addb $-0x30, %al
cmpb $0xa, %al
jae 0x116d
mulsd 0xea6(%rip), %xmm0      # 0x2008
movsbl %al, %eax
cvtsi2sd %eax, %xmm1
addsd %xmm1, %xmm0
divsd 0xe9b(%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 0xef0(%rip), %rdi       # 0x2086
pushq $0x15
popq %rbx
pushq $0x1
popq %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x10c0
callq 0x11cf
movq (%r15), %rcx
leaq 0xee5(%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_O3/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 0x2e1e(%rip), %r14      # 0x3ff8
movq (%r14), %rcx
leaq 0xece(%rip), %rdi       # 0x20b2
pushq $0x8
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x10c0
movq (%r14), %rdi
movq 0x2e84(%rip), %rdx      # 0x4080
leaq 0xeb8(%rip), %rsi       # 0x20bb
xorl %eax, %eax
callq 0x1070
movq (%r14), %rcx
leaq 0xeaf(%rip), %rdi       # 0x20c3
pushq $0xa
popq %rsi
movq %rbx, %rdx
callq 0x10c0
movq (%r14), %rdi
movq 0x2e57(%rip), %rdx      # 0x4080
leaq 0xe9e(%rip), %rsi       # 0x20ce
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1070
// File: /workspace/github_c_makefile_star2_O3/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 0x123e
addq $0x10, %rsp
popq %rbx
retq
callq 0x13a7
// File: /workspace/github_c_makefile_star2_O3/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 0x663a(%rip), %r14      # 0x8ff0
movq (%r14), %rdi
leaq 0x26b5(%rip), %rsi      # 0x5075
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movq (%r14), %rdi
leaq 0x26b5(%rip), %rsi      # 0x5089
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movq (%r14), %rdi
leaq 0x26b8(%rip), %rsi      # 0x50a0
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movq (%r14), %rdi
leaq 0x26bb(%rip), %rsi      # 0x50b7
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movq (%r14), %rdi
leaq 0x26ce(%rip), %rsi      # 0x50de
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movq (%r14), %rdi
leaq 0x26ef(%rip), %rsi      # 0x5113
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movl $0x1, %edi
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O3/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 0x66b5(%rip), %rcx      # 0x9100
leaq 0x2734(%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 0x2acf
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 0x2ad8
movslq %ebx, %rax
cmpq $0x10, %rax
jae 0x2ad8
movb $0x0, (%rsp,%rax)
testl %ebx, %ebx
je 0x2ab9
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 0x2537(%rip), %rsi      # 0x500d
jmp 0x2adf
leaq 0x26c6(%rip), %rsi      # 0x51a5
leaq 0x10(%rsp), %rdx
movl $0x42, %edi
xorl %eax, %eax
callq 0x2150
// File: /workspace/github_c_makefile_star2_O3/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)
movq %rsp, %r8
movl $0x2, %ecx
movl $0x5, %r9d
movl $0x1b, %esi
callq 0x45b8
cmpq $0x4, %rax
jle 0x2b34
movl (%rsp), %r8d
testl %r8d, %r8d
jne 0x2b4e
movb 0x4(%rsp), %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movzbl %bpl, %edx
movzbl %bl, %ecx
leaq 0x2676(%rip), %rsi      # 0x51b8
movl $0x4a, %edi
xorl %eax, %eax
callq 0x2150
movzbl %bpl, %edx
movzbl %bl, %ecx
leaq 0x2676(%rip), %rsi      # 0x51d2
movl $0x4a, %edi
xorl %eax, %eax
callq 0x2090
// File: /workspace/github_c_makefile_star2_O3/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 0x3b30
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 0x45b8
cmpq $0x4, %rax
jne 0x2bd0
movl 0xc(%rsp), %edx
testl %edx, %edx
jne 0x2be3
leaq 0x3eae(%rip), %rdi      # 0x6a65
callq 0x2070
movq 0x63fd(%rip), %rax      # 0x8fc0
movq (%rax), %rdi
addq $0x10, %rsp
popq %rbx
jmp 0x2160
leaq 0x2619(%rip), %rsi      # 0x51f0
movl $0x42, %edi
xorl %eax, %eax
callq 0x2150
leaq 0x262f(%rip), %rsi      # 0x5219
movl $0x42, %edi
xorl %eax, %eax
callq 0x2090
// File: /workspace/github_c_makefile_star2_O3/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
pushq %rax
movq %rcx, %r14
movq %rdx, (%rsp)
movq %rsi, %r15
movq %rdi, %r12
leaq 0x1dd8(%rip), %r13      # 0x584c
leaq 0x46f5(%rip), %rbx      # 0x8170
movq %r13, %rdi
callq 0x2080
movslq %eax, %rbp
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x2050
testl %eax, %eax
jne 0x3aab
movsbl (%r12,%rbp), %edx
testl %edx, %edx
je 0x3abc
leal -0x30(%rdx), %ecx
movl 0x8(%rbx), %eax
cmpl %eax, %ecx
jl 0x3ac6
movq 0x28(%rbx), %r13
addq $0x18, %rbx
testq %r13, %r13
jne 0x3a7b
xorl %eax, %eax
jmp 0x3aeb
movl (%rbx), %ecx
movl 0x8(%rbx), %eax
movl %ecx, (%r15)
jmp 0x3ada
movl (%rbx), %esi
movl %esi, (%r15)
cmpb $0x30, %dl
jl 0x3ada
addl 0x4(%rbx), %ecx
movl $0x1, %eax
jmp 0x3add
movl 0x4(%rbx), %ecx
movq (%rsp), %rdx
movl %ecx, (%rdx)
movl %eax, (%r14)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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)
movq %rsp, %r8
movl $0x3, %ecx
movl $0x4, %r9d
movl $0x1c, %esi
callq 0x45b8
cmpq $0x3, %rax
jle 0x3b73
movl (%rsp), %r8d
testl %r8d, %r8d
jne 0x3b8d
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movzbl %bpl, %edx
movzbl %bl, %ecx
leaq 0x26c1(%rip), %rsi      # 0x6242
movl $0x4a, %edi
xorl %eax, %eax
callq 0x2150
movzbl %bpl, %edx
movzbl %bl, %ecx
leaq 0x26c2(%rip), %rsi      # 0x625d
movl $0x4a, %edi
xorl %eax, %eax
callq 0x2090
// File: /workspace/github_c_makefile_star2_O3/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 0x4e78
cmpl $0x2, %ebp
jne 0x25d4
movq 0x8(%rbx), %rdi
movl $0x1e, %edx
movl $0x5, %esi
callq 0x513c
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 0x3a89
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 0x2a8d
testl %eax, %eax
jne 0x2675
movq %rbx, %rdi
callq 0x58c3
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 0x5017
jmp 0x26a6
movq %rax, %rbx
leaq 0x49d4(%rip), %rdi      # 0x706d
xorl %eax, %eax
callq 0x4ef8
movl $0x0, (%rbx)
movl $0x1, %edi
callq 0x22c0
// File: /workspace/github_c_makefile_star2_O3/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 0x5741
testq %rax, %rax
je 0x274c
movq %rax, %rbx
movq %rax, %rdi
callq 0x4c7b
testq %rax, %rax
je 0x276f
movq %rax, %r15
movq %rax, %rdi
callq 0x20c0
movq %r15, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x456a
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 0x3a89
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 0x4ef8
movl $0x0, (%rbx)
jmp 0x27c7
callq 0x2090
cmpl $0x0, (%rax)
je 0x27b1
movq %rax, %r14
leaq 0x490e(%rip), %rdi      # 0x7091
xorl %eax, %eax
callq 0x4ef8
movl $0x0, (%r14)
jmp 0x27bf
movl $0x1, 0x8d0b(%rip)      # 0xb4a8
xorl %eax, %eax
jmp 0x27cc
leaq 0x48d9(%rip), %rdi      # 0x7081
xorl %eax, %eax
callq 0x5017
jmp 0x27c7
leaq 0x48d9(%rip), %rdi      # 0x7091
xorl %eax, %eax
callq 0x5017
movq %rbx, %rdi
callq 0x456a
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_O3/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 0x6bf0
movl $0x1, 0x89c0(%rip)      # 0xb1f8
movl $0x10, %edi
callq 0x2220
testq %rax, %rax
je 0x284e
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
cmpl $0x0, (%rdi)
jne 0x2ab2
movq %rdi, %r14
cmpl $0x0, 0x8a0e(%rip)      # 0xb4b0
jne 0x2ab2
callq 0x2976
movl (%r14), %ecx
orl %eax, %ecx
je 0x2a9b
movl %eax, %ebx
movl $0x0, 0x89f4(%rip)      # 0xb4b0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x8(%rdi), %rdi
callq *(%r14)
movl %eax, %ebx
movq 0x868c(%rip), %r13      # 0xb1d0
movq 0x868d(%rip), %rbp      # 0xb1d8
cmpq %rbp, %r13
jae 0x2b6b
movq 0x8689(%rip), %rax      # 0xb1e0
leaq 0x1(%r13), %rcx
movq %rcx, 0x866e(%rip)      # 0xb1d0
movq %r14, (%rax,%r13,8)
jmp 0x2c09
movq 0x8676(%rip), %rax      # 0xb1e8
shrq $0x8, %rax
cmpq %rax, 0x8673(%rip)      # 0xb1f0
jbe 0x2bf7
testq %rbp, %rbp
je 0x2c1a
movq %rbp, %rdi
shlq $0x4, %rdi
callq 0x2220
testq %rax, %rax
je 0x2bf7
movq %rax, %r15
movq 0x863d(%rip), %r12      # 0xb1e0
leaq (,%rbp,8), %rdx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21e0
cmpq 0x8643(%rip), %r12      # 0xb200
je 0x2bd5
movq %r12, %rdi
callq 0x2040
movq 0x860a(%rip), %rbp      # 0xb1d8
movq 0x85fb(%rip), %r13      # 0xb1d0
movq %r15, 0x8604(%rip)      # 0xb1e0
addq %rbp, %rbp
movq %rbp, 0x85f2(%rip)      # 0xb1d8
leaq 0x1(%r13), %rax
movq %rax, 0x85df(%rip)      # 0xb1d0
movq %r14, (%r15,%r13,8)
jmp 0x2bff
movq %r14, %rdi
callq 0x2040
xorps %xmm0, %xmm0
movups %xmm0, 0x85df(%rip)     # 0xb1e8
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x449f(%rip), %rdi      # 0x70c0
leaq 0x44a9(%rip), %rsi      # 0x70d1
leaq 0x44c4(%rip), %rcx      # 0x70f3
movl $0x5a, %edx
callq 0x2160
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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 0x2d0f
movl %edx, %ebx
callq 0x27dc
testq %rax, %rax
je 0x2d05
movq %rax, %r14
incq 0x87cd(%rip)            # 0xb430
movq 0x87ae(%rip), %rax      # 0xb418
testq %rax, %rax
je 0x2c88
movq 0x87b2(%rip), %rcx      # 0xb428
leaq -0x1(%rax), %rdx
movq %rdx, 0x8797(%rip)      # 0xb418
movq -0x8(%rcx,%rax,8), %rax
jmp 0x2cb8
incq 0x87a9(%rip)            # 0xb438
cmpl $0x0, 0x87aa(%rip)      # 0xb440
jne 0x2cae
movq 0x87b1(%rip), %rdi      # 0xb450
callq 0x6bf0
movl $0x1, 0x8792(%rip)      # 0xb440
movl $0x20, %edi
callq 0x2220
testq %rax, %rax
je 0x2cfd
movq %r14, (%rax)
movl %ebx, 0x18(%rax)
leaq 0x8(%rax), %rcx
movq $0x0, 0x8(%rax)
movl %ebx, %edx
shlq $0x4, %rdx
leaq 0x8534(%rip), %rsi      # 0xb210
movq 0x8(%rdx,%rsi), %rdi
movq %rdi, 0x10(%rax)
movq %rax, (%rdi)
movq %rcx, 0x8(%rdx,%rsi)
cmpl %ebx, 0x871d(%rip)      # 0xb410
jle 0x2d07
movl %ebx, 0x8715(%rip)      # 0xb410
jmp 0x2d07
movq %r14, %rdi
callq 0x2856
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x4405(%rip), %rdi      # 0x711b
leaq 0x4419(%rip), %rsi      # 0x7136
leaq 0x443b(%rip), %rcx      # 0x715f
movl $0x47, %edx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x2d4d
movq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rax)
jmp 0x2d65
movslq 0x18(%rbx), %rdx
movq 0x10(%rbx), %rcx
shlq $0x4, %rdx
leaq 0x84b0(%rip), %rsi      # 0xb210
movq %rcx, 0x8(%rdx,%rsi)
movq %rax, (%rcx)
movq (%rbx), %rdi
callq 0x2856
movq 0x86a1(%rip), %r12      # 0xb418
movq 0x86a2(%rip), %r13      # 0xb420
cmpq %r13, %r12
jae 0x2d9f
movq 0x869e(%rip), %rax      # 0xb428
leaq 0x1(%r12), %rcx
movq %rcx, 0x8682(%rip)      # 0xb418
movq %rbx, (%rax,%r12,8)
jmp 0x2e3e
movq 0x868a(%rip), %rax      # 0xb430
shrq $0x8, %rax
cmpq %rax, 0x8687(%rip)      # 0xb438
jbe 0x2e2c
testq %r13, %r13
je 0x2e48
movq %r13, %rdi
shlq $0x4, %rdi
callq 0x2220
testq %rax, %rax
je 0x2e2c
movq %rax, %r14
movq 0x8651(%rip), %r15      # 0xb428
leaq (,%r13,8), %rdx
movq %rax, %rdi
movq %r15, %rsi
callq 0x21e0
cmpq 0x8657(%rip), %r15      # 0xb448
je 0x2e09
movq %r15, %rdi
callq 0x2040
movq 0x861e(%rip), %r13      # 0xb420
movq 0x860f(%rip), %r12      # 0xb418
movq %r14, 0x8618(%rip)      # 0xb428
addq %r13, %r13
movq %r13, 0x8606(%rip)      # 0xb420
leaq 0x1(%r12), %rax
movq %rax, 0x85f2(%rip)      # 0xb418
movq %rbx, (%r14,%r12,8)
jmp 0x2e34
movq %rbx, %rdi
callq 0x2040
xorps %xmm0, %xmm0
movups %xmm0, 0x85f2(%rip)     # 0xb430
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x4271(%rip), %rdi      # 0x70c0
leaq 0x427b(%rip), %rsi      # 0x70d1
leaq 0x4296(%rip), %rcx      # 0x70f3
movl $0x5a, %edx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x8598(%rip), %ecx      # 0xb410
leaq 0x8391(%rip), %rax      # 0xb210
cmpl $0x1f, %ecx
jg 0x2eaa
movq %rcx, %rdx
shlq $0x4, %rdx
addq %rax, %rdx
cmpq $0x0, (%rdx)
jne 0x2eba
leal 0x1(%rcx), %esi
movl %esi, 0x8573(%rip)      # 0xb410
addq $0x10, %rdx
cmpl $0x1f, %ecx
movl %esi, %ecx
jl 0x2e8e
jmp 0x2eac
movl %ecx, %esi
movl %esi, %ecx
cmpl $0x20, %esi
jne 0x2eba
xorl %ebx, %ebx
jmp 0x2fb3
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
addq $0x8, %rax
movq -0x8(%rax), %r14
movq 0x8(%r14), %rcx
movq 0x10(%r14), %rdx
leaq 0x10(%rcx), %rsi
testq %rcx, %rcx
cmoveq %rax, %rsi
movq %rdx, (%rsi)
movq %rcx, (%rdx)
movq (%r14), %rbx
movq 0x852a(%rip), %r13      # 0xb418
movq 0x852b(%rip), %rbp      # 0xb420
cmpq %rbp, %r13
jae 0x2f15
movq 0x8527(%rip), %rax      # 0xb428
leaq 0x1(%r13), %rcx
movq %rcx, 0x850c(%rip)      # 0xb418
movq %r14, (%rax,%r13,8)
jmp 0x2fb3
movq 0x8514(%rip), %rax      # 0xb430
shrq $0x8, %rax
cmpq %rax, 0x8511(%rip)      # 0xb438
jbe 0x2fa1
testq %rbp, %rbp
je 0x2fc5
movq %rbp, %rdi
shlq $0x4, %rdi
callq 0x2220
testq %rax, %rax
je 0x2fa1
movq %rax, %r15
movq 0x84db(%rip), %r12      # 0xb428
leaq (,%rbp,8), %rdx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21e0
cmpq 0x84e1(%rip), %r12      # 0xb448
je 0x2f7f
movq %r12, %rdi
callq 0x2040
movq 0x84a8(%rip), %rbp      # 0xb420
movq 0x8499(%rip), %r13      # 0xb418
movq %r15, 0x84a2(%rip)      # 0xb428
addq %rbp, %rbp
movq %rbp, 0x8490(%rip)      # 0xb420
leaq 0x1(%r13), %rax
movq %rax, 0x847d(%rip)      # 0xb418
movq %r14, (%r15,%r13,8)
jmp 0x2fa9
movq %r14, %rdi
callq 0x2040
xorps %xmm0, %xmm0
movups %xmm0, 0x847d(%rip)     # 0xb430
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x40f4(%rip), %rdi      # 0x70c0
leaq 0x40fe(%rip), %rsi      # 0x70d1
leaq 0x4119(%rip), %rcx      # 0x70f3
movl $0x5a, %edx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O3/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 0x18211(%rip), %rdi     # 0x1b4c0
movl $0x18, %edx
movq %rbx, %rsi
callq 0x5d0c
cmpq $-0x1, 0x10(%rax)
jne 0x337c
movq 0x18212(%rip), %r15     # 0x1b4e0
movq 0x181f3(%rip), %r14     # 0x1b4c8
cmpq %r14, %r15
jne 0x3328
leaq (%r15,%r15), %rax
testq %r15, %r15
movl $0x10, %r15d
cmovneq %rax, %r15
movq %r15, %rax
shrq $0x3d, %rax
je 0x3301
callq 0x2090
movl $0xc, (%rax)
jmp 0x3371
movq 0x181c8(%rip), %rdi     # 0x1b4d0
leaq (,%r15,8), %rsi
callq 0x2270
testq %rax, %rax
je 0x3371
movq %rax, 0x181af(%rip)     # 0x1b4d0
movq %r15, 0x181b8(%rip)     # 0x1b4e0
cmpq %r15, %r14
jae 0x339b
cmpq $0x7fffffff, %rbx       # imm = 0x7FFFFFFF
jae 0x33ba
movq 0x1818f(%rip), %rax     # 0x1b4d0
movl %ebx, (%rax,%r14,8)
movl $0x0, 0x4(%rax,%r14,8)
movq 0x1816b(%rip), %rdi     # 0x1b4c0
movl $0x18, %edx
movq %rbx, %rsi
callq 0x5d0c
movq %r14, 0x10(%rax)
incq 0x1815b(%rip)           # 0x1b4c8
xorl %eax, %eax
jmp 0x3376
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3ef1(%rip), %rdi      # 0x7274
leaq 0x3e99(%rip), %rsi      # 0x7223
leaq 0x3f12(%rip), %rcx      # 0x72a3
movl $0x8d, %edx
callq 0x2160
leaq 0x3f18(%rip), %rdi      # 0x72ba
leaq 0x3e7a(%rip), %rsi      # 0x7223
leaq 0x3ef3(%rip), %rcx      # 0x72a3
movl $0x9e, %edx
callq 0x2160
leaq 0x3f0a(%rip), %rdi      # 0x72cb
leaq 0x3e5b(%rip), %rsi      # 0x7223
leaq 0x3ed4(%rip), %rcx      # 0x72a3
movl $0x9f, %edx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O3/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 0x3244
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x34c8
testl %r14d, %r14d
js 0x340d
cmpl $0x2, %ebp
jb 0x342e
leaq 0x3dc2(%rip), %rdi      # 0x71cb
movl %ebp, %esi
jmp 0x3417
leaq 0x3d89(%rip), %rdi      # 0x719d
movl %r14d, %esi
xorl %eax, %eax
callq 0x5017
callq 0x2090
movl $0x0, (%rax)
jmp 0x34c8
movl %r14d, %r14d
movq 0x18088(%rip), %rdi     # 0x1b4c0
movl $0x18, %esi
callq 0x5bca
cmpq %r14, %rax
jbe 0x34bd
xorl %r12d, %r12d
testl %ebp, %ebp
setne %r12b
movq 0x18069(%rip), %rdi     # 0x1b4c0
movl $0x18, %edx
movq %r14, %rsi
callq 0x5d0c
shll $0x3, %r12d
movq (%rax,%r12), %rdi
testq %rdi, %rdi
je 0x34bd
movq %rax, %r15
xorl %ebx, %ebx
testl %ebp, %ebp
setne %bl
callq 0x2856
movq $0x0, (%r15,%r12)
movq 0x18031(%rip), %rdi     # 0x1b4c0
movl $0x18, %edx
movq %r14, %rsi
callq 0x5d0c
movq 0x10(%rax), %rdi
leal (%rbx,%rbx,2), %esi
incl %esi
callq 0x34d3
xorl %ebx, %ebx
cmpq $0x0, 0x18014(%rip)     # 0x1b4c8
jne 0x34c8
callq 0x3804
jmp 0x34c8
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_O3/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 0x17ff4(%rip), %rax     # 0x1b4d0
andw %si, 0x6(%rax,%rdi,8)
andw %si, 0x4(%rax,%rdi,8)
je 0x34e9
retq
pushq %rbx
movq %rdi, %rbx
movq 0x17fcc(%rip), %rdi     # 0x1b4c0
movslq (%rax,%rbx,8), %rsi
movl $0x18, %edx
callq 0x5d0c
movq $-0x1, 0x10(%rax)
movq 0x17fb7(%rip), %rcx     # 0x1b4c8
leaq -0x1(%rcx), %rax
cmpq %rbx, %rax
je 0x354c
movq 0x17faf(%rip), %rax     # 0x1b4d0
movq -0x8(%rax,%rcx,8), %rcx
movq %rcx, (%rax,%rbx,8)
movq 0x17f8f(%rip), %rdi     # 0x1b4c0
movslq %ecx, %rsi
movl $0x18, %edx
callq 0x5d0c
movq %rbx, 0x10(%rax)
movq 0x17f7f(%rip), %rax     # 0x1b4c8
decq %rax
movq %rax, 0x17f75(%rip)     # 0x1b4c8
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3244
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x364a
testq %r15, %r15
je 0x35bc
movq (%r15), %rax
movl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
cmpq $0x20c49a, %rax         # imm = 0x20C49A
jg 0x35c2
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 0x35c2
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
callq 0x380c
movq 0x17f02(%rip), %rdi     # 0x1b4d0
movq 0x17ef3(%rip), %rsi     # 0x1b4c8
movl %r14d, %edx
callq 0x2280
cmpl $-0x1, %eax
jne 0x35f6
callq 0x2090
movq %rax, %r15
movl (%rax), %eax
cmpl $0x4, %eax
jne 0x3611
cmpl $0x0, (%rbx)
je 0x35c7
cmpq $0x0, 0x17eca(%rip)     # 0x1b4c8
je 0x363a
callq 0x37dc
movq 0x17ebc(%rip), %rax     # 0x1b4c8
decq %rax
jmp 0x3641
leaq 0x3bdb(%rip), %rdi      # 0x71f3
testl %eax, %eax
jne 0x3625
xorl %eax, %eax
callq 0x5017
jmp 0x3633
xorl %eax, %eax
callq 0x4ef8
movl $0x0, (%r15)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x364a
movq $-0x1, %rax
movq %rax, 0x17e90(%rip)     # 0x1b4d8
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x17e70(%rip), %rcx     # 0x1b4c8
movq 0x17e79(%rip), %rax     # 0x1b4d8
cmpq %rcx, %rax
jae 0x36b1
movq 0x17e65(%rip), %rdx     # 0x1b4d0
xorl %ebx, %ebx
movzwl 0x6(%rdx,%rax,8), %esi
testb $0x20, %sil
jne 0x376c
testb $0x18, %sil
je 0x3691
andl $-0x39, %esi
movzwl 0x4(%rdx,%rax,8), %edi
orl %edi, %esi
movw %si, 0x6(%rdx,%rax,8)
testb $0x1, %sil
jne 0x36b8
testb $0x4, %sil
jne 0x36f9
decq %rax
movq %rax, 0x17e31(%rip)     # 0x1b4d8
cmpq %rcx, %rax
jb 0x366d
jmp 0x3767
xorl %ebx, %ebx
jmp 0x3767
movq 0x17e01(%rip), %rdi     # 0x1b4c0
movslq (%rdx,%rax,8), %rsi
movl $0x18, %edx
callq 0x5d0c
movq (%rax), %rbx
movq 0x17de9(%rip), %rdi     # 0x1b4c0
movq 0x17df2(%rip), %rax     # 0x1b4d0
movq 0x17df3(%rip), %rcx     # 0x1b4d8
movslq (%rax,%rcx,8), %rsi
movl $0x18, %edx
callq 0x5d0c
movw $0x1, %cx
jmp 0x373d
movq 0x17dc0(%rip), %rdi     # 0x1b4c0
movslq (%rdx,%rax,8), %rsi
movl $0x18, %edx
callq 0x5d0c
movq 0x8(%rax), %rbx
movq 0x17da7(%rip), %rdi     # 0x1b4c0
movq 0x17db0(%rip), %rax     # 0x1b4d0
movq 0x17db1(%rip), %rcx     # 0x1b4d8
movslq (%rax,%rcx,8), %rsi
movl $0x18, %edx
callq 0x5d0c
addq $0x8, %rax
movw $0x4, %cx
movq $0x0, (%rax)
movq 0x17d8d(%rip), %rdi     # 0x1b4d8
movzwl %cx, %esi
callq 0x34d3
testq %rbx, %rbx
je 0x3767
cmpq $0x0, 0x17d68(%rip)     # 0x1b4c8
jne 0x3767
callq 0x3804
movq %rbx, %rax
popq %rbx
retq
leaq 0x3a87(%rip), %rdi      # 0x71fa
leaq 0x3aa9(%rip), %rsi      # 0x7223
leaq 0x3ac9(%rip), %rcx      # 0x724a
movl $0x1b0, %edx            # imm = 0x1B0
callq 0x2160
// File: /workspace/github_c_makefile_star2_O3/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 0x17d2a(%rip), %rbx     # 0x1b4c0
testq %rbx, %rbx
je 0x37d1
cmpq $0x0, 0x17d25(%rip)     # 0x1b4c8
jne 0x37d1
movq 0x17d24(%rip), %rdi     # 0x1b4d0
callq 0x2040
xorl %r14d, %r14d
movq %r14, 0x17d15(%rip)     # 0x1b4d0
movq %r14, 0x17d1e(%rip)     # 0x1b4e0
movq %rbx, %rdi
callq 0x5b0c
movq %r14, 0x17cef(%rip)     # 0x1b4c0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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, 0x17cd5(%rip)     # 0x1b4e8
jne 0x38d2
subq $0x18, %rsp
leaq 0x8(%rsp), %rdi
callq 0x3c38
testl %eax, %eax
jne 0x38c7
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
subq 0x17cb0(%rip), %rax     # 0x1b4f0
cvtsi2sd %rax, %xmm1
subq 0x17cac(%rip), %rcx     # 0x1b4f8
cvtsi2sd %rcx, %xmm0
mulsd 0x3a7f(%rip), %xmm0     # 0x72d8
addsd %xmm1, %xmm0
movsd 0x17c9b(%rip), %xmm1    # 0x1b500
addsd 0x379b(%rip), %xmm1     # 0x7008
movsd %xmm1, 0x17c8b(%rip)    # 0x1b500
movsd 0x17c8b(%rip), %xmm2    # 0x1b508
movapd %xmm0, %xmm3
subsd %xmm2, %xmm3
movapd %xmm3, %xmm4
divsd %xmm1, %xmm4
addsd %xmm2, %xmm4
movsd %xmm4, 0x17c6f(%rip)    # 0x1b508
movapd %xmm0, %xmm1
subsd %xmm4, %xmm1
mulsd %xmm3, %xmm1
addsd 0x17c63(%rip), %xmm1    # 0x1b510
movsd %xmm1, 0x17c5b(%rip)    # 0x1b510
ucomisd 0x17c5b(%rip), %xmm0    # 0x1b518
jbe 0x38c7
movsd %xmm0, 0x17c51(%rip)    # 0x1b518
movb $0x0, 0x17c1a(%rip)     # 0x1b4e8
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x17c25(%rip), %xmm0    # 0x1b500
movsd %xmm0, (%rdi)
movsd 0x17c21(%rip), %xmm1    # 0x1b508
movsd %xmm1, (%rsi)
movsd 0x17c1d(%rip), %xmm1    # 0x1b510
movsd 0x39e5(%rip), %xmm2     # 0x72e0
addsd %xmm0, %xmm2
divsd %xmm2, %xmm1
movsd 0x36fd(%rip), %xmm2     # 0x7008
cmpltsd %xmm0, %xmm2
andpd %xmm1, %xmm2
movlpd %xmm2, (%rdx)
movsd 0x17bf8(%rip), %xmm0    # 0x1b518
movsd %xmm0, (%rcx)
xorl %eax, %eax
movq %rax, 0x17beb(%rip)     # 0x1b518
movq %rax, 0x17bdc(%rip)     # 0x1b510
movq %rax, 0x17bcd(%rip)     # 0x1b508
movq %rax, 0x17bbe(%rip)     # 0x1b500
retq
nop