LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/transform/dct.h
// Function: DCT1d(double const*, int, double*)
void DCT1d(const double* in, int stride, double* out) {
  for (int x = 0; x < 8; ++x) {
    out[x * stride] = 0.0;
    for (int u = 0; u < 8; ++u) {
      out[x * stride] += kDCTMatrix[8 * x + u] * in[u * stride];
    }
  }
}

// Assembly:
movslq %esi, %rax
leaq (,%rax,8), %rcx
leaq 0x1dd7b(%rip), %rsi     # 0x25330
xorl %r8d, %r8d
movq %r8, %r9
imulq %rax, %r9
movq $0x0, (%rdx,%r9,8)
xorpd %xmm0, %xmm0
movq %rdi, %r10
xorl %r11d, %r11d
movsd (%rsi,%r11,8), %xmm1
mulsd (%r10), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, (%rdx,%r9,8)
incq %r11
addq %rcx, %r10
cmpq $0x8, %r11
jne 0x75d1
incq %r8
addq $0x40, %rsi
cmpq $0x8, %r8
jne 0x75b8
retq
// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/transform/dct.h
// Function: IDCT1d(double const*, int, double*)
void IDCT1d(const double* in, int stride, double* out) {
  for (int x = 0; x < 8; ++x) {
    out[x * stride] = 0.0;
    for (int u = 0; u < 8; ++u) {
      out[x * stride] += kDCTMatrix[8 * u + x] * in[u * stride];
    }
  }
}

// Assembly:
movslq %esi, %rax
leaq (,%rax,8), %rcx
leaq 0x1dd1e(%rip), %rsi     # 0x25330
xorl %r8d, %r8d
movq %r8, %r9
imulq %rax, %r9
movq $0x0, (%rdx,%r9,8)
xorpd %xmm0, %xmm0
xorl %r10d, %r10d
movq %rdi, %r11
movsd (%rsi,%r10), %xmm1
mulsd (%r11), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, (%rdx,%r9,8)
addq %rcx, %r11
addq $0x40, %r10
cmpq $0x200, %r10            # imm = 0x200
jne 0x762e
incq %r8
addq $0x8, %rsi
cmpq $0x8, %r8
jne 0x7615
retq
// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/transform/dct.h
// Function: TransformBlock(double*, void (*)(double const*, int, double*))
void TransformBlock(double block[64], Transform1d f) {
  double tmp[64];
  for (int x = 0; x < 8; ++x) {
    f(&block[x], 8, &tmp[x]);
  }
  for (int y = 0; y < 8; ++y) {
    f(&tmp[8 * y], 1, &block[8 * y]);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
leaq (%r14,%r15), %rdi
leaq (%rsp,%r15), %rdx
movl $0x8, %esi
callq *%rbx
addq $0x8, %r15
cmpq $0x40, %r15
jne 0x7676
xorl %r15d, %r15d
leaq (%rsp,%r15), %rdi
leaq (%r14,%r15), %rdx
movl $0x1, %esi
callq *%rbx
addq $0x40, %r15
cmpq $0x200, %r15            # imm = 0x200
jne 0x7692
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/transform/quantize.h
// Function: inv_quantize(Image&, std::vector<int, std::allocator<int>> const&)
bool inv_quantize(Image &input, const std::vector<int> &parameters) {
    for (int c=input.nb_meta_channels; c<input.channel.size(); c++) {
        Channel &ch = input.channel[c];
        if (ch.data.size() == 0) continue;
        int q = ch.q;
        if (q == 1) continue;
        v_printf(3,"De-quantizing channel %i with quantization constant %i\n",c,q);
        for (int y=0; y<ch.h; y++) {
          for (int x=0; x<ch.w; x++) {
            ch.value(y,x) *= q;
          }
        }
        ch.minval *= q;
        ch.maxval *= q;
        ch.q = 1;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movslq 0x6c(%rdi), %rbx
movq (%rdi), %rax
movq %rdi, 0x8(%rsp)
movq 0x8(%rdi), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x6, %rdx
cmpq %rbx, %rdx
jbe 0x8bef
movq %rbx, %r12
shlq $0x6, %r12
movq 0x8(%rax,%r12), %rdx
cmpq (%rax,%r12), %rdx
je 0x8be7
addq %rax, %r12
movl 0x28(%r12), %ebp
cmpl $0x1, %ebp
je 0x8be7
movl $0x3, %edi
leaq 0x1ce99(%rip), %rsi     # 0x259cd
movl %ebx, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1cede
movslq 0x1c(%r12), %rax
testq %rax, %rax
jle 0x8bb7
movq %rbx, 0x10(%rsp)
movl 0x18(%r12), %ecx
leaq 0x24(%r12), %rbx
leaq (%rcx,%rcx), %rsi
xorl %r15d, %r15d
xorl %r8d, %r8d
xorl %r9d, %r9d
testl %ecx, %ecx
jle 0x8ba4
movq (%r12), %r10
movq 0x8(%r12), %r11
subq %r10, %r11
sarq %r11
addq %r8, %r10
movq %rcx, %r13
movq %r15, %rdi
cmpq %rdi, %r11
movq %rbx, %rdx
cmovaq %r10, %rdx
movzwl (%rdx), %r14d
imulw %bp, %r14w
movw %r14w, (%rdx)
addq $0x2, %r10
incq %rdi
decq %r13
jne 0x8b81
incq %r9
addq %rsi, %r8
addq %rcx, %r15
cmpq %rax, %r9
jne 0x8b65
movq 0x10(%rsp), %rbx
movq 0x20(%r12), %xmm0
movd %ebp, %xmm1
pshuflw $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0,4,5,6,7]
pmullw %xmm0, %xmm1
movd %xmm1, 0x20(%r12)
movl $0x1, 0x28(%r12)
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
incq %rbx
jmp 0x8aee
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/transform/quantize.h
// Function: fwd_quantize(Image&, std::vector<int, std::allocator<int>>&)
bool fwd_quantize(Image &input, std::vector<int> &parameters) {
    for (int c=input.nb_meta_channels; c<input.channel.size(); c++) {
        Channel &ch = input.channel[c];
        int q = (c < parameters.size() ? parameters[c] : parameters.back());
        v_printf(3,"Quantizing channel %i with quantization constant %i\n",c,q);
        for (int y=0; y<ch.h; y++) {
          for (int x=0; x<ch.w; x++) {
            ch.value(y,x) = rounded_div(ch.value(y,x),q);
          }
        }
        ch.minval /= q;
        ch.maxval /= q;
        ch.q = q;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, 0x10(%rsp)
movslq 0x6c(%rdi), %rdx
movq (%rdi), %r12
movq %rdi, 0x8(%rsp)
movq 0x8(%rdi), %rax
subq %r12, %rax
sarq $0x6, %rax
cmpq %rdx, %rax
jbe 0x8d25
movq %rdx, %rbx
shlq $0x6, %rbx
leaq (%r12,%rbx), %r13
movq 0x10(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
movq %rcx, %rsi
subq %rax, %rsi
sarq $0x2, %rsi
addq $-0x4, %rcx
cmpq %rdx, %rsi
leaq (%rax,%rdx,4), %rax
cmovbeq %rcx, %rax
movl (%rax), %ebp
movl $0x3, %edi
leaq 0x1cd94(%rip), %rsi     # 0x25a05
movq %rdx, 0x18(%rsp)
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1cede
movslq 0x1c(%r12,%rbx), %rax
movq %rax, 0x20(%rsp)
testq %rax, %rax
jle 0x8cee
movl 0x18(%r13), %r14d
leaq 0x24(%r13), %rcx
leaq (%r14,%r14), %r8
xorl %r15d, %r15d
xorl %r10d, %r10d
xorl %r11d, %r11d
testl %r14d, %r14d
jle 0x8cde
movq (%r13), %r12
movq 0x8(%r13), %rbx
subq %r12, %rbx
sarq %rbx
addq %r10, %r12
movq %r14, %rsi
movq %r15, %r9
cmpq %r9, %rbx
movq %rcx, %rdi
cmovaq %r12, %rdi
movswl (%rdi), %eax
cltd
idivl %ebp
movw %ax, (%rdi)
addq $0x2, %r12
incq %r9
decq %rsi
jne 0x8cbf
incq %r11
addq %r8, %r10
addq %r14, %r15
cmpq 0x20(%rsp), %r11
jne 0x8ca3
movswl 0x20(%r13), %eax
cltd
idivl %ebp
movw %ax, 0x20(%r13)
movswl 0x22(%r13), %eax
cltd
idivl %ebp
movw %ax, 0x22(%r13)
movl %ebp, 0x28(%r13)
movq 0x18(%rsp), %rdx
incq %rdx
movq 0x8(%rsp), %rax
movq (%rax), %r12
movq 0x8(%rax), %rax
jmp 0x8c23
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/transform/palette.h
// Function: meta_palette(Image&, std::vector<int, std::allocator<int>>)
void meta_palette(Image &input, std::vector<int> parameters) {
    if (parameters.size() != 3) {
        e_printf("Error: Palette 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: Palette transform with incorrect parameters.\n");
        input.error = true; return;
    }
    int nb = end_c - begin_c + 1;
    int &nb_colors = parameters[2];
    input.nb_meta_channels++;
    input.nb_channels -= nb-1;
    input.channel.erase(input.channel.begin()+begin_c+1,input.channel.begin()+end_c+1);
    Channel pch(nb_colors,nb, 0, 1);
    pch.hshift = -1;
    input.channel.insert(input.channel.begin(),pch);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movq (%rsi), %r14
movq 0x8(%rsi), %rax
subq %r14, %rax
cmpq $0xc, %rax
jne 0x9429
movl (%r14), %eax
movl 0x4(%r14), %ecx
movl %ecx, %ebp
subl %eax, %ebp
jl 0x9429
movl 0x6c(%rbx), %esi
addl %esi, %ecx
movslq %ecx, %rcx
movq (%rbx), %rdx
movq 0x8(%rbx), %rdi
subq %rdx, %rdi
sarq $0x6, %rdi
cmpq %rcx, %rdi
jbe 0x9429
addl %esi, %eax
incl %esi
movl %esi, 0x6c(%rbx)
subl %ebp, 0x64(%rbx)
incl %ebp
cltq
shlq $0x6, %rax
leaq (%rdx,%rax), %rsi
addq $0x40, %rsi
shlq $0x6, %rcx
addq %rcx, %rdx
addq $0x40, %rdx
movq %rbx, %rdi
callq 0xfcc2
movl 0x8(%r14), %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 0xe282
movl %r15d, 0x18(%r14)
movl %ebp, 0x1c(%r14)
movl $0x10000, 0x20(%r14)    # imm = 0x10000
movabsq $-0xffffffff, %rax      # imm = 0xFFFFFFFF00000001
movq %rax, 0x28(%r14)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0x38(%r14)
movq $0x0, 0x30(%r14)
movw %r12w, 0x24(%r14)
movq (%rbx), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0xde8a
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x943e
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
jmp 0x943e
leaq 0x1c6e7(%rip), %rdi     # 0x25b17
xorl %eax, %eax
callq 0x379e
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 0x9465
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x3590
// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/transform/2dmatch.h
// Function: compute_offset(int, int&, int&)
void compute_offset(int code, int &xoffset, int &yoffset) {
    int onion_layer = 0;
    int onion_layer_size = 4;
    int ocode=code;
    while (code > onion_layer_size) { code -= onion_layer_size; onion_layer++; onion_layer_size += 4; }
    if (onion_layer & 1) {
        // odd layer: going right to left
        if (code <= onion_layer) {
            xoffset = 1 + onion_layer;  yoffset = -code;   // right vertical bottom-to-top segment
        } else if (code <= 3+3*onion_layer) {
            xoffset = 2 +2*onion_layer - code;  yoffset = -1-onion_layer;   // horizontal right-to-left segment
        } else {
            xoffset = -1 - onion_layer;  yoffset = -4 -4*onion_layer + code;    // left vertical top-to-bottom segment
        }
    } else {
        // even layer: going left to right
        if (code <= 1+onion_layer) {
            xoffset = -1 - onion_layer;  yoffset = 1-code;   // left vertical bottom-to-top segment
        } else if (code <= 4+3*onion_layer) {
            xoffset = -3 -2*onion_layer + code;  yoffset = -1-onion_layer;   // horizontal left-to-right segment
        } else {
            xoffset = 1 + onion_layer;  yoffset = -5 -4*onion_layer + code;    // right vertical top-to-bottom segment
        }
    }
}

// Assembly:
xorl %eax, %eax
cmpl $0x5, %edi
jl 0xb254
movl $0x4, %r10d
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl $0x3, %r9d
movl $0x2, %r8d
subl %r10d, %edi
addl $0x4, %r10d
decl %ecx
decl %eax
addl $0x3, %r9d
addl $0x2, %r8d
movl %edi, %r11d
subl %r10d, %r11d
jg 0xb21e
movl %eax, %r10d
negl %eax
testb $0x1, %r10b
je 0xb254
cmpl %eax, %edi
jle 0xb292
cmpl %r9d, %edi
jle 0xb29d
movl %ecx, (%rsi)
movl %r11d, %ecx
jmp 0xb29a
movl %eax, %ecx
orl $0x1, %ecx
cmpl %ecx, %edi
jle 0xb276
leal (%rax,%rax,2), %r8d
addl $0x4, %r8d
cmpl %r8d, %edi
jle 0xb283
movl %ecx, (%rsi)
shll $0x2, %eax
subl %eax, %edi
addl $-0x5, %edi
jmp 0xb298
notl %eax
movl %eax, (%rsi)
movl $0x1, %ecx
subl %edi, %ecx
jmp 0xb29a
subl %eax, %edi
subl %eax, %edi
addl $-0x3, %edi
movl %edi, (%rsi)
notl %eax
movl %eax, %ecx
jmp 0xb29a
negl %edi
negl %ecx
movl %ecx, (%rsi)
movl %edi, %ecx
movl %ecx, (%rdx)
retq
subl %edi, %r8d
movl %r8d, (%rsi)
jmp 0xb29a
// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/transform/2dmatch.h
// Function: make_offsets_table(std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>&)
void make_offsets_table(offsets &t) {
    for (int i=1; i<t.size(); i++) {
        int xoffset, yoffset;
        compute_offset(i,xoffset,yoffset);
        t[i].first = xoffset;
        t[i].second = yoffset;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq (%rdi), %r12
movq 0x8(%rdi), %r13
subq %r12, %r13
sarq $0x3, %r13
cmpq $0x2, %r13
jb 0xb2fb
movl $0x1, %ebx
leaq 0xc(%rsp), %r14
leaq 0x8(%rsp), %r15
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0xb1fe
movl 0xc(%rsp), %eax
movl %eax, (%r12,%rbx,8)
movl 0x8(%rsp), %eax
movl %eax, 0x4(%r12,%rbx,8)
incq %rbx
cmpq %rbx, %r13
jne 0xb2d5
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
movq 0x8(%rdi), %rsi
cmpq %rax, %rsi
je 0xb326
movq %rax, 0x8(%rbx)
movq %rax, %rsi
movl $0x0, 0x4(%rsp)
movq 0x10(%rbx), %rax
cmpq %rax, %rsi
je 0xb347
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xb35c
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl 0x64(%r14), %ecx
decl %ecx
movl %ecx, 0x4(%rsp)
cmpq %rax, %rsi
je 0xb377
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xb38c
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl $0x0, 0x4(%rsp)
cmpq %rax, %rsi
je 0xb3a9
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xb3be
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl $0xf4240, 0x4(%rsp)     # imm = 0xF4240
cmpq %rax, %rsi
je 0xb3db
movl $0xf4240, (%rsi)        # imm = 0xF4240
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xb3e8
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rdi, %rbx
movq (%rsi), %rcx
movq 0x8(%rsi), %rax
cmpq %rcx, %rax
jne 0xb9f5
movq %rsi, %r14
movq %rsi, %rdi
movq %rbx, %rsi
callq 0xb309
movq (%r14), %rcx
movq 0x8(%r14), %rax
subq %rcx, %rax
cmpq $0x8, %rax
jbe 0xbabf
movl (%rcx), %eax
movl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jg 0xbabf
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 0xbabf
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 0xe282
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 0xde8a
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xbad4
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
jmp 0xbad4
leaq 0x1a331(%rip), %rdi     # 0x25df7
xorl %eax, %eax
callq 0x379e
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 0xbafb
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x3590
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
movq 0x28(%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 0xbb70
movslq %esi, %r11
movq (%rdi), %rdi
shlq $0x6, %r11
cmpl 0x18(%rdi,%r11), %r9d
jge 0xbb70
cmpb $0x0, 0x30(%rsp)
je 0xbb79
movl 0x18(%rdi), %eax
imull %r8d, %eax
addl %ecx, %eax
cltq
movq (%rdi), %rbx
movq 0x8(%rdi), %r14
subq %rbx, %r14
sarq %r14
leaq 0x24(%rdi), %r15
cmpq %rax, %r14
leaq (%rbx,%rax,2), %rax
cmovbeq %r15, %rax
cmpw $0x0, (%rax)
je 0xbb79
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
subl %esi, %edx
jl 0xbb72
leaq (%r11,%rdi), %rsi
addq $0x24, %rsi
movl -0xc(%rsi), %eax
movl %eax, %edi
imull %r8d, %edi
addl %ecx, %edi
movslq %edi, %rdi
movq -0x24(%rsi), %r11
movq -0x1c(%rsi), %rbx
subq %r11, %rbx
sarq %rbx
cmpq %rdi, %rbx
leaq (%r11,%rdi,2), %rdi
cmovbeq %rsi, %rdi
movzwl (%rdi), %ebp
imull %r10d, %eax
addl %r9d, %eax
cltq
cmpq %rax, %rbx
leaq (%r11,%rax,2), %rax
cmovbeq %rsi, %rax
addl $-0x1, %edx
setb %dil
cmpw (%rax), %bp
sete %al
jne 0xbb72
addq $0x40, %rsi
testb %dil, %dil
jne 0xbb87
jmp 0xbb72
// File: /workspace/github_cpp_makefile_star2_O3/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), %rax
movq 0x8(%rsi), %rcx
subq %rax, %rcx
cmpq $0x9, %rcx
jae 0xd590
leaq 0x18c42(%rip), %rdi     # 0x261cd
jmp 0xd61e
movq %rsi, %r14
movslq 0x4(%rax), %rcx
movl (%rax), %r15d
cmpl %r15d, %ecx
setl %dl
testl %r15d, %r15d
sets %sil
orb %dl, %sil
leaq 0x18c59(%rip), %rdi     # 0x2620a
jne 0xd61e
movq 0x8(%rbx), %rdx
subq (%rbx), %rdx
sarq $0x6, %rdx
cmpq %rcx, %rdx
jbe 0xd61e
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), %rcx
cmovbeq %rdx, %rcx
cmpl $0x0, (%rcx)
je 0xd606
movq (%rbx), %rsi
addq %r15, %rsi
movq %rbx, %rdi
callq 0xdd98
movq (%r14), %rax
leal 0x1(%r12), %ecx
addl $-0x2, %r12d
addq $0x40, %r15
cmpl %r12d, 0x4(%rax)
movl %ecx, %r12d
jg 0xd5cb
jmp 0xd62c
xorl %eax, %eax
callq 0x379e
movb $0x1, 0xa8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xd97e
movl %edx, %ebx
movq %rdi, %rdx
leaq 0x179cd(%rip), %rcx     # 0x252d0
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
jmpq *%rdi
movq %rsi, %rdi
testb %bl, %bl
je 0xd9de
popq %rbx
jmp 0x3d5a
addq $0x8, %rdx
movzbl %bl, %eax
movq %rsi, %rdi
movl %eax, %esi
callq 0x7531
jmp 0xda09
addq $0x8, %rdx
movzbl %bl, %eax
movq %rsi, %rdi
movl %eax, %esi
popq %rbx
jmp 0x9ab5
movq %rsi, %rdi
testb %bl, %bl
je 0xd9e4
popq %rbx
jmp 0x4111
addq $0x8, %rdx
movzbl %bl, %eax
movq %rsi, %rdi
movl %eax, %esi
callq 0xafc1
jmp 0xda07
addq $0x8, %rdx
movzbl %bl, %eax
movq %rsi, %rdi
movl %eax, %esi
popq %rbx
jmp 0xca32
leaq 0x18940(%rip), %rdi     # 0x262c5
xorl %ebx, %ebx
movl %eax, %esi
xorl %eax, %eax
callq 0x379e
jmp 0xda09
addq $0x8, %rdx
movq %rsi, %rdi
movq %rdx, %rsi
testb %bl, %bl
je 0xd9ea
popq %rbx
jmp 0x7db1
testb %bl, %bl
je 0xd9f1
movq %rsi, %rdi
callq 0x8ad0
jmp 0xda07
addq $0x8, %rdx
movq %rsi, %rdi
movq %rdx, %rsi
testb %bl, %bl
je 0xda02
callq 0xd27e
jmp 0xda07
addq $0x8, %rdx
movq %rsi, %rdi
movq %rdx, %rsi
testb %bl, %bl
je 0xda0d
callq 0xcaae
jmp 0xda07
popq %rbx
jmp 0x663c
popq %rbx
jmp 0x8d4e
callq 0x8421
jmp 0xda07
addq $0x8, %rdx
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x8c00
jmp 0xda07
callq 0xd638
movb $0x1, %bl
movl %ebx, %eax
popq %rbx
retq
popq %rbx
jmp 0xcf2a
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xdac3
movq %rdi, %rax
leaq 0x178c6(%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 0x63d8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7476
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xdb44
movq 0x28(%rsp), %rsi
jmp 0xdb3c
addq $0x8, %rax
movq %rbx, %rdi
movq %rax, %rsi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xadc1
addq $0x8, %rax
movq %rbx, %rdi
movq %rax, %rsi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xb9c5
addq $0x8, %rax
movq %rbx, %rdi
movq %rax, %rsi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x7b24
leaq 0x187fb(%rip), %rdi     # 0x262c5
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x379e
addq $0x8, %rax
movq %rbx, %rdi
movq %rax, %rsi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xd569
addq $0x8, %rax
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xcd16
leaq 0x10(%rsp), %r15
addq $0x8, %rax
movq %rsp, %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x63d8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x931e
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xdb44
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 0xdb5f
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xdb6f
movq (%r15), %rsi
subq %rdi, %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x3590
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x10598
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 0x10556
movl $0x1000, %edx           # imm = 0x1000
subl %ebp, %edx
cmpl %ebp, %edx
ja 0x10615
movl %edx, %ecx
cmpw $0x0, 0x2(%rbx,%rcx,4)
je 0x105d2
incl %ecx
movl %ecx, %edx
jmp 0x105be
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
cmovael %edx, %esi
cmpl %ebp, %esi
jb 0x1060e
movl %ebp, %esi
movw %si, 0x2(%rbx,%rcx,4)
jmp 0x105be
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 0x1061e
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x112b4
movl %r8d, %edx
subl %ecx, %edx
movswl %ax, %esi
cmpl %esi, %edx
cmovlel %eax, %edx
movl %ecx, %esi
subl %r8d, %esi
movl %esi, %eax
negl %eax
cmovsl %esi, %eax
movswl %dx, %esi
cmpl %esi, %eax
cmovlel %edx, %eax
pushq %rbx
movl %eax, %edx
shll $0x10, %edx
cwtl
bsrl %eax, %ebx
testl %edx, %edx
cmovel %edx, %ebx
cmpl $0xf, %ebx
jb 0x112de
leal 0x1(%rbx), %edx
leaq 0x15196(%rip), %rdi     # 0x26468
movl $0xf, %esi
xorl %eax, %eax
callq 0x379e
cmpl $0xf, %ebx
setb %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x15110(%rip), %rsi     # 0x26560
movl $0x5, %edi
xorl %eax, %eax
callq 0x1cede
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xe0fe
movq (%rbx), %r12
movl 0x18(%r12), %edx
testl %edx, %edx
jle 0x11548
leaq 0x14bbd(%rip), %r15     # 0x2603b
xorl %r14d, %r14d
movq (%r12), %rax
movq 0x8(%r12), %rcx
subq %rax, %rcx
sarq %rcx
leaq 0x24(%r12), %rsi
cmpq %r14, %rcx
leaq (%rax,%r14,2), %rdi
cmovbeq %rsi, %rdi
movswl (%rdi), %ebp
testl %ebp, %ebp
js 0x1158e
cmpl %ebp, %edx
jle 0x1158e
testq %r14, %r14
je 0x114d9
xorl %edx, %edx
cmpq %rdx, %rcx
movq %rsi, %rdi
cmovaq %rax, %rdi
cmpw (%rdi), %bp
je 0x1155d
incq %rdx
addq $0x2, %rax
cmpq %rdx, %r14
jne 0x114ba
movl 0x6c(%rbx), %eax
leal (%rax,%r14), %ecx
movslq %ecx, %r13
shlq $0x6, %r13
addq (%rsp), %r13
addl %ebp, %eax
cltq
shlq $0x6, %rax
addq %rax, %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0xe5dc
movq 0x38(%r13), %rax
movq %rax, 0x38(%r12)
movups 0x18(%r13), %xmm0
movups 0x28(%r13), %xmm1
movups %xmm1, 0x28(%r12)
movups %xmm0, 0x18(%r12)
movl $0x5, %edi
movq %r15, %rsi
movl %r14d, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1cede
incq %r14
movq (%rbx), %r12
movslq 0x18(%r12), %rdx
cmpq %rdx, %r14
jl 0x11481
leaq 0x16437(%rip), %rsi     # 0x27986
movl $0x5, %edi
xorl %eax, %eax
callq 0x1cede
jmp 0x11577
leaq 0x14a97(%rip), %rdi     # 0x25ffb
movl %r14d, %esi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x379e
movb $0x1, 0xa8(%rbx)
movq %rsp, %rdi
callq 0xe188
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x14b58(%rip), %rdi     # 0x260ed
movl %ebp, %esi
xorl %eax, %eax
callq 0x379e
jmp 0x11570
jmp 0x115a6
jmp 0x115a6
jmp 0x115a6
movq %rax, %rbx
movq %rsp, %rdi
callq 0xe188
movq %rbx, %rdi
callq 0x3590
// File: /workspace/github_cpp_makefile_star2_O3/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
cmpb $0x2d, (%rdi)
jne 0x115d7
cmpb $0x0, 0x1(%r15)
je 0x1163f
leaq 0x1547b(%rip), %rsi     # 0x26a59
movq %r15, %rdi
callq 0x3370
testq %rax, %rax
je 0x11631
movq 0x1e9b6(%rip), %rcx     # 0x2ffa8
cmpq (%rcx), %rax
leaq 0x15460(%rip), %rcx     # 0x26a5c
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 0x11860
movl %eax, %ebx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x11633
callq 0x32a0
jmp 0x11633
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x1e962(%rip), %rax     # 0x2ffa8
movq (%rax), %rax
jmp 0x115e6
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1165d
callq 0x32a0
movq %rbx, %rdi
callq 0x3590
// File: /workspace/github_cpp_makefile_star2_O3/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 0x13af0
movq %r14, %rdi
callq 0x62f4
cmpb $0x1, 0x24(%rbx)
jne 0x11696
leaq 0x40(%rbx), %rdi
movq %r14, %rsi
callq 0x18118
movq 0x30(%r14), %rax
movq %rax, 0x70(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
cmpb $0x2d, (%rdi)
jne 0x116c6
cmpb $0x0, 0x1(%r12)
je 0x117af
leaq 0x153a2(%rip), %rsi     # 0x26a6f
movq %r12, %rdi
callq 0x3370
movq %rax, %r14
testq %r14, %r14
je 0x1179c
movq 0x1e8e8(%rip), %rax     # 0x2ffd0
cmpq (%rax), %r14
leaq 0x15380(%rip), %rax     # 0x26a72
cmoveq %rax, %r12
movq %r14, (%rsp)
movq %r12, 0x8(%rsp)
movl $0xffffffff, 0x10(%rsp) # imm = 0xFFFFFFFF
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x182ce
movq %rsp, %rdi
leaq 0x18(%rsp), %rdx
movq %rbx, %rsi
callq 0x14568
movl %eax, %ebx
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x11743
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
leaq 0x58(%rsp), %r14
movq 0x40(%r14), %rdi
testq %rdi, %rdi
je 0x11761
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
leaq 0x70(%rsp), %r15
movq %r15, %rdi
callq 0xe794
movq %r14, %rdi
callq 0xe188
movq -0x30(%r15), %rdi
testq %rdi, %rdi
je 0x1178c
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1179e
callq 0x32a0
jmp 0x1179e
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x1e81a(%rip), %rax     # 0x2ffd0
movq (%rax), %r14
jmp 0x116d8
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x117ea
movq (%rsp), %r14
testq %r14, %r14
jne 0x117d9
jmp 0x117e1
movq %rax, %rbx
movq %r14, %rdi
callq 0x32a0
movq %rbx, %rdi
callq 0x3590
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %rsi, %rbx
movq %rdi, %r14
cmpq $0x80, %rsi
jb 0x12219
movq %rbx, %rsi
shrq $0x7, %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x121f0
andl $0x7f, %ebx
movl %ebx, %edi
orl $0x80, %edi
testb %bpl, %bpl
cmovnel %ebx, %edi
movq (%r14), %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x33a0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x14522
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rsi
incq %r14
incq %rsi
movq %rbx, %rdi
callq 0x18410
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), %rsi
cmpq %rsi, 0x10(%rbx)
jae 0x14511
leaq 0x1(%rsi), %rax
movq %rax, 0x10(%rbx)
cmpb $0x0, (%r14)
leaq 0x1(%r14), %r14
jne 0x144de
addq $0x8, %rsp
popq %rbx
popq %r14
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x18410
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 0x1455e
incq %rax
movq %rax, 0x10(%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/encoding/encoding.cpp
// Function: int read_big_endian_varint<BlobReader>(BlobReader&)
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 %rbx
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
movl 0x18(%rdi), %r8d
movq 0x10(%rdi), %rdx
xorl %esi, %esi
movl $0xa, %r9d
cmpq %rax, %rdx
jae 0x1701a
leaq 0x1(%rdx), %r10
movq %r10, 0x10(%rdi)
movzbl (%rcx,%rdx), %ebx
movq %r10, %rdx
jmp 0x17022
movl %r8d, %ebx
testl %r8d, %r8d
js 0x17037
cmpl $0x7f, %ebx
jbe 0x17051
addl %ebx, %esi
shll $0x7, %esi
addl $0xffffc000, %esi       # imm = 0xFFFFC000
decl %r9d
jne 0x17004
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpq %rax, %rdx
jae 0x17053
leaq 0xfbe6(%rip), %rdi      # 0x26c2e
xorl %eax, %eax
callq 0x379e
jmp 0x17053
orl %esi, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x18496
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 0x18479
addq %r15, %r13
movq %r13, %rdi
xorl %esi, %esi
callq 0x3180
testq %r12, %r12
je 0x18486
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_O3/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 %edx, %ebp
subl %esi, %ebp
je 0x1877d
movl %ecx, %ebx
movq %rdi, %r14
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 0x18769
addq %rax, 0x10(%rdi)
movq %rcx, 0x8(%rdi)
callq 0x18788
incl %r15d
movl %r15d, %eax
jmp 0x18777
movq %rax, 0x8(%rdi)
callq 0x18788
xorl %eax, %eax
movl %r15d, %ebp
subl %eax, %ebx
subl %eax, %ebp
jne 0x18732
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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), %rcx
cmpq $0x10000, %rcx          # imm = 0x10000
ja 0x18849
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movl 0x18(%rdi), %esi
movq %rax, %r14
shrq $0x10, %r14
testl %esi, %esi
js 0x1880b
addq %rax, %rcx
cmpq $0xffffff, %rcx         # imm = 0xFFFFFF
ja 0x187e0
movq (%rbx), %rdi
callq 0x14526
cmpl $0x0, 0x1c(%rbx)
je 0x1880b
movq (%rbx), %rdi
movl $0xff, %esi
callq 0x14526
decl 0x1c(%rbx)
jne 0x187cc
jmp 0x1880b
cmpq $0x1000000, %rax        # imm = 0x1000000
jb 0x1883a
movq (%rbx), %rdi
incl %esi
callq 0x14526
cmpl $0x0, 0x1c(%rbx)
je 0x18807
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x14526
decl 0x1c(%rbx)
jne 0x187f8
movzbl %r14b, %r14d
movl %r14d, 0x18(%rbx)
movl 0x10(%rbx), %eax
movzwl %ax, %eax
shll $0x8, %eax
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rcx
shlq $0x8, %rcx
movq %rcx, 0x8(%rbx)
movl %r14d, %esi
cmpq $0x10001, %rcx          # imm = 0x10001
jb 0x187a7
jmp 0x18842
incl 0x1c(%rbx)
movl %esi, %r14d
jmp 0x1880f
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x10520
leaq 0x4018(%rbx), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x18aee
movq 0x4020(%rbx), %rsi
subq 0x4018(%rbx), %rsi
shrq $0x3, %rsi
movl %esi, 0x4030(%rbx)
movzwl %r12w, %edx
leaq 0x10(%rsp), %rdi
callq 0x18b64
leaq 0x4038(%rbx), %r12
leaq 0x10(%rsp), %rdx
leaq 0xf(%rsp), %rcx
movl $0x1, %esi
movq %r12, %rdi
callq 0x18c9a
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x18918
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x18932
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x18949
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 0x18d7e
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 0x18de6
jmp 0x189a6
movq %rax, %r15
leaq 0x10(%rsp), %rdi
callq 0x18d34
jmp 0x189a6
movq %rax, %r15
movq (%r14), %rdi
testq %rdi, %rdi
je 0x189bd
movq 0x4028(%rbx), %rsi
subq %rdi, %rsi
callq 0x32c0
movq %r15, %rdi
callq 0x3590
nop