// File: lunasorcery[P]brailify/./stb/stb_image_resize.h
// Function: stbir__calculate_filters(stbir__info*, stbir__contributors*, float*, stbir_filter, float, float, int, int)
static void stbir__calculate_filters(stbir__info* stbir_info, stbir__contributors* contributors, float* coefficients, stbir_filter filter, float scale_ratio, float shift, int input_size, int output_size)
{
    int n;
    int total_contributors = stbir__get_contributors(scale_ratio, filter, input_size, output_size);

    if (stbir__use_upsampling(scale_ratio))
    {
        float out_pixels_radius = stbir__filter_info_table[filter].support(1 / scale_ratio) * scale_ratio;

        // Looping through out pixels
        for (n = 0; n < total_contributors; n++)
        {
            float in_center_of_out; // Center of the current out pixel in the in pixel space
            int in_first_pixel, in_last_pixel;

            stbir__calculate_sample_range_upsample(n, out_pixels_radius, scale_ratio, shift, &in_first_pixel, &in_last_pixel, &in_center_of_out);

            stbir__calculate_coefficients_upsample(stbir_info, filter, scale_ratio, in_first_pixel, in_last_pixel, in_center_of_out, stbir__get_contributor(contributors, n), stbir__get_coefficient(coefficients, filter, scale_ratio, n, 0));
        }
    }
    else
    {
        float in_pixels_radius = stbir__filter_info_table[filter].support(scale_ratio) / scale_ratio;

        // Looping through in pixels
        for (n = 0; n < total_contributors; n++)
        {
            float out_center_of_in; // Center of the current out pixel in the in pixel space
            int out_first_pixel, out_last_pixel;
            int n_adjusted = n - stbir__get_filter_pixel_margin(filter, scale_ratio);

            stbir__calculate_sample_range_downsample(n_adjusted, in_pixels_radius, scale_ratio, shift, &out_first_pixel, &out_last_pixel, &out_center_of_in);

            stbir__calculate_coefficients_downsample(stbir_info, filter, scale_ratio, out_first_pixel, out_last_pixel, out_center_of_in, stbir__get_contributor(contributors, n), stbir__get_coefficient(coefficients, filter, scale_ratio, n, 0));
        }

        stbir__normalize_downsample_coefficients(stbir_info, contributors, coefficients, filter, scale_ratio, shift, input_size, output_size);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movss %xmm0, -0x20(%rbp)
movss %xmm1, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movss -0x20(%rbp), %xmm0
movl -0x1c(%rbp), %edi
movl -0x28(%rbp), %esi
movl -0x2c(%rbp), %edx
callq 0x1a650
movl %eax, -0x34(%rbp)
movss -0x20(%rbp), %xmm0
callq 0x1a4f0
cmpl $0x0, %eax
je 0x1ae15
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0xb77f(%rip), %rax      # 0x264b0
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movss 0x52c0(%rip), %xmm0     # 0x20004
divss -0x20(%rbp), %xmm0
callq *%rax
mulss -0x20(%rbp), %xmm0
movss %xmm0, -0x38(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x1ae10
movl -0x30(%rbp), %edi
movss -0x38(%rbp), %xmm0
movss -0x20(%rbp), %xmm1
movss -0x24(%rbp), %xmm2
leaq -0x40(%rbp), %rsi
leaq -0x44(%rbp), %rdx
leaq -0x3c(%rbp), %rcx
callq 0x1b360
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x74(%rbp)
movss -0x20(%rbp), %xmm0
movss %xmm0, -0x70(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x68(%rbp)
movss -0x3c(%rbp), %xmm0
movss %xmm0, -0x64(%rbp)
movq -0x10(%rbp), %rdi
movl -0x30(%rbp), %esi
callq 0x1b770
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movss -0x20(%rbp), %xmm0
movl -0x30(%rbp), %edx
xorl %ecx, %ecx
callq 0x1b790
movq -0x80(%rbp), %rdi
movl -0x74(%rbp), %esi
movss -0x70(%rbp), %xmm0
movl -0x6c(%rbp), %edx
movl -0x68(%rbp), %ecx
movss -0x64(%rbp), %xmm1
movq -0x60(%rbp), %r8
movq %rax, %r9
callq 0x1b450
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1ad5c
jmp 0x1af6b
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0xb68f(%rip), %rax      # 0x264b0
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movss -0x20(%rbp), %xmm0
callq *%rax
divss -0x20(%rbp), %xmm0
movss %xmm0, -0x48(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x1af45
movl -0x30(%rbp), %eax
movl %eax, -0xac(%rbp)
movl -0x1c(%rbp), %edi
movss -0x20(%rbp), %xmm0
callq 0x1a520
movl %eax, %ecx
movl -0xac(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %edi
movss -0x48(%rbp), %xmm0
movss -0x20(%rbp), %xmm1
movss -0x24(%rbp), %xmm2
leaq -0x50(%rbp), %rsi
leaq -0x54(%rbp), %rdx
leaq -0x4c(%rbp), %rcx
callq 0x1b7e0
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x9c(%rbp)
movss -0x20(%rbp), %xmm0
movss %xmm0, -0x98(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x94(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x90(%rbp)
movss -0x4c(%rbp), %xmm0
movss %xmm0, -0x8c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x30(%rbp), %esi
callq 0x1b770
movq %rax, -0x88(%rbp)
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movss -0x20(%rbp), %xmm0
movl -0x30(%rbp), %edx
xorl %ecx, %ecx
callq 0x1b790
movq -0xa8(%rbp), %rdi
movl -0x9c(%rbp), %esi
movss -0x98(%rbp), %xmm0
movl -0x94(%rbp), %edx
movl -0x90(%rbp), %ecx
movss -0x8c(%rbp), %xmm1
movq -0x88(%rbp), %r8
movq %rax, %r9
callq 0x1b910
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1ae44
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
movss -0x20(%rbp), %xmm0
movss -0x24(%rbp), %xmm1
movl -0x28(%rbp), %r8d
movl -0x2c(%rbp), %r9d
callq 0x1bb10
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)