// File: /workspace/github_cpp_makefile_star2_O2/donfreiday[P]gb/./imgui/imgui_draw.cpp
// Function: ImFontAtlas::RenderCustomTexData(int, void*)
void ImFontAtlas::RenderCustomTexData(int pass, void* p_rects)
{
    // A work of art lies ahead! (. = white layer, X = black layer, others are blank)
    // The white texels on the top left are the ones we'll use everywhere in ImGui to render filled shapes.
    const int TEX_DATA_W = 90;
    const int TEX_DATA_H = 27;
    const char texture_data[TEX_DATA_W*TEX_DATA_H+1] =
    {
        "..-         -XXXXXXX-    X    -           X           -XXXXXXX          -          XXXXXXX"
        "..-         -X.....X-   X.X   -          X.X          -X.....X          -          X.....X"
        "---         -XXX.XXX-  X...X  -         X...X         -X....X           -           X....X"
        "X           -  X.X  - X.....X -        X.....X        -X...X            -            X...X"
        "XX          -  X.X  -X.......X-       X.......X       -X..X.X           -           X.X..X"
        "X.X         -  X.X  -XXXX.XXXX-       XXXX.XXXX       -X.X X.X          -          X.X X.X"
        "X..X        -  X.X  -   X.X   -          X.X          -XX   X.X         -         X.X   XX"
        "X...X       -  X.X  -   X.X   -    XX    X.X    XX    -      X.X        -        X.X      "
        "X....X      -  X.X  -   X.X   -   X.X    X.X    X.X   -       X.X       -       X.X       "
        "X.....X     -  X.X  -   X.X   -  X..X    X.X    X..X  -        X.X      -      X.X        "
        "X......X    -  X.X  -   X.X   - X...XXXXXX.XXXXXX...X -         X.X   XX-XX   X.X         "
        "X.......X   -  X.X  -   X.X   -X.....................X-          X.X X.X-X.X X.X          "
        "X........X  -  X.X  -   X.X   - X...XXXXXX.XXXXXX...X -           X.X..X-X..X.X           "
        "X.........X -XXX.XXX-   X.X   -  X..X    X.X    X..X  -            X...X-X...X            "
        "X..........X-X.....X-   X.X   -   X.X    X.X    X.X   -           X....X-X....X           "
        "X......XXXXX-XXXXXXX-   X.X   -    XX    X.X    XX    -          X.....X-X.....X          "
        "X...X..X    ---------   X.X   -          X.X          -          XXXXXXX-XXXXXXX          "
        "X..X X..X   -       -XXXX.XXXX-       XXXX.XXXX       ------------------------------------"
        "X.X  X..X   -       -X.......X-       X.......X       -    XX           XX    -           "
        "XX    X..X  -       - X.....X -        X.....X        -   X.X           X.X   -           "
        "      X..X          -  X...X  -         X...X         -  X..X           X..X  -           "
        "       XX           -   X.X   -          X.X          - X...XXXXXXXXXXXXX...X -           "
        "------------        -    X    -           X           -X.....................X-           "
        "                    ----------------------------------- X...XXXXXXXXXXXXX...X -           "
        "                                                      -  X..X           X..X  -           "
        "                                                      -   X.X           X.X   -           "
        "                                                      -    XX           XX    -           "
    };

    ImVector<stbrp_rect>& rects = *(ImVector<stbrp_rect>*)p_rects;
    if (pass == 0)
    {
        // Request rectangles
        stbrp_rect r;
        memset(&r, 0, sizeof(r));
        r.w = (TEX_DATA_W*2)+1;
        r.h = TEX_DATA_H+1;
        rects.push_back(r);
    }
    else if (pass == 1)
    {
        // Render/copy pixels
        const stbrp_rect& r = rects[0];
        for (int y = 0, n = 0; y < TEX_DATA_H; y++)
            for (int x = 0; x < TEX_DATA_W; x++, n++)
            {
                const int offset0 = (int)(r.x + x) + (int)(r.y + y) * TexWidth;
                const int offset1 = offset0 + 1 + TEX_DATA_W;
                TexPixelsAlpha8[offset0] = texture_data[n] == '.' ? 0xFF : 0x00;
                TexPixelsAlpha8[offset1] = texture_data[n] == 'X' ? 0xFF : 0x00;
            }
        const ImVec2 tex_uv_scale(1.0f / TexWidth, 1.0f / TexHeight);
        TexUvWhitePixel = ImVec2((r.x + 0.5f) * tex_uv_scale.x, (r.y + 0.5f) * tex_uv_scale.y);

        // Setup mouse cursors
        const ImVec2 cursor_datas[ImGuiMouseCursor_Count_][3] =
        {
            // Pos ........ Size ......... Offset ......
            { ImVec2(0,3),  ImVec2(12,19), ImVec2( 0, 0) }, // ImGuiMouseCursor_Arrow
            { ImVec2(13,0), ImVec2(7,16),  ImVec2( 4, 8) }, // ImGuiMouseCursor_TextInput
            { ImVec2(31,0), ImVec2(23,23), ImVec2(11,11) }, // ImGuiMouseCursor_Move
            { ImVec2(21,0), ImVec2( 9,23), ImVec2( 5,11) }, // ImGuiMouseCursor_ResizeNS
            { ImVec2(55,18),ImVec2(23, 9), ImVec2(11, 5) }, // ImGuiMouseCursor_ResizeEW
            { ImVec2(73,0), ImVec2(17,17), ImVec2( 9, 9) }, // ImGuiMouseCursor_ResizeNESW
            { ImVec2(55,0), ImVec2(17,17), ImVec2( 9, 9) }, // ImGuiMouseCursor_ResizeNWSE
        };

        for (int type = 0; type < ImGuiMouseCursor_Count_; type++)
        {
            ImGuiMouseCursorData& cursor_data = GImGui->MouseCursorData[type];
            ImVec2 pos = cursor_datas[type][0] + ImVec2((float)r.x, (float)r.y);
            const ImVec2 size = cursor_datas[type][1];
            cursor_data.Type = type;
            cursor_data.Size = size;
            cursor_data.HotOffset = cursor_datas[type][2];
            cursor_data.TexUvMin[0] = (pos) * tex_uv_scale;
            cursor_data.TexUvMax[0] = (pos + size) * tex_uv_scale;
            pos.x += TEX_DATA_W+1;
            cursor_data.TexUvMin[1] = (pos) * tex_uv_scale;
            cursor_data.TexUvMax[1] = (pos + size) * tex_uv_scale;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xb0, %rsp
cmpl $0x1, %esi
je 0x2dba3
testl %esi, %esi
jne 0x2db97
xorps %xmm0, %xmm0
leaq -0xc0(%rbp), %rsi
movaps %xmm0, (%rsi)
movl $0x1c00b5, 0x4(%rsi)    # imm = 0x1C00B5
movq %rdx, %rdi
callq 0x3051e
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rdi, %rbx
xorl %r14d, %r14d
movq %rdx, %rdi
xorl %esi, %esi
callq 0x30454
leaq 0x12c46(%rip), %rcx     # 0x40800
xorl %edx, %edx
cmpl $0x1b, %edx
je 0x2dc1f
movslq %r14d, %r14
xorl %esi, %esi
cmpl $0x5a, %esi
je 0x2dc18
movzwl 0x8(%rax), %edi
movzwl 0xa(%rax), %r8d
addl %edx, %r8d
imull 0x18(%rbx), %r8d
addl %esi, %edi
addl %r8d, %edi
leaq (%r14,%rsi), %r8
movb (%rcx,%r8), %r8b
cmpb $0x2e, %r8b
sete %r9b
negb %r9b
movq 0x8(%rbx), %r10
movslq %edi, %rdi
movb %r9b, (%r10,%rdi)
cmpb $0x58, %r8b
sete %r8b
negb %r8b
movq 0x8(%rbx), %r9
movb %r8b, 0x5b(%r9,%rdi)
incq %rsi
jmp 0x2dbc6
incl %edx
addq %rsi, %r14
jmp 0x2dbbc
cvtsi2ssl 0x18(%rbx), %xmm2
movss 0x8764(%rip), %xmm0     # 0x36390
movaps %xmm0, %xmm1
cvtsi2ssl 0x1c(%rbx), %xmm3
movzwl 0x8(%rax), %ecx
cvtsi2ss %ecx, %xmm4
divss %xmm2, %xmm1
divss %xmm3, %xmm0
movss 0x8784(%rip), %xmm2     # 0x363d0
addss %xmm2, %xmm4
movzwl 0xa(%rax), %ecx
cvtsi2ss %ecx, %xmm3
mulss %xmm1, %xmm4
addss %xmm2, %xmm3
mulss %xmm0, %xmm3
movss %xmm4, 0x24(%rbx)
movss %xmm3, 0x28(%rbx)
movaps 0xdd8b(%rip), %xmm2     # 0x3ba00
leaq -0xb0(%rbp), %rcx
movaps %xmm2, -0x10(%rcx)
movaps 0xdd89(%rip), %xmm2     # 0x3ba10
movaps %xmm2, (%rcx)
movaps 0xdd8f(%rip), %xmm2     # 0x3ba20
movaps %xmm2, 0x10(%rcx)
movaps 0xdd94(%rip), %xmm2     # 0x3ba30
movaps %xmm2, 0x20(%rcx)
movaps 0xdd99(%rip), %xmm2     # 0x3ba40
movaps %xmm2, 0x30(%rcx)
movaps 0xdd9e(%rip), %xmm2     # 0x3ba50
movaps %xmm2, 0x40(%rcx)
movaps 0xdda3(%rip), %xmm2     # 0x3ba60
movaps %xmm2, 0x50(%rcx)
movaps 0xdda8(%rip), %xmm2     # 0x3ba70
movaps %xmm2, 0x60(%rcx)
movaps 0xddad(%rip), %xmm2     # 0x3ba80
movaps %xmm2, 0x70(%rcx)
movaps 0xddb2(%rip), %xmm2     # 0x3ba90
movaps %xmm2, 0x80(%rcx)
movabsq $0x4110000041100000, %rdx # imm = 0x4110000041100000
movq %rdx, 0x90(%rcx)
xorl %edx, %edx
leaq 0x22781(%rip), %rsi     # 0x50480
movss 0xdce1(%rip), %xmm2     # 0x3b9e8
xorl %edi, %edi
cmpq $0x7, %rdi
je 0x2db97
movzwl 0x8(%rax), %r8d
cvtsi2ss %r8d, %xmm3
movzwl 0xa(%rax), %r8d
cvtsi2ss %r8d, %xmm5
movq (%rsi), %r8
addss -0x10(%rcx), %xmm3
addss -0xc(%rcx), %xmm5
movl -0x8(%rcx), %r9d
movl -0x4(%rcx), %r10d
movd %r9d, %xmm6
movd %r10d, %xmm4
movl %edi, 0x1944(%r8,%rdx)
movl %r9d, 0x1950(%r8,%rdx)
movl %r10d, 0x1954(%r8,%rdx)
movq (%rcx), %r9
movq %r9, 0x1948(%r8,%rdx)
movaps %xmm1, %xmm7
mulss %xmm3, %xmm7
movaps %xmm0, %xmm8
mulss %xmm5, %xmm8
unpcklps %xmm8, %xmm7            # xmm7 = xmm7[0],xmm8[0],xmm7[1],xmm8[1]
movaps %xmm3, %xmm9
addss %xmm2, %xmm9
movaps %xmm1, %xmm10
mulss %xmm9, %xmm10
unpcklps %xmm8, %xmm10           # xmm10 = xmm10[0],xmm8[0],xmm10[1],xmm8[1]
movlhps %xmm10, %xmm7           # xmm7 = xmm7[0],xmm10[0]
movups %xmm7, 0x1958(%r8,%rdx)
addss %xmm6, %xmm3
addss %xmm5, %xmm4
mulss %xmm1, %xmm3
mulss %xmm0, %xmm4
unpcklps %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
addss %xmm6, %xmm9
mulss %xmm1, %xmm9
unpcklps %xmm4, %xmm9            # xmm9 = xmm9[0],xmm4[0],xmm9[1],xmm4[1]
movlhps %xmm9, %xmm3            # xmm3 = xmm3[0],xmm9[0]
movups %xmm3, 0x1968(%r8,%rdx)
incq %rdi
addq $0x18, %rcx
addq $0x34, %rdx
jmp 0x2dd09