LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/transform/2dmatch.h
// Function: default_match_parameters(std::vector<int, std::allocator<int>>&, Image const&)
void default_match_parameters(std::vector<int> &parameters, const Image &image) {
    parameters.clear();
    parameters.push_back(0); // first channel
    parameters.push_back(image.nb_channels - 1); // last channel
    parameters.push_back(0);  // 0 = only exact matches, 1 = soft match (difference gets encoded)
    parameters.push_back(1000000); // max distance (positive = search all, negative = look at corresponding positions in previous frames only)
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
cmpq %rax, 0x8(%rdi)
je 0xb406
movq %rax, 0x8(%rbx)
movl $0x0, 0x4(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0xb428
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xb435
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xf6da
movl 0x64(%r14), %eax
decl %eax
movl %eax, 0x4(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0xb455
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xb462
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xf6da
movl $0x0, 0x4(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0xb484
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xb491
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xf6da
movl $0xf4240, 0x4(%rsp)     # imm = 0xF4240
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0xb4b3
movl $0xf4240, (%rsi)        # imm = 0xF4240
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xb4c0
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xf6da
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/transform/2dmatch.h
// Function: meta_match(Image&, std::vector<int, std::allocator<int>>&)
void meta_match(Image &input, std::vector<int> &parameters) {
    if (!parameters.size()) default_match_parameters(parameters,input);
    if (parameters.size() < 3) {
        e_printf("Error: match transform with incorrect parameters.\n");
        input.error = true; return;
    }
    int begin_c = input.nb_meta_channels+parameters[0];
    int end_c = input.nb_meta_channels+parameters[1];
    if (begin_c > end_c || end_c >= input.channel.size()) {
        e_printf("Error: match transform with incorrect parameters.\n");
        input.error = true; return;
    }
    input.nb_meta_channels++;
    Channel mch(input.channel[begin_c].w,input.channel[begin_c].h, 0, 1);
    input.channel.insert(input.channel.begin(),mch);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rax
cmpq (%rsi), %rax
jne 0xbac6
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb3ef
movq (%r14), %rcx
movq 0x8(%r14), %rax
subq %rcx, %rax
cmpq $0x8, %rax
jbe 0xbb97
movl (%rcx), %eax
movl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jg 0xbb97
movl 0x6c(%rbx), %edx
addl %edx, %ecx
movslq %ecx, %rsi
movq (%rbx), %rcx
movq 0x8(%rbx), %rdi
subq %rcx, %rdi
sarq $0x6, %rdi
cmpq %rsi, %rdi
jbe 0xbb97
addl %edx, %eax
incl %edx
movl %edx, 0x6c(%rbx)
cltq
shlq $0x6, %rax
movl 0x18(%rcx,%rax), %ebp
movl 0x1c(%rcx,%rax), %r15d
movl %r15d, %eax
imull %ebp, %eax
movslq %eax, %rsi
xorl %r12d, %r12d
leaq 0xe(%rsp), %rdx
movw %r12w, (%rdx)
leaq 0x10(%rsp), %r14
leaq 0xd(%rsp), %rcx
movq %r14, %rdi
callq 0xe312
movl %ebp, 0x18(%r14)
movl %r15d, 0x1c(%r14)
movl $0x10000, 0x20(%r14)    # imm = 0x10000
movl $0x1, 0x28(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x2c(%r14)
movl $0xffffffff, 0x3c(%r14) # imm = 0xFFFFFFFF
movw %r12w, 0x24(%r14)
movq (%rbx), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0xdf1c
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xbbac
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
jmp 0xbbac
leaq 0x1a259(%rip), %rdi     # 0x25df7
xorl %eax, %eax
callq 0x3796
movb $0x1, 0xa8(%rbx)
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xbbd3
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x35a0
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/transform/2dmatch.h
// Function: matches(Image&, int, int, int, int, int, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>&, bool)
bool matches(Image &img, int c0, int cn, int x, int y, int z, offsets &ot, bool newmatch) {
    int x2 = x+ot[z].first;
    int y2 = y+ot[z].second;
    if (y2<0 || x2<0) return false;
    if (x2 >= img.channel[c0].w) return false;
    if (newmatch && img.channel[0].value(y,x)) return false;
    for (int c=c0; c<=cn; c++)
        if (img.channel[c].value(y,x) != img.channel[c].value(y2,x2)) return false;
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x30(%rsp), %rax
movslq %r9d, %r10
movq (%rax), %rax
movl (%rax,%r10,8), %r9d
addl %ecx, %r9d
movl 0x4(%rax,%r10,8), %r10d
addl %r8d, %r10d
movl %r10d, %eax
orl %r9d, %eax
js 0xbc4d
movslq %esi, %r11
movq (%rdi), %rbx
movq %r11, %r14
shlq $0x6, %r14
cmpl 0x18(%rbx,%r14), %r9d
jge 0xbc4d
cmpb $0x0, 0x38(%rsp)
je 0xbc5a
movl 0x18(%rbx), %eax
imull %r8d, %eax
addl %ecx, %eax
cltq
movq (%rbx), %rdi
movq 0x8(%rbx), %r15
subq %rdi, %r15
sarq %r15
leaq 0x24(%rbx), %r12
cmpq %rax, %r15
leaq (%rdi,%rax,2), %rax
cmovbeq %r12, %rax
cmpw $0x0, (%rax)
je 0xbc5a
xorl %eax, %eax
andb $0x1, %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl %edx, %esi
setg %al
jg 0xbc4f
movslq %edx, %rdi
addq %r14, %rbx
addq $0x24, %rbx
subl %esi, %edx
incl %edx
movl -0xc(%rbx), %esi
movl %esi, %ebp
imull %r8d, %ebp
addl %ecx, %ebp
movslq %ebp, %r14
movq -0x24(%rbx), %r15
movq -0x1c(%rbx), %r12
subq %r15, %r12
sarq %r12
cmpq %r14, %r12
leaq (%r15,%r14,2), %r14
cmovbeq %rbx, %r14
imull %r10d, %esi
addl %r9d, %esi
movslq %esi, %rsi
cmpq %rsi, %r12
leaq (%r15,%rsi,2), %rsi
cmovbeq %rbx, %rsi
movzwl (%r14), %ebp
cmpw (%rsi), %bp
jne 0xbc4f
cmpq %rdi, %r11
leaq 0x1(%r11), %r11
setge %al
addq $0x40, %rbx
decl %edx
jne 0xbc6f
jmp 0xbc4f
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/transform/approximate.h
// Function: meta_approximate(Image&, std::vector<int, std::allocator<int>>&)
void meta_approximate(Image &image, std::vector<int> &parameters) {
    if (parameters.size() < 3) {
        e_printf("Incorrect number of parameters for Approximation transform.\n");
        image.error = true;
        return;
    }
    int nb = parameters[1] - parameters[0] + 1;
    if (nb < 1 || parameters[0] < 0 || parameters[1] >= image.channel.size()) {
        e_printf("Incorrect parameters for Approximation transform.\n");
        image.error = true;
        return;
    }
    for (int c = parameters[0]; c <= parameters[1]; c++) {
        int q = (c+2-parameters[0] < parameters.size() ? parameters[c+2-parameters[0]] : parameters.back());
        if (q) image.channel.push_back(image.channel[c]);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %rcx
movq 0x8(%rsi), %rax
subq %rcx, %rax
cmpq $0x9, %rax
jae 0xd62a
leaq 0x18ba8(%rip), %rdi     # 0x261cd
jmp 0xd6bf
movslq 0x4(%rcx), %rax
movl (%rcx), %r15d
cmpl %r15d, %eax
setl %cl
testl %r15d, %r15d
sets %dl
orb %cl, %dl
leaq 0x18bc4(%rip), %rdi     # 0x2620a
jne 0xd6bf
movq 0x8(%rbx), %rcx
subq (%rbx), %rcx
sarq $0x6, %rcx
cmpq %rax, %rcx
jbe 0xd6bf
movq %rsi, %r14
movq (%rsi), %rax
cmpl 0x4(%rax), %r15d
jg 0xd6cd
leal 0x2(%r15), %r12d
shlq $0x6, %r15
movl %r12d, %ecx
subl (%rax), %ecx
movslq %ecx, %rcx
movq 0x8(%r14), %rdx
movq %rdx, %rsi
subq %rax, %rsi
sarq $0x2, %rsi
addq $-0x4, %rdx
cmpq %rcx, %rsi
leaq (%rax,%rcx,4), %rax
cmovbeq %rdx, %rax
cmpl $0x0, (%rax)
je 0xd6a4
movq (%rbx), %rsi
addq %r15, %rsi
movq %rbx, %rdi
callq 0xde30
movq (%r14), %rax
leal 0x1(%r12), %ecx
addl $-0x2, %r12d
addq $0x40, %r15
cmpl %r12d, 0x4(%rax)
movl %ecx, %r12d
jg 0xd66c
jmp 0xd6cd
xorl %eax, %eax
callq 0x3796
movb $0x1, 0xa8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/transform/transform.cpp
// Function: Transform::apply(Image&, bool)
bool Transform::apply(Image &input, bool inverse) {
    switch(ID) {
        case TRANSFORM_YCbCr: return YCbCr(input, inverse);
        case TRANSFORM_ChromaSubsample: return subsample(input, inverse, parameters);
        case TRANSFORM_DCT: return DCT(input, inverse, parameters);
        case TRANSFORM_QUANTIZE: return quantize(input, inverse, parameters);
        case TRANSFORM_YCoCg: return YCoCg(input, inverse);
//        case TRANSFORM_XYB: return XYB(input, inverse);
        case TRANSFORM_SQUEEZE: return squeeze(input, inverse, parameters);
        case TRANSFORM_PALETTE: return palette(input, inverse, parameters);
        case TRANSFORM_2DMATCH: return match(input, inverse, parameters);
        case TRANSFORM_PERMUTE: return permute(input, inverse, parameters);
        case TRANSFORM_APPROXIMATE: return approximate(input, inverse, parameters);
        default: e_printf("Unknown transformation (ID=%i)\n",ID); return false;
    }
}

// Assembly:
pushq %rbx
movl (%rdi), %eax
cmpq $0xa, %rax
ja 0xda1e
movl %edx, %ebx
movq %rdi, %rdx
leaq 0x1792d(%rip), %rcx     # 0x252d0
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
jmpq *%rdi
movq %rsi, %rdi
testb %bl, %bl
je 0xda7e
popq %rbx
jmp 0x3d3c
addq $0x8, %rdx
movzbl %bl, %eax
movq %rsi, %rdi
movl %eax, %esi
callq 0x7570
jmp 0xdaa9
addq $0x8, %rdx
movzbl %bl, %eax
movq %rsi, %rdi
movl %eax, %esi
popq %rbx
jmp 0x9b4b
movq %rsi, %rdi
testb %bl, %bl
je 0xda84
popq %rbx
jmp 0x4101
addq $0x8, %rdx
movzbl %bl, %eax
movq %rsi, %rdi
movl %eax, %esi
callq 0xb0c0
jmp 0xdaa7
addq $0x8, %rdx
movzbl %bl, %eax
movq %rsi, %rdi
movl %eax, %esi
popq %rbx
jmp 0xcb0b
leaq 0x188a0(%rip), %rdi     # 0x262c5
xorl %ebx, %ebx
movl %eax, %esi
xorl %eax, %eax
callq 0x3796
jmp 0xdaa9
addq $0x8, %rdx
movq %rsi, %rdi
movq %rdx, %rsi
testb %bl, %bl
je 0xda8a
popq %rbx
jmp 0x7e0b
testb %bl, %bl
je 0xda91
movq %rsi, %rdi
callq 0x8b26
jmp 0xdaa7
addq $0x8, %rdx
movq %rsi, %rdi
movq %rdx, %rsi
testb %bl, %bl
je 0xdaa2
callq 0xd34c
jmp 0xdaa7
addq $0x8, %rdx
movq %rsi, %rdi
movq %rdx, %rsi
testb %bl, %bl
je 0xdaad
callq 0xcb87
jmp 0xdaa7
popq %rbx
jmp 0x66c0
popq %rbx
jmp 0x8daa
callq 0x8477
jmp 0xdaa7
addq $0x8, %rdx
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x8c5c
jmp 0xdaa7
callq 0xd6d9
movb $0x1, %bl
movl %ebx, %eax
popq %rbx
retq
popq %rbx
jmp 0xd000
nop
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/transform/transform.cpp
// Function: Transform::meta_apply(Image&)
void Transform::meta_apply(Image &input) {
    switch(ID) {
        case TRANSFORM_YCbCr: return;
        case TRANSFORM_YCoCg: return;
//        case TRANSFORM_XYB: return;
        case TRANSFORM_ChromaSubsample: meta_subsample(input, parameters); return;
        case TRANSFORM_DCT: meta_DCT(input, parameters); return;
        case TRANSFORM_QUANTIZE: return;
        case TRANSFORM_SQUEEZE: meta_squeeze(input, parameters); return;
        case TRANSFORM_PALETTE: meta_palette(input, parameters); return;
        case TRANSFORM_2DMATCH: meta_match(input, parameters); return;
        case TRANSFORM_PERMUTE: meta_permute(input, parameters); return;
        case TRANSFORM_APPROXIMATE: meta_approximate(input, parameters); return;
        default: e_printf("Unknown transformation (ID=%i)\n",ID); return;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movl (%rdi), %esi
cmpq $0xa, %rsi
ja 0xdb63
movq %rdi, %rax
leaq 0x17826(%rip), %rcx     # 0x252fc
movslq (%rcx,%rsi,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
leaq 0x28(%rsp), %r15
addq $0x8, %rax
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x641c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x74b5
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xdbe4
movq 0x28(%rsp), %rsi
jmp 0xdbdc
addq $0x8, %rax
movq %rbx, %rdi
movq %rax, %rsi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xaef0
addq $0x8, %rax
movq %rbx, %rdi
movq %rax, %rsi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xbaa0
addq $0x8, %rax
movq %rbx, %rdi
movq %rax, %rsi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x7b7e
leaq 0x1875b(%rip), %rdi     # 0x262c5
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x3796
addq $0x8, %rax
movq %rbx, %rdi
movq %rax, %rsi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xd603
addq $0x8, %rax
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xcdec
leaq 0x10(%rsp), %r15
addq $0x8, %rax
movq %rsp, %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x641c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x939d
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xdbe4
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
jmp 0xdbff
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xdc0f
movq (%r15), %rsi
subq %rdi, %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x35a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/maniac/chance.cpp
// Function: build_table(unsigned short (*) [2], unsigned int, unsigned int)
void build_table(uint16_t newchances[4096][2], uint32_t factor, unsigned int max_p) {
    const int64_t one = 1LL << 32;
    const int size = 4096;
    int64_t p;
    unsigned int last_p8, p8;
    unsigned int i;

    memset(newchances,0,sizeof(uint16_t) * size * 2);

    last_p8 = 0;
    p = one / 2;
    for (i = 0; i < size / 2; i++) {
        p8 = (size * p + one / 2) >> 32; //FIXME try without the one
        if (p8 <= last_p8) p8 = last_p8 + 1;
        if (last_p8 && last_p8 < size && p8 <= max_p) newchances[last_p8][1] = p8;

        p += ((one - p) * factor + one / 2) >> 32;
        last_p8 = p8;
    }

    for (i = size - max_p; i <= max_p; i++) {
        if (newchances[i][1]) continue;

        p = (i * one + size / 2) / size;
        p += ((one - p) * factor + one / 2) >> 32;
        p8 = (size * p + one / 2) >> 32; //FIXME try without the one
        if (p8 <= i) p8 = i + 1;
        if (p8 > max_p) p8 = max_p;
        newchances[i][1] = p8;
    }

    for (i = 1; i < size; i++)
        newchances[i][0] = size - newchances[size - i][1];

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movabsq $0x100000000, %r15      # imm = 0x100000000
xorl %r12d, %r12d
movl $0x4000, %edx           # imm = 0x4000
xorl %esi, %esi
callq 0x3180
movl %r14d, %eax
movl $0x80000000, %ecx       # imm = 0x80000000
movl $0x800, %edx            # imm = 0x800
movq %rcx, %rdi
shlq $0xc, %rdi
subq $-0x80000000, %rdi      # imm = 0x80000000
shrq $0x20, %rdi
leal 0x1(%r12), %esi
cmpl %edi, %r12d
cmovbl %edi, %esi
leal -0x1000(%r12), %edi
cmpl $0xfffff001, %edi       # imm = 0xFFFFF001
setb %dil
cmpl %ebp, %esi
seta %r8b
orb %dil, %r8b
jne 0x10674
movl %r12d, %edi
movw %si, 0x2(%rbx,%rdi,4)
movq %r15, %rdi
subq %rcx, %rdi
imulq %rax, %rdi
subq $-0x80000000, %rdi      # imm = 0x80000000
sarq $0x20, %rdi
addq %rdi, %rcx
movl %esi, %r12d
decl %edx
jne 0x10632
movl $0x1000, %ecx           # imm = 0x1000
subl %ebp, %ecx
cmpl %ebp, %ecx
ja 0x106ed
movl %ecx, %ecx
cmpw $0x0, 0x2(%rbx,%rcx,4)
jne 0x106e9
movq %rcx, %rdx
shlq $0x14, %rdx
movq %r15, %rsi
subq %rdx, %rsi
imulq %rax, %rsi
subq $-0x80000000, %rsi      # imm = 0x80000000
sarq $0x20, %rsi
addq %rdx, %rsi
shlq $0xc, %rsi
subq $-0x80000000, %rsi      # imm = 0x80000000
shrq $0x20, %rsi
leal 0x1(%rcx), %edx
cmpl %esi, %ecx
cmovbl %esi, %edx
cmpl %ebp, %edx
jb 0x106e4
movl %ebp, %edx
movw %dx, 0x2(%rbx,%rcx,4)
incl %ecx
jmp 0x1069a
leaq 0x4(%rbx), %rax
movl $0x3ffe, %ecx           # imm = 0x3FFE
movw $0x1000, %dx            # imm = 0x1000
subw (%rbx,%rcx), %dx
movw %dx, (%rax)
addq $0x4, %rax
addq $-0x4, %rcx
cmpq $0x2, %rcx
jne 0x106f6
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/encoding.cpp
// Function: check_bit_depth(short, short, int)
bool check_bit_depth(pixel_type minv, pixel_type maxv, int predictor) {
    pixel_type maxav = abs(maxv);
    if (-minv > maxav) maxav = -minv;
    if (predictor>0 && maxv-minv > maxav) maxav = maxv-minv;
    if (predictor>0 && abs(minv-maxv) > maxav) maxav = abs(minv-maxv);
    if (maniac::util::ilog2(maxav)+1 > MAX_BIT_DEPTH) {
        e_printf("Erorr: this FUIF is compiled for a maximum bit depth of %i, while %i bits are needed to encode this channel (range=%i..%i, predictor=%i)\n",
                MAX_BIT_DEPTH, maniac::util::ilog2(maxav)+1, minv, maxv, predictor);
        return false;
    }
    return true;
}

// Assembly:
movl %edx, %r9d
movl %esi, %r8d
movl %esi, %edx
negl %edx
cmovsl %esi, %edx
movl %edi, %ecx
movl %edi, %eax
negl %eax
movswl %dx, %esi
cmpl %eax, %esi
cmovgel %edx, %eax
testl %r9d, %r9d
jle 0x11325
movl %r8d, %edx
subl %ecx, %edx
movswl %ax, %esi
cmpl %esi, %edx
cmovgl %edx, %eax
testl %r9d, %r9d
jle 0x1133e
movl %ecx, %edx
subl %r8d, %edx
movl %edx, %esi
negl %esi
cmovsl %edx, %esi
movswl %ax, %edx
cmpl %edx, %esi
cmovgl %esi, %eax
pushq %rbx
movl %eax, %edx
shll $0x10, %edx
cwtl
bsrl %eax, %ebx
testl %edx, %edx
cmovel %edx, %ebx
cmpl $0xf, %ebx
jb 0x11368
leal 0x1(%rbx), %edx
leaq 0x1510c(%rip), %rdi     # 0x26468
movl $0xf, %esi
xorl %eax, %eax
callq 0x3796
cmpl $0xf, %ebx
setb %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/encoding.cpp
// Function: inv_permute_meta(Image&)
void inv_permute_meta(Image &input) {
    v_printf(5,"Permutation (Meta): ");
    std::vector<Channel> inchannel = input.channel;
    for (int i=0; i<input.channel[0].w; i++) {
        int c = input.channel[0].value(0,i);
        if (c < 0 || c >= input.channel[0].w) {
            e_printf("Invalid permutation: %i is not a channel number\n",c);
            input.error=true;
            return;
        }
        for (int j=0; j<i; j++) if (input.channel[0].value(0,i) == input.channel[0].value(0,j)) {
            e_printf("Invalid permutation: both %i and %i map from channel number %i\n",i,j,input.channel[0].value(0,i));
            input.error=true;
            return;
        }
        input.channel[input.nb_meta_channels+c] = inchannel[input.nb_meta_channels+i];
        v_printf(5,"[%i -> %i] ",i,c);
    }
    v_printf(5,"\n");
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x15079(%rip), %rsi     # 0x26560
movl $0x5, %edi
xorl %eax, %eax
callq 0x1d0d6
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xe196
movq (%rbx), %rax
movl 0x18(%rax), %edx
testl %edx, %edx
jle 0x115da
leaq 0x14b28(%rip), %r15     # 0x2603b
xorl %r14d, %r14d
movq (%rax), %rcx
movq 0x8(%rax), %rsi
subq %rcx, %rsi
sarq %rsi
addq $0x24, %rax
cmpq %r14, %rsi
leaq (%rcx,%r14,2), %rdi
cmovbeq %rax, %rdi
movswl (%rdi), %ebp
testl %ebp, %ebp
js 0x11620
cmpl %ebp, %edx
jle 0x11620
testq %r14, %r14
je 0x1156b
xorl %edx, %edx
cmpq %rdx, %rsi
movq %rax, %rdi
cmovaq %rcx, %rdi
cmpw (%rdi), %bp
je 0x115ef
incq %rdx
addq $0x2, %rcx
cmpq %rdx, %r14
jne 0x1154c
movl 0x6c(%rbx), %eax
leal (%r14,%rax), %ecx
movslq %ecx, %r12
shlq $0x6, %r12
addq (%rsp), %r12
addl %ebp, %eax
movslq %eax, %r13
shlq $0x6, %r13
addq (%rbx), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0xe65e
movq 0x38(%r12), %rax
movq %rax, 0x38(%r13)
movups 0x18(%r12), %xmm0
movups 0x28(%r12), %xmm1
movups %xmm1, 0x28(%r13)
movups %xmm0, 0x18(%r13)
movl $0x5, %edi
movq %r15, %rsi
movl %r14d, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1d0d6
incq %r14
movq (%rbx), %rax
movslq 0x18(%rax), %rdx
cmpq %rdx, %r14
jl 0x11516
leaq 0x163a5(%rip), %rsi     # 0x27986
movl $0x5, %edi
xorl %eax, %eax
callq 0x1d0d6
jmp 0x11609
leaq 0x14a05(%rip), %rdi     # 0x25ffb
movl %r14d, %esi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x3796
movb $0x1, 0xa8(%rbx)
movq %rsp, %rdi
callq 0xe220
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x14ac6(%rip), %rdi     # 0x260ed
movl %ebp, %esi
xorl %eax, %eax
callq 0x3796
jmp 0x11602
jmp 0x11638
jmp 0x11638
jmp 0x11638
movq %rax, %rbx
movq %rsp, %rdi
callq 0xe220
movq %rbx, %rdi
callq 0x35a0
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/encoding.cpp
// Function: fuif_encode_file(char const*, Image const&, fuif_options&)
bool fuif_encode_file(const char * filename, const Image &image, fuif_options &options) {
    FILE *file = NULL;
    if (!strcmp(filename,"-")) file = stdout;
    else file = fopen(filename,"wb");
    if (!file) return false;
    FileIO fio(file, (file == stdout? "to standard output" : filename));
    bool result = fuif_encode(fio, image, options);
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x153f5(%rip), %rsi     # 0x26a59
callq 0x33e0
testl %eax, %eax
je 0x1167e
leaq 0x153e7(%rip), %rsi     # 0x26a5b
movq %r15, %rdi
callq 0x3370
jmp 0x11688
movq 0x1e923(%rip), %rax     # 0x2ffa8
movq (%rax), %rax
testq %rax, %rax
je 0x116d3
movq 0x1e914(%rip), %rcx     # 0x2ffa8
cmpq (%rcx), %rax
leaq 0x153c0(%rip), %rcx     # 0x26a5e
cmoveq %rcx, %r15
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
movq %r15, 0x8(%rdi)
movl $0xffffffff, 0x10(%rdi) # imm = 0xFFFFFFFF
movq %r14, %rsi
movq %rbx, %rdx
callq 0x118ec
movl %eax, %ebx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x116d5
callq 0x32a0
jmp 0x116d5
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x116f3
callq 0x32a0
movq %rbx, %rdi
callq 0x35a0
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/encoding.cpp
// Function: fuif_prepare_encode(Image&, fuif_options&)
void fuif_prepare_encode(Image &image, fuif_options &options) {
    // ensure that the ranges are correct and tight
    image.recompute_minmax();
    // inspect the cumulative channel hshift/vshift to find the right spots to put the truncation offsets
    image.recompute_downscales();
    if (options.debug) {options.heatmap.channel = image.channel; options.heatmap.w = image.w; options.heatmap.h = image.h;}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x13bb0
movq %r14, %rdi
callq 0x6344
cmpb $0x1, 0x24(%rbx)
jne 0x1172c
leaq 0x40(%rbx), %rdi
movq %r14, %rsi
callq 0x18358
movq 0x30(%r14), %rax
movq %rax, 0x70(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/encoding.cpp
// Function: fuif_decode_file(char const*, Image&, fuif_options)
bool fuif_decode_file(const char * filename, Image &image, fuif_options options) {
    FILE *file = NULL;
    if (!strcmp(filename,"-")) file = stdin;
    else file = fopen(filename,"rb");
    if(!file) return false;
    FileIO fio(file, (file==stdin ? "from standard input" : filename));
    bool result = fuif_decode(fio, image, options);
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x15309(%rip), %rsi     # 0x26a59
callq 0x33e0
testl %eax, %eax
je 0x1176a
leaq 0x15311(%rip), %rsi     # 0x26a71
movq %r15, %rdi
callq 0x3370
jmp 0x11774
movq 0x1e85f(%rip), %rax     # 0x2ffd0
movq (%rax), %rax
testq %rax, %rax
je 0x1183c
movq 0x1e84c(%rip), %rcx     # 0x2ffd0
cmpq (%rcx), %rax
leaq 0x152e6(%rip), %rcx     # 0x26a74
cmoveq %rcx, %r15
movq %rax, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movl $0xffffffff, 0x18(%rsp) # imm = 0xFFFFFFFF
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x184ee
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
movq %rbx, %rsi
callq 0x14676
movl %eax, %ebx
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x117e2
movq 0xe8(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
leaq 0x60(%rsp), %r14
movq 0x40(%r14), %rdi
testq %rdi, %rdi
je 0x11800
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
leaq 0x78(%rsp), %r15
movq %r15, %rdi
callq 0xe808
movq %r14, %rdi
callq 0xe220
movq -0x30(%r15), %rdi
testq %rdi, %rdi
je 0x1182b
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1183e
callq 0x32a0
jmp 0x1183e
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x11876
jmp 0x1185f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1186e
callq 0x32a0
movq %rbx, %rdi
callq 0x35a0
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/encoding.cpp
// Function: void write_big_endian_varint<FileIO>(FileIO&, unsigned long, bool)
void write_big_endian_varint(IO& io, size_t number, bool done = true) {
    if (number < 128) {
        if (done) io.fputc(number);
        else io.fputc(number + 128);
    } else {
        size_t lsb = (number & 127);
        number >>= 7;
        write_big_endian_varint(io, number, false);
        write_big_endian_varint(io, lsb, done);
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rdi, %rbx
cmpq $0x7f, %rsi
jbe 0x122eb
movl %esi, %r14d
andl $0x7f, %r14d
shrq $0x7, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x122c2
movq %r14, %rsi
jmp 0x122cb
testb %bpl, %bpl
jne 0x122f6
orl $0x80, %esi
movq (%rbx), %rax
movl %esi, %edi
movq %rax, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x33a0
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/../fileio.h
// Function: BlobIO::fputs(char const*)
int fputs(const char *s) {
        size_t i = 0;
        // null-terminated string
        while(s[i])
        {
            grow(seek_pos + 1);
            data[seek_pos++] = s[i++];
            if(bytes_used < seek_pos)
                bytes_used = seek_pos+1;
        }
        return 0;
    }

// Assembly:
cmpb $0x0, (%rsi)
je 0x14631
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
incq %r14
movq 0x18(%rbx), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x18630
movb -0x1(%r14), %al
movq (%rbx), %rcx
movq 0x18(%rbx), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x18(%rbx)
movb %al, (%rcx,%rdx)
movq 0x18(%rbx), %rax
cmpq %rax, 0x10(%rbx)
jae 0x14620
incq %rax
movq %rax, 0x10(%rbx)
cmpb $0x0, (%r14)
leaq 0x1(%r14), %r14
jne 0x145ea
addq $0x8, %rsp
popq %rbx
popq %r14
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/../fileio.h
// Function: BlobIO::fputc(int)
int fputc(int c) {
        grow(seek_pos + 1);

        data[seek_pos++] = static_cast<uint8_t>(c);
        if(bytes_used < seek_pos)
            bytes_used = seek_pos+1;
        return c;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq 0x18(%rdi), %rsi
incq %rsi
callq 0x18630
movq (%r14), %rax
movq 0x18(%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x18(%r14)
movb %bl, (%rax,%rcx)
movq 0x18(%r14), %rax
cmpq %rax, 0x10(%r14)
jae 0x1466c
incq %rax
movq %rax, 0x10(%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/encoding.cpp
// Function: int read_big_endian_varint<FileIO>(FileIO&)
int read_big_endian_varint(IO& io) {
    int result = 0;
    int bytes_read = 0;
    while (bytes_read++ < 10) {
      int number = io.get_c();
      if (number < 0) break;
      if (number < 128) return result+number;
      number -= 128;
      result += number;
      result <<= 7;
    }
    if (!io.isEOF()) e_printf("Invalid number encountered!\n");
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %ebp, %ebp
movl $0xb, %r15d
decl %r15d
je 0x1510c
movq (%r14), %rdi
callq 0x34c0
testl %eax, %eax
js 0x150ef
cmpl $0x7f, %eax
jg 0x150f6
addl %ebp, %eax
movl $0x1, %ecx
movl %eax, %ebx
jmp 0x15103
movl $0x3, %ecx
jmp 0x15103
addl %eax, %ebp
shll $0x7, %ebp
addl $0xffffc000, %ebp       # imm = 0xFFFFC000
xorl %ecx, %ecx
testl %ecx, %ecx
je 0x150ce
cmpl $0x3, %ecx
jne 0x1512b
movq (%r14), %rdi
callq 0x3480
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x1512b
leaq 0x11b0c(%rip), %rdi     # 0x26c30
xorl %eax, %eax
callq 0x3796
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/../fileio.h
// Function: BlobIO::grow(unsigned long)
void grow(size_t necessary_size) {
        if(necessary_size < data_array_size)
            return;

        size_t new_size = necessary_size;
        // start with reasonably large array
        if(new_size < 4096)
            new_size = 4096;

        if(new_size < data_array_size * 3 / 2)
            new_size = data_array_size * 3 / 2;
        uint8_t* new_data = new uint8_t[new_size];

        memcpy(new_data, data, bytes_used);
        // if seek_pos has been moved beyond the written bytes,
        // fill the empty space with zeroes
        for(size_t i = bytes_used; i < seek_pos; ++i)
            new_data[i] = 0;
        delete [] data;
        data = new_data;
        std::swap(data_array_size, new_size);
    }

// Assembly:
movq 0x8(%rdi), %rax
cmpq %rsi, %rax
ja 0x186b6
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq (%rax,%rax,2), %rax
shrq %rax
cmpq %rax, %rsi
cmovaq %rsi, %rax
cmpq $0x1001, %rax           # imm = 0x1001
movl $0x1000, %r14d          # imm = 0x1000
cmovaeq %rax, %r14
movq %r14, %rdi
callq 0x3040
movq %rax, %r15
movq (%rbx), %r12
movq 0x10(%rbx), %r13
movq %rax, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3260
movq 0x18(%rbx), %rdx
subq %r13, %rdx
jbe 0x18699
addq %r15, %r13
movq %r13, %rdi
xorl %esi, %esi
callq 0x3180
testq %r12, %r12
je 0x186a6
movq %r12, %rdi
callq 0x33b0
movq %r15, (%rbx)
movq %r14, 0x8(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/../maniac/symbol_enc.h
// Function: UniformSymbolCoder<RacOutput24<BlobIO>>::write_int(int, int, int)
void UniformSymbolCoder<RAC>::write_int(int min, int max, int val) {
        assert(max >= min);
        if (min != 0) {
            max -= min;
            val -= min;
        }
        if (max == 0) return;

        // split in [0..med] [med+1..max]
        int med = max/2;
        if (val > med) {
            rac.write_bit(true);
            write_int(med+1, max, val);
        } else {
            rac.write_bit(false);
            write_int(0, med, val);
        }
        return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ebp
movq %rdi, %r14
subl %esi, %ebp
je 0x18a01
subl %esi, %ebx
movl %ebp, %r15d
shrl $0x1f, %r15d
addl %ebp, %r15d
sarl %r15d
movq (%r14), %rdi
movq 0x8(%rdi), %rax
movq %rax, %rcx
shrq %rcx
subq %rcx, %rax
cmpl %r15d, %ebx
jle 0x189f1
addq %rax, 0x10(%rdi)
movq %rcx, 0x8(%rdi)
callq 0x18a0c
incl %r15d
movl %r15d, %esi
jmp 0x189b4
movq %rax, 0x8(%rdi)
callq 0x18a0c
xorl %esi, %esi
movl %r15d, %ebp
jmp 0x189b4
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/../maniac/rac_enc.h
// Function: RacOutput<RacConfig24, BlobIO>::output()
void inline output() {
        while (range <= Config::MIN_RANGE) {
            int byte = low >> Config::MIN_RANGE_BITS;
            if (delayed_byte < 0) { // first generated byte
                delayed_byte = byte;
            } else if (((low + range) >> 8) < Config::MIN_RANGE) { // definitely no overflow
                io.fputc(delayed_byte);
                while (delayed_count) {
                    io.fputc(0xFF);
                    delayed_count--;
                }
                delayed_byte = byte;
            } else if ((low >> 8) >= Config::MIN_RANGE) { // definitely overflow
                io.fputc(delayed_byte + 1);
                while (delayed_count) {
                    io.fputc(0);
                    delayed_count--;
                }
                delayed_byte = byte & 0xFF;
            } else {
                delayed_count++;
            }
            low = (low & (Config::MIN_RANGE - 1)) << 8;
            range <<= 8;
        }
    }

// Assembly:
movq 0x8(%rdi), %rax
cmpq $0x10000, %rax          # imm = 0x10000
ja 0x18ac4
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rbx), %rcx
movq %rcx, %r14
shrq $0x10, %r14
movl 0x18(%rbx), %esi
testl %esi, %esi
js 0x18a60
addq %rcx, %rax
cmpq $0xffffff, %rax         # imm = 0xFFFFFF
ja 0x18a87
movq (%rbx), %rdi
callq 0x14634
cmpl $0x0, 0x1c(%rbx)
je 0x18a60
movq (%rbx), %rdi
movl $0xff, %esi
callq 0x14634
decl 0x1c(%rbx)
jne 0x18a4e
movl %r14d, 0x18(%rbx)
movl 0x10(%rbx), %eax
movzwl %ax, %eax
shll $0x8, %eax
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rax
shlq $0x8, %rax
movq %rax, 0x8(%rbx)
cmpq $0x10001, %rax          # imm = 0x10001
jb 0x18a23
jmp 0x18abd
cmpq $0x1000000, %rcx        # imm = 0x1000000
jb 0x18ab8
movq (%rbx), %rdi
incl %esi
callq 0x14634
cmpl $0x0, 0x1c(%rbx)
je 0x18aaf
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x14634
decl 0x1c(%rbx)
jne 0x18aa0
movzbl %r14b, %eax
movl %eax, 0x18(%rbx)
jmp 0x18a64
incl 0x1c(%rbx)
jmp 0x18a64
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/../maniac/compound_enc.h
// Function: PropertySymbolCoder<SimpleBitChance, RacDummy<DummyIO>, 15>::PropertySymbolCoder(RacDummy<DummyIO>&, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>&, Tree&, int, int, int, int)
PropertySymbolCoder(RAC& racIn, Ranges &rangeIn, Tree &treeIn, int zero_chance=ZERO_CHANCE, int st=CONTEXT_TREE_SPLIT_THRESHOLD, int cut = 2, int alpha = 0xFFFFFFFF / 19) :
        rac(racIn),
        coder(racIn, cut, alpha),
        range(rangeIn),
        nb_properties(range.size()),
        leaf_node(1,CompoundSymbolChances<BitChance,bits>(nb_properties,zero_chance)),
        inner_node(treeIn),
        selection(nb_properties,false),
        split_threshold(st) {

/*        leaf_node[0].realChances.bitZero().set_12bit(zero_chance);
        for(unsigned int i=0; i<nb_properties; i++) {
            leaf_node[0].virtChances[i].first.bitZero().set_12bit(zero_chance);
            leaf_node[0].virtChances[i].second.bitZero().set_12bit(zero_chance);
        }
*/
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %r9d, %ebp
movl %r8d, %r12d
movq %rcx, %r15
movq %rdx, %r13
movq %rdi, %rbx
movl 0xe8(%rsp), %eax
movq %rsi, (%rdi)
movq %rsi, 0x8(%rdi)
addq $0x10, %rdi
movl %eax, 0x4010(%rbx)
movl $0x1000, %edx           # imm = 0x1000
subl 0xe0(%rsp), %edx
movl %eax, %esi
callq 0x105fc
leaq 0x4018(%rbx), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x18d8a
movq 0x4020(%rbx), %rsi
subq 0x4018(%rbx), %rsi
shrq $0x3, %rsi
movl %esi, 0x4030(%rbx)
movzwl %r12w, %edx
leaq 0x10(%rsp), %rdi
callq 0x18e00
leaq 0x4038(%rbx), %r12
leaq 0x10(%rsp), %rdx
leaq 0xf(%rsp), %rcx
movl $0x1, %esi
movq %r12, %rdi
callq 0x18f36
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x18bb6
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x18bd0
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x18be7
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq %r15, 0x4050(%rbx)
leaq 0x4058(%rbx), %rdi
movl 0x4030(%rbx), %esi
leaq 0x10(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0xf(%rsp), %rcx
callq 0x1901a
movl %ebp, 0x4080(%rbx)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq %r12, %rdi
callq 0x19082
jmp 0x18c44
movq %rax, %r15
leaq 0x10(%rsp), %rdi
callq 0x18fd0
jmp 0x18c44
movq %rax, %r15
movq (%r14), %rdi
testq %rdi, %rdi
je 0x18c5b
movq 0x4028(%rbx), %rsi
subq %rdi, %rsi
callq 0x32c0
movq %r15, %rdi
callq 0x35a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/../maniac/compound_enc.h
// Function: PropertySymbolCoder<SimpleBitChance, RacDummy<DummyIO>, 15>::write_int(std::vector<int, std::allocator<int>>&, int, int, int)
void write_int(Properties &properties, int min, int max, int val) {
//        CompoundSymbolChances<BitChance,bits> &chances = find_leaf(properties);
//        set_selection_and_update_property_sums(properties,chances);
        CompoundSymbolChances<BitChance,bits> &chances2 = find_leaf(properties);
        coder.write_int(chances2, selection, min, max, val);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %r8d, %ebx
movl %ecx, %ebp
movl %edx, %r14d
movq %rdi, %r15
callq 0x19c7a
cmpl %ebp, %r14d
je 0x18d3c
leaq 0x4058(%r15), %rcx
movq 0x8(%r15), %rdx
addq $0x10, %r15
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
movq %rdx, 0x8(%rdi)
movq %rax, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movl %r14d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x1ad27
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/../maniac/compound_enc.h
// Function: CompoundSymbolChances<SimpleBitChance, 15>::resetCounters()
void resetCounters() {
        best_property = -1;
        realSize = 0;
        count = 0;
        virtPropSum.assign(virtPropSum.size(),0);
        virtSize.assign(virtSize.size(),0);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movw $0xffff, 0x94(%rdi)     # imm = 0xFFFF
xorl %r15d, %r15d
movq %r15, 0x58(%rdi)
movl $0x0, 0x90(%rdi)
movq 0x80(%rdi), %rsi
subq 0x78(%rdi), %rsi
addq $0x78, %rdi
sarq $0x3, %rsi
leaq 0x8(%rsp), %r14
movq %r15, (%r14)
movq %r14, %rdx
callq 0x1a2ec
leaq 0x60(%rbx), %rdi
movq 0x68(%rbx), %rsi
subq 0x60(%rbx), %rsi
sarq $0x3, %rsi
movq %r15, (%r14)
leaq 0x8(%rsp), %rdx
callq 0x1a6b8
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/../maniac/compound_enc.h
// Function: PropertySymbolCoder<SimpleBitChance, RacDummy<DummyIO>, 15>::kill_children(int)
void kill_children(int pos) {
        PropertyDecisionNode &n = inner_node[pos];
        if (n.property == -1) n.property = 0;
        else kill_children(n.childID);
        PropertyDecisionNode &n1 = inner_node[pos+1];
        if (n1.property == -1) n1.property = 0;
        else kill_children(n1.childID);
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x4050(%rbx), %rax
movslq %esi, %r14
movq (%rax), %rax
cmpw $-0x1, (%rax,%r14,8)
je 0x1b53a
movzwl 0x2(%rax,%r14,8), %esi
movq %rbx, %rdi
callq 0x1b50e
jmp 0x1b541
movw $0x0, (%rax,%r14,8)
movq 0x4050(%rbx), %rax
movq (%rax), %rax
cmpw $-0x1, 0x8(%rax,%r14,8)
je 0x1b55c
movzwl 0xa(%rax,%r14,8), %esi
jmp 0x1b515
movw $0x0, 0x8(%rax,%r14,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/../maniac/compound_enc.h
// Function: FinalPropertySymbolCoder<SimpleBitChance, RacOutput24<BlobIO>, 15>::estimate_int(std::vector<int, std::allocator<int>> const&, int, int, int)
int FinalPropertySymbolCoder<BitChance,RAC,bits>::estimate_int(const Properties &properties, int min, int max, int val) {
        if (min == max) { assert(val==min); return 0; }
        assert(properties.size() == nb_properties);
        FinalCompoundSymbolChances<BitChance,bits> &chances = find_leaf_readonly(properties);
        return coder.estimate_int(chances, min, max, val);
    }

// Assembly:
xorl %eax, %eax
cmpl %ecx, %edx
je 0x1b87b
subq $0x18, %rsp
movq 0x4030(%rdi), %rax
movq (%rax), %rax
movzwl (%rax), %r10d
cmpw $-0x1, %r10w
je 0x1b83a
movq (%rsi), %rsi
movq %rax, %r9
movswq %r10w, %r10
movl (%rsi,%r10,4), %r10d
xorl %r11d, %r11d
cmpl 0x4(%r9), %r10d
setle %r11b
movzwl 0x2(%r9), %r9d
leaq (%rax,%r9,8), %r9
leaq (%r9,%r11,8), %r9
movzwl (%r9), %r10d
cmpw $-0x1, %r10w
jne 0x1b80d
jmp 0x1b83d
movq %rax, %r9
movzwl 0x2(%r9), %esi
leaq (%rsi,%rsi), %rax
shll $0x6, %esi
subq %rax, %rsi
addq 0x4018(%rdi), %rsi
movq (%rdi), %r9
addq $0x8, %rdi
movq %rsp, %rax
movq %rdi, (%rax)
movq %r9, 0x8(%rax)
movq %rsi, 0x10(%rax)
movq %rax, %rdi
movl %edx, %esi
movl %ecx, %edx
movl %r8d, %ecx
callq 0x1bd3a
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/../maniac/compound_enc.h
// Function: FinalPropertySymbolCoder<SimpleBitChance, RacOutput24<BlobIO>, 15>::write_int(std::vector<int, std::allocator<int>> const&, int, int, int)
void FinalPropertySymbolCoder<BitChance,RAC,bits>::write_int(const Properties &properties, int min, int max, int val) {
        if (min == max) { assert(val==min); return; }
        assert(properties.size() == nb_properties);
        FinalCompoundSymbolChances<BitChance,bits> &chances = find_leaf(properties);
        coder.write_int(chances, min, max, val);
    }

// Assembly:
cmpl %ecx, %edx
je 0x1b911
subq $0x18, %rsp
movq 0x4030(%rdi), %rax
movq (%rax), %rax
movzwl (%rax), %r10d
cmpw $-0x1, %r10w
je 0x1b8d0
movq (%rsi), %rsi
movq %rax, %r9
movswq %r10w, %r10
movl (%rsi,%r10,4), %r10d
xorl %r11d, %r11d
cmpl 0x4(%r9), %r10d
setle %r11b
movzwl 0x2(%r9), %r9d
leaq (%rax,%r9,8), %r9
leaq (%r9,%r11,8), %r9
movzwl (%r9), %r10d
cmpw $-0x1, %r10w
jne 0x1b8a3
jmp 0x1b8d3
movq %rax, %r9
movzwl 0x2(%r9), %esi
leaq (%rsi,%rsi), %rax
shll $0x6, %esi
subq %rax, %rsi
addq 0x4018(%rdi), %rsi
movq (%rdi), %r9
addq $0x8, %rdi
movq %rsp, %rax
movq %rdi, (%rax)
movq %r9, 0x8(%rax)
movq %rsi, 0x10(%rax)
movq %rax, %rdi
movl %edx, %esi
movl %ecx, %edx
movl %r8d, %ecx
callq 0x1be8b
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/../maniac/compound_enc.h
// Function: MetaPropertySymbolCoder<SimpleBitChance, RacOutput24<BlobIO>>::write_subtree(int, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>&, Tree const&)
void MetaPropertySymbolCoder<BitChance,RAC>::write_subtree(int pos, Ranges &subrange, const Tree &tree) {
        const PropertyDecisionNode &n = tree[pos];
        int p = n.property;
        coder[0].write_int2(0,nb_properties,p+1);
        if (p != -1) {
//            coder[1].write_int2(CONTEXT_TREE_MIN_COUNT, CONTEXT_TREE_MAX_COUNT, n.count);
//            printf("From properties 0..%i, split node at PROPERTY %i\n",nb_properties-1,p);
            int oldmin = subrange[p].first;
            int oldmax = subrange[p].second;
            assert(oldmin < oldmax);
            coder[2].write_int2(oldmin, oldmax-1, n.splitval);
//            e_printf( "Pos %i: prop %i splitval %i in [%i..%i]\n", pos, n.property, n.splitval, oldmin, oldmax-1);
            // > splitval
            subrange[p].first = n.splitval+1;
            write_subtree(n.childID, subrange, tree);

            // <= splitval
            subrange[p].first = oldmin;
            subrange[p].second = n.splitval;
            write_subtree(n.childID+1, subrange, tree);

            subrange[p].second = oldmax;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rdi, %r15
movslq %esi, %r12
movq (%rcx), %r13
movswl (%r13,%r12,8), %ebp
movq (%rdi), %rdi
movl 0x30(%r15), %edx
leal 0x1(%rbp), %ecx
xorl %esi, %esi
callq 0x1b9e0
cmpl $-0x1, %ebp
je 0x1b9d0
movslq %ebp, %rbp
movq (%rbx), %rax
movl (%rax,%rbp,8), %esi
movl %esi, 0xc(%rsp)
movl 0x4(%rax,%rbp,8), %eax
movq %rax, 0x10(%rsp)
movl $0x80a0, %edi           # imm = 0x80A0
addq (%r15), %rdi
leal -0x1(%rax), %edx
movl 0x4(%r13,%r12,8), %ecx
callq 0x1b9e0
movl 0x4(%r13,%r12,8), %eax
incl %eax
movq (%rbx), %rcx
movl %eax, (%rcx,%rbp,8)
movzwl 0x2(%r13,%r12,8), %esi
movq %r15, %rdi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x1b912
movq (%rbx), %rax
movl 0xc(%rsp), %ecx
movl %ecx, (%rax,%rbp,8)
movl 0x4(%r13,%r12,8), %ecx
movl %ecx, 0x4(%rax,%rbp,8)
movzwl 0x2(%r13,%r12,8), %esi
incl %esi
movq %r15, %rdi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x1b912
movq (%rbx), %rax
movq 0x10(%rsp), %rcx
movl %ecx, 0x4(%rax,%rbp,8)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/encoding.cpp
// Function: bool corrupt_or_truncated<FileIO>(FileIO&, Channel&, unsigned long)
bool corrupt_or_truncated(IO& io, Channel &channel, size_t bytes_to_load) {
    if (io.isEOF() || (bytes_to_load && io.ftell() >= bytes_to_load)) {
        v_printf(3,"Premature end-of-file detected.\n");
        channel.data = std::vector<pixel_type>(channel.w * channel.h, 0);
        return true;
    } else {
        v_printf(3,"Corruption detected.\n");
        return false;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq (%rdi), %rdi
callq 0x3480
testl %eax, %eax
je 0x1c192
leaq 0xacee(%rip), %rsi      # 0x26e28
movl $0x3, %edi
xorl %eax, %eax
callq 0x1d0d6
movslq 0x18(%rbx), %rax
movslq 0x1c(%rbx), %rsi
imulq %rax, %rsi
leaq 0x6(%rsp), %rdx
movw $0x0, (%rdx)
leaq 0x8(%rsp), %r14
leaq 0x5(%rsp), %rcx
movq %r14, %rdi
callq 0xe312
movq %rbx, %rdi
movq %r14, %rsi
callq 0xfe18
movq (%r14), %rdi
testq %rdi, %rdi
je 0x1c18e
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movb $0x1, %bl
jmp 0x1c1b9
testq %r14, %r14
je 0x1c1a4
movq (%r15), %rdi
callq 0x3030
cmpq %r14, %rax
jae 0x1c133
leaq 0xac9e(%rip), %rsi      # 0x26e49
xorl %ebx, %ebx
movl $0x3, %edi
xorl %eax, %eax
callq 0x1d0d6
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/../maniac/symbol.h
// Function: UniformSymbolCoder<RacInput24<FileIO>>::read_int(int, int)
int read_int(int min, int len) {
        assert(len >= 0);
        if (len == 0) return min;

        // split in [0..med] [med+1..len]
        int med = len/2;
        bool bit = rac.read_bit();
        if (bit) {
            return read_int(min+med+1, len-(med+1));
        } else {
            return read_int(min, med);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movl %esi, %ebx
movq %rdi, %r14
testl %r15d, %r15d
je 0x1c207
movl %r15d, %ebp
shrl $0x1f, %r15d
addl %ebp, %r15d
sarl %r15d
movq (%r14), %rdi
movq 0x8(%rdi), %rsi
shrq %rsi
callq 0x1c4fa
testb %al, %al
je 0x1c1d5
addl %r15d, %ebx
incl %ebx
notl %r15d
addl %ebp, %r15d
jmp 0x1c1d5
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/../maniac/compound.h
// Function: MetaPropertySymbolCoder<SimpleBitChance, RacInput24<FileIO>>::read_tree(Tree&)
bool read_tree(Tree &tree) {
          Ranges rootrange(range);
          tree.clear();
          tree.push_back(PropertyDecisionNode());
          int depth=0;
          if (read_subtree(0, rootrange, tree, depth, 0)) {
            int neededdepth = maniac::util::ilog2(tree.size())+1;
            v_printf(8,"Read MANIAC tree with %u nodes and depth %i (with better balance, depth %i might have been enough).\n",(unsigned int) tree.size(),depth,neededdepth);
            return true;
          } else return false;
          //return read_subtree(0, rootrange, tree);
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x18(%rdi), %rsi
leaq 0x10(%rsp), %rdi
callq 0x18d8a
movq (%r14), %rax
cmpq %rax, 0x8(%r14)
je 0x1c33a
movq %rax, 0x8(%r14)
leaq 0x8(%rsp), %rsi
movq $0xffff, (%rsi)         # imm = 0xFFFF
movq %r14, %rdi
callq 0x1c748
leaq 0x8(%rsp), %r8
movl $0x0, (%r8)
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rcx
xorl %r9d, %r9d
callq 0x1c5c0
movl %eax, %ebx
testb %al, %al
je 0x1c3ac
movq 0x8(%r14), %rdx
subq (%r14), %rdx
shrq $0x3, %rdx
bsrl %edx, %eax
xorl $-0x20, %eax
addl $0x21, %eax
testl %edx, %edx
movl $0x1, %r8d
cmovnel %eax, %r8d
movl 0x8(%rsp), %ecx
leaq 0xaabf(%rip), %rsi      # 0x26e5f
movl $0x8, %edi
xorl %eax, %eax
callq 0x1d0d6
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1c3c3
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
jmp 0x1c3d1
jmp 0x1c3d1
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1c3eb
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x35a0
nop