// File: /workspace/github_cpp_makefile_star2_O3/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 $0xb8, %rsp
leaq 0x6944a(%rip), %rax     # 0xfbcd0
movq (%rax), %r14
movq 0x1ae0(%r14), %r12
movb $0x1, 0x90(%r12)
cmpb $0x0, 0x93(%r12)
je 0x928ab
xorl %eax, %eax
jmp 0x92bfc
movq %rdi, %rbx
movq %rsi, -0x48(%rbp)
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x4570a
movl %eax, %r13d
movss 0x22706(%rip), %xmm0    # 0xb4fd0
movq %rbx, -0x50(%rbp)
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x44a23
movaps %xmm0, -0xd0(%rbp)
callq 0x562ff
movaps -0xd0(%rbp), %xmm2
movl 0xd8(%r12), %r15d
movl 0xdc(%r12), %ebx
movd %r15d, %xmm4
movd %ebx, %xmm5
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm2
jbe 0x9291e
movss 0x15b0(%r14), %xmm1
addss %xmm2, %xmm1
movaps %xmm0, -0x90(%rbp)
addss %xmm0, %xmm1
shufps $0x55, %xmm2, %xmm2     # xmm2 = xmm2[1,1,1,1]
movq %r14, -0xa8(%rbp)
movss 0x159c(%r14), %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 -0xb8(%rbp), %r14
movl %r15d, (%r14)
movl %ebx, 0x4(%r14)
movlps %xmm1, 0x8(%r14)
movq %r14, %rdi
callq 0x559be
movq $0x0, -0x58(%rbp)
movq %r14, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x524a8
testb %al, %al
je 0x92bf8
leaq -0xb8(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
leaq -0x29(%rbp), %rcx
movl %r13d, %esi
xorl %r8d, %r8d
callq 0x90b6f
movq %rax, -0x58(%rbp)
testb %al, %al
je 0x929c9
movq -0x48(%rbp), %rax
xorb $0x1, (%rax)
movl %r13d, %edi
callq 0x4618e
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 %r15, %rbx
movq %rbx, %xmm0
movdqa %xmm0, -0x40(%rbp)
leaq -0xb8(%rbp), %rdi
movl %r13d, %esi
movl $0x1, %edx
callq 0x4521b
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
movl $0x9, %edi
cmovel %edx, %edi
testb %al, %al
cmovel %edx, %edi
movss 0x225a9(%rip), %xmm0    # 0xb4fe4
callq 0x43bca
movq -0xa8(%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 $0x1, %esi
callq 0x44f69
movl $0x12, %edi
movss 0x2256f(%rip), %xmm0    # 0xb4fe4
callq 0x43bca
movaps -0x40(%rbp), %xmm1
testb $0x40, 0x1cc(%r12)
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
movaps %xmm1, -0x40(%rbp)
jne 0x92b1e
movss 0x22547(%rip), %xmm3    # 0xb4fe4
movq -0x48(%rbp), %r15
cmpb $0x1, (%r15)
movq -0x50(%rbp), %rbx
jne 0x92af5
movaps -0x90(%rbp), %xmm1
movaps %xmm1, %xmm0
divss 0x2254f(%rip), %xmm0    # 0xb500c
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 0x81f62
cmpb $0x0, 0x3138(%r14)
je 0x92bbd
leaq 0x3e777(%rip), %rax     # 0xd1281
leaq 0x3e774(%rip), %rsi     # 0xd1285
cmpb $0x0, (%r15)
cmovneq %rax, %rsi
jmp 0x92baf
movaps -0x90(%rbp), %xmm0
divss 0x3e25b(%rip), %xmm0    # 0xd0d88
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm0
movss 0x224a8(%rip), %xmm3    # 0xb4fe4
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 -0xe0(%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 -0xd8(%rbp), %rdx
movlps %xmm0, (%rdx)
movss 0x15a0(%r14), %xmm0
movl %eax, %ecx
movl $0xf, %r8d
callq 0x785e6
cmpb $0x0, 0x3138(%r14)
movq -0x50(%rbp), %rbx
je 0x92bbd
leaq 0x3e6ce(%rip), %rsi     # 0xd127d
leaq -0xb8(%rbp), %rdi
xorl %edx, %edx
callq 0x4458c
xorps %xmm0, %xmm0
movaps -0xd0(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x92bf8
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]
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x44476
movq -0x58(%rbp), %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq