// File: /workspace/github_c_makefile_star2_O1/0x0203[P]schack_poc/./nuklear.h
// Function: nk_do_toggle
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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq 0x150(%rsp), %r15
testq %r15, %r15
je 0x1618a
movq %rsi, %rbx
testq %rsi, %rsi
je 0x161a9
movq 0x160(%rsp), %rax
testq %rax, %rax
je 0x161c8
movq %rdx, %r13
testq %rdx, %rdx
je 0x16178
movq %rdi, %rbp
movl %r9d, 0x3c(%rsp)
movq %rcx, 0x78(%rsp)
movl %r8d, 0xc(%rsp)
movq 0x158(%rsp), %r14
movss 0x8(%rax), %xmm3
movss 0xbc(%r15), %xmm2
movss 0xc0(%r15), %xmm4
movaps %xmm2, 0x20(%rsp)
addss %xmm2, %xmm2
movss %xmm2, 0x10(%rsp)
movaps %xmm2, %xmm9
addss %xmm3, %xmm9
maxss %xmm1, %xmm9
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
movaps %xmm4, 0xd0(%rsp)
addss %xmm4, %xmm4
movss %xmm4, 0x50(%rsp)
addss %xmm3, %xmm4
maxss %xmm1, %xmm4
movss 0xc4(%r15), %xmm8
movaps %xmm0, %xmm7
subss %xmm8, %xmm7
movaps %xmm0, %xmm2
shufps $0x55, %xmm0, %xmm2     # xmm2 = xmm2[1,1],xmm0[1,1]
movss 0xc8(%r15), %xmm6
movaps %xmm2, %xmm5
subss %xmm6, %xmm5
addss %xmm8, %xmm8
addss %xmm9, %xmm8
addss %xmm6, %xmm6
addss %xmm4, %xmm6
movss 0x1273a(%rip), %xmm1    # 0x28380
mulss %xmm1, %xmm4
addss %xmm2, %xmm4
mulss %xmm3, %xmm1
subss %xmm1, %xmm4
movaps %xmm4, 0x80(%rsp)
movss 0xd0(%r15), %xmm1
movss %xmm1, 0xc0(%rsp)
addss %xmm1, %xmm1
movss %xmm1, 0x34(%rsp)
movaps %xmm0, %xmm1
movaps %xmm3, 0xa0(%rsp)
addss %xmm3, %xmm1
addss 0xcc(%r15), %xmm1
movaps %xmm1, 0x60(%rsp)
movaps %xmm0, 0x90(%rsp)
addss %xmm0, %xmm9
movss %xmm9, 0x38(%rsp)
movl (%r13), %r12d
movl (%rdi), %eax
andl $0x2, %eax
orl $0x4, %eax
movl %eax, (%rdi)
movaps %xmm7, 0x100(%rsp)
movaps %xmm7, %xmm0
movaps %xmm5, 0xb0(%rsp)
unpcklps %xmm5, %xmm0            # xmm0 = xmm0[0],xmm5[0],xmm0[1],xmm5[1]
movaps %xmm8, 0xf0(%rsp)
movaps %xmm8, %xmm1
movaps %xmm6, 0xe0(%rsp)
unpcklps %xmm6, %xmm1            # xmm1 = xmm1[0],xmm6[0],xmm1[1],xmm6[1]
movq %r14, %rsi
xorl %edx, %edx
callq 0x1e017
testl %eax, %eax
je 0x15d07
movl $0x22, (%rbp)
xorl %eax, %eax
testl %r12d, %r12d
sete %al
movl %eax, %r12d
movaps 0x20(%rsp), %xmm2
movaps 0x90(%rsp), %xmm3
addss %xmm3, %xmm2
movaps 0x80(%rsp), %xmm6
movaps 0xd0(%rsp), %xmm8
addss %xmm6, %xmm8
movss 0x10(%rsp), %xmm5
movss 0x34(%rsp), %xmm0
addss %xmm0, %xmm5
movss 0x50(%rsp), %xmm9
addss %xmm0, %xmm9
movaps 0x60(%rsp), %xmm4
maxss 0x38(%rsp), %xmm4
movl (%rbp), %eax
testb $0x10, %al
movaps 0xb0(%rsp), %xmm7
movaps 0x100(%rsp), %xmm10
jne 0x15dbc
testq %r14, %r14
je 0x15e0f
movss 0x14c(%r14), %xmm0
ucomiss %xmm10, %xmm0
jb 0x15e0f
addss 0xf0(%rsp), %xmm10
ucomiss %xmm0, %xmm10
jbe 0x15e0f
movss 0x150(%r14), %xmm0
ucomiss %xmm7, %xmm0
jb 0x15e0f
addss 0xe0(%rsp), %xmm7
movl $0x40, %ecx
ucomiss %xmm0, %xmm7
ja 0x15e0a
jmp 0x15e0f
movl $0x8, %ecx
testq %r14, %r14
je 0x15e0a
movss 0x14c(%r14), %xmm0
ucomiss %xmm10, %xmm0
jb 0x15e0a
movaps %xmm10, %xmm1
addss 0xf0(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x15e0a
movss 0x150(%r14), %xmm0
ucomiss %xmm7, %xmm0
jb 0x15e0a
movaps %xmm7, %xmm1
addss 0xe0(%rsp), %xmm1
ucomiss %xmm0, %xmm1
ja 0x15d6d
orl %ecx, %eax
movl %eax, (%rbp)
movaps %xmm6, %xmm10
movlhps %xmm3, %xmm10           # xmm10 = xmm10[0],xmm3[0]
movss 0xc0(%rsp), %xmm0
addss %xmm0, %xmm2
addss %xmm0, %xmm8
movaps 0xa0(%rsp), %xmm0
movaps %xmm0, %xmm7
subss %xmm5, %xmm7
subss %xmm9, %xmm0
subss 0x60(%rsp), %xmm4
movl %r12d, (%r13)
movq 0xe0(%r15), %rax
testq %rax, %rax
je 0x15ec1
movq 0xd8(%r15), %rsi
movq %rbx, %rdi
movaps %xmm2, 0x20(%rsp)
movaps %xmm4, 0x10(%rsp)
movaps %xmm7, 0x50(%rsp)
movaps %xmm8, 0xd0(%rsp)
movaps %xmm10, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
callq *%rax
movaps 0xb0(%rsp), %xmm0
movaps 0xc0(%rsp), %xmm10
movaps 0xd0(%rsp), %xmm8
movaps 0x50(%rsp), %xmm7
movaps 0x80(%rsp), %xmm6
movaps 0x10(%rsp), %xmm4
movaps 0x90(%rsp), %xmm3
movaps 0x20(%rsp), %xmm2
movaps 0xa0(%rsp), %xmm5
movaps %xmm5, %xmm1
shufps $0x0, %xmm5, %xmm1      # xmm1 = xmm1[0,0],xmm5[0,0]
shufps $0xe2, %xmm3, %xmm10    # xmm10 = xmm10[2,0],xmm3[2,3]
unpcklps %xmm8, %xmm2            # xmm2 = xmm2[0],xmm8[0],xmm2[1],xmm8[1]
unpcklps %xmm0, %xmm7            # xmm7 = xmm7[0],xmm0[0],xmm7[1],xmm0[1]
movaps 0x60(%rsp), %xmm0
unpcklps %xmm6, %xmm0            # xmm0 = xmm0[0],xmm6[0],xmm0[1],xmm6[1]
movaps %xmm0, 0x60(%rsp)
unpcklps %xmm5, %xmm4            # xmm4 = xmm4[0],xmm5[0],xmm4[1],xmm5[1]
movaps %xmm4, 0x10(%rsp)
movl (%rbp), %eax
movl (%r13), %ebp
cmpl $0x0, 0x3c(%rsp)
movaps %xmm2, 0x20(%rsp)
movaps %xmm7, 0x50(%rsp)
je 0x15f25
testb $0x10, %al
jne 0x15f48
testb $0x20, %al
jne 0x15f73
leaq 0x68(%r15), %r12
movl 0xa8(%r15), %eax
movl %eax, 0x4c(%rsp)
movq %r15, %r14
jmp 0x15f89
testb $0x10, %al
jne 0x15f5c
testb $0x20, %al
jne 0x16044
leaq 0x68(%r15), %r12
movl 0xa8(%r15), %eax
movl %eax, 0x4c(%rsp)
movq %r15, %r14
jmp 0x1605a
leaq 0x20(%r15), %r14
leaq 0x88(%r15), %r12
movl 0xac(%r15), %eax
jmp 0x15f85
leaq 0x20(%r15), %r14
leaq 0x88(%r15), %r12
movl 0xac(%r15), %eax
jmp 0x16056
leaq 0x20(%r15), %r14
leaq 0x88(%r15), %r12
movl 0xb0(%r15), %eax
movl %eax, 0x4c(%rsp)
cmpl $0x0, (%r14)
je 0x15fa9
addq $0x8, %r14
movq %rbx, %rdi
movaps %xmm10, %xmm0
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7b23
jmp 0x16004
movl 0x60(%r15), %esi
movq %rbx, %rdi
movaps %xmm10, %xmm0
callq 0x7352
movss 0xd0(%r15), %xmm0
movaps 0x90(%rsp), %xmm2
addss %xmm0, %xmm2
movaps 0x80(%rsp), %xmm3
addss %xmm0, %xmm3
addss %xmm0, %xmm0
movaps %xmm0, %xmm1
maxss 0xa0(%rsp), %xmm1
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
subss %xmm0, %xmm1
movl 0x8(%r14), %esi
shufps $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
movq %rbx, %rdi
movaps %xmm2, %xmm0
callq 0x7352
testl %ebp, %ebp
movaps 0x20(%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movaps 0x50(%rsp), %xmm2
je 0x16126
leaq 0x8(%r12), %rsi
cmpl $0x1, (%r12)
jne 0x16032
movq %rbx, %rdi
movaps %xmm2, %xmm1
jmp 0x16100
movl (%rsi), %esi
movq %rbx, %rdi
movaps %xmm2, %xmm1
callq 0x7352
jmp 0x16121
leaq 0x20(%r15), %r14
leaq 0x88(%r15), %r12
movl 0xb0(%r15), %eax
movl %eax, 0x4c(%rsp)
cmpl $0x0, (%r14)
je 0x1607a
addq $0x8, %r14
movq %rbx, %rdi
movaps %xmm10, %xmm0
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7b23
jmp 0x160db
movl 0x60(%r15), %esi
xorps %xmm2, %xmm2
movq %rbx, %rdi
movaps %xmm10, %xmm0
callq 0x6fee
movss 0xd0(%r15), %xmm0
movaps 0x90(%rsp), %xmm3
addss %xmm0, %xmm3
movaps 0x80(%rsp), %xmm2
addss %xmm0, %xmm2
addss %xmm0, %xmm0
movaps %xmm0, %xmm1
maxss 0xa0(%rsp), %xmm1
unpcklps %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
subss %xmm0, %xmm1
movl 0x8(%r14), %esi
shufps $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
xorps %xmm2, %xmm2
movq %rbx, %rdi
movaps %xmm3, %xmm0
callq 0x6fee
testl %ebp, %ebp
movaps 0x10(%rsp), %xmm1
movaps 0x50(%rsp), %xmm3
je 0x16126
leaq 0x8(%r12), %rsi
cmpl $0x1, (%r12)
jne 0x1610c
movq %rbx, %rdi
movaps 0x20(%rsp), %xmm0
movaps %xmm3, %xmm1
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7b23
jmp 0x16121
movl (%rsi), %esi
xorps %xmm2, %xmm2
movq %rbx, %rdi
movaps 0x20(%rsp), %xmm0
movaps %xmm3, %xmm1
callq 0x6fee
movaps 0x10(%rsp), %xmm1
leaq 0x40(%rsp), %rcx
movq $0x0, (%rcx)
movl 0xb4(%r15), %eax
movl %eax, 0x8(%rcx)
movq %rbx, %rdi
movaps 0x60(%rsp), %xmm0
movq 0x78(%rsp), %rsi
movl 0xc(%rsp), %edx
movl $0x11, %r8d
movq 0x160(%rsp), %r9
callq 0x13f12
movq 0xe8(%r15), %rax
testq %rax, %rax
je 0x16178
movq 0xd8(%r15), %rsi
movq %rbx, %rdi
callq *%rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16a9a(%rip), %rdi     # 0x2cc2b
leaq 0x134eb(%rip), %rsi     # 0x29683
leaq 0x1a568(%rip), %rcx     # 0x30707
movl $0x4f27, %edx           # imm = 0x4F27
callq 0x3100
leaq 0x16262(%rip), %rdi     # 0x2c412
leaq 0x134cc(%rip), %rsi     # 0x29683
leaq 0x1a549(%rip), %rcx     # 0x30707
movl $0x4f28, %edx           # imm = 0x4F28
callq 0x3100
leaq 0x144be(%rip), %rdi     # 0x2a68d
leaq 0x134ad(%rip), %rsi     # 0x29683
leaq 0x1a52a(%rip), %rcx     # 0x30707
movl $0x4f29, %edx           # imm = 0x4F29
callq 0x3100