// File: /workspace/github_cpp_makefile_star2_O3/Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::ItemSize(ImVec2 const&, float)
void ImGui::ItemSize(const ImVec2& size, float text_baseline_y)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    if (window->SkipItems)
        return;

    // We increase the height in this function to accommodate for baseline offset.
    // In theory we should be offsetting the starting position (window->DC.CursorPos), that will be the topic of a larger refactor,
    // but since ItemSize() is not yet an API that moves the cursor (to handle e.g. wrapping) enlarging the height has the same effect.
    const float offset_to_match_baseline_y = (text_baseline_y >= 0) ? ImMax(0.0f, window->DC.CurrLineTextBaseOffset - text_baseline_y) : 0.0f;
    const float line_height = ImMax(window->DC.CurrLineSize.y, size.y + offset_to_match_baseline_y);

    // Always align ourselves on pixel boundaries
    //if (g.IO.KeyAlt) window->DrawList->AddRect(window->DC.CursorPos, window->DC.CursorPos + ImVec2(size.x, line_height), IM_COL32(255,0,0,200)); // [DEBUG]
    window->DC.CursorPosPrevLine.x = window->DC.CursorPos.x + size.x;
    window->DC.CursorPosPrevLine.y = window->DC.CursorPos.y;
    window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);    // Next line
    window->DC.CursorPos.y = IM_FLOOR(window->DC.CursorPos.y + line_height + g.Style.ItemSpacing.y);        // Next line
    window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x);
    window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y - g.Style.ItemSpacing.y);
    //if (g.IO.KeyAlt) window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, IM_COL32(255,0,0,255), 4); // [DEBUG]

    window->DC.PrevLineSize.y = line_height;
    window->DC.CurrLineSize.y = 0.0f;
    window->DC.PrevLineTextBaseOffset = ImMax(window->DC.CurrLineTextBaseOffset, text_baseline_y);
    window->DC.CurrLineTextBaseOffset = 0.0f;

    // Horizontal layout mode
    if (window->DC.LayoutType == ImGuiLayoutType_Horizontal)
        SameLine();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0xa99b0(%rip), %rcx     # 0xfbcd0
movq 0x1ae0(%rcx), %rax
cmpb $0x0, 0x93(%rax)
jne 0x524a6
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm0
movss 0x110(%rax), %xmm1
jb 0x52359
movaps %xmm1, %xmm3
subss %xmm0, %xmm3
xorps %xmm4, %xmm4
movaps %xmm3, %xmm2
cmpless %xmm4, %xmm2
andnps %xmm3, %xmm2
movss 0x104(%rax), %xmm3
addss 0x4(%rdi), %xmm2
movaps %xmm2, %xmm4
cmpless %xmm3, %xmm4
movaps %xmm4, %xmm5
andnps %xmm2, %xmm5
andps %xmm3, %xmm4
movss 0xd8(%rax), %xmm2
addss (%rdi), %xmm2
movss 0x10(%rax), %xmm6
movss %xmm2, 0xe0(%rax)
movss 0xdc(%rax), %xmm3
movss %xmm3, 0xe4(%rax)
addss 0x118(%rax), %xmm6
addss 0x11c(%rax), %xmm6
orps %xmm5, %xmm4
cvttps2dq %xmm6, %xmm5
cvtdq2ps %xmm5, %xmm5
movss %xmm5, 0xd8(%rax)
movaps %xmm4, %xmm5
addss %xmm3, %xmm5
movss 0x15ac(%rcx), %xmm6
addss %xmm6, %xmm5
cvttps2dq %xmm5, %xmm5
cvtdq2ps %xmm5, %xmm5
movss %xmm5, 0xdc(%rax)
movss 0xf0(%rax), %xmm7
movaps %xmm2, %xmm8
cmpless %xmm7, %xmm8
movaps %xmm8, %xmm9
andnps %xmm2, %xmm9
andps %xmm7, %xmm8
orps %xmm9, %xmm8
movss %xmm8, 0xf0(%rax)
movss 0xf4(%rax), %xmm7
subss %xmm6, %xmm5
movaps %xmm5, %xmm6
cmpless %xmm7, %xmm6
movaps %xmm6, %xmm8
andnps %xmm5, %xmm8
andps %xmm7, %xmm6
orps %xmm8, %xmm6
movss %xmm6, 0xf4(%rax)
movss %xmm4, 0x10c(%rax)
xorl %edx, %edx
movl %edx, 0x104(%rax)
movaps %xmm0, %xmm4
cmpless %xmm1, %xmm4
andps %xmm4, %xmm1
andnps %xmm0, %xmm4
orps %xmm1, %xmm4
movss %xmm4, 0x114(%rax)
movl %edx, 0x110(%rax)
cmpl %edx, 0x1bc(%rax)
jne 0x524a6
movb $0x1, 0x90(%rax)
addss 0x15a8(%rcx), %xmm2
movss %xmm2, 0xd8(%rax)
movss %xmm3, 0xdc(%rax)
movq 0x108(%rax), %rcx
movq %rcx, 0x100(%rax)
movss %xmm4, 0x110(%rax)
popq %rbp
retq