LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: cloudinary[P]fuif/encoding/../maniac/symbol.h
// Function: SymbolChance<SimpleBitChance, 15>::SymbolChance(unsigned short)
SymbolChance(uint16_t zero_chance) {
        bitZero().set_12bit(zero_chance);
//        bitSign().set_12bit(0x800); // 50%, which is the default anyway
        uint64_t p = zero_chance;       // implicit denominator of 0x1000
        uint64_t rp = 0x1000 - zero_chance;  // 1-p

        // assume geometric distribution: Pr(X=k) = (1-p)^k p
        // (p = zero_chance)
        // cumulative distribution function: Pr(X < k) = 1-(1-p)^k = 1-rp^k
        //                                   Pr(X >= k) = (1-p)^k = rp^k
        // bitExp(i) == true   iff   X >= 2^i && X < 2^(i+1)
        // bitExp(i) is only used if the lower bound holds
        // Pr(X >= 2^i && X < 2^(i+1) | X >= 2^i ) = (rp^2^i - rp^2^(i+1)) / rp^2^i = 1 - rp^2^i

        for (int i=0; i<bits-1; i++) {
            if (rp < 0x100) rp = 0x100;
            if (rp > 0xf00) rp = 0xf00;
            bitExp(i).set_12bit(0x1000 - rp);
            rp = (rp*rp + 0x800) >> 12;     // square it
        }
        for (int i=0; i<bits; i++) {
            bitMant(i).set_12bit(MANT_CHANCE);
        }
    }

// Assembly:
subq $0x68, %rsp
movw %si, %ax
movq %rdi, 0x60(%rsp)
movw %ax, 0x5e(%rsp)
movq 0x60(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x2d1d0
movq 0x28(%rsp), %rdi
addq $0x2, %rdi
callq 0x2d1d0
movq 0x28(%rsp), %rax
addq $0x4, %rax
movq %rax, %rcx
addq $0x1c, %rcx
movq %rcx, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x2d1d0
movq 0x20(%rsp), %rax
movq 0x30(%rsp), %rcx
addq $0x2, %rax
cmpq %rcx, %rax
movq %rax, 0x38(%rsp)
jne 0x2cd78
movq 0x28(%rsp), %rax
addq $0x20, %rax
movq %rax, %rcx
addq $0x1e, %rcx
movq %rcx, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x2d1d0
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
addq $0x2, %rax
cmpq %rcx, %rax
movq %rax, 0x18(%rsp)
jne 0x2cdb9
movq 0x28(%rsp), %rdi
callq 0x2d1e0
movq %rax, %rdi
movzwl 0x5e(%rsp), %esi
callq 0x2d1f0
movzwl 0x5e(%rsp), %eax
movq %rax, 0x50(%rsp)
movzwl 0x5e(%rsp), %ecx
movl $0x1000, %eax           # imm = 0x1000
subl %ecx, %eax
cltq
movq %rax, 0x48(%rsp)
movl $0x0, 0x44(%rsp)
cmpl $0xe, 0x44(%rsp)
jge 0x2ce95
cmpq $0x100, 0x48(%rsp)      # imm = 0x100
jae 0x2ce37
movq $0x100, 0x48(%rsp)      # imm = 0x100
cmpq $0xf00, 0x48(%rsp)      # imm = 0xF00
jbe 0x2ce4b
movq $0xf00, 0x48(%rsp)      # imm = 0xF00
movq 0x28(%rsp), %rdi
movl 0x44(%rsp), %esi
callq 0x2d210
movq %rax, %rdi
movl $0x1000, %eax           # imm = 0x1000
subq 0x48(%rsp), %rax
movzwl %ax, %esi
callq 0x2d1f0
movq 0x48(%rsp), %rax
imulq 0x48(%rsp), %rax
addq $0x800, %rax            # imm = 0x800
shrq $0xc, %rax
movq %rax, 0x48(%rsp)
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x2ce1c
movl $0x0, 0x40(%rsp)
cmpl $0xf, 0x40(%rsp)
jge 0x2cecc
movq 0x28(%rsp), %rdi
movl 0x40(%rsp), %esi
callq 0x2d230
movq %rax, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x2d1f0
movl 0x40(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x40(%rsp)
jmp 0x2ce9d
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: cloudinary[P]fuif/encoding/../maniac/compound_enc.h
// Function: PropertySymbolCoder<SimpleBitChance, RacDummy<DummyIO>, 15>::set_selection_and_update_property_sums(std::vector<int, std::allocator<int>> const&, CompoundSymbolChances<SimpleBitChance, 15>&, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>> const&)
void inline set_selection_and_update_property_sums(const Properties &properties, CompoundSymbolChances<BitChance,bits> &chances, const Ranges &crange) {
        chances.count++;
        for(unsigned int i=0; i<nb_properties; i++) {
            assert(properties[i] >= range[i].first);
            assert(properties[i] <= range[i].second);
            chances.virtPropSum[i] += properties[i];
//            PropertyVal splitval = div_down(chances.virtPropSum[i],chances.count);
            PropertyVal splitval = compute_splitval(chances,i,crange);
            selection[i] = (properties[i] > splitval);
        }
    }

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rax
movl 0x90(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x90(%rax)
movl $0x0, 0x34(%rsp)
movq 0x18(%rsp), %rcx
movl 0x34(%rsp), %eax
cmpl 0x4030(%rcx), %eax
jae 0x30ade
movq 0x48(%rsp), %rdi
movl 0x34(%rsp), %eax
movl %eax, %esi
callq 0x13560
movslq (%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rdi
addq $0x78, %rdi
movl 0x34(%rsp), %eax
movl %eax, %esi
callq 0x30d70
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rdi
addq (%rax), %rcx
movq %rcx, (%rax)
movq 0x40(%rsp), %rsi
movl 0x34(%rsp), %eax
movq 0x38(%rsp), %rcx
movswl %ax, %edx
callq 0x30b50
movl %eax, 0x30(%rsp)
movq 0x48(%rsp), %rdi
movl 0x34(%rsp), %eax
movl %eax, %esi
callq 0x13560
movq 0x18(%rsp), %rdi
movl (%rax), %eax
cmpl 0x30(%rsp), %eax
setg %al
movb %al, 0x17(%rsp)
addq $0x4058, %rdi           # imm = 0x4058
movl 0x34(%rsp), %eax
movl %eax, %esi
callq 0x30d90
movq %rax, %rcx
movb 0x17(%rsp), %al
movq %rcx, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
movzbl %al, %esi
andl $0x1, %esi
leaq 0x20(%rsp), %rdi
callq 0x30df0
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x30a0e
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: cloudinary[P]fuif/encoding/../maniac/compound_enc.h
// Function: PropertySymbolCoder<SimpleBitChance, RacDummy<DummyIO>, 15>::compute_splitval(CompoundSymbolChances<SimpleBitChance, 15> const&, short, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>> const&) const
inline PropertyVal compute_splitval(const CompoundSymbolChances<BitChance,bits> &ch, int16_t p, const Ranges &crange) const {
        // encourage making initial branches for > 0, == 0, < 0
/*
        if (ch.range[p].first <= 0 && ch.range[p].second >= 0) {
            if (ch.range[p].second > 0) return 0;
            if (ch.range[p].first < 0) return -1;
        }
*/
        // make first branch on > 0
/*
        if (ch.range[p].first < 0 && ch.range[p].second > 0) {
            return 0;
        }
*/
        if (crange[p].first < 0 && crange[p].second > 0) {
            return 0;
        }
        PropertyVal splitval = div_down(ch.virtPropSum[p],ch.count);
//        if (splitval >= ch.range[p].second)
//             splitval = ch.range[p].second-1; // == does happen because of rounding and running average
        if (splitval >= crange[p].second)
             splitval = crange[p].second-1; // == does happen because of rounding and running average
        return splitval;
    }

// Assembly:
subq $0x48, %rsp
movw %dx, %ax
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movw %ax, 0x2e(%rsp)
movq %rcx, 0x20(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movswq 0x2e(%rsp), %rsi
callq 0x30f50
cmpl $0x0, (%rax)
jge 0x30baa
movq 0x20(%rsp), %rdi
movswq 0x2e(%rsp), %rsi
callq 0x30f50
cmpl $0x0, 0x4(%rax)
jle 0x30baa
movl $0x0, 0x44(%rsp)
jmp 0x30c20
movq 0x30(%rsp), %rdi
addq $0x78, %rdi
movswq 0x2e(%rsp), %rsi
callq 0x30fd0
movq 0x10(%rsp), %rdi
movq (%rax), %rsi
movq 0x30(%rsp), %rax
movl 0x90(%rax), %edx
callq 0x30f70
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x20(%rsp), %rdi
movswq 0x2e(%rsp), %rsi
callq 0x30f50
movq %rax, %rcx
movl 0xc(%rsp), %eax
cmpl 0x4(%rcx), %eax
jl 0x30c18
movq 0x20(%rsp), %rdi
movswq 0x2e(%rsp), %rsi
callq 0x30f50
movl 0x4(%rax), %eax
subl $0x1, %eax
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movw $0xffff, 0x94(%rdi)     # imm = 0xFFFF
movq $0x0, 0x58(%rdi)
movl $0x0, 0x90(%rdi)
movq %rdi, %rax
addq $0x78, %rax
movq %rax, 0x8(%rsp)
addq $0x78, %rdi
callq 0x2f700
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq $0x0, 0x28(%rsp)
leaq 0x28(%rsp), %rdx
callq 0x31620
movq 0x10(%rsp), %rdi
movq %rdi, %rax
addq $0x60, %rax
movq %rax, 0x18(%rsp)
addq $0x60, %rdi
callq 0x2f300
movq 0x18(%rsp), %rdi
movq %rax, %rsi
movq $0x0, 0x20(%rsp)
leaq 0x20(%rsp), %rdx
callq 0x31650
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: cloudinary[P]fuif/encoding/../maniac/compound_enc.h
// Function: CompoundSymbolBitCoder<SimpleBitChance, RacDummy<DummyIO>, 15>::bestChance(SymbolChanceBitType, int)
BitChance inline & bestChance(SymbolChanceBitType type, int i = 0) {
        signed short int p = chances.best_property;
        return (p == -1 ? chances.realChances.bit(type,i)
                : ((select)[p] ? chances.virtChances[p].first.bit(type,i)
                   : chances.virtChances[p].second.bit(type,i) ));
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movl %edx, 0x38(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x10(%rax), %rax
movw 0x94(%rax), %ax
movw %ax, 0x36(%rsp)
movswl 0x36(%rsp), %eax
cmpl $-0x1, %eax
jne 0x330f5
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdi
movl 0x3c(%rsp), %esi
movl 0x38(%rsp), %edx
callq 0x33400
movq %rax, 0x10(%rsp)
jmp 0x3318d
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rdi
movswq 0x36(%rsp), %rsi
callq 0x30d90
movq %rax, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x33490
testb $0x1, %al
jne 0x33123
jmp 0x33152
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdi
addq $0x40, %rdi
movswq 0x36(%rsp), %rsi
callq 0x334c0
movq %rax, %rdi
movl 0x3c(%rsp), %esi
movl 0x38(%rsp), %edx
callq 0x33400
movq %rax, 0x8(%rsp)
jmp 0x33183
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdi
addq $0x40, %rdi
movswq 0x36(%rsp), %rsi
callq 0x334c0
movq %rax, %rdi
addq $0x3e, %rdi
movl 0x3c(%rsp), %esi
movl 0x38(%rsp), %edx
callq 0x33400
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x48, %rsp
retq
nopw (%rax,%rax)
// File: cloudinary[P]fuif/encoding/../maniac/symbol.h
// Function: SymbolChance<SimpleBitChance, 15>::bit(SymbolChanceBitType, int)
BitChance inline &bit(SymbolChanceBitType typ, int i = 0) {
        switch (typ) {
        default:
        case BIT_ZERO:
            return bitZero();
        case BIT_SIGN:
            return bitSign();
        case BIT_EXP:
            return bitExp(i);
        case BIT_MANT:
            return bitMant(i);
        }
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movl %edx, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movl 0x14(%rsp), %eax
movq %rax, 0x8(%rsp)
subq $0x3, %rax
ja 0x3343e
movq 0x8(%rsp), %rax
leaq 0x13f1f(%rip), %rcx     # 0x47354
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x33440
movq (%rsp), %rdi
callq 0x2d1e0
movq %rax, 0x20(%rsp)
jmp 0x33486
movq (%rsp), %rdi
callq 0x334e0
movq %rax, 0x20(%rsp)
jmp 0x33486
movq (%rsp), %rdi
movl 0x10(%rsp), %esi
callq 0x2d210
movq %rax, 0x20(%rsp)
jmp 0x33486
movq (%rsp), %rdi
movl 0x10(%rsp), %esi
callq 0x2d230
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq 0x4050(%rax), %rdi
movslq 0x1c(%rsp), %rsi
callq 0x30990
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movswl (%rax), %eax
cmpl $-0x1, %eax
jne 0x33955
movq 0x10(%rsp), %rax
movw $0x0, (%rax)
jmp 0x33967
movq (%rsp), %rdi
movq 0x10(%rsp), %rax
movzwl 0x2(%rax), %esi
callq 0x33910
movq (%rsp), %rax
movq 0x4050(%rax), %rdi
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x30990
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movswl (%rax), %eax
cmpl $-0x1, %eax
jne 0x3399f
movq 0x8(%rsp), %rax
movw $0x0, (%rax)
jmp 0x339b1
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
movzwl 0x2(%rax), %esi
callq 0x33910
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movl %edx, 0x1c(%rsp)
movl %ecx, 0x18(%rsp)
movl %r8d, 0x14(%rsp)
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x18(%rsp), %eax
jne 0x33dc8
movl $0x0, 0x34(%rsp)
jmp 0x33dfa
movq (%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x35440
movq (%rsp), %rdi
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rsi
movl 0x1c(%rsp), %edx
movl 0x18(%rsp), %ecx
movl 0x14(%rsp), %r8d
callq 0x35560
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %edx, 0x24(%rsp)
movl %ecx, 0x20(%rsp)
movl %r8d, 0x1c(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x20(%rsp), %eax
jne 0x33e41
jmp 0x33e71
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x35920
movq 0x8(%rsp), %rdi
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rsi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
movl 0x1c(%rsp), %r8d
callq 0x35a40
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: cloudinary[P]fuif/encoding/../maniac/compound_enc.h
// Function: FinalPropertySymbolCoder<SimpleBitChance, RacOutput24<BlobIO>, 15>::find_leaf_readonly(std::vector<int, std::allocator<int>> const&)
FinalCompoundSymbolChances<BitChance,bits> inline & FinalPropertySymbolCoder<BitChance,RAC,bits>::find_leaf_readonly(const Properties &properties) {
        Tree::size_type pos = 0;
//        while(inner_node[pos].property != -1 && inner_node[pos].count < 0) {
        while(inner_node[pos].property != -1) { // && inner_node[pos].count < 0) {
                if (properties[inner_node[pos].property] > inner_node[pos].splitval) {
                  pos = inner_node[pos].childID;
                } else {
                  pos = inner_node[pos].childID+1;
                }
        }
//        return leaf_node[inner_node[pos].leafID];
        return leaf_node[inner_node[pos].childID];
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x18(%rsp), %rax
movq 0x4030(%rax), %rdi
movq 0x20(%rsp), %rsi
callq 0x30990
movswl (%rax), %eax
cmpl $-0x1, %eax
je 0x35526
movq 0x18(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movq 0x4030(%rax), %rdi
movq 0x20(%rsp), %rsi
callq 0x30990
movq 0x8(%rsp), %rdi
movswq (%rax), %rsi
callq 0x13560
movq %rax, %rcx
movq 0x18(%rsp), %rax
movl (%rcx), %ecx
movl %ecx, 0x14(%rsp)
movq 0x4030(%rax), %rdi
movq 0x20(%rsp), %rsi
callq 0x30990
movq %rax, %rcx
movl 0x14(%rsp), %eax
cmpl 0x4(%rcx), %eax
jle 0x354fd
movq 0x18(%rsp), %rax
movq 0x4030(%rax), %rdi
movq 0x20(%rsp), %rsi
callq 0x30990
movzwl 0x2(%rax), %eax
movq %rax, 0x20(%rsp)
jmp 0x35521
movq 0x18(%rsp), %rax
movq 0x4030(%rax), %rdi
movq 0x20(%rsp), %rsi
callq 0x30990
movzwl 0x2(%rax), %eax
addl $0x1, %eax
cltq
movq %rax, 0x20(%rsp)
jmp 0x35461
movq 0x18(%rsp), %rax
movq %rax, %rcx
addq $0x4018, %rcx           # imm = 0x4018
movq %rcx, (%rsp)
movq 0x4030(%rax), %rdi
movq 0x20(%rsp), %rsi
callq 0x30990
movq (%rsp), %rdi
movzwl 0x2(%rax), %eax
movl %eax, %esi
callq 0x355b0
addq $0x38, %rsp
retq
nop
// File: 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:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
movq 0x58(%rsp), %rdi
callq 0x25a20
testb $0x1, %al
jne 0x36302
cmpq $0x0, 0x48(%rsp)
je 0x3639f
movq 0x58(%rsp), %rdi
callq 0x25410
cmpq 0x48(%rsp), %rax
jb 0x3639f
leaq 0x11a1b(%rip), %rsi     # 0x47d24
xorl %eax, %eax
movl $0x3, %edi
callq 0x3a770
movq 0x50(%rsp), %rcx
movl 0x18(%rcx), %eax
movl 0x1c(%rcx), %ecx
imull %ecx, %eax
cltq
movq %rax, 0x8(%rsp)
movw $0x0, 0x2e(%rsp)
leaq 0x2d(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x12e60
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rcx
leaq 0x30(%rsp), %rdi
leaq 0x2e(%rsp), %rdx
callq 0x13a70
jmp 0x3635b
movq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x19b70
leaq 0x30(%rsp), %rdi
callq 0x13110
leaq 0x2d(%rsp), %rdi
callq 0x12ef0
movb $0x1, 0x67(%rsp)
jmp 0x363b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x2d(%rsp), %rdi
callq 0x12ef0
jmp 0x363c2
movl $0x3, %edi
leaq 0x1199a(%rip), %rsi     # 0x47d45
movb $0x0, %al
callq 0x3a770
movb $0x0, 0x67(%rsp)
movb 0x67(%rsp), %al
andb $0x1, %al
addq $0x68, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x36a0
nopl (%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl %esi, 0x14(%rsp)
movl %edx, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
cmpl $0x0, 0x10(%rsp)
jne 0x3647b
movl 0x14(%rsp), %eax
movl %eax, 0x24(%rsp)
jmp 0x364e2
movl 0x10(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq (%rsp), %rax
movl %ecx, 0xc(%rsp)
movq (%rax), %rdi
callq 0x36b70
andb $0x1, %al
movb %al, 0xb(%rsp)
testb $0x1, 0xb(%rsp)
je 0x364cd
movq (%rsp), %rdi
movl 0x14(%rsp), %esi
addl 0xc(%rsp), %esi
addl $0x1, %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %eax
addl $0x1, %eax
subl %eax, %edx
callq 0x36450
movl %eax, 0x24(%rsp)
jmp 0x364e2
movq (%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0xc(%rsp), %edx
callq 0x36450
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq 0x58(%rsp), %rsi
movq %rsi, 0x8(%rsp)
addq $0x18, %rsi
leaq 0x38(%rsp), %rdi
callq 0x2c4a0
movq 0x50(%rsp), %rdi
callq 0x374c0
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x30(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x29fc0
jmp 0x3666f
movq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x374e0
jmp 0x36680
movq 0x8(%rsp), %rdi
movl $0x0, 0x20(%rsp)
movq 0x50(%rsp), %rcx
leaq 0x38(%rsp), %rdx
leaq 0x20(%rsp), %r8
xorl %r9d, %r9d
movl %r9d, %esi
callq 0x37510
movb %al, 0x7(%rsp)
jmp 0x366ad
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x366b7
jmp 0x36721
movq 0x50(%rsp), %rdi
callq 0x30b30
movl %eax, %edi
callq 0x1ebd0
incl %eax
movl %eax, 0x1c(%rsp)
movq 0x50(%rsp), %rdi
callq 0x30b30
movl %eax, %edx
movl 0x20(%rsp), %ecx
movl 0x1c(%rsp), %r8d
leaq 0x11671(%rip), %rsi     # 0x47d5b
xorl %eax, %eax
movl $0x8, %edi
callq 0x3a770
jmp 0x366f8
movb $0x1, 0x67(%rsp)
movl $0x1, 0x18(%rsp)
jmp 0x3672e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x134e0
jmp 0x36743
movb $0x0, 0x67(%rsp)
movl $0x1, 0x18(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x134e0
movb 0x67(%rsp), %al
andb $0x1, %al
addq $0x68, %rsp
retq
movq 0x28(%rsp), %rdi
callq 0x36a0
nopl (%rax)
// File: cloudinary[P]fuif/encoding/../maniac/compound.h
// Function: FinalPropertySymbolCoder<SimpleBitChance, RacInput24<FileIO>, 15>::read_int(std::vector<int, std::allocator<int>> const&, int, int)
int read_int(const Properties &properties, int min, int max) ATTRIBUTE_HOT {
        if (min == max) { return min; }
        assert(properties.size() == nb_properties);
        FinalCompoundSymbolChances<BitChance,bits> &chances = find_leaf(properties);
        return coder.read_int(chances, min, max);
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movl %edx, 0x1c(%rsp)
movl %ecx, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x18(%rsp), %eax
jne 0x36964
movl 0x1c(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0x36993
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x37f00
movq 0x8(%rsp), %rdi
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rsi
movl 0x1c(%rsp), %edx
movl 0x18(%rsp), %ecx
callq 0x38020
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax)
// File: cloudinary[P]fuif/encoding/context_predict.h
// Function: predict_and_compute_properties_with_precomputed_reference_no_edge_case(std::vector<int, std::allocator<int>>&, Channel const&, int, int, Channel const&)
inline pixel_type predict_and_compute_properties_with_precomputed_reference_no_edge_case(Properties &p, const Channel &ch, int x, int y, const Channel &references) {
    int offset;
    for (offset=0; offset<references.w; ) {
        p[offset] = references.value_nocheck(x,offset); offset++;
        p[offset] = references.value_nocheck(x,offset); offset++;
    }
    return predict_and_compute_properties_no_edge_case(p,ch,x,y,offset);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %edx, 0x24(%rsp)
movl %ecx, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x36a41
movq 0x18(%rsp), %rdi
movl 0x24(%rsp), %esi
movl 0x14(%rsp), %edx
callq 0x131b0
cwtl
movl %eax, 0xc(%rsp)
movq 0x30(%rsp), %rdi
movslq 0x14(%rsp), %rsi
callq 0x12190
movl 0xc(%rsp), %ecx
movl %ecx, (%rax)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movq 0x18(%rsp), %rdi
movl 0x24(%rsp), %esi
movl 0x14(%rsp), %edx
callq 0x131b0
cwtl
movl %eax, 0x10(%rsp)
movq 0x30(%rsp), %rdi
movslq 0x14(%rsp), %rsi
callq 0x12190
movl 0x10(%rsp), %ecx
movl %ecx, (%rax)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x369c3
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
movl 0x14(%rsp), %r8d
callq 0x1e000
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: cloudinary[P]fuif/encoding/../maniac/rac.h
// Function: RacInput<RacConfig24, FileIO>::RacInput(FileIO&)
explicit RacInput(IO& ioin) : io(ioin), range(Config::BASE_RANGE), low(0) {
        rac_t r = Config::BASE_RANGE;
        while (r > 1) {
            low <<= 8;
            low |= read_catch_eof();
            r >>= 8;
        }
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rcx
movq %rcx, (%rax)
movq $0x1000000, 0x8(%rax)   # imm = 0x1000000
movq $0x0, 0x10(%rax)
movq $0x1000000, 0x10(%rsp)  # imm = 0x1000000
cmpq $0x1, 0x10(%rsp)
jbe 0x36b37
movq 0x8(%rsp), %rdi
movq 0x10(%rdi), %rax
shlq $0x8, %rax
movq %rax, 0x10(%rdi)
callq 0x36b40
movq %rax, %rcx
movq 0x8(%rsp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rax
shrq $0x8, %rax
movq %rax, 0x10(%rsp)
jmp 0x36af9
addq $0x28, %rsp
retq
nopl (%rax)
// File: cloudinary[P]fuif/encoding/../maniac/rac.h
// Function: RacInput<RacConfig24, FileIO>::get(unsigned long)
bool inline get(rac_t chance) {
        assert(chance >= 0);
        assert(chance < range);
        if (low >= range-chance) {
            low -= range-chance;
            range = chance;
            input();
            return true;
        } else {
            range -= chance;
            input();
            return false;
        }
    }

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rcx), %rax
movq 0x8(%rcx), %rcx
subq 0x10(%rsp), %rcx
cmpq %rcx, %rax
jb 0x36be8
movq 0x8(%rsp), %rdi
movq 0x8(%rdi), %rcx
subq 0x10(%rsp), %rcx
movq 0x10(%rdi), %rax
subq %rcx, %rax
movq %rax, 0x10(%rdi)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rdi)
callq 0x36c20
movb $0x1, 0x27(%rsp)
jmp 0x36c07
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rcx
movq 0x8(%rdi), %rax
subq %rcx, %rax
movq %rax, 0x8(%rdi)
callq 0x36c20
movb $0x0, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: cloudinary[P]fuif/encoding/../maniac/rac.h
// Function: RacInput<RacConfig24, FileIO>::input()
void inline input() {
        if (range <= Config::MIN_RANGE) {
            low <<= 8;
            range <<= 8;
            low |= read_catch_eof();
        }
        if (range <= Config::MIN_RANGE) {
            low <<= 8;
            range <<= 8;
            low |= read_catch_eof();
        }
    }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x10000, 0x8(%rax)     # imm = 0x10000
ja 0x36c6f
movq 0x8(%rsp), %rdi
movq 0x10(%rdi), %rax
shlq $0x8, %rax
movq %rax, 0x10(%rdi)
movq 0x8(%rdi), %rax
shlq $0x8, %rax
movq %rax, 0x8(%rdi)
callq 0x36b40
movq %rax, %rcx
movq 0x8(%rsp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq 0x8(%rsp), %rax
cmpq $0x10000, 0x8(%rax)     # imm = 0x10000
ja 0x36cb0
movq 0x8(%rsp), %rdi
movq 0x10(%rdi), %rax
shlq $0x8, %rax
movq %rax, 0x10(%rdi)
movq 0x8(%rdi), %rax
shlq $0x8, %rax
movq %rax, 0x8(%rdi)
callq 0x36b40
movq %rax, %rcx
movq 0x8(%rsp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: cloudinary[P]fuif/encoding/../maniac/symbol.h
// Function: int reader<15, SimpleSymbolBitCoder<SimpleBitChance, RacInput24<FileIO>, 15>>(SimpleSymbolBitCoder<SimpleBitChance, RacInput24<FileIO>, 15>&, int, int)
int reader(SymbolCoder& coder, int min, int max) {
    assert(min<=max);
    if (min == max) return min;

    bool sign;
    assert(min <= 0 && max >= 0); // should always be the case, because guess should always be in valid range

      if (coder.read(BIT_ZERO)) return 0;
      if (min < 0) {
        if (max > 0) {
          sign = coder.read(BIT_SIGN);
        } else {sign = false; }
      } else {sign = true; }

    const int amax = (sign? max : -min);
    const int emax = maniac::util::ilog2(amax);

    int e = 0;
    for (; e < emax; e++) {
        if (coder.read(BIT_EXP,e)) break;
    }

    int have = (1 << e);

    for (int pos = e; pos>0;) {
        pos--;
        int minabs1 = have | (1<<pos);
        if (minabs1 > amax) continue; // 1-bit is impossible
        if (coder.read(BIT_MANT,pos)) have = minabs1;
    }
    return (sign ? have : -have);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movl %esi, 0x34(%rsp)
movl %edx, 0x30(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x30(%rsp), %eax
jne 0x37c88
movl 0x34(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0x37dda
movq 0x38(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x37df0
testb $0x1, %al
jne 0x37c9c
jmp 0x37ca9
movl $0x0, 0x44(%rsp)
jmp 0x37dda
cmpl $0x0, 0x34(%rsp)
jge 0x37cd7
cmpl $0x0, 0x30(%rsp)
jle 0x37cd0
movq 0x38(%rsp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x37df0
andb $0x1, %al
movb %al, 0x2f(%rsp)
jmp 0x37cd5
movb $0x0, 0x2f(%rsp)
jmp 0x37cdc
movb $0x1, 0x2f(%rsp)
testb $0x1, 0x2f(%rsp)
je 0x37ced
movl 0x30(%rsp), %eax
movl %eax, 0x10(%rsp)
jmp 0x37cf7
xorl %eax, %eax
subl 0x34(%rsp), %eax
movl %eax, 0x10(%rsp)
movl 0x10(%rsp), %eax
movl %eax, 0x28(%rsp)
movl 0x28(%rsp), %edi
callq 0x1ebd0
movl %eax, 0x24(%rsp)
movl $0x0, 0x20(%rsp)
movl 0x20(%rsp), %eax
cmpl 0x24(%rsp), %eax
jge 0x37d48
movq 0x38(%rsp), %rdi
movl 0x20(%rsp), %edx
movl $0x2, %esi
callq 0x37df0
testb $0x1, %al
jne 0x37d37
jmp 0x37d39
jmp 0x37d48
jmp 0x37d3b
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x37d14
movl 0x20(%rsp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, 0x1c(%rsp)
movl 0x20(%rsp), %eax
movl %eax, 0x18(%rsp)
cmpl $0x0, 0x18(%rsp)
jle 0x37db7
movl 0x18(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x18(%rsp)
movl 0x1c(%rsp), %eax
movl 0x18(%rsp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
orl %ecx, %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x28(%rsp), %eax
jle 0x37d94
jmp 0x37d5f
movq 0x38(%rsp), %rdi
movl 0x18(%rsp), %edx
movl $0x3, %esi
callq 0x37df0
testb $0x1, %al
jne 0x37dad
jmp 0x37db5
movl 0x14(%rsp), %eax
movl %eax, 0x1c(%rsp)
jmp 0x37d5f
testb $0x1, 0x2f(%rsp)
je 0x37dc8
movl 0x1c(%rsp), %eax
movl %eax, 0xc(%rsp)
jmp 0x37dd2
xorl %eax, %eax
subl 0x1c(%rsp), %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: cloudinary[P]fuif/encoding/../maniac/symbol.h
// Function: SimpleSymbolBitCoder<SimpleBitChance, RacInput24<FileIO>, 15>::read(SymbolChanceBitType, int)
bool read(SymbolChanceBitType typ, int i = 0) {
        BitChance& bch = ctx.bit(typ, i);
        bool bit = rac.read_12bit_chance(bch.get_12bit());
        bch.put(bit, table);
        return bit;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movl %edx, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rax), %rdi
movl 0x2c(%rsp), %esi
movl 0x28(%rsp), %edx
callq 0x33400
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x20(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
callq 0x331c0
movq 0x8(%rsp), %rdi
movzwl %ax, %esi
callq 0x37e80
movq 0x10(%rsp), %rcx
andb $0x1, %al
movb %al, 0x1f(%rsp)
movq 0x20(%rsp), %rdi
movb 0x1f(%rsp), %al
movq (%rcx), %rdx
andb $0x1, %al
movzbl %al, %esi
callq 0x33560
movb 0x1f(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: cloudinary[P]fuif/encoding/../maniac/compound.h
// Function: FinalCompoundSymbolBitCoder<SimpleBitChance, RacInput24<FileIO>, 15>::read(SymbolChanceBitType, int)
bool inline read(const SymbolChanceBitType type, const int i = 0) {
        BitChance& ch = chances.realChances.bit(type, i);
        bool bit = rac.read_12bit_chance(ch.get_12bit());
        updateChances(type, i, bit);
        return bit;
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movl %edx, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rax), %rdi
movl 0x2c(%rsp), %esi
movl 0x28(%rsp), %edx
callq 0x33400
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x20(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
callq 0x331c0
movq 0x8(%rsp), %rdi
movzwl %ax, %esi
callq 0x37e80
movq 0x10(%rsp), %rdi
andb $0x1, %al
movb %al, 0x1f(%rsp)
movl 0x2c(%rsp), %esi
movl 0x28(%rsp), %edx
movb 0x1f(%rsp), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0x382e0
movb 0x1f(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: cloudinary[P]fuif/io.cpp
// Function: e_printf(char const*, ...)
void e_printf(const char *format, ...) {
    va_list args;
    va_start(args, format);
    vfprintf(stderr, format, args);
    fflush(stderr);
    va_end(args);
}

// Assembly:
subq $0xe8, %rsp
testb %al, %al
je 0x3a6af
movaps %xmm0, 0x40(%rsp)
movaps %xmm1, 0x50(%rsp)
movaps %xmm2, 0x60(%rsp)
movaps %xmm3, 0x70(%rsp)
movaps %xmm4, 0x80(%rsp)
movaps %xmm5, 0x90(%rsp)
movaps %xmm6, 0xa0(%rsp)
movaps %xmm7, 0xb0(%rsp)
movq %r9, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, 0xe0(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, 0xd0(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0xc8(%rsp)
movl $0x30, 0xc4(%rsp)
movl $0x8, 0xc0(%rsp)
movq 0x1f8ce(%rip), %rax     # 0x59fd8
movq %rax, 0x8(%rsp)
movq (%rax), %rdi
movq 0xe0(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x34d0
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x3450
addq $0xe8, %rsp
retq
nopl (%rax)
// File: cloudinary[P]fuif/io.cpp
// Function: v_printf(int, char const*, ...)
void v_printf(const int v, const char *format, ...) {
    if (verbosity < v) return;
    va_list args;
    va_start(args, format);
    vfprintf(my_stdout, format, args);
    fflush(my_stdout);
    va_end(args);
}

// Assembly:
subq $0xd8, %rsp
testb %al, %al
je 0x3a7ac
movaps %xmm0, 0x30(%rsp)
movaps %xmm1, 0x40(%rsp)
movaps %xmm2, 0x50(%rsp)
movaps %xmm3, 0x60(%rsp)
movaps %xmm4, 0x70(%rsp)
movaps %xmm5, 0x80(%rsp)
movaps %xmm6, 0x90(%rsp)
movaps %xmm7, 0xa0(%rsp)
movq %r9, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl %edi, 0xd4(%rsp)
movq %rsi, 0xc8(%rsp)
movl 0x1fbd3(%rip), %eax     # 0x5a3a8
cmpl 0xd4(%rsp), %eax
jge 0x3a7e0
jmp 0x3a838
leaq 0xb0(%rsp), %rax
movq %rsp, %rcx
movq %rcx, 0x10(%rax)
leaq 0xe0(%rsp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq 0x21fa9(%rip), %rdi     # 0x5c7b8
movq 0xc8(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
callq 0x34d0
movq 0x21f8d(%rip), %rdi     # 0x5c7b8
callq 0x3450
leaq 0xb0(%rsp), %rax
addq $0xd8, %rsp
retq
// File: cloudinary[P]fuif/io.cpp
// Function: v_printf_tty(int, char const*, ...)
void v_printf_tty(const int v, const char *format, ...) {
    if (verbosity < v) return;
#ifdef _WIN32
    if(!_isatty(_fileno(my_stdout))) return;
#else
    if(!isatty(fileno(my_stdout))) return;
#endif
    va_list args;
    va_start(args, format);
    vfprintf(my_stdout, format, args);
    fflush(my_stdout);
    va_end(args);
}

// Assembly:
subq $0xd8, %rsp
testb %al, %al
je 0x3a87c
movaps %xmm0, 0x30(%rsp)
movaps %xmm1, 0x40(%rsp)
movaps %xmm2, 0x50(%rsp)
movaps %xmm3, 0x60(%rsp)
movaps %xmm4, 0x70(%rsp)
movaps %xmm5, 0x80(%rsp)
movaps %xmm6, 0x90(%rsp)
movaps %xmm7, 0xa0(%rsp)
movq %r9, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl %edi, 0xd4(%rsp)
movq %rsi, 0xc8(%rsp)
movl 0x1fb03(%rip), %eax     # 0x5a3a8
cmpl 0xd4(%rsp), %eax
jge 0x3a8b0
jmp 0x3a922
movq 0x21f01(%rip), %rdi     # 0x5c7b8
callq 0x33b0
movl %eax, %edi
callq 0x3680
cmpl $0x0, %eax
jne 0x3a8ca
jmp 0x3a922
leaq 0xb0(%rsp), %rax
movq %rsp, %rcx
movq %rcx, 0x10(%rax)
leaq 0xe0(%rsp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq 0x21ebf(%rip), %rdi     # 0x5c7b8
movq 0xc8(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
callq 0x34d0
movq 0x21ea3(%rip), %rdi     # 0x5c7b8
callq 0x3450
leaq 0xb0(%rsp), %rax
addq $0xd8, %rsp
retq
nopw (%rax,%rax)
// File: cloudinary[P]fuif/./import/read_gif.h
// Function: gd_get_frame(gd_GIF*)
int
gd_get_frame(gd_GIF *gif)
{
    char sep;

    dispose(gif);
    read(gif->fd, &sep, 1);
    while (sep != ',') {
        if (sep == ';')
            return 0;
        if (sep == '!')
            read_ext(gif);
        else return -1;
        read(gif->fd, &sep, 1);
    }
    if (read_image(gif) == -1)
        return -1;
    return 1;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
callq 0x3b280
movq 0x8(%rsp), %rax
movl (%rax), %edi
leaq 0x7(%rsp), %rsi
movl $0x1, %edx
callq 0x3520
movsbl 0x7(%rsp), %eax
cmpl $0x2c, %eax
je 0x3b19f
movsbl 0x7(%rsp), %eax
cmpl $0x3b, %eax
jne 0x3b167
movl $0x0, 0x14(%rsp)
jmp 0x3b1c0
movsbl 0x7(%rsp), %eax
cmpl $0x21, %eax
jne 0x3b17d
movq 0x8(%rsp), %rdi
callq 0x3b430
jmp 0x3b187
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
jmp 0x3b1c0
movq 0x8(%rsp), %rax
movl (%rax), %edi
leaq 0x7(%rsp), %rsi
movl $0x1, %edx
callq 0x3520
jmp 0x3b149
movq 0x8(%rsp), %rdi
callq 0x3b4e0
cmpl $-0x1, %eax
jne 0x3b1b8
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
jmp 0x3b1c0
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax)
// File: cloudinary[P]fuif/./import/read_gif.h
// Function: dispose(gd_GIF*)
static void
dispose(gd_GIF *gif)
{
    int i, j, k;
    uint8_t *bgcolor;
    switch (gif->gce.disposal) {
    case 2: /* Restore to background color. */
        bgcolor = &gif->palette->colors[gif->bgindex*3];
        i = gif->fy * gif->width + gif->fx;
        for (j = 0; j < gif->fh; j++) {
            for (k = 0; k < gif->fw; k++) {
                memcpy(&gif->canvas[(i+k)*4], bgcolor, 3);
                if (!gif->gce.transparency || gif->bgindex != gif->gce.tindex) gif->canvas[(i+k)*4+3] = 255; // opaque
                else
                gif->canvas[(i+k)*4+3] = 0; // transparent
            }
            i += gif->width;
        }
        break;
    case 3: /* Restore to previous, i.e., don't update canvas.*/
        break;
    default:
        /* Add frame non-transparent pixels to canvas. */
        render_frame_rect(gif, gif->canvas);
    }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movzbl 0x1b(%rax), %eax
movl %eax, 0x4(%rsp)
subl $0x2, %eax
je 0x3b2af
jmp 0x3b29d
movl 0x4(%rsp), %eax
subl $0x3, %eax
je 0x3b40a
jmp 0x3b40c
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rax
addq $0x4, %rax
movq 0x20(%rsp), %rcx
movzbl 0x658(%rcx), %ecx
imull $0x3, %ecx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movzwl 0x652(%rax), %eax
movq 0x20(%rsp), %rcx
movzwl 0x10(%rcx), %ecx
imull %ecx, %eax
movq 0x20(%rsp), %rcx
movzwl 0x650(%rcx), %ecx
addl %ecx, %eax
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
movq 0x20(%rsp), %rcx
movzwl 0x656(%rcx), %ecx
cmpl %ecx, %eax
jge 0x3b408
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq 0x20(%rsp), %rcx
movzwl 0x654(%rcx), %ecx
cmpl %ecx, %eax
jge 0x3b3e7
movq 0x20(%rsp), %rax
movq 0x660(%rax), %rax
movl 0x1c(%rsp), %ecx
addl 0x14(%rsp), %ecx
shll $0x2, %ecx
movslq %ecx, %rcx
movq 0x8(%rsp), %rdx
movw (%rdx), %si
movw %si, (%rax,%rcx)
movb 0x2(%rdx), %dl
movb %dl, 0x2(%rax,%rcx)
movq 0x20(%rsp), %rax
cmpl $0x0, 0x20(%rax)
je 0x3b391
movq 0x20(%rsp), %rax
movzbl 0x658(%rax), %eax
movq 0x20(%rsp), %rcx
movzbl 0x1a(%rcx), %ecx
cmpl %ecx, %eax
je 0x3b3b4
movq 0x20(%rsp), %rax
movq 0x660(%rax), %rax
movl 0x1c(%rsp), %ecx
addl 0x14(%rsp), %ecx
shll $0x2, %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movb $-0x1, (%rax,%rcx)
jmp 0x3b3d5
movq 0x20(%rsp), %rax
movq 0x660(%rax), %rax
movl 0x1c(%rsp), %ecx
addl 0x14(%rsp), %ecx
shll $0x2, %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
jmp 0x3b3d7
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x3b328
movq 0x20(%rsp), %rax
movzwl 0x10(%rax), %eax
addl 0x1c(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x3b308
jmp 0x3b422
jmp 0x3b422
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x660(%rax), %rsi
callq 0x3b7a0
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: cloudinary[P]fuif/./import/read_gif.h
// Function: read_ext(gd_GIF*)
static void
read_ext(gd_GIF *gif)
{
    uint8_t label;

    read(gif->fd, &label, 1);
    switch (label) {
    case 0x01:
        read_plain_text_ext(gif);
        break;
    case 0xF9:
        read_graphic_control_ext(gif);
        break;
    case 0xFE:
        read_comment_ext(gif);
        break;
    case 0xFF:
        read_application_ext(gif);
        break;
    default:
        fprintf(stderr, "unknown extension: %02X\n", label);
    }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movl (%rax), %edi
leaq 0xf(%rsp), %rsi
movl $0x1, %edx
callq 0x3520
movzbl 0xf(%rsp), %eax
movl %eax, 0x8(%rsp)
subl $0x1, %eax
je 0x3b486
jmp 0x3b45f
movl 0x8(%rsp), %eax
subl $0xf9, %eax
je 0x3b492
jmp 0x3b46c
movl 0x8(%rsp), %eax
subl $0xfe, %eax
je 0x3b49e
jmp 0x3b479
movl 0x8(%rsp), %eax
subl $0xff, %eax
je 0x3b4aa
jmp 0x3b4b6
movq 0x10(%rsp), %rdi
callq 0x44760
jmp 0x3b4d3
movq 0x10(%rsp), %rdi
callq 0x448f0
jmp 0x3b4d3
movq 0x10(%rsp), %rdi
callq 0x449b0
jmp 0x3b4d3
movq 0x10(%rsp), %rdi
callq 0x44a20
jmp 0x3b4d3
movq 0x1eb1b(%rip), %rax     # 0x59fd8
movq (%rax), %rdi
movzbl 0xf(%rsp), %edx
leaq 0xe3ce(%rip), %rsi      # 0x4989a
movb $0x0, %al
callq 0x3500
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: cloudinary[P]fuif/./import/read_gif.h
// Function: render_frame_rect(gd_GIF*, unsigned char*)
static void
render_frame_rect(gd_GIF *gif, uint8_t *buffer)
{
    int i, j, k;
    uint8_t index, *color;
    i = gif->fy * gif->width + gif->fx;
    for (j = 0; j < gif->fh; j++) {
        for (k = 0; k < gif->fw; k++) {
            index = gif->frame[(gif->fy + j) * gif->width + gif->fx + k];
            color = &gif->palette->colors[index*3];
            if (!gif->gce.transparency || index != gif->gce.tindex) {
                memcpy(&buffer[(i+k)*4], color, 3);
                buffer[(i+k)*4+3] = 255; // opaque
            }
        }
        i += gif->width;
    }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movzwl 0x652(%rax), %eax
movq -0x8(%rsp), %rcx
movzwl 0x10(%rcx), %ecx
imull %ecx, %eax
movq -0x8(%rsp), %rcx
movzwl 0x650(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x14(%rsp)
movl $0x0, -0x18(%rsp)
movl -0x18(%rsp), %eax
movq -0x8(%rsp), %rcx
movzwl 0x656(%rcx), %ecx
cmpl %ecx, %eax
jge 0x3b908
movl $0x0, -0x1c(%rsp)
movl -0x1c(%rsp), %eax
movq -0x8(%rsp), %rcx
movzwl 0x654(%rcx), %ecx
cmpl %ecx, %eax
jge 0x3b8e7
movq -0x8(%rsp), %rax
movq 0x668(%rax), %rax
movq -0x8(%rsp), %rcx
movzwl 0x652(%rcx), %ecx
addl -0x18(%rsp), %ecx
movq -0x8(%rsp), %rdx
movzwl 0x10(%rdx), %edx
imull %edx, %ecx
movq -0x8(%rsp), %rdx
movzwl 0x650(%rdx), %edx
addl %edx, %ecx
addl -0x1c(%rsp), %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x1d(%rsp)
movq -0x8(%rsp), %rax
movq 0x28(%rax), %rax
addq $0x4, %rax
movzbl -0x1d(%rsp), %ecx
imull $0x3, %ecx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rsp)
movq -0x8(%rsp), %rax
cmpl $0x0, 0x20(%rax)
je 0x3b895
movzbl -0x1d(%rsp), %eax
movq -0x8(%rsp), %rcx
movzbl 0x1a(%rcx), %ecx
cmpl %ecx, %eax
je 0x3b8d5
movq -0x10(%rsp), %rax
movl -0x14(%rsp), %ecx
addl -0x1c(%rsp), %ecx
shll $0x2, %ecx
movslq %ecx, %rcx
movq -0x28(%rsp), %rdx
movw (%rdx), %si
movw %si, (%rax,%rcx)
movb 0x2(%rdx), %dl
movb %dl, 0x2(%rax,%rcx)
movq -0x10(%rsp), %rax
movl -0x14(%rsp), %ecx
addl -0x1c(%rsp), %ecx
shll $0x2, %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movb $-0x1, (%rax,%rcx)
jmp 0x3b8d7
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0x3b7fc
movq -0x8(%rsp), %rax
movzwl 0x10(%rax), %eax
addl -0x14(%rsp), %eax
movl %eax, -0x14(%rsp)
movl -0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rsp)
jmp 0x3b7dc
retq
nopl (%rax)
// File: cloudinary[P]fuif/./import/read_pam.h
// Function: read_pnm_int(_IO_FILE*, char*, char**)
unsigned int read_pnm_int(FILE *fp, char* buf, char** t) {
    long result = strtol(*t,t,10);
    if (result == 0) {
        // no valid int found here, try next line
        do {
          *t = fgets(buf, PPMREADBUFLEN, fp);
          if ( *t == NULL ) {return false;}
        } while ( strncmp(buf, "#", 1) == 0 || strncmp(buf, "\n", 1) == 0);
        result = strtol(*t,t,10);
        if (result == 0) { e_printf("Invalid PNM file.\n"); fclose(fp); }
    }
    return result;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rsp), %rsi
movl $0xa, %edx
callq 0x34f0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x3d243
jmp 0x3d17d
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rdx
movl $0x100, %esi            # imm = 0x100
callq 0x35e0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x3d1b4
movl $0x0, 0x34(%rsp)
jmp 0x3d24c
jmp 0x3d1b6
movq 0x20(%rsp), %rdi
leaq 0xaf22(%rip), %rsi      # 0x480e4
movl $0x1, %edx
callq 0x31c0
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, 0xf(%rsp)
je 0x3d1f9
movq 0x20(%rsp), %rdi
leaq 0xb6c8(%rip), %rsi      # 0x488ad
movl $0x1, %edx
callq 0x31c0
cmpl $0x0, %eax
sete %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x3d17d
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rsp), %rsi
movl $0xa, %edx
callq 0x34f0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x3d241
leaq 0xaeb6(%rip), %rdi      # 0x480e6
movb $0x0, %al
callq 0x3a670
movq 0x28(%rsp), %rdi
callq 0x3350
jmp 0x3d243
movq 0x10(%rsp), %rax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: cloudinary[P]fuif/fuif.cpp
// Function: file_exists(char const*)
bool file_exists(const char * filename){
        FILE * file = fopen(filename, "rb");
        if (!file) return false;
        fclose(file);
        return true;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
leaq 0x6738(%rip), %rsi      # 0x4796d
callq 0x3460
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jne 0x4124c
movb $0x0, 0x17(%rsp)
jmp 0x4125a
movq (%rsp), %rdi
callq 0x3350
movb $0x1, 0x17(%rsp)
movb 0x17(%rsp), %al
andb $0x1, %al
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)