// File: /workspace/github_c_makefile_star2_O0/dnbaker[P]fastiota/././fastiota.c
// Function: fastiota64_inc(unsigned long*, unsigned long, unsigned long, unsigned long)
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:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0xe0(%rbp)
movq %rsi, -0xe8(%rbp)
movq %rdx, -0xf0(%rbp)
movq %rcx, -0xf8(%rbp)
cmpq $0x1, -0xf8(%rbp)
jne 0x1c07
movq -0xe0(%rbp), %rdi
movq -0xe8(%rbp), %rsi
movq -0xf0(%rbp), %rdx
callq 0x1e70
movq %rax, -0xd8(%rbp)
jmp 0x1e52
movq -0xe0(%rbp), %rax
movq -0xe8(%rbp), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, -0x100(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0xf0(%rbp), %rax
movq -0xf8(%rbp), %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x90(%rbp)
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %xmm1
movq -0x98(%rbp), %xmm0
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movaps %xmm0, -0xb0(%rbp)
movaps -0xb0(%rbp), %xmm0
movaps %xmm0, -0x120(%rbp)
movq $0x2, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x68(%rbp)
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %xmm1
movq -0x70(%rbp), %xmm0
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movdqa %xmm0, -0x80(%rbp)
movdqa -0x80(%rbp), %xmm0
movdqa %xmm0, -0x130(%rbp)
movq -0xe0(%rbp), %rax
andq $0xf, %rax
cmpq $0x0, %rax
jne 0x1d5e
jmp 0x1cca
movq -0x100(%rbp), %rax
movq -0xe0(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x2, %rax
jl 0x1d59
movq -0xe0(%rbp), %rax
movdqa -0x120(%rbp), %xmm0
movq %rax, -0xb8(%rbp)
movdqa %xmm0, -0xd0(%rbp)
movdqa -0xd0(%rbp), %xmm0
movq -0xb8(%rbp), %rax
movdqa %xmm0, (%rax)
movdqa -0x120(%rbp), %xmm1
movdqa -0x130(%rbp), %xmm0
movdqa %xmm1, -0x30(%rbp)
movdqa %xmm0, -0x40(%rbp)
movdqa -0x30(%rbp), %xmm0
paddq -0x40(%rbp), %xmm0
movdqa %xmm0, -0x120(%rbp)
movq -0xe0(%rbp), %rax
addq $0x10, %rax
movq %rax, -0xe0(%rbp)
jmp 0x1cca
jmp 0x1de2
jmp 0x1d60
movq -0x100(%rbp), %rax
movq -0xe0(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x2, %rax
jl 0x1de0
movq -0xe0(%rbp), %rax
movdqa -0x120(%rbp), %xmm0
movq %rax, -0x8(%rbp)
movdqa %xmm0, -0x20(%rbp)
movdqa -0x20(%rbp), %xmm0
movq -0x8(%rbp), %rax
movdqu %xmm0, (%rax)
movdqa -0x120(%rbp), %xmm1
movdqa -0x130(%rbp), %xmm0
movdqa %xmm1, -0x50(%rbp)
movdqa %xmm0, -0x60(%rbp)
movdqa -0x50(%rbp), %xmm0
paddq -0x60(%rbp), %xmm0
movdqa %xmm0, -0x120(%rbp)
movq -0xe0(%rbp), %rax
addq $0x10, %rax
movq %rax, -0xe0(%rbp)
jmp 0x1d60
jmp 0x1de2
movq -0xe0(%rbp), %rax
movq -0x108(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
addq -0xf0(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xe0(%rbp), %rax
cmpq -0x100(%rbp), %rax
jae 0x1e44
movq -0xf0(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0xf0(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, -0xe0(%rbp)
movq %rcx, (%rax)
jmp 0x1e05
movq -0x108(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopw %cs:(%rax,%rax)