// File: /workspace/github_c_makefile_star2_O1/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 0x4336(%rip), %xmm0     # 0x2337c
ja 0x1f4c9
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 0x1f376
leaq (%r11,%r14,4), %rdi
leaq 0x46ef(%rip), %r9       # 0x2378c
movslq (%r9,%rbx,4), %r10
addq %r9, %r10
jmpq *%r10
testl %r8d, %r8d
jle 0x1f41f
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 0x1f115
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 0x1f0fc
jnp 0x1f42e
mulss (%rdi,%rbx,4), %xmm1
addss (%r14,%r15,4), %xmm1
movss %xmm1, (%r14,%r15,4)
incq %r15
cmpl %r15d, %r8d
jne 0x1f0e4
incq %r11
addq %rdx, %r10
cmpq %r9, %r11
jne 0x1f0c1
jmp 0x1f41f
testl %r8d, %r8d
jle 0x1f41f
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 0x1f1d0
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 0x1f187
jnp 0x1f44d
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 0x1f173
incq %r11
addl %edx, %r10d
cmpq %r9, %r11
jne 0x1f145
jmp 0x1f41f
testl %r8d, %r8d
jle 0x1f41f
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 0x1f2b7
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 0x1f260
jnp 0x1f46c
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 0x1f24d
incq %r11
addl %edx, %r10d
cmpq %r9, %r11
jne 0x1f1ff
jmp 0x1f41f
testl %r8d, %r8d
jle 0x1f41f
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 0x1f362
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 0x1f330
jnp 0x1f48b
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 0x1f318
incq %r11
addq %rdx, %r10
cmpq %r9, %r11
jne 0x1f2eb
jmp 0x1f41f
testl %r8d, %r8d
jle 0x1f41f
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 0x1f414
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 0x1f3e4
jnp 0x1f4aa
testl %r9d, %r9d
jle 0x1f409
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 0x1f3eb
incq %r14
addq %rbx, %r12
cmpl %r14d, %ebp
jne 0x1f3cd
incq %r8
addq %rbx, %r11
cmpq %rdi, %r8
jne 0x1f3a7
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x63ea(%rip), %rdi      # 0x2581f
leaq 0x5a0e(%rip), %rsi      # 0x24e4a
leaq 0x648d(%rip), %rcx      # 0x258d0
movl $0x610, %edx            # imm = 0x610
callq 0x5130
leaq 0x63cb(%rip), %rdi      # 0x2581f
leaq 0x59ef(%rip), %rsi      # 0x24e4a
leaq 0x646e(%rip), %rcx      # 0x258d0
movl $0x63b, %edx            # imm = 0x63B
callq 0x5130
leaq 0x63ac(%rip), %rdi      # 0x2581f
leaq 0x59d0(%rip), %rsi      # 0x24e4a
leaq 0x644f(%rip), %rcx      # 0x258d0
movl $0x652, %edx            # imm = 0x652
callq 0x5130
leaq 0x638d(%rip), %rdi      # 0x2581f
leaq 0x59b1(%rip), %rsi      # 0x24e4a
leaq 0x6430(%rip), %rcx      # 0x258d0
movl $0x625, %edx            # imm = 0x625
callq 0x5130
leaq 0x636e(%rip), %rdi      # 0x2581f
leaq 0x5992(%rip), %rsi      # 0x24e4a
leaq 0x6411(%rip), %rcx      # 0x258d0
movl $0x66b, %edx            # imm = 0x66B
callq 0x5130
leaq 0x63d7(%rip), %rdi      # 0x258a7
leaq 0x5973(%rip), %rsi      # 0x24e4a
leaq 0x63f2(%rip), %rcx      # 0x258d0
movl $0x5fe, %edx            # imm = 0x5FE
callq 0x5130