// File: /workspace/github_cpp_makefile_star2_O3/Ciaxur[P]yagb-emu/include/imgui/imgui_tables.cpp
// Function: ImGui::TableMergeDrawChannels(ImGuiTable*)
void ImGui::TableMergeDrawChannels(ImGuiTable* table)
{
    ImGuiContext& g = *GImGui;
    ImDrawListSplitter* splitter = &table->DrawSplitter;
    const bool has_freeze_v = (table->FreezeRowsCount > 0);
    const bool has_freeze_h = (table->FreezeColumnsCount > 0);
    IM_ASSERT(splitter->_Current == 0);

    // Track which groups we are going to attempt to merge, and which channels goes into each group.
    struct MergeGroup
    {
        ImRect  ClipRect;
        int     ChannelsCount;
        ImBitArray<IMGUI_TABLE_MAX_DRAW_CHANNELS> ChannelsMask;
    };
    int merge_group_mask = 0x00;
    MergeGroup merge_groups[4];
    memset(merge_groups, 0, sizeof(merge_groups));

    // 1. Scan channels and take note of those which can be merged
    for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
    {
        if ((table->VisibleMaskByIndex & ((ImU64)1 << column_n)) == 0)
            continue;
        ImGuiTableColumn* column = &table->Columns[column_n];

        const int merge_group_sub_count = has_freeze_v ? 2 : 1;
        for (int merge_group_sub_n = 0; merge_group_sub_n < merge_group_sub_count; merge_group_sub_n++)
        {
            const int channel_no = (merge_group_sub_n == 0) ? column->DrawChannelFrozen : column->DrawChannelUnfrozen;

            // Don't attempt to merge if there are multiple draw calls within the column
            ImDrawChannel* src_channel = &splitter->_Channels[channel_no];
            if (src_channel->_CmdBuffer.Size > 0 && src_channel->_CmdBuffer.back().ElemCount == 0)
                src_channel->_CmdBuffer.pop_back();
            if (src_channel->_CmdBuffer.Size != 1)
                continue;

            // Find out the width of this merge group and check if it will fit in our column
            // (note that we assume that rendering didn't stray on the left direction. we should need a CursorMinPos to detect it)
            if (!(column->Flags & ImGuiTableColumnFlags_NoClip))
            {
                float content_max_x;
                if (!has_freeze_v)
                    content_max_x = ImMax(column->ContentMaxXUnfrozen, column->ContentMaxXHeadersUsed); // No row freeze
                else if (merge_group_sub_n == 0)
                    content_max_x = ImMax(column->ContentMaxXFrozen, column->ContentMaxXHeadersUsed);   // Row freeze: use width before freeze
                else
                    content_max_x = column->ContentMaxXUnfrozen;                                        // Row freeze: use width after freeze
                if (content_max_x > column->ClipRect.Max.x)
                    continue;
            }

            const int merge_group_n = (has_freeze_h && column_n < table->FreezeColumnsCount ? 0 : 1) + (has_freeze_v && merge_group_sub_n == 0 ? 0 : 2);
            IM_ASSERT(channel_no < IMGUI_TABLE_MAX_DRAW_CHANNELS);
            MergeGroup* merge_group = &merge_groups[merge_group_n];
            if (merge_group->ChannelsCount == 0)
                merge_group->ClipRect = ImRect(+FLT_MAX, +FLT_MAX, -FLT_MAX, -FLT_MAX);
            merge_group->ChannelsMask.SetBit(channel_no);
            merge_group->ChannelsCount++;
            merge_group->ClipRect.Add(src_channel->_CmdBuffer[0].ClipRect);
            merge_group_mask |= (1 << merge_group_n);
        }

        // Invalidate current draw channel
        // (we don't clear DrawChannelFrozen/DrawChannelUnfrozen solely to facilitate debugging/later inspection of data)
        column->DrawChannelCurrent = (ImGuiTableDrawChannelIdx)-1;
    }

    // [DEBUG] Display merge groups
#if 0
    if (g.IO.KeyShift)
        for (int merge_group_n = 0; merge_group_n < IM_ARRAYSIZE(merge_groups); merge_group_n++)
        {
            MergeGroup* merge_group = &merge_groups[merge_group_n];
            if (merge_group->ChannelsCount == 0)
                continue;
            char buf[32];
            ImFormatString(buf, 32, "MG%d:%d", merge_group_n, merge_group->ChannelsCount);
            ImVec2 text_pos = merge_group->ClipRect.Min + ImVec2(4, 4);
            ImVec2 text_size = CalcTextSize(buf, NULL);
            GetForegroundDrawList()->AddRectFilled(text_pos, text_pos + text_size, IM_COL32(0, 0, 0, 255));
            GetForegroundDrawList()->AddText(text_pos, IM_COL32(255, 255, 0, 255), buf, NULL);
            GetForegroundDrawList()->AddRect(merge_group->ClipRect.Min, merge_group->ClipRect.Max, IM_COL32(255, 255, 0, 255));
        }
#endif

    // 2. Rewrite channel list in our preferred order
    if (merge_group_mask != 0)
    {
        // We skip channel 0 (Bg0/Bg1) and 1 (Bg2 frozen) from the shuffling since they won't move - see channels allocation in TableSetupDrawChannels().
        const int LEADING_DRAW_CHANNELS = 2;
        g.DrawChannelsTempMergeBuffer.resize(splitter->_Count - LEADING_DRAW_CHANNELS); // Use shared temporary storage so the allocation gets amortized
        ImDrawChannel* dst_tmp = g.DrawChannelsTempMergeBuffer.Data;
        ImBitArray<IMGUI_TABLE_MAX_DRAW_CHANNELS> remaining_mask;                       // We need 132-bit of storage
        remaining_mask.ClearAllBits();
        remaining_mask.SetBitRange(LEADING_DRAW_CHANNELS, splitter->_Count);
        remaining_mask.ClearBit(table->Bg2DrawChannelUnfrozen);
        IM_ASSERT(has_freeze_v == false || table->Bg2DrawChannelUnfrozen != TABLE_DRAW_CHANNEL_BG2_FROZEN);
        int remaining_count = splitter->_Count - (has_freeze_v ? LEADING_DRAW_CHANNELS + 1 : LEADING_DRAW_CHANNELS);
        //ImRect host_rect = (table->InnerWindow == table->OuterWindow) ? table->InnerClipRect : table->HostClipRect;
        ImRect host_rect = table->HostClipRect;
        for (int merge_group_n = 0; merge_group_n < IM_ARRAYSIZE(merge_groups); merge_group_n++)
        {
            if (int merge_channels_count = merge_groups[merge_group_n].ChannelsCount)
            {
                MergeGroup* merge_group = &merge_groups[merge_group_n];
                ImRect merge_clip_rect = merge_group->ClipRect;

                // Extend outer-most clip limits to match those of host, so draw calls can be merged even if
                // outer-most columns have some outer padding offsetting them from their parent ClipRect.
                // The principal cases this is dealing with are:
                // - On a same-window table (not scrolling = single group), all fitting columns ClipRect -> will extend and match host ClipRect -> will merge
                // - Columns can use padding and have left-most ClipRect.Min.x and right-most ClipRect.Max.x != from host ClipRect -> will extend and match host ClipRect -> will merge
                // FIXME-TABLE FIXME-WORKRECT: We are wasting a merge opportunity on tables without scrolling if column doesn't fit
                // within host clip rect, solely because of the half-padding difference between window->WorkRect and window->InnerClipRect.
                if ((merge_group_n & 1) == 0 || !has_freeze_h)
                    merge_clip_rect.Min.x = ImMin(merge_clip_rect.Min.x, host_rect.Min.x);
                if ((merge_group_n & 2) == 0 || !has_freeze_v)
                    merge_clip_rect.Min.y = ImMin(merge_clip_rect.Min.y, host_rect.Min.y);
                if ((merge_group_n & 1) != 0)
                    merge_clip_rect.Max.x = ImMax(merge_clip_rect.Max.x, host_rect.Max.x);
                if ((merge_group_n & 2) != 0 && (table->Flags & ImGuiTableFlags_NoHostExtendY) == 0)
                    merge_clip_rect.Max.y = ImMax(merge_clip_rect.Max.y, host_rect.Max.y);
#if 0
                GetOverlayDrawList()->AddRect(merge_group->ClipRect.Min, merge_group->ClipRect.Max, IM_COL32(255, 0, 0, 200), 0.0f, ~0, 1.0f);
                GetOverlayDrawList()->AddLine(merge_group->ClipRect.Min, merge_clip_rect.Min, IM_COL32(255, 100, 0, 200));
                GetOverlayDrawList()->AddLine(merge_group->ClipRect.Max, merge_clip_rect.Max, IM_COL32(255, 100, 0, 200));
#endif
                remaining_count -= merge_group->ChannelsCount;
                for (int n = 0; n < IM_ARRAYSIZE(remaining_mask.Storage); n++)
                    remaining_mask.Storage[n] &= ~merge_group->ChannelsMask.Storage[n];
                for (int n = 0; n < splitter->_Count && merge_channels_count != 0; n++)
                {
                    // Copy + overwrite new clip rect
                    if (!merge_group->ChannelsMask.TestBit(n))
                        continue;
                    merge_group->ChannelsMask.ClearBit(n);
                    merge_channels_count--;

                    ImDrawChannel* channel = &splitter->_Channels[n];
                    IM_ASSERT(channel->_CmdBuffer.Size == 1 && merge_clip_rect.Contains(ImRect(channel->_CmdBuffer[0].ClipRect)));
                    channel->_CmdBuffer[0].ClipRect = merge_clip_rect.ToVec4();
                    memcpy(dst_tmp++, channel, sizeof(ImDrawChannel));
                }
            }

            // Make sure Bg2DrawChannelUnfrozen appears in the middle of our groups (whereas Bg0/Bg1 and Bg2 frozen are fixed to 0 and 1)
            if (merge_group_n == 1 && has_freeze_v)
                memcpy(dst_tmp++, &splitter->_Channels[table->Bg2DrawChannelUnfrozen], sizeof(ImDrawChannel));
        }

        // Append unmergeable channels that we didn't reorder at the end of the list
        for (int n = 0; n < splitter->_Count && remaining_count != 0; n++)
        {
            if (!remaining_mask.TestBit(n))
                continue;
            ImDrawChannel* channel = &splitter->_Channels[n];
            memcpy(dst_tmp++, channel, sizeof(ImDrawChannel));
            remaining_count--;
        }
        IM_ASSERT(dst_tmp == g.DrawChannelsTempMergeBuffer.Data + g.DrawChannelsTempMergeBuffer.Size);
        memcpy(splitter->_Channels.Data + LEADING_DRAW_CHANNELS, g.DrawChannelsTempMergeBuffer.Data, (splitter->_Count - LEADING_DRAW_CHANNELS) * sizeof(ImDrawChannel));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
cmpl $0x0, 0x1e8(%rdi)
jne 0x8af27
movq %rdi, %r13
leaq 0x71552(%rip), %rax     # 0xfbcd0
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movb 0x241(%rdi), %r12b
movb 0x243(%rdi), %al
movb %al, -0x2a(%rbp)
leaq -0x1a0(%rbp), %rdi
movq $0x0, -0x38(%rbp)
movl $0xa0, %edx
xorl %esi, %esi
callq 0xc260
movl 0x6c(%r13), %eax
testl %eax, %eax
jle 0x8ae82
xorl %edx, %edx
movb %r12b, -0x29(%rbp)
movq 0x50(%r13), %rcx
btq %rdx, %rcx
jae 0x8a982
movq %rdx, -0x80(%rbp)
imulq $0x68, %rdx, %rdi
addq 0x10(%r13), %rdi
cmpq 0x18(%r13), %rdi
jae 0x8af08
movb $0x1, %r15b
movq %rdi, -0x40(%rbp)
movzbl %r15b, %eax
andl $0x1, %eax
xorq $0x59, %rax
movzbl (%rdi,%rax), %esi
cmpl %esi, 0x1f0(%r13)
jle 0x8ae94
movq 0x1f8(%r13), %r14
movl %esi, %ecx
shll $0x5, %ecx
movslq (%r14,%rcx), %rax
testq %rax, %rax
jle 0x8a961
addq %rcx, %r14
movq 0x8(%r14), %rcx
imulq $0x38, %rax, %rdx
cmpl $0x0, -0x18(%rcx,%rdx)
jne 0x8a839
decl %eax
movl %eax, (%r14)
cmpl $0x1, %eax
jne 0x8a961
testb $-0x80, (%rdi)
jne 0x8a885
testb %r12b, %r12b
jle 0x8a859
testb $0x1, %r15b
je 0x8a876
movss 0x40(%rdi), %xmm1
jmp 0x8a85e
movss 0x44(%rdi), %xmm1
movss 0x48(%rdi), %xmm2
movaps %xmm2, %xmm0
cmpless %xmm1, %xmm0
andps %xmm0, %xmm1
andnps %xmm2, %xmm0
orps %xmm1, %xmm0
jmp 0x8a87b
movss 0x44(%rdi), %xmm0
ucomiss 0x28(%rdi), %xmm0
ja 0x8a961
cmpb $0x0, -0x2a(%rbp)
jle 0x8a8a0
movsbq 0x243(%r13), %rax
xorl %r12d, %r12d
cmpq %rax, -0x80(%rbp)
setge %r12b
jmp 0x8a8a6
movl $0x1, %r12d
movl %r15d, %eax
notb %al
movzbl %al, %eax
andl $0x1, %eax
addl %eax, %eax
cmpb $0x0, -0x29(%rbp)
movl $0x2, %ecx
cmovlel %ecx, %eax
cmpb $-0x7c, %sil
jae 0x8aed2
orl %eax, %r12d
movl %r12d, %eax
leaq (%rax,%rax,4), %rax
leaq -0x1a0(,%rax,8), %rbx
addq %rbp, %rbx
cmpl $0x0, 0x10(%rbx)
jne 0x8a8ee
movaps 0x44545(%rip), %xmm0    # 0xcee30
movups %xmm0, (%rbx)
leaq 0x14(%rbx), %rdi
callq 0x8fa84
incl 0x10(%rbx)
cmpl $0x0, (%r14)
jle 0x8aef1
movq 0x8(%r14), %rax
movss (%rax), %xmm3
movss 0x4(%rax), %xmm2
movss 0x8(%rax), %xmm1
movss 0xc(%rax), %xmm0
movss (%rbx), %xmm4
ucomiss %xmm3, %xmm4
jbe 0x8a928
movss %xmm3, (%rbx)
movss 0x4(%rbx), %xmm3
ucomiss %xmm2, %xmm3
movq -0x40(%rbp), %rdi
jbe 0x8a93b
movss %xmm2, 0x4(%rbx)
ucomiss 0x8(%rbx), %xmm1
jbe 0x8a946
movss %xmm1, 0x8(%rbx)
ucomiss 0xc(%rbx), %xmm0
jbe 0x8a951
movss %xmm0, 0xc(%rbx)
movq -0x38(%rbp), %rax
btsl %r12d, %eax
movq %rax, -0x38(%rbp)
movb -0x29(%rbp), %r12b
testb %r12b, %r12b
setg %al
testb %r15b, %al
movl $0x0, %r15d
jne 0x8a7ed
movb $-0x1, 0x57(%rdi)
movl 0x6c(%r13), %eax
movq -0x80(%rbp), %rdx
incq %rdx
movslq %eax, %rcx
cmpq %rcx, %rdx
jl 0x8a7c2
cmpl $0x0, -0x38(%rbp)
je 0x8ae82
movl 0x1ec(%r13), %edx
leal -0x2(%rdx), %r14d
movq -0x48(%rbp), %rcx
movl 0x20fc(%rcx), %eax
cmpl %r14d, %eax
jge 0x8a9c9
movq %r13, %r15
testl %eax, %eax
je 0x8a9d9
movl %eax, %ebx
shrl $0x1f, %ebx
addl %eax, %ebx
sarl %ebx
addl %eax, %ebx
jmp 0x8a9de
movq 0x2100(%rcx), %rax
movq %rax, -0x38(%rbp)
movq %rcx, %rax
jmp 0x8aa46
movl $0x8, %ebx
cmpl %r14d, %ebx
cmovlel %r14d, %ebx
movslq %ebx, %rdi
shlq $0x5, %rdi
callq 0x41c63
movq %rax, %r13
movq -0x48(%rbp), %rax
movq 0x2100(%rax), %rsi
testq %rsi, %rsi
je 0x8aa2b
movslq 0x20f8(%rax), %rdx
shlq $0x5, %rdx
movq %r13, %rdi
callq 0xc080
movq -0x48(%rbp), %rax
movq 0x2100(%rax), %rdi
callq 0x41d3c
movq -0x48(%rbp), %rax
movq %r13, -0x38(%rbp)
movq %r13, 0x2100(%rax)
movl %ebx, 0x20fc(%rax)
movq %r15, %r13
movl 0x1ec(%r15), %edx
movl %r14d, 0x20f8(%rax)
xorps %xmm0, %xmm0
leaq -0xa0(%rbp), %r15
movaps %xmm0, (%r15)
movl $0x0, 0x10(%r15)
movq %r15, %rdi
movl $0x2, %esi
callq 0x8fac2
movzbl 0x247(%r13), %esi
movq %r15, %rdi
callq 0x8fb18
testb %r12b, %r12b
jle 0x8aaba
movl $0xfffffffd, %edx       # imm = 0xFFFFFFFD
cmpb $0x1, 0x247(%r13)
movq -0x38(%rbp), %r15
movq %r13, %r10
jne 0x8aac6
leaq 0x450aa(%rip), %rdi     # 0xcfb4c
leaq 0x443e1(%rip), %rsi     # 0xcee8a
leaq 0x45051(%rip), %rcx     # 0xcfb01
movl $0x909, %edx            # imm = 0x909
callq 0xc140
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
movq -0x38(%rbp), %r15
movq %r13, %r10
addl 0x1ec(%r10), %edx
movss 0x15c(%r10), %xmm0
movss %xmm0, -0x54(%rbp)
movss 0x160(%r10), %xmm0
movss %xmm0, -0x50(%rbp)
movss 0x164(%r10), %xmm0
movaps %xmm0, -0xc0(%rbp)
movss 0x168(%r10), %xmm0
movaps %xmm0, -0xb0(%rbp)
leaq -0x18c(%rbp), %rsi
xorl %r8d, %r8d
movq %r10, -0x40(%rbp)
leaq (%r8,%r8,4), %rax
movl -0x190(%rbp,%rax,8), %ebx
testl %ebx, %ebx
je 0x8ad61
leaq -0x1a0(,%rax,8), %rdi
addq %rbp, %rdi
cmpb $0x0, -0x2a(%rbp)
setle %al
movups (%rdi), %xmm1
testb $0x1, %r8b
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x8ab59
movaps %xmm1, %xmm0
minss -0x54(%rbp), %xmm0
movss %xmm0, %xmm1            # xmm1 = xmm0[0],xmm1[1,2,3]
testb %r12b, %r12b
setg %al
cmpq $0x2, %r8
setae %cl
testb %al, %cl
jne 0x8ab80
movaps %xmm1, %xmm0
shufps $0x55, %xmm1, %xmm0     # xmm0 = xmm0[1,1],xmm1[1,1]
minss -0x50(%rbp), %xmm0
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
movaps %xmm0, %xmm1
testb $0x1, %r8b
je 0x8abb3
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
movaps -0xc0(%rbp), %xmm2
movaps %xmm1, %xmm3
movaps %xmm2, %xmm1
cmpless %xmm0, %xmm1
andps %xmm1, %xmm0
andnps %xmm2, %xmm1
orps %xmm0, %xmm1
shufps $0x30, %xmm3, %xmm1     # xmm1 = xmm1[0,0],xmm3[3,0]
shufps $0x84, %xmm1, %xmm3     # xmm3 = xmm3[0,1],xmm1[0,2]
movaps %xmm3, %xmm1
cmpq $0x2, %r8
jb 0x8abed
testb $0x2, 0x6(%r10)
jne 0x8abed
movaps %xmm1, %xmm0
shufps $0xff, %xmm1, %xmm0     # xmm0 = xmm0[3,3],xmm1[3,3]
movaps -0xb0(%rbp), %xmm2
movaps %xmm1, %xmm3
movaps %xmm2, %xmm1
cmpless %xmm0, %xmm1
andps %xmm1, %xmm0
andnps %xmm2, %xmm1
orps %xmm0, %xmm1
shufps $0xe4, %xmm3, %xmm1     # xmm1 = xmm1[0,1],xmm3[2,3]
shufps $0x24, %xmm1, %xmm3     # xmm3 = xmm3[0,1],xmm1[2,0]
movaps %xmm3, %xmm1
addq $0x14, %rdi
xorl %eax, %eax
movl (%rsi,%rax,4), %ecx
notl %ecx
andl %ecx, -0xa0(%rbp,%rax,4)
incq %rax
cmpq $0x5, %rax
jne 0x8abf3
subl %ebx, %edx
cmpl $0x0, 0x1ec(%r10)
jle 0x8ad5d
movq %r8, -0x60(%rbp)
movq %rsi, -0x68(%rbp)
movl %edx, -0x4c(%rbp)
movq %r15, -0x38(%rbp)
movaps %xmm1, %xmm0
shufps $0x55, %xmm1, %xmm0     # xmm0 = xmm0[1,1],xmm1[1,1]
movaps %xmm0, -0x100(%rbp)
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
movaps %xmm1, %xmm2
shufps $0xff, %xmm1, %xmm2     # xmm2 = xmm2[3,3],xmm1[3,3]
movaps %xmm2, -0xe0(%rbp)
movaps %xmm1, -0x80(%rbp)
movaps %xmm0, -0xf0(%rbp)
movlhps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movaps %xmm1, -0xd0(%rbp)
xorl %r14d, %r14d
xorl %r12d, %r12d
movl %r12d, %esi
movq %rdi, %r15
callq 0x8fb56
testb %al, %al
je 0x8ad26
movq %r15, %r13
movq %r15, %rdi
movl %r12d, %esi
callq 0x8fb18
movq -0x40(%rbp), %r10
movslq 0x1f0(%r10), %rax
cmpq %rax, %r12
jge 0x8ae94
movq 0x1f8(%r10), %rax
cmpl $0x1, (%rax,%r14)
movaps -0x80(%rbp), %xmm1
jne 0x8aeb3
movq 0x8(%rax,%r14), %rcx
movss (%rcx), %xmm0
ucomiss %xmm1, %xmm0
jb 0x8aeb3
movss 0x4(%rcx), %xmm0
ucomiss -0x100(%rbp), %xmm0
jb 0x8aeb3
movaps -0xf0(%rbp), %xmm0
ucomiss 0x8(%rcx), %xmm0
jb 0x8aeb3
movaps -0xe0(%rbp), %xmm0
ucomiss 0xc(%rcx), %xmm0
jb 0x8aeb3
decl %ebx
addq %r14, %rax
movaps -0xd0(%rbp), %xmm0
movups %xmm0, (%rcx)
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movq -0x38(%rbp), %r15
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
leaq 0x20(%r15), %rax
movq %rax, -0x38(%rbp)
movq %r13, %rdi
jmp 0x8ad2d
movq %r15, %rdi
movq -0x40(%rbp), %r10
incq %r12
movslq 0x1ec(%r10), %rax
cmpq %rax, %r12
jge 0x8ad48
addq $0x20, %r14
testl %ebx, %ebx
jne 0x8ac65
movb -0x29(%rbp), %r12b
movq -0x38(%rbp), %r15
movl -0x4c(%rbp), %edx
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %r8
jmp 0x8ad61
movb -0x29(%rbp), %r12b
testb %r12b, %r12b
setg %al
cmpq $0x1, %r8
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x8adaa
movzbl 0x247(%r10), %eax
cmpl %eax, 0x1f0(%r10)
jle 0x8ae94
movq 0x1f8(%r10), %rcx
shll $0x5, %eax
movups (%rcx,%rax), %xmm0
movups 0x10(%rcx,%rax), %xmm1
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
addq $0x20, %r15
incq %r8
addq $0x28, %rsi
cmpq $0x4, %r8
jne 0x8ab17
movq %r15, %r13
movl 0x1ec(%r10), %eax
testl %eax, %eax
jle 0x8ae45
testl %edx, %edx
je 0x8ae45
xorl %r14d, %r14d
leaq -0xa0(%rbp), %rbx
xorl %r12d, %r12d
movl %edx, %r15d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x8fb56
testb %al, %al
je 0x8ae27
movq -0x40(%rbp), %r10
movslq 0x1f0(%r10), %rax
cmpq %rax, %r12
jge 0x8ae94
movl %r15d, %edx
movq 0x1f8(%r10), %rax
movups (%rax,%r14), %xmm0
movups 0x10(%rax,%r14), %xmm1
movups %xmm1, 0x10(%r13)
movups %xmm0, (%r13)
addq $0x20, %r13
decl %edx
jmp 0x8ae2e
movl %r15d, %edx
movq -0x40(%rbp), %r10
incq %r12
movslq 0x1ec(%r10), %rax
cmpq %rax, %r12
jge 0x8ae45
addq $0x20, %r14
testl %edx, %edx
jne 0x8adda
movq -0x48(%rbp), %rcx
movq 0x2100(%rcx), %rsi
movslq 0x20f8(%rcx), %rcx
shlq $0x5, %rcx
addq %rsi, %rcx
cmpq %rcx, %r13
jne 0x8af46
movq 0x1f8(%r10), %rdi
addq $0x40, %rdi
movslq %eax, %rdx
shlq $0x5, %rdx
addq $-0x40, %rdx
callq 0xc080
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2e7dd(%rip), %rdi     # 0xb9678
leaq 0x2e7e9(%rip), %rsi     # 0xb968b
leaq 0x43c72(%rip), %rcx     # 0xceb1b
movl $0x65c, %edx            # imm = 0x65C
callq 0xc140
leaq 0x44cea(%rip), %rdi     # 0xcfba4
leaq 0x43fc9(%rip), %rsi     # 0xcee8a
leaq 0x44c39(%rip), %rcx     # 0xcfb01
movl $0x934, %edx            # imm = 0x934
callq 0xc140
leaq 0x44c59(%rip), %rdi     # 0xcfb32
leaq 0x43faa(%rip), %rsi     # 0xcee8a
leaq 0x44c1a(%rip), %rcx     # 0xcfb01
movl $0x8dd, %edx            # imm = 0x8DD
callq 0xc140
leaq 0x2e780(%rip), %rdi     # 0xb9678
leaq 0x2e78c(%rip), %rsi     # 0xb968b
leaq 0x43c55(%rip), %rcx     # 0xceb5b
jmp 0x8aea9
leaq 0x2f7a9(%rip), %rdi     # 0xba6b8
leaq 0x2e729(%rip), %rsi     # 0xb963f
leaq 0x2f7b4(%rip), %rcx     # 0xba6d1
movl $0x20e, %edx            # imm = 0x20E
callq 0xc140
leaq 0x44bbb(%rip), %rdi     # 0xcfae9
leaq 0x43f55(%rip), %rsi     # 0xcee8a
leaq 0x44bc5(%rip), %rcx     # 0xcfb01
movl $0x8ad, %edx            # imm = 0x8AD
callq 0xc140
leaq 0x44cba(%rip), %rdi     # 0xcfc07
leaq 0x43f36(%rip), %rsi     # 0xcee8a
leaq 0x44ba6(%rip), %rcx     # 0xcfb01
movl $0x948, %edx            # imm = 0x948
callq 0xc140