// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::Checkbox(char const*, bool*)
bool ImGui::Checkbox(const char* label, bool* v)
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return false;

    ImGuiContext& g = *GImGui;
    const ImGuiStyle& style = g.Style;
    const ImGuiID id = window->GetID(label);
    const ImVec2 label_size = CalcTextSize(label, NULL, true);

    const float square_sz = GetFrameHeight();
    const ImVec2 pos = window->DC.CursorPos;
    const ImRect total_bb(pos, pos + ImVec2(square_sz + (label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f), label_size.y + style.FramePadding.y * 2.0f));
    ItemSize(total_bb, style.FramePadding.y);
    if (!ItemAdd(total_bb, id))
    {
        IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0));
        return false;
    }

    bool hovered, held;
    bool pressed = ButtonBehavior(total_bb, id, &hovered, &held);
    if (pressed)
    {
        *v = !(*v);
        MarkItemEdited(id);
    }

    const ImRect check_bb(pos, pos + ImVec2(square_sz, square_sz));
    RenderNavHighlight(total_bb, id);
    RenderFrame(check_bb.Min, check_bb.Max, GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), true, style.FrameRounding);
    ImU32 check_col = GetColorU32(ImGuiCol_CheckMark);
    bool mixed_value = (window->DC.ItemFlags & ImGuiItemFlags_MixedValue) != 0;
    if (mixed_value)
    {
        // Undocumented tristate/mixed/indeterminate checkbox (#2644)
        // This may seem awkwardly designed because the aim is to make ImGuiItemFlags_MixedValue supported by all widgets (not just checkbox)
        ImVec2 pad(ImMax(1.0f, IM_FLOOR(square_sz / 3.6f)), ImMax(1.0f, IM_FLOOR(square_sz / 3.6f)));
        window->DrawList->AddRectFilled(check_bb.Min + pad, check_bb.Max - pad, check_col, style.FrameRounding);
    }
    else if (*v)
    {
        const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f));
        RenderCheckMark(window->DrawList, check_bb.Min + ImVec2(pad, pad), check_col, square_sz - pad * 2.0f);
    }

    if (g.LogEnabled)
        LogRenderedText(&total_bb.Min, mixed_value ? "[~]" : *v ? "[x]" : "[ ]");
    if (label_size.x > 0.0f)
        RenderText(ImVec2(check_bb.Max.x + style.ItemInnerSpacing.x, check_bb.Min.y + style.FramePadding.y), label);

    IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0));
    return pressed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
leaq 0x681df(%rip), %rax     # 0xe3ce0
movq (%rax), %r15
movq 0x1ae0(%r15), %r12
movb $0x1, 0x90(%r12)
cmpb $0x0, 0x93(%r12)
je 0x7bb26
xorl %eax, %eax
jmp 0x7be6b
movq %rdi, %rbx
movq %rsi, -0x48(%rbp)
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3700a
movl %eax, %r13d
pushq $0x1
popq %rdx
movss 0x204a8(%rip), %xmm0    # 0x9bff0
movq %rbx, -0x50(%rbp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x365e8
movaps %xmm0, -0xc0(%rbp)
callq 0x43ec9
movaps -0xc0(%rbp), %xmm2
movl 0xd8(%r12), %r14d
movl 0xdc(%r12), %ebx
movd %r14d, %xmm4
movd %ebx, %xmm5
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm2
jbe 0x7bb97
movss 0x15b0(%r15), %xmm1
addss %xmm2, %xmm1
movaps %xmm0, -0x90(%rbp)
addss %xmm0, %xmm1
shufps $0x55, %xmm2, %xmm2     # xmm2 = xmm2[1,1,1,1]
movq %r15, -0x58(%rbp)
movss 0x159c(%r15), %xmm0
movaps %xmm0, %xmm3
addss %xmm0, %xmm3
addss %xmm2, %xmm3
movdqa %xmm4, -0xa0(%rbp)
addss %xmm4, %xmm1
movdqa %xmm5, -0x70(%rbp)
addss %xmm5, %xmm3
unpcklps %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
leaq -0xb0(%rbp), %r15
movl %r14d, (%r15)
movl %ebx, 0x4(%r15)
movlps %xmm1, 0x8(%r15)
movq %r15, %rdi
callq 0x4388d
movq $0x0, -0x60(%rbp)
movq %r15, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x40ea5
testb %al, %al
je 0x7be67
leaq -0xb0(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
leaq -0x29(%rbp), %rcx
movl %r13d, %esi
xorl %r8d, %r8d
callq 0x79dde
movq %rax, -0x60(%rbp)
testb %al, %al
je 0x7bc3f
movq -0x48(%rbp), %rax
xorb $0x1, (%rax)
movl %r13d, %edi
callq 0x3749e
movaps -0x90(%rbp), %xmm0
movaps %xmm0, %xmm1
addss -0xa0(%rbp), %xmm1
movaps %xmm1, -0x80(%rbp)
movaps -0x70(%rbp), %xmm1
addss %xmm0, %xmm1
movaps %xmm1, -0x70(%rbp)
shlq $0x20, %rbx
orq %r14, %rbx
movq %rbx, %xmm0
movdqa %xmm0, -0x40(%rbp)
leaq -0xb0(%rbp), %rdi
pushq $0x1
popq %r15
movl %r13d, %esi
movl %r15d, %edx
callq 0x36c91
movb -0x29(%rbp), %al
movb -0x2a(%rbp), %cl
movl %eax, %edx
xorb $0x1, %dl
andb %cl, %dl
movzbl %dl, %edx
addl $0x7, %edx
testb $0x1, %cl
pushq $0x9
popq %rdi
cmovel %edx, %edi
testb %al, %al
cmovel %edx, %edi
movss 0x20347(%rip), %xmm0    # 0x9bff8
callq 0x35d33
movq -0x58(%rbp), %r14
movss 0x15a0(%r14), %xmm2
movaps -0x80(%rbp), %xmm1
unpcklps -0x70(%rbp), %xmm1      # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
movaps -0x40(%rbp), %xmm0
movl %eax, %edi
movl %r15d, %esi
callq 0x36a6f
pushq $0x12
popq %rdi
movss 0x20314(%rip), %xmm0    # 0x9bff8
callq 0x35d33
movaps -0x40(%rbp), %xmm1
testb $0x40, 0x1cc(%r12)
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
movaps %xmm1, -0x40(%rbp)
jne 0x7bd91
movss 0x202ec(%rip), %xmm3    # 0x9bff8
movq -0x48(%rbp), %r15
cmpb $0x1, (%r15)
movq -0x50(%rbp), %rbx
jne 0x7bd64
movaps -0x90(%rbp), %xmm1
movaps %xmm1, %xmm0
divss 0x202f4(%rip), %xmm0    # 0x9c020
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm0
maxss %xmm0, %xmm3
movq 0x2b8(%r12), %rdi
movaps -0xa0(%rbp), %xmm0
addss %xmm3, %xmm0
movaps %xmm3, %xmm2
addss -0x40(%rbp), %xmm2
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
addss %xmm3, %xmm3
subss %xmm3, %xmm1
movl %eax, %esi
callq 0x6ba45
movq -0x58(%rbp), %r14
cmpb $0x0, 0x3138(%r14)
je 0x7be2e
leaq 0x3c874(%rip), %rax     # 0xb85f1
leaq 0x3c871(%rip), %rsi     # 0xb85f5
cmpb $0x0, (%r15)
cmovneq %rax, %rsi
jmp 0x7be20
movaps -0x90(%rbp), %xmm0
divss 0x3c350(%rip), %xmm0    # 0xb80f0
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm0
movss 0x20249(%rip), %xmm3    # 0x9bff8
maxss %xmm0, %xmm3
movq 0x2b8(%r12), %rdi
movaps -0xa0(%rbp), %xmm2
addss %xmm3, %xmm2
movaps %xmm3, %xmm0
addss %xmm1, %xmm0
unpcklps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
leaq -0xd0(%rbp), %rsi
movlps %xmm2, (%rsi)
movaps -0x80(%rbp), %xmm0
subss %xmm3, %xmm0
movaps -0x70(%rbp), %xmm1
subss %xmm3, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0xc8(%rbp), %rdx
movlps %xmm0, (%rdx)
movss 0x15a0(%r14), %xmm0
pushq $0xf
popq %r8
movl %eax, %ecx
callq 0x64020
cmpb $0x0, 0x3138(%r14)
movq -0x50(%rbp), %rbx
je 0x7be2e
leaq 0x3c7cd(%rip), %rsi     # 0xb85ed
leaq -0xb0(%rbp), %rdi
xorl %edx, %edx
callq 0x36222
xorps %xmm0, %xmm0
movaps -0xc0(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x7be67
movaps -0x80(%rbp), %xmm0
addss 0x15b0(%r14), %xmm0
movaps -0x40(%rbp), %xmm1
addss 0x159c(%r14), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
pushq $0x1
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x36156
movq -0x60(%rbp), %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq