// File: /workspace/github_c_makefile_star2_O3/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 0x18ca
leaq (%rdi,%rsi,8), %rax
vpbroadcastq %rcx, %xmm0
vpmullq 0x16d6(%rip), %xmm0, %xmm1 # 0x3540
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 0x1704(%rip), %zmm3 # 0x35c0
vpermi2q %zmm2, %zmm0, %zmm3
vpmovsxbq 0x16fc(%rip), %zmm0 # 0x35c8
vpermi2q %zmm1, %zmm3, %zmm0
movb $-0x80, %cl
kmovd %ecx, %k1
vpbroadcastq %r8, %zmm0 {%k1}
movq %rdi, %rcx
testb $0x3f, %dil
je 0x1f51
cmpq $0x8, %rsi
jl 0x20c9
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 0x1fbe
shll $0x6, %r9d
vpbroadcastq 0x1662(%rip), %zmm1 # 0x3598
movq %rdi, %rcx
vmovdqu64 %zmm0, (%rcx)
vpaddq %zmm1, %zmm0, %zmm0
addq $0x40, %rcx
addq $-0x40, %r9
jne 0x1f39
jmp 0x1fc1
cmpq $0x8, %rsi
jl 0x20c9
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 0x2048
shll $0x6, %r9d
vpbroadcastq 0x15f8(%rip), %zmm1 # 0x3598
movq %rdi, %rcx
vmovdqa64 %zmm0, (%rcx)
vpaddq %zmm1, %zmm0, %zmm0
addq $0x40, %rcx
addq $-0x40, %r9
jne 0x1fa3
jmp 0x204b
movq %rdi, %rcx
cmpq $0xc0, %rsi
jb 0x20c9
addq %rdi, %r8
subq %rcx, %r8
vpbroadcastq 0x15ba(%rip), %zmm1 # 0x3598
vpbroadcastq 0x15b8(%rip), %zmm2 # 0x35a0
vpbroadcastq 0x15b6(%rip), %zmm3 # 0x35a8
vpbroadcastq 0x15b4(%rip), %zmm4 # 0x35b0
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 0x1ffc
jmp 0x20c9
movq %rdi, %rcx
cmpq $0xc0, %rsi
jb 0x20c9
addq %rdi, %r8
subq %rcx, %r8
vpbroadcastq 0x1534(%rip), %zmm1 # 0x3598
vpbroadcastq 0x1532(%rip), %zmm2 # 0x35a0
vpbroadcastq 0x1530(%rip), %zmm3 # 0x35a8
vpbroadcastq 0x152e(%rip), %zmm4 # 0x35b0
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 0x2082
cmpq %rax, %rcx
jae 0x214d
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 0x1011(%rip), %ymm0, %ymm0 # 0x3120
vpsrlq $0x3, %ymm1, %ymm1
xorl %edx, %edx
vpmovsxbq 0x1465(%rip), %ymm2 # 0x3584
vpbroadcastq 0x1490(%rip), %ymm3 # 0x35b8
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 0x2128
movq %rdi, %rax
vzeroupper
retq