// File: lunasorcery[P]brailify/./stb/stb_image_resize.h
// Function: stbir__resample_vertical_downsample(stbir__info*, int, int, int, float)
static void stbir__resample_vertical_downsample(stbir__info* stbir_info, int n, int in_first_scanline, int in_last_scanline, float in_center_of_out)
{
    int x, k;
    int output_w = stbir_info->output_w;
    int output_h = stbir_info->output_h;
    stbir__contributors* vertical_contributors = stbir_info->vertical_contributors;
    float* vertical_coefficients = stbir_info->vertical_coefficients;
    int channels = stbir_info->channels;
    int kernel_pixel_width = stbir_info->vertical_filter_pixel_width;
    void* output_data = stbir_info->output_data;
    float* horizontal_buffer = stbir_info->horizontal_buffer;
    int coefficient_width = stbir_info->vertical_coefficient_width;
    int contributor = n + stbir_info->vertical_filter_pixel_margin;

    float* ring_buffer = stbir_info->ring_buffer;
    int ring_buffer_begin_index = stbir_info->ring_buffer_begin_index;
    int ring_buffer_first_scanline = stbir_info->ring_buffer_first_scanline;
    int ring_buffer_last_scanline = stbir_info->ring_buffer_last_scanline;
    int ring_buffer_length = stbir_info->ring_buffer_length_bytes/sizeof(float);
    int n0,n1;

    n0 = vertical_contributors[contributor].n0;
    n1 = vertical_contributors[contributor].n1;

    STBIR_ASSERT(!stbir__use_height_upsampling(stbir_info));

    for (k = n0; k <= n1; k++)
    {
        int coefficient_index = k - n0;
        int coefficient_group = coefficient_width * contributor;
        float coefficient = vertical_coefficients[coefficient_group + coefficient_index];

        float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length);

        switch (channels) {
            case 1:
                for (x = 0; x < output_w; x++)
                {
                    int in_pixel_index = x * 1;
                    ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient;
                }
                break;
            case 2:
                for (x = 0; x < output_w; x++)
                {
                    int in_pixel_index = x * 2;
                    ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient;
                    ring_buffer_entry[in_pixel_index + 1] += horizontal_buffer[in_pixel_index + 1] * coefficient;
                }
                break;
            case 3:
                for (x = 0; x < output_w; x++)
                {
                    int in_pixel_index = x * 3;
                    ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient;
                    ring_buffer_entry[in_pixel_index + 1] += horizontal_buffer[in_pixel_index + 1] * coefficient;
                    ring_buffer_entry[in_pixel_index + 2] += horizontal_buffer[in_pixel_index + 2] * coefficient;
                }
                break;
            case 4:
                for (x = 0; x < output_w; x++)
                {
                    int in_pixel_index = x * 4;
                    ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient;
                    ring_buffer_entry[in_pixel_index + 1] += horizontal_buffer[in_pixel_index + 1] * coefficient;
                    ring_buffer_entry[in_pixel_index + 2] += horizontal_buffer[in_pixel_index + 2] * coefficient;
                    ring_buffer_entry[in_pixel_index + 3] += horizontal_buffer[in_pixel_index + 3] * coefficient;
                }
                break;
            default:
                for (x = 0; x < output_w; x++)
                {
                    int in_pixel_index = x * channels;

                    int c;
                    for (c = 0; c < channels; c++)
                        ring_buffer_entry[in_pixel_index + c] += horizontal_buffer[in_pixel_index + c] * coefficient;
                }
                break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movss %xmm0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl 0x4c(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movl 0xb4(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movl 0xac(%rax), %eax
movl %eax, -0x54(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
addl 0xbc(%rcx), %eax
movl %eax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0xd8(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movl 0xd4(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x8(%rbp), %rax
movl 0xcc(%rax), %eax
movl %eax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movl 0xd0(%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x8(%rbp), %rax
movslq 0xc8(%rax), %rax
shrq $0x2, %rax
movl %eax, -0x70(%rbp)
movq -0x30(%rbp), %rax
movslq -0x58(%rbp), %rcx
movl (%rax,%rcx,8), %eax
movl %eax, -0x74(%rbp)
movq -0x30(%rbp), %rax
movslq -0x58(%rbp), %rcx
movl 0x4(%rax,%rcx,8), %eax
movl %eax, -0x78(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1a730
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1f0ea
jmp 0x1f0ec
jmp 0x1f10b
leaq 0x2c0e(%rip), %rdi      # 0x21d01
leaq 0x2070(%rip), %rsi      # 0x2116a
movl $0x7ce, %edx            # imm = 0x7CE
leaq 0x2ca9(%rip), %rcx      # 0x21daf
callq 0x1090
movl -0x74(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x78(%rbp), %eax
jg 0x1f5a1
movl -0x20(%rbp), %eax
movl -0x74(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x7c(%rbp)
movl -0x54(%rbp), %eax
movl -0x58(%rbp), %ecx
imull %ecx, %eax
movl %eax, -0x80(%rbp)
movq -0x38(%rbp), %rax
movl -0x80(%rbp), %ecx
movl -0x7c(%rbp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, -0x84(%rbp)
movl -0x20(%rbp), %edi
movq -0x60(%rbp), %rsi
movl -0x64(%rbp), %edx
movl -0x68(%rbp), %ecx
movl -0x40(%rbp), %r8d
movl -0x70(%rbp), %r9d
callq 0x1e3e0
movq %rax, -0x90(%rbp)
movl -0x3c(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0xb0(%rbp)
subl $0x3, %eax
ja 0x1f4f1
movq -0xb0(%rbp), %rax
leaq 0x1162(%rip), %rcx      # 0x202f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x1f207
movl -0x1c(%rbp), %eax
shll $0x0, %eax
movl %eax, -0x94(%rbp)
movq -0x50(%rbp), %rax
movl -0x94(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movss -0x84(%rbp), %xmm2
movq -0x90(%rbp), %rax
movl -0x94(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1f1a6
jmp 0x1f591
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x1f2bc
movl -0x1c(%rbp), %eax
shll %eax
movl %eax, -0x98(%rbp)
movq -0x50(%rbp), %rax
movl -0x98(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movss -0x84(%rbp), %xmm2
movq -0x90(%rbp), %rax
movl -0x98(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movq -0x50(%rbp), %rax
movl -0x98(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movss -0x84(%rbp), %xmm2
movq -0x90(%rbp), %rax
movl -0x98(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1f213
jmp 0x1f591
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x1f3b2
imull $0x3, -0x1c(%rbp), %eax
movl %eax, -0x9c(%rbp)
movq -0x50(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movss -0x84(%rbp), %xmm2
movq -0x90(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movq -0x50(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movss -0x84(%rbp), %xmm2
movq -0x90(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movq -0x50(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movss -0x84(%rbp), %xmm2
movq -0x90(%rbp), %rax
movl -0x9c(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1f2c8
jmp 0x1f591
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x1f4ec
movl -0x1c(%rbp), %eax
shll $0x2, %eax
movl %eax, -0xa0(%rbp)
movq -0x50(%rbp), %rax
movl -0xa0(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movss -0x84(%rbp), %xmm2
movq -0x90(%rbp), %rax
movl -0xa0(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movq -0x50(%rbp), %rax
movl -0xa0(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movss -0x84(%rbp), %xmm2
movq -0x90(%rbp), %rax
movl -0xa0(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movq -0x50(%rbp), %rax
movl -0xa0(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movss -0x84(%rbp), %xmm2
movq -0x90(%rbp), %rax
movl -0xa0(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movq -0x50(%rbp), %rax
movl -0xa0(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movss -0x84(%rbp), %xmm2
movq -0x90(%rbp), %rax
movl -0xa0(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1f3be
jmp 0x1f591
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x1f58f
movl -0x1c(%rbp), %eax
imull -0x3c(%rbp), %eax
movl %eax, -0xa4(%rbp)
movl $0x0, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x1f57f
movq -0x50(%rbp), %rax
movl -0xa4(%rbp), %ecx
addl -0xa8(%rbp), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movss -0x84(%rbp), %xmm2
movq -0x90(%rbp), %rax
movl -0xa4(%rbp), %ecx
addl -0xa8(%rbp), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0xa8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa8(%rbp)
jmp 0x1f51b
jmp 0x1f581
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1f4f8
jmp 0x1f591
jmp 0x1f593
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1f111
addq $0xb0, %rsp
popq %rbp
retq
nopw (%rax,%rax)