// File: /workspace/github_c_makefile_star2_O1/dnbaker[P]fastiota/fastiota.c
// Function: fastiota64
FASTIOTA_EXPORT uint64_t *fastiota64(uint64_t *start, size_t nelem, uint64_t sv) {
    {
        const size_t leftover = VECSIZE / sizeof(uint64_t) - (uint64_t)start % (VECSIZE / sizeof(uint64_t));
        if(leftover && leftover != VECSIZE / sizeof(uint64_t)) {
            nelem -= leftover;
            switch(leftover) {
                case 7: CASEN case 6: CASEN case 5: CASEN case 4: CASEN case 3: CASEN case 2: CASEN case 1: CASEN
                default: ;
            }
        }
    }
#undef CASEN
    uint64_t *const end = start + nelem, *const origstart = start;
#if __AVX512F__
    __m512i m = init_start64(_mm512_set_epi64, sv);
    const __m512i inc = _mm512_set1_epi64((signed_size_t)(sizeof(m) / sizeof(uint64_t)));
    UNROLL4
    while(end - start >= (signed_size_t)(sizeof(m) / sizeof(uint64_t))) {
        _mm512_store_si512((void *)start, m);
        m = _mm512_add_epi64(m, inc);
        start += (signed_size_t)(sizeof(m) / sizeof(uint64_t));
    }
    sv += (start - origstart);
#elif __AVX2__
    __m256i m = init_start64(_mm256_set_epi64x, sv);
    const __m256i inc = _mm256_set1_epi64x((signed_size_t)(sizeof(m) / sizeof(uint64_t)));
    UNROLL4
    while(end - start >= (signed_size_t)(sizeof(m) / sizeof(uint64_t))) {
        _mm256_store_si256((__m256i *)start, m);
        m = _mm256_add_epi64(m, inc);
        start += (signed_size_t)(sizeof(m) / sizeof(uint64_t));
    }
    sv += (start - origstart);
#elif __SSE2__
    __m128i m = init_start64(_mm_set_epi64x, sv);
    const __m128i inc = _mm_set1_epi64x((signed_size_t)(sizeof(m) / sizeof(uint64_t)));
    UNROLL4
    while(end - start >= (signed_size_t)(sizeof(m) / sizeof(uint64_t))) {
        _mm_store_si128((__m128i *)start, m);
        m = _mm_add_epi64(m, inc);
        start += (signed_size_t)(sizeof(m) / sizeof(uint64_t));
    }
    sv += (start - origstart);
#endif
    while(start < end) *start++ = sv++;
    return origstart;
}

// Assembly:
movq %rdi, %rax
andq $0x7, %rdi
je 0x1852
movq %rax, %rcx
orq $-0x8, %rcx
decq %rdi
leaq 0x1ac0(%rip), %r8       # 0x32c0
movslq (%r8,%rdi,4), %rdi
addq %r8, %rdi
jmpq *%rdi
movq %rdx, (%rax)
addq $0x8, %rax
incq %rdx
movq %rdx, (%rax)
addq $0x8, %rax
incq %rdx
movq %rdx, (%rax)
addq $0x8, %rax
incq %rdx
movq %rdx, (%rax)
addq $0x8, %rax
incq %rdx
movq %rdx, (%rax)
addq $0x8, %rax
incq %rdx
movq %rdx, (%rax)
addq $0x8, %rax
incq %rdx
addq %rcx, %rsi
movq %rdx, (%rax)
addq $0x8, %rax
incq %rdx
leaq (%rax,%rsi,8), %rcx
movq %rax, %rdi
movq %rax, %r8
cmpq $0x8, %rsi
jl 0x19a4
leaq 0x7(%rdx), %rdi
vpbroadcastq %rdx, %ymm0
vpaddq 0x1c48(%rip), %xmm0, %xmm1 # 0x34c0
vpaddq 0x1820(%rip), %ymm0, %ymm2 # 0x30a0
vpmovsxbq 0x1cb6(%rip), %zmm3 # 0x3540
vpermi2q %zmm0, %zmm2, %zmm3
vpmovsxbq 0x1cae(%rip), %zmm0 # 0x3548
vpermi2q %zmm1, %zmm3, %zmm0
movb $-0x80, %r8b
kmovd %r8d, %k1
vpbroadcastq %rdi, %zmm0 {%k1}
leaq (,%rsi,8), %rdi
movl $0x3f, %r8d
subq %rdi, %r8
cmpq $-0x38, %r8
movq $-0x39, %rdi
cmovgeq %r8, %rdi
leaq (%rdi,%rsi,8), %rsi
movl %esi, %r8d
shrl $0x6, %r8d
incl %r8d
andl $0x3, %r8d
je 0x1911
shll $0x6, %r8d
vpbroadcastq 0x1c28(%rip), %zmm1 # 0x3518
movq %r8, %r9
movq %rax, %rdi
vmovdqa64 %zmm0, (%rdi)
vpaddq %zmm1, %zmm0, %zmm0
addq $0x40, %rdi
addq $-0x40, %r9
jne 0x18f6
addq %rax, %r8
jmp 0x1914
movq %rax, %rdi
cmpq $0xc0, %rsi
jb 0x19a4
movq %rdi, %r8
negq %r8
vpbroadcastq 0x1be7(%rip), %zmm1 # 0x3518
vpbroadcastq 0x1be5(%rip), %zmm2 # 0x3520
vpbroadcastq 0x1be3(%rip), %zmm3 # 0x3528
vpbroadcastq 0x1be1(%rip), %zmm4 # 0x3530
vmovdqa64 %zmm0, (%rdi)
vpaddq %zmm1, %zmm0, %zmm5
vmovdqa64 %zmm5, 0x40(%rdi)
vpaddq %zmm2, %zmm0, %zmm5
vmovdqa64 %zmm5, 0x80(%rdi)
vpaddq %zmm3, %zmm0, %zmm5
vmovdqa64 %zmm5, 0xc0(%rdi)
vpaddq %zmm4, %zmm0, %zmm0
addq $0x100, %rdi            # imm = 0x100
leaq (%rcx,%r8), %rsi
addq $-0x100, %rsi
addq $-0x100, %r8
cmpq $0x38, %rsi
jg 0x194f
negq %r8
cmpq %rcx, %rdi
jae 0x1a25
leaq 0x8(%rdi), %rsi
cmpq %rsi, %rcx
cmovaq %rcx, %rsi
movq %rdi, %rcx
notq %rcx
addq %rsi, %rcx
vpbroadcastq %rcx, %ymm1
shrq $0x3, %rcx
subq %rax, %r8
sarq $0x3, %r8
addq %rdx, %r8
addq $0x4, %rcx
andq $-0x4, %rcx
vpbroadcastq %r8, %ymm0
vpaddq 0x16d9(%rip), %ymm0, %ymm0 # 0x30c0
vpsrlq $0x3, %ymm1, %ymm1
xorl %edx, %edx
vpmovsxbq 0x1b0d(%rip), %ymm2 # 0x3504
vpbroadcastq 0x1b38(%rip), %ymm3 # 0x3538
vpbroadcastq %rdx, %ymm4
vpor %ymm2, %ymm4, %ymm4
vpcmpleuq %ymm1, %ymm4, %k1
vmovdqu64 %ymm0, (%rdi,%rdx,8) {%k1}
addq $0x4, %rdx
vpaddq %ymm3, %ymm0, %ymm0
cmpq %rdx, %rcx
jne 0x1a00
vzeroupper
retq