// File: /workspace/github_c_makefile_star2_O2/dnbaker[P]fastiota/fastiota.c
// Function: fastiota64_inc
FASTIOTA_EXPORT uint64_t *fastiota64_inc(uint64_t *start, size_t nelem, uint64_t sv, uint64_t incv) {
    if(incv == 1) return fastiota64(start, nelem, sv);
    uint64_t *const end = start + nelem, *const origstart = start;
#if __AVX512F__
    __m512i m = init_start_val64(_mm512_set_epi64, sv, incv);
    const __m512i inc = _mm512_set1_epi64((signed_size_t)(sizeof(m) / sizeof(uint64_t)));
    if((uint64_t)start % sizeof(m) == 0) {
        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));
        }
    } else {
        UNROLL4
        while(end - start >= (signed_size_t)(sizeof(m) / sizeof(uint64_t))) {
            _mm512_storeu_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_start_val64(_mm256_set_epi64x, sv, incv);
    const __m256i inc = _mm256_set1_epi64x((signed_size_t)(sizeof(m) / sizeof(uint64_t)));
    if((uint64_t)start % sizeof(m) == 0) {
        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));
        }
    } else {
        UNROLL4
        while(end - start >= (signed_size_t)(sizeof(m) / sizeof(uint64_t))) {
            _mm256_storeu_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_start_val64(_mm_set_epi64x, sv, incv);
    const __m128i inc = _mm_set1_epi64x((signed_size_t)(sizeof(m) / sizeof(uint64_t)));
    if((uint64_t)start % sizeof(m) == 0) {
        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));
        }
    } else {
        UNROLL4
        while(end - start >= (signed_size_t)(sizeof(m) / sizeof(uint64_t))) {
            _mm_storeu_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:
cmpq $0x1, %rcx
je 0x19d4
vpbroadcastq %rcx, %xmm0
vpmullq 0x6da(%rip), %xmm0, %xmm1 # 0x2480
imulq $0x7, %rcx, %rax
addq %rdx, %rax
vpbroadcastq %rdx, %ymm2
vpaddq %xmm2, %xmm1, %xmm1
leaq (,%rcx,4), %r8
leaq (%rcx,%rcx,2), %r9
addq %rcx, %rcx
vmovq %r8, %xmm3
vmovq %r9, %xmm4
vpunpcklqdq %xmm3, %xmm4, %xmm3 # xmm3 = xmm4[0],xmm3[0]
vmovq %rcx, %xmm4
vpunpcklqdq %xmm4, %xmm0, %xmm0 # xmm0 = xmm0[0],xmm4[0]
vinserti128 $0x1, %xmm3, %ymm0, %ymm0
vpaddq %ymm2, %ymm0, %ymm0
vpmovsxbq 0x6f7(%rip), %zmm3 # 0x24e8
vpermi2q %zmm2, %zmm0, %zmm3
vpmovsxbq 0x6ef(%rip), %zmm0 # 0x24f0
vpermi2q %zmm1, %zmm3, %zmm0
movb $-0x80, %cl
kmovd %ecx, %k1
vpbroadcastq %rax, %zmm0 {%k1}
leaq (,%rsi,8), %rcx
vpbroadcastq 0x6a3(%rip), %zmm1 # 0x24c8
vpbroadcastq 0x6a1(%rip), %zmm2 # 0x24d0
vpbroadcastq 0x69f(%rip), %zmm3 # 0x24d8
vpbroadcastq 0x69d(%rip), %zmm4 # 0x24e0
movq %rdi, %rax
testb $0x3f, %dil
je 0x1f2a
cmpq $0x39, %rcx
jl 0x1f44
vmovdqu64 %zmm0, (%rax)
leaq -0x40(%rcx), %r8
cmpq $0x39, %r8
jl 0x1f32
vpaddq %zmm1, %zmm0, %zmm5
vmovdqu64 %zmm5, 0x40(%rax)
leaq -0x80(%rcx), %r8
cmpq $0x39, %r8
jl 0x1f38
vpaddq %zmm2, %zmm0, %zmm5
vmovdqu64 %zmm5, 0x80(%rax)
leaq -0xc0(%rcx), %r8
cmpq $0x39, %r8
jl 0x1f3e
vpaddq %zmm3, %zmm0, %zmm5
vmovdqu64 %zmm5, 0xc0(%rax)
vpaddq %zmm4, %zmm0, %zmm0
addq $0x100, %rax            # imm = 0x100
addq $-0x100, %rcx
jmp 0x1e50
vmovdqa64 %zmm0, (%rax)
leaq -0x40(%rcx), %r8
cmpq $0x39, %r8
jl 0x1f32
vpaddq %zmm1, %zmm0, %zmm5
vmovdqa64 %zmm5, 0x40(%rax)
leaq -0x80(%rcx), %r8
cmpq $0x39, %r8
jl 0x1f38
vpaddq %zmm2, %zmm0, %zmm5
vmovdqa64 %zmm5, 0x80(%rax)
leaq -0xc0(%rcx), %r8
cmpq $0x39, %r8
jl 0x1f3e
vpaddq %zmm3, %zmm0, %zmm5
vmovdqa64 %zmm5, 0xc0(%rax)
vpaddq %zmm4, %zmm0, %zmm0
addq $0x100, %rax            # imm = 0x100
addq $-0x100, %rcx
cmpq $0x39, %rcx
jge 0x1ec9
jmp 0x1f44
addq $0x40, %rax
jmp 0x1f44
subq $-0x80, %rax
jmp 0x1f44
addq $0xc0, %rax
leaq (%rdi,%rsi,8), %rcx
movq %rax, %rsi
subq %rdi, %rsi
sarq $0x3, %rsi
addq %rdx, %rsi
cmpq %rcx, %rax
jae 0x1f66
movq %rsi, (%rax)
addq $0x8, %rax
incq %rsi
jmp 0x1f55
movq %rdi, %rax
vzeroupper
retq