// File: /workspace/github_cpp_makefile_star2_O1/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 %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %rax
cmpq (%rsi), %rax
jne 0xaf18
movq %rbx, %rdi
movq %r14, %rsi
callq 0xaae1
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
cmpq $0x9, %rcx
jb 0xb08f
movl $0x2, %ecx
xorl %edx, %edx
leaq 0x10(%rsp), %r15
movq %rbx, 0x50(%rsp)
movq %rdx, 0x8(%rsp)
movslq 0x4(%rax,%rdx,4), %rdx
movl (%rax,%rcx,4), %ebp
cmpl %ebp, %edx
jg 0xb063
movq 0x8(%rsp), %rcx
movl (%rax,%rcx,4), %ebx
incl %ebp
movl 0x64(%r14), %eax
addl 0x6c(%r14), %eax
testb $0x2, %bl
cmovel %ebp, %eax
movslq %eax, %r13
movq %rdx, %r12
shlq $0x6, %r12
orq $0x18, %r12
shlq $0x6, %r13
subl %edx, %ebp
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x2e(%rsp)
movl $0x1, 0x38(%rsp)
leaq 0x3c(%rsp), %rax
movups %xmm0, (%rax)
movl $0xffffffff, 0x4c(%rsp) # imm = 0xFFFFFFFF
movq (%r14), %rsi
movq 0x1c(%rsi,%r12), %rax
movq %rax, 0x44(%rsp)
movl 0x24(%rsi,%r12), %eax
movl %eax, 0x4c(%rsp)
testb $0x1, %bl
jne 0xaff7
movl 0x4(%rsi,%r12), %eax
leal 0x1(%rax), %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
incl %ecx
sarl %ecx
movl %ecx, 0x4(%rsi,%r12)
incl 0x18(%rsi,%r12)
incl 0x20(%rsi,%r12)
subl %ecx, %eax
movl %eax, 0x2c(%rsp)
movl (%rsi,%r12), %eax
movl %eax, 0x28(%rsp)
jmp 0xb024
movl (%rsi,%r12), %eax
leal 0x1(%rax), %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
incl %ecx
sarl %ecx
movl %ecx, (%rsi,%r12)
incl 0x14(%rsi,%r12)
incl 0x1c(%rsi,%r12)
subl %ecx, %eax
movl %eax, 0x28(%rsp)
movl 0x4(%rsi,%r12), %eax
movl %eax, 0x2c(%rsp)
movq 0x14(%rsi,%r12), %rax
movq %rax, 0x3c(%rsp)
addq %r13, %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0xdf1c
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xb053
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
addq $0x40, %r12
addq $0x40, %r13
decl %ebp
jne 0xaf7e
movq 0x8(%rsp), %rax
movq %rax, %rcx
leaq 0x3(%rax), %rdx
addq $0x5, %rcx
movq 0x50(%rsp), %rbx
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
subq %rax, %rsi
sarq $0x2, %rsi
cmpq %rcx, %rsi
ja 0xaf3d
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xb0b8
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x35a0