// File: /workspace/github_c_makefile_star2_O2/dnbaker[P]fastiota/fastiota.c
// Function: fastiota32_inc
FASTIOTA_EXPORT uint32_t *fastiota32_inc(uint32_t *start, size_t nelem, uint32_t sv, uint32_t incv) {
    if(incv == 1) return fastiota32(start, nelem, sv);
    uint32_t *const end = start + nelem, *const origstart = start;
#if __AVX512F__
    __m512i m = init_start_val(_mm512_set_epi32, sv, incv);
    const __m512i inc = _mm512_set1_epi32(sizeof(m) / sizeof(uint32_t));
    if((uint64_t)start % sizeof(m) == 0) {
        UNROLL4
        while(end - start >= (signed_size_t)(sizeof(m) / sizeof(uint32_t))) {
            _mm512_store_si512((void *)start, m);
            m = _mm512_add_epi32(m, inc);
            start += sizeof(m) / sizeof(uint32_t);
        }
    } else {
        UNROLL4
        while(end - start >= (signed_size_t)(sizeof(m) / sizeof(uint32_t))) {
            _mm512_storeu_si512((void *)start, m);
            m = _mm512_add_epi32(m, inc);
            start += sizeof(m) / sizeof(uint32_t);
        }
    }
    sv += (start - origstart);
#elif __AVX2__
    __m256i m = init_start_val(_mm256_set_epi32, sv, incv);
    const __m256i inc = _mm256_set1_epi32((signed_size_t)(sizeof(m) / sizeof(uint32_t)));
    if((uint64_t)start % sizeof(m) == 0) {
        UNROLL4
        while(end - start >= (signed_size_t)(sizeof(m) / sizeof(uint32_t))) {
            _mm256_store_si256((__m256i *)start, m);
            m = _mm256_add_epi32(m, inc);
            start += sizeof(m) / sizeof(uint32_t);
        }
    } else {
        UNROLL4
        while(end - start >= (signed_size_t)(sizeof(m) / sizeof(uint32_t))) {
            _mm256_storeu_si256((__m256i *)start, m);
            m = _mm256_add_epi32(m, inc);
            start += sizeof(m) / sizeof(uint32_t);
        }
    }
    sv += (start - origstart);
#elif __SSE2__
    __m128i m = init_start_val(_mm_set_epi32, sv, incv);
    const __m128i inc = _mm_set1_epi32(sizeof(m) / sizeof(uint32_t));
    if((uint64_t)start % sizeof(m) == 0) {
        UNROLL4
        while(end - start >= (signed_size_t)(sizeof(m) / sizeof(uint32_t))) {
            _mm_store_si128((__m128i *)start, m);
            m = _mm_add_epi32(m, inc);
            start += sizeof(m) / sizeof(uint32_t);
        }
    } else {
        UNROLL4
        while(end - start >= (signed_size_t)(sizeof(m) / sizeof(uint32_t))) {
            _mm_storeu_si128((__m128i *)start, m);
            m = _mm_add_epi32(m, inc);
            start += sizeof(m) / sizeof(uint32_t);
        }
    }
    sv += (start - origstart);
#endif
    while(start < end) *start++ = sv++;
    return origstart;
}

// Assembly:
cmpl $0x1, %ecx
je 0x17ac
vpbroadcastd %ecx, %xmm0
vpmulld 0x8b5(%rip), %xmm0, %xmm1 # 0x2450
vpbroadcastd %edx, %ymm2
vpaddd %xmm2, %xmm1, %xmm1
vpmulld 0x892(%rip), %xmm0, %xmm3 # 0x2440
imull $0xd, %ecx, %eax
addl %edx, %eax
vpaddd %xmm2, %xmm3, %xmm3
vpmulld 0x8d0(%rip), %xmm0, %xmm4 # 0x2490
vpmovsxbd 0x91f(%rip), %ymm5 # 0x24e8
vpermi2d %ymm0, %ymm4, %ymm5
vpmulld 0x8c8(%rip), %xmm0, %xmm0 # 0x24a0
shll $0x3, %ecx
vinserti128 $0x1, %xmm0, %ymm0, %ymm0
vpblendd $0x60, %ymm0, %ymm5, %ymm0 # ymm0 = ymm5[0,1,2,3,4],ymm0[5,6],ymm5[7]
vpbroadcastd %ecx, %ymm4
vpblendd $0x80, %ymm4, %ymm0, %ymm0 # ymm0 = ymm0[0,1,2,3,4,5,6],ymm4[7]
vpaddd %ymm2, %ymm0, %ymm0
vpmovsxbd 0x85f(%rip), %zmm4 # 0x2460
vpermi2d %zmm2, %zmm0, %zmm4
vpmovsxbd 0x85f(%rip), %zmm2 # 0x2470
vpermi2d %zmm3, %zmm4, %zmm2
movw $0x2000, %cx            # imm = 0x2000
kmovd %ecx, %k1
vpbroadcastd %eax, %zmm2 {%k1}
vpmovsxbq 0x891(%rip), %zmm0 # 0x24c0
vpermi2q %zmm1, %zmm2, %zmm0
leaq (,%rsi,4), %rcx
vpbroadcastd 0x869(%rip), %zmm1 # 0x24b0
vpbroadcastd 0x863(%rip), %zmm2 # 0x24b4
vpbroadcastd 0x85d(%rip), %zmm3 # 0x24b8
vpbroadcastd 0x857(%rip), %zmm4 # 0x24bc
movq %rdi, %rax
testb $0x3f, %dil
je 0x1d4c
cmpq $0x3d, %rcx
jl 0x1d66
vmovdqu64 %zmm0, (%rax)
leaq -0x40(%rcx), %r8
cmpq $0x3d, %r8
jl 0x1d54
vpaddd %zmm1, %zmm0, %zmm5
vmovdqu64 %zmm5, 0x40(%rax)
leaq -0x80(%rcx), %r8
cmpq $0x3d, %r8
jl 0x1d5a
vpaddd %zmm2, %zmm0, %zmm5
vmovdqu64 %zmm5, 0x80(%rax)
leaq -0xc0(%rcx), %r8
cmpq $0x3d, %r8
jl 0x1d60
vpaddd %zmm3, %zmm0, %zmm5
vmovdqu64 %zmm5, 0xc0(%rax)
vpaddd %zmm4, %zmm0, %zmm0
addq $0x100, %rax            # imm = 0x100
addq $-0x100, %rcx
jmp 0x1c72
vmovdqa64 %zmm0, (%rax)
leaq -0x40(%rcx), %r8
cmpq $0x3d, %r8
jl 0x1d54
vpaddd %zmm1, %zmm0, %zmm5
vmovdqa64 %zmm5, 0x40(%rax)
leaq -0x80(%rcx), %r8
cmpq $0x3d, %r8
jl 0x1d5a
vpaddd %zmm2, %zmm0, %zmm5
vmovdqa64 %zmm5, 0x80(%rax)
leaq -0xc0(%rcx), %r8
cmpq $0x3d, %r8
jl 0x1d60
vpaddd %zmm3, %zmm0, %zmm5
vmovdqa64 %zmm5, 0xc0(%rax)
vpaddd %zmm4, %zmm0, %zmm0
addq $0x100, %rax            # imm = 0x100
addq $-0x100, %rcx
cmpq $0x3d, %rcx
jge 0x1ceb
jmp 0x1d66
addq $0x40, %rax
jmp 0x1d66
subq $-0x80, %rax
jmp 0x1d66
addq $0xc0, %rax
leaq (%rdi,%rsi,4), %rcx
movq %rax, %rsi
subq %rdi, %rsi
shrq $0x2, %rsi
addl %edx, %esi
cmpq %rcx, %rax
jae 0x1d85
movl %esi, (%rax)
addq $0x4, %rax
incl %esi
jmp 0x1d76
movq %rdi, %rax
vzeroupper
retq