// File: /workspace/github_cpp_makefile_star2_O3/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 0x1760(%rip), %xmm0     # 0x16008
ja 0x14d1b
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 0x14bc9
leaq (%r11,%r8,4), %rdi
leaq 0x1a71(%rip), %r8       # 0x1636c
movslq (%r8,%rbx,4), %r9
addq %r8, %r9
jmpq *%r9
testl %esi, %esi
jle 0x14c71
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 0x14970
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 0x14956
jnp 0x14c80
mulss (%rdi,%r8,4), %xmm1
addss (%rbx,%r14,4), %xmm1
movss %xmm1, (%rbx,%r14,4)
incq %r14
cmpl %r14d, %esi
jne 0x1493e
incq %r11
addq %rdx, %r10
cmpq %r9, %r11
jne 0x14919
jmp 0x14c71
testl %esi, %esi
jle 0x14c71
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 0x14a24
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 0x149dc
jnp 0x14c9f
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 0x149c8
incq %r11
addl %edx, %r10d
cmpq %r9, %r11
jne 0x14999
jmp 0x14c71
testl %esi, %esi
jle 0x14c71
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 0x14b0e
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 0x14ab2
jnp 0x14cbe
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 0x14a9e
incq %r11
addl %edx, %r10d
cmpq -0x40(%rbp), %r11
jne 0x14a54
jmp 0x14c71
testl %esi, %esi
jle 0x14c71
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 0x14bb5
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 0x14b85
jnp 0x14cdd
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 0x14b6d
incq %r11
addq %rdx, %r10
cmpq %r9, %r11
jne 0x14b3c
jmp 0x14c71
testl %esi, %esi
jle 0x14c71
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 0x14c66
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 0x14c35
jnp 0x14cfc
testl %r9d, %r9d
jle 0x14c5b
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 0x14c3d
incq %r14
addq %rbx, %rsi
cmpl %r14d, %r15d
jne 0x14c1d
incq %r8
addq %rbx, %r11
cmpq %rdi, %r8
jne 0x14bf7
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x35b5(%rip), %rdi      # 0x1823c
leaq 0x2be6(%rip), %rsi      # 0x17874
leaq 0x3658(%rip), %rcx      # 0x182ed
movl $0x60c, %edx            # imm = 0x60C
callq 0x1080
leaq 0x3596(%rip), %rdi      # 0x1823c
leaq 0x2bc7(%rip), %rsi      # 0x17874
leaq 0x3639(%rip), %rcx      # 0x182ed
movl $0x637, %edx            # imm = 0x637
callq 0x1080
leaq 0x3577(%rip), %rdi      # 0x1823c
leaq 0x2ba8(%rip), %rsi      # 0x17874
leaq 0x361a(%rip), %rcx      # 0x182ed
movl $0x64e, %edx            # imm = 0x64E
callq 0x1080
leaq 0x3558(%rip), %rdi      # 0x1823c
leaq 0x2b89(%rip), %rsi      # 0x17874
leaq 0x35fb(%rip), %rcx      # 0x182ed
movl $0x621, %edx            # imm = 0x621
callq 0x1080
leaq 0x3539(%rip), %rdi      # 0x1823c
leaq 0x2b6a(%rip), %rsi      # 0x17874
leaq 0x35dc(%rip), %rcx      # 0x182ed
movl $0x667, %edx            # imm = 0x667
callq 0x1080
leaq 0x35a2(%rip), %rdi      # 0x182c4
leaq 0x2b4b(%rip), %rsi      # 0x17874
leaq 0x35bd(%rip), %rcx      # 0x182ed
movl $0x5fa, %edx            # imm = 0x5FA
callq 0x1080