// File: /workspace/github_cpp_makefile_star2_O2/lunasorcery[P]brailify/./stb/stb_image_resize.h
// Function: stbir__calculate_memory(stbir__info*)
static stbir_uint32 stbir__calculate_memory(stbir__info *info)
{
    int pixel_margin = stbir__get_filter_pixel_margin(info->horizontal_filter, info->horizontal_scale);
    int filter_height = stbir__get_filter_pixel_width(info->vertical_filter, info->vertical_scale);

    info->horizontal_num_contributors = stbir__get_contributors(info->horizontal_scale, info->horizontal_filter, info->input_w, info->output_w);
    info->vertical_num_contributors   = stbir__get_contributors(info->vertical_scale  , info->vertical_filter  , info->input_h, info->output_h);

    info->horizontal_contributors_size = info->horizontal_num_contributors * sizeof(stbir__contributors);
    info->horizontal_coefficients_size = stbir__get_total_horizontal_coefficients(info) * sizeof(float);
    info->vertical_contributors_size = info->vertical_num_contributors * sizeof(stbir__contributors);
    info->vertical_coefficients_size = stbir__get_total_vertical_coefficients(info) * sizeof(float);
    info->decode_buffer_size = (info->input_w + pixel_margin * 2) * info->channels * sizeof(float);
    info->horizontal_buffer_size = info->output_w * info->channels * sizeof(float);
    info->ring_buffer_size = info->output_w * info->channels * filter_height * sizeof(float);
    info->encode_buffer_size = info->output_w * info->channels * sizeof(float);

    STBIR_ASSERT(info->horizontal_filter != 0);
    STBIR_ASSERT(info->horizontal_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); // this now happens too late
    STBIR_ASSERT(info->vertical_filter != 0);
    STBIR_ASSERT(info->vertical_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); // this now happens too late

    if (stbir__use_height_upsampling(info))
        // The horizontal buffer is for when we're downsampling the height and we
        // can't output the result of sampling the decode buffer directly into the
        // ring buffers.
        info->horizontal_buffer_size = 0;
    else
        // The encode buffer is to retain precision in the height upsampling method
        // and isn't used when height downsampling.
        info->encode_buffer_size = 0;

    return info->horizontal_contributors_size + info->horizontal_coefficients_size
        + info->vertical_contributors_size + info->vertical_coefficients_size
        + info->decode_buffer_size + info->horizontal_buffer_size
        + info->ring_buffer_size + info->encode_buffer_size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x5c(%rdi), %edi
movss 0x44(%rbx), %xmm0
callq 0xcb6f
movl %eax, %r14d
movl 0x60(%rbx), %edi
movss 0x48(%rbx), %xmm0
callq 0xcb80
movl %eax, %r15d
movss 0x44(%rbx), %xmm0
movl 0x5c(%rbx), %edi
movl 0x8(%rbx), %esi
movl 0x20(%rbx), %edx
callq 0xcc23
movl %eax, 0xc0(%rbx)
movss 0x48(%rbx), %xmm0
movl 0x60(%rbx), %edi
movl 0xc(%rbx), %esi
movl 0x24(%rbx), %edx
callq 0xcc23
movl %eax, 0xc4(%rbx)
movl 0xc0(%rbx), %r12d
leal (,%r12,8), %eax
movl %eax, 0xe8(%rbx)
movl 0x5c(%rbx), %edi
movss 0x44(%rbx), %xmm0
callq 0xced9
imull %r12d, %eax
shll $0x2, %eax
movl %eax, 0xec(%rbx)
movl 0xc4(%rbx), %r12d
leal (,%r12,8), %eax
movl %eax, 0xf0(%rbx)
movl 0x60(%rbx), %edi
movss 0x48(%rbx), %xmm0
callq 0xced9
imull %r12d, %eax
shll $0x2, %eax
movl %eax, 0xf4(%rbx)
addl %r14d, %r14d
addl 0x8(%rbx), %r14d
movl 0x4c(%rbx), %edx
movl 0x5c(%rbx), %ecx
imull %edx, %r14d
shll $0x2, %r14d
movl %r14d, 0xf8(%rbx)
imull 0x20(%rbx), %edx
leal (,%rdx,4), %esi
movl %esi, 0xfc(%rbx)
imull %r15d, %edx
shll $0x2, %edx
movl %edx, 0x100(%rbx)
movl %esi, 0x104(%rbx)
testl %ecx, %ecx
je 0xcaf3
cmpl $0x6, %ecx
jae 0xcb12
movl 0x60(%rbx), %ecx
testl %ecx, %ecx
je 0xcb31
cmpl $0x6, %ecx
jae 0xcb50
movss 0x48(%rbx), %xmm0
xorl %ecx, %ecx
xorl %edi, %edi
ucomiss 0x3557(%rip), %xmm0     # 0x10008
setbe %dil
movl %esi, %r8d
cmovbel %ecx, %r8d
cmovbel %esi, %ecx
andl $0x0, 0xfc(%rbx,%rdi,8)
addl %eax, %r14d
addl %edx, %r14d
addl 0xe8(%rbx), %r14d
addl 0xec(%rbx), %r14d
addl 0xf0(%rbx), %r14d
addl %r8d, %ecx
addl %r14d, %ecx
movl %ecx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4c7d(%rip), %rdi      # 0x11777
leaq 0x4c93(%rip), %rsi      # 0x11794
leaq 0x4ca5(%rip), %rcx      # 0x117ad
movl $0x8d0, %edx            # imm = 0x8D0
callq 0x1080
leaq 0x4cc8(%rip), %rdi      # 0x117e1
leaq 0x4c74(%rip), %rsi      # 0x11794
leaq 0x4c86(%rip), %rcx      # 0x117ad
movl $0x8d1, %edx            # imm = 0x8D1
callq 0x1080
leaq 0x4d0e(%rip), %rdi      # 0x11846
leaq 0x4c55(%rip), %rsi      # 0x11794
leaq 0x4c67(%rip), %rcx      # 0x117ad
movl $0x8d2, %edx            # imm = 0x8D2
callq 0x1080
leaq 0x4d0a(%rip), %rdi      # 0x11861
leaq 0x4c36(%rip), %rsi      # 0x11794
leaq 0x4c48(%rip), %rcx      # 0x117ad
movl $0x8d3, %edx            # imm = 0x8D3
callq 0x1080