// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_do_scrollbarh
NK_LIB float
nk_do_scrollbarh(nk_flags *state,
    struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling,
    float offset, float target, float step, float button_pixel_inc,
    const struct nk_style_scrollbar *style, struct nk_input *in,
    const struct nk_user_font *font)
{
    struct nk_rect cursor;
    struct nk_rect empty_west;
    struct nk_rect empty_east;

    float scroll_step;
    float scroll_offset;
    float scroll_off;
    float scroll_ratio;

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

    /* scrollbar background */
    scroll.h = NK_MAX(scroll.h, 1);
    scroll.w = NK_MAX(scroll.w, 2 * scroll.h);
    if (target <= scroll.w) return 0;

    /* optional scrollbar buttons */
    if (style->show_buttons) {
        nk_flags ws;
        float scroll_w;
        struct nk_rect button;
        button.y = scroll.y;
        button.w = scroll.h;
        button.h = scroll.h;

        scroll_w = scroll.w - 2 * button.w;
        scroll_step = NK_MIN(step, button_pixel_inc);

        /* decrement button */
        button.x = scroll.x;
        if (nk_do_button_symbol(&ws, out, button, style->dec_symbol,
            NK_BUTTON_REPEATER, &style->dec_button, in, font))
            offset = offset - scroll_step;

        /* increment button */
        button.x = scroll.x + scroll.w - button.w;
        if (nk_do_button_symbol(&ws, out, button, style->inc_symbol,
            NK_BUTTON_REPEATER, &style->inc_button, in, font))
            offset = offset + scroll_step;

        scroll.x = scroll.x + button.w;
        scroll.w = scroll_w;
    }

    /* calculate scrollbar constants */
    scroll_step = NK_MIN(step, scroll.w);
    scroll_offset = NK_CLAMP(0, offset, target - scroll.w);
    scroll_ratio = scroll.w / target;
    scroll_off = scroll_offset / target;

    /* calculate cursor bounds */
    cursor.w = (scroll_ratio * scroll.w) - (2*style->border + 2*style->padding.x);
    cursor.x = scroll.x + (scroll_off * scroll.w) + style->border + style->padding.x;
    cursor.h = scroll.h - (2 * style->border + 2 * style->padding.y);
    cursor.y = scroll.y + style->border + style->padding.y;

    /* calculate empty space around cursor */
    empty_west.x = scroll.x;
    empty_west.y = scroll.y;
    empty_west.w = cursor.x - scroll.x;
    empty_west.h = scroll.h;

    empty_east.x = cursor.x + cursor.w;
    empty_east.y = scroll.y;
    empty_east.w = (scroll.x + scroll.w) - (cursor.x + cursor.w);
    empty_east.h = scroll.h;

    /* update scrollbar */
    scroll_offset = nk_scrollbar_behavior(state, in, has_scrolling, &scroll, &cursor,
        &empty_west, &empty_east, scroll_offset, target, scroll_step, NK_HORIZONTAL);
    scroll_off = scroll_offset / target;
    cursor.x = scroll.x + (scroll_off * scroll.w);

    /* draw scrollbar */
    if (style->draw_begin) style->draw_begin(out, style->userdata);
    nk_draw_scrollbar(out, *state, style, &scroll, &cursor);
    if (style->draw_end) style->draw_end(out, style->userdata);
    return scroll_offset;
}

// Assembly:
subq $0xe8, %rsp
movlpd %xmm0, 0xd4(%rsp)
movlpd %xmm1, 0xdc(%rsp)
movq %rdi, 0xc8(%rsp)
movq %rsi, 0xc0(%rsp)
movl %edx, 0xbc(%rsp)
movss %xmm2, 0xb8(%rsp)
movss %xmm3, 0xb4(%rsp)
movss %xmm4, 0xb0(%rsp)
movss %xmm5, 0xac(%rsp)
movq %rcx, 0xa0(%rsp)
movq %r8, 0x98(%rsp)
movq %r9, 0x90(%rsp)
cmpq $0x0, 0xc0(%rsp)
jne 0x8678a
movq 0x3e892(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x2ac38(%rip), %rsi     # 0xb13a0
leaq 0x2ac4f(%rip), %rdx     # 0xb13be
movl $0x661b, %ecx           # imm = 0x661B
movb $0x0, %al
callq 0x13ec0
movq 0x3e86e(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x8678c
jmp 0x8678e
cmpq $0x0, 0xa0(%rsp)
jne 0x867cc
movq 0x3e850(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x2abf6(%rip), %rsi     # 0xb13a0
leaq 0x2ac0d(%rip), %rdx     # 0xb13be
movl $0x661c, %ecx           # imm = 0x661C
movb $0x0, %al
callq 0x13ec0
movq 0x3e82c(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x867ce
cmpq $0x0, 0xc0(%rsp)
je 0x867e4
cmpq $0x0, 0xa0(%rsp)
jne 0x867f5
xorps %xmm0, %xmm0
movss %xmm0, 0xe4(%rsp)
jmp 0x86ed0
movss 0x26ceb(%rip), %xmm0    # 0xad4e8
ucomiss 0xe0(%rsp), %xmm0
jbe 0x86817
movss 0x26cd9(%rip), %xmm0    # 0xad4e8
movss %xmm0, 0x34(%rsp)
jmp 0x86826
movss 0xe0(%rsp), %xmm0
movss %xmm0, 0x34(%rsp)
movss 0x34(%rsp), %xmm0
movss %xmm0, 0xe0(%rsp)
movss 0xdc(%rsp), %xmm1
movss 0x26c9e(%rip), %xmm0    # 0xad4e4
mulss 0xe0(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x8686d
movss 0x26c88(%rip), %xmm0    # 0xad4e4
mulss 0xe0(%rsp), %xmm0
movss %xmm0, 0x30(%rsp)
jmp 0x8687c
movss 0xdc(%rsp), %xmm0
movss %xmm0, 0x30(%rsp)
movss 0x30(%rsp), %xmm0
movss %xmm0, 0xdc(%rsp)
movss 0xb4(%rsp), %xmm1
movss 0xdc(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jb 0x868b3
xorps %xmm0, %xmm0
movss %xmm0, 0xe4(%rsp)
jmp 0x86ed0
movq 0xa0(%rsp), %rax
cmpl $0x0, 0x11c(%rax)
je 0x86a89
movss 0xd8(%rsp), %xmm0
movss %xmm0, 0x3c(%rsp)
movss 0xe0(%rsp), %xmm0
movss %xmm0, 0x40(%rsp)
movss 0xe0(%rsp), %xmm0
movss %xmm0, 0x44(%rsp)
movss 0xdc(%rsp), %xmm0
movss 0x40(%rsp), %xmm1
addss %xmm1, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x48(%rsp)
movss 0xb0(%rsp), %xmm1
movss 0xac(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x8693a
movss 0xb0(%rsp), %xmm0
movss %xmm0, 0x2c(%rsp)
jmp 0x86949
movss 0xac(%rsp), %xmm0
movss %xmm0, 0x2c(%rsp)
movss 0x2c(%rsp), %xmm0
movss %xmm0, 0x5c(%rsp)
movss 0xd4(%rsp), %xmm0
movss %xmm0, 0x38(%rsp)
movq 0xc0(%rsp), %rsi
movq 0xa0(%rsp), %r8
movl 0x2d4(%r8), %edx
addq $0x1f8, %r8             # imm = 0x1F8
movq 0x98(%rsp), %r9
movq 0x90(%rsp), %rcx
movsd 0x38(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movq %rsp, %rax
movq %rcx, (%rax)
leaq 0x4c(%rsp), %rdi
movl $0x1, %ecx
callq 0x5e910
cmpl $0x0, %eax
je 0x869d0
movss 0xb8(%rsp), %xmm0
subss 0x5c(%rsp), %xmm0
movss %xmm0, 0xb8(%rsp)
movss 0xd4(%rsp), %xmm0
movss 0xdc(%rsp), %xmm1
addss %xmm1, %xmm0
movss 0x40(%rsp), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x38(%rsp)
movq 0xc0(%rsp), %rsi
movq 0xa0(%rsp), %r8
movl 0x2d0(%r8), %edx
addq $0x120, %r8             # imm = 0x120
movq 0x98(%rsp), %r9
movq 0x90(%rsp), %rcx
movsd 0x38(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movq %rsp, %rax
movq %rcx, (%rax)
leaq 0x4c(%rsp), %rdi
movl $0x1, %ecx
callq 0x5e910
cmpl $0x0, %eax
je 0x86a62
movss 0xb8(%rsp), %xmm0
addss 0x5c(%rsp), %xmm0
movss %xmm0, 0xb8(%rsp)
movss 0xd4(%rsp), %xmm0
addss 0x40(%rsp), %xmm0
movss %xmm0, 0xd4(%rsp)
movss 0x48(%rsp), %xmm0
movss %xmm0, 0xdc(%rsp)
movss 0xb0(%rsp), %xmm1
movss 0xdc(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x86ab1
movss 0xb0(%rsp), %xmm0
movss %xmm0, 0x28(%rsp)
jmp 0x86ac0
movss 0xdc(%rsp), %xmm0
movss %xmm0, 0x28(%rsp)
movss 0x28(%rsp), %xmm0
movss %xmm0, 0x5c(%rsp)
movss 0xb8(%rsp), %xmm1
movss 0xb4(%rsp), %xmm0
subss 0xdc(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x86afd
movss 0xb8(%rsp), %xmm0
movss %xmm0, 0x24(%rsp)
jmp 0x86b15
movss 0xb4(%rsp), %xmm0
subss 0xdc(%rsp), %xmm0
movss %xmm0, 0x24(%rsp)
movss 0x24(%rsp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x86b2e
xorps %xmm0, %xmm0
movss %xmm0, 0x20(%rsp)
jmp 0x86b83
movss 0xb8(%rsp), %xmm1
movss 0xb4(%rsp), %xmm0
subss 0xdc(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x86b5f
movss 0xb8(%rsp), %xmm0
movss %xmm0, 0x1c(%rsp)
jmp 0x86b77
movss 0xb4(%rsp), %xmm0
subss 0xdc(%rsp), %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0x20(%rsp)
movss 0x20(%rsp), %xmm0
movss %xmm0, 0x58(%rsp)
movss 0xdc(%rsp), %xmm0
divss 0xb4(%rsp), %xmm0
movss %xmm0, 0x50(%rsp)
movss 0x58(%rsp), %xmm0
divss 0xb4(%rsp), %xmm0
movss %xmm0, 0x54(%rsp)
movss 0x50(%rsp), %xmm0
movss 0xdc(%rsp), %xmm2
movq 0xa0(%rsp), %rax
movss 0xfc(%rax), %xmm1
movq 0xa0(%rsp), %rax
movss 0x268f9(%rip), %xmm3    # 0xad4e4
mulss 0x10c(%rax), %xmm3
addss %xmm1, %xmm1
addss %xmm3, %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x88(%rsp)
movss 0xd4(%rsp), %xmm1
movss 0x54(%rsp), %xmm0
movss 0xdc(%rsp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq 0xa0(%rsp), %rax
addss 0xfc(%rax), %xmm0
movq 0xa0(%rsp), %rax
addss 0x10c(%rax), %xmm0
movss %xmm0, 0x80(%rsp)
movss 0xe0(%rsp), %xmm0
movq 0xa0(%rsp), %rax
movss 0xfc(%rax), %xmm1
movq 0xa0(%rsp), %rax
movss 0x26859(%rip), %xmm2    # 0xad4e4
mulss 0x110(%rax), %xmm2
addss %xmm1, %xmm1
addss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x8c(%rsp)
movss 0xd8(%rsp), %xmm0
movq 0xa0(%rsp), %rax
addss 0xfc(%rax), %xmm0
movq 0xa0(%rsp), %rax
addss 0x110(%rax), %xmm0
movss %xmm0, 0x84(%rsp)
movss 0xd4(%rsp), %xmm0
movss %xmm0, 0x70(%rsp)
movss 0xd8(%rsp), %xmm0
movss %xmm0, 0x74(%rsp)
movss 0x80(%rsp), %xmm0
subss 0xd4(%rsp), %xmm0
movss %xmm0, 0x78(%rsp)
movss 0xe0(%rsp), %xmm0
movss %xmm0, 0x7c(%rsp)
movss 0x80(%rsp), %xmm0
addss 0x88(%rsp), %xmm0
movss %xmm0, 0x60(%rsp)
movss 0xd8(%rsp), %xmm0
movss %xmm0, 0x64(%rsp)
movss 0xd4(%rsp), %xmm0
addss 0xdc(%rsp), %xmm0
movss 0x80(%rsp), %xmm1
addss 0x88(%rsp), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x68(%rsp)
movss 0xe0(%rsp), %xmm0
movss %xmm0, 0x6c(%rsp)
movq 0xc8(%rsp), %rdi
movq 0x98(%rsp), %rsi
movl 0xbc(%rsp), %edx
movss 0x58(%rsp), %xmm0
movss 0xb4(%rsp), %xmm1
movss 0x5c(%rsp), %xmm2
leaq 0xd4(%rsp), %rcx
leaq 0x80(%rsp), %r8
leaq 0x70(%rsp), %r9
leaq 0x60(%rsp), %rax
movq %rax, (%rsp)
movl $0x1, 0x8(%rsp)
callq 0x87170
movss %xmm0, 0x58(%rsp)
movss 0x58(%rsp), %xmm0
divss 0xb4(%rsp), %xmm0
movss %xmm0, 0x54(%rsp)
movss 0xd4(%rsp), %xmm1
movss 0x54(%rsp), %xmm0
movss 0xdc(%rsp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x80(%rsp)
movq 0xa0(%rsp), %rax
cmpq $0x0, 0x2e0(%rax)
je 0x86e58
movq 0xa0(%rsp), %rax
movq 0x2e0(%rax), %rax
movq 0xc0(%rsp), %rdi
movq 0xa0(%rsp), %rcx
movq 0x2d8(%rcx), %rsi
callq *%rax
movq 0xc0(%rsp), %rdi
movq 0xc8(%rsp), %rax
movl (%rax), %esi
movq 0xa0(%rsp), %rdx
leaq 0xd4(%rsp), %rcx
leaq 0x80(%rsp), %r8
callq 0x87b40
movq 0xa0(%rsp), %rax
cmpq $0x0, 0x2e8(%rax)
je 0x86ec1
movq 0xa0(%rsp), %rax
movq 0x2e8(%rax), %rax
movq 0xc0(%rsp), %rdi
movq 0xa0(%rsp), %rcx
movq 0x2d8(%rcx), %rsi
callq *%rax
movss 0x58(%rsp), %xmm0
movss %xmm0, 0xe4(%rsp)
movss 0xe4(%rsp), %xmm0
addq $0xe8, %rsp
retq
nopw %cs:(%rax,%rax)