LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/kasymovga[P]devilwm/ewmh.c
// Function: ewmh_set_net_client_list_stacking
void ewmh_set_net_client_list_stacking(ScreenInfo *s) {
	struct list *iter;
	for (iter = clients_stacking_order; iter; iter = iter->next) {
		Client *c = iter->data;
		if (c->screen == s) {
			XChangeProperty(dpy, s->root, xa_net_client_list_stacking,
					XA_WINDOW, 32, PropModeReplace,
					(unsigned char *)&c->window, 1);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x7cb4(%rip), %r15      # 0xd7f0
leaq 0x7ce5(%rip), %r12      # 0xd828
pushq $0x21
popq %r14
pushq $0x20
popq %rbp
movq (%r15), %r15
testq %r15, %r15
je 0x5b80
movq 0x8(%r15), %rax
cmpq %rbx, 0x10(%rax)
jne 0x5b4a
movq (%r12), %rdi
movq 0x8(%rbx), %rsi
movq 0x7b55(%rip), %rdx      # 0xd6c0
movq %r14, %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
pushq $0x1
pushq %rax
callq 0x3660
popq %rcx
popq %rdx
jmp 0x5b4a
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/kasymovga[P]devilwm/screen.c
// Function: find_monitors
void find_monitors(Client *c) {
#ifdef RANDR
	if (have_randr) {
		XRRMonitorInfo *xmonitors = XRRGetMonitors(dpy, c->screen->root, 0, &monitors_count);
		monitors_realloc();
		for (int i = 0; i < monitors_count; i++) {
			monitors[i].x = xmonitors[i].x;
			monitors[i].y = xmonitors[i].y;
			monitors[i].width = xmonitors[i].width;
			monitors[i].height = xmonitors[i].height;
		}
		if (monitors_count) {
			XRRFreeMonitors(xmonitors);
			return;
		}
	}
#endif
	monitors_count = 1;
	monitors_realloc();
	monitors[0].x = 0;
	monitors[0].y = 0;
	monitors[0].width = DisplayWidth(dpy, c->screen->screen);
	monitors[0].height = DisplayHeight(dpy, c->screen->screen);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x6565(%rip), %rax      # 0xd860
cmpl $0x0, (%rax)
je 0x7369
leaq 0x6521(%rip), %rax      # 0xd828
movq (%rax), %rdi
movq 0x10(%rbx), %rax
movq 0x8(%rax), %rsi
leaq 0x6567(%rip), %rcx      # 0xd880
xorl %r15d, %r15d
xorl %edx, %edx
callq 0x3170
movq %rax, %r14
callq 0x73ae
movq 0x6546(%rip), %rcx      # 0xd878
movslq 0x6547(%rip), %rax      # 0xd880
movq %r14, %rdx
addq $0x14, %rdx
cmpq %rax, %r15
jge 0x7358
movups (%rdx), %xmm0
movups %xmm0, (%rcx)
incq %r15
addq $0x38, %rdx
addq $0x10, %rcx
jmp 0x7340
testl %eax, %eax
je 0x7369
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x32e0
movl $0x1, 0x650d(%rip)      # 0xd880
callq 0x73ae
movq 0x64f9(%rip), %rax      # 0xd878
andq $0x0, (%rax)
leaq 0x649e(%rip), %rcx      # 0xd828
movq (%rcx), %rcx
movq 0xe8(%rcx), %rcx
movq 0x10(%rbx), %rdx
movslq (%rdx), %rdx
shlq $0x7, %rdx
movq 0x18(%rcx,%rdx), %rcx
movq %rcx, 0x8(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/kasymovga[P]devilwm/screen.c
// Function: monitors_realloc
static void monitors_realloc(void) {
	static Monitor monitor_static;
	if (!monitors_count)
		return;

	if (monitors_size < monitors_count) {
		if (monitors != &monitor_static) {
			free(monitors);
		}
		monitors = malloc(sizeof(struct Monitor) * monitors_count);
		if (monitors)
			monitors_size = monitors_count;
		else {
			monitors_size = 0;
		}
	}
	if (monitors) {
		return;
	}
	//Canot allocate memory
	LOG_ERROR("out of memory\n");
	monitors_count = 1;
	monitors = &monitor_static;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl 0x64c9(%rip), %ebp      # 0xd880
testl %ebp, %ebp
je 0x7406
movq 0x64b6(%rip), %rdi      # 0xd878
leaq 0x64bf(%rip), %rbx      # 0xd888
cmpl %ebp, 0x64b5(%rip)      # 0xd884
jge 0x7401
cmpq %rbx, %rdi
je 0x73e1
callq 0x32b0
movl 0x649f(%rip), %ebp      # 0xd880
movslq %ebp, %rdi
shlq $0x4, %rdi
callq 0x31c0
movq %rax, 0x6484(%rip)      # 0xd878
testq %rax, %rax
je 0x740d
movl %ebp, 0x6485(%rip)      # 0xd884
jmp 0x7406
testq %rdi, %rdi
je 0x7414
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
andl $0x0, 0x6470(%rip)      # 0xd884
movq 0x5bd5(%rip), %rax      # 0xcff0
movq (%rax), %rcx
leaq 0x254b(%rip), %rdi      # 0x9970
pushq $0xe
popq %rsi
pushq $0x1
popq %rdx
callq 0x36e0
movl $0x1, 0x6446(%rip)      # 0xd880
movq %rbx, 0x6437(%rip)      # 0xd878
jmp 0x7406
// File: /workspace/github_c_makefile_star2_O2/kasymovga[P]devilwm/screen.c
// Function: find_monitor
Monitor *find_monitor(Client *c) {
	find_monitors(c);
	for (int i = 0; i < monitors_count; i++) {
		if (monitors[i].x + monitors[i].width < c->x
				|| monitors[i].x >= c->x + c->width
				|| monitors[i].y >= c->y + c->height
				|| monitors[i].y + monitors[i].width < c->y)
			continue;

		return &monitors[i];
	}
	return &monitors[0];
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x72ec
movslq 0x642d(%rip), %rcx      # 0xd880
movq 0x641e(%rip), %rax      # 0xd878
xorl %edx, %edx
testl %ecx, %ecx
movl $0x0, %edi
cmovgl %ecx, %edi
movq %rax, %rsi
cmpq %rdx, %rdi
je 0x74bd
movl (%rsi), %r9d
movl 0x8(%rsi), %r8d
leal (%r8,%r9), %r11d
movl 0x24(%rbx), %r10d
cmpl %r10d, %r11d
jl 0x74b4
addl 0x2c(%rbx), %r10d
cmpl %r10d, %r9d
jge 0x74b4
movl 0x4(%rsi), %r9d
movl 0x28(%rbx), %r10d
movl 0x30(%rbx), %r11d
addl %r10d, %r11d
cmpl %r11d, %r9d
setge %r11b
addl %r9d, %r8d
cmpl %r10d, %r8d
setl %r8b
orb %r11b, %r8b
cmpb $0x1, %r8b
jne 0x74bd
incq %rdx
addq $0x10, %rsi
jmp 0x7469
cmpq %rcx, %rdx
cmovlq %rsi, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/kasymovga[P]devilwm/screen.c
// Function: next
void next(void) {
	struct list *newl = list_find(clients_tab_order, current);
	ScreenInfo *current_screen = find_current_screen();
	Client *newc = current;
	if (newl)
		newc = next_find(newl->next, NULL, current_screen);

	if (!newc)
		newc = next_find(clients_tab_order, newl, current_screen);

	select_client(newc);
	if (!newc)
		return;

	client_show(newc);
	//client_raise(newc);
#ifdef WARP_POINTER
	setmouse(newc->window, newc->width + newc->border - 1,
			newc->height + newc->border - 1);
#endif
	discard_enter_events(newc);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x5196(%rip), %r12      # 0xd7e0
movq (%r12), %rdi
leaq 0x51a3(%rip), %r15      # 0xd7f8
movq (%r15), %rsi
callq 0x5ebe
movq %rax, %rbx
callq 0x86cd
movq %rax, %r14
testq %rbx, %rbx
je 0x867f
movq (%rbx), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x8724
movq %rax, %r15
jmp 0x8682
movq (%r15), %r15
testq %r15, %r15
jne 0x8699
movq (%r12), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x8724
movq %rax, %r15
movq %r15, %rdi
callq 0x3ad3
testq %r15, %r15
je 0x86c1
movq %r15, %rdi
callq 0x3948
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x692a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/kasymovga[P]devilwm/screen.c
// Function: next_find
static Client *next_find(struct list *start, struct list *end, ScreenInfo *screen) {
	struct Client *c;
	for (struct list *l = start; l; l = l->next) {
		c = l->data;
		if (c->screen == screen && ((!c->is_dock || c->screen->docks_visible)
#ifdef VWM
				&& (is_fixed(c) || c->vdesk == c->screen->vdesk)
#endif
		))
			return c;

		if (l == end)
			return NULL;
	}
	return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x875c
movq 0x8(%rdi), %rax
movq 0x10(%rax), %rcx
cmpq %rdx, %rcx
jne 0x8752
cmpl $0x0, 0x7c(%rax)
je 0x8742
cmpl $0x0, 0x68(%rcx)
je 0x8752
movl 0x78(%rax), %r8d
cmpl $-0x1, %r8d
je 0x875e
cmpl 0x40(%rcx), %r8d
je 0x875e
cmpq %rsi, %rdi
je 0x875c
movq (%rdi), %rdi
jmp 0x8724
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]hash-prospector/prospector.c
// Function: usage
static void
usage(FILE *f)
{
    fprintf(f, "usage: prospector "
            "[-E|L|S] [-4|-8] [-ehs] [-l lib] [-p pattern] [-r n:m] [-t x]\n");
    fprintf(f, " -4          Generate 32-bit hash functions (default)\n");
    fprintf(f, " -8          Generate 64-bit hash functions\n");
    fprintf(f, " -e          Measure bias exactly (requires -E)\n");
    fprintf(f, " -h          Print this help message\n");
    fprintf(f, " -l ./lib.so Load hash() from a shared object\n");
    fprintf(f, " -p pattern  Search only a given pattern\n");
    fprintf(f, " -q n        Score quality knob (12-30, default: 18)\n");
    fprintf(f, " -r n:m      Use between n and m operations [3:6]\n");
    fprintf(f, " -s          Don't use large constants\n");
    fprintf(f, " -t x        Initial score threshold [10.0]\n");
    fprintf(f, " -E          Single evaluation mode (requires -p or -l)\n");
    fprintf(f, " -S          Hash function search mode (default)\n");
    fprintf(f, " -L          Enumerate output mode (requires -p or -l)\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x1537(%rip), %rdi      # 0x33aa
pushq $0x50
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x156f(%rip), %rdi      # 0x33fb
pushq $0x36
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x1591(%rip), %rdi      # 0x3432
pushq $0x2c
popq %r15
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x15a5(%rip), %rdi      # 0x345f
pushq $0x30
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x15c1(%rip), %rdi      # 0x3490
pushq $0x25
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x15d2(%rip), %rdi      # 0x34b6
pushq $0x2e
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x15ec(%rip), %rdi      # 0x34e5
pushq $0x29
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x1601(%rip), %rdi      # 0x350f
pushq $0x35
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x1622(%rip), %rdi      # 0x3545
pushq $0x32
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x1640(%rip), %rdi      # 0x3578
pushq $0x27
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x1653(%rip), %rdi      # 0x35a0
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x166b(%rip), %rdi      # 0x35cd
pushq $0x38
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x168f(%rip), %rdi      # 0x3606
pushq $0x31
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x11c0
leaq 0x16ac(%rip), %rdi      # 0x3638
pushq $0x37
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
popq %rbx
popq %r14
popq %r15
jmp 0x11c0
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]hash-prospector/prospector.c
// Function: execbuf_lock
static void
execbuf_lock(void *buf)
{
    switch (wxr_enabled) {
        case WXR_UNKNOWN:
            if (!mprotect(buf, 4096, PROT_READ | PROT_WRITE | PROT_EXEC)) {
                wxr_enabled = WXR_DISABLED;
                return;
            }
            wxr_enabled = WXR_ENABLED;
            /* FALLTHROUGH */
        case WXR_ENABLED:
            if (mprotect(buf, 4096, PROT_READ | PROT_EXEC)) {
                fprintf(stderr,
                        "prospector: mprotect(PROT_EXEC) failed: %s\n",
                        strerror(errno));
                exit(EXIT_FAILURE);
            }
            break;
        case WXR_DISABLED:
            break;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x2e1f(%rip), %eax      # 0x5110
cmpl $0x1, %eax
je 0x2318
testl %eax, %eax
jne 0x232c
pushq $0x7
popq %rdx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
callq 0x1140
testl %eax, %eax
je 0x232e
movl $0x1, 0x2df8(%rip)      # 0x5110
pushq $0x5
popq %rdx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
callq 0x1140
testl %eax, %eax
jne 0x233a
popq %rbx
retq
movl $0x2, 0x2dd8(%rip)      # 0x5110
jmp 0x232c
movq 0x2cb7(%rip), %rax      # 0x4ff8
movq (%rax), %rbx
callq 0x1040
movl (%rax), %edi
callq 0x11e0
leaq 0x131b(%rip), %rsi      # 0x3672
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1110
pushq $0x1
popq %rdi
callq 0x11b0
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]hash-prospector/prospector.c
// Function: load_function
static void *
load_function(const char *so)
{
    void *handle = dlopen(so, RTLD_NOW);
    if (!handle) {
        fprintf(stderr, "prospector: could not load %s\n", so);
        exit(EXIT_FAILURE);
    }
    void *f = dlsym(handle, "hash");
    if (!f) {
        fprintf(stderr, "prospector: could not find 'hash' in %s\n", so);
        exit(EXIT_FAILURE);
    }
    return f;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x2
popq %rsi
callq 0x1100
testq %rax, %rax
je 0x2393
leaq 0x1339(%rip), %rsi      # 0x36bd
movq %rax, %rdi
callq 0x1180
testq %rax, %rax
je 0x23a6
popq %rbx
retq
movq 0x2c5e(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x12fa(%rip), %rsi      # 0x369e
jmp 0x23b7
movq 0x2c4b(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x130b(%rip), %rsi      # 0x36c2
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1110
pushq $0x1
popq %rdi
callq 0x11b0
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]hash-prospector/prospector.c
// Function: estimate_bias64
static double
estimate_bias64(uint64_t ABI (*f)(uint64_t), uint64_t rng[2])
{
    long n = 1L << score_quality;
    long bins[64][64] = {{0}};
    for (long i = 0; i < n; i++) {
        uint64_t x = xoroshiro128plus(rng);
        uint64_t h0 = f(x);
        for (int j = 0; j < 64; j++) {
            uint64_t bit = UINT64_C(1) << j;
            uint64_t h1 = f(x ^ bit);
            uint64_t set = h0 ^ h1;
            for (int k = 0; k < 64; k++)
                bins[j][k] += (set >> k) & 1;
        }
    }
    double mean = 0;
    for (int j = 0; j < 64; j++) {
        for (int k = 0; k < 64; k++) {
            /* FIXME: normalize this somehow */
            double diff = (bins[j][k] - n / 2) / (n / 2.0);
            mean += (diff * diff) / (64 * 64);
        }
    }
    return sqrt(mean) * 1000.0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x8028, %rsp           # imm = 0x8028
movq %rsi, 0x10(%rsp)
movq %rdi, %r15
movb 0x2cfd(%rip), %cl       # 0x5108
pushq $0x1
popq %r14
shlq %cl, %r14
leaq 0x20(%rsp), %rdi
xorl %ebx, %ebx
movl $0x8000, %edx           # imm = 0x8000
xorl %esi, %esi
callq 0x10c0
testq %r14, %r14
movl $0x0, %eax
movq %r14, 0x8(%rsp)
cmovgq %r14, %rax
movq %rax, 0x18(%rsp)
cmpq 0x18(%rsp), %rbx
je 0x249a
movq 0x10(%rsp), %rdi
callq 0x2679
movq %rax, %r13
movq %rax, %rdi
callq *%r15
movq %rax, %rbp
leaq 0x20(%rsp), %r14
xorl %r12d, %r12d
cmpq $0x40, %r12
je 0x2495
movq %r13, %rdi
btcq %r12, %rdi
callq *%r15
xorq %rbp, %rax
xorl %ecx, %ecx
cmpq $0x40, %rcx
je 0x2489
btq %rcx, %rax
adcq $0x0, (%r14,%rcx,8)
incq %rcx
jmp 0x2475
incq %r12
addq $0x200, %r14            # imm = 0x200
jmp 0x2460
incq %rbx
jmp 0x243b
pushq $-0x2
popq %rcx
movq 0x8(%rsp), %rsi
movq %rsi, %rax
cqto
cvtsi2sd %rsi, %xmm1
idivq %rcx
mulsd 0xb71(%rip), %xmm1      # 0x3028
xorpd %xmm0, %xmm0
leaq 0x20(%rsp), %rcx
xorl %edx, %edx
movsd 0xb66(%rip), %xmm2      # 0x3030
cmpq $0x40, %rdx
je 0x2505
xorl %esi, %esi
cmpq $0x40, %rsi
je 0x24f9
movq (%rcx,%rsi,8), %rdi
addq %rax, %rdi
cvtsi2sd %rdi, %xmm3
divsd %xmm1, %xmm3
mulsd %xmm3, %xmm3
mulsd %xmm2, %xmm3
addsd %xmm3, %xmm0
incq %rsi
jmp 0x24d2
incq %rdx
addq $0x200, %rcx            # imm = 0x200
jmp 0x24ca
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x2515
sqrtsd %xmm0, %xmm0
jmp 0x251a
callq 0x11d0
mulsd 0xafe(%rip), %xmm0      # 0x3020
addq $0x8028, %rsp           # imm = 0x8028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]hash-prospector/prospector.c
// Function: estimate_bias32
static double
estimate_bias32(uint32_t ABI (*f)(uint32_t), uint64_t rng[2])
{
    long n = 1L << score_quality;
    long bins[32][32] = {{0}};
    for (long i = 0; i < n; i++) {
        uint32_t x = xoroshiro128plus(rng);
        uint32_t h0 = f(x);
        for (int j = 0; j < 32; j++) {
            uint32_t bit = UINT32_C(1) << j;
            uint32_t h1 = f(x ^ bit);
            uint32_t set = h0 ^ h1;
            for (int k = 0; k < 32; k++)
                bins[j][k] += (set >> k) & 1;
        }
    }
    double mean = 0;
    for (int j = 0; j < 32; j++) {
        for (int k = 0; k < 32; k++) {
            /* FIXME: normalize this somehow */
            double diff = (bins[j][k] - n / 2) / (n / 2.0);
            mean += (diff * diff) / (32 * 32);
        }
    }
    return sqrt(mean) * 1000.0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2028, %rsp           # imm = 0x2028
movq %rsi, 0x10(%rsp)
movq %rdi, %r15
movb 0x2bb5(%rip), %cl       # 0x5108
pushq $0x1
popq %r14
shlq %cl, %r14
leaq 0x20(%rsp), %rdi
xorl %ebx, %ebx
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0x10c0
testq %r14, %r14
movl $0x0, %eax
movq %r14, 0x8(%rsp)
cmovgq %r14, %rax
movq %rax, 0x18(%rsp)
cmpq 0x18(%rsp), %rbx
je 0x25df
movq 0x10(%rsp), %rdi
callq 0x2679
movq %rax, %r13
movl %r13d, %edi
callq *%r15
movl %eax, %ebp
leaq 0x20(%rsp), %r14
xorl %r12d, %r12d
cmpq $0x20, %r12
je 0x25da
movl %r13d, %edi
btcl %r12d, %edi
callq *%r15
xorl %ebp, %eax
xorl %ecx, %ecx
cmpq $0x20, %rcx
je 0x25ce
btl %ecx, %eax
adcq $0x0, (%r14,%rcx,8)
incq %rcx
jmp 0x25bb
incq %r12
addq $0x100, %r14            # imm = 0x100
jmp 0x25a7
incq %rbx
jmp 0x2583
pushq $-0x2
popq %rcx
movq 0x8(%rsp), %rsi
movq %rsi, %rax
cqto
cvtsi2sd %rsi, %xmm1
idivq %rcx
mulsd 0xa2c(%rip), %xmm1      # 0x3028
xorpd %xmm0, %xmm0
leaq 0x20(%rsp), %rcx
xorl %edx, %edx
movsd 0xa09(%rip), %xmm2      # 0x3018
cmpq $0x20, %rdx
je 0x264a
xorl %esi, %esi
cmpq $0x20, %rsi
je 0x263e
movq (%rcx,%rsi,8), %rdi
addq %rax, %rdi
cvtsi2sd %rdi, %xmm3
divsd %xmm1, %xmm3
mulsd %xmm3, %xmm3
mulsd %xmm2, %xmm3
addsd %xmm3, %xmm0
incq %rsi
jmp 0x2617
incq %rdx
addq $0x100, %rcx            # imm = 0x100
jmp 0x260f
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x265a
sqrtsd %xmm0, %xmm0
jmp 0x265f
callq 0x11d0
mulsd 0x9b9(%rip), %xmm0      # 0x3020
addq $0x2028, %rsp           # imm = 0x2028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]hash-prospector/prospector.c
// Function: xoroshiro128plus
static uint64_t
xoroshiro128plus(uint64_t s[2])
{
    uint64_t s0 = s[0];
    uint64_t s1 = s[1];
    uint64_t result = s0 + s1;
    s1 ^= s0;
    s[0] = ((s0 << 24) | (s0 >> 40)) ^ s1 ^ (s1 << 16);
    s[1] = (s1 << 37) | (s1 >> 27);
    return result;
}

// Assembly:
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
leaq (%rdx,%rcx), %rax
xorq %rcx, %rdx
rolq $0x18, %rcx
movq %rdx, %rsi
shlq $0x10, %rsi
xorq %rcx, %rsi
xorq %rdx, %rsi
movq %rsi, (%rdi)
rolq $0x25, %rdx
movq %rdx, 0x8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]hash-prospector/prospector.c
// Function: hf_gen
static void
hf_gen(struct hf_op *op, uint64_t s[2], int flags)
{
    uint64_t r = xoroshiro128plus(s);
    int min = flags & F_TINY ? 3 : 0;
    op->type = (r % (9 - min)) + min + (flags & F_U64 ? 9 : 0);
    hf_randomize(op, s);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2679
movl %ebp, %ecx
andl $0x2, %ecx
movl %ecx, %esi
shrl %esi
xorl %edx, %edx
testl %ecx, %ecx
sete %dl
leal (%rdx,%rdx,2), %ecx
addl $0x6, %ecx
xorl %edx, %edx
divq %rcx
leal (%rsi,%rsi,2), %eax
andl $0x1, %ebp
negl %ebp
andl $0x9, %ebp
addl %eax, %ebp
addl %ebp, %edx
movl %edx, (%r14)
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x26a4
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./imgp.h
// Function: imgp_gray
void imgp_gray(uint8_t *s, int sx, int sy, int stride, uint8_t *p, int gstride)
{
	for (int y=0; y<sy; y++) {
		for (int x=0; x<sx; x++) {
			p[x] = 0.3 * s[x*3+0] + 0.59 * s[x*3+1] + 0.11*s[x*3+2];
		}

		s += stride*3;
		p += gstride;
	}
}

// Assembly:
pushq %rbx
leal (%rcx,%rcx,2), %eax
cltq
xorl %ecx, %ecx
testl %esi, %esi
cmovlel %ecx, %esi
movslq %r9d, %r9
testl %edx, %edx
cmovlel %ecx, %edx
addq $0x2, %rdi
movsd 0x14ebd(%rip), %xmm0    # 0x1ba60
movsd 0x14ebd(%rip), %xmm1    # 0x1ba68
movsd 0x14ebd(%rip), %xmm2    # 0x1ba70
cmpl %edx, %ecx
je 0x6c0b
movq %rdi, %r10
xorl %r11d, %r11d
cmpq %r11, %rsi
je 0x6c01
movzbl -0x2(%r10), %ebx
cvtsi2sd %ebx, %xmm3
movzbl -0x1(%r10), %ebx
cvtsi2sd %ebx, %xmm4
mulsd %xmm0, %xmm4
mulsd %xmm1, %xmm3
addsd %xmm4, %xmm3
movzbl (%r10), %ebx
cvtsi2sd %ebx, %xmm4
mulsd %xmm2, %xmm4
addsd %xmm3, %xmm4
cvttsd2si %xmm4, %ebx
movb %bl, (%r8,%r11)
incq %r11
addq $0x3, %r10
jmp 0x6bbd
addq %r9, %r8
incl %ecx
addq %rax, %rdi
jmp 0x6bb3
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./imgp.h
// Function: imgp_dilate
void imgp_dilate(uint8_t *s, int w, int h, int bpp, uint8_t *p)
{
	for (int y=1; y<h-1; y++) {
		for (int x=1; x<w-1; x++) {
			for (int b=0; b<bpp; b++) {
				uint8_t uc = s[ ((y+0)*w + (x+0))*bpp+b ]; // centre
				uint8_t ua = s[ ((y-1)*w + (x+0))*bpp+b ]; // above
				uint8_t ub = s[ ((y+1)*w + (x+0))*bpp+b ]; // below
				uint8_t ul = s[ ((y+0)*w + (x-1))*bpp+b ]; // left
				uint8_t ur = s[ ((y+0)*w + (x+1))*bpp+b ]; // right

				uint8_t ux = 0;
				if (uc > ux) ux = uc;
				if (ua > ux) ux = ua;
				if (ub > ux) ux = ub;
				if (ul > ux) ux = ul;
				if (ur > ux) ux = ur;
				p[ (y*w + x)*bpp+b ] = ux;
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %r13
decl %edx
leal -0x1(%rsi), %r8d
xorl %eax, %eax
testl %ecx, %ecx
cmovgl %ecx, %eax
movslq %r8d, %r8
movq %r8, -0x8(%rsp)
movslq %ecx, %rcx
movslq %edx, %rdx
movq %rdx, -0x40(%rsp)
movslq %esi, %rsi
leal 0x2(%rsi), %r10d
imull %ecx, %r10d
movl %ecx, %edx
imull %esi, %edx
leaq 0x1(,%rsi,2), %rbx
imulq %rcx, %rbx
addq %rdi, %rbx
movq %rcx, %r8
imulq %rsi, %r8
movq %r8, -0x48(%rsp)
leaq (%rdi,%rcx), %r15
incq %rsi
imulq %rcx, %rsi
movq %rdi, -0x10(%rsp)
leaq (%rdi,%rsi), %r12
addq %r13, %rsi
movabsq $0x1, %rdi
movl %edx, -0x54(%rsp)
movl %edx, -0x58(%rsp)
cmpq -0x40(%rsp), %rdi
jge 0x6d8c
incq %rdi
movq %rdi, -0x38(%rsp)
movq %rsi, -0x18(%rsp)
movq %r12, -0x30(%rsp)
movq %r15, -0x28(%rsp)
movq %rbx, -0x20(%rsp)
movl -0x58(%rsp), %r9d
movl %r10d, -0x50(%rsp)
movabsq $0x1, %rdx
cmpq -0x8(%rsp), %rdx
jge 0x6d4d
movslq %r10d, %r8
movq -0x10(%rsp), %rdi
addq %rdi, %r8
movl %r9d, -0x4c(%rsp)
movslq %r9d, %r11
addq %rdi, %r11
xorl %r13d, %r13d
cmpq %r13, %rax
je 0x6d2e
movzbl (%r12,%r13), %r14d
movzbl (%r15,%r13), %ebp
movzbl (%rbx,%r13), %edi
movzbl (%r11,%r13), %r9d
cmpb %r14b, %bpl
cmoval %ebp, %r14d
cmpb %r14b, %dil
cmoval %edi, %r14d
cmpb %r14b, %r9b
ja 0x6d18
movl %r14d, %r9d
movzbl (%r8,%r13), %r14d
cmpb %r9b, %r14b
ja 0x6d25
movl %r9d, %r14d
movb %r14b, (%rsi,%r13)
incq %r13
jmp 0x6ce9
incq %rdx
addl %ecx, %r10d
movl -0x4c(%rsp), %r9d
addl %ecx, %r9d
addq %rcx, %rbx
addq %rcx, %r15
addq %rcx, %r12
addq %rcx, %rsi
jmp 0x6cc9
movl -0x50(%rsp), %r10d
movl -0x54(%rsp), %edx
addl %edx, %r10d
addl %edx, -0x58(%rsp)
movq -0x20(%rsp), %rbx
movq -0x48(%rsp), %rdx
addq %rdx, %rbx
movq -0x28(%rsp), %r15
addq %rdx, %r15
movq -0x30(%rsp), %r12
addq %rdx, %r12
movq -0x18(%rsp), %rsi
addq %rdx, %rsi
movq -0x38(%rsp), %rdi
jmp 0x6c8e
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./imgp.h
// Function: imgp_ahash
void imgp_ahash(uint8_t *s, int w, int h, uint8_t *ahash)
{
	uint8_t resize[AHASH_SIZE*AHASH_SIZE];
	stbir_resize_uint8(s, w, h, 0, resize, AHASH_SIZE, AHASH_SIZE, 0, 1);

	double avg = 0;
	for (int i=0; i<AHASH_SIZE*AHASH_SIZE; i++) {
		avg += resize[i];
	}
	avg /= AHASH_SIZE*AHASH_SIZE;
	//printf("avg: %f\n", avg);

	for (int i=0; i<AHASH_SIZE*AHASH_SIZE; i++) {
		ahash[i/8] <<= 1;
		if (avg <= (double)resize[i]) ahash[i/8] |= 1;
		else ahash[i/8] &= ~1;
	}

	/*for (int i=0; i<AHASH_SIZE*AHASH_SIZE/8; i++) {
		printf("%02x", ahash[i]);
	}
	printf("\n");*/
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rcx, %rbx
andl $0x0, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movl $0x10, (%rsp)
xorl %r14d, %r14d
leaq 0x20(%rsp), %r8
pushq $0x10
popq %r9
xorl %ecx, %ecx
callq 0x5790
xorpd %xmm0, %xmm0
cmpq $0x100, %r14            # imm = 0x100
je 0x6e35
movzbl 0x20(%rsp,%r14), %eax
cvtsi2sd %eax, %xmm1
addsd %xmm1, %xmm0
incq %r14
jmp 0x6e19
mulsd 0x14c3b(%rip), %xmm0    # 0x1ba78
xorl %eax, %eax
cmpq $0x100, %rax            # imm = 0x100
je 0x6e6e
movl %eax, %ecx
shrl $0x3, %ecx
movb (%rbx,%rcx), %dl
addb %dl, %dl
movzbl 0x20(%rsp,%rax), %esi
cvtsi2sd %esi, %xmm1
ucomisd %xmm0, %xmm1
setae %sil
orb %dl, %sil
movb %sil, (%rbx,%rcx)
incq %rax
jmp 0x6e3f
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./imgp.h
// Function: cmp_node
int cmp_node(oct_node a, oct_node b)
{
	if (a->n_kids < b->n_kids) return -1;
	if (a->n_kids > b->n_kids) return 1;

	int ac = a->count * (1 + a->kid_idx) >> a->depth;
	int bc = b->count * (1 + b->kid_idx) >> b->depth;
	return ac < bc ? -1 : ac > bc;
}

// Assembly:
movb 0x68(%rsi), %al
cmpb %al, 0x68(%rdi)
jae 0x70d2
pushq $-0x1
jmp 0x70d6
jbe 0x70d8
pushq $0x1
popq %rax
retq
movzbl 0x69(%rdi), %eax
incl %eax
imull 0x18(%rdi), %eax
movb 0x6b(%rdi), %cl
sarl %cl, %eax
movzbl 0x69(%rsi), %edx
incl %edx
imull 0x18(%rsi), %edx
movb 0x6b(%rsi), %cl
sarl %cl, %edx
xorl %ecx, %ecx
cmpl %edx, %eax
setg %cl
pushq $-0x1
popq %rax
cmovgel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./imgp.h
// Function: down_heap
void down_heap(node_heap *h, oct_node p)
{
	int n = p->heap_idx, m;
	while (1) {
		m = n * 2;
		if (m >= h->n) break;
		if (m + 1 < h->n && cmp_node(h->buf[m], h->buf[m + 1]) > 0) m++;

		if (cmp_node(p, h->buf[m]) <= 0) break;

		h->buf[n] = h->buf[m];
		h->buf[n]->heap_idx = n;
		n = m;
	}
	h->buf[n] = p;
	p->heap_idx = n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl 0x1c(%rsi), %r13d
movl 0x4(%rdi), %ebp
movq %rdi, (%rsp)
movq 0x8(%rdi), %r12
movl %r13d, %eax
movslq %r13d, %r14
leal (%rax,%rax), %r13d
cmpl %ebp, %r13d
jge 0x7185
movl %r13d, %r15d
orl $0x1, %r15d
cmpl %ebp, %r15d
jge 0x7159
movslq %r13d, %rax
movq (%r12,%rax,8), %rdi
movslq %r15d, %rax
movq (%r12,%rax,8), %rsi
callq 0x70c6
testl %eax, %eax
jg 0x7156
movl %r13d, %r15d
movl %r15d, %r13d
movslq %r13d, %rax
movq (%r12,%rax,8), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x70c6
testl %eax, %eax
jle 0x7185
movq %r15, (%r12,%r14,8)
movq (%rsp), %rax
movq 0x8(%rax), %r12
movq (%r12,%r14,8), %rax
movl %r14d, 0x1c(%rax)
jmp 0x7121
movq %rbx, (%r12,%r14,8)
movl %r14d, 0x1c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./imgp.h
// Function: up_heap
void up_heap(node_heap *h, oct_node p)
{
	int n = p->heap_idx;
	oct_node prev;

	while (n>1) {
		prev = h->buf[n / 2];
		if (cmp_node(p, prev) >= 0) break;

		h->buf[n] = prev;
		prev->heap_idx = n;
		n /= 2;
	}
	h->buf[n] = p;
	p->heap_idx = n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x1c(%rsi), %ebp
movq 0x8(%r14), %r12
cmpl $0x2, %ebp
jl 0x71e1
movl %ebp, %r13d
shrl %r13d
movq (%r12,%r13,8), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x70c6
testl %eax, %eax
jns 0x71e1
movl %ebp, %eax
movq %r15, (%r12,%rax,8)
movl %ebp, 0x1c(%r15)
movl %r13d, %ebp
jmp 0x71b0
movslq %ebp, %rax
movq %rbx, (%r12,%rax,8)
movl %ebp, 0x1c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./imgp.h
// Function: heap_add
void heap_add(node_heap *h, oct_node p)
{
	if ((p->flags & ON_INHEAP)) {
		down_heap(h, p);
		up_heap(h, p);
		return;
	}

	p->flags |= ON_INHEAP;
	if (!h->n) h->n = 1;
	if (h->n >= h->alloc) {
		while (h->n >= h->alloc) h->alloc += 1024;
		h->buf = realloc(h->buf, sizeof(oct_node) * h->alloc);
	}

	p->heap_idx = h->n;
	h->buf[h->n++] = p;
	up_heap(h, p);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movb 0x6a(%rsi), %al
testb $0x1, %al
jne 0x7230
orb $0x1, %al
movb %al, 0x6a(%rbx)
movl 0x4(%r14), %ecx
testl %ecx, %ecx
jne 0x7223
movl $0x1, 0x4(%r14)
pushq $0x1
popq %rcx
movl (%r14), %eax
cmpl %eax, %ecx
jge 0x723d
movq 0x8(%r14), %rax
jmp 0x726a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7104
jmp 0x727b
movslq %eax, %rsi
shlq $0x3, %rsi
cmpl %eax, %ecx
jl 0x7259
addl $0x400, %eax            # imm = 0x400
movl %eax, (%r14)
addq $0x2000, %rsi           # imm = 0x2000
jmp 0x7244
movq 0x8(%r14), %rdi
callq 0x11b0
movq %rax, 0x8(%r14)
movl 0x4(%r14), %ecx
movl %ecx, 0x1c(%rbx)
leal 0x1(%rcx), %edx
movl %edx, 0x4(%r14)
movslq %ecx, %rcx
movq %rbx, (%rax,%rcx,8)
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x719c
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./imgp.h
// Function: pop_heap
oct_node pop_heap(node_heap *h)
{
	if (h->n <= 1) return 0;

	oct_node ret = h->buf[1];
	h->buf[1] = h->buf[--h->n];

	h->buf[h->n] = 0;

	h->buf[1]->heap_idx = 1;
	down_heap(h, h->buf[1]);

	return ret;
}

// Assembly:
pushq %rbx
movl 0x4(%rdi), %eax
cmpl $0x2, %eax
jge 0x729a
xorl %ebx, %ebx
jmp 0x72cc
movq 0x8(%rdi), %rcx
movq 0x8(%rcx), %rbx
decl %eax
movl %eax, 0x4(%rdi)
movq (%rcx,%rax,8), %rdx
movq %rdx, 0x8(%rcx)
movq 0x8(%rdi), %rcx
andq $0x0, (%rcx,%rax,8)
movq 0x8(%rdi), %rax
movq 0x8(%rax), %rsi
movl $0x1, 0x1c(%rsi)
callq 0x7104
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./imgp.h
// Function: node_new
oct_node node_new(unsigned char idx, unsigned char depth, oct_node p)
{
	static int len = 0;
	if (len <= 1) {
		oct_node p = calloc(sizeof(oct_node_t), 2048);
		p->parent = oct_pool;
		oct_pool = p;
		len = 2047;
	}

	oct_node x = oct_pool + len--;
	x->kid_idx = idx;
	x->depth = depth;
	x->parent = p;
	if (p) p->n_kids++;
	return x;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movl %edi, %r14d
movl 0x1bf52(%rip), %ecx     # 0x23238
movq 0x1bf53(%rip), %r15     # 0x23240
cmpl $0x1, %ecx
jg 0x7312
pushq $0x70
popq %rdi
movl $0x800, %esi            # imm = 0x800
callq 0x1110
movq %r15, 0x60(%rax)
movq %rax, 0x1bf36(%rip)     # 0x23240
movl $0x7ff, %ecx            # imm = 0x7FF
movq %rax, %r15
leal -0x1(%rcx), %eax
movl %eax, 0x1bf1d(%rip)     # 0x23238
movl %ecx, %eax
imulq $0x70, %rax, %rcx
leaq (%r15,%rcx), %rax
movb %r14b, 0x69(%r15,%rcx)
movb %bpl, 0x6b(%r15,%rcx)
movq %rbx, 0x60(%r15,%rcx)
testq %rbx, %rbx
je 0x733c
incb 0x68(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./imgp.h
// Function: node_free
void node_free()
{
	oct_node p;
	while (oct_pool) {
		p = oct_pool->parent;
		free(oct_pool);
		oct_pool = p;
	}
}

// Assembly:
pushq %rbx
movq 0x1bef1(%rip), %rdi     # 0x23240
testq %rdi, %rdi
je 0x7369
movq 0x60(%rdi), %rbx
callq 0x1030
movq %rbx, 0x1bedc(%rip)     # 0x23240
movq %rbx, %rdi
jmp 0x734f
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./imgp.h
// Function: node_insert
oct_node node_insert(oct_node root, unsigned char *pix)
{
	unsigned char i, bit, depth = 0;
	for (bit = 1 << 7; ++depth < OCT_DEPTH; bit >>= 1) {
		i = !!(pix[1] & bit) * 4 + !!(pix[0] & bit) * 2 + !!(pix[2] & bit);
		if (!root->kids[i]) {
			root->kids[i] = node_new(i, depth, root);
		}

		root = root->kids[i];
	}

	root->r += pix[0];
	root->g += pix[1];
	root->b += pix[2];
	root->count++;
	return root;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x80, %ebp
movb $0x1, %r12b
cmpb $0x8, %r12b
je 0x73d6
movzbl 0x1(%rbx), %eax
testl %eax, %ebp
setne %al
shlb $0x2, %al
movzbl (%rbx), %ecx
testl %ecx, %ebp
setne %cl
addb %cl, %cl
orb %al, %cl
movzbl 0x2(%rbx), %eax
testl %eax, %ebp
setne %al
orb %cl, %al
movzbl %al, %r15d
movq 0x20(%r14,%r15,8), %rax
testq %rax, %rax
jne 0x73cc
movzbl %r12b, %esi
movl %r15d, %edi
movq %r14, %rdx
callq 0x72d1
movq %rax, 0x20(%r14,%r15,8)
shrl %ebp
incb %r12b
movq %rax, %r14
jmp 0x7381
movzbl (%rbx), %eax
addq %rax, (%r14)
movzbl 0x1(%rbx), %eax
addq %rax, 0x8(%r14)
movzbl 0x2(%rbx), %eax
addq %rax, 0x10(%r14)
incl 0x18(%r14)
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./imgp.h
// Function: node_fold
oct_node node_fold(oct_node p)
{
	if (p->n_kids) abort();
	oct_node q = p->parent;
	q->count += p->count;

	q->r += p->r;
	q->g += p->g;
	q->b += p->b;
	q->n_kids --;
	q->kids[p->kid_idx] = 0;
	return q;
}

// Assembly:
cmpb $0x0, 0x68(%rdi)
jne 0x7432
movq 0x60(%rdi), %rax
movl 0x18(%rdi), %ecx
addl %ecx, 0x18(%rax)
movdqu (%rdi), %xmm0
movdqu (%rax), %xmm1
paddq %xmm0, %xmm1
movdqu %xmm1, (%rax)
movq 0x10(%rdi), %rcx
addq %rcx, 0x10(%rax)
decb 0x68(%rax)
movzbl 0x69(%rdi), %ecx
andq $0x0, 0x20(%rax,%rcx,8)
retq
pushq %rax
callq 0x1040
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./imgp.h
// Function: color_replace
void color_replace(oct_node root, unsigned char *pix)
{
	unsigned char i, bit;

	for (bit = 1 << 7; bit; bit >>= 1) {
		i = !!(pix[1] & bit) * 4 + !!(pix[0] & bit) * 2 + !!(pix[2] & bit);
		if (!root->kids[i]) break;
		root = root->kids[i];
	}

	pix[0] = root->r;
	pix[1] = root->g;
	pix[2] = root->b;
}

// Assembly:
movb $-0x80, %cl
movq %rdi, %rax
testb %cl, %cl
je 0x746e
xorl %edx, %edx
testb %cl, 0x1(%rsi)
setne %dl
xorl %edi, %edi
testb %cl, (%rsi)
setne %dil
shll $0x2, %edx
leal (%rdx,%rdi,2), %edx
xorl %edi, %edi
testb %cl, 0x2(%rsi)
setne %dil
orl %edx, %edi
movq 0x20(%rax,%rdi,8), %rdi
shrb %cl
testq %rdi, %rdi
jne 0x743a
movb (%rax), %cl
movb %cl, (%rsi)
movb 0x8(%rax), %cl
movb %cl, 0x1(%rsi)
movb 0x10(%rax), %al
movb %al, 0x2(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./imgp.h
// Function: imgp_color_quant
void imgp_color_quant(unsigned char *im, int w, int h, int n_colors)
{
	int i;
	unsigned char *pix = im;
	node_heap heap = { 0, 0, 0 };

	oct_node root = node_new(0, 0, 0);
	for (i=0; i < w * h; i++, pix += 3) {
		heap_add(&heap, node_insert(root, pix));
	}

	while (heap.n > n_colors + 1) {
		heap_add(&heap, node_fold(pop_heap(&heap)));
	}

	/*for (i=1; i < heap.n; i++) {
		oct_node got = heap.buf[i];
		double c = got->count;
		got->r = got->r / c + .5;
		got->g = got->g / c + .5;
		got->b = got->b / c + .5;
		printf("%2d | %3lu %3lu %3lu (%d pixels)\n",
		       i, got->r, got->g, got->b, got->count);
	}*/

	for (i=0, pix = im; i < w * h; i++, pix += 3) {
		color_replace(root, pix);
	}

	node_free();
	free(heap.buf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, 0xc(%rsp)
movl %edx, %r13d
movl %esi, %ebp
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r12
movaps %xmm0, (%r12)
xorl %ebx, %ebx
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x72d1
movq %rax, %r15
imull %r13d, %ebp
testl %ebp, %ebp
cmovlel %ebx, %ebp
movl %ebp, %ebx
movq %r14, %r13
subl $0x1, %ebx
jb 0x74e5
movq %r15, %rdi
movq %r13, %rsi
callq 0x736b
movq %r12, %rdi
movq %rax, %rsi
callq 0x71fa
addq $0x3, %r13
jmp 0x74c4
movl 0xc(%rsp), %ebx
incl %ebx
leaq 0x10(%rsp), %r12
cmpl %ebx, 0x14(%rsp)
jle 0x7522
movq %r12, %rdi
callq 0x728d
movq %rax, %rdi
callq 0x73fc
movq %r12, %rdi
movq %rax, %rsi
callq 0x71fa
jmp 0x74f0
movq %r15, %rdi
movq %r14, %rsi
callq 0x7438
addq $0x3, %r14
subl $0x1, %ebp
jae 0x7513
callq 0x7347
movq 0x18(%rsp), %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./imgp.h
// Function: rndunit_24to15
uint8_t rndunit_24to15(uint8_t u, int dither)
{
	uint8_t unit = (u & 0b11111000)>>3;
	uint8_t weight = (u & 0b00000111);
	if (dither && (weight - (rand() % 7) >=0) && (unit < 31)) {
		unit++;
	}
	return unit<<3;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
shrb $0x3, %bl
testl %esi, %esi
je 0x7572
andb $0x7, %dil
movzbl %dil, %ebp
callq 0x1240
pushq $0x7
popq %rcx
cltd
idivl %ecx
cmpl %ebp, %edx
setle %al
cmpb $0x1f, %bl
setne %cl
andb %al, %cl
addb %cl, %bl
shlb $0x3, %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./potracelib.h
// Function: path_new
path_t *path_new(void) {
  path_t *p = NULL;
  privpath_t *priv = NULL;
  SAFE_CALLOC(p, 1, path_t);
  memset(p, 0, sizeof(path_t));
  SAFE_CALLOC(priv, 1, privpath_t);
  memset(priv, 0, sizeof(privpath_t));
  p->priv = priv;
  return p;
 calloc_error:
  free(p);
  free(priv);
  return NULL;
}

// Assembly:
pushq %rbx
pushq $0x1
popq %rdi
pushq $0x40
popq %rsi
callq 0x1110
movq %rax, %rbx
testq %rax, %rax
je 0x75f5
pushq $0x1
popq %rdi
movl $0xc0, %esi
callq 0x1110
testq %rax, %rax
je 0x75f5
movq %rax, 0x38(%rbx)
jmp 0x75ff
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./potracelib.h
// Function: path_free
void path_free(path_t *p) {
  if (p) {
    if (p->priv) {
      free(p->priv->pt);
      free(p->priv->lon);
      free(p->priv->sums);
      free(p->priv->po);
      privcurve_free_members(&p->priv->curve);
      privcurve_free_members(&p->priv->ocurve);
    }
    free(p->priv);
    /* do not free p->fcurve ! */
  }
  free(p);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0x766d
movq 0x38(%rbx), %rax
testq %rax, %rax
je 0x7666
movq 0x8(%rax), %rdi
callq 0x1030
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x1030
movq 0x38(%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x1030
movq 0x38(%rbx), %rax
movq 0x30(%rax), %rdi
callq 0x1030
movq 0x38(%rbx), %rdi
addq $0x38, %rdi
callq 0x7676
movq 0x38(%rbx), %rdi
addq $0x78, %rdi
callq 0x7676
movq 0x38(%rbx), %rdi
jmp 0x7668
xorl %edi, %edi
callq 0x1030
movq %rbx, %rdi
popq %rbx
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./potracelib.h
// Function: privcurve_init
int privcurve_init(privcurve_t *curve, int n) {
  memset(curve, 0, sizeof(privcurve_t));
  curve->n = n;
  SAFE_CALLOC(curve->tag, n, int);
  SAFE_CALLOC(curve->c, n, dpoint3_t);
  SAFE_CALLOC(curve->vertex, n, dpoint_t);
  SAFE_CALLOC(curve->alpha, n, double);
  SAFE_CALLOC(curve->alpha0, n, double);
  SAFE_CALLOC(curve->beta, n, double);
  return 0;
 calloc_error:
  free(curve->tag);
  free(curve->c);
  free(curve->vertex);
  free(curve->alpha);
  free(curve->alpha0);
  free(curve->beta);
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbp
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movl %esi, (%rdi)
movslq %esi, %r13
pushq $0x4
popq %rsi
movq %r13, %rdi
callq 0x1110
movq %rax, %rbx
movq %rax, 0x8(%rbp)
testq %rax, %rax
je 0x779a
pushq $0x30
popq %rsi
movq %r13, %rdi
callq 0x1110
movq %rax, 0x10(%rbp)
testq %rax, %rax
je 0x779a
movq %rax, %r14
pushq $0x10
popq %rsi
movq %r13, %rdi
callq 0x1110
movq %rax, 0x20(%rbp)
testq %rax, %rax
je 0x77e4
movq %rax, %r15
pushq $0x8
popq %rsi
movq %r13, %rdi
callq 0x1110
movq %rax, 0x28(%rbp)
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x77ef
pushq $0x8
popq %rsi
movq %r13, %rdi
callq 0x1110
movq %rax, 0x30(%rbp)
xorl %r12d, %r12d
testq %rax, %rax
je 0x7793
movq %rax, 0x10(%rsp)
pushq $0x8
popq %rsi
movq %r13, %rdi
callq 0x1110
movq %rax, 0x38(%rbp)
testq %rax, %rax
jne 0x77d2
movq 0x10(%rsp), %r12
movq 0x8(%rsp), %r13
jmp 0x77a6
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %r15d, %r15d
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movq %r15, %rdi
callq 0x1030
movq %r13, %rdi
callq 0x1030
movq %r12, %rdi
callq 0x1030
pushq $0x1
popq %r12
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %r15d, %r15d
jmp 0x77a6
xorl %r12d, %r12d
xorl %r13d, %r13d
jmp 0x77a6
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./potracelib.h
// Function: progress_update
static inline void progress_update(double d, progress_t *prog) {
  double d_scaled;
  if (prog != NULL && prog->callback != NULL) {
    d_scaled = prog->min * (1-d) + prog->max * d;
    if (d == 1.0 || d_scaled >= prog->d_prev + prog->epsilon) {
      prog->callback(prog->min * (1-d) + prog->max * d, prog->data);
      prog->d_prev = d_scaled;
    }
  }
}

// Assembly:
testq %rdi, %rdi
je 0xa722
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0xa71d
movsd 0x113d0(%rip), %xmm1    # 0x1baa8
ucomisd %xmm1, %xmm0
subsd %xmm0, %xmm1
mulsd 0x18(%rbx), %xmm0
mulsd 0x10(%rbx), %xmm1
addsd %xmm0, %xmm1
jne 0xa6f2
jnp 0xa702
movsd 0x30(%rbx), %xmm0
addsd 0x20(%rbx), %xmm0
ucomisd %xmm0, %xmm1
jb 0xa71d
movq 0x8(%rbx), %rdi
movapd %xmm1, %xmm0
movsd %xmm1, 0x8(%rsp)
callq *%rax
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x30(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./potracelib.h
// Function: xor_path
static void xor_path(potrace_bitmap_t *bm, path_t *p) {
  int xa, x, y, k, y1;
  if (p->priv->len <= 0) {  /* a path of length 0 is silly, but legal */
    return;
  }
  y1 = p->priv->pt[p->priv->len-1].y;
  xa = p->priv->pt[0].x & -BM_WORDBITS;
  for (k=0; k<p->priv->len; k++) {
    x = p->priv->pt[k].x;
    y = p->priv->pt[k].y;
    if (y != y1) {
      /* efficiently invert the rectangle [x,xa] x [y,y1] */
      xor_to_ref(bm, x, min(y,y1), xa);
      y1 = y;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movq 0x38(%rsi), %rcx
movslq (%rcx), %rax
testq %rax, %rax
jle 0xb10e
movq 0x8(%rcx), %rdx
movq %rax, %rcx
shlq $0x4, %rcx
movl -0x8(%rdx,%rcx), %ebx
movl (%rdx), %esi
andl $-0x40, %esi
xorl %r8d, %r8d
movabsq $-0x1, %r9
cmpq %rax, %r8
je 0xb10e
movq %r8, %r10
shlq $0x4, %r10
leaq (%rdx,%r10), %rcx
movl 0x8(%rdx,%r10), %r10d
cmpl %r10d, %ebx
jne 0xb078
movl %ebx, %r10d
jmp 0xb103
movl (%rcx), %r11d
cmovgel %r10d, %ebx
movl %r11d, %ecx
andl $-0x40, %ecx
movslq %ebx, %rbx
movl %esi, %ebp
cmpl %esi, %ecx
jl 0xb0d4
cmpl %ecx, %ebp
jge 0xb0d8
movslq 0x8(%rdi), %r14
imulq %rbx, %r14
shlq $0x3, %r14
addq 0x10(%rdi), %r14
movl %ebp, %r15d
sarl $0x6, %r15d
movslq %r15d, %r15
notq (%r14,%r15,8)
addl $0x40, %ebp
jmp 0xb08e
movslq 0x8(%rdi), %r14
imulq %rbx, %r14
shlq $0x3, %r14
addq 0x10(%rdi), %r14
movl %ecx, %ebp
sarl $0x6, %ebp
movslq %ebp, %r15
notq (%r14,%r15,8)
addl $0x40, %ecx
cmpl %esi, %ecx
jl 0xb0b5
movl %r11d, %ecx
andl $0x3f, %ecx
je 0xb103
negb %cl
movq %r9, %r14
shlq %cl, %r14
movslq 0x8(%rdi), %rcx
imulq %rbx, %rcx
shlq $0x3, %rcx
addq 0x10(%rdi), %rcx
sarl $0x6, %r11d
movslq %r11d, %r11
xorq %r14, (%rcx,%r11,8)
incq %r8
movl %r10d, %ebx
jmp 0xb052
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./potracelib.h
// Function: potrace_param_default
potrace_param_t *potrace_param_default(void) {
  potrace_param_t *p;
  p = (potrace_param_t *) malloc(sizeof(potrace_param_t));
  if (!p) {
    return NULL;
  }
  memcpy(p, &param_default, sizeof(potrace_param_t));
  return p;
}

// Assembly:
pushq %rax
pushq $0x48
popq %rdi
callq 0x1180
testq %rax, %rax
je 0xb15c
leaq 0xe435(%rip), %rsi      # 0x19588
pushq $0x9
popq %rcx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./potracelib.h
// Function: progress_subrange_end
static inline void progress_subrange_end(progress_t *prog, progress_t *sub) {
  if (prog != NULL && prog->callback != NULL) {
    if (sub->callback == NULL) {
      progress_update(sub->b, prog);
    } else {
      prog->d_prev = sub->d_prev;
    }
  }    
}

// Assembly:
testq %rdi, %rdi
je 0xb386
cmpq $0x0, (%rdi)
je 0xb386
cmpq $0x0, (%rsi)
je 0xb387
movsd 0x30(%rsi), %xmm0
movsd %xmm0, 0x30(%rdi)
retq
movsd 0x28(%rsi), %xmm0
jmp 0xa6bb
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./potracelib.h
// Function: bm_new
static inline potrace_bitmap_t *bm_new(int w, int h) {
  potrace_bitmap_t *bm;
  int dy = w == 0 ? 0 : (w - 1) / BM_WORDBITS + 1;
  ptrdiff_t size;
  size = getsize(dy, h);
  if (size < 0) {
    errno = ENOMEM;
    return NULL;
  }
  if (size == 0) {
    size = BM_WORDSIZE; /* make sure calloc() doesn't return NULL */
  } 
  bm = (potrace_bitmap_t *) malloc(sizeof(potrace_bitmap_t));
  if (!bm) {
    return NULL;
  }
  bm->w = w;
  bm->h = h;
  bm->dy = dy;
  bm->map = (potrace_word *) calloc(1, size);
  if (!bm->map) {
    free(bm);
    return NULL;
  }
  return bm;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movl %edi, %r14d
testl %edi, %edi
je 0xb897
leal -0x1(%r14), %eax
pushq $0x40
popq %rcx
cltd
idivl %ecx
movl %eax, %ebp
incl %ebp
jmp 0xb899
xorl %ebp, %ebp
movl %ebp, %edi
movl %ebx, %esi
callq 0x18d32
testq %rax, %rax
js 0xb8e8
movq %rax, %r12
pushq $0x18
popq %rdi
callq 0x1180
testq %rax, %rax
je 0xb8f3
movq %rax, %r15
testq %r12, %r12
pushq $0x8
popq %rsi
cmovneq %r12, %rsi
movl %r14d, (%rax)
movl %ebx, 0x4(%rax)
movl %ebp, 0x8(%rax)
pushq $0x1
popq %rdi
callq 0x1110
movq %rax, 0x10(%r15)
testq %rax, %rax
jne 0xb8f6
movq %r15, %rdi
callq 0x1030
jmp 0xb8f3
callq 0x1050
movl $0xc, (%rax)
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./stb_image_resize.h
// Function: stbir__filter_catmullrom
static float stbir__filter_catmullrom(float x, float s)
{
    STBIR__UNUSED_PARAM(s);

    x = (float)fabs(x);

    if (x < 1.0f)
        return 1 - x*x*(2.5f - 1.5f*x);
    else if (x < 2.0f)
        return 2 - x*(4 + x*(0.5f*x - 2.5f));

    return (0.0f);
}

// Assembly:
movaps 0x2fb7(%rip), %xmm2     # 0x192a0
andps %xmm0, %xmm2
movss 0x2d14(%rip), %xmm1     # 0x19008
ucomiss %xmm2, %xmm1
jbe 0x1631d
movss 0x2d6f(%rip), %xmm3     # 0x19070
mulss %xmm2, %xmm3
addss 0x2d67(%rip), %xmm3     # 0x19074
mulss %xmm0, %xmm0
mulss %xmm3, %xmm0
subss %xmm0, %xmm1
movaps %xmm1, %xmm0
retq
movss 0x2d0f(%rip), %xmm0     # 0x19034
ucomiss %xmm2, %xmm0
jbe 0x16353
movss 0x2cf2(%rip), %xmm1     # 0x19024
mulss %xmm2, %xmm1
addss 0x2d2e(%rip), %xmm1     # 0x1906c
mulss %xmm2, %xmm1
addss 0x2d1e(%rip), %xmm1     # 0x19068
mulss %xmm2, %xmm1
subss %xmm1, %xmm0
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O2/yui0[P]img2vec/./potracelib.h
// Function: quadform
static inline double quadform(quadform_t Q, dpoint_t w) {
  double v[3];
  int i, j;
  double sum;
  v[0] = w.x;
  v[1] = w.y;
  v[2] = 1;
  sum = 0.0;
  for (i=0; i<3; i++) {
    for (j=0; j<3; j++) {
      sum += v[i] * Q[i][j] * v[j];
    }
  }
  return sum;
}

// Assembly:
movsd %xmm0, -0x18(%rsp)
movsd %xmm1, -0x10(%rsp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x8(%rsp)
xorpd %xmm0, %xmm0
xorl %eax, %eax
cmpq $0x3, %rax
je 0x1887b
movsd -0x18(%rsp,%rax,8), %xmm1
xorl %ecx, %ecx
cmpq $0x3, %rcx
je 0x18872
movsd (%rdi,%rcx,8), %xmm2
mulsd %xmm1, %xmm2
mulsd -0x18(%rsp,%rcx,8), %xmm2
addsd %xmm2, %xmm0
incq %rcx
jmp 0x18854
incq %rax
addq $0x18, %rdi
jmp 0x18846
retq