// File: /workspace/github_cpp_makefile_star2_O2/cloudinary[P]fuif/transform/squeeze.h
// Function: meta_squeeze(Image&, std::vector<int, std::allocator<int>>&)
void meta_squeeze(Image &image, std::vector<int> &parameters) {
    if (!parameters.size()) default_squeeze_parameters(parameters,image);

    for (int i=0; i+2<parameters.size(); i+=3) {
        bool horizontal = parameters[i] & 1; // 0=vertical, 1=horizontal
        bool in_place = !(parameters[i] & 2);
        int beginc = parameters[i+1];
        int endc = parameters[i+2];
        int offset;
        if (in_place) offset = endc+1; else offset = image.nb_meta_channels + image.nb_channels;
        int nb_chans = endc-beginc+1;
        for (int c=beginc; c<=endc; c++) {
            Channel dummy;
            dummy.hcshift = image.channel[c].hcshift;
            dummy.vcshift = image.channel[c].vcshift;
            dummy.component = image.channel[c].component;
            if (horizontal) {
                int w = image.channel[c].w;
                image.channel[c].w = (w+1)/2;
                image.channel[c].hshift++;
                image.channel[c].hcshift++;
                dummy.w = w-(w+1)/2;
                dummy.h = image.channel[c].h;
            } else {
                int h = image.channel[c].h;
                image.channel[c].h = (h+1)/2;
                image.channel[c].vshift++;
                image.channel[c].vcshift++;
                dummy.h = h-(h+1)/2;
                dummy.w = image.channel[c].w;
            }
            dummy.hshift = image.channel[c].hshift;
            dummy.vshift = image.channel[c].vshift;

            image.channel.insert(image.channel.begin()+offset+c-beginc, dummy);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %r14
movq 0x8(%rsi), %rax
movq %rsi, 0x8(%rsp)
cmpq (%rsi), %rax
jne 0x8212
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x7f78
xorl %esi, %esi
leaq 0x10(%rsp), %rbx
leaq 0x2(%rsi), %rcx
movq 0x8(%rsp), %rdx
movq (%rdx), %rax
movq 0x8(%rdx), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rcx, %rdx
jbe 0x8386
movl (%rax,%rsi,4), %edi
movslq 0x8(%rax,%rsi,4), %r13
leal 0x1(%r13), %ecx
movl 0x64(%r14), %edx
addl 0x6c(%r14), %edx
movl %edi, 0x4(%rsp)
testb $0x2, %dil
movq %rsi, 0x50(%rsp)
movslq 0x4(%rax,%rsi,4), %r15
cmovel %ecx, %edx
movslq %edx, %rbp
movq %r15, %r12
shlq $0x6, %r12
orq $0x38, %r12
shlq $0x6, %rbp
cmpq %r13, %r15
jg 0x8378
pxor %xmm0, %xmm0
movdqa %xmm0, 0x20(%rsp)
movdqa %xmm0, 0x10(%rsp)
andq $0x0, 0x2e(%rsp)
movl $0x1, 0x38(%rsp)
leaq 0x3c(%rsp), %rax
movdqu %xmm0, (%rax)
orl $-0x1, 0x4c(%rsp)
movq (%r14), %rsi
movl -0x4(%rsi,%r12), %ecx
movl %ecx, 0x44(%rsp)
movq (%rsi,%r12), %rax
movq %rax, 0x48(%rsp)
testb $0x1, 0x4(%rsp)
jne 0x830b
movq %rax, %xmm0
movl -0x1c(%rsi,%r12), %edi
movl -0x8(%rsi,%r12), %ecx
leal 0x1(%rdi), %eax
cltd
pushq $0x2
popq %r8
idivl %r8d
movl %eax, -0x1c(%rsi,%r12)
incl %ecx
movl %ecx, -0x8(%rsi,%r12)
movd %xmm0, %edx
incl %edx
movl %edx, (%rsi,%r12)
subl %eax, %edi
movl %edi, 0x2c(%rsp)
movl -0x20(%rsi,%r12), %eax
movl %eax, 0x28(%rsp)
movl -0xc(%rsi,%r12), %edi
jmp 0x834a
movl -0x20(%rsi,%r12), %r8d
movl -0xc(%rsi,%r12), %edi
leal 0x1(%r8), %eax
cltd
pushq $0x2
popq %r9
idivl %r9d
movl %eax, -0x20(%rsi,%r12)
incl %edi
movl %edi, -0xc(%rsi,%r12)
incl %ecx
movl %ecx, -0x4(%rsi,%r12)
subl %eax, %r8d
movl %r8d, 0x28(%rsp)
movl -0x1c(%rsi,%r12), %eax
movl %eax, 0x2c(%rsp)
movl -0x8(%rsi,%r12), %ecx
movl %edi, 0x3c(%rsp)
movl %ecx, 0x40(%rsp)
addq %rbp, %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0xa7c8
movq %rbx, %rdi
callq 0xabc2
incq %r15
addq $0x40, %r12
addq $0x40, %rbp
jmp 0x8274
movq 0x50(%rsp), %rsi
addq $0x3, %rsi
jmp 0x8219
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xabc2
movq %rbx, %rdi
callq 0x35d0