// File: /workspace/github_cpp_makefile_star2_O1/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 0x697a9(%rip), %rax     # 0xfdcd0
movq (%rax), %r14
movq 0x1ae0(%r14), %r12
movb $0x1, 0x90(%r12)
cmpb $0x0, 0x93(%r12)
je 0x9454c
xorl %eax, %eax
jmp 0x94886
movq %rdi, %rbx
movq %rsi, -0x48(%rbp)
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x46258
movl %eax, %r13d
movss 0x22a65(%rip), %xmm0    # 0xb6fd0
movq %rbx, -0x88(%rbp)
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x4548d
movaps %xmm0, -0xc0(%rbp)
callq 0x57404
movaps -0xc0(%rbp), %xmm2
movl 0xd8(%r12), %r15d
movl 0xdc(%r12), %ebx
movd %r15d, %xmm4
movd %ebx, %xmm5
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm2
jbe 0x945c2
movss 0x15b0(%r14), %xmm1
addss %xmm2, %xmm1
movaps %xmm0, -0x60(%rbp)
addss %xmm0, %xmm1
shufps $0x55, %xmm2, %xmm2     # xmm2 = xmm2[1,1,1,1]
movq %r14, -0x90(%rbp)
movss 0x159c(%r14), %xmm0
movaps %xmm0, %xmm3
addss %xmm0, %xmm3
addss %xmm2, %xmm3
movdqa %xmm4, -0x70(%rbp)
addss %xmm4, %xmm1
movdqa %xmm5, -0x80(%rbp)
addss %xmm5, %xmm3
unpcklps %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
leaq -0xa0(%rbp), %r14
movl %r15d, (%r14)
movl %ebx, 0x4(%r14)
movlps %xmm1, 0x8(%r14)
movq %r14, %rdi
callq 0x56a82
movq $0x0, -0x50(%rbp)
movq %r14, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x5346f
testb %al, %al
je 0x94882
leaq -0xa0(%rbp), %rdi
leaq -0x29(%rbp), %rdx
leaq -0x2a(%rbp), %rcx
movl %r13d, %esi
xorl %r8d, %r8d
callq 0x92870
movq %rax, -0x50(%rbp)
testb %al, %al
je 0x94667
movq -0x48(%rbp), %rax
xorb $0x1, (%rax)
movl %r13d, %edi
callq 0x46ca4
movaps -0x60(%rbp), %xmm0
movaps %xmm0, %xmm1
addss -0x70(%rbp), %xmm1
movaps -0x80(%rbp), %xmm2
addss %xmm0, %xmm2
movaps %xmm1, -0xb0(%rbp)
movaps %xmm2, -0x80(%rbp)
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movaps %xmm1, -0xd0(%rbp)
shlq $0x20, %rbx
orq %r15, %rbx
movq %rbx, %xmm0
movdqa %xmm0, -0x40(%rbp)
leaq -0xa0(%rbp), %rdi
movl %r13d, %esi
movl $0x1, %edx
callq 0x45ca4
cmpb $0x1, -0x2a(%rbp)
movq -0x90(%rbp), %r14
jne 0x946cd
movl $0x9, %edi
cmpb $0x0, -0x29(%rbp)
jne 0x946d4
movzbl -0x29(%rbp), %edi
addl $0x7, %edi
movss 0x22908(%rip), %xmm0    # 0xb6fe4
callq 0x445bd
movss 0x15a0(%r14), %xmm2
movaps -0x40(%rbp), %xmm0
movaps -0xd0(%rbp), %xmm1
movl %eax, %edi
movl $0x1, %esi
callq 0x459e5
movl $0x12, %edi
movss 0x228d6(%rip), %xmm0    # 0xb6fe4
callq 0x445bd
movaps -0x40(%rbp), %xmm3
movl 0x1cc(%r12), %ebx
shufps $0x55, %xmm3, %xmm3     # xmm3 = xmm3[1,1,1,1]
testb $0x40, %bl
movq -0x48(%rbp), %r15
movaps %xmm3, -0x40(%rbp)
jne 0x94787
movss 0x228ac(%rip), %xmm4    # 0xb6fe4
cmpb $0x1, (%r15)
movaps -0x70(%rbp), %xmm0
jne 0x94804
movaps -0x60(%rbp), %xmm1
movaps %xmm1, %xmm2
divss 0x228b7(%rip), %xmm2    # 0xb700c
cvttps2dq %xmm2, %xmm2
cvtdq2ps %xmm2, %xmm2
maxss %xmm2, %xmm4
movq 0x2b8(%r12), %rdi
addss %xmm4, %xmm0
movaps %xmm4, %xmm2
addss %xmm3, %xmm2
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
addss %xmm4, %xmm4
subss %xmm4, %xmm1
movl %eax, %esi
callq 0x83ab2
jmp 0x94800
movaps -0x60(%rbp), %xmm0
divss 0x3e721(%rip), %xmm0    # 0xd2eb4
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm0
movss 0x22842(%rip), %xmm2    # 0xb6fe4
maxss %xmm0, %xmm2
movq 0x2b8(%r12), %rdi
movaps -0x70(%rbp), %xmm1
addss %xmm2, %xmm1
movaps %xmm2, %xmm0
addss %xmm3, %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
leaq -0xe0(%rbp), %rsi
movlps %xmm1, (%rsi)
movaps -0xb0(%rbp), %xmm0
subss %xmm2, %xmm0
movaps -0x80(%rbp), %xmm1
subss %xmm2, %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 0x79d4a
movaps -0x40(%rbp), %xmm3
cmpb $0x1, 0x3138(%r14)
jne 0x94844
testb $0x40, %bl
jne 0x9482b
leaq 0x3eb97(%rip), %rax     # 0xd33b1
leaq 0x3eb94(%rip), %rsi     # 0xd33b5
cmpb $0x0, (%r15)
cmovneq %rax, %rsi
jmp 0x94832
leaq 0x3eb7b(%rip), %rsi     # 0xd33ad
leaq -0xa0(%rbp), %rdi
xorl %edx, %edx
callq 0x44fd9
movaps -0x40(%rbp), %xmm3
xorps %xmm0, %xmm0
movaps -0xc0(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x94882
movaps -0xb0(%rbp), %xmm0
addss 0x15b0(%r14), %xmm0
addss 0x159c(%r14), %xmm3
unpcklps %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movq -0x88(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x44ec4
movq -0x50(%rbp), %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq