// File: cloudinary[P]fuif/transform/subsample.h
// Function: meta_subsample(Image&, std::vector<int, std::allocator<int>>)
void meta_subsample(Image &input, std::vector<int> parameters) {
    check_subsample_parameters(parameters);
    if (parameters.size())
    for (int i=0; i<parameters.size(); i+=4) {
        int c1 = parameters[i+0];
        int c2 = parameters[i+1];
        int srh = parameters[i+2];
        int srv = parameters[i+3];
        assert (srh == 1 || srh == 2);
        assert (srv == 1 || srv == 2);
        int srhshift = (srh==1?0:1);
        int srvshift = (srv==1?0:1);
        for (int c=c1; c<=c2; c++) {
          input.channel[c].w += srh-1;
          input.channel[c].w /= srh;
          input.channel[c].h += srv-1;
          input.channel[c].h /= srv;
          input.channel[c].hshift += srhshift;
          input.channel[c].vshift += srvshift;
        }
    }
}

// Assembly:
subq $0x78, %rsp
movq %rsi, 0x38(%rsp)
movq %rdi, %rax
movq 0x38(%rsp), %rdi
movq %rdi, 0x40(%rsp)
movq %rax, 0x70(%rsp)
movq %rdi, 0x68(%rsp)
callq 0x6e80
movq 0x40(%rsp), %rdi
callq 0x4d50
cmpq $0x0, %rax
je 0x7e2c
movl $0x0, 0x64(%rsp)
movq 0x40(%rsp), %rdi
movslq 0x64(%rsp), %rax
movq %rax, 0x30(%rsp)
callq 0x4d50
movq %rax, %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
jae 0x7e2a
movq 0x40(%rsp), %rdi
movl 0x64(%rsp), %eax
addl $0x0, %eax
movslq %eax, %rsi
callq 0x12190
movq 0x40(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x60(%rsp)
movl 0x64(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x12190
movq 0x40(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x5c(%rsp)
movl 0x64(%rsp), %eax
addl $0x2, %eax
movslq %eax, %rsi
callq 0x12190
movq 0x40(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x58(%rsp)
movl 0x64(%rsp), %eax
addl $0x3, %eax
movslq %eax, %rsi
callq 0x12190
movl (%rax), %eax
movl %eax, 0x54(%rsp)
movl 0x58(%rsp), %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
movl %eax, 0x50(%rsp)
movl 0x54(%rsp), %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
movl %eax, 0x4c(%rsp)
movl 0x60(%rsp), %eax
movl %eax, 0x48(%rsp)
movl 0x48(%rsp), %eax
cmpl 0x5c(%rsp), %eax
jg 0x7e18
movl 0x58(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x8(%rsp)
movq 0x70(%rsp), %rdi
movslq 0x48(%rsp), %rsi
callq 0x4ba0
movl 0x8(%rsp), %ecx
addl 0x18(%rax), %ecx
movl %ecx, 0x18(%rax)
movl 0x58(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x70(%rsp), %rdi
movslq 0x48(%rsp), %rsi
callq 0x4ba0
movl 0xc(%rsp), %ecx
movq %rax, 0x10(%rsp)
movl 0x18(%rax), %eax
cltd
idivl %ecx
movl %eax, %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x18(%rax)
movl 0x54(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x18(%rsp)
movq 0x70(%rsp), %rdi
movslq 0x48(%rsp), %rsi
callq 0x4ba0
movl 0x18(%rsp), %ecx
addl 0x1c(%rax), %ecx
movl %ecx, 0x1c(%rax)
movl 0x54(%rsp), %eax
movl %eax, 0x1c(%rsp)
movq 0x70(%rsp), %rdi
movslq 0x48(%rsp), %rsi
callq 0x4ba0
movl 0x1c(%rsp), %ecx
movq %rax, 0x20(%rsp)
movl 0x1c(%rax), %eax
cltd
idivl %ecx
movl %eax, %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x1c(%rax)
movl 0x50(%rsp), %eax
movl %eax, 0x28(%rsp)
movq 0x70(%rsp), %rdi
movslq 0x48(%rsp), %rsi
callq 0x4ba0
movl 0x28(%rsp), %ecx
addl 0x2c(%rax), %ecx
movl %ecx, 0x2c(%rax)
movl 0x4c(%rsp), %eax
movl %eax, 0x2c(%rsp)
movq 0x70(%rsp), %rdi
movslq 0x48(%rsp), %rsi
callq 0x4ba0
movl 0x2c(%rsp), %ecx
addl 0x30(%rax), %ecx
movl %ecx, 0x30(%rax)
movl 0x48(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x48(%rsp)
jmp 0x7d10
jmp 0x7e1a
movl 0x64(%rsp), %eax
addl $0x4, %eax
movl %eax, 0x64(%rsp)
jmp 0x7c51
jmp 0x7e2c
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)