// File: cloudinary[P]fuif/transform/dct.h
// Function: meta_DCT(Image&, std::vector<int, std::allocator<int>>&)
void meta_DCT(Image &image, std::vector<int> &parameters) {
    if (!parameters.size()) default_DCT_parameters(parameters,image);
    int beginc = image.nb_meta_channels + parameters[0];
    int endc = image.nb_meta_channels + parameters[1];
    int nb_channels = endc-beginc+1;
    std::vector<std::vector<int>> ordering;
    std::vector<int> comp;
    std::vector<int> coeff;
    default_DCT_scanscript(nb_channels,ordering,comp,coeff);
    for (int c=beginc; c<=endc; c++) {
        int bw = (image.channel[c].w+7)/8;
        int bh = (image.channel[c].h+7)/8;
        image.channel[c].w = bw;
        image.channel[c].h = bh;
        image.channel[c].hshift += 3;
        image.channel[c].vshift += 3;
        image.channel[c].hcshift += 3;
        image.channel[c].vcshift += 3;
    }
    for (int i=nb_channels; i<64*nb_channels; i++) {
          Channel dummy;
          int c = beginc+comp[i];
          dummy.w=image.channel[c].w; dummy.h=image.channel[c].h;
          dummy.hshift = image.channel[c].hshift;
          dummy.vshift = image.channel[c].vshift;
          dummy.hcshift = dct_cshifts[coeff[i]]+image.channel[c].hcshift-3;
          dummy.vcshift = dct_cshifts[coeff[i]]+image.channel[c].vcshift-3;
          dummy.component = image.channel[c].component;
          assert(dummy.component == comp[i]);
          image.channel.push_back(dummy);
    }
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movq %rdi, 0x110(%rsp)
movq %rsi, 0x108(%rsp)
movq 0x108(%rsp), %rdi
callq 0x4d50
cmpq $0x0, %rax
jne 0x857f
movq 0x108(%rsp), %rdi
movq 0x110(%rsp), %rsi
callq 0x84f0
movq 0x110(%rsp), %rax
movl 0x6c(%rax), %eax
movl %eax, 0x28(%rsp)
movq 0x108(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12190
movq %rax, %rcx
movl 0x28(%rsp), %eax
movl (%rcx), %ecx
addl %ecx, %eax
movl %eax, 0x104(%rsp)
movq 0x110(%rsp), %rax
movl 0x6c(%rax), %eax
movl %eax, 0x2c(%rsp)
movq 0x108(%rsp), %rdi
movl $0x1, %esi
callq 0x12190
movq %rax, %rcx
movl 0x2c(%rsp), %eax
movl (%rcx), %ecx
addl %ecx, %eax
movl %eax, 0x100(%rsp)
movl 0x100(%rsp), %eax
movl 0x104(%rsp), %ecx
subl %ecx, %eax
incl %eax
movl %eax, 0xfc(%rsp)
leaq 0xe0(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x125d0
leaq 0xc8(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x125e0
leaq 0xb0(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x125e0
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rcx
movl 0xfc(%rsp), %edi
callq 0x8180
jmp 0x8650
movl 0x104(%rsp), %eax
movl %eax, 0xa0(%rsp)
movl 0xa0(%rsp), %eax
cmpl 0x100(%rsp), %eax
jg 0x87bb
movq 0x110(%rsp), %rdi
movslq 0xa0(%rsp), %rsi
callq 0x4ba0
movl 0x18(%rax), %eax
addl $0x7, %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, 0x9c(%rsp)
movq 0x110(%rsp), %rdi
movslq 0xa0(%rsp), %rsi
callq 0x4ba0
movl 0x1c(%rax), %eax
addl $0x7, %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, 0x98(%rsp)
movl 0x9c(%rsp), %eax
movl %eax, 0x20(%rsp)
movq 0x110(%rsp), %rdi
movslq 0xa0(%rsp), %rsi
callq 0x4ba0
movl 0x20(%rsp), %ecx
movl %ecx, 0x18(%rax)
movl 0x98(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x110(%rsp), %rdi
movslq 0xa0(%rsp), %rsi
callq 0x4ba0
movl 0x24(%rsp), %ecx
movl %ecx, 0x1c(%rax)
movq 0x110(%rsp), %rdi
movslq 0xa0(%rsp), %rsi
callq 0x4ba0
movl 0x2c(%rax), %ecx
addl $0x3, %ecx
movl %ecx, 0x2c(%rax)
movq 0x110(%rsp), %rdi
movslq 0xa0(%rsp), %rsi
callq 0x4ba0
movl 0x30(%rax), %ecx
addl $0x3, %ecx
movl %ecx, 0x30(%rax)
movq 0x110(%rsp), %rdi
movslq 0xa0(%rsp), %rsi
callq 0x4ba0
movl 0x34(%rax), %ecx
addl $0x3, %ecx
movl %ecx, 0x34(%rax)
movq 0x110(%rsp), %rdi
movslq 0xa0(%rsp), %rsi
callq 0x4ba0
movl 0x38(%rax), %ecx
addl $0x3, %ecx
movl %ecx, 0x38(%rax)
movl 0xa0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa0(%rsp)
jmp 0x865e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa8(%rsp)
movl %eax, 0xa4(%rsp)
jmp 0x89c5
movl 0xfc(%rsp), %eax
movl %eax, 0x94(%rsp)
movl 0x94(%rsp), %eax
movl 0xfc(%rsp), %ecx
shll $0x6, %ecx
cmpl %ecx, %eax
jge 0x8996
leaq 0x50(%rsp), %rdi
callq 0x125f0
jmp 0x87ee
movl 0x104(%rsp), %eax
movl %eax, (%rsp)
movslq 0x94(%rsp), %rsi
leaq 0xc8(%rsp), %rdi
callq 0x12190
movq %rax, %rcx
movl (%rsp), %eax
movl (%rcx), %ecx
addl %ecx, %eax
movl %eax, 0x4c(%rsp)
movq 0x110(%rsp), %rdi
movslq 0x4c(%rsp), %rsi
callq 0x4ba0
movl 0x18(%rax), %eax
movl %eax, 0x68(%rsp)
movq 0x110(%rsp), %rdi
movslq 0x4c(%rsp), %rsi
callq 0x4ba0
movl 0x1c(%rax), %eax
movl %eax, 0x6c(%rsp)
movq 0x110(%rsp), %rdi
movslq 0x4c(%rsp), %rsi
callq 0x4ba0
movl 0x2c(%rax), %eax
movl %eax, 0x7c(%rsp)
movq 0x110(%rsp), %rdi
movslq 0x4c(%rsp), %rsi
callq 0x4ba0
movl 0x30(%rax), %eax
movl %eax, 0x80(%rsp)
movslq 0x94(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x12190
movslq (%rax), %rcx
leaq 0x3dcba(%rip), %rax     # 0x46560
movq %rax, 0x10(%rsp)
movl (%rax,%rcx,4), %eax
movl %eax, 0x4(%rsp)
movq 0x110(%rsp), %rdi
movslq 0x4c(%rsp), %rsi
callq 0x4ba0
movl 0x4(%rsp), %ecx
movq 0x8(%rsp), %rdi
movl 0x34(%rax), %edx
movl %ecx, %eax
movl %edx, %ecx
leal -0x3(%rax,%rcx), %eax
movl %eax, 0x84(%rsp)
movslq 0x94(%rsp), %rsi
callq 0x12190
movq %rax, %rcx
movq 0x10(%rsp), %rax
movslq (%rcx), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x1c(%rsp)
movq 0x110(%rsp), %rdi
movslq 0x4c(%rsp), %rsi
callq 0x4ba0
movl 0x1c(%rsp), %ecx
movl 0x38(%rax), %edx
movl %ecx, %eax
movl %edx, %ecx
leal -0x3(%rax,%rcx), %eax
movl %eax, 0x88(%rsp)
movq 0x110(%rsp), %rdi
movslq 0x4c(%rsp), %rsi
callq 0x4ba0
movl 0x3c(%rax), %eax
movl %eax, 0x8c(%rsp)
movq 0x110(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x12660
jmp 0x8956
leaq 0x50(%rsp), %rdi
callq 0x12380
movl 0x94(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x94(%rsp)
jmp 0x87c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa8(%rsp)
movl %eax, 0xa4(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x12380
jmp 0x89c5
leaq 0xb0(%rsp), %rdi
callq 0x54f0
leaq 0xc8(%rsp), %rdi
callq 0x54f0
leaq 0xe0(%rsp), %rdi
callq 0x126d0
addq $0x118, %rsp            # imm = 0x118
retq
leaq 0xb0(%rsp), %rdi
callq 0x54f0
leaq 0xc8(%rsp), %rdi
callq 0x54f0
leaq 0xe0(%rsp), %rdi
callq 0x126d0
movq 0xa8(%rsp), %rdi
callq 0x36a0
nopl (%rax)