// File: /workspace/github_c_makefile_star2_O3/algorithm-archivists[P]GathVL/src/objects/../../include/stb_image_resize.h
// Function: stbir__resample_horizontal_downsample(stbir__info*, float*)
static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, float* output_buffer)
{
    int x, k;
    int input_w = stbir_info->input_w;
    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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x8(%rsp)
movss 0x44(%rdi), %xmm0
ucomiss 0x3e65(%rip), %xmm0     # 0x233fc
ja 0x1fa1a
movslq 0x4c(%rdi), %r9
movl %r9d, %r10d
movq 0x98(%rdi), %r11
movslq 0xb8(%rdi), %rsi
movl %esi, %eax
imull %r9d, %eax
movslq %eax, %r14
movq 0x70(%rdi), %rax
movq 0x78(%rdi), %rcx
movl 0xa8(%rdi), %edx
movq %rsi, 0x10(%rsp)
leal (%rsi,%rsi), %r8d
addl 0x8(%rdi), %r8d
leal -0x1(%r10), %ebx
cmpl $0x3, %ebx
ja 0x1f8c7
leaq (%r11,%r14,4), %rdi
leaq 0x42de(%rip), %r9       # 0x238cc
movslq (%r9,%rbx,4), %r10
addq %r9, %r10
jmpq *%r10
testl %r8d, %r8d
jle 0x1f970
movl %r8d, %r9d
xorl %r10d, %r10d
xorps %xmm0, %xmm0
xorl %r11d, %r11d
movq 0x8(%rsp), %rsi
movslq (%rax,%r11,8), %r15
movl 0x4(%rax,%r11,8), %r8d
cmpl %r8d, %r15d
jg 0x1f666
movq %r11, %rbx
subq 0x10(%rsp), %rbx
leaq (%rsi,%r15,4), %r14
subl %r15d, %r8d
incl %r8d
xorl %r15d, %r15d
leal (%r10,%r15), %ebp
movslq %ebp, %r12
movss (%rcx,%r12,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x1f64d
jnp 0x1f97f
mulss (%rdi,%rbx,4), %xmm1
addss (%r14,%r15,4), %xmm1
movss %xmm1, (%r14,%r15,4)
incq %r15
cmpl %r15d, %r8d
jne 0x1f635
incq %r11
addq %rdx, %r10
cmpq %r9, %r11
jne 0x1f612
jmp 0x1f970
testl %r8d, %r8d
jle 0x1f970
movl %r8d, %r9d
addq $0x8, 0x8(%rsp)
xorl %r10d, %r10d
xorps %xmm0, %xmm0
xorl %r11d, %r11d
movq 0x8(%rsp), %rsi
movslq (%rax,%r11,8), %r8
movl 0x4(%rax,%r11,8), %ebx
cmpl %ebx, %r8d
jg 0x1f721
movq %r11, %r14
subq 0x10(%rsp), %r14
shlq $0x2, %r14
leaq (%r14,%r14,2), %r14
leaq (%r8,%r8,2), %r15
leaq (%rsi,%r15,4), %r15
subl %r8d, %ebx
incl %ebx
movl %r10d, %r8d
movslq %r8d, %r12
movss (%rcx,%r12,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x1f6d8
jnp 0x1f99e
movss (%rdi,%r14), %xmm2
mulss %xmm1, %xmm2
addss -0x8(%r15), %xmm2
movss %xmm2, -0x8(%r15)
movss 0x4(%rdi,%r14), %xmm2
mulss %xmm1, %xmm2
addss -0x4(%r15), %xmm2
movss %xmm2, -0x4(%r15)
mulss 0x8(%rdi,%r14), %xmm1
addss (%r15), %xmm1
movss %xmm1, (%r15)
addq $0xc, %r15
incl %r8d
decl %ebx
jne 0x1f6c4
incq %r11
addl %edx, %r10d
cmpq %r9, %r11
jne 0x1f696
jmp 0x1f970
testl %r8d, %r8d
jle 0x1f970
movl %r8d, %r9d
addq $0xc, 0x8(%rsp)
xorl %r10d, %r10d
xorps %xmm0, %xmm0
xorl %r11d, %r11d
movslq (%rax,%r11,8), %r8
movl 0x4(%rax,%r11,8), %ebx
cmpl %ebx, %r8d
jg 0x1f808
movq %r11, %r13
subq 0x10(%rsp), %r13
leaq (,%r13,4), %r14
leaq 0x1(,%r13,4), %r15
leaq 0x2(,%r13,4), %r12
leaq 0x3(,%r13,4), %r13
movq %r8, %rbp
shlq $0x4, %rbp
addq 0x8(%rsp), %rbp
subl %r8d, %ebx
incl %ebx
movl %r10d, %r8d
movslq %r8d, %rsi
movss (%rcx,%rsi,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x1f7b1
jnp 0x1f9bd
movss (%rdi,%r14,4), %xmm2
mulss %xmm1, %xmm2
addss -0xc(%rbp), %xmm2
movss %xmm2, -0xc(%rbp)
movss (%rdi,%r15,4), %xmm2
mulss %xmm1, %xmm2
addss -0x8(%rbp), %xmm2
movss %xmm2, -0x8(%rbp)
movss (%rdi,%r12,4), %xmm2
mulss %xmm1, %xmm2
addss -0x4(%rbp), %xmm2
movss %xmm2, -0x4(%rbp)
mulss (%rdi,%r13,4), %xmm1
addss (%rbp), %xmm1
movss %xmm1, (%rbp)
addq $0x10, %rbp
incl %r8d
decl %ebx
jne 0x1f79e
incq %r11
addl %edx, %r10d
cmpq %r9, %r11
jne 0x1f750
jmp 0x1f970
testl %r8d, %r8d
jle 0x1f970
movl %r8d, %r9d
addq $0x4, 0x8(%rsp)
xorl %r10d, %r10d
xorps %xmm0, %xmm0
xorl %r11d, %r11d
movq 0x8(%rsp), %rsi
movslq (%rax,%r11,8), %r12
movl 0x4(%rax,%r11,8), %ebx
cmpl %ebx, %r12d
jg 0x1f8b3
movq %r11, %r8
subq 0x10(%rsp), %r8
leaq 0x1(,%r8,2), %r14
addq %r8, %r8
leaq (%rsi,%r12,8), %r15
subl %r12d, %ebx
incl %ebx
xorl %r12d, %r12d
leal (%r10,%r12), %ebp
movslq %ebp, %r13
movss (%rcx,%r13,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x1f881
jnp 0x1f9dc
movss (%rdi,%r8,4), %xmm2
mulss %xmm1, %xmm2
addss -0x4(%r15,%r12,8), %xmm2
movss %xmm2, -0x4(%r15,%r12,8)
mulss (%rdi,%r14,4), %xmm1
addss (%r15,%r12,8), %xmm1
movss %xmm1, (%r15,%r12,8)
incq %r12
cmpl %r12d, %ebx
jne 0x1f869
incq %r11
addq %rdx, %r10
cmpq %r9, %r11
jne 0x1f83c
jmp 0x1f970
testl %r8d, %r8d
jle 0x1f970
movl %r8d, %edi
leaq (,%r9,4), %rbx
shlq $0x2, %r14
movq 0x10(%rsp), %rsi
imulq %r9, %rsi
shlq $0x2, %rsi
subq %rsi, %r14
addq %r14, %r11
xorl %r8d, %r8d
xorps %xmm0, %xmm0
movslq (%rax,%r8,8), %r14
movl 0x4(%rax,%r8,8), %ebp
cmpl %ebp, %r14d
jg 0x1f965
movl %r8d, %r15d
imull %edx, %r15d
subl %r14d, %r15d
incl %ebp
movq %rbx, %r12
imulq %r14, %r12
addq 0x8(%rsp), %r12
leal (%r15,%r14), %esi
movslq %esi, %rsi
movss (%rcx,%rsi,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x1f935
jnp 0x1f9fb
testl %r9d, %r9d
jle 0x1f95a
xorl %esi, %esi
movss (%r11,%rsi,4), %xmm2
mulss %xmm1, %xmm2
addss (%r12,%rsi,4), %xmm2
movss %xmm2, (%r12,%rsi,4)
incq %rsi
cmpq %rsi, %r10
jne 0x1f93c
incq %r14
addq %rbx, %r12
cmpl %r14d, %ebp
jne 0x1f91e
incq %r8
addq %rbx, %r11
cmpq %rdi, %r8
jne 0x1f8f8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5f9b(%rip), %rdi      # 0x25921
leaq 0x55f1(%rip), %rsi      # 0x24f7e
leaq 0x603e(%rip), %rcx      # 0x259d2
movl $0x610, %edx            # imm = 0x610
callq 0x5130
leaq 0x5f7c(%rip), %rdi      # 0x25921
leaq 0x55d2(%rip), %rsi      # 0x24f7e
leaq 0x601f(%rip), %rcx      # 0x259d2
movl $0x63b, %edx            # imm = 0x63B
callq 0x5130
leaq 0x5f5d(%rip), %rdi      # 0x25921
leaq 0x55b3(%rip), %rsi      # 0x24f7e
leaq 0x6000(%rip), %rcx      # 0x259d2
movl $0x652, %edx            # imm = 0x652
callq 0x5130
leaq 0x5f3e(%rip), %rdi      # 0x25921
leaq 0x5594(%rip), %rsi      # 0x24f7e
leaq 0x5fe1(%rip), %rcx      # 0x259d2
movl $0x625, %edx            # imm = 0x625
callq 0x5130
leaq 0x5f1f(%rip), %rdi      # 0x25921
leaq 0x5575(%rip), %rsi      # 0x24f7e
leaq 0x5fc2(%rip), %rcx      # 0x259d2
movl $0x66b, %edx            # imm = 0x66B
callq 0x5130
leaq 0x5f88(%rip), %rdi      # 0x259a9
leaq 0x5556(%rip), %rsi      # 0x24f7e
leaq 0x5fa3(%rip), %rcx      # 0x259d2
movl $0x5fe, %edx            # imm = 0x5FE
callq 0x5130