// File: /workspace/github_c_makefile_star2_O1/arkanis[P]process-map/./deps/raygui.h
// Function: GuiGrid
Vector2 GuiGrid(Rectangle bounds, float spacing, int subdivs)
{
    #if !defined(GRID_COLOR_ALPHA)
        #define GRID_COLOR_ALPHA    0.15f           // Grid lines alpha amount
    #endif

    GuiControlState state = guiState;
    Vector2 mousePoint = GetMousePosition();
    Vector2 currentCell = { -1, -1 };

    int linesV = ((int)(bounds.width/spacing))*subdivs + 1;
    int linesH = ((int)(bounds.height/spacing))*subdivs + 1;

    // Update control
    //--------------------------------------------------------------------
    if ((state != GUI_STATE_DISABLED) && !guiLocked)
    {
        if (CheckCollisionPointRec(mousePoint, bounds))
        {
            currentCell.x = (mousePoint.x - bounds.x) / spacing;
            currentCell.y = (mousePoint.y - bounds.y) / spacing;
        }
    }
    //--------------------------------------------------------------------

    // Draw control
    //--------------------------------------------------------------------
    switch (state)
    {
        case GUI_STATE_NORMAL:
        {
            if (subdivs > 0)
            {
                // Draw vertical grid lines
                for (int i = 0; i < linesV; i++)
                {
                    Rectangle lineV = { bounds.x + spacing * i / subdivs, bounds.y, 1, bounds.height };
                    GuiDrawRectangle(lineV, 0, BLANK, ((i%subdivs) == 0) ? Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), GRID_COLOR_ALPHA * 4) : Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), GRID_COLOR_ALPHA));
                }

                // Draw horizontal grid lines
                for (int i = 0; i < linesH; i++)
                {
                    Rectangle lineH = { bounds.x, bounds.y + spacing * i / subdivs, bounds.width, 1 };
                    GuiDrawRectangle(lineH, 0, BLANK, ((i%subdivs) == 0) ? Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), GRID_COLOR_ALPHA * 4) : Fade(GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)), GRID_COLOR_ALPHA));
                }
            }
        } break;
        default: break;
    }

    return currentCell;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edi, %ebx
movss %xmm2, (%rsp)
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movl 0x970a6(%rip), %ebp     # 0xa7250
callq 0x2867d
movaps %xmm0, %xmm2
movaps 0x57f77(%rip), %xmm0    # 0x68130
movaps %xmm0, 0x50(%rsp)
cmpl $0x3, %ebp
je 0x1020d
cmpb $0x0, 0x9708a(%rip)     # 0xa7254
jne 0x1020d
movaps %xmm2, %xmm0
movaps 0x10(%rsp), %xmm1
movaps %xmm2, 0x30(%rsp)
movaps 0x40(%rsp), %xmm2
callq 0x34d6b
testb %al, %al
je 0x1020d
movaps 0x30(%rsp), %xmm2
subps 0x20(%rsp), %xmm2
movaps %xmm2, %xmm1
movss (%rsp), %xmm0
divss %xmm0, %xmm1
shufps $0x55, %xmm2, %xmm2     # xmm2 = xmm2[1,1,1,1]
divss %xmm0, %xmm2
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movaps %xmm1, 0x50(%rsp)
testl %ebp, %ebp
setne %al
testl %ebx, %ebx
setle %cl
orb %al, %cl
jne 0x103db
movaps 0x40(%rsp), %xmm1
movaps %xmm1, %xmm0
shufps $0x55, %xmm1, %xmm0     # xmm0 = xmm0[1,1],xmm1[1,1]
movss (%rsp), %xmm3
divss %xmm3, %xmm1
movaps %xmm0, %xmm2
divss %xmm3, %xmm2
cvttss2si %xmm1, %r13d
cvttss2si %xmm2, %r12d
imull %ebx, %r13d
imull %ebx, %r12d
movaps 0x20(%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
movaps %xmm1, 0x20(%rsp)
testl %r13d, %r13d
js 0x1031a
xorps %xmm1, %xmm1
cvtsi2ss %ebx, %xmm1
movss %xmm1, 0x8(%rsp)
cvttss2si 0x20(%rsp), %eax
movl %eax, 0x4(%rsp)
cvttss2si %xmm0, %eax
movl %eax, 0xc(%rsp)
incl %r13d
xorl %r15d, %r15d
movl %r15d, %eax
xorl %edx, %edx
divl %ebx
xorl %r14d, %r14d
testl %edx, %edx
sete %bpl
cmpb $0x0, 0x96fb5(%rip)     # 0xa7255
jne 0x102a7
callq 0x6a18
movb %bpl, %r14b
leaq 0x57fc7(%rip), %rax     # 0x68278
movss (%rax,%r14,4), %xmm0
movss %xmm0, 0x30(%rsp)
movl 0x97015(%rip), %edi     # 0xa72d8
callq 0x44152
movl %eax, %edi
movss 0x30(%rsp), %xmm0
callq 0x43e1c
cmpl $0x1000000, %eax        # imm = 0x1000000
jb 0x1030e
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
mulss (%rsp), %xmm0
divss 0x8(%rsp), %xmm0
addss 0x10(%rsp), %xmm0
cvttss2si %xmm0, %edi
movl 0x4(%rsp), %esi
movl $0x1, %edx
movl 0xc(%rsp), %ecx
movl %eax, %r8d
callq 0x31115
incl %r15d
cmpl %r15d, %r13d
jne 0x10289
testl %r12d, %r12d
js 0x103db
xorps %xmm0, %xmm0
cvtsi2ss %ebx, %xmm0
movss %xmm0, 0x8(%rsp)
cvttss2si 0x10(%rsp), %eax
movl %eax, 0x10(%rsp)
cvttss2si 0x40(%rsp), %eax
movl %eax, 0x4(%rsp)
incl %r12d
xorl %r15d, %r15d
leaq 0x57f27(%rip), %r13     # 0x68278
movl %r15d, %eax
xorl %edx, %edx
divl %ebx
xorl %ebp, %ebp
testl %edx, %edx
sete %r14b
cmpb $0x0, 0x96eee(%rip)     # 0xa7255
jne 0x1036e
callq 0x6a18
movb %r14b, %bpl
movss (%r13,%rbp,4), %xmm0
movss %xmm0, 0x30(%rsp)
movl 0x96f54(%rip), %edi     # 0xa72d8
callq 0x44152
movl %eax, %edi
movss 0x30(%rsp), %xmm0
callq 0x43e1c
cmpl $0x1000000, %eax        # imm = 0x1000000
jb 0x103cf
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
mulss (%rsp), %xmm0
divss 0x8(%rsp), %xmm0
addss 0x20(%rsp), %xmm0
cvttss2si %xmm0, %esi
movl 0x10(%rsp), %edi
movl 0x4(%rsp), %edx
movl $0x1, %ecx
movl %eax, %r8d
callq 0x31115
incl %r15d
cmpl %r15d, %r12d
jne 0x10351
movaps 0x50(%rsp), %xmm0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq