// File: /workspace/github_cpp_makefile_star2_O2/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 0xa2f9a(%rip), %rcx     # 0xe3ce0
movq 0x1ae0(%rcx), %rax
cmpb $0x0, 0x93(%rax)
jne 0x40e92
xorps %xmm3, %xmm3
ucomiss %xmm3, %xmm0
movss 0x110(%rax), %xmm1
jb 0x40d7f
movaps %xmm1, %xmm2
subss %xmm0, %xmm2
xorps %xmm4, %xmm4
movaps %xmm2, %xmm3
cmpless %xmm4, %xmm3
andnps %xmm2, %xmm3
movss 0x104(%rax), %xmm4
addss 0x4(%rdi), %xmm3
movaps %xmm3, %xmm2
cmpless %xmm4, %xmm2
movaps %xmm2, %xmm5
andnps %xmm3, %xmm5
andps %xmm4, %xmm2
orps %xmm5, %xmm2
movss 0xd8(%rax), %xmm3
addss (%rdi), %xmm3
movss 0x10(%rax), %xmm4
movss %xmm3, 0xe0(%rax)
movss 0xdc(%rax), %xmm5
movss %xmm5, 0xe4(%rax)
addss 0x118(%rax), %xmm4
addss 0x11c(%rax), %xmm4
cvttps2dq %xmm4, %xmm4
cvtdq2ps %xmm4, %xmm4
movss %xmm4, 0xd8(%rax)
movaps %xmm2, %xmm4
addss %xmm5, %xmm4
movss 0x15ac(%rcx), %xmm5
addss %xmm5, %xmm4
cvttps2dq %xmm4, %xmm4
cvtdq2ps %xmm4, %xmm4
movss %xmm4, 0xdc(%rax)
movss 0xf0(%rax), %xmm6
movaps %xmm3, %xmm7
cmpless %xmm6, %xmm7
movaps %xmm7, %xmm8
andnps %xmm3, %xmm8
andps %xmm6, %xmm7
orps %xmm8, %xmm7
movss %xmm7, 0xf0(%rax)
movss 0xf4(%rax), %xmm3
subss %xmm5, %xmm4
movaps %xmm4, %xmm5
cmpless %xmm3, %xmm5
movaps %xmm5, %xmm6
andnps %xmm4, %xmm6
andps %xmm3, %xmm5
orps %xmm6, %xmm5
movss %xmm5, 0xf4(%rax)
movss %xmm2, 0x10c(%rax)
andl $0x0, 0x104(%rax)
movaps %xmm0, %xmm2
cmpless %xmm1, %xmm2
andps %xmm2, %xmm1
andnps %xmm0, %xmm2
orps %xmm1, %xmm2
movss %xmm2, 0x114(%rax)
andl $0x0, 0x110(%rax)
xorl %ecx, %ecx
cmpl %ecx, 0x1bc(%rax)
je 0x40e94
popq %rbp
retq
movss 0x5b154(%rip), %xmm1    # 0x9bff0
xorps %xmm0, %xmm0
popq %rbp
jmp 0x437ec