// File: /workspace/github_c_makefile_star2_O0/Cyan4973[P]FiniteStateEntropy/programs/../lib/huf_compress.c
// Function: HUF_compress4X_usingCTable_internal
static size_t
HUF_compress4X_usingCTable_internal(void* dst, size_t dstSize,
                              const void* src, size_t srcSize,
                              const HUF_CElt* CTable, int bmi2)
{
    size_t const segmentSize = (srcSize+3)/4;   /* first 3 segments */
    const BYTE* ip = (const BYTE*) src;
    const BYTE* const iend = ip + srcSize;
    BYTE* const ostart = (BYTE*) dst;
    BYTE* const oend = ostart + dstSize;
    BYTE* op = ostart;

    if (dstSize < 6 + 1 + 1 + 1 + 8) return 0;   /* minimum space to compress successfully */
    if (srcSize < 12) return 0;   /* no saving possible : too small input */
    op += 6;   /* jumpTable */

    assert(op <= oend);
    {   CHECK_V_F(cSize, HUF_compress1X_usingCTable_internal(op, (size_t)(oend-op), ip, segmentSize, CTable, bmi2) );
        if (cSize==0) return 0;
        assert(cSize <= 65535);
        MEM_writeLE16(ostart, (U16)cSize);
        op += cSize;
    }

    ip += segmentSize;
    assert(op <= oend);
    {   CHECK_V_F(cSize, HUF_compress1X_usingCTable_internal(op, (size_t)(oend-op), ip, segmentSize, CTable, bmi2) );
        if (cSize==0) return 0;
        assert(cSize <= 65535);
        MEM_writeLE16(ostart+2, (U16)cSize);
        op += cSize;
    }

    ip += segmentSize;
    assert(op <= oend);
    {   CHECK_V_F(cSize, HUF_compress1X_usingCTable_internal(op, (size_t)(oend-op), ip, segmentSize, CTable, bmi2) );
        if (cSize==0) return 0;
        assert(cSize <= 65535);
        MEM_writeLE16(ostart+4, (U16)cSize);
        op += cSize;
    }

    ip += segmentSize;
    assert(op <= oend);
    assert(ip <= iend);
    {   CHECK_V_F(cSize, HUF_compress1X_usingCTable_internal(op, (size_t)(oend-op), ip, (size_t)(iend-ip), CTable, bmi2) );
        if (cSize==0) return 0;
        op += cSize;
    }

    return (size_t)(op-ostart);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %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 -0x28(%rbp), %rax
addq $0x3, %rax
shrq $0x2, %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
cmpq $0x11, -0x18(%rbp)
jae 0x161f7
movq $0x0, -0x8(%rbp)
jmp 0x1641e
cmpq $0xc, -0x28(%rbp)
jae 0x1620b
movq $0x0, -0x8(%rbp)
jmp 0x1641e
movq -0x68(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x68(%rbp), %rax
subq %rax, %rsi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %r8
movl -0x34(%rbp), %r9d
callq 0x160d0
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0x151f0
cmpl $0x0, %eax
je 0x1625a
movq -0x70(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1641e
cmpq $0x0, -0x70(%rbp)
jne 0x1626e
movq $0x0, -0x8(%rbp)
jmp 0x1641e
movq -0x58(%rbp), %rdi
movq -0x70(%rbp), %rax
movzwl %ax, %esi
callq 0x177c0
movq -0x70(%rbp), %rax
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x40(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x68(%rbp), %rax
subq %rax, %rsi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %r8
movl -0x34(%rbp), %r9d
callq 0x160d0
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
callq 0x151f0
cmpl $0x0, %eax
je 0x162d9
movq -0x78(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1641e
cmpq $0x0, -0x78(%rbp)
jne 0x162ed
movq $0x0, -0x8(%rbp)
jmp 0x1641e
movq -0x58(%rbp), %rdi
addq $0x2, %rdi
movq -0x78(%rbp), %rax
movzwl %ax, %esi
callq 0x177c0
movq -0x78(%rbp), %rax
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x40(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x68(%rbp), %rax
subq %rax, %rsi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %r8
movl -0x34(%rbp), %r9d
callq 0x160d0
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rdi
callq 0x151f0
cmpl $0x0, %eax
je 0x1635c
movq -0x80(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1641e
cmpq $0x0, -0x80(%rbp)
jne 0x16370
movq $0x0, -0x8(%rbp)
jmp 0x1641e
movq -0x58(%rbp), %rdi
addq $0x4, %rdi
movq -0x80(%rbp), %rax
movzwl %ax, %esi
callq 0x177c0
movq -0x80(%rbp), %rax
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x40(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x68(%rbp), %rax
subq %rax, %rsi
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %rax
subq %rax, %rcx
movq -0x30(%rbp), %r8
movl -0x34(%rbp), %r9d
callq 0x160d0
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rdi
callq 0x151f0
cmpl $0x0, %eax
je 0x163ec
movq -0x88(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1641e
cmpq $0x0, -0x88(%rbp)
jne 0x16400
movq $0x0, -0x8(%rbp)
jmp 0x1641e
movq -0x88(%rbp), %rax
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq -0x58(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax,%rax)