// File: /workspace/github_c_makefile_star2_O0/Cyan4973[P]FiniteStateEntropy/programs/../lib/huf_decompress.c
// Function: HUF_fillDTableX2Level2
static void HUF_fillDTableX2Level2(HUF_DEltX2* DTable, U32 sizeLog, const U32 consumed,
                           const U32* rankValOrigin, const int minWeight,
                           const sortedSymbol_t* sortedSymbols, const U32 sortedListSize,
                           U32 nbBitsBaseline, U16 baseSeq)
{
    HUF_DEltX2 DElt;
    U32 rankVal[HUF_TABLELOG_MAX + 1];

    /* get pre-calculated rankVal */
    memcpy(rankVal, rankValOrigin, sizeof(rankVal));

    /* fill skipped values */
    if (minWeight>1) {
        U32 i, skipSize = rankVal[minWeight];
        MEM_writeLE16(&(DElt.sequence), baseSeq);
        DElt.nbBits   = (BYTE)(consumed);
        DElt.length   = 1;
        for (i = 0; i < skipSize; i++)
            DTable[i] = DElt;
    }

    /* fill DTable */
    {   U32 s; for (s=0; s<sortedListSize; s++) {   /* note : sortedSymbols already skipped */
            const U32 symbol = sortedSymbols[s].symbol;
            const U32 weight = sortedSymbols[s].weight;
            const U32 nbBits = nbBitsBaseline - weight;
            const U32 length = 1 << (sizeLog-nbBits);
            const U32 start = rankVal[weight];
            U32 i = start;
            const U32 end = start + length;

            MEM_writeLE16(&(DElt.sequence), (U16)(baseSeq + (symbol << 8)));
            DElt.nbBits = (BYTE)(nbBits + consumed);
            DElt.length = 2;
            do { DTable[i++] = DElt; } while (i<end);   /* since length >= 1 */

            rankVal[weight] += length;
    }   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movw 0x20(%rbp), %ax
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq %r9, -0x28(%rbp)
leaq -0x60(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x34, %edx
callq 0x1120
cmpl $0x1, -0x1c(%rbp)
jle 0x1eb8e
movslq -0x1c(%rbp), %rax
movl -0x60(%rbp,%rax,4), %eax
movl %eax, -0x68(%rbp)
leaq -0x2c(%rbp), %rdi
movzwl 0x20(%rbp), %esi
callq 0x1ec70
movl -0x10(%rbp), %eax
movb %al, -0x2a(%rbp)
movb $0x1, -0x29(%rbp)
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x68(%rbp), %eax
jae 0x1eb8c
movq -0x8(%rbp), %rax
movl -0x64(%rbp), %ecx
movl -0x2c(%rbp), %edx
movl %edx, (%rax,%rcx,4)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x1eb6c
jmp 0x1eb8e
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl 0x10(%rbp), %eax
jae 0x1ec62
movq -0x28(%rbp), %rax
movl -0x6c(%rbp), %ecx
movzbl (%rax,%rcx,2), %eax
movl %eax, -0x70(%rbp)
movq -0x28(%rbp), %rax
movl -0x6c(%rbp), %ecx
movzbl 0x1(%rax,%rcx,2), %eax
movl %eax, -0x74(%rbp)
movl 0x18(%rbp), %eax
subl -0x74(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0xc(%rbp), %ecx
subl -0x78(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x7c(%rbp)
movl -0x74(%rbp), %eax
movl -0x60(%rbp,%rax,4), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x84(%rbp)
movl -0x80(%rbp), %eax
addl -0x7c(%rbp), %eax
movl %eax, -0x88(%rbp)
leaq -0x2c(%rbp), %rdi
movzwl 0x20(%rbp), %eax
movl -0x70(%rbp), %ecx
shll $0x8, %ecx
addl %ecx, %eax
movzwl %ax, %esi
callq 0x1ec70
movl -0x78(%rbp), %eax
addl -0x10(%rbp), %eax
movb %al, -0x2a(%rbp)
movb $0x2, -0x29(%rbp)
movq -0x8(%rbp), %rax
movl -0x84(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x84(%rbp)
movl %ecx, %ecx
movl -0x2c(%rbp), %edx
movl %edx, (%rax,%rcx,4)
movl -0x84(%rbp), %eax
cmpl -0x88(%rbp), %eax
jb 0x1ec1b
movl -0x7c(%rbp), %ecx
movl -0x74(%rbp), %eax
addl -0x60(%rbp,%rax,4), %ecx
movl %ecx, -0x60(%rbp,%rax,4)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x1eb95
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax,%rax)