// File: 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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq 0x40(%rsp), %rdi
callq 0x4d50
cmpq $0x1, %rax
jne 0x7047
movq 0x40(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12190
movl (%rax), %eax
movq %rax, 0x8(%rsp)
subq $0x3, %rax
ja 0x7043
movq 0x8(%rsp), %rax
leaq 0x3f328(%rip), %rcx     # 0x461f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x40(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12190
movl $0x1, (%rax)
movq 0x40(%rsp), %rdi
movl $0x2, 0x3c(%rsp)
leaq 0x3c(%rsp), %rsi
callq 0x121b0
movq 0x40(%rsp), %rdi
movl $0x2, 0x38(%rsp)
leaq 0x38(%rsp), %rsi
callq 0x121b0
movq 0x40(%rsp), %rdi
movl $0x2, 0x34(%rsp)
leaq 0x34(%rsp), %rsi
callq 0x121b0
jmp 0x7045
movq 0x40(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12190
movl $0x1, (%rax)
movq 0x40(%rsp), %rdi
movl $0x2, 0x30(%rsp)
leaq 0x30(%rsp), %rsi
callq 0x121b0
movq 0x40(%rsp), %rdi
movl $0x2, 0x2c(%rsp)
leaq 0x2c(%rsp), %rsi
callq 0x121b0
movq 0x40(%rsp), %rdi
movl $0x1, 0x28(%rsp)
leaq 0x28(%rsp), %rsi
callq 0x121b0
jmp 0x7045
movq 0x40(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12190
movl $0x1, (%rax)
movq 0x40(%rsp), %rdi
movl $0x2, 0x24(%rsp)
leaq 0x24(%rsp), %rsi
callq 0x121b0
movq 0x40(%rsp), %rdi
movl $0x1, 0x20(%rsp)
leaq 0x20(%rsp), %rsi
callq 0x121b0
movq 0x40(%rsp), %rdi
movl $0x2, 0x1c(%rsp)
leaq 0x1c(%rsp), %rsi
callq 0x121b0
jmp 0x7045
movq 0x40(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12190
movl $0x1, (%rax)
movq 0x40(%rsp), %rdi
movl $0x2, 0x18(%rsp)
leaq 0x18(%rsp), %rsi
callq 0x121b0
movq 0x40(%rsp), %rdi
movl $0x4, 0x14(%rsp)
leaq 0x14(%rsp), %rsi
callq 0x121b0
movq 0x40(%rsp), %rdi
movl $0x1, 0x10(%rsp)
leaq 0x10(%rsp), %rsi
callq 0x121b0
jmp 0x7045
jmp 0x7045
jmp 0x7047
movq 0x40(%rsp), %rdi
callq 0x4d50
andq $0x3, %rax
cmpq $0x0, %rax
je 0x7073
leaq 0x3f6dc(%rip), %rdi     # 0x4673e
movb $0x0, %al
callq 0x3a670
movq 0x40(%rsp), %rdi
callq 0x121e0
addq $0x48, %rsp
retq
nopl (%rax,%rax)