LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x7698
movslq 0x7087(%rip), %rdx      # 0xe880
testq %rdx, %rdx
setg %cl
jle 0x787a
movq 0x7070(%rip), %r9       # 0xe878
movl 0x24(%rbx), %esi
movq %rdx, %rdi
negq %rdi
movl $0x1, %r8d
movq %r9, %rax
movl (%r9), %r10d
movl 0x8(%r9), %r9d
leal (%r9,%r10), %r11d
cmpl %esi, %r11d
jl 0x785e
movl 0x2c(%rbx), %r11d
addl %esi, %r11d
cmpl %r11d, %r10d
jge 0x785e
movl 0x4(%rax), %r10d
movl 0x28(%rbx), %r11d
movl 0x30(%rbx), %ebp
addl %r11d, %ebp
cmpl %ebp, %r10d
setge %bpl
addl %r10d, %r9d
cmpl %r11d, %r9d
setl %r9b
orb %bpl, %r9b
cmpb $0x1, %r9b
jne 0x787a
cmpq %rdx, %r8
setb %cl
leaq 0x10(%rax), %r9
leaq (%rdi,%r8), %r10
incq %r10
incq %r8
cmpq $0x1, %r10
jne 0x7817
jmp 0x787a
testb $0x1, %cl
jne 0x7886
movq 0x6ff2(%rip), %rax      # 0xe878
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5cfd(%rip), %r12      # 0xe7e0
movq (%r12), %rdi
leaq 0x5d0a(%rip), %r15      # 0xe7f8
movq (%r15), %rsi
callq 0x6287
movq %rax, %rbx
callq 0x8b66
movq %rax, %r14
testq %rbx, %rbx
je 0x8b18
movq (%rbx), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x8bda
movq %rax, %r15
jmp 0x8b1b
movq (%r15), %r15
testq %r15, %r15
jne 0x8b32
movq (%r12), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x8bda
movq %rax, %r15
movq %r15, %rdi
callq 0x3cf0
testq %r15, %r15
je 0x8b5a
movq %r15, %rdi
callq 0x3b17
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6cb0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8c12
movq 0x8(%rdi), %rax
movq 0x10(%rax), %rcx
cmpq %rdx, %rcx
jne 0x8c08
cmpl $0x0, 0x7c(%rax)
je 0x8bf8
cmpl $0x0, 0x68(%rcx)
je 0x8c08
movl 0x78(%rax), %r8d
cmpl $-0x1, %r8d
je 0x8c14
cmpl 0x40(%rcx), %r8d
je 0x8c14
cmpq %rsi, %rdi
je 0x8c12
movq (%rdi), %rdi
jmp 0x8bda
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movq %rdi, %rbx
leaq 0x1379(%rip), %rdi      # 0x33aa
movl $0x50, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x13b1(%rip), %rdi      # 0x33fb
movl $0x36, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x13cf(%rip), %rdi      # 0x3432
movl $0x2c, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x13e3(%rip), %rdi      # 0x345f
movl $0x30, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x13fb(%rip), %rdi      # 0x3490
movl $0x25, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x1408(%rip), %rdi      # 0x34b6
movl $0x2e, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x141e(%rip), %rdi      # 0x34e5
movl $0x29, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x142f(%rip), %rdi      # 0x350f
movl $0x35, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x144c(%rip), %rdi      # 0x3545
movl $0x32, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x1466(%rip), %rdi      # 0x3578
movl $0x27, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x1475(%rip), %rdi      # 0x35a0
movl $0x2c, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x1489(%rip), %rdi      # 0x35cd
movl $0x38, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x14a9(%rip), %rdi      # 0x3606
movl $0x31, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x14c2(%rip), %rdi      # 0x3638
movl $0x37, %esi
movl $0x1, %edx
movq %rbx, %rcx
popq %rbx
jmp 0x11c0
// File: /workspace/github_c_makefile_star2_O1/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 0x2c66(%rip), %eax      # 0x5110
cmpl $0x1, %eax
je 0x24d3
testl %eax, %eax
jne 0x24e9
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movl $0x7, %edx
callq 0x1140
testl %eax, %eax
je 0x24eb
movl $0x1, 0x2c3d(%rip)      # 0x5110
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movl $0x5, %edx
callq 0x1140
testl %eax, %eax
jne 0x24f7
popq %rbx
retq
movl $0x2, 0x2c1b(%rip)      # 0x5110
jmp 0x24e9
callq 0x132c
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x2, %esi
callq 0x1100
testq %rax, %rax
je 0x2525
leaq 0x11a7(%rip), %rsi      # 0x36bd
movq %rax, %rdi
callq 0x1180
testq %rax, %rax
je 0x252d
popq %rbx
retq
movq %rbx, %rdi
callq 0x1383
movq %rbx, %rdi
callq 0x135f
// File: /workspace/github_c_makefile_star2_O1/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, 0x18(%rsp)
movq %rdi, %r14
movl 0x2bb3(%rip), %r12d     # 0x5108
movl $0x1, %eax
movq %rax, 0x8(%rsp)
movl %r12d, %ecx
shlq %cl, %rax
movq %rax, 0x10(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x8000, %edx           # imm = 0x8000
xorl %esi, %esi
callq 0x10c0
cmpl $0x3f, %r12d
je 0x261a
movq 0x10(%rsp), %rax
cmpq $0x2, %rax
movq 0x8(%rsp), %rcx
cmovgeq %rax, %rcx
movq %rcx, 0x8(%rsp)
xorl %r15d, %r15d
movq 0x18(%rsp), %rsi
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
leaq (%rcx,%rax), %r12
xorq %rax, %rcx
rolq $0x18, %rax
movq %rcx, %rdx
shlq $0x10, %rdx
xorq %rax, %rdx
xorq %rcx, %rdx
movq %rdx, (%rsi)
rolq $0x25, %rcx
movq %rcx, 0x8(%rsi)
movq %r12, %rdi
callq *%r14
movq %rax, %r13
leaq 0x20(%rsp), %rbp
xorl %ebx, %ebx
movq %r12, %rdi
btcq %rbx, %rdi
callq *%r14
xorq %r13, %rax
xorl %ecx, %ecx
btq %rcx, %rax
adcq $0x0, (%rbp,%rcx,8)
incq %rcx
cmpq $0x40, %rcx
jne 0x25ed
incq %rbx
addq $0x200, %rbp            # imm = 0x200
cmpq $0x40, %rbx
jne 0x25de
incq %r15
cmpq 0x8(%rsp), %r15
jne 0x259f
movq 0x10(%rsp), %rcx
movq %rcx, %rax
shrq $0x3f, %rax
addq %rcx, %rax
sarq %rax
negq %rax
cvtsi2sd %rcx, %xmm1
mulsd 0x9ec(%rip), %xmm1      # 0x3028
xorpd %xmm0, %xmm0
leaq 0x20(%rsp), %rcx
xorl %edx, %edx
movsd 0x9e1(%rip), %xmm2      # 0x3030
xorl %esi, %esi
movq (%rcx,%rsi,8), %rdi
addq %rax, %rdi
xorps %xmm3, %xmm3
cvtsi2sd %rdi, %xmm3
divsd %xmm1, %xmm3
mulsd %xmm3, %xmm3
mulsd %xmm2, %xmm3
addsd %xmm3, %xmm0
incq %rsi
cmpq $0x40, %rsi
jne 0x2651
incq %rdx
addq $0x200, %rcx            # imm = 0x200
cmpq $0x40, %rdx
jne 0x264f
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x2699
sqrtsd %xmm0, %xmm0
jmp 0x269e
callq 0x11d0
mulsd 0x97a(%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_O1/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, 0x18(%rsp)
movq %rdi, %r14
movl 0x2a31(%rip), %ebp      # 0x5108
movl $0x1, %eax
movq %rax, 0x8(%rsp)
movl %ebp, %ecx
shlq %cl, %rax
movq %rax, 0x10(%rsp)
leaq 0x20(%rsp), %rdi
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0x10c0
cmpl $0x3f, %ebp
je 0x2795
movq 0x10(%rsp), %rax
cmpq $0x2, %rax
movq 0x8(%rsp), %rcx
cmovgeq %rax, %rcx
movq %rcx, 0x8(%rsp)
xorl %r15d, %r15d
movq 0x18(%rsp), %rsi
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
leal (%rcx,%rax), %ebp
xorq %rax, %rcx
rolq $0x18, %rax
movq %rcx, %rdx
shlq $0x10, %rdx
xorq %rax, %rdx
xorq %rcx, %rdx
movq %rdx, (%rsi)
rolq $0x25, %rcx
movq %rcx, 0x8(%rsi)
movl %ebp, %edi
callq *%r14
movl %eax, %r12d
leaq 0x20(%rsp), %r13
xorl %ebx, %ebx
movl %ebp, %edi
btcl %ebx, %edi
callq *%r14
xorl %r12d, %eax
xorl %ecx, %ecx
btl %ecx, %eax
adcq $0x0, (%r13,%rcx,8)
incq %rcx
cmpq $0x20, %rcx
jne 0x2769
incq %rbx
addq $0x100, %r13            # imm = 0x100
cmpq $0x20, %rbx
jne 0x275c
incq %r15
cmpq 0x8(%rsp), %r15
jne 0x271f
movq 0x10(%rsp), %rcx
movq %rcx, %rax
shrq $0x3f, %rax
addq %rcx, %rax
sarq %rax
negq %rax
cvtsi2sd %rcx, %xmm1
mulsd 0x871(%rip), %xmm1      # 0x3028
xorpd %xmm0, %xmm0
leaq 0x20(%rsp), %rcx
xorl %edx, %edx
movsd 0x84e(%rip), %xmm2      # 0x3018
xorl %esi, %esi
movq (%rcx,%rsi,8), %rdi
addq %rax, %rdi
xorps %xmm3, %xmm3
cvtsi2sd %rdi, %xmm3
divsd %xmm1, %xmm3
mulsd %xmm3, %xmm3
mulsd %xmm2, %xmm3
addsd %xmm3, %xmm0
incq %rsi
cmpq $0x20, %rsi
jne 0x27cc
incq %rdx
addq $0x100, %rcx            # imm = 0x100
cmpq $0x20, %rdx
jne 0x27ca
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x2814
sqrtsd %xmm0, %xmm0
jmp 0x2819
callq 0x11d0
mulsd 0x7ff(%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_O1/skeeto[P]hash-prospector/prospector.c
// Function: hf_randomize
static void
hf_randomize(struct hf_op *op, uint64_t s[2])
{
    uint64_t r = xoroshiro128plus(s);
    switch (op->type) {
        case HF32_NOT:
        case HF64_NOT:
        case HF32_BSWAP:
        case HF64_BSWAP:
            op->constant = 0;
            break;
        case HF32_XOR:
        case HF32_ADD:
            op->constant = (uint32_t)r;
            break;
        case HF32_MUL:
            op->constant = (uint32_t)r | 1;
            break;
        case HF32_ROT:
        case HF32_XORL:
        case HF32_XORR:
        case HF32_ADDL:
        case HF32_SUBL:
            op->constant = 1 + r % 31;
            break;
        case HF64_XOR:
        case HF64_ADD:
            op->constant = r;
            break;
        case HF64_MUL:
            op->constant = r | 1;
            break;
        case HF64_ROT:
        case HF64_XORL:
        case HF64_XORR:
        case HF64_ADDL:
        case HF64_SUBL:
            op->constant = 1 + r % 63;
            break;
    }
}

// Assembly:
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
movq %rcx, %rdx
xorq %rax, %rdx
movq %rax, %r8
rolq $0x18, %r8
movq %rdx, %r9
shlq $0x10, %r9
xorq %r8, %r9
xorq %rdx, %r9
rolq $0x25, %rdx
movq %r9, (%rsi)
movq %rdx, 0x8(%rsi)
movl (%rdi), %edx
cmpq $0x13, %rdx
ja 0x28ee
addq %rax, %rcx
leaq 0x8db(%rip), %rax       # 0x3150
movslq (%rax,%rdx,4), %rdx
addq %rax, %rdx
jmpq *%rdx
movabsq $0x842108421084211, %rdx # imm = 0x842108421084211
movq %rcx, %rax
mulq %rdx
movq %rcx, %rax
subq %rdx, %rax
shrq %rax
addq %rdx, %rax
shrq $0x4, %rax
movq %rax, %rdx
shlq $0x5, %rdx
jmp 0x28ce
movabsq $0x410410410410411, %rdx # imm = 0x410410410410411
movq %rcx, %rax
mulq %rdx
movq %rcx, %rax
subq %rdx, %rax
shrq %rax
addq %rdx, %rax
shrq $0x5, %rax
movq %rax, %rdx
shlq $0x6, %rdx
subq %rdx, %rax
addq %rax, %rcx
incq %rcx
jmp 0x28ea
xorl %ecx, %ecx
jmp 0x28ea
movl %ecx, %ecx
jmp 0x28ea
orq $0x1, %rcx
jmp 0x28ea
orl $0x1, %ecx
movq %rcx, 0x8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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:
movl %edx, %ecx
movq (%rsi), %rdx
movq 0x8(%rsi), %r8
leaq (%r8,%rdx), %rax
xorq %rdx, %r8
rolq $0x18, %rdx
movq %r8, %r9
shlq $0x10, %r9
xorq %rdx, %r9
xorq %r8, %r9
movq %r9, (%rsi)
rolq $0x25, %r8
movq %r8, 0x8(%rsi)
movl %ecx, %edx
andl $0x2, %edx
movl %edx, %r8d
shrl %r8d
xorl %r9d, %r9d
testl %edx, %edx
sete %r9b
leal (%r9,%r9,2), %r9d
addl $0x6, %r9d
xorl %edx, %edx
divq %r9
leal (%r8,%r8,2), %eax
andl $0x1, %ecx
negl %ecx
andl $0x9, %ecx
addl %eax, %ecx
addl %ecx, %edx
movl %edx, (%rdi)
jmp 0x2833
// File: /workspace/github_c_makefile_star2_O1/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:
testl %edx, %edx
jle 0x70ed
pushq %rbp
pushq %rbx
leal (%rcx,%rcx,2), %eax
cltq
movslq %r9d, %rcx
movl %esi, %r9d
addq $0x2, %rdi
xorl %r10d, %r10d
movsd 0x189c7(%rip), %xmm0    # 0x1fa40
movsd 0x189c7(%rip), %xmm1    # 0x1fa48
movsd 0x189c7(%rip), %xmm2    # 0x1fa50
testl %esi, %esi
jle 0x70dd
movq %rdi, %r11
xorl %ebx, %ebx
movzbl -0x2(%r11), %ebp
xorps %xmm3, %xmm3
cvtsi2sd %ebp, %xmm3
movzbl -0x1(%r11), %ebp
xorps %xmm4, %xmm4
cvtsi2sd %ebp, %xmm4
mulsd %xmm0, %xmm4
mulsd %xmm1, %xmm3
addsd %xmm4, %xmm3
movzbl (%r11), %ebp
xorps %xmm4, %xmm4
cvtsi2sd %ebp, %xmm4
mulsd %xmm2, %xmm4
addsd %xmm3, %xmm4
cvttsd2si %xmm4, %ebp
movb %bpl, (%r8,%rbx)
incq %rbx
addq $0x3, %r11
cmpq %rbx, %r9
jne 0x7092
addq %rcx, %r8
incl %r10d
addq %rax, %rdi
cmpl %edx, %r10d
jne 0x7089
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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, -0x58(%rsp)
movq %rsi, -0x48(%rsp)
movq %rdi, -0x28(%rsp)
movq %rdx, -0x60(%rsp)
cmpl $0x3, %edx
jl 0x7282
movq -0x60(%rsp), %rax
decl %eax
movq %rax, -0x60(%rsp)
movq -0x48(%rsp), %rax
leal -0x1(%rax), %edx
movq %rdx, -0x8(%rsp)
movslq %ecx, %rdx
movslq %eax, %rsi
movl %edx, %r11d
leal 0x2(%rsi), %edi
imull %ecx, %edi
movl %edi, -0x64(%rsp)
movl %ecx, %edi
imull %eax, %edi
leaq 0x1(,%rsi,2), %r8
imulq %rdx, %r8
movq -0x28(%rsp), %rax
addq %rax, %r8
movq %r8, -0x38(%rsp)
movq %rdx, %r8
imulq %rsi, %r8
movq %r8, -0x20(%rsp)
leaq (%rax,%rdx), %r8
movq %r8, -0x40(%rsp)
incq %rsi
movq %rdx, -0x10(%rsp)
imulq %rdx, %rsi
addq %rsi, -0x58(%rsp)
addq %rax, %rsi
movq %rsi, -0x30(%rsp)
movl $0x1, %edx
movl %edi, -0x50(%rsp)
movl %edi, -0x68(%rsp)
movl %ecx, -0x4c(%rsp)
movq %rdx, -0x18(%rsp)
cmpl $0x3, -0x48(%rsp)
jl 0x724a
movl $0x1, %esi
movq -0x30(%rsp), %r10
movq -0x58(%rsp), %r8
movq -0x40(%rsp), %r12
movq -0x38(%rsp), %r14
movl -0x68(%rsp), %ebp
movl -0x64(%rsp), %edx
testl %ecx, %ecx
jle 0x7227
movslq %edx, %r15
movq -0x28(%rsp), %rax
addq %rax, %r15
movslq %ebp, %rbx
addq %rax, %rbx
xorl %r13d, %r13d
movzbl (%r10,%r13), %eax
movzbl (%r12,%r13), %edi
movzbl (%r14,%r13), %ecx
movzbl (%rbx,%r13), %r9d
cmpb %al, %dil
cmoval %edi, %eax
cmpb %al, %cl
cmoval %ecx, %eax
cmpb %al, %r9b
ja 0x720e
movl %eax, %r9d
movzbl (%r15,%r13), %eax
cmpb %r9b, %al
ja 0x721b
movl %r9d, %eax
movb %al, (%r8,%r13)
incq %r13
cmpq %r13, %r11
jne 0x71e7
incq %rsi
movl -0x4c(%rsp), %ecx
addl %ecx, %edx
addl %ecx, %ebp
movq -0x10(%rsp), %rax
addq %rax, %r14
addq %rax, %r12
addq %rax, %r8
addq %rax, %r10
cmpq -0x8(%rsp), %rsi
jne 0x71cf
movq -0x18(%rsp), %rdx
incq %rdx
movl -0x50(%rsp), %eax
addl %eax, -0x64(%rsp)
addl %eax, -0x68(%rsp)
movq -0x20(%rsp), %rax
addq %rax, -0x38(%rsp)
addq %rax, -0x40(%rsp)
addq %rax, -0x58(%rsp)
addq %rax, -0x30(%rsp)
cmpq -0x60(%rsp), %rdx
jne 0x719e
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 $0x108, %rsp            # imm = 0x108
movq %rcx, %rbx
xorl %r14d, %r14d
movl $0x1, %eax
movq %rsp, %r8
movss 0x15d10(%rip), %xmm2    # 0x1d008
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorl %ecx, %ecx
movl $0x10, %r9d
movaps %xmm2, %xmm3
pushq %r14
pushq %rax
pushq %rax
pushq %r14
pushq %r14
pushq %r14
pushq %r14
pushq $-0x1
pushq %rax
pushq $0x0
pushq %r14
pushq $0x10
callq 0x59c3
addq $0x60, %rsp
xorpd %xmm0, %xmm0
movzbl (%rsp,%r14), %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
addsd %xmm1, %xmm0
incq %r14
cmpq $0x100, %r14            # imm = 0x100
jne 0x732d
mulsd 0x18707(%rip), %xmm0    # 0x1fa58
xorl %eax, %eax
movl %eax, %ecx
shrl $0x3, %ecx
movb (%rbx,%rcx), %dl
addb %dl, %dl
movb %dl, (%rbx,%rcx)
movzbl (%rsp,%rax), %esi
xorps %xmm1, %xmm1
cvtsi2sd %esi, %xmm1
ucomisd %xmm0, %xmm1
setae %sil
orb %dl, %sil
movb %sil, (%rbx,%rcx)
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x7353
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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), %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpb %cl, 0x68(%rdi)
jb 0x764a
movl $0x1, %eax
ja 0x764a
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
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovgel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rdi, %r14
movq %rsi, (%rsp)
movl 0x1c(%rsi), %r13d
movl 0x4(%rdi), %ebp
leal (,%r13,2), %r15d
cmpl %ebp, %r15d
jge 0x76d6
movl %r15d, %r12d
orl $0x1, %r12d
cmpl %ebp, %r12d
jge 0x7698
movq 0x8(%r14), %rax
movslq %r15d, %rcx
movq (%rax,%rcx,8), %rdi
movslq %r12d, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x7609
testl %eax, %eax
jg 0x769b
movl %r15d, %r12d
movq 0x8(%r14), %rbx
movslq %r12d, %rax
movq (%rbx,%rax,8), %r15
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x7609
testl %eax, %eax
jle 0x76d6
movslq %r13d, %rax
movq %r15, (%rbx,%rax,8)
movq 0x8(%r14), %rcx
movq (%rcx,%rax,8), %rcx
movl %eax, 0x1c(%rcx)
leal (%r12,%r12), %r15d
movl %r12d, %r13d
cmpl %ebp, %r15d
jl 0x7671
jmp 0x76d9
movl %r13d, %r12d
movq 0x8(%r14), %rax
movslq %r12d, %rcx
movq (%rsp), %rdx
movq %rdx, (%rax,%rcx,8)
movl %ecx, 0x1c(%rdx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
cmpl $0x2, %ebp
jl 0x7746
movl %ebp, %r12d
movq 0x8(%r14), %r13
shrl %r12d
movq (%r13,%r12,8), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7609
testl %eax, %eax
jns 0x7746
movl %ebp, %eax
movq %r15, (%r13,%rax,8)
movl %ebp, 0x1c(%r15)
cmpl $0x3, %ebp
movl %r12d, %ebp
ja 0x7716
jmp 0x7749
movl %ebp, %r12d
movq 0x8(%r14), %rax
movslq %r12d, %rcx
movq %rbx, (%rax,%rcx,8)
movl %ecx, 0x1c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x77ea
orb $0x1, %al
movb %al, 0x6a(%rbx)
cmpl $0x0, 0x4(%r14)
jne 0x778b
movl $0x1, 0x4(%r14)
movl 0x4(%r14), %ecx
cmpl (%r14), %ecx
jl 0x77d2
movl (%r14), %eax
cmpl %eax, %ecx
jl 0x77be
leal 0x400(%rax), %edx
incl %ecx
cmpl %ecx, %edx
cmovgl %edx, %ecx
movl %eax, %edx
notl %edx
addl %ecx, %edx
andl $0xfffffc00, %edx       # imm = 0xFFFFFC00
addl %edx, %eax
addl $0x400, %eax            # imm = 0x400
movl %eax, (%r14)
movq 0x8(%r14), %rdi
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0x11c0
movq %rax, 0x8(%r14)
movslq 0x4(%r14), %rax
movl %eax, 0x1c(%rbx)
movq 0x8(%r14), %rcx
leal 0x1(%rax), %edx
movl %edx, 0x4(%r14)
movq %rbx, (%rcx,%rax,8)
jmp 0x77f5
movq %r14, %rdi
movq %rbx, %rsi
callq 0x764b
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x76fa
// File: /workspace/github_c_makefile_star2_O1/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
movslq 0x4(%rdi), %rax
cmpq $0x2, %rax
jge 0x7816
xorl %ebx, %ebx
jmp 0x7850
movq 0x8(%rdi), %rcx
movq 0x8(%rcx), %rbx
leaq -0x1(%rax), %rdx
movl %edx, 0x4(%rdi)
movl %edx, %edx
movq (%rcx,%rdx,8), %rdx
movq %rdx, 0x8(%rcx)
movq 0x8(%rdi), %rcx
movq $0x0, -0x8(%rcx,%rax,8)
movq 0x8(%rdi), %rax
movq 0x8(%rax), %rsi
movl $0x1, 0x1c(%rsi)
callq 0x764b
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movl %edi, %r14d
cmpl $0x1, 0x1f9d0(%rip)     # 0x27238
jg 0x7895
movl $0x70, %edi
movl $0x800, %esi            # imm = 0x800
callq 0x1120
movq 0x1f9c0(%rip), %rcx     # 0x27240
movq %rcx, 0x60(%rax)
movq %rax, 0x1f9b5(%rip)     # 0x27240
movl $0x7ff, 0x1f9a3(%rip)   # imm = 0x7FF
movq 0x1f9a4(%rip), %rcx     # 0x27240
movslq 0x1f995(%rip), %rax     # 0x27238
leal -0x1(%rax), %edx
movl %edx, 0x1f98c(%rip)     # 0x27238
imulq $0x70, %rax, %rdx
leaq (%rcx,%rdx), %rax
movb %r14b, 0x69(%rcx,%rdx)
movb %bpl, 0x6b(%rcx,%rdx)
movq %rbx, 0x60(%rcx,%rdx)
testq %rbx, %rbx
je 0x78cb
incb 0x68(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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:
movq 0x1f969(%rip), %rdi     # 0x27240
testq %rdi, %rdi
je 0x78f6
pushq %rbx
movq 0x60(%rdi), %rbx
callq 0x1030
movq %rbx, 0x1f953(%rip)     # 0x27240
movq %rbx, %rdi
testq %rbx, %rbx
jne 0x78dd
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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, %r14
movq %rdi, %rbx
movl $0x80, %ebp
movb $0x1, %r12b
movzbl 0x1(%r14), %eax
testl %eax, %ebp
setne %al
shlb $0x2, %al
movzbl (%r14), %ecx
testl %ecx, %ebp
setne %cl
addb %cl, %cl
orb %al, %cl
movzbl 0x2(%r14), %eax
testl %eax, %ebp
setne %al
orb %cl, %al
movzbl %al, %r15d
cmpq $0x0, 0x20(%rbx,%r15,8)
jne 0x7953
movzbl %r12b, %esi
movl %r15d, %edi
movq %rbx, %rdx
callq 0x7855
movq %rax, 0x20(%rbx,%r15,8)
movq 0x20(%rbx,%r15,8), %rbx
shrl %ebp
incb %r12b
cmpb $0x8, %r12b
jne 0x790d
movzbl (%r14), %eax
addq %rax, (%rbx)
movzbl 0x1(%r14), %eax
addq %rax, 0x8(%rbx)
movzbl 0x2(%r14), %eax
addq %rax, 0x10(%rbx)
incl 0x18(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x79c2
movq 0x60(%rdi), %rax
movl 0x18(%rdi), %ecx
addl %ecx, 0x18(%rax)
movq (%rdi), %rcx
addq %rcx, (%rax)
movq 0x8(%rdi), %rcx
addq %rcx, 0x8(%rax)
movq 0x10(%rdi), %rcx
addq %rcx, 0x10(%rax)
decb 0x68(%rax)
movzbl 0x69(%rdi), %ecx
movq $0x0, 0x20(%rax,%rcx,8)
retq
pushq %rax
callq 0x1040
// File: /workspace/github_c_makefile_star2_O1/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 (%rsi), %al
movb 0x1(%rsi), %cl
movb 0x2(%rsi), %dl
movb $-0x80, %r8b
movq %rdi, %r9
xorl %edi, %edi
testb %r8b, %cl
setne %dil
xorl %r10d, %r10d
testb %r8b, %al
setne %r10b
shll $0x2, %edi
leal (%rdi,%r10,2), %edi
xorl %r10d, %r10d
testb %r8b, %dl
setne %r10b
orl %edi, %r10d
movq 0x20(%r9,%r10,8), %rdi
testq %rdi, %rdi
je 0x7a19
movl %r8d, %r10d
shrb %r10b
movq %rdi, %r9
cmpb $0x2, %r8b
movl %r10d, %r8d
jae 0x79d3
movb (%r9), %al
movb %al, (%rsi)
movb 0x8(%r9), %al
movb %al, 0x1(%rsi)
movb 0x10(%r9), %al
movb %al, 0x2(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/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, %r12d
movl %esi, %ebp
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7855
movq %rax, %r15
imull %r12d, %ebp
testl %ebp, %ebp
jle 0x7a8d
leaq 0x10(%rsp), %r12
movl %ebp, %ebx
movq %r14, %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x78f7
movq %r12, %rdi
movq %rax, %rsi
callq 0x7766
addq $0x3, %r13
decl %ebx
jne 0x7a6f
movl 0xc(%rsp), %ebx
incl %ebx
cmpl %ebx, 0x14(%rsp)
jle 0x7abf
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x7807
movq %rax, %rdi
callq 0x798b
movq %r12, %rdi
movq %rax, %rsi
callq 0x7766
cmpl %ebx, 0x14(%rsp)
jg 0x7a9e
testl %ebp, %ebp
jle 0x7ad6
movq %r15, %rdi
movq %r14, %rsi
callq 0x79c8
addq $0x3, %r14
decl %ebp
jne 0x7ac3
movq 0x1f763(%rip), %rdi     # 0x27240
testq %rdi, %rdi
je 0x7afa
movq 0x60(%rdi), %rbx
callq 0x1030
movq %rbx, 0x1f74e(%rip)     # 0x27240
movq %rbx, %rdi
testq %rbx, %rbx
jne 0x7ae2
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_O1/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 0x7b5e
andb $0x7, %dil
movzbl %dil, %ebp
callq 0x1250
cltq
imulq $-0x6db6db6d, %rax, %rcx # imm = 0x92492493
shrq $0x20, %rcx
addl %eax, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x2, %ecx
addl %edx, %ecx
leal (,%rcx,8), %edx
subl %edx, %ecx
addl %eax, %ecx
cmpl %ebp, %ecx
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_O1/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 %r14
pushq %rbx
pushq %rax
movl $0x1, %edi
movl $0x40, %esi
callq 0x1120
movq %rax, %rbx
testq %rax, %rax
je 0x7c07
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
movl $0x1, %edi
movl $0xc0, %esi
callq 0x1120
testq %rax, %rax
je 0x7c07
movq %rax, %r14
movl $0xc0, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x10f0
movq %r14, 0x38(%rbx)
jmp 0x7c11
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7c81
movq 0x38(%rbx), %rax
testq %rax, %rax
je 0x7c78
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 0x7c8a
movq 0x38(%rbx), %rdi
addq $0x78, %rdi
callq 0x7c8a
movq 0x38(%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
popq %rbx
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O1/yui0[P]img2vec/./potracelib.h
// Function: privcurve_free_members
static void privcurve_free_members(privcurve_t *curve) {
  free(curve->tag);
  free(curve->c);
  free(curve->vertex);
  free(curve->alpha);
  free(curve->alpha0);
  free(curve->beta);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x1030
movq 0x10(%rbx), %rdi
callq 0x1030
movq 0x20(%rbx), %rdi
callq 0x1030
movq 0x28(%rbx), %rdi
callq 0x1030
movq 0x30(%rbx), %rdi
callq 0x1030
movq 0x38(%rbx), %rdi
popq %rbx
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movl %esi, (%rdi)
movslq %esi, %r15
movl $0x4, %esi
movq %r15, %rdi
callq 0x1120
movq %rax, %r14
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x7d96
movl $0x30, %esi
movq %r15, %rdi
callq 0x1120
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x7d96
movl $0x10, %esi
movq %r15, %rdi
callq 0x1120
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x7d96
movl $0x8, %esi
movq %r15, %rdi
callq 0x1120
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x7d96
movl $0x8, %esi
movq %r15, %rdi
callq 0x1120
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0x7d96
movl $0x8, %esi
movq %r15, %rdi
callq 0x1120
movq %rax, %rcx
movq %rax, 0x38(%rbx)
xorl %eax, %eax
testq %rcx, %rcx
jne 0x7dd0
movq %r14, %rdi
callq 0x1030
movq 0x10(%rbx), %rdi
callq 0x1030
movq 0x20(%rbx), %rdi
callq 0x1030
movq 0x28(%rbx), %rdi
callq 0x1030
movq 0x30(%rbx), %rdi
callq 0x1030
movq 0x38(%rbx), %rdi
callq 0x1030
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
movq 0x38(%rsi), %rcx
movslq (%rcx), %rax
testq %rax, %rax
jle 0xc1f8
movq 0x8(%rcx), %rdx
movq %rax, %rcx
shlq $0x4, %rcx
movl -0x8(%rdx,%rcx), %r10d
movl (%rdx), %esi
andl $-0x40, %esi
xorl %r8d, %r8d
movq %r8, %r9
shlq $0x4, %r9
leaq (%rdx,%r9), %rcx
movl 0x8(%rdx,%r9), %r9d
cmpl %r9d, %r10d
jne 0xc152
movl %r10d, %r9d
jmp 0xc1e9
cmovgel %r9d, %r10d
movl (%rcx), %r11d
movl %r11d, %ecx
andl $-0x40, %ecx
cmpl %esi, %ecx
jge 0xc18b
movslq %r10d, %r14
movslq 0x8(%rdi), %rbx
imulq %r14, %rbx
shlq $0x3, %rbx
addq 0x10(%rdi), %rbx
movl %ecx, %ebp
sarl $0x6, %ebp
movslq %ebp, %r14
notq (%rbx,%r14,8)
addl $0x40, %ecx
cmpl %esi, %ecx
jl 0xc176
jmp 0xc1b7
jle 0xc1b7
movslq %r10d, %r14
movslq 0x8(%rdi), %rbx
imulq %r14, %rbx
shlq $0x3, %rbx
addq 0x10(%rdi), %rbx
movl %esi, %ebp
movl %ebp, %r14d
sarl $0x6, %r14d
movslq %r14d, %r14
notq (%rbx,%r14,8)
addl $0x40, %ebp
cmpl %ecx, %ebp
jl 0xc1a2
movl %r11d, %ecx
andl $0x3f, %ecx
je 0xc1e9
negb %cl
movq $-0x1, %rbx
shlq %cl, %rbx
movslq %r10d, %rcx
movslq 0x8(%rdi), %r10
imulq %rcx, %r10
shlq $0x3, %r10
addq 0x10(%rdi), %r10
sarl $0x6, %r11d
movslq %r11d, %rcx
xorq %rbx, (%r10,%rcx,8)
incq %r8
movl %r9d, %r10d
cmpq %rax, %r8
jne 0xc135
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x48, %edi
callq 0x1190
testq %rax, %rax
je 0xc221
leaq 0x11344(%rip), %rsi     # 0x1d558
movl $0x9, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
popq %rcx
retq
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x364f(%rip), %xmm2     # 0x1d260
andps %xmm0, %xmm2
movss 0x33ec(%rip), %xmm1     # 0x1d008
ucomiss %xmm2, %xmm1
jbe 0x19c45
movss 0x3447(%rip), %xmm3     # 0x1d070
mulss %xmm2, %xmm3
addss 0x343f(%rip), %xmm3     # 0x1d074
mulss %xmm0, %xmm0
mulss %xmm3, %xmm0
subss %xmm0, %xmm1
movaps %xmm1, %xmm0
retq
movss 0x33e7(%rip), %xmm0     # 0x1d034
ucomiss %xmm2, %xmm0
jbe 0x19c7b
movss 0x33ca(%rip), %xmm1     # 0x1d024
mulss %xmm2, %xmm1
addss 0x3406(%rip), %xmm1     # 0x1d06c
mulss %xmm2, %xmm1
addss 0x33f6(%rip), %xmm1     # 0x1d068
mulss %xmm2, %xmm1
subss %xmm1, %xmm0
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/yui0[P]img2vec/./stb_image_resize.h
// Function: stbir__edge_wrap
stbir__inline static int stbir__edge_wrap(stbir_edge edge, int n, int max)
{
    // avoid per-pixel switch
    if (n >= 0 && n < max)
        return n;
    return stbir__edge_wrap_slow(edge, n, max);
}

// Assembly:
movl %edx, %ecx
testl %esi, %esi
setns %al
cmpl %edx, %esi
setl %dl
testb %dl, %al
je 0x1baf3
movl %esi, %eax
retq
decl %edi
cmpl $0x3, %edi
ja 0x1bb53
xorl %eax, %eax
leaq 0x1949(%rip), %rdx      # 0x1d44c
movslq (%rdx,%rdi,4), %rdi
addq %rdx, %rdi
jmpq *%rdi
testl %esi, %esi
js 0x1bb3c
leal -0x1(%rcx), %eax
cmpl %ecx, %esi
cmovll %esi, %eax
retq
testl %esi, %esi
js 0x1bb3d
cmpl %ecx, %esi
jl 0x1baf0
leal (%rcx,%rcx), %eax
xorl %edx, %edx
cmpl %esi, %eax
notl %esi
leal (%rsi,%rcx,2), %eax
cmovlel %edx, %eax
retq
movl %esi, %eax
cltd
idivl %ecx
movl %edx, %eax
testl %esi, %esi
js 0x1bb45
retq
cmpl %ecx, %esi
jge 0x1bb4e
negl %esi
jmp 0x1baf0
addl %eax, %ecx
testl %eax, %eax
cmovel %eax, %ecx
jmp 0x1bb50
decl %ecx
movl %ecx, %eax
retq
pushq %rax
leaq 0x593d(%rip), %rdi      # 0x21498
leaq 0x50fe(%rip), %rsi      # 0x20c60
leaq 0x594a(%rip), %rcx      # 0x214b3
movl $0x3e3, %edx            # imm = 0x3E3
callq 0x10e0
// File: /workspace/github_c_makefile_star2_O1/yui0[P]img2vec/./potracelib.h
// Function: tangent
static double tangent(dpoint_t p0, dpoint_t p1, dpoint_t p2, dpoint_t p3, dpoint_t q0, dpoint_t q1) {
  double A, B, C;   /* (1-t)^2 A + 2(1-t)t B + t^2 C = 0 */
  double a, b, c;   /* a t^2 + b t + c = 0 */
  double d, s, r1, r2;
  A = cprod(p0, p1, q0, q1);
  B = cprod(p1, p2, q0, q1);
  C = cprod(p2, p3, q0, q1);
  a = A - 2*B + C;
  b = -2*A + 2*B;
  c = A;
  
  d = b*b - 4*a*c;
  if (a==0 || d<0) {
    return -1.0;
  }
  s = sqrt(d);
  r1 = (-b + s) / (2 * a);
  r2 = (-b - s) / (2 * a);
  if (r1 >= 0 && r1 <= 1) {
    return r1;
  } else if (r2 >= 0 && r2 <= 1) {
    return r2;
  } else {
    return -1.0;
  }
}

// Assembly:
subq $0x28, %rsp
movsd 0x40(%rsp), %xmm8
movsd 0x48(%rsp), %xmm9
subsd %xmm4, %xmm6
movapd %xmm4, %xmm10
subsd %xmm2, %xmm10
subsd %xmm0, %xmm2
subsd %xmm5, %xmm7
subsd %xmm3, %xmm5
subsd 0x30(%rsp), %xmm8
subsd %xmm1, %xmm3
subsd 0x38(%rsp), %xmm9
mulsd %xmm8, %xmm3
mulsd %xmm9, %xmm2
subsd %xmm3, %xmm2
mulsd %xmm8, %xmm5
mulsd %xmm9, %xmm10
subsd %xmm5, %xmm10
mulsd %xmm7, %xmm8
mulsd %xmm9, %xmm6
subsd %xmm8, %xmm6
addsd %xmm10, %xmm10
movapd %xmm2, %xmm5
subsd %xmm10, %xmm5
addsd %xmm6, %xmm5
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm5
movsd 0x361c(%rip), %xmm0     # 0x1fa68
jne 0x1c454
jnp 0x1c539
movapd %xmm2, %xmm1
addsd %xmm2, %xmm1
subsd %xmm1, %xmm10
movsd 0x3697(%rip), %xmm4     # 0x1fb00
mulsd %xmm5, %xmm4
mulsd %xmm2, %xmm4
movapd %xmm10, %xmm1
mulsd %xmm10, %xmm1
addsd %xmm4, %xmm1
ucomisd %xmm1, %xmm3
ja 0x1c539
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jb 0x1c499
sqrtsd %xmm1, %xmm1
jmp 0x1c4c4
movapd %xmm1, %xmm0
movapd %xmm10, 0x10(%rsp)
movsd %xmm5, 0x8(%rsp)
callq 0x1230
xorpd %xmm2, %xmm2
movsd 0x8(%rsp), %xmm5
movapd 0x10(%rsp), %xmm10
movapd %xmm0, %xmm1
movapd %xmm1, %xmm0
subsd %xmm10, %xmm0
addsd %xmm5, %xmm5
divsd %xmm5, %xmm0
ucomisd %xmm2, %xmm0
jb 0x1c4e9
movsd 0x359d(%rip), %xmm2     # 0x1fa80
ucomisd %xmm0, %xmm2
jae 0x1c539
xorpd 0xbfe(%rip), %xmm10     # 0x1d0f0
subsd %xmm1, %xmm10
divsd %xmm5, %xmm10
movapd %xmm10, %xmm1
cmplesd 0x3576(%rip), %xmm1     # 0x1fa80
movapd %xmm1, %xmm0
andpd %xmm10, %xmm0
movsd 0x354d(%rip), %xmm2     # 0x1fa68
andnpd %xmm2, %xmm1
orpd %xmm0, %xmm1
xorpd %xmm0, %xmm0
cmplesd %xmm10, %xmm0
andpd %xmm0, %xmm1
andnpd %xmm2, %xmm0
orpd %xmm1, %xmm0
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/kilobyte[P]colormatch/16x16.c
// Function: main
int main()
{
    printf("     ");
    for (int x=0; x<16; ++x)
    {
        printf("\e[48;2;");
        pc(x);
        printf(";%d;4m%3d \e[0m", neg16(x), x);
    }
    printf("\n");

    for (int y=0; y<16; ++y)
    {
        printf("\e[48;2;");
        pc(y);
        printf(";%dm%3d \e[0m ", neg16(y), y);

        for (int x=0; x<16; ++x)
        {
            printf("\e[0;38;2;");
            pc(x);
            printf(";48;2;");
            pc(y);
            printf("m%4d\e[0m", (color_diff(col256_to_rgb(x), col256_to_rgb(y))
                          +16777216/2)/16777216);
        }

        int v = col256_to_rgb(y);
        printf(" %02x%02x%02x\n", (v>>16)&255, (v>>8)&255, v&255);
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xe36(%rip), %rdi       # 0x2004
xorl %eax, %eax
callq 0x1060
leaq 0xe2e(%rip), %rbx       # 0x200a
movl $0x61, %r15d
leaq 0xe29(%rip), %r14       # 0x2012
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1060
movl %ebp, %edi
callq 0x1320
cmpl $0x9, %ebp
movl $0x1e, %esi
cmovbl %r15d, %esi
movq %r14, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x1060
incl %ebp
cmpl $0x10, %ebp
jne 0x11eb
movl $0xa, %edi
callq 0x1030
leaq 0xe03(%rip), %r15       # 0x202f
leaq 0xe06(%rip), %r12       # 0x2039
leaq 0xe06(%rip), %r13       # 0x2040
xorl %ebx, %ebx
leaq 0xdc7(%rip), %rdi       # 0x200a
xorl %eax, %eax
callq 0x1060
movl %ebx, %edi
callq 0x1320
cmpl $0x9, %ebx
movl $0x1e, %esi
movl $0x61, %eax
cmovbl %eax, %esi
leaq 0xdb9(%rip), %rdi       # 0x2021
movl %ebx, %edx
xorl %eax, %eax
callq 0x1060
xorl %r14d, %r14d
movq %r15, %rdi
xorl %eax, %eax
callq 0x1060
movl %r14d, %edi
callq 0x1320
movq %r12, %rdi
xorl %eax, %eax
callq 0x1060
movl %ebx, %edi
callq 0x1320
movl %r14d, %edi
callq 0x1ca4
movl %eax, %ebp
movl %ebx, %edi
callq 0x1ca4
movl %ebp, %edi
movl %eax, %esi
callq 0x1c5b
leal 0x800000(%rax), %ecx
leal 0x17fffff(%rax), %esi
testl %ecx, %ecx
cmovnsl %ecx, %esi
sarl $0x18, %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x1060
incl %r14d
cmpl $0x10, %r14d
jne 0x1274
movl %ebx, %edi
callq 0x1ca4
movl %eax, %esi
shrl $0x10, %esi
movl $0xff, %ecx
andl %ecx, %esi
movl %eax, %edx
shrl $0x8, %edx
andl %ecx, %edx
andl %ecx, %eax
leaq 0xd4e(%rip), %rdi       # 0x2049
movl %eax, %ecx
xorl %eax, %eax
callq 0x1060
incl %ebx
cmpl $0x10, %ebx
jne 0x123c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq