// File: /workspace/github_cpp_makefile_star2_O2/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 $0x58, %rsp
testb $0x1, 0x4(%rdi)
je 0x727f8
movq %rdi, %rbx
leaq 0x7171a(%rip), %rax     # 0xe3ce0
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movss 0xf0(%rdi), %xmm3
movss 0xf8(%rdi), %xmm0
movss 0xcc(%rdi), %xmm1
addss %xmm3, %xmm1
movaps %xmm1, %xmm4
cmpless %xmm0, %xmm4
movaps %xmm4, %xmm2
andnps %xmm1, %xmm2
andps %xmm0, %xmm4
orps %xmm2, %xmm4
movaps %xmm4, -0x80(%rbp)
movss 0xd0(%rdi), %xmm0
movss %xmm3, -0x40(%rbp)
addss %xmm3, %xmm0
movss %xmm0, -0x3c(%rbp)
leaq 0x20(%rdi), %r15
leaq 0x10(%rdi), %rax
movq %rax, -0x38(%rbp)
xorl %r13d, %r13d
movq %r15, -0x68(%rbp)
movslq 0x6c(%rbx), %rax
cmpq %rax, %r13
jge 0x727e9
movq 0x40(%rbx), %rax
btq %r13, %rax
jae 0x72669
movq %r15, %rdi
movl %r13d, %esi
callq 0x787be
movb (%rax), %al
movb %al, -0x2b(%rbp)
movsbl %al, %r12d
movq -0x38(%rbp), %rdi
movl %r12d, %esi
callq 0x4c4c6
testl $0x40000010, (%rax)     # imm = 0x40000010
je 0x7266e
incq %r13
jmp 0x7262a
movq %rax, %r14
testb $0x8, 0x5(%rbx)
movaps -0x80(%rbp), %xmm0
je 0x72680
movss -0x3c(%rbp), %xmm0
movss %xmm0, -0x48(%rbp)
je 0x72690
cmpb $0x0, 0x24c(%rbx)
je 0x72669
movsbl 0x243(%rbx), %esi
testl %esi, %esi
jle 0x726c7
movss 0xc(%r14), %xmm0
movss %xmm0, -0x44(%rbp)
decl %esi
movq %r15, %rdi
callq 0x787be
movsbl (%rax), %esi
movq -0x38(%rbp), %rdi
callq 0x4c4c6
movss 0xc(%rax), %xmm0
ucomiss -0x44(%rbp), %xmm0
ja 0x72669
movswl 0x78(%rbx), %edx
movq %rbx, %rdi
movl %r12d, %esi
callq 0x72b10
movl %eax, %r15d
movss 0xc(%r14), %xmm0
movaps %xmm0, %xmm1
addss 0x2a1a2(%rip), %xmm1    # 0x9c88c
addss 0x2a19e(%rip), %xmm0    # 0x9c890
movss %xmm1, -0x58(%rbp)
movss -0x40(%rbp), %xmm1
movss %xmm1, -0x54(%rbp)
movss %xmm0, -0x50(%rbp)
movss -0x48(%rbp), %xmm0
movss %xmm0, -0x4c(%rbp)
movl %eax, %edi
callq 0x370fd
xorl %eax, %eax
movb %al, -0x2a(%rbp)
movb %al, -0x29(%rbp)
leaq -0x58(%rbp), %rdi
movl %r15d, %esi
leaq -0x2a(%rbp), %rdx
leaq -0x29(%rbp), %rcx
movl $0x1910, %r8d           # imm = 0x1910
callq 0x79dde
testb %al, %al
je 0x72760
xorl %edi, %edi
callq 0x4028c
testb %al, %al
je 0x72760
movq %rbx, %rdi
movl %r12d, %esi
callq 0x72b4b
callq 0x37444
xorl %eax, %eax
movb %al, -0x2a(%rbp)
movb %al, -0x29(%rbp)
cmpb $0x1, -0x29(%rbp)
movq -0x68(%rbp), %r15
movb -0x2b(%rbp), %r14b
jne 0x727b0
cmpb $-0x1, 0x238(%rbx)
jne 0x727a1
movsbl 0x23e(%rbx), %esi
movss 0x2a152(%rip), %xmm0    # 0x9c8d8
cmpl $-0x1, %esi
je 0x72799
movq -0x38(%rbp), %rdi
callq 0x4c4c6
movss 0xc(%rax), %xmm0
movss %xmm0, 0xe4(%rbx)
movb %r14b, 0x237(%rbx)
movzwl 0x78(%rbx), %eax
movw %ax, 0x7a(%rbx)
cmpb $0x1, -0x2a(%rbp)
jne 0x727cb
movq -0x60(%rbp), %rax
movss 0x1b28(%rax), %xmm0
ucomiss 0x438ef(%rip), %xmm0    # 0xb60b8
ja 0x727d5
cmpb $0x1, -0x29(%rbp)
jne 0x72669
movb %r14b, 0x235(%rbx)
pushq $0x4
popq %rdi
callq 0x404f0
jmp 0x72669
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x43bf0(%rip), %rdi     # 0xb63ef
leaq 0x43900(%rip), %rsi     # 0xb6106
leaq 0x43c0b(%rip), %rcx     # 0xb6418
movl $0x44b, %edx            # imm = 0x44B
callq 0xc140