// File: /workspace/github_c_makefile_star2_O0/arkanis[P]process-map/./deps/raygui.h
// Function: GuiTextSplit
static const char **GuiTextSplit(const char *text, int *count, int *textRow)
{
    // NOTE: Current implementation returns a copy of the provided string with '\0' (string end delimiter)
    // inserted between strings defined by "delimiter" parameter. No memory is dynamically allocated,
    // all used memory is static... it has some limitations:
    //      1. Maximum number of possible split strings is set by TEXTSPLIT_MAX_TEXT_ELEMENTS
    //      2. Maximum size of text to split is TEXTSPLIT_MAX_TEXT_LENGTH
    // NOTE: Those definitions could be externally provided if required

    #if !defined(TEXTSPLIT_MAX_TEXT_LENGTH)
        #define TEXTSPLIT_MAX_TEXT_LENGTH      1024
    #endif

    #if !defined(TEXTSPLIT_MAX_TEXT_ELEMENTS)
        #define TEXTSPLIT_MAX_TEXT_ELEMENTS     128
    #endif

    static const char *result[TEXTSPLIT_MAX_TEXT_ELEMENTS] = { NULL };
    static char buffer[TEXTSPLIT_MAX_TEXT_LENGTH] = { 0 };
    memset(buffer, 0, TEXTSPLIT_MAX_TEXT_LENGTH);

    result[0] = buffer;
    int counter = 1;

    if (textRow != NULL) textRow[0] = 0;

    // Count how many substrings we have on text and point to every one
    for (int i = 0; i < TEXTSPLIT_MAX_TEXT_LENGTH; i++)
    {
        buffer[i] = text[i];
        if (buffer[i] == '\0') break;
        else if ((buffer[i] == ';') || (buffer[i] == '\n'))
        {
            result[counter] = buffer + i + 1;

            if (textRow != NULL)
            {
                if (buffer[i] == '\n') textRow[counter] = textRow[counter - 1] + 1;
                else textRow[counter] = textRow[counter - 1];
            }

            buffer[i] = '\0';   // Set an end of string at this point

            counter++;
            if (counter == TEXTSPLIT_MAX_TEXT_ELEMENTS) break;
        }
    }

    *count = counter;

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq 0xc0055(%rip), %rdi     # 0xcab30
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x6060
leaq 0xc0042(%rip), %rax     # 0xcab30
movq %rax, 0xbfc3b(%rip)     # 0xca730
movl $0x1, -0x1c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xab0d
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, -0x20(%rbp)
cmpl $0x400, -0x20(%rbp)     # imm = 0x400
jge 0xac2f
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb (%rax,%rcx), %dl
movslq -0x20(%rbp), %rcx
leaq 0xbfff9(%rip), %rax     # 0xcab30
movb %dl, (%rax,%rcx)
movslq -0x20(%rbp), %rcx
leaq 0xbffeb(%rip), %rax     # 0xcab30
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0xab53
jmp 0xac2f
movslq -0x20(%rbp), %rcx
leaq 0xbffd2(%rip), %rax     # 0xcab30
movsbl (%rax,%rcx), %eax
cmpl $0x3b, %eax
je 0xab7f
movslq -0x20(%rbp), %rcx
leaq 0xbffbe(%rip), %rax     # 0xcab30
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
jne 0xac1d
movslq -0x20(%rbp), %rax
leaq 0xbffa6(%rip), %rdx     # 0xcab30
addq %rax, %rdx
addq $0x1, %rdx
movslq -0x1c(%rbp), %rcx
leaq 0xbfb94(%rip), %rax     # 0xca730
movq %rdx, (%rax,%rcx,8)
cmpq $0x0, -0x18(%rbp)
je 0xabf8
movslq -0x20(%rbp), %rcx
leaq 0xbff7e(%rip), %rax     # 0xcab30
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
jne 0xabdb
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0xabf6
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0xabf8
movslq -0x20(%rbp), %rcx
leaq 0xbff2d(%rip), %rax     # 0xcab30
movb $0x0, (%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x80, -0x1c(%rbp)
jne 0xac1b
jmp 0xac2f
jmp 0xac1d
jmp 0xac1f
jmp 0xac21
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xab14
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
leaq 0xbfaf1(%rip), %rax     # 0xca730
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)