LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x1989
movl (%rdi), %eax
movl (%rsi), %edx
cmpl $0x1, 0x8(%rsi)
leaq 0x6c8(%rip), %r8        # 0x201e
leaq 0x6c5(%rip), %rcx       # 0x2022
cmoveq %r8, %rcx
cmpq %rsi, 0x18(%rdi)
leaq 0x6cd(%rip), %rsi       # 0x2039
leaq 0x6cc(%rip), %r8        # 0x203f
cmoveq %rsi, %r8
leaq 0x6aa(%rip), %rdi       # 0x2028
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
jmp 0x19b1
movl (%rsi), %eax
cmpl $0x1, 0x8(%rsi)
leaq 0x688(%rip), %rcx       # 0x201e
leaq 0x685(%rip), %rdx       # 0x2022
cmoveq %rcx, %rdx
leaq 0x666(%rip), %rdi       # 0x200e
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/begriffs[P]pthread-test/pipe.c
// Function: pipe_send
void pipe_send(struct stage *s, long data)
{
	pthread_mutex_lock(&s->mutex);
	{
		while (s->data_ready)
			pthread_cond_wait(&s->ready, &s->mutex);
		s->data = data;
		s->data_ready = true;
		pthread_cond_signal(&s->avail);
	}
	pthread_mutex_unlock(&s->mutex);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x1100
leaq 0x58(%rbx), %r15
cmpb $0x1, 0x88(%rbx)
jne 0x1236
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1040
jmp 0x1220
movq %r14, 0x90(%rbx)
movb $0x1, 0x88(%rbx)
leaq 0x28(%rbx), %rdi
callq 0x1080
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x10a0
// File: /workspace/github_c_makefile_star2_O2/begriffs[P]pthread-test/pipe.c
// Function: pipe_stage
void *pipe_stage(void *arg)
{
	struct stage *s = arg;
	struct stage *next = s->next;

	pthread_mutex_lock(&s->mutex);
	{
		while (1)
		{
			while (!s->data_ready)
				pthread_cond_wait(&s->avail, &s->mutex);
			/* the operation we perform is incrementing data */
			pipe_send(next, s->data + 1);
			s->data_ready = false;
			pthread_cond_signal(&s->ready);
		}
	}
	pthread_mutex_unlock(&s->mutex);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xa0(%rdi), %r14
callq 0x1100
leaq 0x28(%rbx), %r15
leaq 0x58(%rbx), %r12
cmpb $0x0, 0x88(%rbx)
je 0x12a5
movq 0x90(%rbx), %rsi
incq %rsi
movq %r14, %rdi
callq 0x120c
movb $0x0, 0x88(%rbx)
movq %r12, %rdi
callq 0x1080
jmp 0x1279
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1040
jmp 0x1279
// File: /workspace/github_c_makefile_star2_O2/begriffs[P]pthread-test/pipe.c
// Function: pipe_create
void pipe_create(struct pipe *p, int stages)
{
	struct stage **link = &p->head, *new_s, *s;

	pthread_mutex_init(&p->mutex, NULL);
	p->stages = stages;
	p->active = false;

	while (stages-- > 0)
	{
		new_s = malloc(sizeof *new_s);
		pthread_mutex_init(&new_s->mutex, NULL);
		pthread_cond_init(&new_s->avail, NULL);
		pthread_cond_init(&new_s->ready, NULL);
		new_s->data_ready = false;
		*link = new_s;
		link = &new_s->next;
	}
	
	/* end list, record tail */
	*link = NULL;
	p->tail = new_s;

	for (s = p->head; s->next; s = s->next)
		pthread_create(&s->thread, NULL, pipe_stage, s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x28(%rdi), %r15
xorl %esi, %esi
callq 0x10f0
movl %ebp, 0x38(%rbx)
andl $0x0, 0x3c(%rbx)
movq %r15, %r12
testl %ebp, %ebp
jle 0x131f
decl %ebp
movl $0xa8, %edi
callq 0x10b0
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
callq 0x10f0
leaq 0x28(%r14), %rdi
xorl %esi, %esi
callq 0x1090
leaq 0x58(%r14), %rdi
xorl %esi, %esi
callq 0x1090
movb $0x0, 0x88(%r14)
movq %r14, (%r12)
movq %r14, %r12
addq $0xa0, %r12
jmp 0x12d4
andq $0x0, (%r12)
movq %r14, 0x30(%rbx)
leaq -0xd5(%rip), %rbx       # 0x125a
movq (%r15), %rcx
cmpq $0x0, 0xa0(%rcx)
je 0x1356
leaq 0xa0(%rcx), %r15
leaq 0x98(%rcx), %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x10d0
jmp 0x132f
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x13fc
leal -0x1(%r12), %eax
movl %eax, 0x3c(%r15)
movq %r15, %rdi
callq 0x10a0
movq %rbx, %rdi
callq 0x1100
leaq 0x28(%rbx), %r15
cmpb $0x0, 0x88(%rbx)
jne 0x13e0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1040
jmp 0x13ca
movq 0x90(%rbx), %rax
movq %rax, (%r14)
movb $0x0, 0x88(%rbx)
leaq 0x58(%rbx), %rdi
callq 0x1080
jmp 0x13ff
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_O2/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 0x98(%rsp), %rbx
pushq $0xa
popq %rsi
movq %rbx, %rdi
callq 0x12b2
leaq 0xbc0(%rip), %rdi       # 0x2004
callq 0x1030
leaq 0xbe1(%rip), %r14       # 0x2031
movq 0x2b81(%rip), %r12      # 0x3fd8
leaq 0x10(%rsp), %r15
leaq 0xbf2(%rip), %r13       # 0x2055
leaq 0x8(%rsp), %rbp
movq %r14, %rdi
xorl %eax, %eax
callq 0x1060
movq (%r12), %rdx
movq %r15, %rdi
movl $0x80, %esi
callq 0x1070
testq %rax, %rax
je 0x151e
movq %r15, %rdi
callq 0x1050
cmpq $0x2, %rax
jb 0x1468
jne 0x14c6
cmpb $0x3d, 0x10(%rsp)
jne 0x14c6
movq %rbx, %rdi
movq %rsp, %rsi
callq 0x138d
testb %al, %al
je 0x14ec
movq (%rsp), %rsi
leaq 0xb7b(%rip), %rdi       # 0x2038
xorl %eax, %eax
callq 0x1060
jmp 0x1468
movq %r15, %rdi
movq %r13, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x10c0
testl %eax, %eax
jle 0x14fd
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x135f
jmp 0x1468
leaq 0xb54(%rip), %rdi       # 0x2047
callq 0x1030
jmp 0x1468
movq 0x2af4(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xb4b(%rip), %rdi       # 0x2059
pushq $0x15
popq %rsi
pushq $0x1
popq %rdx
callq 0x10e0
jmp 0x1468
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_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1010, %rsp           # imm = 0x1010
movaps %xmm0, (%rsp)
movq %rdi, %rbx
leaq 0xe37(%rip), %rsi       # 0x2020
callq 0x1090
testq %rax, %rax
je 0x131d
movq %rax, %r14
movl $0xfffff, %edi          # imm = 0xFFFFF
callq 0x1080
movq %rax, %r15
leaq 0x10(%rsp), %rdi
xorl %ebp, %ebp
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x1050
xorpd %xmm1, %xmm1
movapd (%rsp), %xmm2
cmpeqsd %xmm2, %xmm1
movsd 0xdd8(%rip), %xmm0      # 0x2008
andpd %xmm1, %xmm0
andnpd %xmm2, %xmm1
orpd %xmm0, %xmm1
movq 0x2db5(%rip), %r12      # 0x3ff8
movq (%r12), %rdi
movapd %xmm1, (%rsp)
movapd %xmm1, %xmm0
mulsd 0xdb8(%rip), %xmm0      # 0x2010
leaq 0xe07(%rip), %rsi       # 0x2066
movl $0x3ff, %edx            # imm = 0x3FF
movb $0x1, %al
callq 0x1070
movl $0x1000, %ecx           # imm = 0x1000
pushq $0x1
popq %rax
xorl %edx, %edx
testl %ecx, %ecx
je 0x12a8
cvtsi2sd %ecx, %xmm0
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %rsi
cmpl $0x2, %esi
cmovbl %eax, %esi
leal (%rsi,%rdx), %edi
movl %edx, %edx
cmpq %rdi, %rdx
jae 0x12a1
movb %bpl, 0x10(%rsp,%rdx)
incq %rdx
jmp 0x1292
incb %bpl
subl %esi, %ecx
jmp 0x1275
xorl %ecx, %ecx
cmpq $0xfffff, %rcx          # imm = 0xFFFFF
je 0x12d6
imull $0x9e3779b1, %eax, %eax # imm = 0x9E3779B1
addl $0x85ebca77, %eax       # imm = 0x85EBCA77
movl %eax, %edx
shrl $0xb, %edx
andl $0xfff, %edx            # imm = 0xFFF
movb 0x10(%rsp,%rdx), %dl
movb %dl, (%r15,%rcx)
incq %rcx
jmp 0x12aa
pushq $0x1
popq %rsi
movl $0xfffff, %edx          # imm = 0xFFFFF
movq %r15, %rdi
movq %r14, %rcx
callq 0x10c0
movq %r15, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1040
movq (%r12), %rdi
leaq 0xd2e(%rip), %rsi       # 0x2032
movq %rbx, %rdx
xorl %eax, %eax
addq $0x1010, %rsp           # imm = 0x1010
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1070
leaq 0xcff(%rip), %rdi       # 0x2023
callq 0x10a0
pushq $0x1
popq %rdi
callq 0x10b0
// File: /workspace/github_c_makefile_star2_O2/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, 0x2d20(%rip)      # 0x4080
movq 0x2c91(%rip), %r15      # 0x3ff8
movq (%r15), %rcx
leaq 0xcde(%rip), %rdi       # 0x204f
pushq $0x16
popq %rsi
pushq $0x1
popq %rdx
callq 0x10c0
cmpl $0x1, %ebp
jle 0x13dd
movq 0x8(%rbx), %rax
movb (%rax), %cl
addb $-0x30, %cl
cmpb $0xa, %cl
adcq $0x0, %rax
cmpb $0xa, %cl
jb 0x139c
xorpd %xmm0, %xmm0
jmp 0x13a3
movsbl %cl, %ecx
cvtsi2sd %ecx, %xmm0
movb (%rax), %al
addb $-0x30, %al
cmpb $0xa, %al
jae 0x13be
mulsd 0xc65(%rip), %xmm0      # 0x2018
movsbl %al, %eax
cvtsi2sd %eax, %xmm1
addsd %xmm1, %xmm0
divsd 0xc4a(%rip), %xmm0      # 0x2010
leaq 0x8(%rsp), %rdi
callq 0x11cc
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq (%r15), %rcx
leaq 0xc9f(%rip), %rdi       # 0x2086
pushq $0x15
popq %rbx
pushq $0x1
popq %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x10c0
callq 0x1420
movq (%r15), %rcx
leaq 0xc94(%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_O2/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 0x2bcd(%rip), %r14      # 0x3ff8
movq (%r14), %rcx
leaq 0xc7d(%rip), %rdi       # 0x20b2
pushq $0x8
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x10c0
movq (%r14), %rdi
movq 0x2c33(%rip), %rdx      # 0x4080
leaq 0xc67(%rip), %rsi       # 0x20bb
xorl %eax, %eax
callq 0x1070
movq (%r14), %rcx
leaq 0xc5e(%rip), %rdi       # 0x20c3
pushq $0xa
popq %rsi
movq %rbx, %rdx
callq 0x10c0
movq (%r14), %rdi
movq 0x2c06(%rip), %rdx      # 0x4080
leaq 0xc4d(%rip), %rsi       # 0x20ce
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1070
// File: /workspace/github_c_makefile_star2_O2/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 0x612a(%rip), %r14      # 0x9ff0
movq (%r14), %rdi
leaq 0x11a5(%rip), %rsi      # 0x5075
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movq (%r14), %rdi
leaq 0x11a5(%rip), %rsi      # 0x5089
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movq (%r14), %rdi
leaq 0x11a8(%rip), %rsi      # 0x50a0
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movq (%r14), %rdi
leaq 0x11ab(%rip), %rsi      # 0x50b7
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movq (%r14), %rdi
leaq 0x11be(%rip), %rsi      # 0x50de
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
movq (%r14), %rdi
leaq 0x11df(%rip), %rsi      # 0x5113
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2120
pushq $0x1
popq %rdi
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O2/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 0x61a7(%rip), %rcx      # 0xa100
leaq 0x1226(%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 0x3fdb
movl %eax, %ebp
movq %rsp, %rsi
pushq $0x10
popq %rdx
movl %eax, %edi
callq 0x2100
movq %rax, %rbx
movl %ebp, %edi
callq 0x20f0
testl %ebx, %ebx
js 0x3fe4
movslq %ebx, %rax
cmpq $0x10, %rax
jae 0x3fe4
movb $0x0, (%rsp,%rax)
testl %ebx, %ebx
je 0x3fc5
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 0x102b(%rip), %rsi      # 0x500d
jmp 0x3feb
leaq 0x11ba(%rip), %rsi      # 0x51a5
pushq $0x42
popq %rdi
leaq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/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)
pushq $0x1b
popq %rsi
pushq $0x2
popq %rcx
movq %rsp, %r8
pushq $0x5
popq %r9
callq 0x410b
cmpq $0x4, %rax
jle 0x4038
movl (%rsp), %r8d
testl %r8d, %r8d
jne 0x4050
movb 0x4(%rsp), %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movzbl %bpl, %edx
movzbl %bl, %ecx
leaq 0x1172(%rip), %rsi      # 0x51b8
pushq $0x4a
popq %rdi
xorl %eax, %eax
callq 0x2150
movzbl %bpl, %edx
movzbl %bl, %ecx
leaq 0x1174(%rip), %rsi      # 0x51d2
pushq $0x4a
popq %rdi
xorl %eax, %eax
callq 0x2090
// File: /workspace/github_c_makefile_star2_O2/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)
pushq $0x1c
popq %rsi
pushq $0x3
popq %rcx
movq %rsp, %r8
pushq $0x4
popq %r9
callq 0x410b
cmpq $0x3, %rax
jle 0x40db
movl (%rsp), %r8d
testl %r8d, %r8d
jne 0x40f3
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movzbl %bpl, %edx
movzbl %bl, %ecx
leaq 0x2159(%rip), %rsi      # 0x6242
pushq $0x4a
popq %rdi
xorl %eax, %eax
callq 0x2150
movzbl %bpl, %edx
movzbl %bl, %ecx
leaq 0x215c(%rip), %rsi      # 0x625d
pushq $0x4a
popq %rdi
xorl %eax, %eax
callq 0x2090
// File: /workspace/github_c_makefile_star2_O2/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 0x40(%rcx,%r9), %rsi
pushq $0x1
popq %rdi
callq 0x2110
movq %rax, %r12
movq $0x3, (%rax)
movl %r14d, %eax
movq %rax, 0x8(%r12)
movl %r15d, 0x10(%r12)
movl %ebx, 0x14(%r12)
testq %r15, %r15
je 0x4166
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
testl %eax, %eax
je 0x4181
pushq $-0x1
popq %r13
jmp 0x41a2
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_O2/truenas[P]binaries/src/ixnvdimm.c
// Function: Crc16
static int
Crc16(char *ptr, int count)
{
	int crc, i;

	crc = 0;
	while (--count >= 0) {
		crc = crc ^ (int)*ptr++ << 8;
		for (i = 0; i < 8; ++i) {
			if (crc & 0x8000) {
				crc = crc << 1 ^ 0x1021;
			} else {
				crc = crc << 1;
			}
		}
	}
	return (crc & 0xFFFF);
}

// Assembly:
xorl %ecx, %ecx
pushq $0x8
popq %rax
testl %esi, %esi
jle 0x422a
decl %esi
movsbl (%rdi), %edx
shll $0x8, %edx
xorl %edx, %ecx
movl %eax, %edx
subl $0x1, %edx
jb 0x4225
movl %ecx, %r8d
addl %ecx, %r8d
movl %r8d, %r9d
xorl $0x1021, %r9d           # imm = 0x1021
testw %cx, %cx
cmovnsl %r8d, %r9d
movl %r9d, %ecx
jmp 0x4204
incq %rdi
jmp 0x41f4
movzwl %cx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2481
callq 0x489c
cmpl $0x2, %ebp
jne 0x24b0
movq 0x8(%rbx), %rdi
pushq $0x5
popq %rsi
pushq $0x1e
popq %rdx
callq 0x4c2c
testq %rax, %rax
jne 0x24d4
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2517
leaq 0x4b89(%rip), %rdi      # 0x7034
jmp 0x255f
movq 0x8b41(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x4b4f(%rip), %rsi      # 0x7010
leaq 0x4b63(%rip), %rdx      # 0x702b
xorl %eax, %eax
callq 0x21d0
jmp 0x257c
movq %rax, %rbx
movl $0x78, 0x8fc3(%rip)     # 0xb4a4
andl $0x0, 0x8fc0(%rip)      # 0xb4a8
leaq 0x95(%rip), %rdi        # 0x2584
movsd 0x4b11(%rip), %xmm0     # 0x7008
movq %rax, %rsi
callq 0x3686
testq %rax, %rax
jne 0x2523
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2542
leaq 0x4b3b(%rip), %rdi      # 0x7050
jmp 0x255f
movq %rax, %rbx
leaq 0x4b13(%rip), %rdi      # 0x7034
jmp 0x2572
leaq 0x8f7e(%rip), %rdi      # 0xb4a8
callq 0x294b
testl %eax, %eax
jne 0x254e
movq %rbx, %rdi
callq 0x530d
xorl %edi, %edi
callq 0x22c0
movq %rax, %rbx
leaq 0x4b04(%rip), %rdi      # 0x7050
jmp 0x2572
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2568
leaq 0x4b0e(%rip), %rdi      # 0x706d
xorl %eax, %eax
callq 0x4aa8
jmp 0x257c
movq %rax, %rbx
leaq 0x4afb(%rip), %rdi      # 0x706d
xorl %eax, %eax
callq 0x4919
andl $0x0, (%rbx)
pushq $0x1
popq %rdi
callq 0x22c0
// File: /workspace/github_c_makefile_star2_O2/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 0x51c0
testq %rax, %rax
je 0x2620
movq %rax, %rbx
movq %rax, %rdi
callq 0x46ae
testq %rax, %rax
je 0x2640
movq %rax, %r15
movq %rax, %rdi
callq 0x20c0
movq %r15, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x4007
movl 0x8ed5(%rip), %eax      # 0xb4a4
leal -0x1(%rax), %ecx
movl %ecx, 0x8ecc(%rip)      # 0xb4a4
cmpl $0x2, %eax
jl 0x2661
leaq -0x64(%rip), %rdi       # 0x2584
movsd 0x4a18(%rip), %xmm0     # 0x7008
movq %r14, %rsi
callq 0x3686
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jne 0x2698
callq 0x2090
cmpl $0x0, (%rax)
je 0x269e
movq %rax, %rbx
leaq 0x4a32(%rip), %rdi      # 0x7050
jmp 0x2634
callq 0x2090
cmpl $0x0, (%rax)
je 0x266f
movq %rax, %rbx
leaq 0x4a4d(%rip), %rdi      # 0x7081
xorl %eax, %eax
callq 0x4919
andl $0x0, (%rbx)
jmp 0x2695
callq 0x2090
cmpl $0x0, (%rax)
je 0x267f
movq %rax, %r14
leaq 0x4a3d(%rip), %rdi      # 0x7091
xorl %eax, %eax
callq 0x4919
andl $0x0, (%r14)
jmp 0x268d
movl $0x1, 0x8e3d(%rip)      # 0xb4a8
xorl %eax, %eax
jmp 0x2698
leaq 0x4a0b(%rip), %rdi      # 0x7081
xorl %eax, %eax
callq 0x4aa8
jmp 0x2695
leaq 0x4a0b(%rip), %rdi      # 0x7091
xorl %eax, %eax
callq 0x4aa8
movq %rbx, %rdi
callq 0x4007
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x49ab(%rip), %rdi      # 0x7050
jmp 0x2676
nop
// File: /workspace/github_c_makefile_star2_O2/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 0x8b35(%rip)            # 0xb1e8
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8b10(%rip), %rax      # 0xb1d0
testq %rax, %rax
je 0x26de
movq 0x8b14(%rip), %rcx      # 0xb1e0
leaq -0x1(%rax), %rdx
movq %rdx, 0x8af9(%rip)      # 0xb1d0
movq -0x8(%rcx,%rax,8), %rax
jmp 0x270c
incq 0x8b0b(%rip)            # 0xb1f0
cmpl $0x0, 0x8b0c(%rip)      # 0xb1f8
jne 0x2704
movq 0x8b13(%rip), %rdi      # 0xb208
callq 0x6370
movl $0x1, 0x8af4(%rip)      # 0xb1f8
pushq $0x10
popq %rdi
callq 0x2220
testq %rax, %rax
je 0x2718
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2abe
movl %edx, %ebx
callq 0x26a8
testq %rax, %rax
je 0x2ab4
movq %rax, %r14
incq 0x8a19(%rip)            # 0xb430
movq 0x89fa(%rip), %rax      # 0xb418
testq %rax, %rax
je 0x2a3c
movq 0x89fe(%rip), %rcx      # 0xb428
leaq -0x1(%rax), %rdx
movq %rdx, 0x89e3(%rip)      # 0xb418
movq -0x8(%rcx,%rax,8), %rax
jmp 0x2a6a
incq 0x89f5(%rip)            # 0xb438
cmpl $0x0, 0x89f6(%rip)      # 0xb440
jne 0x2a62
movq 0x89fd(%rip), %rdi      # 0xb450
callq 0x6370
movl $0x1, 0x89de(%rip)      # 0xb440
pushq $0x20
popq %rdi
callq 0x2220
testq %rax, %rax
je 0x2aac
movq %r14, (%rax)
movl %ebx, 0x18(%rax)
leaq 0x8(%rax), %rcx
andq $0x0, 0x8(%rax)
movl %ebx, %edx
shlq $0x4, %rdx
leaq 0x8785(%rip), %rsi      # 0xb210
movq 0x8(%rdx,%rsi), %rdi
movq %rdi, 0x10(%rax)
movq %rax, (%rdi)
movq %rcx, 0x8(%rdx,%rsi)
cmpl %ebx, 0x896e(%rip)      # 0xb410
jle 0x2ab6
movl %ebx, 0x8966(%rip)      # 0xb410
jmp 0x2ab6
movq %r14, %rdi
callq 0x2720
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x4656(%rip), %rdi      # 0x711b
leaq 0x466a(%rip), %rsi      # 0x7136
leaq 0x468c(%rip), %rcx      # 0x715f
pushq $0x47
popq %rdx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x2af2
movq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rax)
jmp 0x2b0a
movslq 0x18(%rbx), %rdx
movq 0x10(%rbx), %rcx
shlq $0x4, %rdx
leaq 0x870b(%rip), %rsi      # 0xb210
movq %rcx, 0x8(%rdx,%rsi)
movq %rax, (%rcx)
movq (%rbx), %rdi
callq 0x2720
movq %rbx, %rdi
popq %rbx
jmp 0x2b1b
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movl 0x87e4(%rip), %ecx      # 0xb410
movq %rcx, %rdx
shlq $0x4, %rdx
leaq 0x85d6(%rip), %rax      # 0xb210
addq %rax, %rdx
cmpl $0x1f, %ecx
jg 0x2c5a
cmpq $0x0, (%rdx)
jne 0x2c64
leal 0x1(%rcx), %esi
incq %rcx
movl %esi, 0x87bc(%rip)      # 0xb410
addq $0x10, %rdx
jmp 0x2c3d
cmpq $0x20, %rcx
jne 0x2c64
xorl %ebx, %ebx
jmp 0x2c96
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
addq $0x8, %rax
movq -0x8(%rax), %rdi
movq 0x8(%rdi), %rcx
leaq 0x10(%rcx), %rdx
testq %rcx, %rcx
cmoveq %rax, %rdx
movq 0x10(%rdi), %rax
movq %rax, (%rdx)
movq %rcx, (%rax)
movq (%rdi), %rbx
callq 0x2b1b
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2fd8
pushq $-0x1
popq %rbx
testl %eax, %eax
jne 0x311c
testl %r14d, %r14d
js 0x3076
cmpl $0x2, %ebp
jb 0x3094
leaq 0x4159(%rip), %rdi      # 0x71cb
movl %ebp, %esi
jmp 0x3080
leaq 0x4120(%rip), %rdi      # 0x719d
movl %r14d, %esi
xorl %eax, %eax
callq 0x4aa8
callq 0x2090
andl $0x0, (%rax)
jmp 0x311c
movl %r14d, %r14d
movq 0x18422(%rip), %rdi     # 0x1b4c0
callq 0x3034
cmpq %r14, %rax
jbe 0x3111
xorl %r12d, %r12d
testl %ebp, %ebp
setne %r12b
movq 0x18408(%rip), %rdi     # 0x1b4c0
movq %r14, %rsi
callq 0x303c
shll $0x3, %r12d
movq (%rax,%r12), %rdi
testq %rdi, %rdi
je 0x3111
movq %rax, %r15
xorl %ebx, %ebx
testl %ebp, %ebp
setne %bl
callq 0x2720
andq $0x0, (%r15,%r12)
movq 0x183d8(%rip), %rdi     # 0x1b4c0
movq %r14, %rsi
callq 0x303c
movq 0x10(%rax), %rdi
leal (%rbx,%rbx,2), %esi
incl %esi
callq 0x3127
xorl %ebx, %ebx
cmpq $0x0, 0x183c0(%rip)     # 0x1b4c8
jne 0x311c
callq 0x3404
jmp 0x311c
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_O2/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 0x183a0(%rip), %rax     # 0x1b4d0
andw %si, 0x6(%rax,%rdi,8)
andw %si, 0x4(%rax,%rdi,8)
je 0x313d
retq
pushq %rbx
movq %rdi, %rbx
movq 0x18378(%rip), %rdi     # 0x1b4c0
movslq (%rax,%rbx,8), %rsi
callq 0x303c
orq $-0x1, 0x10(%rax)
movq 0x1836b(%rip), %rcx     # 0x1b4c8
leaq -0x1(%rcx), %rax
cmpq %rbx, %rax
je 0x3193
movq 0x18363(%rip), %rax     # 0x1b4d0
movq -0x8(%rax,%rcx,8), %rcx
movq %rcx, (%rax,%rbx,8)
movq 0x18343(%rip), %rdi     # 0x1b4c0
movslq %ecx, %rsi
callq 0x303c
movq %rbx, 0x10(%rax)
movq 0x18338(%rip), %rax     # 0x1b4c8
decq %rax
movq %rax, 0x1832e(%rip)     # 0x1b4c8
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2fd8
testl %eax, %eax
je 0x31b9
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
testq %r15, %r15
je 0x31f0
movq (%r15), %rax
movl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
cmpq $0x20c49a, %rax         # imm = 0x20C49A
jg 0x31f4
imull $0x3e8, %eax, %ecx      # imm = 0x3E8
movl $0x3e7, %eax            # imm = 0x3E7
addq 0x8(%r15), %rax
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
movq %rax, %r14
addl %ecx, %r14d
jmp 0x31f4
pushq $-0x1
popq %r14
callq 0x340c
movq 0x182d0(%rip), %rdi     # 0x1b4d0
movq 0x182c1(%rip), %rsi     # 0x1b4c8
movl %r14d, %edx
callq 0x2280
cmpl $-0x1, %eax
jne 0x3228
callq 0x2090
movq %rax, %r15
movl (%rax), %eax
cmpl $0x4, %eax
jne 0x3243
cmpl $0x0, (%rbx)
je 0x31f9
cmpq $0x0, 0x18298(%rip)     # 0x1b4c8
je 0x326a
callq 0x33dc
movq 0x1828a(%rip), %rax     # 0x1b4c8
decq %rax
jmp 0x326d
leaq 0x3fa9(%rip), %rdi      # 0x71f3
testl %eax, %eax
jne 0x325a
xorl %eax, %eax
callq 0x4aa8
jmp 0x31b0
xorl %eax, %eax
callq 0x4919
andl $0x0, (%r15)
jmp 0x31b0
pushq $-0x1
popq %rax
movq %rax, 0x18264(%rip)     # 0x1b4d8
xorl %eax, %eax
jmp 0x31b3
// File: /workspace/github_c_makefile_star2_O2/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 0x18245(%rip), %rdx     # 0x1b4c8
movq 0x1824e(%rip), %rax     # 0x1b4d8
movq 0x1823f(%rip), %rcx     # 0x1b4d0
xorl %ebx, %ebx
cmpq %rdx, %rax
jae 0x335c
movzwl 0x6(%rcx,%rax,8), %esi
testb $0x20, %sil
jne 0x3375
testb $0x18, %sil
je 0x32c0
andl $-0x39, %esi
movzwl 0x4(%rcx,%rax,8), %edi
orl %edi, %esi
movw %si, 0x6(%rcx,%rax,8)
testb $0x1, %sil
jne 0x32d8
testb $0x4, %sil
jne 0x330f
decq %rax
movq %rax, 0x18202(%rip)     # 0x1b4d8
jmp 0x3293
movq 0x181e1(%rip), %rdi     # 0x1b4c0
movslq (%rcx,%rax,8), %rsi
callq 0x303c
movq (%rax), %rbx
movq 0x181ce(%rip), %rdi     # 0x1b4c0
movq 0x181d7(%rip), %rax     # 0x1b4d0
movq 0x181d8(%rip), %rcx     # 0x1b4d8
movslq (%rax,%rcx,8), %rsi
callq 0x303c
movw $0x1, %cx
jmp 0x3349
movq 0x181aa(%rip), %rdi     # 0x1b4c0
movslq (%rcx,%rax,8), %rsi
callq 0x303c
movq 0x8(%rax), %rbx
movq 0x18196(%rip), %rdi     # 0x1b4c0
movq 0x1819f(%rip), %rax     # 0x1b4d0
movq 0x181a0(%rip), %rcx     # 0x1b4d8
movslq (%rax,%rcx,8), %rsi
callq 0x303c
addq $0x8, %rax
movw $0x4, %cx
andq $0x0, (%rax)
movq 0x18184(%rip), %rdi     # 0x1b4d8
movzwl %cx, %esi
callq 0x3127
testq %rbx, %rbx
je 0x3370
cmpq $0x0, 0x1815f(%rip)     # 0x1b4c8
jne 0x3370
callq 0x3404
movq %rbx, %rax
popq %rbx
retq
leaq 0x3e7e(%rip), %rdi      # 0x71fa
leaq 0x3ea0(%rip), %rsi      # 0x7223
leaq 0x3ec0(%rip), %rcx      # 0x724a
movl $0x1b0, %edx            # imm = 0x1B0
callq 0x2160
// File: /workspace/github_c_makefile_star2_O2/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, 0x180d5(%rip)     # 0x1b4e8
jne 0x34d2
subq $0x18, %rsp
leaq 0x8(%rsp), %rdi
callq 0x3828
testl %eax, %eax
jne 0x34c7
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
subq 0x180b0(%rip), %rax     # 0x1b4f0
cvtsi2sd %rax, %xmm1
subq 0x180ac(%rip), %rcx     # 0x1b4f8
cvtsi2sd %rcx, %xmm0
mulsd 0x3e7f(%rip), %xmm0     # 0x72d8
addsd %xmm1, %xmm0
movsd 0x1809b(%rip), %xmm1    # 0x1b500
addsd 0x3b9b(%rip), %xmm1     # 0x7008
movsd %xmm1, 0x1808b(%rip)    # 0x1b500
movsd 0x1808b(%rip), %xmm2    # 0x1b508
movapd %xmm0, %xmm3
subsd %xmm2, %xmm3
movapd %xmm3, %xmm4
divsd %xmm1, %xmm4
addsd %xmm2, %xmm4
movsd %xmm4, 0x1806f(%rip)    # 0x1b508
movapd %xmm0, %xmm1
subsd %xmm4, %xmm1
mulsd %xmm3, %xmm1
addsd 0x18063(%rip), %xmm1    # 0x1b510
movsd %xmm1, 0x1805b(%rip)    # 0x1b510
ucomisd 0x1805b(%rip), %xmm0    # 0x1b518
jbe 0x34c7
movsd %xmm0, 0x18051(%rip)    # 0x1b518
movb $0x0, 0x1801a(%rip)     # 0x1b4e8
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x18025(%rip), %xmm0    # 0x1b500
movsd %xmm0, (%rdi)
movsd 0x18021(%rip), %xmm1    # 0x1b508
movsd %xmm1, (%rsi)
movsd 0x1801d(%rip), %xmm1    # 0x1b510
movsd 0x3de5(%rip), %xmm2     # 0x72e0
addsd %xmm0, %xmm2
divsd %xmm2, %xmm1
movsd 0x3afd(%rip), %xmm2     # 0x7008
cmpltsd %xmm0, %xmm2
andpd %xmm1, %xmm2
movlpd %xmm2, (%rdx)
movsd 0x17ff8(%rip), %xmm0    # 0x1b518
movsd %xmm0, (%rcx)
andq $0x0, 0x17fec(%rip)     # 0x1b518
andq $0x0, 0x17fdc(%rip)     # 0x1b510
andq $0x0, 0x17fcc(%rip)     # 0x1b508
andq $0x0, 0x17fbc(%rip)     # 0x1b500
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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, 0x17fbe(%rip)     # 0x1b520
je 0x35b7
movq %r14, %rdi
movq %rbx, %rsi
callq 0x26a8
testq %rax, %rax
je 0x35d8
movq %rax, %r14
pushq $0x20
popq %rdi
callq 0x2220
testq %rax, %rax
je 0x35ad
movq %rax, %rbx
movq %r14, (%rax)
movq %rax, %rsi
addq $0x10, %rsi
movups (%r15), %xmm0
movups %xmm0, 0x10(%rax)
movq %rsp, %rdi
callq 0x3634
testl %eax, %eax
je 0x35e7
movq %rbx, %rdi
callq 0x2040
movq %r14, %rdi
callq 0x2720
jmp 0x35d8
callq 0x57c4
movq %rax, 0x17f5d(%rip)     # 0x1b520
testq %rax, %rax
je 0x35d8
leaq 0x35(%rip), %rdi        # 0x3604
callq 0x6370
testl %eax, %eax
je 0x3564
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x17f32(%rip), %rdi     # 0x1b520
movq %rsp, %rsi
movq %rbx, %rdx
callq 0x5812
movq %rax, 0x8(%rbx)
testq %rax, %rax
jne 0x35da
jmp 0x35a5
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_timer.c
// Function: gettimeout
static int
gettimeout(struct timeval * tv, const struct timeval * tdelta)
{

	if (monoclock_get(tv))
		goto err0;
	tv->tv_sec += tdelta->tv_sec;
	if ((tv->tv_usec += tdelta->tv_usec) >= 1000000) {
		tv->tv_usec -= 1000000;
		tv->tv_sec += 1;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x3828
testl %eax, %eax
je 0x364c
pushq $-0x1
popq %rax
jmp 0x367e
movdqu (%r14), %xmm1
movdqu (%rbx), %xmm0
paddq %xmm1, %xmm0
movdqu %xmm0, (%rbx)
pshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
movq %xmm1, %rcx
xorl %eax, %eax
cmpq $0xf4240, %rcx          # imm = 0xF4240
jl 0x367e
paddq 0x3c76(%rip), %xmm0     # 0x72f0
movdqu %xmm0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_timer.c
// Function: events_timer_register_double
void *
events_timer_register_double(int (* func)(void *), void * cookie,
    double timeo)
{
	struct timeval tv;

	/* Convert timeo to a struct timeval. */
	tv.tv_sec = (time_t)timeo;
	tv.tv_usec = (suseconds_t)((timeo - (double)tv.tv_sec) * 1000000.0);

	/* Schedule the timeout. */
	return (events_timer_register(func, cookie, &tv));
}

// Assembly:
subq $0x18, %rsp
cvttsd2si %xmm0, %rax
cvtsi2sd %rax, %xmm1
leaq 0x8(%rsp), %rdx
subsd %xmm1, %xmm0
mulsd 0x3c5b(%rip), %xmm0     # 0x7300
movq %rax, (%rdx)
cvttsd2si %xmm0, %rax
movq %rax, 0x8(%rdx)
callq 0x3548
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_timer.c
// Function: events_timer_min
int
events_timer_min(struct timeval ** timeo)
{
	struct timeval tnow;
	const struct timeval * tv;

	/* If we have no queue, we have no timers; return NULL. */
	if (Q == NULL) {
		*timeo = NULL;
		goto done;
	}

	/* Get the minimum timer from the queue. */
	tv = timerqueue_getmin(Q);

	/* If there are no timers, return NULL. */
	if (tv == NULL) {
		*timeo = NULL;
		goto done;
	}

	/* Allocate space for holding the returned timeval. */
	if ((*timeo = malloc(sizeof(struct timeval))) == NULL)
		goto err0;

	/* Get the current time... */
	if (monoclock_get(&tnow))
		goto err1;

	/* ... and compare it to the minimum timer. */
	if ((tnow.tv_sec > tv->tv_sec) ||
	    ((tnow.tv_sec == tv->tv_sec) && (tnow.tv_usec > tv->tv_usec))) {
		/* The timer has already expired, so return zero. */
		(*timeo)->tv_sec = 0;
		(*timeo)->tv_usec = 0;
	} else {
		/* Compute the difference. */
		(*timeo)->tv_sec = tv->tv_sec - tnow.tv_sec;
		(*timeo)->tv_usec = tv->tv_usec - tnow.tv_usec;
		if (tv->tv_usec < tnow.tv_usec) {
			(*timeo)->tv_usec += 1000000;
			(*timeo)->tv_sec -= 1;
		}
	}

done:
	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x17df6(%rip), %rdi     # 0x1b520
testq %rdi, %rdi
je 0x3765
callq 0x5892
testq %rax, %rax
je 0x3765
movq %rax, %r14
pushq $0x10
popq %rdi
callq 0x2220
movq %rax, (%rbx)
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0x376b
movq %rsp, %rdi
callq 0x3828
testl %eax, %eax
je 0x3776
movq (%rbx), %rdi
callq 0x2040
jmp 0x376b
andq $0x0, (%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq (%r14), %rax
subq (%rsp), %rax
jge 0x378a
movq (%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
jmp 0x3769
jne 0x379c
movq 0x8(%rsp), %rdx
movq 0x8(%r14), %rcx
cmpq %rcx, %rdx
jg 0x377f
jmp 0x37a5
movq 0x8(%r14), %rcx
movq 0x8(%rsp), %rdx
subq %rdx, %rcx
movq (%rbx), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rdx)
movq 0x8(%r14), %rsi
xorl %ebp, %ebp
cmpq 0x8(%rsp), %rsi
jge 0x376b
addq $0xf4240, %rcx          # imm = 0xF4240
movq %rcx, 0x8(%rdx)
decq %rax
movq %rax, (%rdx)
jmp 0x376b