// File: /workspace/github_c_makefile_star2_O1/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 0x17e6
leaq (%rdi,%rsi,8), %rax
vpbroadcastq %rcx, %xmm0
vpmullq 0x173a(%rip), %xmm0, %xmm1 # 0x34c0
leaq (,%rcx,8), %r8
subq %rcx, %r8
addq %rdx, %r8
vpbroadcastq %rdx, %ymm2
vpaddq %xmm2, %xmm1, %xmm1
leaq (,%rcx,4), %r9
leaq (%rcx,%rcx,2), %r10
addq %rcx, %rcx
vmovq %r9, %xmm3
vmovq %r10, %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 0x1768(%rip), %zmm3 # 0x3540
vpermi2q %zmm2, %zmm0, %zmm3
vpmovsxbq 0x1760(%rip), %zmm0 # 0x3548
vpermi2q %zmm1, %zmm3, %zmm0
movb $-0x80, %cl
kmovd %ecx, %k1
vpbroadcastq %r8, %zmm0 {%k1}
movq %rdi, %rcx
testb $0x3f, %dil
je 0x1e6d
cmpq $0x8, %rsi
jl 0x1fe5
leaq (,%rsi,8), %r8
movl $0x3f, %ecx
subq %r8, %rcx
cmpq $-0x38, %rcx
movq $-0x39, %r9
cmovgeq %rcx, %r9
leaq (%r9,%rsi,8), %rsi
movl %esi, %r9d
shrl $0x6, %r9d
incl %r9d
andl $0x3, %r9d
je 0x1eda
shll $0x6, %r9d
vpbroadcastq 0x16c6(%rip), %zmm1 # 0x3518
movq %rdi, %rcx
vmovdqu64 %zmm0, (%rcx)
vpaddq %zmm1, %zmm0, %zmm0
addq $0x40, %rcx
addq $-0x40, %r9
jne 0x1e55
jmp 0x1edd
cmpq $0x8, %rsi
jl 0x1fe5
leaq (,%rsi,8), %r8
movl $0x3f, %ecx
subq %r8, %rcx
cmpq $-0x38, %rcx
movq $-0x39, %r9
cmovgeq %rcx, %r9
leaq (%r9,%rsi,8), %rsi
movl %esi, %r9d
shrl $0x6, %r9d
incl %r9d
andl $0x3, %r9d
je 0x1f64
shll $0x6, %r9d
vpbroadcastq 0x165c(%rip), %zmm1 # 0x3518
movq %rdi, %rcx
vmovdqa64 %zmm0, (%rcx)
vpaddq %zmm1, %zmm0, %zmm0
addq $0x40, %rcx
addq $-0x40, %r9
jne 0x1ebf
jmp 0x1f67
movq %rdi, %rcx
cmpq $0xc0, %rsi
jb 0x1fe5
addq %rdi, %r8
subq %rcx, %r8
vpbroadcastq 0x161e(%rip), %zmm1 # 0x3518
vpbroadcastq 0x161c(%rip), %zmm2 # 0x3520
vpbroadcastq 0x161a(%rip), %zmm3 # 0x3528
vpbroadcastq 0x1618(%rip), %zmm4 # 0x3530
vmovdqu64 %zmm0, (%rcx)
vpaddq %zmm1, %zmm0, %zmm5
vmovdqu64 %zmm5, 0x40(%rcx)
vpaddq %zmm2, %zmm0, %zmm5
vmovdqu64 %zmm5, 0x80(%rcx)
vpaddq %zmm3, %zmm0, %zmm5
vmovdqu64 %zmm5, 0xc0(%rcx)
vpaddq %zmm4, %zmm0, %zmm0
addq $0x100, %rcx            # imm = 0x100
addq $-0x100, %r8
cmpq $0x38, %r8
jg 0x1f18
jmp 0x1fe5
movq %rdi, %rcx
cmpq $0xc0, %rsi
jb 0x1fe5
addq %rdi, %r8
subq %rcx, %r8
vpbroadcastq 0x1598(%rip), %zmm1 # 0x3518
vpbroadcastq 0x1596(%rip), %zmm2 # 0x3520
vpbroadcastq 0x1594(%rip), %zmm3 # 0x3528
vpbroadcastq 0x1592(%rip), %zmm4 # 0x3530
vmovdqa64 %zmm0, (%rcx)
vpaddq %zmm1, %zmm0, %zmm5
vmovdqa64 %zmm5, 0x40(%rcx)
vpaddq %zmm2, %zmm0, %zmm5
vmovdqa64 %zmm5, 0x80(%rcx)
vpaddq %zmm3, %zmm0, %zmm5
vmovdqa64 %zmm5, 0xc0(%rcx)
vpaddq %zmm4, %zmm0, %zmm0
addq $0x100, %rcx            # imm = 0x100
addq $-0x100, %r8
cmpq $0x38, %r8
jg 0x1f9e
cmpq %rax, %rcx
jae 0x2069
leaq 0x8(%rcx), %rsi
cmpq %rsi, %rax
cmovaq %rax, %rsi
movq %rcx, %rax
notq %rax
addq %rsi, %rax
vpbroadcastq %rax, %ymm1
shrq $0x3, %rax
movq %rcx, %rsi
subq %rdi, %rsi
sarq $0x3, %rsi
addq %rdx, %rsi
addq $0x4, %rax
andq $-0x4, %rax
vpbroadcastq %rsi, %ymm0
vpaddq 0x1095(%rip), %ymm0, %ymm0 # 0x30c0
vpsrlq $0x3, %ymm1, %ymm1
xorl %edx, %edx
vpmovsxbq 0x14c9(%rip), %ymm2 # 0x3504
vpbroadcastq 0x14f4(%rip), %ymm3 # 0x3538
vpbroadcastq %rdx, %ymm4
vpor %ymm2, %ymm4, %ymm4
vpcmpleuq %ymm1, %ymm4, %k1
vmovdqu64 %ymm0, (%rcx,%rdx,8) {%k1}
addq $0x4, %rdx
vpaddq %ymm3, %ymm0, %ymm0
cmpq %rdx, %rax
jne 0x2044
movq %rdi, %rax
vzeroupper
retq