// File: Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: SetCursorPosYAndSetupForPrevLine(float, float)
static void SetCursorPosYAndSetupForPrevLine(float pos_y, float line_height)
{
    // Set cursor position and a few other things so that SetScrollHereY() and Columns() can work when seeking cursor.
    // FIXME: It is problematic that we have to do that here, because custom/equivalent end-user code would stumble on the same issue.
    // The clipper should probably have a 4th step to display the last item in a regular manner.
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    float off_y = pos_y - window->DC.CursorPos.y;
    window->DC.CursorPos.y = pos_y;
    window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, pos_y);
    window->DC.CursorPosPrevLine.y = window->DC.CursorPos.y - line_height;  // Setting those fields so that SetScrollHereY() can properly function after the end of our clipper usage.
    window->DC.PrevLineSize.y = (line_height - g.Style.ItemSpacing.y);      // If we end up needing more accurate data (to e.g. use SameLine) we may as well make the clipper have a fourth step to let user process and display the last item in their list.
    if (ImGuiOldColumns* columns = window->DC.CurrentColumns)
        columns->LineMinY = window->DC.CursorPos.y;                         // Setting this so that cell Y position are set properly
    if (ImGuiTable* table = g.CurrentTable)
    {
        if (table->IsInsideRow)
            ImGui::TableEndRow(table);
        table->RowPosY2 = window->DC.CursorPos.y;
        const int row_increase = (int)((off_y / line_height) + 0.5f);
        //table->CurrentRow += row_increase; // Can't do without fixing TableEndRow()
        table->RowBgColorCounter += row_increase;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movss %xmm0, -0x4(%rbp)
movss %xmm1, -0x8(%rbp)
movq 0x14bd67(%rip), %rax    # 0x212f40
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x1ae0(%rax), %rax
movq %rax, -0x18(%rbp)
movss -0x4(%rbp), %xmm0
movq -0x18(%rbp), %rax
subss 0xdc(%rax), %xmm0
movss %xmm0, -0x1c(%rbp)
movss -0x4(%rbp), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0xdc(%rax)
movq -0x18(%rbp), %rax
movss 0xf4(%rax), %xmm0
movss -0x4(%rbp), %xmm1
callq 0xc88c0
movq -0x18(%rbp), %rax
movss %xmm0, 0xf4(%rax)
movq -0x18(%rbp), %rax
movss 0xdc(%rax), %xmm0
subss -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0xe4(%rax)
movss -0x8(%rbp), %xmm0
movq -0x10(%rbp), %rax
subss 0x15ac(%rax), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x10c(%rax)
movq -0x18(%rbp), %rax
movq 0x1b0(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xc729a
movq -0x18(%rbp), %rax
movss 0xdc(%rax), %xmm0
movq -0x28(%rbp), %rax
movss %xmm0, 0x1c(%rax)
movq -0x10(%rbp), %rax
movq 0x20a8(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xc730e
movq -0x30(%rbp), %rax
testb $0x1, 0x249(%rax)
je 0xc72c6
movq -0x30(%rbp), %rdi
callq 0x12e9d0
movq -0x18(%rbp), %rax
movss 0xdc(%rax), %xmm0
movq -0x30(%rbp), %rax
movss %xmm0, 0x80(%rax)
movss -0x1c(%rbp), %xmm0
divss -0x8(%rbp), %xmm0
movss 0xaace8(%rip), %xmm1    # 0x171fd8
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rax
addl 0x94(%rax), %ecx
movl %ecx, 0x94(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)