// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/transform/subsample.h
// Function: check_subsample_parameters(std::vector<int, std::allocator<int>>&)
void check_subsample_parameters(std::vector<int> &parameters) {
    if (parameters.size() == 1) {
        // special case: abbreviated parameters for some common cases
        switch (parameters[0]) {
            case 0:     // 4:2:0
                parameters[0] = 1;
                parameters.push_back(2);
                parameters.push_back(2);
                parameters.push_back(2);
                break;
            case 1:     // 4:2:2
                parameters[0] = 1;
                parameters.push_back(2);
                parameters.push_back(2);
                parameters.push_back(1);
                break;
            case 2:     // 4:4:0
                parameters[0] = 1;
                parameters.push_back(2);
                parameters.push_back(1);
                parameters.push_back(2);
                break;
            case 3:     // 4:1:1
                parameters[0] = 1;
                parameters.push_back(2);
                parameters.push_back(4);
                parameters.push_back(1);
                break;
            default:
                break;
        }
    }
    if (parameters.size() % 4) {
        e_printf("Error: invalid parameters for subsampling.\n");
        parameters.clear();
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %rsi
movq %rsi, %rcx
subq %rax, %rcx
cmpq $0x4, %rcx
jne 0x6bff
movl (%rax), %ecx
cmpq $0x3, %rcx
ja 0x6bff
leaq 0x1e89c(%rip), %rdx     # 0x252c0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl $0x1, (%rax)
movl $0x2, 0xc(%rsp)
movq 0x10(%rbx), %rax
cmpq %rax, %rsi
je 0x6b32
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6b47
movl $0x1, (%rax)
movl $0x2, 0xc(%rsp)
movq 0x10(%rbx), %rax
cmpq %rax, %rsi
je 0x6ad7
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6aec
movl $0x1, (%rax)
movl $0x2, 0xc(%rsp)
movq 0x10(%rbx), %rax
cmpq %rax, %rsi
je 0x6b01
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6b16
movl $0x1, (%rax)
movl $0x2, 0xc(%rsp)
movq 0x10(%rbx), %rax
cmpq %rax, %rsi
je 0x6b8e
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6ba3
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl $0x1, 0xc(%rsp)
cmpq %rax, %rsi
je 0x6b64
movl $0x1, (%rsi)
jmp 0x6b5a
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl $0x4, 0xc(%rsp)
cmpq %rax, %rsi
je 0x6bc0
movl $0x4, (%rsi)
jmp 0x6bb6
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl $0x2, 0xc(%rsp)
cmpq %rax, %rsi
je 0x6b64
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6b79
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl $0x2, 0xc(%rsp)
cmpq %rax, %rsi
je 0x6bf2
movl $0x2, (%rsi)
jmp 0x6be8
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl $0x2, 0xc(%rsp)
cmpq %rax, %rsi
je 0x6bc0
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6bd5
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
movl $0x1, 0xc(%rsp)
cmpq %rax, %rsi
je 0x6bf2
movl $0x1, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6bff
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0xf66e
movl 0x8(%rbx), %eax
subl (%rbx), %eax
testb $0xc, %al
je 0x6c23
leaq 0x1ebff(%rip), %rdi     # 0x2580e
xorl %eax, %eax
callq 0x379e
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x6c23
movq %rax, 0x8(%rbx)
addq $0x10, %rsp
popq %rbx
retq