// File: /workspace/github_c_makefile_star2_O2/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 0x1a40
movq %rax, %rcx
orq $-0x8, %rcx
decq %rdi
leaq 0x8d2(%rip), %r8        # 0x22c0
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
vpbroadcastq %rdx, %ymm0
vpaddq 0xa2e(%rip), %xmm0, %xmm1 # 0x2480
vpaddq 0x686(%rip), %ymm0, %ymm2 # 0x20e0
vpmovsxbq 0xa84(%rip), %zmm3 # 0x24e8
leaq 0x7(%rdx), %rdi
vpermi2q %zmm0, %zmm2, %zmm3
vpmovsxbq 0xa78(%rip), %zmm0 # 0x24f0
vpermi2q %zmm1, %zmm3, %zmm0
movb $-0x80, %r8b
kmovd %r8d, %k1
vpbroadcastq %rdi, %zmm0 {%k1}
shlq $0x3, %rsi
vpbroadcastq 0xa2e(%rip), %zmm1 # 0x24c8
vpbroadcastq 0xa2c(%rip), %zmm2 # 0x24d0
xorl %edi, %edi
vpbroadcastq 0xa28(%rip), %zmm3 # 0x24d8
vpbroadcastq 0xa26(%rip), %zmm4 # 0x24e0
movl $0x100, %r9d            # imm = 0x100
movq %rax, %r8
cmpq $0x39, %rsi
jl 0x1b30
vmovdqa64 %zmm0, (%rax,%rdi)
leaq -0x40(%rsi), %r10
cmpq $0x39, %r10
jl 0x1b35
vpaddq %zmm1, %zmm0, %zmm5
vmovdqa64 %zmm5, 0x40(%rax,%rdi)
leaq -0x80(%rsi), %r10
cmpq $0x39, %r10
jl 0x1b42
vpaddq %zmm2, %zmm0, %zmm5
vmovdqa64 %zmm5, 0x80(%rax,%rdi)
leaq -0xc0(%rsi), %r10
cmpq $0x39, %r10
jl 0x1b52
vpaddq %zmm3, %zmm0, %zmm5
vmovdqa64 %zmm5, 0xc0(%rax,%rdi)
vpaddq %zmm4, %zmm0, %zmm0
addq %r9, %r8
addq %r9, %rdi
addq $-0x100, %rsi
jmp 0x1ac3
addq %rax, %rdi
jmp 0x1b5f
addq $0x40, %r8
addq %rax, %rdi
addq $0x40, %rdi
jmp 0x1b5f
subq $-0x80, %r8
addq %rax, %rdi
addq $0x80, %rdi
jmp 0x1b5f
addq %rax, %rdi
addq $0xc0, %rdi
movq %rdi, %r8
subq %rax, %r8
sarq $0x3, %r8
addq %rdx, %r8
cmpq %rcx, %rdi
jae 0x1b7a
movq %r8, (%rdi)
addq $0x8, %rdi
incq %r8
jmp 0x1b69
vzeroupper
retq