// File: /workspace/github_cpp_makefile_star2_O1/lunasorcery[P]brailify/./stb/stb_image_resize.h
// Function: stbir__resample_horizontal_downsample(stbir__info*, int, float*)
static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, int n, float* output_buffer)
{
    int x, k;
    int input_w = stbir_info->input_w;
    int output_w = stbir_info->output_w;
    int kernel_pixel_width = stbir_info->horizontal_filter_pixel_width;
    int channels = stbir_info->channels;
    float* decode_buffer = stbir__get_decode_buffer(stbir_info);
    stbir__contributors* horizontal_contributors = stbir_info->horizontal_contributors;
    float* horizontal_coefficients = stbir_info->horizontal_coefficients;
    int coefficient_width = stbir_info->horizontal_coefficient_width;
    int filter_pixel_margin = stbir_info->horizontal_filter_pixel_margin;
    int max_x = input_w + filter_pixel_margin * 2;

    STBIR_ASSERT(!stbir__use_width_upsampling(stbir_info));

    switch (channels) {
        case 1:
            for (x = 0; x < max_x; x++)
            {
                int n0 = horizontal_contributors[x].n0;
                int n1 = horizontal_contributors[x].n1;

                int in_x = x - filter_pixel_margin;
                int in_pixel_index = in_x * 1;
                int max_n = n1;
                int coefficient_group = coefficient_width * x;

                for (k = n0; k <= max_n; k++)
                {
                    int out_pixel_index = k * 1;
                    float coefficient = horizontal_coefficients[coefficient_group + k - n0];
                    STBIR_ASSERT(coefficient != 0);
                    output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient;
                }
            }
            break;

        case 2:
            for (x = 0; x < max_x; x++)
            {
                int n0 = horizontal_contributors[x].n0;
                int n1 = horizontal_contributors[x].n1;

                int in_x = x - filter_pixel_margin;
                int in_pixel_index = in_x * 2;
                int max_n = n1;
                int coefficient_group = coefficient_width * x;

                for (k = n0; k <= max_n; k++)
                {
                    int out_pixel_index = k * 2;
                    float coefficient = horizontal_coefficients[coefficient_group + k - n0];
                    STBIR_ASSERT(coefficient != 0);
                    output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient;
                    output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient;
                }
            }
            break;

        case 3:
            for (x = 0; x < max_x; x++)
            {
                int n0 = horizontal_contributors[x].n0;
                int n1 = horizontal_contributors[x].n1;

                int in_x = x - filter_pixel_margin;
                int in_pixel_index = in_x * 3;
                int max_n = n1;
                int coefficient_group = coefficient_width * x;

                for (k = n0; k <= max_n; k++)
                {
                    int out_pixel_index = k * 3;
                    float coefficient = horizontal_coefficients[coefficient_group + k - n0];
                    STBIR_ASSERT(coefficient != 0);
                    output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient;
                    output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient;
                    output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient;
                }
            }
            break;

        case 4:
            for (x = 0; x < max_x; x++)
            {
                int n0 = horizontal_contributors[x].n0;
                int n1 = horizontal_contributors[x].n1;

                int in_x = x - filter_pixel_margin;
                int in_pixel_index = in_x * 4;
                int max_n = n1;
                int coefficient_group = coefficient_width * x;

                for (k = n0; k <= max_n; k++)
                {
                    int out_pixel_index = k * 4;
                    float coefficient = horizontal_coefficients[coefficient_group + k - n0];
                    STBIR_ASSERT(coefficient != 0);
                    output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient;
                    output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient;
                    output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient;
                    output_buffer[out_pixel_index + 3] += decode_buffer[in_pixel_index + 3] * coefficient;
                }
            }
            break;

        default:
            for (x = 0; x < max_x; x++)
            {
                int n0 = horizontal_contributors[x].n0;
                int n1 = horizontal_contributors[x].n1;

                int in_x = x - filter_pixel_margin;
                int in_pixel_index = in_x * channels;
                int max_n = n1;
                int coefficient_group = coefficient_width * x;

                for (k = n0; k <= max_n; k++)
                {
                    int c;
                    int out_pixel_index = k * channels;
                    float coefficient = horizontal_coefficients[coefficient_group + k - n0];
                    STBIR_ASSERT(coefficient != 0);
                    for (c = 0; c < channels; c++)
                        output_buffer[out_pixel_index + c] += decode_buffer[in_pixel_index + c] * coefficient;
                }
            }
            break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, -0x30(%rbp)
movss 0x44(%rdi), %xmm0
ucomiss 0x1a09(%rip), %xmm0     # 0x17008
ja 0x15a72
movslq 0x4c(%rdi), %r9
movl %r9d, %r10d
movq 0x98(%rdi), %r11
movslq 0xb8(%rdi), %rsi
movl %esi, %eax
imull %r9d, %eax
movslq %eax, %r8
movq 0x70(%rdi), %rax
movq 0x78(%rdi), %rcx
movl 0xa8(%rdi), %edx
movq %rsi, -0x38(%rbp)
addl %esi, %esi
addl 0x8(%rdi), %esi
leal -0x1(%r10), %ebx
cmpl $0x3, %ebx
ja 0x15920
leaq (%r11,%r8,4), %rdi
leaq 0x1d1a(%rip), %r8       # 0x1736c
movslq (%r8,%rbx,4), %r9
addq %r8, %r9
jmpq *%r9
testl %esi, %esi
jle 0x159c8
movl %esi, %r9d
xorl %r10d, %r10d
xorps %xmm0, %xmm0
xorl %r11d, %r11d
movslq (%rax,%r11,8), %r14
movl 0x4(%rax,%r11,8), %esi
cmpl %esi, %r14d
jg 0x156c7
movq %r11, %r8
subq -0x38(%rbp), %r8
movq -0x30(%rbp), %rbx
leaq (%rbx,%r14,4), %rbx
subl %r14d, %esi
incl %esi
xorl %r14d, %r14d
leal (%r10,%r14), %r15d
movslq %r15d, %r15
movss (%rcx,%r15,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x156ad
jnp 0x159d7
mulss (%rdi,%r8,4), %xmm1
addss (%rbx,%r14,4), %xmm1
movss %xmm1, (%rbx,%r14,4)
incq %r14
cmpl %r14d, %esi
jne 0x15695
incq %r11
addq %rdx, %r10
cmpq %r9, %r11
jne 0x15670
jmp 0x159c8
testl %esi, %esi
jle 0x159c8
movl %esi, %r9d
addq $0x8, -0x30(%rbp)
xorl %r10d, %r10d
xorps %xmm0, %xmm0
xorl %r11d, %r11d
movslq (%rax,%r11,8), %rsi
movl 0x4(%rax,%r11,8), %ebx
cmpl %ebx, %esi
jg 0x1577b
movq %r11, %r8
subq -0x38(%rbp), %r8
shlq $0x2, %r8
leaq (%r8,%r8,2), %r8
leaq (%rsi,%rsi,2), %r14
movq -0x30(%rbp), %r15
leaq (%r15,%r14,4), %r14
subl %esi, %ebx
incl %ebx
movl %r10d, %esi
movslq %esi, %r15
movss (%rcx,%r15,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x15733
jnp 0x159f6
movss (%rdi,%r8), %xmm2
mulss %xmm1, %xmm2
addss -0x8(%r14), %xmm2
movss %xmm2, -0x8(%r14)
movss 0x4(%rdi,%r8), %xmm2
mulss %xmm1, %xmm2
addss -0x4(%r14), %xmm2
movss %xmm2, -0x4(%r14)
mulss 0x8(%rdi,%r8), %xmm1
addss (%r14), %xmm1
movss %xmm1, (%r14)
addq $0xc, %r14
incl %esi
decl %ebx
jne 0x1571f
incq %r11
addl %edx, %r10d
cmpq %r9, %r11
jne 0x156f0
jmp 0x159c8
testl %esi, %esi
jle 0x159c8
movl %esi, %esi
movq %rsi, -0x40(%rbp)
addq $0xc, -0x30(%rbp)
xorl %r10d, %r10d
xorps %xmm0, %xmm0
xorl %r11d, %r11d
movslq (%rax,%r11,8), %rsi
movl 0x4(%rax,%r11,8), %ebx
cmpl %ebx, %esi
jg 0x15865
movq %r11, %r8
subq -0x38(%rbp), %r8
leaq (,%r8,4), %r14
leaq 0x1(,%r8,4), %r15
leaq 0x2(,%r8,4), %r12
leaq 0x3(,%r8,4), %r13
movq %rsi, %r8
shlq $0x4, %r8
addq -0x30(%rbp), %r8
subl %esi, %ebx
incl %ebx
movl %r10d, %esi
movslq %esi, %r9
movss (%rcx,%r9,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x15809
jnp 0x15a15
movss (%rdi,%r14,4), %xmm2
mulss %xmm1, %xmm2
addss -0xc(%r8), %xmm2
movss %xmm2, -0xc(%r8)
movss (%rdi,%r15,4), %xmm2
mulss %xmm1, %xmm2
addss -0x8(%r8), %xmm2
movss %xmm2, -0x8(%r8)
movss (%rdi,%r12,4), %xmm2
mulss %xmm1, %xmm2
addss -0x4(%r8), %xmm2
movss %xmm2, -0x4(%r8)
mulss (%rdi,%r13,4), %xmm1
addss (%r8), %xmm1
movss %xmm1, (%r8)
addq $0x10, %r8
incl %esi
decl %ebx
jne 0x157f5
incq %r11
addl %edx, %r10d
cmpq -0x40(%rbp), %r11
jne 0x157ab
jmp 0x159c8
testl %esi, %esi
jle 0x159c8
movl %esi, %r9d
addq $0x4, -0x30(%rbp)
xorl %r10d, %r10d
xorps %xmm0, %xmm0
xorl %r11d, %r11d
movslq (%rax,%r11,8), %r15
movl 0x4(%rax,%r11,8), %r8d
cmpl %r8d, %r15d
jg 0x1590c
movq %r11, %rsi
subq -0x38(%rbp), %rsi
leaq 0x1(,%rsi,2), %rbx
addq %rsi, %rsi
movq -0x30(%rbp), %r14
leaq (%r14,%r15,8), %r14
subl %r15d, %r8d
incl %r8d
xorl %r15d, %r15d
leal (%r10,%r15), %r12d
movslq %r12d, %r12
movss (%rcx,%r12,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x158dc
jnp 0x15a34
movss (%rdi,%rsi,4), %xmm2
mulss %xmm1, %xmm2
addss -0x4(%r14,%r15,8), %xmm2
movss %xmm2, -0x4(%r14,%r15,8)
mulss (%rdi,%rbx,4), %xmm1
addss (%r14,%r15,8), %xmm1
movss %xmm1, (%r14,%r15,8)
incq %r15
cmpl %r15d, %r8d
jne 0x158c4
incq %r11
addq %rdx, %r10
cmpq %r9, %r11
jne 0x15893
jmp 0x159c8
testl %esi, %esi
jle 0x159c8
movl %esi, %edi
leaq (,%r9,4), %rbx
shlq $0x2, %r8
movq -0x38(%rbp), %rsi
imulq %r9, %rsi
shlq $0x2, %rsi
subq %rsi, %r8
addq %r8, %r11
xorl %r8d, %r8d
xorps %xmm0, %xmm0
movslq (%rax,%r8,8), %r14
movl 0x4(%rax,%r8,8), %r15d
cmpl %r15d, %r14d
jg 0x159bd
movl %r8d, %r12d
imull %edx, %r12d
subl %r14d, %r12d
incl %r15d
movq %rbx, %rsi
imulq %r14, %rsi
addq -0x30(%rbp), %rsi
leal (%r12,%r14), %r13d
movslq %r13d, %r13
movss (%rcx,%r13,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x1598c
jnp 0x15a53
testl %r9d, %r9d
jle 0x159b2
xorl %r13d, %r13d
movss (%r11,%r13,4), %xmm2
mulss %xmm1, %xmm2
addss (%rsi,%r13,4), %xmm2
movss %xmm2, (%rsi,%r13,4)
incq %r13
cmpq %r13, %r10
jne 0x15994
incq %r14
addq %rbx, %rsi
cmpl %r14d, %r15d
jne 0x15974
incq %r8
addq %rbx, %r11
cmpq %rdi, %r8
jne 0x1594e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3894(%rip), %rdi      # 0x19272
leaq 0x2e93(%rip), %rsi      # 0x18878
leaq 0x3937(%rip), %rcx      # 0x19323
movl $0x60c, %edx            # imm = 0x60C
callq 0x1090
leaq 0x3875(%rip), %rdi      # 0x19272
leaq 0x2e74(%rip), %rsi      # 0x18878
leaq 0x3918(%rip), %rcx      # 0x19323
movl $0x637, %edx            # imm = 0x637
callq 0x1090
leaq 0x3856(%rip), %rdi      # 0x19272
leaq 0x2e55(%rip), %rsi      # 0x18878
leaq 0x38f9(%rip), %rcx      # 0x19323
movl $0x64e, %edx            # imm = 0x64E
callq 0x1090
leaq 0x3837(%rip), %rdi      # 0x19272
leaq 0x2e36(%rip), %rsi      # 0x18878
leaq 0x38da(%rip), %rcx      # 0x19323
movl $0x621, %edx            # imm = 0x621
callq 0x1090
leaq 0x3818(%rip), %rdi      # 0x19272
leaq 0x2e17(%rip), %rsi      # 0x18878
leaq 0x38bb(%rip), %rcx      # 0x19323
movl $0x667, %edx            # imm = 0x667
callq 0x1090
leaq 0x3881(%rip), %rdi      # 0x192fa
leaq 0x2df8(%rip), %rsi      # 0x18878
leaq 0x389c(%rip), %rcx      # 0x19323
movl $0x5fa, %edx            # imm = 0x5FA
callq 0x1090