// File: /workspace/github_cpp_makefile_star2_O2/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 $0x28, %rsp
movss 0x44(%rdi), %xmm0
ucomiss 0x192e(%rip), %xmm0     # 0x10008
ja 0xeaf7
movslq 0x4c(%rdi), %r10
movq 0x98(%rdi), %r11
movslq 0xb8(%rdi), %r8
movl %r8d, %eax
imull %r10d, %eax
movslq %eax, %rdx
movq 0x70(%rdi), %r12
movq 0x78(%rdi), %rcx
movl 0xa8(%rdi), %r13d
movq %r8, -0x30(%rbp)
leal (%r8,%r8), %eax
addl 0x8(%rdi), %eax
leal -0x1(%r10), %r8d
cmpl $0x3, %r8d
ja 0xe9a9
leaq (%r11,%rdx,4), %rdi
leaq 0x1b45(%rip), %rdx      # 0x10274
movslq (%rdx,%r8,4), %r8
addq %rdx, %r8
jmpq *%r8
xorl %r10d, %r10d
testl %eax, %eax
cmovlel %r10d, %eax
xorps %xmm0, %xmm0
xorl %edx, %edx
cmpq %rax, %rdx
je 0xea4d
movslq (%r12,%rdx,8), %r8
movslq 0x4(%r12,%rdx,8), %r9
movq %rdx, %r11
subq -0x30(%rbp), %r11
movl %r10d, %ebx
cmpq %r9, %r8
jg 0xe795
movslq %ebx, %r14
movss (%rcx,%r14,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0xe77c
jnp 0xea7b
mulss (%rdi,%r11,4), %xmm1
addss (%rsi,%r8,4), %xmm1
movss %xmm1, (%rsi,%r8,4)
incq %r8
incl %ebx
jmp 0xe763
incq %rdx
addl %r13d, %r10d
jmp 0xe747
xorl %r10d, %r10d
testl %eax, %eax
cmovlel %r10d, %eax
addq $0x8, %rsi
xorps %xmm0, %xmm0
xorl %r11d, %r11d
cmpq %rax, %r11
je 0xea4d
movslq (%r12,%r11,8), %rdx
movslq 0x4(%r12,%r11,8), %r9
movq %r11, %r8
subq -0x30(%rbp), %r8
imulq $0xc, %r8, %r8
imulq $0xc, %rdx, %rbx
addq %rsi, %rbx
movl %r10d, %r14d
cmpq %r9, %rdx
jg 0xe834
movslq %r14d, %r15
movss (%rcx,%r15,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0xe7f0
jnp 0xea5c
movss (%rdi,%r8), %xmm2
mulss %xmm1, %xmm2
addss -0x8(%rbx), %xmm2
movss %xmm2, -0x8(%rbx)
movss 0x4(%rdi,%r8), %xmm2
mulss %xmm1, %xmm2
addss -0x4(%rbx), %xmm2
movss %xmm2, -0x4(%rbx)
mulss 0x8(%rdi,%r8), %xmm1
addss (%rbx), %xmm1
movss %xmm1, (%rbx)
incq %rdx
addq $0xc, %rbx
incl %r14d
jmp 0xe7d7
incq %r11
addl %r13d, %r10d
jmp 0xe7b0
xorl %r10d, %r10d
testl %eax, %eax
cmovlel %r10d, %eax
movq %rax, -0x38(%rbp)
addq $0xc, %rsi
xorps %xmm0, %xmm0
xorl %r11d, %r11d
movq %r12, -0x48(%rbp)
movl %r13d, -0x3c(%rbp)
cmpq -0x38(%rbp), %r11
je 0xea4d
movslq (%r12,%r11,8), %r9
movslq 0x4(%r12,%r11,8), %r14
movq %r11, %rdx
subq -0x30(%rbp), %rdx
leaq (,%rdx,4), %r15
leaq 0x1(,%rdx,4), %r12
leaq 0x2(,%rdx,4), %r13
leaq 0x3(,%rdx,4), %rdx
movq %r9, %rbx
shlq $0x4, %rbx
addq %rsi, %rbx
movl %r10d, %r8d
cmpq %r14, %r9
jg 0xe912
movslq %r8d, %rax
movss (%rcx,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0xe8bd
jnp 0xea9a
movss (%rdi,%r15,4), %xmm2
mulss %xmm1, %xmm2
addss -0xc(%rbx), %xmm2
movss %xmm2, -0xc(%rbx)
movss (%rdi,%r12,4), %xmm2
mulss %xmm1, %xmm2
addss -0x8(%rbx), %xmm2
movss %xmm2, -0x8(%rbx)
movss (%rdi,%r13,4), %xmm2
mulss %xmm1, %xmm2
addss -0x4(%rbx), %xmm2
movss %xmm2, -0x4(%rbx)
mulss (%rdi,%rdx,4), %xmm1
addss (%rbx), %xmm1
movss %xmm1, (%rbx)
incq %r9
incl %r8d
addq $0x10, %rbx
jmp 0xe8a5
incq %r11
movl -0x3c(%rbp), %r13d
addl %r13d, %r10d
movq -0x48(%rbp), %r12
jmp 0xe85e
xorl %r10d, %r10d
testl %eax, %eax
cmovlel %r10d, %eax
xorps %xmm0, %xmm0
xorl %r11d, %r11d
cmpq %rax, %r11
je 0xea4d
movslq (%r12,%r11,8), %rdx
movslq 0x4(%r12,%r11,8), %r8
movq %r11, %r9
subq -0x30(%rbp), %r9
leaq 0x1(,%r9,2), %rbx
addq %r9, %r9
movl %r10d, %r14d
cmpq %r8, %rdx
jg 0xe9a1
movslq %r14d, %r15
movss (%rcx,%r15,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0xe974
jnp 0xeab9
movss (%rdi,%r9,4), %xmm2
mulss %xmm1, %xmm2
addss (%rsi,%rdx,8), %xmm2
movss %xmm2, (%rsi,%rdx,8)
mulss (%rdi,%rbx,4), %xmm1
addss 0x4(%rsi,%rdx,8), %xmm1
movss %xmm1, 0x4(%rsi,%rdx,8)
incq %rdx
incl %r14d
jmp 0xe95b
incq %r11
addl %r13d, %r10d
jmp 0xe934
xorl %edi, %edi
testl %r10d, %r10d
movl $0x0, %ebx
cmovgl %r10d, %ebx
testl %eax, %eax
cmovlel %edi, %eax
movq %rax, -0x38(%rbp)
shlq $0x2, %rdx
movq -0x30(%rbp), %rax
imulq %r10, %rax
shlq $0x2, %r10
shlq $0x2, %rax
subq %rax, %rdx
addq %rdx, %r11
xorps %xmm0, %xmm0
cmpq -0x38(%rbp), %rdi
je 0xea4d
movslq (%r12,%rdi,8), %r9
movslq 0x4(%r12,%rdi,8), %r14
movl %r13d, %edx
imull %edi, %edx
subl %r9d, %edx
movq %r10, %r15
imulq %r9, %r15
addq %rsi, %r15
cmpq %r14, %r9
jg 0xea45
leal (%rdx,%r9), %eax
cltq
movss (%rcx,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0xea1a
jnp 0xead8
xorl %r8d, %r8d
cmpq %r8, %rbx
je 0xea3d
movss (%r11,%r8,4), %xmm2
mulss %xmm1, %xmm2
addss (%r15,%r8,4), %xmm2
movss %xmm2, (%r15,%r8,4)
incq %r8
jmp 0xea1d
incq %r9
addq %r10, %r15
jmp 0xe9ff
incq %rdi
addq %r10, %r11
jmp 0xe9dd
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x36f9(%rip), %rdi      # 0x1215c
leaq 0x2d2a(%rip), %rsi      # 0x11794
leaq 0x379c(%rip), %rcx      # 0x1220d
movl $0x637, %edx            # imm = 0x637
callq 0x1080
leaq 0x36da(%rip), %rdi      # 0x1215c
leaq 0x2d0b(%rip), %rsi      # 0x11794
leaq 0x377d(%rip), %rcx      # 0x1220d
movl $0x60c, %edx            # imm = 0x60C
callq 0x1080
leaq 0x36bb(%rip), %rdi      # 0x1215c
leaq 0x2cec(%rip), %rsi      # 0x11794
leaq 0x375e(%rip), %rcx      # 0x1220d
movl $0x64e, %edx            # imm = 0x64E
callq 0x1080
leaq 0x369c(%rip), %rdi      # 0x1215c
leaq 0x2ccd(%rip), %rsi      # 0x11794
leaq 0x373f(%rip), %rcx      # 0x1220d
movl $0x621, %edx            # imm = 0x621
callq 0x1080
leaq 0x367d(%rip), %rdi      # 0x1215c
leaq 0x2cae(%rip), %rsi      # 0x11794
leaq 0x3720(%rip), %rcx      # 0x1220d
movl $0x667, %edx            # imm = 0x667
callq 0x1080
leaq 0x36e6(%rip), %rdi      # 0x121e4
leaq 0x2c8f(%rip), %rsi      # 0x11794
leaq 0x3701(%rip), %rcx      # 0x1220d
movl $0x5fa, %edx            # imm = 0x5FA
callq 0x1080