// File: /workspace/github_cpp_makefile_star2_O1/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 0x6c62
movl (%rax), %ecx
cmpq $0x3, %rcx
ja 0x6c62
leaq 0x1e818(%rip), %rdx     # 0x252c0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl $0x1, (%rax)
movl $0x2, 0xc(%rsp)
cmpq 0x10(%rbx), %rsi
je 0x6ba1
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6bae
movl $0x1, (%rax)
movl $0x2, 0xc(%rsp)
cmpq 0x10(%rbx), %rsi
je 0x6b4f
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6b5c
movl $0x1, (%rax)
movl $0x2, 0xc(%rsp)
cmpq 0x10(%rbx), %rsi
je 0x6b76
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6b83
movl $0x1, (%rax)
movl $0x2, 0xc(%rsp)
cmpq 0x10(%rbx), %rsi
je 0x6bf7
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6c04
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0xf6da
movl $0x1, 0xc(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x6bd0
movl $0x1, (%rsi)
jmp 0x6bc6
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0xf6da
movl $0x4, 0xc(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x6c26
movl $0x4, (%rsi)
jmp 0x6c1c
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0xf6da
movl $0x2, 0xc(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x6bd0
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6bdd
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0xf6da
movl $0x2, 0xc(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x6c55
movl $0x2, (%rsi)
jmp 0x6c4b
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0xf6da
movl $0x2, 0xc(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x6c26
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6c33
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0xf6da
movl $0x1, 0xc(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x6c55
movl $0x1, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x6c62
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0xf6da
movl 0x8(%rbx), %eax
subl (%rbx), %eax
testb $0xc, %al
je 0x6c86
leaq 0x1eb9c(%rip), %rdi     # 0x2580e
xorl %eax, %eax
callq 0x3796
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x6c86
movq %rax, 0x8(%rbx)
addq $0x10, %rsp
popq %rbx
retq