// File: /workspace/github_cpp_makefile_star2_O3/Ciaxur[P]yagb-emu/include/imgui/imgui_tables.cpp
// Function: ImGui::TableUpdateBorders(ImGuiTable*)
void ImGui::TableUpdateBorders(ImGuiTable* table)
{
    ImGuiContext& g = *GImGui;
    IM_ASSERT(table->Flags & ImGuiTableFlags_Resizable);

    // At this point OuterRect height may be zero or under actual final height, so we rely on temporal coherency and
    // use the final height from last frame. Because this is only affecting _interaction_ with columns, it is not
    // really problematic (whereas the actual visual will be displayed in EndTable() and using the current frame height).
    // Actual columns highlight/render will be performed in EndTable() and not be affected.
    const float hit_half_width = TABLE_RESIZE_SEPARATOR_HALF_THICKNESS;
    const float hit_y1 = table->OuterRect.Min.y;
    const float hit_y2_body = ImMax(table->OuterRect.Max.y, hit_y1 + table->LastOuterHeight);
    const float hit_y2_head = hit_y1 + table->LastFirstRowHeight;

    for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
    {
        if (!(table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n)))
            continue;

        const int column_n = table->DisplayOrderToIndex[order_n];
        ImGuiTableColumn* column = &table->Columns[column_n];
        if (column->Flags & (ImGuiTableColumnFlags_NoResize | ImGuiTableColumnFlags_NoDirectResize_))
            continue;

        // ImGuiTableFlags_NoBordersInBodyUntilResize will be honored in TableDrawBorders()
        const float border_y2_hit = (table->Flags & ImGuiTableFlags_NoBordersInBody) ? hit_y2_head : hit_y2_body;
        if ((table->Flags & ImGuiTableFlags_NoBordersInBody) && table->IsUsingHeaders == false)
            continue;

        if (table->FreezeColumnsCount > 0)
            if (column->MaxX < table->Columns[table->DisplayOrderToIndex[table->FreezeColumnsCount - 1]].MaxX)
                continue;

        ImGuiID column_id = TableGetColumnResizeID(table, column_n, table->InstanceCurrent);
        ImRect hit_rect(column->MaxX - hit_half_width, hit_y1, column->MaxX + hit_half_width, border_y2_hit);
        //GetForegroundDrawList()->AddRect(hit_rect.Min, hit_rect.Max, IM_COL32(255, 0, 0, 100));
        KeepAliveID(column_id);

        bool hovered = false, held = false;
        bool pressed = ButtonBehavior(hit_rect, column_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_AllowItemOverlap | ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnDoubleClick);
        if (pressed && IsMouseDoubleClicked(0))
        {
            TableSetColumnWidthAutoSingle(table, column_n);
            ClearActiveID();
            held = hovered = false;
        }
        if (held)
        {
            if (table->LastResizedColumn == -1)
                table->ResizeLockMinContentsX2 = table->RightMostEnabledColumn != -1 ? table->Columns[table->RightMostEnabledColumn].MaxX : -FLT_MAX;
            table->ResizedColumn = (ImGuiTableColumnIdx)column_n;
            table->InstanceInteracted = table->InstanceCurrent;
        }
        if ((hovered && g.HoveredIdTimer > TABLE_RESIZE_SEPARATOR_FEEDBACK_TIMER) || held)
        {
            table->HoveredColumnBorder = (ImGuiTableColumnIdx)column_n;
            SetMouseCursor(ImGuiMouseCursor_ResizeEW);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
testb $0x1, 0x4(%rdi)
je 0x88d4d
movq %rdi, %rbx
movl 0x6c(%rdi), %eax
testl %eax, %eax
jle 0x88d08
leaq 0x73220(%rip), %rcx     # 0xfbcd0
movq (%rcx), %rcx
movq %rcx, -0x50(%rbp)
movss 0xf0(%rbx), %xmm3
movss 0xf8(%rbx), %xmm0
movss 0xcc(%rbx), %xmm1
addss %xmm3, %xmm1
movaps %xmm1, %xmm4
cmpless %xmm0, %xmm4
movaps %xmm4, %xmm2
andnps %xmm1, %xmm2
andps %xmm0, %xmm4
orps %xmm2, %xmm4
movaps %xmm4, -0x60(%rbp)
movss 0xd0(%rbx), %xmm0
movss %xmm3, -0x34(%rbp)
addss %xmm3, %xmm0
movss %xmm0, -0x30(%rbp)
xorl %r15d, %r15d
movq 0x40(%rbx), %rcx
btq %r15, %rcx
jae 0x88cf9
movq 0x20(%rbx), %rcx
movq 0x28(%rbx), %rsi
leaq (%rcx,%r15), %rdx
cmpq %rsi, %rdx
jae 0x88d2e
movsbq (%rdx), %r13
testq %r13, %r13
js 0x88d17
imulq $0x68, %r13, %r12
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %rdi
addq %rdx, %r12
cmpq %rdi, %r12
jae 0x88d17
testl $0x40000010, (%r12)     # imm = 0x40000010
jne 0x88cf9
testb $0x8, 0x5(%rbx)
movaps -0x60(%rbp), %xmm1
je 0x88b69
movss -0x30(%rbp), %xmm1
je 0x88b78
cmpb $0x0, 0x24c(%rbx)
je 0x88cf9
movsbq 0x243(%rbx), %r8
testq %r8, %r8
jle 0x88bc2
decl %r8d
addq %r8, %rcx
cmpq %rsi, %rcx
jae 0x88d2e
movsbq (%rcx), %rcx
testq %rcx, %rcx
js 0x88d17
imulq $0x68, %rcx, %rcx
addq %rcx, %rdx
cmpq %rdi, %rdx
jae 0x88d17
movss 0xc(%rdx), %xmm0
ucomiss 0xc(%r12), %xmm0
ja 0x88cf9
movswl 0x78(%rbx), %edx
movq %rbx, %rdi
movl %r13d, %esi
movss %xmm1, -0x38(%rbp)
callq 0x8915f
movl %eax, %r14d
movss 0xc(%r12), %xmm0
movaps %xmm0, %xmm1
addss 0x2cc75(%rip), %xmm1    # 0xb5860
addss 0x2cc71(%rip), %xmm0    # 0xb5864
movss %xmm1, -0x48(%rbp)
movss -0x34(%rbp), %xmm1
movss %xmm1, -0x44(%rbp)
movss %xmm0, -0x40(%rbp)
movss -0x38(%rbp), %xmm0
movss %xmm0, -0x3c(%rbp)
movl %eax, %edi
callq 0x459e2
xorl %eax, %eax
movb %al, -0x29(%rbp)
movb %al, -0x2a(%rbp)
leaq -0x48(%rbp), %rdi
movl %r14d, %esi
leaq -0x29(%rbp), %rdx
leaq -0x2a(%rbp), %rcx
movl $0x1910, %r8d           # imm = 0x1910
callq 0x90b6f
testb %al, %al
je 0x88c61
xorl %edi, %edi
callq 0x51712
testb %al, %al
je 0x88c61
movq %rbx, %rdi
movl %r13d, %esi
callq 0x8919a
callq 0x46130
xorl %eax, %eax
movb %al, -0x29(%rbp)
movb %al, -0x2a(%rbp)
movb -0x2a(%rbp), %al
cmpb $0x1, %al
jne 0x88cc5
cmpb $-0x1, 0x238(%rbx)
jne 0x88caa
movsbq 0x23e(%rbx), %rcx
movss 0x2cc27(%rip), %xmm0    # 0xb58a8
cmpq $-0x1, %rcx
je 0x88ca2
testb %cl, %cl
js 0x88d17
imulq $0x68, %rcx, %rcx
addq 0x10(%rbx), %rcx
cmpq 0x18(%rbx), %rcx
jae 0x88d17
movss 0xc(%rcx), %xmm0
movss %xmm0, 0xe4(%rbx)
movb %r13b, 0x237(%rbx)
movzwl 0x78(%rbx), %ecx
movw %cx, 0x7a(%rbx)
cmpb $0x0, -0x29(%rbp)
jne 0x88ccb
testb %al, %al
jne 0x88ce5
jmp 0x88cf6
cmpb $0x1, -0x29(%rbp)
jne 0x88cf6
movq -0x50(%rbp), %rcx
movss 0x1b28(%rcx), %xmm0
ucomiss 0x46146(%rip), %xmm0    # 0xcee24
seta %cl
orb %al, %cl
je 0x88cf6
movb %r13b, 0x235(%rbx)
movl $0x4, %edi
callq 0x519ab
movl 0x6c(%rbx), %eax
incq %r15
movslq %eax, %rcx
cmpq %rcx, %r15
jl 0x88b04
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3199a(%rip), %rdi     # 0xba6b8
leaq 0x3091a(%rip), %rsi     # 0xb963f
leaq 0x319a5(%rip), %rcx     # 0xba6d1
jmp 0x88d43
leaq 0x31983(%rip), %rdi     # 0xba6b8
leaq 0x30903(%rip), %rsi     # 0xb963f
leaq 0x47cf6(%rip), %rcx     # 0xd0a39
movl $0x20e, %edx            # imm = 0x20E
callq 0xc140
leaq 0x4641f(%rip), %rdi     # 0xcf173
leaq 0x4612f(%rip), %rsi     # 0xcee8a
leaq 0x4643a(%rip), %rcx     # 0xcf19c
movl $0x44b, %edx            # imm = 0x44B
callq 0xc140