// File: /workspace/github_c_makefile_star2_O1/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_do_selectable
NK_LIB nk_bool
nk_do_selectable(nk_flags *state, struct nk_command_buffer *out,
    struct nk_rect bounds, const char *str, int len, nk_flags align, nk_bool *value,
    const struct nk_style_selectable *style, const struct nk_input *in,
    const struct nk_user_font *font)
{
    int old_value;
    struct nk_rect touch;

    NK_ASSERT(state);
    NK_ASSERT(out);
    NK_ASSERT(str);
    NK_ASSERT(len);
    NK_ASSERT(value);
    NK_ASSERT(style);
    NK_ASSERT(font);

    if (!state || !out || !str || !len || !value || !style || !font) return 0;
    old_value = *value;

    /* remove padding */
    touch.x = bounds.x - style->touch_padding.x;
    touch.y = bounds.y - style->touch_padding.y;
    touch.w = bounds.w + style->touch_padding.x * 2;
    touch.h = bounds.h + style->touch_padding.y * 2;

    /* update button */
    if (nk_button_behavior(state, touch, in, NK_BUTTON_DEFAULT))
        *value = !(*value);

    /* draw selectable */
    if (style->draw_begin) style->draw_begin(out, style->userdata);
    nk_draw_selectable(out, *state, style, *value, &bounds, 0,0,NK_SYMBOL_NONE, str, len, align, font);
    if (style->draw_end) style->draw_end(out, style->userdata);
    return old_value != *value;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbx
movq %r8, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbp
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
movups %xmm0, 0x18(%rsp)
testq %rdi, %rdi
jne 0x497ed
movq 0x3e82a(%rip), %r13     # 0x87ff0
movq (%r13), %rdi
leaq 0x285bb(%rip), %rsi     # 0x71d8c
leaq 0x285d2(%rip), %rdx     # 0x71daa
movl $0x6287, %ecx           # imm = 0x6287
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
callq 0x13780
testq %r14, %r14
jne 0x49820
movq 0x3e7f7(%rip), %r13     # 0x87ff0
movq (%r13), %rdi
leaq 0x28588(%rip), %rsi     # 0x71d8c
leaq 0x2859f(%rip), %rdx     # 0x71daa
movl $0x6288, %ecx           # imm = 0x6288
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
callq 0x13780
testq %r15, %r15
jne 0x49853
movq 0x3e7c4(%rip), %r13     # 0x87ff0
movq (%r13), %rdi
leaq 0x28555(%rip), %rsi     # 0x71d8c
leaq 0x2856c(%rip), %rdx     # 0x71daa
movl $0x6289, %ecx           # imm = 0x6289
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
callq 0x13780
cmpl $0x0, 0x8(%rsp)
jne 0x49888
movq 0x3e78f(%rip), %r13     # 0x87ff0
movq (%r13), %rdi
leaq 0x28520(%rip), %rsi     # 0x71d8c
leaq 0x28537(%rip), %rdx     # 0x71daa
movl $0x628a, %ecx           # imm = 0x628A
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
callq 0x13780
movq 0x60(%rsp), %r13
testq %rbx, %rbx
jne 0x498c5
movq 0x3e757(%rip), %r13     # 0x87ff0
movq (%r13), %rdi
leaq 0x284e8(%rip), %rsi     # 0x71d8c
leaq 0x284ff(%rip), %rdx     # 0x71daa
movl $0x628b, %ecx           # imm = 0x628B
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
movq 0x60(%rsp), %r13
callq 0x13780
movq 0x70(%rsp), %r8
testq %r13, %r13
jne 0x49902
movq 0x3e71a(%rip), %r12     # 0x87ff0
movq (%r12), %rdi
leaq 0x284ab(%rip), %rsi     # 0x71d8c
leaq 0x284c2(%rip), %rdx     # 0x71daa
movl $0x628c, %ecx           # imm = 0x628C
xorl %eax, %eax
callq 0x12d80
movq (%r12), %rdi
callq 0x13780
movq 0x70(%rsp), %r8
testq %r8, %r8
jne 0x4994c
movq 0x3e6e2(%rip), %rax     # 0x87ff0
movq (%rax), %rdi
leaq 0x28474(%rip), %rsi     # 0x71d8c
leaq 0x2848b(%rip), %rdx     # 0x71daa
movl $0x628d, %ecx           # imm = 0x628D
xorl %eax, %eax
movq %rbx, %r12
movq %rbp, %rbx
movq %r8, %rbp
callq 0x12d80
movq 0x3e6b5(%rip), %rax     # 0x87ff0
movq (%rax), %rdi
callq 0x13780
movq %rbp, %r8
movq %rbx, %rbp
movq %r12, %rbx
testq %r8, %r8
sete %al
testq %r13, %r13
sete %cl
testq %rbx, %rbx
sete %dl
cmpl $0x0, 0x8(%rsp)
sete %sil
testq %r15, %r15
sete %dil
testq %r14, %r14
sete %r8b
testq %rbp, %rbp
sete %r9b
orb %r8b, %r9b
orb %sil, %dil
orb %r9b, %dil
orb %dl, %dil
orb %cl, %dil
orb %al, %dil
xorl %eax, %eax
testb $0x1, %dil
jne 0x49a3e
movq 0x68(%rsp), %rsi
movl (%rbx), %r12d
movsd 0x11c(%r13), %xmm1
movsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm2
subps %xmm1, %xmm0
addps %xmm1, %xmm1
addps %xmm2, %xmm1
movq %rbp, %rdi
xorl %edx, %edx
callq 0x521be
testl %eax, %eax
je 0x499d8
xorl %eax, %eax
cmpl $0x0, (%rbx)
sete %al
movl %eax, (%rbx)
movq 0x140(%r13), %rax
testq %rax, %rax
je 0x499f0
movq 0x138(%r13), %rsi
movq %r14, %rdi
callq *%rax
movl (%rbp), %esi
movl (%rbx), %ecx
leaq 0x18(%rsp), %r8
movq %r14, %rdi
movq %r13, %rdx
xorl %r9d, %r9d
pushq 0x70(%rsp)
pushq 0x18(%rsp)
pushq 0x18(%rsp)
pushq %r15
pushq $0x0
pushq $0x0
callq 0x5893d
addq $0x30, %rsp
movq 0x148(%r13), %rax
testq %rax, %rax
je 0x49a36
movq 0x138(%r13), %rsi
movq %r14, %rdi
callq *%rax
xorl %eax, %eax
cmpl (%rbx), %r12d
setne %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq