// File: /workspace/github_c_makefile_star2_O2/Cyan4973[P]FiniteStateEntropy/programs/../lib/fseU16.c
// Function: FSE_decompressU16_usingDTable
size_t FSE_decompressU16_usingDTable (U16* dst, size_t maxDstSize,
                               const void* cSrc, size_t cSrcSize,
                               const FSE_DTable* dt)
{
    U16* const ostart = dst;
    U16* op = ostart;
    U16* const oend = ostart + maxDstSize;
    BIT_DStream_t bitD;
    FSE_DState_t state;

    /* Init */
    memset(&bitD, 0, sizeof(bitD));
    BIT_initDStream(&bitD, cSrc, cSrcSize);
    FSE_initDState(&state, &bitD, dt);

    while((BIT_reloadDStream(&bitD) < BIT_DStream_completed) && (op<oend)) {
        *op++ = FSE_decodeSymbolU16(&state, &bitD);
    }

    if (!BIT_endOfDStream(&bitD)) return ERROR(corruption_detected);

    while (state.state && op<oend) {
        *op++ = FSE_decodeSymbolU16(&state, &bitD);
    }

    if (state.state) return ERROR(corruption_detected);

    return op-ostart;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
testq %rcx, %rcx
je 0x8d67
movq %rdx, 0x18(%rsp)
leaq 0x8(%rdx), %rax
movq %rax, 0x20(%rsp)
cmpq $0x8, %rcx
jb 0x8d7f
leaq (%rdx,%rcx), %rax
addq $-0x8, %rax
movq %rax, 0x10(%rsp)
movq (%rax), %rax
movq %rax, (%rsp)
movq %rax, %rcx
shrq $0x38, %rcx
je 0x8e01
bsrl %ecx, %edx
notl %edx
addl $0x9, %edx
jmp 0x8e03
andq $0x0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
xorl %edx, %edx
xorl %eax, %eax
jmp 0x8e03
movq %rdx, 0x10(%rsp)
movzbl (%rdx), %eax
movq %rax, (%rsp)
leaq -0x2(%rcx), %rdi
cmpq $0x5, %rdi
ja 0x8de8
leaq 0x82a4(%rip), %r8       # 0x11040
movslq (%r8,%rdi,4), %rdi
addq %r8, %rdi
jmpq *%rdi
movzbl 0x6(%rdx), %edi
shlq $0x30, %rdi
orq %rdi, %rax
movzbl 0x5(%rdx), %edi
shlq $0x28, %rdi
addq %rdi, %rax
movzbl 0x4(%rdx), %edi
shlq $0x20, %rdi
addq %rdi, %rax
movzbl 0x3(%rdx), %edi
shll $0x18, %edi
addq %rdi, %rax
movzbl 0x2(%rdx), %edi
shll $0x10, %edi
addq %rdi, %rax
movzbl 0x1(%rdx), %edi
shll $0x8, %edi
addq %rdi, %rax
movq %rax, (%rsp)
movzbl -0x1(%rdx,%rcx), %edx
testl %edx, %edx
je 0x8e01
bsrl %edx, %edx
xorl $0x1f, %edx
shll $0x3, %ecx
subl %ecx, %edx
addl $0x29, %edx
jmp 0x8e03
xorl %edx, %edx
movzwl (%r14), %edi
addl %edi, %edx
movl %edx, %ecx
negb %cl
shrq %cl, %rax
leaq (%rbx,%rsi,2), %r13
leaq 0x8245(%rip), %rcx      # 0x11060
andl (%rcx,%rdi,4), %eax
movq %rsp, %r15
movl %edx, 0x8(%r15)
leaq 0x28(%rsp), %r12
movq %rax, (%r12)
movq %r15, %rdi
callq 0x8ecf
addq $0x4, %r14
movq %r14, 0x8(%r12)
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x8ecf
cmpl $0x1, %eax
ja 0x8e6c
leaq (%rbx,%rbp), %r14
cmpq %r13, %r14
jae 0x8e6c
movq %r12, %rdi
movq %r15, %rsi
callq 0x8caa
movw %ax, (%r14)
addq $0x2, %rbp
jmp 0x8e41
movq 0x10(%rsp), %rcx
pushq $-0x4
popq %rax
cmpq 0x18(%rsp), %rcx
jne 0x8ec0
cmpl $0x40, 0x8(%rsp)
jne 0x8ec0
leaq 0x28(%rsp), %r15
movq %rsp, %r12
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x8eb2
leaq (%rbx,%rbp), %r14
cmpq %r13, %r14
jae 0x8eb2
movq %r15, %rdi
movq %r12, %rsi
callq 0x8caa
movw %ax, (%r14)
addq $0x2, %rbp
jmp 0x8e8a
testq %rax, %rax
pushq $-0x4
popq %rax
jne 0x8ec0
sarq %rbp
movq %rbp, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq