// File: 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
subq $0xb50, %rsp            # imm = 0xB50
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xaf0(%rbp)
movl $0x5a, -0x1c(%rbp)
movl $0x1b, -0x20(%rbp)
leaq -0x9a0(%rbp), %rdi
leaq 0x21363(%rip), %rsi     # 0x653e0
movl $0x97f, %edx            # imm = 0x97F
callq 0x7080
movq -0x18(%rbp), %rax
movq %rax, -0x9a8(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x440d5
leaq -0x9b8(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x7240
movw $0xb5, -0x9b4(%rbp)
movw $0x1c, -0x9b2(%rbp)
movq -0x9a8(%rbp), %rdi
leaq -0x9b8(%rbp), %rsi
callq 0x4cac0
jmp 0x44748
cmpl $0x1, -0xc(%rbp)
jne 0x44746
movq -0x9a8(%rbp), %rdi
xorl %esi, %esi
callq 0x4c970
movq %rax, -0x9c0(%rbp)
movl $0x0, -0x9c4(%rbp)
movl $0x0, -0x9c8(%rbp)
cmpl $0x1b, -0x9c4(%rbp)
jge 0x44206
movl $0x0, -0x9cc(%rbp)
cmpl $0x5a, -0x9cc(%rbp)
jge 0x441f0
movq -0xaf0(%rbp), %rax
movq -0x9c0(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
addl -0x9cc(%rbp), %ecx
movq -0x9c0(%rbp), %rdx
movzwl 0xa(%rdx), %edx
addl -0x9c4(%rbp), %edx
imull 0x18(%rax), %edx
addl %edx, %ecx
movl %ecx, -0x9d0(%rbp)
movl -0x9d0(%rbp), %ecx
addl $0x1, %ecx
addl $0x5a, %ecx
movl %ecx, -0x9d4(%rbp)
movslq -0x9c8(%rbp), %rcx
movsbl -0x9a0(%rbp,%rcx), %esi
xorl %ecx, %ecx
movl $0xff, %edx
cmpl $0x2e, %esi
cmovel %edx, %ecx
movb %cl, %sil
movq 0x8(%rax), %rcx
movslq -0x9d0(%rbp), %rdx
movb %sil, (%rcx,%rdx)
movslq -0x9c8(%rbp), %rcx
movsbl -0x9a0(%rbp,%rcx), %esi
xorl %ecx, %ecx
movl $0xff, %edx
cmpl $0x58, %esi
cmovel %edx, %ecx
movb %cl, %dl
movq 0x8(%rax), %rax
movslq -0x9d4(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x9cc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9cc(%rbp)
movl -0x9c8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c8(%rbp)
jmp 0x4411f
jmp 0x441f2
movl -0x9c4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c4(%rbp)
jmp 0x44108
movq -0xaf0(%rbp), %rax
cvtsi2ssl 0x18(%rax), %xmm1
movss 0x16dfe(%rip), %xmm0    # 0x5b018
divss %xmm1, %xmm0
cvtsi2ssl 0x1c(%rax), %xmm2
movss 0x16ded(%rip), %xmm1    # 0x5b018
divss %xmm2, %xmm1
leaq -0x9dc(%rbp), %rdi
callq 0x2d280
movq -0x9c0(%rbp), %rax
movzwl 0x8(%rax), %eax
cvtsi2ss %eax, %xmm0
movss 0x16dd2(%rip), %xmm1    # 0x5b024
addss %xmm1, %xmm0
mulss -0x9dc(%rbp), %xmm0
movq -0x9c0(%rbp), %rax
movzwl 0xa(%rax), %eax
cvtsi2ss %eax, %xmm1
movss 0x16daf(%rip), %xmm2    # 0x5b024
addss %xmm2, %xmm1
mulss -0x9d8(%rbp), %xmm1
leaq -0x9e4(%rbp), %rdi
callq 0x2d280
movq -0xaf0(%rbp), %rax
movq -0x9e4(%rbp), %rcx
movq %rcx, 0x24(%rax)
leaq -0xa90(%rbp), %rdi
xorps %xmm0, %xmm0
movss 0x16dc3(%rip), %xmm1    # 0x5b074
callq 0x2d280
leaq -0xa90(%rbp), %rdi
addq $0x8, %rdi
movss 0x1c303(%rip), %xmm0    # 0x605cc
movss 0x1c31f(%rip), %xmm1    # 0x605f0
callq 0x2d280
leaq -0xa90(%rbp), %rdi
addq $0x10, %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x2d280
leaq -0xa90(%rbp), %rdi
addq $0x18, %rdi
movq %rdi, -0xb20(%rbp)
movss 0x1c2ca(%rip), %xmm0    # 0x605d0
xorps %xmm1, %xmm1
callq 0x2d280
movq -0xb20(%rbp), %rdi
addq $0x8, %rdi
movss 0x192bb(%rip), %xmm0    # 0x5d5dc
movss 0x16d3f(%rip), %xmm1    # 0x5b068
callq 0x2d280
movq -0xb20(%rbp), %rdi
addq $0x10, %rdi
movss 0x16d17(%rip), %xmm0    # 0x5b058
movss 0x16d27(%rip), %xmm1    # 0x5b070
callq 0x2d280
leaq -0xa90(%rbp), %rdi
addq $0x30, %rdi
movq %rdi, -0xb18(%rbp)
movss 0x1c284(%rip), %xmm0    # 0x605ec
xorps %xmm1, %xmm1
callq 0x2d280
movq -0xb18(%rbp), %rdi
addq $0x8, %rdi
movss 0x1c261(%rip), %xmm1    # 0x605e4
movaps %xmm1, %xmm0
callq 0x2d280
movq -0xb18(%rbp), %rdi
addq $0x10, %rdi
movss 0x1c242(%rip), %xmm1    # 0x605e0
movaps %xmm1, %xmm0
callq 0x2d280
leaq -0xa90(%rbp), %rdi
addq $0x48, %rdi
movq %rdi, -0xb10(%rbp)
movss 0x1c228(%rip), %xmm0    # 0x605e8
xorps %xmm1, %xmm1
callq 0x2d280
movq -0xb10(%rbp), %rdi
addq $0x8, %rdi
movss 0x16c89(%rip), %xmm0    # 0x5b064
movss 0x1c201(%rip), %xmm1    # 0x605e4
callq 0x2d280
movq -0xb10(%rbp), %rdi
addq $0x10, %rdi
movss 0x16c85(%rip), %xmm0    # 0x5b080
movss 0x1c1dd(%rip), %xmm1    # 0x605e0
callq 0x2d280
leaq -0xa90(%rbp), %rdi
addq $0x60, %rdi
movq %rdi, -0xb08(%rbp)
movss 0x1c1b6(%rip), %xmm0    # 0x605d8
movss 0x1919e(%rip), %xmm1    # 0x5d5c8
callq 0x2d280
movq -0xb08(%rbp), %rdi
addq $0x8, %rdi
movss 0x1c1a2(%rip), %xmm0    # 0x605e4
movss 0x16c1a(%rip), %xmm1    # 0x5b064
callq 0x2d280
movq -0xb08(%rbp), %rdi
addq $0x10, %rdi
movss 0x1c17e(%rip), %xmm0    # 0x605e0
movss 0x16c16(%rip), %xmm1    # 0x5b080
callq 0x2d280
leaq -0xa90(%rbp), %rdi
addq $0x78, %rdi
movq %rdi, -0xb00(%rbp)
movss 0x1c153(%rip), %xmm0    # 0x605dc
xorps %xmm1, %xmm1
callq 0x2d280
movq -0xb00(%rbp), %rdi
addq $0x8, %rdi
movss 0x1c130(%rip), %xmm1    # 0x605d4
movaps %xmm1, %xmm0
callq 0x2d280
movq -0xb00(%rbp), %rdi
addq $0x10, %rdi
movss 0x16ba5(%rip), %xmm1    # 0x5b064
movaps %xmm1, %xmm0
callq 0x2d280
leaq -0xa90(%rbp), %rdi
addq $0x90, %rdi
movq %rdi, -0xaf8(%rbp)
movss 0x1c0f4(%rip), %xmm0    # 0x605d8
xorps %xmm1, %xmm1
callq 0x2d280
movq -0xaf8(%rbp), %rdi
addq $0x8, %rdi
movss 0x1c0d5(%rip), %xmm1    # 0x605d4
movaps %xmm1, %xmm0
callq 0x2d280
movq -0xaf8(%rbp), %rdi
addq $0x10, %rdi
movss 0x16b4a(%rip), %xmm1    # 0x5b064
movaps %xmm1, %xmm0
callq 0x2d280
movl $0x0, -0xa94(%rbp)
cmpl $0x7, -0xa94(%rbp)
jge 0x44744
leaq 0x34f80(%rip), %rax     # 0x794c0
movq (%rax), %rax
movslq -0xa94(%rbp), %rcx
imulq $0x34, %rcx, %rcx
leaq 0x1944(%rax,%rcx), %rax
movq %rax, -0xaa0(%rbp)
movslq -0xa94(%rbp), %rax
leaq (%rax,%rax,2), %rax
leaq -0xa90(%rbp,%rax,8), %rax
movq %rax, -0xb48(%rbp)
movq -0x9c0(%rbp), %rax
movzwl 0x8(%rax), %ecx
cvtsi2ss %ecx, %xmm0
movzwl 0xa(%rax), %eax
cvtsi2ss %eax, %xmm1
leaq -0xab0(%rbp), %rdi
movq %rdi, -0xb40(%rbp)
callq 0x2d280
movq -0xb48(%rbp), %rdi
movq -0xb40(%rbp), %rsi
callq 0x3f120
movlpd %xmm0, -0xaa8(%rbp)
movslq -0xa94(%rbp), %rax
leaq (%rax,%rax,2), %rax
movq -0xa88(%rbp,%rax,8), %rax
movq %rax, -0xab8(%rbp)
movl -0xa94(%rbp), %ecx
movq -0xaa0(%rbp), %rax
movl %ecx, (%rax)
movq -0xaa0(%rbp), %rax
movq -0xab8(%rbp), %rcx
movq %rcx, 0xc(%rax)
movslq -0xa94(%rbp), %rax
leaq (%rax,%rax,2), %rcx
movq -0xaa0(%rbp), %rax
movq -0xa80(%rbp,%rcx,8), %rcx
movq %rcx, 0x4(%rax)
leaq -0xaa8(%rbp), %rdi
movq %rdi, -0xb38(%rbp)
leaq -0x9dc(%rbp), %rsi
movq %rsi, -0xb28(%rbp)
callq 0x45920
movq -0xb38(%rbp), %rdi
movlpd %xmm0, -0xac0(%rbp)
movq -0xaa0(%rbp), %rax
movq -0xac0(%rbp), %rcx
movq %rcx, 0x14(%rax)
leaq -0xab8(%rbp), %rsi
movq %rsi, -0xb30(%rbp)
callq 0x3f120
movq -0xb28(%rbp), %rsi
movlpd %xmm0, -0xad0(%rbp)
leaq -0xad0(%rbp), %rdi
callq 0x45920
movq -0xb38(%rbp), %rdi
movq -0xb28(%rbp), %rsi
movlpd %xmm0, -0xac8(%rbp)
movq -0xaa0(%rbp), %rax
movq -0xac8(%rbp), %rcx
movq %rcx, 0x24(%rax)
movss -0xaa8(%rbp), %xmm0
movss 0x1bf37(%rip), %xmm1    # 0x605f4
addss %xmm1, %xmm0
movss %xmm0, -0xaa8(%rbp)
callq 0x45920
movq -0xb38(%rbp), %rdi
movq -0xb30(%rbp), %rsi
movlpd %xmm0, -0xad8(%rbp)
movq -0xaa0(%rbp), %rax
movq -0xad8(%rbp), %rcx
movq %rcx, 0x1c(%rax)
callq 0x3f120
movq -0xb28(%rbp), %rsi
movlpd %xmm0, -0xae8(%rbp)
leaq -0xae8(%rbp), %rdi
callq 0x45920
movlpd %xmm0, -0xae0(%rbp)
movq -0xaa0(%rbp), %rax
movq -0xae0(%rbp), %rcx
movq %rcx, 0x2c(%rax)
movl -0xa94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa94(%rbp)
jmp 0x4452c
jmp 0x44746
jmp 0x44748
addq $0xb50, %rsp            # imm = 0xB50
popq %rbp
retq
nopw %cs:(%rax,%rax)