// File: /workspace/github_c_makefile_star2_O0/algorithm-archivists[P]GathVL/src/objects/../../include/stb_image_resize.h
// Function: stbir__calculate_coefficients_downsample(stbir_filter, float, int, int, float, stbir__contributors*, float*)
static void stbir__calculate_coefficients_downsample(stbir_filter filter, float scale_ratio, int out_first_pixel, int out_last_pixel, float out_center_of_in, stbir__contributors* contributor, float* coefficient_group)
{
    int i;

     STBIR_ASSERT(out_last_pixel - out_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(scale_ratio) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical.

    contributor->n0 = out_first_pixel;
    contributor->n1 = out_last_pixel;

    STBIR_ASSERT(contributor->n1 >= contributor->n0);

    for (i = 0; i <= out_last_pixel - out_first_pixel; i++)
    {
        float out_pixel_center = (float)(i + out_first_pixel) + 0.5f;
        float x = out_pixel_center - out_center_of_in;
        coefficient_group[i] = stbir__filter_info_table[filter].kernel(x, scale_ratio) * scale_ratio;
    }

    STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(out_last_pixel + 1) + 0.5f - out_center_of_in, scale_ratio) == 0);

    for (i = out_last_pixel - out_first_pixel; i >= 0; i--)
    {
        if (coefficient_group[i])
            break;

        // This line has no weight. We can skip it.
        contributor->n1 = contributor->n0 + i - 1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movss %xmm0, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movss %xmm1, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl -0x10(%rbp), %eax
subl -0xc(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x1d4f8(%rip), %rax     # 0x4f5a0
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movss -0x8(%rbp), %xmm0
callq *%rax
movss 0x92fa(%rip), %xmm1     # 0x3b3bc
mulss %xmm1, %xmm0
callq 0x35bf0
movl -0x38(%rbp), %eax
cvttss2si %xmm0, %ecx
cmpl %ecx, %eax
jg 0x320d8
jmp 0x320f7
leaq 0xaddc(%rip), %rdi      # 0x3cebb
leaq 0xa833(%rip), %rsi      # 0x3c919
movl $0x441, %edx            # imm = 0x441
leaq 0xae32(%rip), %rcx      # 0x3cf24
callq 0x50f0
movl -0xc(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0x10(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jl 0x3211b
jmp 0x3213a
leaq 0xace3(%rip), %rdi      # 0x3ce05
leaq 0xa7f0(%rip), %rsi      # 0x3c919
movl $0x446, %edx            # imm = 0x446
leaq 0xadef(%rip), %rcx      # 0x3cf24
callq 0x50f0
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl -0x10(%rbp), %ecx
subl -0xc(%rbp), %ecx
cmpl %ecx, %eax
jg 0x321b7
movl -0x2c(%rbp), %eax
addl -0xc(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss 0x9254(%rip), %xmm1     # 0x3b3b4
addss %xmm1, %xmm0
movss %xmm0, -0x30(%rbp)
movss -0x30(%rbp), %xmm0
subss -0x14(%rbp), %xmm0
movss %xmm0, -0x34(%rbp)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x1d41c(%rip), %rax     # 0x4f5a0
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movss -0x34(%rbp), %xmm0
movss -0x8(%rbp), %xmm1
callq *%rax
mulss -0x8(%rbp), %xmm0
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x32141
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x1d3dd(%rip), %rax     # 0x4f5a0
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl -0x10(%rbp), %ecx
addl $0x1, %ecx
cvtsi2ss %ecx, %xmm0
movss 0x91d5(%rip), %xmm1     # 0x3b3b4
addss %xmm1, %xmm0
subss -0x14(%rbp), %xmm0
movss -0x8(%rbp), %xmm1
callq *%rax
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x321fb
jp 0x321fb
jmp 0x3221a
leaq 0xad96(%rip), %rdi      # 0x3cf98
leaq 0xa710(%rip), %rsi      # 0x3c919
movl $0x44f, %edx            # imm = 0x44F
leaq 0xad0f(%rip), %rcx      # 0x3cf24
callq 0x50f0
movl -0x10(%rbp), %eax
subl -0xc(%rbp), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jl 0x32262
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x32242
jp 0x32242
jmp 0x32244
jmp 0x32262
movq -0x20(%rbp), %rax
movl (%rax), %ecx
addl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x32223
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)