// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
cmpq $0x11, %rsi
setb %al
cmpq $0xc, %rcx
setb %cl
orb %al, %cl
je 0xadf4
xorl %r14d, %r14d
jmp 0xaf68
movq %rsi, %r13
movq %rdi, %r12
leaq 0x3(%rbx), %rbp
shrq $0x2, %rbp
leaq 0x6(%rdi), %r15
addq $-0x6, %rsi
movq %r15, %rdi
movq %rdx, 0x20(%rsp)
movq %rbp, %rcx
movq %r8, 0x8(%rsp)
movl %r9d, 0x4(%rsp)
callq 0xac1c
movq %rax, %r14
cmpq $-0x9, %rax
ja 0xae3e
testq %r14, %r14
je 0xae42
movw %r14w, (%r12)
addq %r14, %r15
movb $0x1, %al
jmp 0xae47
xorl %eax, %eax
jmp 0xae47
xorl %eax, %eax
xorl %r14d, %r14d
testb %al, %al
je 0xaf68
movq %r12, 0x10(%rsp)
addq %r12, %r13
movq 0x20(%rsp), %rax
leaq (%rax,%rbp), %rdx
movq %r13, %rsi
subq %r15, %rsi
movq %r15, %rdi
movq %rdx, 0x18(%rsp)
movq %rbp, %rcx
movq 0x8(%rsp), %r8
movl 0x4(%rsp), %r9d
callq 0xac1c
movq %rax, %r12
cmpq $-0x9, %rax
ja 0xaea2
testq %r12, %r12
je 0xaea6
movq 0x10(%rsp), %rax
movw %r12w, 0x2(%rax)
addq %r12, %r15
movb $0x1, %al
movq %r14, %r12
jmp 0xaeab
xorl %eax, %eax
jmp 0xaeab
xorl %eax, %eax
xorl %r12d, %r12d
movl 0x4(%rsp), %r9d
movq 0x8(%rsp), %r8
testb %al, %al
je 0xaef9
movq 0x18(%rsp), %rdx
addq %rbp, %rdx
movq %r13, %rsi
subq %r15, %rsi
movq %r15, %rdi
movq %rdx, 0x18(%rsp)
movq %rbp, %rcx
callq 0xac1c
movq %rax, %r14
cmpq $-0x9, %rax
ja 0xaefe
testq %r14, %r14
je 0xaf02
movq 0x10(%rsp), %rax
movw %r14w, 0x4(%rax)
addq %r14, %r15
movb $0x1, %al
movq %r12, %r14
jmp 0xaf07
movq %r12, %r14
jmp 0xaf68
xorl %eax, %eax
jmp 0xaf07
xorl %eax, %eax
xorl %r14d, %r14d
testb %al, %al
je 0xaf68
movq 0x20(%rsp), %rcx
addq %rbx, %rcx
movq 0x18(%rsp), %rdx
addq %rbp, %rdx
subq %r15, %r13
subq %rdx, %rcx
movq %r15, %rdi
movq %r13, %rsi
movq 0x8(%rsp), %r8
movl 0x4(%rsp), %r9d
callq 0xac1c
cmpq $-0x9, %rax
ja 0xaf4d
testq %rax, %rax
movq 0x10(%rsp), %rdx
je 0xaf59
addq %rax, %r15
movb $0x1, %cl
jmp 0xaf5e
xorl %ecx, %ecx
movq %rax, %r14
movq 0x10(%rsp), %rdx
jmp 0xaf5e
xorl %ecx, %ecx
xorl %r14d, %r14d
testb %cl, %cl
je 0xaf68
subq %rdx, %r15
movq %r15, %r14
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq