// File: /workspace/github_c_makefile_star2_O1/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_do_selectable_image
NK_LIB nk_bool
nk_do_selectable_image(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_image *img, const struct nk_style_selectable *style,
    const struct nk_input *in, const struct nk_user_font *font)
{
    nk_bool old_value;
    struct nk_rect touch;
    struct nk_rect icon;

    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;

    /* toggle behavior */
    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;
    if (nk_button_behavior(state, touch, in, NK_BUTTON_DEFAULT))
        *value = !(*value);

    icon.y = bounds.y + style->padding.y;
    icon.w = icon.h = bounds.h - 2 * style->padding.y;
    if (align & NK_TEXT_ALIGN_LEFT) {
        icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w);
        icon.x = NK_MAX(icon.x, 0);
    } else icon.x = bounds.x + 2 * style->padding.x;

    icon.x += style->image_padding.x;
    icon.y += style->image_padding.y;
    icon.w -= 2 * style->image_padding.x;
    icon.h -= 2 * style->image_padding.y;

    /* draw selectable */
    if (style->draw_begin) style->draw_begin(out, style->userdata);
    nk_draw_selectable(out, *state, style, *value, &bounds, &icon, img, 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 $0x58, %rsp
movq %r9, %rbx
movq %r8, 0x8(%rsp)
movq %rcx, (%rsp)
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbp
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
movups %xmm0, 0x20(%rsp)
testq %rdi, %rdi
jne 0x49c56
movq 0x3e3c1(%rip), %r13     # 0x87ff0
movq (%r13), %rdi
leaq 0x28152(%rip), %rsi     # 0x71d8c
leaq 0x28169(%rip), %rdx     # 0x71daa
movl $0x62ac, %ecx           # imm = 0x62AC
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
callq 0x13780
testq %r14, %r14
jne 0x49c89
movq 0x3e38e(%rip), %r13     # 0x87ff0
movq (%r13), %rdi
leaq 0x2811f(%rip), %rsi     # 0x71d8c
leaq 0x28136(%rip), %rdx     # 0x71daa
movl $0x62ad, %ecx           # imm = 0x62AD
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
callq 0x13780
testq %r12, %r12
jne 0x49cbc
movq 0x3e35b(%rip), %r13     # 0x87ff0
movq (%r13), %rdi
leaq 0x280ec(%rip), %rsi     # 0x71d8c
leaq 0x28103(%rip), %rdx     # 0x71daa
movl $0x62ae, %ecx           # imm = 0x62AE
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
callq 0x13780
cmpl $0x0, (%rsp)
jne 0x49cf0
movq 0x3e327(%rip), %r13     # 0x87ff0
movq (%r13), %rdi
leaq 0x280b8(%rip), %rsi     # 0x71d8c
leaq 0x280cf(%rip), %rdx     # 0x71daa
movl $0x62af, %ecx           # imm = 0x62AF
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
callq 0x13780
movq 0x98(%rsp), %r13
testq %rbx, %rbx
jne 0x49d33
movq 0x3e2ec(%rip), %r13     # 0x87ff0
movq (%r13), %rdi
leaq 0x2807d(%rip), %rsi     # 0x71d8c
leaq 0x28094(%rip), %rdx     # 0x71daa
movl $0x62b0, %ecx           # imm = 0x62B0
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
movq 0x98(%rsp), %r13
callq 0x13780
movq 0xa8(%rsp), %r15
testq %r13, %r13
jne 0x49d7c
movq %r12, %r15
movq 0x3e2a6(%rip), %r12     # 0x87ff0
movq (%r12), %rdi
leaq 0x28037(%rip), %rsi     # 0x71d8c
leaq 0x2804e(%rip), %rdx     # 0x71daa
movl $0x62b1, %ecx           # imm = 0x62B1
xorl %eax, %eax
callq 0x12d80
movq (%r12), %rdi
movq %r15, %r12
callq 0x13780
movq 0xa8(%rsp), %r15
testq %r15, %r15
jne 0x49db4
movq 0x3e268(%rip), %rcx     # 0x87ff0
movq (%rcx), %rdi
leaq 0x27ffa(%rip), %rsi     # 0x71d8c
leaq 0x28011(%rip), %rdx     # 0x71daa
movl $0x62b2, %ecx           # imm = 0x62B2
xorl %eax, %eax
callq 0x12d80
movq 0x3e244(%rip), %rax     # 0x87ff0
movq (%rax), %rdi
callq 0x13780
testq %r15, %r15
sete %al
testq %r13, %r13
sete %cl
testq %rbx, %rbx
sete %dl
cmpl $0x0, (%rsp)
sete %sil
testq %r12, %r12
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 0x49f66
movq 0xa0(%rsp), %rsi
movl (%rbx), %r15d
movsd 0x11c(%r13), %xmm1
movsd 0x20(%rsp), %xmm0
movsd 0x28(%rsp), %xmm2
movaps %xmm0, 0x40(%rsp)
subps %xmm1, %xmm0
addps %xmm1, %xmm1
movaps %xmm2, 0x30(%rsp)
addps %xmm2, %xmm1
movq %rbp, %rdi
xorl %edx, %edx
callq 0x521be
testl %eax, %eax
je 0x49e4c
xorl %eax, %eax
cmpl $0x0, (%rbx)
sete %al
movl %eax, (%rbx)
movss 0x118(%r13), %xmm2
movaps 0x40(%rsp), %xmm3
movaps %xmm3, %xmm1
shufps $0x55, %xmm3, %xmm1     # xmm1 = xmm1[1,1],xmm3[1,1]
addss %xmm2, %xmm1
movss %xmm1, 0x14(%rsp)
movaps 0x30(%rsp), %xmm4
movaps %xmm4, %xmm0
shufps $0x55, %xmm4, %xmm0     # xmm0 = xmm0[1,1],xmm4[1,1]
addss %xmm2, %xmm2
subss %xmm2, %xmm0
movss %xmm0, 0x1c(%rsp)
movss %xmm0, 0x18(%rsp)
testb $0x1, 0x8(%rsp)
jne 0x49ea5
movss 0x114(%r13), %xmm2
addss %xmm2, %xmm2
addss %xmm3, %xmm2
jmp 0x49ec5
addss %xmm4, %xmm3
movss 0x114(%r13), %xmm2
addss %xmm2, %xmm2
addss %xmm0, %xmm2
subss %xmm2, %xmm3
xorps %xmm2, %xmm2
maxss %xmm3, %xmm2
movq 0x90(%rsp), %r10
movss %xmm2, 0x10(%rsp)
movsd 0x124(%r13), %xmm3
unpcklps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
addps %xmm3, %xmm2
unpcklps %xmm0, %xmm0            # xmm0 = xmm0[0,0,1,1]
addps %xmm3, %xmm3
subps %xmm3, %xmm0
movlhps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
movups %xmm2, 0x10(%rsp)
movq 0x140(%r13), %rax
testq %rax, %rax
je 0x49f13
movq 0x138(%r13), %rsi
movq %r14, %rdi
callq *%rax
movq 0x90(%rsp), %r10
movl (%rbp), %esi
movl (%rbx), %ecx
leaq 0x20(%rsp), %r8
leaq 0x10(%rsp), %r9
movq %r14, %rdi
movq %r13, %rdx
pushq 0xa8(%rsp)
pushq 0x10(%rsp)
pushq 0x10(%rsp)
pushq %r12
pushq $0x0
pushq %r10
callq 0x5893d
addq $0x30, %rsp
movq 0x148(%r13), %rax
testq %rax, %rax
je 0x49f5e
movq 0x138(%r13), %rsi
movq %r14, %rdi
callq *%rax
xorl %eax, %eax
cmpl (%rbx), %r15d
setne %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq