// File: donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::Checkbox(char const*, bool*)
bool ImGui::Checkbox(const char* label, bool* v)
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return false;

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

    const ImRect check_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(label_size.y + style.FramePadding.y*2, label_size.y + style.FramePadding.y*2));
    ItemSize(check_bb, style.FramePadding.y);

    ImRect total_bb = check_bb;
    if (label_size.x > 0)
        SameLine(0, style.ItemInnerSpacing.x);
    const ImRect text_bb(window->DC.CursorPos + ImVec2(0,style.FramePadding.y), window->DC.CursorPos + ImVec2(0,style.FramePadding.y) + label_size);
    if (label_size.x > 0)
    {
        ItemSize(ImVec2(text_bb.GetWidth(), check_bb.GetHeight()), style.FramePadding.y);
        total_bb = ImRect(ImMin(check_bb.Min, text_bb.Min), ImMax(check_bb.Max, text_bb.Max));
    }

    if (!ItemAdd(total_bb, &id))
        return false;

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

    RenderFrame(check_bb.Min, check_bb.Max, window->Color((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), true, style.FrameRounding);
    if (*v)
    {
        const float check_sz = ImMin(check_bb.GetWidth(), check_bb.GetHeight());
        const float pad = ImMax(1.0f, (float)(int)(check_sz / 6.0f));
        window->DrawList->AddRectFilled(check_bb.Min+ImVec2(pad,pad), check_bb.Max-ImVec2(pad,pad), window->Color(ImGuiCol_CheckMark), style.FrameRounding);
    }

    if (g.LogEnabled)
        LogRenderedText(text_bb.GetTL(), *v ? "[x]" : "[ ]");
    RenderText(text_bb.GetTL(), label);

    return pressed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
callq 0x2e220
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
testb $0x1, 0x74(%rax)
je 0x23a8f
movb $0x0, -0x1(%rbp)
jmp 0x24004
movq 0x55a2a(%rip), %rax     # 0x794c0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x13e8, %rax           # imm = 0x13E8
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x130(%rbp)
callq 0xbc60
movq -0x130(%rbp), %rsi
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %edx
movss 0x375a1(%rip), %xmm0    # 0x5b07c
callq 0x10930
movlpd %xmm0, -0x3c(%rbp)
movq -0x20(%rbp), %rax
addq $0xa8, %rax
movq %rax, -0x120(%rbp)
movss -0x38(%rbp), %xmm0
movq -0x30(%rbp), %rax
movss 0x24(%rax), %xmm1
addss %xmm1, %xmm1
addss %xmm0, %xmm1
leaq -0x5c(%rbp), %rdi
movq %rdi, -0x128(%rbp)
movaps %xmm1, %xmm0
callq 0x2d280
movq -0x128(%rbp), %rsi
movq -0x120(%rbp), %rdi
callq 0xc7e0
movq -0x120(%rbp), %rsi
movlpd %xmm0, -0x54(%rbp)
leaq -0x4c(%rbp), %rdi
leaq -0x54(%rbp), %rdx
callq 0x2eb40
movq -0x30(%rbp), %rax
movss 0x24(%rax), %xmm0
leaq -0x4c(%rbp), %rdi
callq 0xc060
movq -0x4c(%rbp), %rax
movq %rax, -0x6c(%rbp)
movq -0x44(%rbp), %rax
movq %rax, -0x64(%rbp)
movss -0x3c(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x23b8b
movq -0x30(%rbp), %rax
movss 0x34(%rax), %xmm1
xorps %xmm0, %xmm0
callq 0x1a5e0
movq -0x20(%rbp), %rax
addq $0xa8, %rax
movq %rax, -0x158(%rbp)
movq -0x30(%rbp), %rax
movss 0x24(%rax), %xmm1
leaq -0x8c(%rbp), %rdi
movq %rdi, -0x150(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x144(%rbp)
callq 0x2d280
movq -0x158(%rbp), %rdi
movq -0x150(%rbp), %rsi
callq 0xc7e0
movaps %xmm0, %xmm1
movss -0x144(%rbp), %xmm0
movlpd %xmm1, -0x84(%rbp)
movq -0x20(%rbp), %rax
addq $0xa8, %rax
movq %rax, -0x140(%rbp)
movq -0x30(%rbp), %rax
movss 0x24(%rax), %xmm1
leaq -0xa4(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x2d280
movq -0x140(%rbp), %rdi
movq -0x138(%rbp), %rsi
callq 0xc7e0
movlpd %xmm0, -0x9c(%rbp)
leaq -0x9c(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0xc7e0
movlpd %xmm0, -0x94(%rbp)
leaq -0x7c(%rbp), %rdi
leaq -0x84(%rbp), %rsi
leaq -0x94(%rbp), %rdx
callq 0x2eb40
movss -0x3c(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x23d2c
leaq -0x7c(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x2fe50
movss %xmm0, -0x174(%rbp)
leaq -0x4c(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x2f520
movaps %xmm0, %xmm1
movss -0x174(%rbp), %xmm0
leaq -0xac(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x2d280
movq -0x170(%rbp), %rdi
movq -0x30(%rbp), %rax
movss 0x24(%rax), %xmm0
callq 0xbeb0
movq -0x168(%rbp), %rdi
movq -0x160(%rbp), %rsi
callq 0x16fb0
movlpd %xmm0, -0xc4(%rbp)
leaq -0x44(%rbp), %rdi
leaq -0x74(%rbp), %rsi
callq 0x16b80
movlpd %xmm0, -0xcc(%rbp)
leaq -0xbc(%rbp), %rdi
leaq -0xc4(%rbp), %rsi
leaq -0xcc(%rbp), %rdx
callq 0x2eb40
movq -0xbc(%rbp), %rax
movq %rax, -0x6c(%rbp)
movq -0xb4(%rbp), %rax
movq %rax, -0x64(%rbp)
leaq -0x6c(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0xc0a0
testb $0x1, %al
jne 0x23d46
movb $0x0, -0x1(%rbp)
jmp 0x24004
movl -0x34(%rbp), %esi
leaq -0x6c(%rbp), %rdi
leaq -0xcd(%rbp), %rdx
leaq -0xce(%rbp), %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x17010
andb $0x1, %al
movb %al, -0xcf(%rbp)
testb $0x1, -0xcf(%rbp)
je 0x23d8c
movq -0x18(%rbp), %rax
movb (%rax), %cl
xorb $-0x1, %cl
movq -0x18(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movq -0x4c(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x44(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x180(%rbp)
testb $0x1, -0xce(%rbp)
je 0x23dcc
testb $0x1, -0xcd(%rbp)
je 0x23dcc
movl $0x8, %eax
movl %eax, -0x184(%rbp)
jmp 0x23de8
movb -0xcd(%rbp), %dl
movl $0x6, %eax
movl $0x7, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x184(%rbp)
movq -0x180(%rbp), %rdi
movl -0x184(%rbp), %esi
movss 0x3721b(%rip), %xmm0    # 0x5b018
callq 0x2ea40
movl %eax, %edi
movq -0x30(%rbp), %rax
movss 0x28(%rax), %xmm2
movsd -0xd8(%rbp), %xmm0
movsd -0xe0(%rbp), %xmm1
movl $0x1, %esi
callq 0x10a20
movq -0x18(%rbp), %rax
testb $0x1, (%rax)
je 0x23f70
leaq -0x4c(%rbp), %rdi
movq %rdi, -0x1b0(%rbp)
callq 0x2fe50
movq -0x1b0(%rbp), %rdi
movss %xmm0, -0x1b4(%rbp)
callq 0x2f520
movaps %xmm0, %xmm1
movss -0x1b4(%rbp), %xmm0
callq 0xe370
movss %xmm0, -0xe4(%rbp)
movss -0xe4(%rbp), %xmm0
movss 0x371ec(%rip), %xmm1    # 0x5b06c
divss %xmm1, %xmm0
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm1
movss 0x37185(%rip), %xmm0    # 0x5b018
callq 0xb7c0
movss %xmm0, -0xe8(%rbp)
movq -0x20(%rbp), %rax
movq 0x270(%rax), %rax
movq %rax, -0x190(%rbp)
movss -0xe8(%rbp), %xmm1
leaq -0xf8(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
movaps %xmm1, %xmm0
callq 0x2d280
movq -0x1b0(%rbp), %rdi
movq -0x1a8(%rbp), %rsi
callq 0xc7e0
movlpd %xmm0, -0xf0(%rbp)
leaq -0x44(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movss -0xe8(%rbp), %xmm1
leaq -0x108(%rbp), %rdi
movq %rdi, -0x198(%rbp)
movaps %xmm1, %xmm0
callq 0x2d280
movq -0x1a0(%rbp), %rdi
movq -0x198(%rbp), %rsi
callq 0xdf20
movlpd %xmm0, -0x100(%rbp)
movq -0x20(%rbp), %rdi
movl $0x12, %esi
movss 0x370d8(%rip), %xmm0    # 0x5b018
callq 0x2ea40
movq -0x190(%rbp), %rdi
movl %eax, %ecx
movq -0x30(%rbp), %rax
movss 0x28(%rax), %xmm0
leaq -0xf0(%rbp), %rsi
leaq -0x100(%rbp), %rdx
movl $0xf, %r8d
callq 0x40670
movq -0x28(%rbp), %rax
testb $0x1, 0x2be8(%rax)
je 0x23fce
leaq -0x7c(%rbp), %rdi
callq 0x2f290
movlpd %xmm0, -0x110(%rbp)
movq -0x18(%rbp), %rax
testb $0x1, (%rax)
je 0x23fa7
leaq 0x38065(%rip), %rax     # 0x5c003
movq %rax, -0x1c0(%rbp)
jmp 0x23fb7
leaq 0x38059(%rip), %rax     # 0x5c007
movq %rax, -0x1c0(%rbp)
jmp 0x23fb7
movq -0x1c0(%rbp), %rsi
leaq -0x110(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0x10320
leaq -0x7c(%rbp), %rdi
callq 0x2f290
movlpd %xmm0, -0x118(%rbp)
movq -0x10(%rbp), %rdi
movsd -0x118(%rbp), %xmm0
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x10100
movb -0xcf(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
nopw %cs:(%rax,%rax)