// File: /workspace/github_c_makefile_star2_O0/algorithm-archivists[P]GathVL/src/objects/../../include/stb_image_resize.h
// Function: stbir__buffer_loop_upsample(stbir__info*)
static void stbir__buffer_loop_upsample(stbir__info* stbir_info)
{
    int y;
    float scale_ratio = stbir_info->vertical_scale;
    float out_scanlines_radius = stbir__filter_info_table[stbir_info->vertical_filter].support(1/scale_ratio) * scale_ratio;

    STBIR_ASSERT(stbir__use_height_upsampling(stbir_info));

    for (y = 0; y < stbir_info->output_h; y++)
    {
        float in_center_of_out = 0; // Center of the current out scanline in the in scanline space
        int in_first_scanline = 0, in_last_scanline = 0;

        stbir__calculate_sample_range_upsample(y, out_scanlines_radius, scale_ratio, stbir_info->vertical_shift, &in_first_scanline, &in_last_scanline, &in_center_of_out);

        STBIR_ASSERT(in_last_scanline - in_first_scanline + 1 <= stbir_info->ring_buffer_num_entries);

        if (stbir_info->ring_buffer_begin_index >= 0)
        {
            // Get rid of whatever we don't need anymore.
            while (in_first_scanline > stbir_info->ring_buffer_first_scanline)
            {
                if (stbir_info->ring_buffer_first_scanline == stbir_info->ring_buffer_last_scanline)
                {
                    // We just popped the last scanline off the ring buffer.
                    // Reset it to the empty state.
                    stbir_info->ring_buffer_begin_index = -1;
                    stbir_info->ring_buffer_first_scanline = 0;
                    stbir_info->ring_buffer_last_scanline = 0;
                    break;
                }
                else
                {
                    stbir_info->ring_buffer_first_scanline++;
                    stbir_info->ring_buffer_begin_index = (stbir_info->ring_buffer_begin_index + 1) % stbir_info->ring_buffer_num_entries;
                }
            }
        }

        // Load in new ones.
        if (stbir_info->ring_buffer_begin_index < 0)
            stbir__decode_and_resample_upsample(stbir_info, in_first_scanline);

        while (in_last_scanline > stbir_info->ring_buffer_last_scanline)
            stbir__decode_and_resample_upsample(stbir_info, stbir_info->ring_buffer_last_scanline + 1);

        // Now all buffers should be ready to write a row of vertical sampling.
        stbir__resample_vertical_upsample(stbir_info, y);

        STBIR_PROGRESS_REPORT((float)y / stbir_info->output_h);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movss 0x48(%rax), %xmm0
movss %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x60(%rax), %eax
movl %eax, %ecx
leaq 0x1de66(%rip), %rax     # 0x4f5a0
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movss 0x9c5b(%rip), %xmm0     # 0x3b3a8
divss -0x10(%rbp), %xmm0
callq *%rax
mulss -0x10(%rbp), %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x8(%rbp), %rdi
callq 0x30f00
cmpl $0x0, %eax
je 0x3176e
jmp 0x3178d
leaq 0xbd01(%rip), %rdi      # 0x3d476
leaq 0xb19d(%rip), %rsi      # 0x3c919
movl $0x813, %edx            # imm = 0x813
leaq 0xb908(%rip), %rcx      # 0x3d090
callq 0x50f0
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jge 0x31913
xorps %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0xc(%rbp), %edi
movss -0x14(%rbp), %xmm0
movss -0x10(%rbp), %xmm1
movq -0x8(%rbp), %rax
movss 0x40(%rax), %xmm2
leaq -0x1c(%rbp), %rsi
leaq -0x20(%rbp), %rdx
leaq -0x18(%rbp), %rcx
callq 0x31ad0
movl -0x20(%rbp), %eax
subl -0x1c(%rbp), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
cmpl 0xcc(%rcx), %eax
jg 0x317f8
jmp 0x31817
leaq 0xb8c1(%rip), %rdi      # 0x3d0c0
leaq 0xb113(%rip), %rsi      # 0x3c919
movl $0x81c, %edx            # imm = 0x81C
leaq 0xb87e(%rip), %rcx      # 0x3d090
callq 0x50f0
movq -0x8(%rbp), %rax
cmpl $0x0, 0xd8(%rax)
jl 0x318b7
jmp 0x3182a
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xd0(%rcx), %eax
jle 0x318b5
movq -0x8(%rbp), %rax
movl 0xd0(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0xd4(%rcx), %eax
jne 0x3187b
movq -0x8(%rbp), %rax
movl $0xffffffff, 0xd8(%rax) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movl $0x0, 0xd0(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0xd4(%rax)
jmp 0x318b5
movq -0x8(%rbp), %rax
movl 0xd0(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xd0(%rax)
movq -0x8(%rbp), %rax
movl 0xd8(%rax), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
cltd
idivl 0xcc(%rcx)
movq -0x8(%rbp), %rax
movl %edx, 0xd8(%rax)
jmp 0x3182a
jmp 0x318b7
movq -0x8(%rbp), %rax
cmpl $0x0, 0xd8(%rax)
jge 0x318d0
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x32630
jmp 0x318d2
movl -0x20(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xd4(%rcx), %eax
jle 0x318f9
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0xd4(%rax), %esi
addl $0x1, %esi
callq 0x32630
jmp 0x318d2
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x326b0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x31794
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)