// File: /workspace/github_cpp_makefile_star2_O1/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 0xaa9e7(%rip), %rcx     # 0xfdcd0
movq 0x1ae0(%rcx), %rax
cmpb $0x0, 0x93(%rax)
jne 0x5346d
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x5331f
movss 0x110(%rax), %xmm2
subss %xmm0, %xmm2
xorps %xmm3, %xmm3
movaps %xmm2, %xmm1
cmpless %xmm3, %xmm1
andnps %xmm2, %xmm1
movss 0x104(%rax), %xmm2
addss 0x4(%rdi), %xmm1
movaps %xmm1, %xmm3
cmpless %xmm2, %xmm3
movaps %xmm3, %xmm4
andnps %xmm1, %xmm4
andps %xmm2, %xmm3
orps %xmm4, %xmm3
movss 0xd8(%rax), %xmm1
addss (%rdi), %xmm1
movss 0x10(%rax), %xmm4
movss %xmm1, 0xe0(%rax)
movss 0xdc(%rax), %xmm2
movss %xmm2, 0xe4(%rax)
addss 0x118(%rax), %xmm4
addss 0x11c(%rax), %xmm4
cvttps2dq %xmm4, %xmm4
cvtdq2ps %xmm4, %xmm4
movss %xmm4, 0xd8(%rax)
movaps %xmm3, %xmm4
addss %xmm2, %xmm4
movss 0x15ac(%rcx), %xmm5
addss %xmm5, %xmm4
cvttps2dq %xmm4, %xmm4
cvtdq2ps %xmm4, %xmm4
movss %xmm4, 0xdc(%rax)
movss 0xf0(%rax), %xmm6
movaps %xmm1, %xmm7
cmpless %xmm6, %xmm7
movaps %xmm7, %xmm8
andnps %xmm1, %xmm8
andps %xmm6, %xmm7
orps %xmm8, %xmm7
movss %xmm7, 0xf0(%rax)
movss 0xf4(%rax), %xmm6
subss %xmm5, %xmm4
movaps %xmm4, %xmm5
cmpless %xmm6, %xmm5
movaps %xmm5, %xmm7
andnps %xmm4, %xmm7
andps %xmm6, %xmm5
orps %xmm7, %xmm5
movss %xmm5, 0xf4(%rax)
movss %xmm3, 0x10c(%rax)
xorl %edx, %edx
movl %edx, 0x104(%rax)
movss 0x110(%rax), %xmm4
movaps %xmm0, %xmm3
cmpless %xmm4, %xmm3
andps %xmm3, %xmm4
andnps %xmm0, %xmm3
orps %xmm4, %xmm3
movss %xmm3, 0x114(%rax)
movl %edx, 0x110(%rax)
cmpl %edx, 0x1bc(%rax)
jne 0x5346d
movb $0x1, 0x90(%rax)
addss 0x15a8(%rcx), %xmm1
movss %xmm1, 0xd8(%rax)
movss %xmm2, 0xdc(%rax)
movq 0x108(%rax), %rcx
movq %rcx, 0x100(%rax)
movss %xmm3, 0x110(%rax)
popq %rbp
retq