// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/transform/squeeze.h
// Function: default_squeeze_parameters(std::vector<int, std::allocator<int>>&, Image const&)
void default_squeeze_parameters(std::vector<int> &parameters, const Image &image) {
    int nb_channels = image.nb_channels;
    // maybe other transforms have been applied before, but let's assume the first nb_channels channels
    // still contain the 'main' data

    parameters.clear();
    int w = image.channel[image.nb_meta_channels].w;
    int h = image.channel[image.nb_meta_channels].h;
    v_printf(7,"\nDefault squeeze parameters for %ix%i image: ",w,h);

    bool wide = (w>h);  // do horizontal first on wide images; vertical first on tall images
    if (nb_channels>2 && image.channel[image.nb_meta_channels+1].w == w && image.channel[image.nb_meta_channels+1].h == h) {
        // assume channels 1 and 2 are chroma, and can be squeezed first for 4:2:0 previews
        v_printf(7,"(4:2:0 chroma), ",w,h);
//        if (!wide) {
//        parameters.push_back(0+2); // vertical chroma squeeze
//        parameters.push_back(image.nb_meta_channels+1);
//        parameters.push_back(image.nb_meta_channels+2);
//        }
        parameters.push_back(1+2); // horizontal chroma squeeze
        parameters.push_back(image.nb_meta_channels+1);
        parameters.push_back(image.nb_meta_channels+2);
//        if (wide) {
        parameters.push_back(0+2); // vertical chroma squeeze
        parameters.push_back(image.nb_meta_channels+1);
        parameters.push_back(image.nb_meta_channels+2);
//        }
    }

    if (!wide) {
            if (h > MAX_FIRST_PREVIEW_SIZE) {
                parameters.push_back(0); // vertical squeeze
                parameters.push_back(image.nb_meta_channels);
                parameters.push_back(image.nb_meta_channels+nb_channels-1);
                h = (h+1)/2;
                v_printf(7,"Vertical (%ix%i), ",w,h);
            }
    }
    while ( w > MAX_FIRST_PREVIEW_SIZE || h > MAX_FIRST_PREVIEW_SIZE ) {
            if (w > MAX_FIRST_PREVIEW_SIZE) {
                parameters.push_back(1); // horizontal squeeze
                parameters.push_back(image.nb_meta_channels);
                parameters.push_back(image.nb_meta_channels+nb_channels-1);
                w = (w+1)/2;
                v_printf(7,"Horizontal (%ix%i), ",w,h);
            }
            if (h > MAX_FIRST_PREVIEW_SIZE) {
                parameters.push_back(0); // vertical squeeze
                parameters.push_back(image.nb_meta_channels);
                parameters.push_back(image.nb_meta_channels+nb_channels-1);
                h = (h+1)/2;
                v_printf(7,"Vertical (%ix%i), ",w,h);
            }
    }
    v_printf(7,"that's it\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %rbx
movl 0x64(%rsi), %r13d
movq (%rdi), %rax
cmpq %rax, 0x8(%rdi)
je 0xa9a7
movq %rax, 0x8(%rbx)
leaq 0x6c(%r12), %r14
movslq 0x6c(%r12), %rax
movq (%r12), %rcx
shlq $0x6, %rax
movl 0x18(%rcx,%rax), %ebp
movl 0x1c(%rcx,%rax), %r15d
leaq 0x1b350(%rip), %rsi     # 0x25d19
movl $0x7, %edi
movl %ebp, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x1cede
cmpl $0x3, %r13d
jl 0xab42
movslq 0x6c(%r12), %rcx
movq (%r12), %rax
shlq $0x6, %rcx
cmpl %ebp, 0x58(%rax,%rcx)
jne 0xab42
addq %rcx, %rax
cmpl %r15d, 0x5c(%rax)
jne 0xab42
leaq 0x1b338(%rip), %rsi     # 0x25d47
movl $0x7, %edi
movl %ebp, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x1cede
movl $0x3, 0x4(%rsp)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
cmpq %rax, %rsi
je 0xaa45
movl $0x3, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xaa5a
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl (%r14), %ecx
incl %ecx
movl %ecx, 0x4(%rsp)
cmpq %rax, %rsi
je 0xaa74
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xaa89
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl (%r14), %ecx
addl $0x2, %ecx
movl %ecx, 0x4(%rsp)
cmpq %rax, %rsi
je 0xaaa4
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xaab9
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl $0x2, 0x4(%rsp)
cmpq %rax, %rsi
je 0xaad6
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xaaeb
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl (%r14), %ecx
incl %ecx
movl %ecx, 0x4(%rsp)
cmpq %rax, %rsi
je 0xab05
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xab1a
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl (%r14), %ecx
addl $0x2, %ecx
movl %ecx, 0x4(%rsp)
cmpq %rax, %rsi
je 0xab35
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xab42
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
cmpl %r15d, %ebp
setg %al
cmpl $0x9, %r15d
setl %cl
orb %al, %cl
jne 0xac00
movl $0x0, 0x4(%rsp)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
cmpq %rax, %rsi
je 0xab7c
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xab91
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
cmpq %rax, %rsi
je 0xaba5
movl (%r14), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xabb8
movq %rbx, %rdi
movq %r14, %rdx
callq 0xf9d8
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl (%r14), %ecx
addl %r13d, %ecx
decl %ecx
movl %ecx, 0x4(%rsp)
cmpq %rax, %rsi
je 0xabd5
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xabe2
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
incl %r15d
shrl %r15d
leaq 0x1b169(%rip), %rsi     # 0x25d58
movl $0x7, %edi
movl %ebp, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x1cede
cmpl $0x9, %ebp
setge %al
cmpl $0x9, %r15d
setge %r12b
cmpl $0x8, %ebp
jg 0xac1d
cmpl $0x9, %r15d
jl 0xad9f
decl %r13d
testb $0x1, %al
je 0xaccd
movl $0x1, 0x4(%rsp)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
cmpq %rax, %rsi
je 0xac4d
movl $0x1, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xac62
movq %rbx, %rdi
leaq 0x4(%rsp), %rdx
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
cmpq %rax, %rsi
je 0xac76
movl (%r14), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xac89
movq %rbx, %rdi
movq %r14, %rdx
callq 0xf9d8
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl (%r14), %ecx
addl %r13d, %ecx
movl %ecx, 0x4(%rsp)
cmpq %rax, %rsi
je 0xaca4
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xacb1
movq %rbx, %rdi
leaq 0x4(%rsp), %rdx
callq 0xf66e
incl %ebp
shrl %ebp
movl $0x7, %edi
leaq 0x1b0aa(%rip), %rsi     # 0x25d6b
movl %ebp, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x1cede
testb $0x1, %r12b
je 0xad7e
movl $0x0, 0x4(%rsp)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
cmpq %rax, %rsi
je 0xacfc
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xad11
movq %rbx, %rdi
leaq 0x4(%rsp), %rdx
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
cmpq %rax, %rsi
je 0xad25
movl (%r14), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xad38
movq %rbx, %rdi
movq %r14, %rdx
callq 0xf9d8
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl (%r14), %ecx
addl %r13d, %ecx
movl %ecx, 0x4(%rsp)
cmpq %rax, %rsi
je 0xad53
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0xad60
movq %rbx, %rdi
leaq 0x4(%rsp), %rdx
callq 0xf66e
incl %r15d
shrl %r15d
movl $0x7, %edi
leaq 0x1afe6(%rip), %rsi     # 0x25d58
movl %ebp, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x1cede
cmpl $0x9, %ebp
setge %al
cmpl $0x9, %r15d
setge %r12b
cmpl $0x8, %ebp
jg 0xac20
cmpl $0x8, %r15d
jg 0xac20
leaq 0x1afda(%rip), %rsi     # 0x25d80
movl $0x7, %edi
xorl %eax, %eax
callq 0x1cede
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq