// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/rANS_static4x16pr.c
// Function: rans_dec_func
static inline
unsigned char *(*rans_dec_func(int do_simd, int order))
    (unsigned char *in,
     unsigned int in_size,
     unsigned char *out,
     unsigned int out_size) {

    if (!do_simd) { // SIMD disabled
        return order & 1
            ? rans_uncompress_O1_4x16
            : rans_uncompress_O0_4x16;
    }

#ifdef NO_THREADS
    htscodecs_tls_cpu_init();
#else
    int err = pthread_once(&rans_cpu_once, htscodecs_tls_cpu_init);
    if (err != 0) {
        fprintf(stderr, "Initialising TLS data failed: pthread_once: %s\n",
                strerror(err));
        fprintf(stderr, "Using scalar code only\n");
    }
#endif

    int have_d_sse4_1  = have_sse4_1;
    int have_d_avx2    = have_avx2;
    int have_d_avx512f = have_avx512f;

    if (!(rans_cpu & RANS_CPU_DEC_AVX512)) have_d_avx512f = 0;
    if (!(rans_cpu & RANS_CPU_DEC_AVX2))   have_d_avx2    = 0;
    if (!(rans_cpu & RANS_CPU_DEC_SSE4))   have_d_sse4_1  = 0;

    if (order & 1) {
#if defined(HAVE_AVX512)
        if (have_d_avx512f)
            return rans_uncompress_O1_32x16_avx512;
#endif
#if defined(HAVE_AVX2)
        if (have_d_avx2)
            return rans_uncompress_O1_32x16_avx2;
#endif
#if defined(HAVE_SSE4_1) && defined(HAVE_SSSE3) && defined(HAVE_POPCNT)
        if (have_d_sse4_1)
            return rans_uncompress_O1_32x16_sse4;
#endif
        return rans_uncompress_O1_32x16;
    } else {
#if defined(HAVE_AVX512)
        if (have_d_avx512f)
            return rans_uncompress_O0_32x16_avx512;
#endif
#if defined(HAVE_AVX2)
        if (have_d_avx2)
            return rans_uncompress_O0_32x16_avx2;
#endif
#if defined(HAVE_SSE4_1) && defined(HAVE_SSSE3) && defined(HAVE_POPCNT)
        if (have_d_sse4_1)
            return rans_uncompress_O0_32x16_sse4;
#endif
        return rans_uncompress_O0_32x16;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x928e8
movl -0x10(%rbp), %edx
andl $0x1, %edx
leaq -0x3471(%rip), %rax     # 0x8f460
leaq 0x15f8(%rip), %rcx      # 0x93ed0
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x92a3c
leaq 0x7ffb5(%rip), %rdi     # 0x1128a4
leaq -0x2706(%rip), %rsi     # 0x901f0
callq 0x4460
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x92947
movq 0x7a6d5(%rip), %rax     # 0x10cfe0
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movl -0x14(%rbp), %edi
callq 0x4130
movq -0x28(%rbp), %rdi
movq %rax, %rdx
leaq 0x63bee(%rip), %rsi     # 0xf6516
movb $0x0, %al
callq 0x46d0
movq 0x7a6aa(%rip), %rax     # 0x10cfe0
movq (%rax), %rdi
leaq 0x63c06(%rip), %rsi     # 0xf6546
movb $0x0, %al
callq 0x46d0
movl 0x7ff4b(%rip), %eax     # 0x112898
movl %eax, -0x18(%rbp)
movl 0x7ff46(%rip), %eax     # 0x11289c
movl %eax, -0x1c(%rbp)
movl 0x7ff41(%rip), %eax     # 0x1128a0
movl %eax, -0x20(%rbp)
movl 0x7b268(%rip), %eax     # 0x10dbd0
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0x92979
movl $0x0, -0x20(%rbp)
movl 0x7b251(%rip), %eax     # 0x10dbd0
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
jne 0x92990
movl $0x0, -0x1c(%rbp)
movl 0x7b23a(%rip), %eax     # 0x10dbd0
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0x929a7
movl $0x0, -0x18(%rbp)
movl -0x10(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x929f8
cmpl $0x0, -0x20(%rbp)
je 0x929c5
leaq 0x1a4b1(%rip), %rax     # 0xace70
movq %rax, -0x8(%rbp)
jmp 0x92a3c
cmpl $0x0, -0x1c(%rbp)
je 0x929d8
leaq 0xd63e(%rip), %rax      # 0xa0010
movq %rax, -0x8(%rbp)
jmp 0x92a3c
cmpl $0x0, -0x18(%rbp)
je 0x929eb
leaq 0x221cb(%rip), %rax     # 0xb4bb0
movq %rax, -0x8(%rbp)
jmp 0x92a3c
leaq 0x2ecae(%rip), %rax     # 0xc16a0
movq %rax, -0x8(%rbp)
jmp 0x92a3c
cmpl $0x0, -0x20(%rbp)
je 0x92a0b
leaq 0x16ddb(%rip), %rax     # 0xa97e0
movq %rax, -0x8(%rbp)
jmp 0x92a3c
cmpl $0x0, -0x1c(%rbp)
je 0x92a1e
leaq 0x7708(%rip), %rax      # 0x9a120
movq %rax, -0x8(%rbp)
jmp 0x92a3c
cmpl $0x0, -0x18(%rbp)
je 0x92a31
leaq 0x1eae5(%rip), %rax     # 0xb1510
movq %rax, -0x8(%rbp)
jmp 0x92a3c
leaq 0x2d1f8(%rip), %rax     # 0xbfc30
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)