// File: /workspace/github_c_makefile_star2_O0/arkanis[P]process-map/./deps/raygui.h
// Function: GetTextBounds
static Rectangle GetTextBounds(int control, Rectangle bounds)
{
    Rectangle textBounds = bounds;

    textBounds.x = bounds.x + GuiGetStyle(control, BORDER_WIDTH);
    textBounds.y = bounds.y + GuiGetStyle(control, BORDER_WIDTH);
    textBounds.width = bounds.width - 2*GuiGetStyle(control, BORDER_WIDTH);
    textBounds.height = bounds.height - 2*GuiGetStyle(control, BORDER_WIDTH);

    // Consider TEXT_PADDING properly, depends on control type and TEXT_ALIGNMENT
    switch (control)
    {
        case COMBOBOX: bounds.width -= (GuiGetStyle(control, COMBO_BUTTON_WIDTH) + GuiGetStyle(control, COMBO_BUTTON_PADDING)); break;
        case VALUEBOX: break;   // NOTE: ValueBox text value always centered, text padding applies to label
        default:
        {
            if (GuiGetStyle(control, TEXT_ALIGNMENT) == GUI_TEXT_ALIGN_RIGHT) textBounds.x -= GuiGetStyle(control, TEXT_PADDING);
            else textBounds.x += GuiGetStyle(control, TEXT_PADDING);
        } break;
    }

    // TODO: Special cases (no label): COMBOBOX, DROPDOWNBOX, LISTVIEW (scrollbar?)
    // More special cases (label side): CHECKBOX, SLIDER, VALUEBOX, SPINNER

    return textBounds;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movlpd %xmm0, -0x20(%rbp)
movlpd %xmm1, -0x18(%rbp)
movl %edi, -0x24(%rbp)
movups -0x20(%rbp), %xmm0
movaps %xmm0, -0x10(%rbp)
movss -0x20(%rbp), %xmm0
movss %xmm0, -0x3c(%rbp)
movl -0x24(%rbp), %edi
movl $0xc, %esi
movl %esi, -0x30(%rbp)
callq 0x6f90
movss -0x3c(%rbp), %xmm0
movl -0x30(%rbp), %esi
cvtsi2ss %eax, %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x10(%rbp)
movss -0x1c(%rbp), %xmm0
movss %xmm0, -0x38(%rbp)
movl -0x24(%rbp), %edi
callq 0x6f90
movss -0x38(%rbp), %xmm0
movl -0x30(%rbp), %esi
cvtsi2ss %eax, %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0xc(%rbp)
movss -0x18(%rbp), %xmm0
movss %xmm0, -0x34(%rbp)
movl -0x24(%rbp), %edi
callq 0x6f90
movss -0x34(%rbp), %xmm0
movl -0x30(%rbp), %esi
addl %eax, %eax
cvtsi2ss %eax, %xmm1
subss %xmm1, %xmm0
movss %xmm0, -0x8(%rbp)
movss -0x14(%rbp), %xmm0
movss %xmm0, -0x2c(%rbp)
movl -0x24(%rbp), %edi
callq 0x6f90
movss -0x2c(%rbp), %xmm0
addl %eax, %eax
cvtsi2ss %eax, %xmm1
subss %xmm1, %xmm0
movss %xmm0, -0x4(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
subl $0x7, %eax
je 0xa049
jmp 0xa03f
movl -0x28(%rbp), %eax
subl $0xa, %eax
je 0xa081
jmp 0xa083
movl -0x24(%rbp), %edi
movl $0x10, %esi
callq 0x6f90
movl %eax, -0x40(%rbp)
movl -0x24(%rbp), %edi
movl $0x11, %esi
callq 0x6f90
movl %eax, %ecx
movl -0x40(%rbp), %eax
addl %ecx, %eax
cvtsi2ss %eax, %xmm1
movss -0x18(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x18(%rbp)
jmp 0xa0d3
jmp 0xa0d3
movl -0x24(%rbp), %edi
movl $0xe, %esi
callq 0x6f90
cmpl $0x2, %eax
jne 0xa0b6
movl -0x24(%rbp), %edi
movl $0xd, %esi
callq 0x6f90
cvtsi2ss %eax, %xmm1
movss -0x10(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x10(%rbp)
jmp 0xa0d1
movl -0x24(%rbp), %edi
movl $0xd, %esi
callq 0x6f90
cvtsi2ss %eax, %xmm0
addss -0x10(%rbp), %xmm0
movss %xmm0, -0x10(%rbp)
jmp 0xa0d3
movsd -0x10(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)