LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::TreePop()
void ImGui::TreePop()
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    Unindent();

    window->DC.TreeDepth--;
    ImU32 tree_depth_mask = (1 << window->DC.TreeDepth);

    // Handle Left arrow to move to parent tree node (when ImGuiTreeNodeFlags_NavLeftJumpsBackHere is enabled)
    if (g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet())
        if (g.NavIdIsAlive && (window->DC.TreeJumpToParentOnPopMask & tree_depth_mask))
        {
            SetNavID(window->IDStack.back(), g.NavLayer, 0);
            NavMoveRequestCancel();
        }
    window->DC.TreeJumpToParentOnPopMask &= tree_depth_mask - 1;

    IM_ASSERT(window->IDStack.Size > 1); // There should always be 1 element in the IDStack (pushed during window creation). If this triggers you called TreePop/PopID too much.
    PopID();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x5ad71(%rip), %rax     # 0xfdcd0
movq (%rax), %r15
movq 0x1ae0(%r15), %rbx
xorps %xmm0, %xmm0
callq 0x56d81
movl 0x18c(%rbx), %ecx
decl %ecx
movl $0x1, %r14d
shll %cl, %r14d
movl %ecx, 0x18c(%rbx)
cmpl $0x0, 0x1d10(%r15)
jne 0xa2fe1
cmpq %rbx, 0x1c90(%r15)
jne 0xa2fe1
callq 0x58ef0
testb %al, %al
je 0xa2fe1
cmpb $0x1, 0x1ce4(%r15)
jne 0xa2fe1
testl %r14d, 0x190(%rbx)
je 0xa2fe1
movslq 0xc8(%rbx), %rax
testq %rax, %rax
jle 0xa3022
movq 0xd0(%rbx), %rcx
movl -0x4(%rcx,%rax,4), %edi
movl 0x1cdc(%r15), %esi
xorl %edx, %edx
callq 0x58d20
callq 0x58f1d
decl %r14d
andl %r14d, 0x190(%rbx)
cmpl $0x1, 0xc8(%rbx)
jle 0xa3003
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x56188
leaq 0x1677c(%rip), %rdi     # 0xb9786
leaq 0x30137(%rip), %rsi     # 0xd3148
leaq 0x31946(%rip), %rcx     # 0xd495e
movl $0x16f8, %edx           # imm = 0x16F8
callq 0xc140
leaq 0x2c9b1(%rip), %rdi     # 0xcf9da
leaq 0x1865b(%rip), %rsi     # 0xbb68b
leaq 0x199c1(%rip), %rcx     # 0xbc9f8
movl $0x666, %edx            # imm = 0x666
callq 0xc140
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::SetNextItemOpen(bool, int)
void ImGui::SetNextItemOpen(bool is_open, ImGuiCond cond)
{
    ImGuiContext& g = *GImGui;
    if (g.CurrentWindow->SkipItems)
        return;
    g.NextItemData.Flags |= ImGuiNextItemDataFlags_HasOpen;
    g.NextItemData.OpenVal = is_open;
    g.NextItemData.OpenCond = cond ? cond : ImGuiCond_Always;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x5ac60(%rip), %rax     # 0xfdcd0
movq (%rax), %rax
movq 0x1ae0(%rax), %rcx
cmpb $0x0, 0x93(%rcx)
jne 0xa309d
orb $0x2, 0x1bf8(%rax)
movb %dil, 0x1c08(%rax)
cmpl $0x1, %esi
adcl $0x0, %esi
movl %esi, 0x1c04(%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::ListBoxHeader(char const*, int, int)
bool ImGui::ListBoxHeader(const char* label, int items_count, int height_in_items)
{
    // Size default to hold ~7.25 items.
    // We add +25% worth of item height to allow the user to see at a glance if there are more items up/down, without looking at the scrollbar.
    // We don't add this extra bit if items_count <= height_in_items. It is slightly dodgy, because it means a dynamic list of items will make the widget resize occasionally when it crosses that size.
    // I am expecting that someone will come and complain about this behavior in a remote future, then we can advise on a better solution.
    if (height_in_items < 0)
        height_in_items = ImMin(items_count, 7);
    const ImGuiStyle& style = GetStyle();
    float height_in_items_f = (height_in_items < items_count) ? (height_in_items + 0.25f) : (height_in_items + 0.00f);

    // We include ItemSpacing.y so that a list sized for the exact number of items doesn't make a scrollbar appears. We could also enforce that by passing a flag to BeginChild().
    ImVec2 size;
    size.x = 0.0f;
    size.y = ImFloor(GetTextLineHeightWithSpacing() * height_in_items_f + style.FramePadding.y * 2.0f);
    return ListBoxHeader(label, size);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %r15d
cmpl $0x7, %esi
movl $0x7, %r12d
cmovll %esi, %r12d
movq %rdi, %rbx
testl %edx, %edx
cmovnsl %edx, %r12d
callq 0x44587
movq %rax, %r14
cvtsi2ss %r12d, %xmm0
cmpl %r15d, %r12d
jge 0xa34f2
addss 0x13afa(%rip), %xmm0    # 0xb6fec
movss %xmm0, -0x24(%rbp)
leaq -0x2c(%rbp), %r15
movq $0x0, (%r15)
callq 0x573e7
movss 0x3c(%r14), %xmm1
addss %xmm1, %xmm1
mulss -0x24(%rbp), %xmm0
addss %xmm1, %xmm0
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm0
movss %xmm0, 0x4(%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa32a8
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::ListBoxFooter()
void ImGui::ListBoxFooter()
{
    ImGuiWindow * window = GetCurrentWindow();
    IM_ASSERT((window->Flags & ImGuiWindowFlags_ChildWindow) && "Mismatched ListBoxHeader/ListBoxFooter calls. Did you test the return value of ListBoxHeader()?");
    ImGuiWindow* parent_window = window->ParentWindow;
    const ImRect bb = parent_window->DC.LastItemRect;
    const ImGuiStyle& style = GetStyle();

    EndChildFrame();

    // Redeclare item size so that it includes the label (we have stored the full size in LastItemRect)
    // We call SameLine() to restore DC.CurrentLine* data
    SameLine();
    parent_window->DC.CursorPos = bb.Min;
    ItemSize(bb, style.FramePadding.y);
    EndGroup();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0x5a77d(%rip), %rax     # 0xfdcd0
movq (%rax), %rax
movq 0x1ae0(%rax), %rax
movb $0x1, 0x90(%rax)
testb $0x1, 0xf(%rax)
je 0xa35c5
movq 0x388(%rax), %r15
movups 0x12c(%r15), %xmm0
leaq -0x30(%rbp), %rbx
movaps %xmm0, (%rbx)
callq 0x44587
movq %rax, %r14
callq 0x538e5
movss 0x13a3b(%rip), %xmm1    # 0xb6fd0
xorps %xmm0, %xmm0
callq 0x569e1
movq (%rbx), %rax
movq %rax, 0xd8(%r15)
movss 0x3c(%r14), %xmm0
movq %rbx, %rdi
callq 0x56a82
callq 0x56723
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x313a8(%rip), %rdi     # 0xd4974
leaq 0x2fb75(%rip), %rsi     # 0xd3148
leaq 0x3142e(%rip), %rcx     # 0xd4a08
movl $0x1829, %edx           # imm = 0x1829
callq 0xc140
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::ListBox(char const*, int*, bool (*)(void*, int, char const**), void*, int, int)
bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int height_in_items)
{
    if (!ListBoxHeader(label, items_count, height_in_items))
        return false;

    // Assume all items have even height (= 1 line of text). If you need items of different or variable sizes you can create a custom version of ListBox() in your code without using the clipper.
    ImGuiContext& g = *GImGui;
    bool value_changed = false;
    ImGuiListClipper clipper;
    clipper.Begin(items_count, GetTextLineHeightWithSpacing()); // We know exactly our line height here so we pass it as a minor optimization, but generally you don't need to.
    while (clipper.Step())
        for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
        {
            const bool item_selected = (i == *current_item);
            const char* item_text;
            if (!items_getter(data, i, &item_text))
                item_text = "*Unknown item*";

            PushID(i);
            if (Selectable(item_text, item_selected))
            {
                *current_item = i;
                value_changed = true;
            }
            if (item_selected)
                SetItemDefaultFocus();
            PopID();
        }
    ListBoxFooter();
    if (value_changed)
        MarkItemEdited(g.CurrentWindow->DC.LastItemId);

    return value_changed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r8d, %r12d
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %r8d, %esi
movl %r9d, %edx
callq 0xa34b0
testb %al, %al
je 0xa36db
leaq 0x5a69b(%rip), %rax     # 0xfdcd0
movq (%rax), %rax
movq %rax, -0x60(%rbp)
leaq -0x54(%rbp), %rdi
callq 0x44130
callq 0x573e7
leaq -0x54(%rbp), %rdi
movl %r12d, %esi
callq 0x44172
movl $0x0, -0x2c(%rbp)
leaq -0x54(%rbp), %rdi
callq 0x44316
testb %al, %al
je 0xa36df
movl -0x54(%rbp), %r13d
cmpl -0x50(%rbp), %r13d
jge 0xa365d
movl (%r15), %r12d
movq %rbx, %rdi
movl %r13d, %esi
leaq -0x38(%rbp), %rdx
callq *%r14
testb %al, %al
jne 0xa3693
leaq 0x2ff9f(%rip), %rax     # 0xd362e
movq %rax, -0x38(%rbp)
movl %r13d, %edi
callq 0x55f53
xorl %esi, %esi
cmpl %r12d, %r13d
sete %sil
movq -0x38(%rbp), %rdi
movq $0x0, -0x68(%rbp)
xorl %edx, %edx
leaq -0x68(%rbp), %rcx
callq 0x962c5
testb %al, %al
je 0xa36c7
movl %r13d, (%r15)
movb $0x1, %al
movl %eax, -0x2c(%rbp)
cmpl %r12d, %r13d
jne 0xa36d1
callq 0x55a6e
callq 0x56188
incl %r13d
jmp 0xa366e
xorl %ebx, %ebx
jmp 0xa370b
callq 0xa353f
movl -0x2c(%rbp), %ebx
testb $0x1, %bl
je 0xa3702
movq -0x60(%rbp), %rax
movq 0x1ae0(%rax), %rax
movl 0x124(%rax), %edi
callq 0x46ca4
leaq -0x54(%rbp), %rdi
callq 0x44148
andb $0x1, %bl
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa3725
jmp 0xa3725
jmp 0xa3725
movq %rax, %rbx
leaq -0x54(%rbp), %rdi
callq 0x44148
movq %rbx, %rdi
callq 0xc560
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::Value(char const*, float, char const*)
void ImGui::Value(const char* prefix, float v, const char* float_format)
{
    if (float_format)
    {
        char fmt[64];
        ImFormatString(fmt, IM_ARRAYSIZE(fmt), "%%s: %s", float_format);
        Text(fmt, prefix, v);
    }
    else
    {
        Text("%s: %.3f", prefix, v);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
testq %rsi, %rsi
je 0xa4211
movq %rsi, %rcx
leaq 0x30929(%rip), %rdx     # 0xd4b04
leaq -0x60(%rbp), %r14
movl $0x40, %esi
movq %r14, %rdi
xorl %eax, %eax
movss %xmm0, -0x14(%rbp)
callq 0x427cb
xorps %xmm0, %xmm0
cvtss2sd -0x14(%rbp), %xmm0
movq %r14, %rdi
movq %rbx, %rsi
movb $0x1, %al
callq 0x92024
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
cvtss2sd %xmm0, %xmm0
leaq 0x308f0(%rip), %rdi     # 0xd4b0c
movq %rbx, %rsi
movb $0x1, %al
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x92024
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGuiMenuColumns::Update(int, float, bool)
void ImGuiMenuColumns::Update(int count, float spacing, bool clear)
{
    IM_ASSERT(count == IM_ARRAYSIZE(Pos));
    IM_UNUSED(count);
    Width = NextWidth = 0.0f;
    Spacing = spacing;
    if (clear)
        memset(NextWidths, 0, sizeof(NextWidths));
    for (int i = 0; i < IM_ARRAYSIZE(Pos); i++)
    {
        if (i > 0 && NextWidths[i] > 0.0f)
            Width += Spacing;
        Pos[i] = IM_FLOOR(Width);
        Width += NextWidths[i];
        NextWidths[i] = 0.0f;
    }
}

// Assembly:
cmpl $0x3, %esi
jne 0xa429a
movq $0x0, 0x4(%rdi)
movss %xmm0, (%rdi)
testb %dl, %dl
je 0xa4252
movl $0x0, 0x20(%rdi)
movq $0x0, 0x18(%rdi)
movss 0x4(%rdi), %xmm1
xorl %eax, %eax
xorps %xmm2, %xmm2
testq %rax, %rax
je 0xa4270
movss 0x18(%rdi,%rax,4), %xmm3
ucomiss %xmm2, %xmm3
jbe 0xa4270
addss %xmm0, %xmm1
cvttps2dq %xmm1, %xmm3
cvtdq2ps %xmm3, %xmm3
movss %xmm3, 0xc(%rdi,%rax,4)
addss 0x18(%rdi,%rax,4), %xmm1
movl $0x0, 0x18(%rdi,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0xa425c
movss %xmm1, 0x4(%rdi)
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x30870(%rip), %rdi     # 0xd4b15
leaq 0x2ee9c(%rip), %rsi     # 0xd3148
leaq 0x30891(%rip), %rcx     # 0xd4b44
movl $0x193d, %edx           # imm = 0x193D
callq 0xc140
nop
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGuiMenuColumns::DeclColumns(float, float, float)
float ImGuiMenuColumns::DeclColumns(float w0, float w1, float w2) // not using va_arg because they promote float to double
{
    NextWidth = 0.0f;
    NextWidths[0] = ImMax(NextWidths[0], w0);
    NextWidths[1] = ImMax(NextWidths[1], w1);
    NextWidths[2] = ImMax(NextWidths[2], w2);
    for (int i = 0; i < IM_ARRAYSIZE(Pos); i++)
        NextWidth += NextWidths[i] + ((i > 0 && NextWidths[i] > 0.0f) ? Spacing : 0.0f);
    return ImMax(Width, NextWidth);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x0, 0x8(%rdi)
movss (%rdi), %xmm3
movss 0x18(%rdi), %xmm4
movaps %xmm0, %xmm5
cmpless %xmm4, %xmm5
andps %xmm5, %xmm4
andnps %xmm0, %xmm5
orps %xmm4, %xmm5
movss %xmm5, 0x18(%rdi)
movss 0x1c(%rdi), %xmm0
movaps %xmm1, %xmm4
cmpless %xmm0, %xmm4
andps %xmm4, %xmm0
andnps %xmm1, %xmm4
orps %xmm0, %xmm4
movss %xmm4, 0x1c(%rdi)
movss 0x20(%rdi), %xmm0
movaps %xmm2, %xmm1
cmpless %xmm0, %xmm1
andps %xmm1, %xmm0
andnps %xmm2, %xmm1
orps %xmm0, %xmm1
movss %xmm1, 0x20(%rdi)
xorps %xmm1, %xmm1
xorl %eax, %eax
movss 0x18(%rdi,%rax,4), %xmm0
xorps %xmm2, %xmm2
testq %rax, %rax
je 0xa4339
cmpltss %xmm0, %xmm2
andps %xmm3, %xmm2
addss %xmm2, %xmm0
addss %xmm0, %xmm1
incq %rax
cmpq $0x3, %rax
jne 0xa4323
movss %xmm1, 0x8(%rdi)
movss 0x4(%rdi), %xmm2
movaps %xmm1, %xmm0
cmpless %xmm2, %xmm0
andps %xmm0, %xmm2
andnps %xmm1, %xmm0
orps %xmm2, %xmm0
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::BeginMainMenuBar()
bool ImGui::BeginMainMenuBar()
{
    ImGuiContext& g = *GImGui;
    g.NextWindowData.MenuBarOffsetMinVal = ImVec2(g.Style.DisplaySafeAreaPadding.x, ImMax(g.Style.DisplaySafeAreaPadding.y - g.Style.FramePadding.y, 0.0f));
    SetNextWindowPos(ImVec2(0.0f, 0.0f));
    SetNextWindowSize(ImVec2(g.IO.DisplaySize.x, g.NextWindowData.MenuBarOffsetMinVal.y + g.FontBaseSize + g.Style.FramePadding.y));
    PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
    PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(0, 0));
    ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_MenuBar;
    bool is_open = Begin("##MainMenuBar", NULL, window_flags) && BeginMenuBar();
    PopStyleVar(2);
    g.NextWindowData.MenuBarOffsetMinVal = ImVec2(0.0f, 0.0f);
    if (!is_open)
    {
        End();
        return false;
    }
    return true; //-V1020
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0x59570(%rip), %rax     # 0xfdcd0
movq (%rax), %r15
movl 0x160c(%r15), %eax
movss 0x1610(%r15), %xmm0
subss 0x159c(%r15), %xmm0
xorps %xmm1, %xmm1
cmpless %xmm0, %xmm1
andps %xmm0, %xmm1
movl %eax, 0x1bec(%r15)
movss %xmm1, 0x1bf0(%r15)
xorl %ebx, %ebx
leaq -0x20(%rbp), %r14
movq %rbx, (%r14)
leaq -0x28(%rbp), %rdx
movq %rbx, (%rdx)
movq %r14, %rdi
xorl %esi, %esi
callq 0x5566a
movss 0x10(%r15), %xmm0
movss 0x1bf0(%r15), %xmm1
addss 0x1984(%r15), %xmm1
addss 0x159c(%r15), %xmm1
movss %xmm0, (%r14)
movss %xmm1, 0x4(%r14)
movq %r14, %rdi
xorl %esi, %esi
callq 0x4c35e
xorps %xmm0, %xmm0
movl $0x2, %edi
callq 0x449ff
movq %rbx, (%r14)
leaq -0x20(%rbp), %rsi
movl $0x4, %edi
callq 0x44ba2
leaq 0x17c64(%rip), %rdi     # 0xbc470
xorl %esi, %esi
movl $0x50f, %edx            # imm = 0x50F
callq 0x4c3ad
testb %al, %al
je 0xa4823
callq 0xa4384
movl %eax, %ebx
movl $0x2, %edi
callq 0x44d5f
movq $0x0, 0x1bec(%r15)
testb %bl, %bl
jne 0xa4841
callq 0x51ace
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::EndMainMenuBar()
void ImGui::EndMainMenuBar()
{
    EndMenuBar();

    // When the user has left the menu layer (typically: closed menus through activation of an item), we restore focus to the previous window
    // FIXME: With this strategy we won't be able to restore a NULL focus.
    ImGuiContext& g = *GImGui;
    if (g.CurrentWindow == g.NavWindow && g.NavLayer == ImGuiNavLayer_Main && !g.NavAnyRequest)
        FocusTopMostWindowUnderOne(g.NavWindow, NULL);

    End();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0xa4564
leaq 0x59472(%rip), %rax     # 0xfdcd0
movq (%rax), %rax
movq 0x1c90(%rax), %rdi
cmpq %rdi, 0x1ae0(%rax)
jne 0xa488a
cmpl $0x0, 0x1cdc(%rax)
jne 0xa488a
cmpb $0x0, 0x1ce8(%rax)
jne 0xa488a
xorl %esi, %esi
callq 0x4c27b
popq %rbp
jmp 0x51ace
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::EndMenu()
void ImGui::EndMenu()
{
    // Nav: When a left move request _within our child menu_ failed, close ourselves (the _parent_ menu).
    // A menu doesn't close itself because EndMenuBar() wants the catch the last Left<>Right inputs.
    // However, it means that with the current code, a BeginMenu() from outside another menu or a menu-bar won't be closable with the Left direction.
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    if (g.NavWindow && g.NavWindow->ParentWindow == window && g.NavMoveDir == ImGuiDir_Left && NavMoveRequestButNoResultYet() && window->DC.LayoutType == ImGuiLayoutType_Vertical)
    {
        ClosePopupToLevel(g.BeginPopupStack.Size, true);
        NavMoveRequestCancel();
    }

    EndPopup();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x58bc5(%rip), %rax     # 0xfdcd0
movq (%rax), %rbx
movq 0x1c90(%rbx), %rax
testq %rax, %rax
je 0xa515b
movq 0x1ae0(%rbx), %r14
cmpq %r14, 0x388(%rax)
jne 0xa515b
cmpl $0x0, 0x1d10(%rbx)
jne 0xa515b
callq 0x58ef0
testb %al, %al
je 0xa515b
cmpl $0x1, 0x1bc(%r14)
jne 0xa515b
movl 0x1c80(%rbx), %edi
movl $0x1, %esi
callq 0x58144
callq 0x58f1d
popq %rbx
popq %r14
popq %rbp
jmp 0x5847b
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::BeginTabBar(char const*, int)
bool    ImGui::BeginTabBar(const char* str_id, ImGuiTabBarFlags flags)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    if (window->SkipItems)
        return false;

    ImGuiID id = window->GetID(str_id);
    ImGuiTabBar* tab_bar = g.TabBars.GetOrAddByKey(id);
    ImRect tab_bar_bb = ImRect(window->DC.CursorPos.x, window->DC.CursorPos.y, window->WorkRect.Max.x, window->DC.CursorPos.y + g.FontSize + g.Style.FramePadding.y * 2);
    tab_bar->ID = id;
    return BeginTabBarEx(tab_bar, tab_bar_bb, flags | ImGuiTabBarFlags_IsFocused);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0x58810(%rip), %rax     # 0xfdcd0
movq (%rax), %r12
movq 0x1ae0(%r12), %r14
cmpb $0x0, 0x93(%r14)
je 0xa54dc
xorl %eax, %eax
jmp 0xa5563
movl %esi, %ebx
movq %rdi, %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x46258
movl %eax, %r15d
leaq 0x2110(%r12), %rdi
movl %eax, %esi
callq 0xad620
movss 0xd8(%r14), %xmm0
movss 0xdc(%r14), %xmm1
movss 0x240(%r14), %xmm2
movss 0x1980(%r12), %xmm3
addss %xmm1, %xmm3
movss 0x159c(%r12), %xmm4
addss %xmm4, %xmm4
addss %xmm3, %xmm4
leaq -0x30(%rbp), %rsi
movss %xmm0, (%rsi)
movss %xmm1, 0x4(%rsi)
movss %xmm2, 0x8(%rsi)
movss %xmm4, 0xc(%rsi)
movl %r15d, 0x14(%rax)
orl $0x200000, %ebx         # imm = 0x200000
movq %rax, %rdi
movl %ebx, %edx
callq 0xa5570
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::TabBarFindTabByID(ImGuiTabBar*, unsigned int)
ImGuiTabItem* ImGui::TabBarFindTabByID(ImGuiTabBar* tab_bar, ImGuiID tab_id)
{
    if (tab_id != 0)
        for (int n = 0; n < tab_bar->Tabs.Size; n++)
            if (tab_bar->Tabs[n].ID == tab_id)
                return &tab_bar->Tabs[n];
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %esi, %esi
je 0xa6ac1
movslq (%rdi), %rcx
testq %rcx, %rcx
setg %dl
jle 0xa6ab8
movq 0x8(%rdi), %rax
cmpl %esi, (%rax)
je 0xa6abd
movl $0x1, %edx
cmpq %rdx, %rcx
je 0xa6aba
leaq 0x24(%rax), %rdi
incq %rdx
cmpl %esi, 0x24(%rax)
movq %rdi, %rax
jne 0xa6a96
decq %rdx
cmpq %rcx, %rdx
setb %dl
movq %rdi, %rax
jmp 0xa6abd
jmp 0xa6abd
seta %dl
testb %dl, %dl
jne 0xa6ac3
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::TabBarRemoveTab(ImGuiTabBar*, unsigned int)
void ImGui::TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id)
{
    if (ImGuiTabItem* tab = TabBarFindTabByID(tab_bar, tab_id))
        tab_bar->Tabs.erase(tab);
    if (tab_bar->VisibleTabId == tab_id)      { tab_bar->VisibleTabId = 0; }
    if (tab_bar->SelectedTabId == tab_id)     { tab_bar->SelectedTabId = 0; }
    if (tab_bar->NextSelectedTabId == tab_id) { tab_bar->NextSelectedTabId = 0; }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
testl %esi, %esi
je 0xa6b2b
movslq (%rbx), %rax
testq %rax, %rax
setg %cl
jle 0xa6b19
movq 0x8(%rbx), %rdi
movb $0x1, %cl
cmpl %r14d, (%rdi)
je 0xa6b27
leaq (%rax,%rax,8), %rcx
leaq (%rdi,%rcx,4), %rcx
addq $-0x24, %rcx
movl $0x1, %r8d
movq %r8, %rdx
cmpq %r8, %rax
je 0xa6b1b
leaq 0x24(%rdi), %rsi
leaq 0x1(%rdx), %r8
cmpl %r14d, 0x24(%rdi)
movq %rsi, %rdi
jne 0xa6afe
jmp 0xa6b1e
jmp 0xa6b27
movq %rcx, %rsi
cmpq %rax, %rdx
setb %cl
movq %rsi, %rdi
testb %cl, %cl
jne 0xa6b2d
xorl %edi, %edi
testq %rdi, %rdi
je 0xa6b7c
movq 0x8(%rbx), %rcx
cmpq %rdi, %rcx
ja 0xa6ba8
movslq (%rbx), %rax
leaq (%rax,%rax,8), %rdx
leaq (%rcx,%rdx,4), %rdx
cmpq %rdi, %rdx
jbe 0xa6ba8
movq %rdi, %rdx
subq %rcx, %rdx
shrq $0x2, %rdx
movabsq $-0x71c71c71c71c71c7, %rcx # imm = 0x8E38E38E38E38E39
imulq %rdx, %rcx
leaq 0x24(%rdi), %rsi
notq %rcx
addq %rcx, %rax
shlq $0x2, %rax
leaq (%rax,%rax,8), %rdx
callq 0xc130
decl (%rbx)
cmpl %r14d, 0x20(%rbx)
jne 0xa6b89
movl $0x0, 0x20(%rbx)
cmpl %r14d, 0x18(%rbx)
jne 0xa6b96
movl $0x0, 0x18(%rbx)
cmpl %r14d, 0x1c(%rbx)
jne 0xa6ba3
movl $0x0, 0x1c(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1b9b1(%rip), %rdi     # 0xc2560
leaq 0x14ad5(%rip), %rsi     # 0xbb68b
leaq 0x2e84a(%rip), %rcx     # 0xd5407
movl $0x674, %edx            # imm = 0x674
callq 0xc140
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::TabBarCloseTab(ImGuiTabBar*, ImGuiTabItem*)
void ImGui::TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab)
{
    IM_ASSERT(!(tab->Flags & ImGuiTabItemFlags_Button));
    if (!(tab->Flags & ImGuiTabItemFlags_UnsavedDocument))
    {
        // This will remove a frame of lag for selecting another tab on closure.
        // However we don't run it in the case where the 'Unsaved' flag is set, so user gets a chance to fully undo the closure
        tab->WantClose = true;
        if (tab_bar->VisibleTabId == tab->ID)
        {
            tab->LastFrameVisible = -1;
            tab_bar->SelectedTabId = tab_bar->NextSelectedTabId = 0;
        }
    }
    else
    {
        // Actually select before expecting closure attempt (on an UnsavedDocument tab user is expect to e.g. show a popup)
        if (tab_bar->VisibleTabId != tab->ID)
            tab_bar->NextSelectedTabId = tab->ID;
    }
}

// Assembly:
movl 0x4(%rsi), %eax
btl $0x15, %eax
jb 0xa6bfa
testb $0x1, %al
jne 0xa6bef
movb $0x1, 0x22(%rsi)
movl 0x20(%rdi), %eax
cmpl (%rsi), %eax
jne 0xa6bf9
movl $0xffffffff, 0x8(%rsi)  # imm = 0xFFFFFFFF
movq $0x0, 0x18(%rdi)
retq
movl (%rsi), %eax
cmpl %eax, 0x20(%rdi)
je 0xa6bf9
movl %eax, 0x1c(%rdi)
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x2e07b(%rip), %rdi     # 0xd4c80
leaq 0x2c53c(%rip), %rsi     # 0xd3148
leaq 0x2e096(%rip), %rcx     # 0xd4ca9
movl $0x1c88, %edx           # imm = 0x1C88
callq 0xc140
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::TabBarQueueReorder(ImGuiTabBar*, ImGuiTabItem const*, int)
void ImGui::TabBarQueueReorder(ImGuiTabBar* tab_bar, const ImGuiTabItem* tab, int dir)
{
    IM_ASSERT(dir == -1 || dir == +1);
    IM_ASSERT(tab_bar->ReorderRequestTabId == 0);
    tab_bar->ReorderRequestTabId = tab->ID;
    tab_bar->ReorderRequestDir = (ImS8)dir;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $-0x1, %edx
je 0xa6c2b
cmpl $0x1, %edx
jne 0xa6c5a
cmpl $0x0, 0x64(%rdi)
jne 0xa6c3b
movl (%rsi), %eax
movl %eax, 0x64(%rdi)
movb %dl, 0x68(%rdi)
popq %rbp
retq
leaq 0x2e101(%rip), %rdi     # 0xd4d43
leaq 0x2c4ff(%rip), %rsi     # 0xd3148
leaq 0x2e0aa(%rip), %rcx     # 0xd4cfa
movl $0x1cc4, %edx           # imm = 0x1CC4
callq 0xc140
leaq 0x2e082(%rip), %rdi     # 0xd4ce3
leaq 0x2c4e0(%rip), %rsi     # 0xd3148
leaq 0x2e08b(%rip), %rcx     # 0xd4cfa
movl $0x1cc3, %edx           # imm = 0x1CC3
callq 0xc140
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::TabBarProcessReorder(ImGuiTabBar*)
bool ImGui::TabBarProcessReorder(ImGuiTabBar* tab_bar)
{
    ImGuiTabItem* tab1 = TabBarFindTabByID(tab_bar, tab_bar->ReorderRequestTabId);
    if (tab1 == NULL || (tab1->Flags & ImGuiTabItemFlags_NoReorder))
        return false;

    //IM_ASSERT(tab_bar->Flags & ImGuiTabBarFlags_Reorderable); // <- this may happen when using debug tools
    int tab2_order = tab_bar->GetTabOrder(tab1) + tab_bar->ReorderRequestDir;
    if (tab2_order < 0 || tab2_order >= tab_bar->Tabs.Size)
        return false;

    // Reordered TabItem must share the same position flags than target
    ImGuiTabItem* tab2 = &tab_bar->Tabs[tab2_order];
    if (tab2->Flags & ImGuiTabItemFlags_NoReorder)
        return false;
    if ((tab1->Flags & (ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing)) != (tab2->Flags & (ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing)))
        return false;

    ImGuiTabItem item_tmp = *tab1;
    *tab1 = *tab2;
    *tab2 = item_tmp;

    if (tab_bar->Flags & ImGuiTabBarFlags_SaveSettings)
        MarkIniSettingsDirty();
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movl 0x64(%rdi), %ecx
testl %ecx, %ecx
je 0xa6ce3
movslq (%rbx), %rax
testq %rax, %rax
setg %dl
jle 0xa6cd1
movq 0x8(%rbx), %r14
movb $0x1, %dl
cmpl %ecx, (%r14)
je 0xa6cdf
leaq (%rax,%rax,8), %rdx
leaq (%r14,%rdx,4), %rdx
addq $-0x24, %rdx
movl $0x1, %r8d
movq %r8, %rsi
cmpq %r8, %rax
je 0xa6cd3
leaq 0x24(%r14), %rdi
leaq 0x1(%rsi), %r8
cmpl %ecx, 0x24(%r14)
movq %rdi, %r14
jne 0xa6cb6
jmp 0xa6cd6
jmp 0xa6cdf
movq %rdx, %rdi
cmpq %rax, %rsi
setb %dl
movq %rdi, %r14
testb %dl, %dl
jne 0xa6ce6
xorl %r14d, %r14d
testq %r14, %r14
je 0xa6d25
testb $0x20, 0x4(%r14)
jne 0xa6d25
movq %rbx, %rdi
movq %r14, %rsi
callq 0xad690
movsbl 0x68(%rbx), %ecx
addl %eax, %ecx
js 0xa6d25
cmpl (%rbx), %ecx
jge 0xa6d25
movq 0x8(%rbx), %rax
movl %ecx, %ecx
leaq (%rcx,%rcx,8), %rcx
movl 0x4(%rax,%rcx,4), %edx
testb $0x20, %dl
jne 0xa6d25
xorl 0x4(%r14), %edx
testb $-0x40, %dl
je 0xa6d30
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq (%rax,%rcx,4), %rax
movl 0x20(%r14), %ecx
movl %ecx, -0x20(%rbp)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
movl 0x1f(%rax), %ecx
movl %ecx, 0x1f(%r14)
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
movl -0x21(%rbp), %ecx
movl %ecx, 0x1f(%rax)
movaps -0x40(%rbp), %xmm0
movaps -0x30(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
testb $0x40, 0x12(%rbx)
je 0xa6d83
callq 0x5a458
movb $0x1, %al
jmp 0xa6d27
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::BeginTabItem(char const*, bool*, int)
bool    ImGui::BeginTabItem(const char* label, bool* p_open, ImGuiTabItemFlags flags)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    if (window->SkipItems)
        return false;

    ImGuiTabBar* tab_bar = g.CurrentTabBar;
    if (tab_bar == NULL)
    {
        IM_ASSERT_USER_ERROR(tab_bar, "Needs to be called between BeginTabBar() and EndTabBar()!");
        return false;
    }
    IM_ASSERT(!(flags & ImGuiTabItemFlags_Button)); // BeginTabItem() Can't be used with button flags, use TabItemButton() instead!

    bool ret = TabItemEx(tab_bar, label, p_open, flags);
    if (ret && !(flags & ImGuiTabItemFlags_NoPushId))
    {
        ImGuiTabItem* tab = &tab_bar->Tabs[tab_bar->LastTabItemIdx];
        PushOverrideID(tab->ID); // We already hashed 'label' so push into the ID stack directly instead of doing another hash through PushID(label)
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x56f38(%rip), %rax     # 0xfdcd0
movq (%rax), %rax
movq 0x1ae0(%rax), %rcx
cmpb $0x0, 0x93(%rcx)
je 0xa6daf
xorl %ebx, %ebx
jmp 0xa6e06
movq 0x2108(%rax), %r14
testq %r14, %r14
je 0xa6e13
movl %edx, %r15d
btl $0x15, %edx
jb 0xa6e32
movq %rsi, %rdx
movq %rdi, %rsi
movq %r14, %rdi
movl %r15d, %ecx
callq 0xa6e70
movl %eax, %ebx
xorb $0x1, %al
andl $0x8, %r15d
shrl $0x3, %r15d
orb %al, %r15b
jne 0xa6e06
movswl 0x70(%r14), %eax
testl %eax, %eax
js 0xa6e51
cmpl %eax, (%r14)
jle 0xa6e51
movq 0x8(%r14), %rcx
movl %eax, %eax
leaq (%rax,%rax,8), %rax
movl (%rcx,%rax,4), %edi
callq 0x5605a
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2df4b(%rip), %rdi     # 0xd4d65
leaq 0x2c327(%rip), %rsi     # 0xd3148
leaq 0x2df86(%rip), %rcx     # 0xd4dae
movl $0x1d5e, %edx           # imm = 0x1D5E
callq 0xc140
leaq 0x2e086(%rip), %rdi     # 0xd4ebf
leaq 0x2c308(%rip), %rsi     # 0xd3148
leaq 0x2df67(%rip), %rcx     # 0xd4dae
movl $0x1d61, %edx           # imm = 0x1D61
callq 0xc140
leaq 0x14820(%rip), %rdi     # 0xbb678
leaq 0x1482c(%rip), %rsi     # 0xbb68b
leaq 0x2e563(%rip), %rcx     # 0xd53c9
movl $0x65c, %edx            # imm = 0x65C
callq 0xc140
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::EndTabItem()
void    ImGui::EndTabItem()
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    if (window->SkipItems)
        return;

    ImGuiTabBar* tab_bar = g.CurrentTabBar;
    if (tab_bar == NULL)
    {
        IM_ASSERT_USER_ERROR(tab_bar != NULL, "Needs to be called between BeginTabBar() and EndTabBar()!");
        return;
    }
    IM_ASSERT(tab_bar->LastTabItemIdx >= 0);
    ImGuiTabItem* tab = &tab_bar->Tabs[tab_bar->LastTabItemIdx];
    if (!(tab->Flags & ImGuiTabItemFlags_NoPushId))
        PopID();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x564b7(%rip), %rax     # 0xfdcd0
movq (%rax), %rax
movq 0x1ae0(%rax), %rcx
cmpb $0x0, 0x93(%rcx)
jne 0xa785c
movq 0x2108(%rax), %rax
testq %rax, %rax
je 0xa785e
movswl 0x70(%rax), %ecx
testl %ecx, %ecx
js 0xa787d
cmpl %ecx, (%rax)
jle 0xa789c
movq 0x8(%rax), %rax
movslq %ecx, %rcx
leaq (%rcx,%rcx,8), %rcx
testb $0x8, 0x4(%rax,%rcx,4)
jne 0xa785c
popq %rbp
jmp 0x56188
popq %rbp
retq
leaq 0x2d58b(%rip), %rdi     # 0xd4df0
leaq 0x2b8dc(%rip), %rsi     # 0xd3148
leaq 0x2d5d0(%rip), %rcx     # 0xd4e43
movl $0x1d76, %edx           # imm = 0x1D76
callq 0xc140
leaq 0x2d5d8(%rip), %rdi     # 0xd4e5c
leaq 0x2b8bd(%rip), %rsi     # 0xd3148
leaq 0x2d5b1(%rip), %rcx     # 0xd4e43
movl $0x1d79, %edx           # imm = 0x1D79
callq 0xc140
leaq 0x13dd5(%rip), %rdi     # 0xbb678
leaq 0x13de1(%rip), %rsi     # 0xbb68b
leaq 0x2db18(%rip), %rcx     # 0xd53c9
movl $0x65c, %edx            # imm = 0x65C
callq 0xc140
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::TabItemButton(char const*, int)
bool    ImGui::TabItemButton(const char* label, ImGuiTabItemFlags flags)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    if (window->SkipItems)
        return false;

    ImGuiTabBar* tab_bar = g.CurrentTabBar;
    if (tab_bar == NULL)
    {
        IM_ASSERT_USER_ERROR(tab_bar != NULL, "Needs to be called between BeginTabBar() and EndTabBar()!");
        return false;
    }
    return TabItemEx(tab_bar, label, NULL, flags | ImGuiTabItemFlags_Button | ImGuiTabItemFlags_NoReorder);
}

// Assembly:
leaq 0x5640e(%rip), %rax     # 0xfdcd0
movq (%rax), %rax
movq 0x1ae0(%rax), %rdx
cmpb $0x0, 0x93(%rdx)
je 0xa78d8
xorl %eax, %eax
retq
movl %esi, %ecx
movq %rdi, %rsi
movq 0x2108(%rax), %rdi
testq %rdi, %rdi
je 0xa78f6
orl $0x200020, %ecx         # imm = 0x200020
xorl %edx, %edx
jmp 0xa6e70
pushq %rbp
movq %rsp, %rbp
leaq 0x2d4ef(%rip), %rdi     # 0xd4df0
leaq 0x2b840(%rip), %rsi     # 0xd3148
leaq 0x2d56a(%rip), %rcx     # 0xd4e79
movl $0x1d89, %edx           # imm = 0x1D89
callq 0xc140
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::TabBarCalcTabID(ImGuiTabBar*, char const*)
static ImU32   ImGui::TabBarCalcTabID(ImGuiTabBar* tab_bar, const char* label)
{
    if (tab_bar->Flags & ImGuiTabBarFlags_DockNode)
    {
        ImGuiID id = ImHashStr(label);
        KeepAliveID(id);
        return id;
    }
    else
    {
        ImGuiWindow* window = GImGui->CurrentWindow;
        return window->GetID(label);
    }
}

// Assembly:
testb $0x10, 0x12(%rdi)
jne 0xa7937
leaq 0x563aa(%rip), %rax     # 0xfdcd0
movq (%rax), %rax
movq 0x1ae0(%rax), %rdi
xorl %edx, %edx
jmp 0x46258
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x428dc
movl %eax, %ebx
movl %eax, %edi
callq 0x46530
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::TabItemCalcSize(char const*, bool)
ImVec2 ImGui::TabItemCalcSize(const char* label, bool has_close_button)
{
    ImGuiContext& g = *GImGui;
    ImVec2 label_size = CalcTextSize(label, NULL, true);
    ImVec2 size = ImVec2(label_size.x + g.Style.FramePadding.x, label_size.y + g.Style.FramePadding.y * 2.0f);
    if (has_close_button)
        size.x += g.Style.FramePadding.x + (g.Style.ItemInnerSpacing.x + g.FontSize); // We use Y intentionally to fit the close button circle.
    else
        size.x += g.Style.FramePadding.x + 1.0f;
    return ImVec2(ImMin(size.x, TabBarCalcMaxTabWidth()), size.y);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
leaq 0x56362(%rip), %r14     # 0xfdcd0
movq (%r14), %r15
movss 0xf657(%rip), %xmm0     # 0xb6fd0
xorl %esi, %esi
movl $0x1, %edx
callq 0x4548d
movaps %xmm0, %xmm1
movss 0x1598(%r15), %xmm0
movss 0x159c(%r15), %xmm2
testl %ebx, %ebx
je 0xa79b2
movss 0x15b0(%r15), %xmm3
addss 0x1980(%r15), %xmm3
jmp 0xa79ba
movss 0xf62a(%rip), %xmm3     # 0xb6fe4
addss %xmm0, %xmm3
addss %xmm1, %xmm0
addss %xmm3, %xmm0
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
addss %xmm2, %xmm2
movq (%r14), %rax
movss 0x1980(%rax), %xmm3
mulss 0xff27(%rip), %xmm3     # 0xb7908
addss %xmm1, %xmm2
minss %xmm3, %xmm0
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::SetTabItemClosed(char const*)
void    ImGui::SetTabItemClosed(const char* label)
{
    ImGuiContext& g = *GImGui;
    bool is_within_manual_tab_bar = g.CurrentTabBar && !(g.CurrentTabBar->Flags & ImGuiTabBarFlags_DockNode);
    if (is_within_manual_tab_bar)
    {
        ImGuiTabBar* tab_bar = g.CurrentTabBar;
        ImGuiID tab_id = TabBarCalcTabID(tab_bar, label);
        if (ImGuiTabItem* tab = TabBarFindTabByID(tab_bar, tab_id))
            tab->WantClose = true; // Will be processed by next call to TabBarLayout()
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x55aba(%rip), %rax     # 0xfdcd0
movq (%rax), %rax
movq 0x2108(%rax), %rbx
testq %rbx, %rbx
je 0xa829c
testb $0x10, 0x12(%rbx)
jne 0xa829c
movq %rdi, %rsi
movq %rbx, %rdi
callq 0xa7919
testl %eax, %eax
je 0xa8291
movslq (%rbx), %rdx
testq %rdx, %rdx
setg %sil
jle 0xa827d
movq 0x8(%rbx), %rcx
movb $0x1, %sil
cmpl %eax, (%rcx)
je 0xa828c
leaq (%rdx,%rdx,8), %rsi
leaq (%rcx,%rsi,4), %rsi
addq $-0x24, %rsi
movl $0x1, %r9d
movq %r9, %rdi
cmpq %r9, %rdx
je 0xa827f
leaq 0x24(%rcx), %r8
leaq 0x1(%rdi), %r9
cmpl %eax, 0x24(%rcx)
movq %r8, %rcx
jne 0xa8263
jmp 0xa8282
jmp 0xa828c
movq %rsi, %r8
cmpq %rdx, %rdi
setb %sil
movq %r8, %rcx
testb %sil, %sil
jne 0xa8293
xorl %ecx, %ecx
testq %rcx, %rcx
je 0xa829c
movb $0x1, 0x22(%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imstb_textedit.h
// Function: ImStb::stb_text_makeundo_replace(ImGuiInputTextState*, ImStb::STB_TexteditState*, int, int, int)
static void stb_text_makeundo_replace(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int old_length, int new_length)
{
   int i;
   STB_TEXTEDIT_CHARTYPE *p = stb_text_createundo(&state->undostate, where, old_length, new_length);
   if (p) {
      for (i=0; i < old_length; ++i)
         p[i] = STB_TEXTEDIT_GETCHAR(str, where+i);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r15d
movl %edx, %ebx
movq %rdi, %r14
leaq 0x20(%rsi), %rdi
movl %edx, %esi
movl %ecx, %edx
movl %r8d, %ecx
callq 0xa8921
testq %rax, %rax
sete %cl
testl %r15d, %r15d
setle %dl
orb %cl, %dl
jne 0xa8307
movl %ebx, %ecx
movl %r15d, %edx
leaq (%rcx,%rcx), %rsi
xorl %edi, %edi
testl %ebx, %ebx
js 0xa8312
leal (%rcx,%rdi), %r8d
cmpl %r8d, 0x10(%r14)
jle 0xa8312
movq 0x18(%r14), %r8
addq %rsi, %r8
movzwl (%r8,%rdi,2), %r8d
movw %r8w, (%rax,%rdi,2)
incq %rdi
cmpq %rdi, %rdx
jne 0xa82e0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1335f(%rip), %rdi     # 0xbb678
leaq 0x1336b(%rip), %rsi     # 0xbb68b
leaq 0x2ce8d(%rip), %rcx     # 0xd51b4
movl $0x65d, %edx            # imm = 0x65D
callq 0xc140
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImStb::STB_TEXTEDIT_DELETECHARS(ImGuiInputTextState*, int, int)
static void STB_TEXTEDIT_DELETECHARS(STB_TEXTEDIT_STRING* obj, int pos, int n)
{
    ImWchar* dst = obj->TextW.Data + pos;

    // We maintain our buffer length in both UTF-8 and wchar formats
    obj->Edited = true;
    obj->CurLenA -= ImTextCountUtf8BytesFromStr(dst, dst + n);
    obj->CurLenW -= n;

    // Offset remaining text (FIXME-OPT: Use memmove)
    const ImWchar* src = obj->TextW.Data + pos + n;
    while (ImWchar c = *src++)
        *dst++ = c;
    *dst = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movslq %esi, %r15
addq %r15, %r15
movq 0x18(%rdi), %rbx
addq %r15, %rbx
movb $0x1, 0xe7e(%rdi)
movslq %edx, %r12
leaq (%rbx,%r12,2), %rsi
movq %rbx, %rdi
callq 0x42d4e
subl %eax, 0x8(%r14)
subl %r12d, 0x4(%r14)
addq 0x18(%r14), %r15
leaq (%r15,%r12,2), %rax
movzwl (%rax), %ecx
testw %cx, %cx
je 0xa8381
movw %cx, (%rbx)
addq $0x2, %rbx
addq $0x2, %rax
testw %cx, %cx
jne 0xa8372
movw $0x0, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imstb_textedit.h
// Function: ImStb::stb_textedit_delete_selection(ImGuiInputTextState*, ImStb::STB_TexteditState*)
static void stb_textedit_delete_selection(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
{
   stb_textedit_clamp(str, state);
   if (STB_TEXT_HAS_SELECTION(state)) {
      if (state->select_start < state->select_end) {
         stb_textedit_delete(str, state, state->select_start, state->select_end - state->select_start);
         state->select_end = state->cursor = state->select_start;
      } else {
         stb_textedit_delete(str, state, state->select_end, state->select_start - state->select_end);
         state->select_start = state->cursor = state->select_end;
      }
      state->has_preferred_x = 0;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0xa863d
leaq 0x4(%rbx), %r12
movl 0x4(%rbx), %edx
movl 0x8(%rbx), %ecx
leaq 0x8(%rbx), %r15
movl %edx, %eax
subl %ecx, %eax
je 0xa85fe
jge 0xa85de
subl %edx, %ecx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa887b
movq %r12, %rax
jmp 0xa85f3
movq %r14, %rdi
movq %rbx, %rsi
movl %ecx, %edx
movl %eax, %ecx
callq 0xa887b
movq %r15, %rax
movq %r12, %r15
movl (%rax), %eax
movl %eax, (%rbx)
movl %eax, (%r15)
movb $0x0, 0x16(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imstb_textedit.h
// Function: ImStb::stb_textedit_move_to_last(ImGuiInputTextState*, ImStb::STB_TexteditState*)
static void stb_textedit_move_to_last(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
{
   if (STB_TEXT_HAS_SELECTION(state)) {
      stb_textedit_sortselection(state);
      stb_textedit_clamp(str, state);
      state->cursor = state->select_end;
      state->select_start = state->select_end;
      state->has_preferred_x = 0;
   }
}

// Assembly:
movl 0x4(%rsi), %eax
movl 0x8(%rsi), %ecx
cmpl %ecx, %eax
je 0xa863c
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
jle 0xa8622
movl %eax, 0x8(%rbx)
movl %ecx, 0x4(%rbx)
movq %rbx, %rsi
callq 0xa863d
movl 0x8(%rbx), %eax
movl %eax, (%rbx)
movl %eax, 0x4(%rbx)
movb $0x0, 0x16(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imstb_textedit.h
// Function: ImStb::stb_textedit_clamp(ImGuiInputTextState*, ImStb::STB_TexteditState*)
static void stb_textedit_clamp(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
{
   int n = STB_TEXTEDIT_STRINGLEN(str);
   if (STB_TEXT_HAS_SELECTION(state)) {
      if (state->select_start > n) state->select_start = n;
      if (state->select_end   > n) state->select_end = n;
      // if clamping forced them to be equal, move the cursor to match
      if (state->select_start == state->select_end)
         state->cursor = state->select_start;
   }
   if (state->cursor > n) state->cursor = n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x4(%rdi), %eax
movl 0x4(%rsi), %edx
movl 0x8(%rsi), %ecx
cmpl %ecx, %edx
je 0xa8666
cmpl %eax, %edx
jle 0xa8655
movl %eax, 0x4(%rsi)
cmpl %eax, %ecx
jle 0xa865c
movl %eax, 0x8(%rsi)
movl 0x4(%rsi), %ecx
cmpl 0x8(%rsi), %ecx
jne 0xa8666
movl %ecx, (%rsi)
cmpl %eax, (%rsi)
jle 0xa866c
movl %eax, (%rsi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imstb_textedit.h
// Function: ImStb::stb_text_createundo(ImStb::StbUndoState*, int, int, int)
static STB_TEXTEDIT_CHARTYPE *stb_text_createundo(StbUndoState *state, int pos, int insert_len, int delete_len)
{
   StbUndoRecord *r = stb_text_create_undo_record(state, insert_len);
   if (r == NULL)
      return NULL;

   r->where = pos;
   r->insert_length = (STB_TEXTEDIT_POSITIONTYPE) insert_len;
   r->delete_length = (STB_TEXTEDIT_POSITIONTYPE) delete_len;

   if (insert_len == 0) {
      r->char_storage = -1;
      return NULL;
   } else {
      r->char_storage = state->undo_char_point;
      state->undo_char_point += insert_len;
      return &state->undo_char[r->char_storage];
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %r15d
movl %edx, %ebx
movl %esi, %r12d
movq %rdi, %r14
movw $0x63, 0xe00(%rdi)
movl $0x3e7, 0xe08(%rdi)     # imm = 0x3E7
cmpw $0x63, 0xdfe(%rdi)
jne 0xa895c
movq %r14, %rdi
callq 0xa8a03
cmpl $0x3e7, %ebx            # imm = 0x3E7
jle 0xa897d
movw $0x0, 0xdfe(%r14)
movl $0x0, 0xe04(%r14)
xorl %eax, %eax
jmp 0xa89bf
movl 0xe04(%r14), %eax
addl %ebx, %eax
cmpl $0x3e8, %eax            # imm = 0x3E8
jl 0xa89a5
movq %r14, %rdi
callq 0xa8a03
movl 0xe04(%r14), %eax
addl %ebx, %eax
cmpl $0x3e7, %eax            # imm = 0x3E7
jg 0xa898d
movswq 0xdfe(%r14), %rax
leal 0x1(%rax), %ecx
movw %cx, 0xdfe(%r14)
shlq $0x4, %rax
addq %r14, %rax
testq %rax, %rax
je 0xa89f8
movl %r12d, (%rax)
movl %ebx, 0x4(%rax)
movl %r15d, 0x8(%rax)
testl %ebx, %ebx
je 0xa89f1
movslq 0xe04(%r14), %rcx
movl %ecx, 0xc(%rax)
addl %ecx, %ebx
movl %ebx, 0xe04(%r14)
leaq (%r14,%rcx,2), %rax
addq $0x630, %rax            # imm = 0x630
jmp 0xa89fa
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imstb_textedit.h
// Function: ImStb::stb_textedit_discard_undo(ImStb::StbUndoState*)
static void stb_textedit_discard_undo(StbUndoState *state)
{
   if (state->undo_point > 0) {
      // if the 0th undo state has characters, clean those up
      if (state->undo_rec[0].char_storage >= 0) {
         int n = state->undo_rec[0].insert_length, i;
         // delete n characters from all other records
         state->undo_char_point -= n;
         STB_TEXTEDIT_memmove(state->undo_char, state->undo_char + n, (size_t) (state->undo_char_point*sizeof(STB_TEXTEDIT_CHARTYPE)));
         for (i=0; i < state->undo_point; ++i)
            if (state->undo_rec[i].char_storage >= 0)
               state->undo_rec[i].char_storage -= n; // @OPTIMIZE: get rid of char_storage and infer it
      }
      --state->undo_point;
      STB_TEXTEDIT_memmove(state->undo_rec, state->undo_rec+1, (size_t) (state->undo_point*sizeof(state->undo_rec[0])));
   }
}

// Assembly:
cmpw $0x0, 0xdfe(%rdi)
jle 0xa8aa2
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0xc(%rdi)
js 0xa8a7a
movslq 0x4(%rbx), %r14
movslq 0xe04(%rbx), %rdx
subq %r14, %rdx
movl %edx, 0xe04(%rbx)
leaq 0x630(%rbx), %rdi
leaq (%rbx,%r14,2), %rsi
addq $0x630, %rsi            # imm = 0x630
addq %rdx, %rdx
callq 0xc130
movswq 0xdfe(%rbx), %rax
testq %rax, %rax
jle 0xa8a7a
shlq $0x4, %rax
xorl %ecx, %ecx
movl 0xc(%rbx,%rcx), %edx
testl %edx, %edx
js 0xa8a71
subl %r14d, %edx
movl %edx, 0xc(%rbx,%rcx)
addq $0x10, %rcx
cmpq %rcx, %rax
jne 0xa8a62
movzwl 0xdfe(%rbx), %eax
decl %eax
movw %ax, 0xdfe(%rbx)
leaq 0x10(%rbx), %rsi
movswq %ax, %rdx
shlq $0x4, %rdx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xc130
retq
// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: TabItemComparerBySection(void const*, void const*)
static int IMGUI_CDECL TabItemComparerBySection(const void* lhs, const void* rhs)
{
    const ImGuiTabItem* a = (const ImGuiTabItem*)lhs;
    const ImGuiTabItem* b = (const ImGuiTabItem*)rhs;
    const int a_section = (a->Flags & ImGuiTabItemFlags_Leading) ? 0 : (a->Flags & ImGuiTabItemFlags_Trailing) ? 2 : 1;
    const int b_section = (b->Flags & ImGuiTabItemFlags_Leading) ? 0 : (b->Flags & ImGuiTabItemFlags_Trailing) ? 2 : 1;
    if (a_section != b_section)
        return a_section - b_section;
    return (int)(a->IndexDuringLayout - b->IndexDuringLayout);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x4(%rdi), %ecx
xorl %eax, %eax
testb %cl, %cl
sets %al
incl %eax
xorl %edx, %edx
testb $0x40, %cl
cmovnel %edx, %eax
movl 0x4(%rsi), %ecx
xorl %r8d, %r8d
testb %cl, %cl
sets %r8b
incl %r8d
testb $0x40, %cl
cmovnel %edx, %r8d
subl %r8d, %eax
jne 0xa8d44
movswl 0x20(%rdi), %eax
movswl 0x20(%rsi), %ecx
subl %ecx, %eax
popq %rbp
retq