// File: /workspace/github_c_makefile_star2_O0/space222[P]silo/./nuklear.h
// Function: nk_do_toggle(unsigned int*, nk_command_buffer*, nk_rect, int*, char const*, int, nk_toggle_type, nk_style_toggle const*, nk_input const*, nk_user_font const*)
NK_LIB int
nk_do_toggle(nk_flags *state,
    struct nk_command_buffer *out, struct nk_rect r,
    int *active, const char *str, int len, enum nk_toggle_type type,
    const struct nk_style_toggle *style, const struct nk_input *in,
    const struct nk_user_font *font)
{
    int was_active;
    struct nk_rect bounds;
    struct nk_rect select;
    struct nk_rect cursor;
    struct nk_rect label;

    NK_ASSERT(style);
    NK_ASSERT(out);
    NK_ASSERT(font);
    if (!out || !style || !font || !active)
        return 0;

    r.w = NK_MAX(r.w, font->height + 2 * style->padding.x);
    r.h = NK_MAX(r.h, font->height + 2 * style->padding.y);

    /* add additional touch padding for touch screen devices */
    bounds.x = r.x - style->touch_padding.x;
    bounds.y = r.y - style->touch_padding.y;
    bounds.w = r.w + 2 * style->touch_padding.x;
    bounds.h = r.h + 2 * style->touch_padding.y;

    /* calculate the selector space */
    select.w = font->height;
    select.h = select.w;
    select.y = r.y + r.h/2.0f - select.h/2.0f;
    select.x = r.x;

    /* calculate the bounds of the cursor inside the selector */
    cursor.x = select.x + style->padding.x + style->border;
    cursor.y = select.y + style->padding.y + style->border;
    cursor.w = select.w - (2 * style->padding.x + 2 * style->border);
    cursor.h = select.h - (2 * style->padding.y + 2 * style->border);

    /* label behind the selector */
    label.x = select.x + select.w + style->spacing;
    label.y = select.y;
    label.w = NK_MAX(r.x + r.w, label.x) - label.x;
    label.h = select.w;

    /* update selector */
    was_active = *active;
    *active = nk_toggle_behavior(in, bounds, state, *active);

    /* draw selector */
    if (style->draw_begin)
        style->draw_begin(out, style->userdata);
    if (type == NK_TOGGLE_CHECK) {
        nk_draw_checkbox(out, *state, style, *active, &label, &select, &cursor, str, len, font);
    } else {
        nk_draw_option(out, *state, style, *active, &label, &select, &cursor, str, len, font);
    }
    if (style->draw_end)
        style->draw_end(out, style->userdata);
    return (was_active != *active);
}

// Assembly:
pushq %rbx
subq $0xe0, %rsp
movq 0x100(%rsp), %rax
movq 0xf8(%rsp), %rax
movq 0xf0(%rsp), %rax
movlpd %xmm0, 0xcc(%rsp)
movlpd %xmm1, 0xd4(%rsp)
movq %rdi, 0xc0(%rsp)
movq %rsi, 0xb8(%rsp)
movq %rdx, 0xb0(%rsp)
movq %rcx, 0xa8(%rsp)
movl %r8d, 0xa4(%rsp)
movl %r9d, 0xa0(%rsp)
cmpq $0x0, 0xf0(%rsp)
je 0x2781f
jmp 0x2783e
leaq 0x213b4(%rip), %rdi     # 0x48bda
leaq 0x1db86(%rip), %rsi     # 0x453b3
movl $0x4fef, %edx           # imm = 0x4FEF
leaq 0x23ac8(%rip), %rcx     # 0x4b301
callq 0x20a0
cmpq $0x0, 0xb8(%rsp)
je 0x2784b
jmp 0x2786a
leaq 0x20afe(%rip), %rdi     # 0x48350
leaq 0x1db5a(%rip), %rsi     # 0x453b3
movl $0x4ff0, %edx           # imm = 0x4FF0
leaq 0x23a9c(%rip), %rcx     # 0x4b301
callq 0x20a0
cmpq $0x0, 0x100(%rsp)
je 0x27877
jmp 0x27896
leaq 0x1f4cd(%rip), %rdi     # 0x46d4b
leaq 0x1db2e(%rip), %rsi     # 0x453b3
movl $0x4ff1, %edx           # imm = 0x4FF1
leaq 0x23a70(%rip), %rcx     # 0x4b301
callq 0x20a0
cmpq $0x0, 0xb8(%rsp)
je 0x278c2
cmpq $0x0, 0xf0(%rsp)
je 0x278c2
cmpq $0x0, 0x100(%rsp)
je 0x278c2
cmpq $0x0, 0xb0(%rsp)
jne 0x278d2
movl $0x0, 0xdc(%rsp)
jmp 0x27e2d
movss 0xd4(%rsp), %xmm1
movq 0x100(%rsp), %rax
movss 0x8(%rax), %xmm2
movq 0xf0(%rsp), %rax
movss 0xbc(%rax), %xmm0
addss %xmm0, %xmm0
addss %xmm2, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x27932
movq 0x100(%rsp), %rax
movss 0x8(%rax), %xmm1
movq 0xf0(%rsp), %rax
movss 0xbc(%rax), %xmm0
addss %xmm0, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x2c(%rsp)
jmp 0x27941
movss 0xd4(%rsp), %xmm0
movss %xmm0, 0x2c(%rsp)
movss 0x2c(%rsp), %xmm0
movss %xmm0, 0xd4(%rsp)
movss 0xd8(%rsp), %xmm1
movq 0x100(%rsp), %rax
movss 0x8(%rax), %xmm2
movq 0xf0(%rsp), %rax
movss 0xc0(%rax), %xmm0
addss %xmm0, %xmm0
addss %xmm2, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x279b0
movq 0x100(%rsp), %rax
movss 0x8(%rax), %xmm1
movq 0xf0(%rsp), %rax
movss 0xc0(%rax), %xmm0
addss %xmm0, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x28(%rsp)
jmp 0x279bf
movss 0xd8(%rsp), %xmm0
movss %xmm0, 0x28(%rsp)
movss 0x28(%rsp), %xmm0
movss %xmm0, 0xd8(%rsp)
movss 0xcc(%rsp), %xmm0
movq 0xf0(%rsp), %rax
subss 0xc4(%rax), %xmm0
movss %xmm0, 0x8c(%rsp)
movss 0xd0(%rsp), %xmm0
movq 0xf0(%rsp), %rax
subss 0xc8(%rax), %xmm0
movss %xmm0, 0x90(%rsp)
movss 0xd4(%rsp), %xmm1
movq 0xf0(%rsp), %rax
movss 0xc4(%rax), %xmm0
addss %xmm0, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x94(%rsp)
movss 0xd8(%rsp), %xmm1
movq 0xf0(%rsp), %rax
movss 0xc8(%rax), %xmm0
addss %xmm0, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x98(%rsp)
movq 0x100(%rsp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0x84(%rsp)
movss 0x84(%rsp), %xmm0
movss %xmm0, 0x88(%rsp)
movss 0xd0(%rsp), %xmm0
movss 0xd8(%rsp), %xmm1
movss 0x1d660(%rip), %xmm2    # 0x45108
divss %xmm2, %xmm1
addss %xmm1, %xmm0
movss 0x88(%rsp), %xmm1
movss 0x1d647(%rip), %xmm2    # 0x45108
divss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x80(%rsp)
movss 0xcc(%rsp), %xmm0
movss %xmm0, 0x7c(%rsp)
movss 0x7c(%rsp), %xmm0
movq 0xf0(%rsp), %rax
addss 0xbc(%rax), %xmm0
movq 0xf0(%rsp), %rax
addss 0xd0(%rax), %xmm0
movss %xmm0, 0x6c(%rsp)
movss 0x80(%rsp), %xmm0
movq 0xf0(%rsp), %rax
addss 0xc0(%rax), %xmm0
movq 0xf0(%rsp), %rax
addss 0xd0(%rax), %xmm0
movss %xmm0, 0x70(%rsp)
movss 0x84(%rsp), %xmm0
movq 0xf0(%rsp), %rax
movss 0xbc(%rax), %xmm1
movq 0xf0(%rsp), %rax
movss 0x1d5a3(%rip), %xmm2    # 0x45108
mulss 0xd0(%rax), %xmm2
addss %xmm1, %xmm1
addss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x74(%rsp)
movss 0x88(%rsp), %xmm0
movq 0xf0(%rsp), %rax
movss 0xc0(%rax), %xmm1
movq 0xf0(%rsp), %rax
movss 0x1d560(%rip), %xmm2    # 0x45108
mulss 0xd0(%rax), %xmm2
addss %xmm1, %xmm1
addss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x78(%rsp)
movss 0x7c(%rsp), %xmm0
addss 0x84(%rsp), %xmm0
movq 0xf0(%rsp), %rax
addss 0xcc(%rax), %xmm0
movss %xmm0, 0x5c(%rsp)
movss 0x80(%rsp), %xmm0
movss %xmm0, 0x60(%rsp)
movss 0xcc(%rsp), %xmm1
addss 0xd4(%rsp), %xmm1
movss 0x5c(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x27c21
movss 0x5c(%rsp), %xmm0
movss %xmm0, 0x24(%rsp)
jmp 0x27c39
movss 0xcc(%rsp), %xmm0
addss 0xd4(%rsp), %xmm0
movss %xmm0, 0x24(%rsp)
movss 0x24(%rsp), %xmm0
movss 0x5c(%rsp), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x64(%rsp)
movss 0x84(%rsp), %xmm0
movss %xmm0, 0x68(%rsp)
movq 0xb0(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x9c(%rsp)
movq 0xf8(%rsp), %rdi
movups 0x8c(%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0xc0(%rsp), %rsi
movq 0xb0(%rsp), %rax
movl (%rax), %edx
movsd 0x40(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
callq 0x3c220
movl %eax, %ecx
movq 0xb0(%rsp), %rax
movl %ecx, (%rax)
movq 0xf0(%rsp), %rax
cmpq $0x0, 0xe0(%rax)
je 0x27cf7
movq 0xf0(%rsp), %rax
movq 0xe0(%rax), %rax
movq 0xb8(%rsp), %rdi
movq 0xf0(%rsp), %rcx
movq 0xd8(%rcx), %rcx
movq %rcx, 0x38(%rsp)
movq 0x38(%rsp), %rsi
callq *%rax
cmpl $0x0, 0xa0(%rsp)
jne 0x27d66
movq 0xb8(%rsp), %rdi
movq 0xc0(%rsp), %rax
movl (%rax), %esi
movq 0xf0(%rsp), %rdx
movq 0xb0(%rsp), %rax
movl (%rax), %ecx
movq 0xa8(%rsp), %r11
movl 0xa4(%rsp), %r10d
movq 0x100(%rsp), %rax
leaq 0x5c(%rsp), %r8
leaq 0x7c(%rsp), %r9
leaq 0x6c(%rsp), %rbx
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x3c330
jmp 0x27dc9
movq 0xb8(%rsp), %rdi
movq 0xc0(%rsp), %rax
movl (%rax), %esi
movq 0xf0(%rsp), %rdx
movq 0xb0(%rsp), %rax
movl (%rax), %ecx
movq 0xa8(%rsp), %r11
movl 0xa4(%rsp), %r10d
movq 0x100(%rsp), %rax
leaq 0x5c(%rsp), %r8
leaq 0x7c(%rsp), %r9
leaq 0x6c(%rsp), %rbx
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x3c6c0
movq 0xf0(%rsp), %rax
cmpq $0x0, 0xe8(%rax)
je 0x27e0d
movq 0xf0(%rsp), %rax
movq 0xe8(%rax), %rax
movq 0xb8(%rsp), %rdi
movq 0xf0(%rsp), %rcx
movq 0xd8(%rcx), %rcx
movq %rcx, 0x30(%rsp)
movq 0x30(%rsp), %rsi
callq *%rax
movl 0x9c(%rsp), %eax
movq 0xb0(%rsp), %rcx
cmpl (%rcx), %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0xdc(%rsp)
movl 0xdc(%rsp), %eax
addq $0xe0, %rsp
popq %rbx
retq
nopl (%rax)