// File: /workspace/github_c_makefile_star2_O0/Cyan4973[P]FiniteStateEntropy/programs/../lib/fse_compress.c
// Function: FSE_compress_usingCTable_generic
static size_t FSE_compress_usingCTable_generic (void* dst, size_t dstSize,
                           const void* src, size_t srcSize,
                           const FSE_CTable* ct, const unsigned fast)
{
    const BYTE* const istart = (const BYTE*) src;
    const BYTE* const iend = istart + srcSize;
    const BYTE* ip=iend;

    BIT_CStream_t bitC;
    FSE_CState_t CState1, CState2;

    /* init */
    if (srcSize <= 2) return 0;
    { size_t const initError = BIT_initCStream(&bitC, dst, dstSize);
      if (FSE_isError(initError)) return 0; /* not enough space available to write a bitstream */ }

#define FSE_FLUSHBITS(s)  (fast ? BIT_flushBitsFast(s) : BIT_flushBits(s))

    if (srcSize & 1) {
        FSE_initCState2(&CState1, ct, *--ip);
        FSE_initCState2(&CState2, ct, *--ip);
        FSE_encodeSymbol(&bitC, &CState1, *--ip);
        FSE_FLUSHBITS(&bitC);
    } else {
        FSE_initCState2(&CState2, ct, *--ip);
        FSE_initCState2(&CState1, ct, *--ip);
    }

    /* join to mod 4 */
    srcSize -= 2;
    if ((sizeof(bitC.bitContainer)*8 > FSE_MAX_TABLELOG*4+7 ) && (srcSize & 2)) {  /* test bit 2 */
        FSE_encodeSymbol(&bitC, &CState2, *--ip);
        FSE_encodeSymbol(&bitC, &CState1, *--ip);
        FSE_FLUSHBITS(&bitC);
    }

    /* 2 or 4 encoding per loop */
    while ( ip>istart ) {

        FSE_encodeSymbol(&bitC, &CState2, *--ip);

        if (sizeof(bitC.bitContainer)*8 < FSE_MAX_TABLELOG*2+7 )   /* this test must be static */
            FSE_FLUSHBITS(&bitC);

        FSE_encodeSymbol(&bitC, &CState1, *--ip);

        if (sizeof(bitC.bitContainer)*8 > FSE_MAX_TABLELOG*4+7 ) {  /* this test must be static */
            FSE_encodeSymbol(&bitC, &CState2, *--ip);
            FSE_encodeSymbol(&bitC, &CState1, *--ip);
        }

        FSE_FLUSHBITS(&bitC);
    }

    FSE_flushCState(&bitC, &CState2);
    FSE_flushCState(&bitC, &CState1);
    return BIT_closeCStream(&bitC);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x2, -0x28(%rbp)
ja 0x12203
movq $0x0, -0x8(%rbp)
jmp 0x1247a
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x78(%rbp), %rdi
callq 0x12920
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rdi
callq 0x11f40
cmpl $0x0, %eax
je 0x12239
movq $0x0, -0x8(%rbp)
jmp 0x1247a
movq -0x28(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x122d0
movq -0x30(%rbp), %rsi
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x50(%rbp)
movzbl -0x1(%rax), %edx
leaq -0x98(%rbp), %rdi
callq 0x129a0
movq -0x30(%rbp), %rsi
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x50(%rbp)
movzbl -0x1(%rax), %edx
leaq -0xb8(%rbp), %rdi
callq 0x129a0
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x50(%rbp)
movzbl -0x1(%rax), %edx
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x12a30
cmpl $0x0, -0x34(%rbp)
je 0x122c5
leaq -0x78(%rbp), %rdi
callq 0x12ac0
jmp 0x122ce
leaq -0x78(%rbp), %rdi
callq 0x12b30
jmp 0x12316
movq -0x30(%rbp), %rsi
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x50(%rbp)
movzbl -0x1(%rax), %edx
leaq -0xb8(%rbp), %rdi
callq 0x129a0
movq -0x30(%rbp), %rsi
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x50(%rbp)
movzbl -0x1(%rax), %edx
leaq -0x98(%rbp), %rdi
callq 0x129a0
movq -0x28(%rbp), %rax
subq $0x2, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
andq $0x2, %rax
cmpq $0x0, %rax
je 0x12392
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x50(%rbp)
movzbl -0x1(%rax), %edx
leaq -0x78(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x12a30
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x50(%rbp)
movzbl -0x1(%rax), %edx
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x12a30
cmpl $0x0, -0x34(%rbp)
je 0x12387
leaq -0x78(%rbp), %rdi
callq 0x12ac0
jmp 0x12390
leaq -0x78(%rbp), %rdi
callq 0x12b30
jmp 0x12392
jmp 0x12394
movq -0x50(%rbp), %rax
cmpq -0x40(%rbp), %rax
jbe 0x1244d
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x50(%rbp)
movzbl -0x1(%rax), %edx
leaq -0x78(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x12a30
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x50(%rbp)
movzbl -0x1(%rax), %edx
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x12a30
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x50(%rbp)
movzbl -0x1(%rax), %edx
leaq -0x78(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x12a30
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x50(%rbp)
movzbl -0x1(%rax), %edx
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x12a30
cmpl $0x0, -0x34(%rbp)
je 0x1243f
leaq -0x78(%rbp), %rdi
callq 0x12ac0
jmp 0x12448
leaq -0x78(%rbp), %rdi
callq 0x12b30
jmp 0x12394
leaq -0x78(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x12bc0
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x12bc0
leaq -0x78(%rbp), %rdi
callq 0x12c00
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)