// File: donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::ItemAdd(ImRect const&, unsigned int const*)
bool ImGui::ItemAdd(const ImRect& bb, const ImGuiID* id)
{
    ImGuiWindow* window = GetCurrentWindow();
    window->DC.LastItemID = id ? *id : 0;
    window->DC.LastItemRect = bb;
    if (IsClippedEx(bb, id, false))
    {
        window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRect = false;
        return false;
    }

    // This is a sensible default, but widgets are free to override it after calling ItemAdd()
    ImGuiState& g = *GImGui;
    if (IsMouseHoveringRect(bb.Min, bb.Max))
    {
        // Matching the behavior of IsHovered() but ignore if ActiveId==window->MoveID (we clicked on the window background)
        // So that clicking on items with no active id such as Text() still returns true with IsItemHovered()
        window->DC.LastItemHoveredRect = true;
        window->DC.LastItemHoveredAndUsable = false;
        if (g.HoveredRootWindow == window->RootWindow)
            if (g.ActiveId == 0 || (id && g.ActiveId == *id) || g.ActiveIdIsFocusedOnly || (g.ActiveId == window->MoveID))
                if (IsWindowContentHoverable(window))
                    window->DC.LastItemHoveredAndUsable = true;
    }
    else
    {
        window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRect = false;
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
callq 0x2e220
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xc0cb
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
jmp 0xc0d2
xorl %eax, %eax
movl %eax, -0x2c(%rbp)
jmp 0xc0d2
movl -0x2c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xe0(%rax)
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, 0xe4(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0xec(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %edx, %edx
callq 0xc220
testb $0x1, %al
jne 0xc111
jmp 0xc130
movq -0x20(%rbp), %rax
movb $0x0, 0xf5(%rax)
movq -0x20(%rbp), %rax
movb $0x0, 0xf4(%rax)
movb $0x0, -0x1(%rbp)
jmp 0xc208
movq 0x6d389(%rip), %rax     # 0x794c0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
movl $0x1, %edx
callq 0xc2b0
testb $0x1, %al
jne 0xc15a
jmp 0xc1ee
movq -0x20(%rbp), %rax
movb $0x1, 0xf5(%rax)
movq -0x20(%rbp), %rax
movb $0x0, 0xf4(%rax)
movq -0x28(%rbp), %rax
movq 0x1780(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x278(%rcx), %rax
jne 0xc1ec
movq -0x28(%rbp), %rax
cmpl $0x0, 0x1790(%rax)
je 0xc1ce
cmpq $0x0, -0x18(%rbp)
je 0xc1ae
movq -0x28(%rbp), %rax
movl 0x1790(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
je 0xc1ce
movq -0x28(%rbp), %rax
testb $0x1, 0x179a(%rax)
jne 0xc1ce
movq -0x28(%rbp), %rax
movl 0x1790(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x48(%rcx), %eax
jne 0xc1ea
movq -0x20(%rbp), %rdi
callq 0xc370
testb $0x1, %al
jne 0xc1dd
jmp 0xc1e8
movq -0x20(%rbp), %rax
movb $0x1, 0xf4(%rax)
jmp 0xc1ea
jmp 0xc1ec
jmp 0xc204
movq -0x20(%rbp), %rax
movb $0x0, 0xf5(%rax)
movq -0x20(%rbp), %rax
movb $0x0, 0xf4(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)