// File: Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::SplitterBehavior(ImRect const&, unsigned int, ImGuiAxis, float*, float*, float, float, float, float)
bool ImGui::SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend, float hover_visibility_delay)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;

    const ImGuiItemFlags item_flags_backup = window->DC.ItemFlags;
    window->DC.ItemFlags |= ImGuiItemFlags_NoNav | ImGuiItemFlags_NoNavDefaultFocus;
    bool item_add = ItemAdd(bb, id);
    window->DC.ItemFlags = item_flags_backup;
    if (!item_add)
        return false;

    bool hovered, held;
    ImRect bb_interact = bb;
    bb_interact.Expand(axis == ImGuiAxis_Y ? ImVec2(0.0f, hover_extend) : ImVec2(hover_extend, 0.0f));
    ButtonBehavior(bb_interact, id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_AllowItemOverlap);
    if (g.ActiveId != id)
        SetItemAllowOverlap();

    if (held || (g.HoveredId == id && g.HoveredIdPreviousFrame == id && g.HoveredIdTimer >= hover_visibility_delay))
        SetMouseCursor(axis == ImGuiAxis_Y ? ImGuiMouseCursor_ResizeNS : ImGuiMouseCursor_ResizeEW);

    ImRect bb_render = bb;
    if (held)
    {
        ImVec2 mouse_delta_2d = g.IO.MousePos - g.ActiveIdClickOffset - bb_interact.Min;
        float mouse_delta = (axis == ImGuiAxis_Y) ? mouse_delta_2d.y : mouse_delta_2d.x;

        // Minimum pane size
        float size_1_maximum_delta = ImMax(0.0f, *size1 - min_size1);
        float size_2_maximum_delta = ImMax(0.0f, *size2 - min_size2);
        if (mouse_delta < -size_1_maximum_delta)
            mouse_delta = -size_1_maximum_delta;
        if (mouse_delta > size_2_maximum_delta)
            mouse_delta = size_2_maximum_delta;

        // Apply resize
        if (mouse_delta != 0.0f)
        {
            if (mouse_delta < 0.0f)
                IM_ASSERT(*size1 + mouse_delta >= min_size1);
            if (mouse_delta > 0.0f)
                IM_ASSERT(*size2 - mouse_delta >= min_size2);
            *size1 += mouse_delta;
            *size2 -= mouse_delta;
            bb_render.Translate((axis == ImGuiAxis_X) ? ImVec2(mouse_delta, 0.0f) : ImVec2(0.0f, mouse_delta));
            MarkItemEdited(id);
        }
    }

    // Render
    const ImU32 col = GetColorU32(held ? ImGuiCol_SeparatorActive : (hovered && g.HoveredIdTimer >= hover_visibility_delay) ? ImGuiCol_SeparatorHovered : ImGuiCol_Separator);
    window->DrawList->AddRectFilled(bb_render.Min, bb_render.Max, col, 0.0f);

    return held;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movss %xmm0, -0x2c(%rbp)
movss %xmm1, -0x30(%rbp)
movss %xmm2, -0x34(%rbp)
movss %xmm3, -0x38(%rbp)
leaq 0xd4fd8(%rip), %rax     # 0x212f40
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq 0x1ae0(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl 0x1cc(%rax), %eax
movl %eax, -0x4c(%rbp)
movq -0x48(%rbp), %rax
movl 0x1cc(%rax), %ecx
orl $0x18, %ecx
movl %ecx, 0x1cc(%rax)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xd6250
andb $0x1, %al
movb %al, -0x4d(%rbp)
movl -0x4c(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x1cc(%rax)
testb $0x1, -0x4d(%rbp)
jne 0x13dfcf
movb $0x0, -0x1(%rbp)
jmp 0x13e378
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x60(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
cmpl $0x1, -0x18(%rbp)
jne 0x13dffb
movss -0x34(%rbp), %xmm1
leaq -0x68(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0xbf4c0
jmp 0x13e00c
movss -0x34(%rbp), %xmm0
leaq -0x68(%rbp), %rdi
xorps %xmm1, %xmm1
callq 0xbf4c0
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xe89d0
movl -0x14(%rbp), %esi
leaq -0x60(%rbp), %rdi
leaq -0x4e(%rbp), %rdx
leaq -0x4f(%rbp), %rcx
movl $0x1800, %r8d           # imm = 0x1800
callq 0x139df0
movq -0x40(%rbp), %rax
movl 0x1b30(%rax), %eax
cmpl -0x14(%rbp), %eax
je 0x13e047
callq 0xd5760
testb $0x1, -0x4f(%rbp)
jne 0x13e07d
movq -0x40(%rbp), %rax
movl 0x1b1c(%rax), %eax
cmpl -0x14(%rbp), %eax
jne 0x13e095
movq -0x40(%rbp), %rax
movl 0x1b20(%rax), %eax
cmpl -0x14(%rbp), %eax
jne 0x13e095
movq -0x40(%rbp), %rax
movss 0x1b28(%rax), %xmm0
ucomiss -0x38(%rbp), %xmm0
jb 0x13e095
movl -0x18(%rbp), %ecx
movl $0x4, %edi
movl $0x3, %eax
cmpl $0x1, %ecx
cmovel %eax, %edi
callq 0xd5340
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x78(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x70(%rbp)
testb $0x1, -0x4f(%rbp)
je 0x13e2d6
movq -0x40(%rbp), %rsi
movq %rsi, %rdi
addq $0x128, %rdi            # imm = 0x128
addq $0x1b58, %rsi           # imm = 0x1B58
callq 0x1390e0
movlpd %xmm0, -0x88(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x1390e0
movlpd %xmm0, -0x80(%rbp)
cmpl $0x1, -0x18(%rbp)
jne 0x13e0fe
movss -0x7c(%rbp), %xmm0
movss %xmm0, -0xa4(%rbp)
jmp 0x13e10b
movss -0x80(%rbp), %xmm0
movss %xmm0, -0xa4(%rbp)
movss -0xa4(%rbp), %xmm0
movss %xmm0, -0x8c(%rbp)
movq -0x20(%rbp), %rax
movss (%rax), %xmm1
subss -0x2c(%rbp), %xmm1
xorps %xmm0, %xmm0
callq 0x139050
movss %xmm0, -0x90(%rbp)
movq -0x28(%rbp), %rax
movss (%rax), %xmm1
subss -0x30(%rbp), %xmm1
xorps %xmm0, %xmm0
callq 0x139050
movss %xmm0, -0x94(%rbp)
movss -0x8c(%rbp), %xmm1
movss -0x90(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x13e194
movss -0x90(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x8c(%rbp)
movss -0x8c(%rbp), %xmm0
ucomiss -0x94(%rbp), %xmm0
jbe 0x13e1b5
movss -0x94(%rbp), %xmm0
movss %xmm0, -0x8c(%rbp)
movss -0x8c(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x13e1cc
jp 0x13e1cc
jmp 0x13e2d4
xorps %xmm0, %xmm0
ucomiss -0x8c(%rbp), %xmm0
jbe 0x13e211
movq -0x20(%rbp), %rax
movss (%rax), %xmm0
addss -0x8c(%rbp), %xmm0
ucomiss -0x2c(%rbp), %xmm0
jb 0x13e1f0
jmp 0x13e20f
leaq 0x50512(%rip), %rdi     # 0x18e709
leaq 0x501e2(%rip), %rsi     # 0x18e3e0
movl $0x5ac, %edx            # imm = 0x5AC
leaq 0x50521(%rip), %rcx     # 0x18e72b
callq 0xd180
jmp 0x13e211
movss -0x8c(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x13e25a
movq -0x28(%rbp), %rax
movss (%rax), %xmm0
subss -0x8c(%rbp), %xmm0
ucomiss -0x30(%rbp), %xmm0
jb 0x13e239
jmp 0x13e258
leaq 0x5055a(%rip), %rdi     # 0x18e79a
leaq 0x50199(%rip), %rsi     # 0x18e3e0
movl $0x5ae, %edx            # imm = 0x5AE
leaq 0x504d8(%rip), %rcx     # 0x18e72b
callq 0xd180
jmp 0x13e25a
movss -0x8c(%rbp), %xmm0
movq -0x20(%rbp), %rax
addss (%rax), %xmm0
movss %xmm0, (%rax)
movss -0x8c(%rbp), %xmm1
movq -0x28(%rbp), %rax
movss (%rax), %xmm0
subss %xmm1, %xmm0
movss %xmm0, (%rax)
cmpl $0x0, -0x18(%rbp)
jne 0x13e2a5
movss -0x8c(%rbp), %xmm0
leaq -0x9c(%rbp), %rdi
xorps %xmm1, %xmm1
callq 0xbf4c0
jmp 0x13e2bc
movss -0x8c(%rbp), %xmm1
leaq -0x9c(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0xbf4c0
leaq -0x78(%rbp), %rdi
leaq -0x9c(%rbp), %rsi
callq 0x15bf20
movl -0x14(%rbp), %edi
callq 0xca110
jmp 0x13e2d6
testb $0x1, -0x4f(%rbp)
je 0x13e2e9
movl $0x1d, %eax
movl %eax, -0xa8(%rbp)
jmp 0x13e32c
xorl %eax, %eax
testb $0x1, -0x4e(%rbp)
movb %al, -0xa9(%rbp)
je 0x13e310
movq -0x40(%rbp), %rax
movss 0x1b28(%rax), %xmm0
ucomiss -0x38(%rbp), %xmm0
setae %al
movb %al, -0xa9(%rbp)
movb -0xa9(%rbp), %dl
movl $0x1b, %eax
movl $0x1c, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0xa8(%rbp)
movl -0xa8(%rbp), %edi
movss 0x32902(%rip), %xmm0    # 0x170c3c
callq 0xc76e0
movl %eax, -0xa0(%rbp)
movq -0x48(%rbp), %rax
movq 0x2b8(%rax), %rdi
leaq -0x78(%rbp), %rsi
leaq -0x78(%rbp), %rdx
addq $0x8, %rdx
movl -0xa0(%rbp), %ecx
xorps %xmm0, %xmm0
movl $0xf, %r8d
callq 0x113090
movb -0x4f(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)