// File: /workspace/github_c_makefile_star2_O3/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 0x15fc
leaq (%rdi,%rsi,4), %rax
vpbroadcastd %ecx, %xmm0
vpmulld 0x19e2(%rip), %xmm0, %xmm1 # 0x3510
vpbroadcastd %edx, %ymm2
vpaddd %xmm2, %xmm1, %xmm1
leal (%rcx,%rcx,2), %r8d
vpmulld 0x19bb(%rip), %xmm0, %xmm3 # 0x3500
leal (%rcx,%r8,4), %r8d
addl %edx, %r8d
vpaddd %xmm2, %xmm3, %xmm3
vpmulld 0x19f7(%rip), %xmm0, %xmm4 # 0x3550
vpmovsxbd 0x1a5e(%rip), %ymm5 # 0x35c0
vpermi2d %ymm0, %ymm4, %ymm5
vpmulld 0x19ef(%rip), %xmm0, %xmm0 # 0x3560
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 0x1986(%rip), %zmm4 # 0x3520
vpermi2d %zmm2, %zmm0, %zmm4
vpmovsxbd 0x1986(%rip), %zmm2 # 0x3530
vpermi2d %zmm3, %zmm4, %zmm2
movw $0x2000, %cx            # imm = 0x2000
kmovd %ecx, %k1
vpbroadcastd %r8d, %zmm2 {%k1}
vpmovsxbq 0x19c0(%rip), %zmm0 # 0x3588
vpermi2q %zmm1, %zmm2, %zmm0
movq %rdi, %rcx
testb $0x3f, %dil
je 0x1c41
cmpq $0x10, %rsi
jl 0x1db9
leaq (,%rsi,4), %r8
movl $0x3f, %ecx
subq %r8, %rcx
cmpq $-0x3c, %rcx
movq $-0x3d, %r9
cmovgeq %rcx, %r9
leaq (%r9,%rsi,4), %rsi
movl %esi, %r9d
shrl $0x6, %r9d
incl %r9d
andl $0x3, %r9d
je 0x1cae
shll $0x6, %r9d
vpbroadcastd 0x194a(%rip), %zmm1 # 0x3570
movq %rdi, %rcx
vmovdqu64 %zmm0, (%rcx)
vpaddd %zmm1, %zmm0, %zmm0
addq $0x40, %rcx
addq $-0x40, %r9
jne 0x1c29
jmp 0x1cb1
cmpq $0x10, %rsi
jl 0x1db9
leaq (,%rsi,4), %r8
movl $0x3f, %ecx
subq %r8, %rcx
cmpq $-0x3c, %rcx
movq $-0x3d, %r9
cmovgeq %rcx, %r9
leaq (%r9,%rsi,4), %rsi
movl %esi, %r9d
shrl $0x6, %r9d
incl %r9d
andl $0x3, %r9d
je 0x1d38
shll $0x6, %r9d
vpbroadcastd 0x18e0(%rip), %zmm1 # 0x3570
movq %rdi, %rcx
vmovdqa64 %zmm0, (%rcx)
vpaddd %zmm1, %zmm0, %zmm0
addq $0x40, %rcx
addq $-0x40, %r9
jne 0x1c93
jmp 0x1d3b
movq %rdi, %rcx
cmpq $0xc0, %rsi
jb 0x1db9
addq %rdi, %r8
subq %rcx, %r8
vpbroadcastd 0x18a2(%rip), %zmm1 # 0x3570
vpbroadcastd 0x189c(%rip), %zmm2 # 0x3574
vpbroadcastd 0x1896(%rip), %zmm3 # 0x3578
vpbroadcastd 0x1890(%rip), %zmm4 # 0x357c
vmovdqu64 %zmm0, (%rcx)
vpaddd %zmm1, %zmm0, %zmm5
vmovdqu64 %zmm5, 0x40(%rcx)
vpaddd %zmm2, %zmm0, %zmm5
vmovdqu64 %zmm5, 0x80(%rcx)
vpaddd %zmm3, %zmm0, %zmm5
vmovdqu64 %zmm5, 0xc0(%rcx)
vpaddd %zmm4, %zmm0, %zmm0
addq $0x100, %rcx            # imm = 0x100
addq $-0x100, %r8
cmpq $0x3c, %r8
jg 0x1cec
jmp 0x1db9
movq %rdi, %rcx
cmpq $0xc0, %rsi
jb 0x1db9
addq %rdi, %r8
subq %rcx, %r8
vpbroadcastd 0x181c(%rip), %zmm1 # 0x3570
vpbroadcastd 0x1816(%rip), %zmm2 # 0x3574
vpbroadcastd 0x1810(%rip), %zmm3 # 0x3578
vpbroadcastd 0x180a(%rip), %zmm4 # 0x357c
vmovdqa64 %zmm0, (%rcx)
vpaddd %zmm1, %zmm0, %zmm5
vmovdqa64 %zmm5, 0x40(%rcx)
vpaddd %zmm2, %zmm0, %zmm5
vmovdqa64 %zmm5, 0x80(%rcx)
vpaddd %zmm3, %zmm0, %zmm5
vmovdqa64 %zmm5, 0xc0(%rcx)
vpaddd %zmm4, %zmm0, %zmm0
addq $0x100, %rcx            # imm = 0x100
addq $-0x100, %r8
cmpq $0x3c, %r8
jg 0x1d72
cmpq %rax, %rcx
jae 0x1e45
leaq 0x4(%rcx), %rsi
cmpq %rsi, %rax
cmovaq %rax, %rsi
movq %rcx, %rax
notq %rax
addq %rsi, %rax
vpbroadcastq %rax, %zmm1
shrq $0x2, %rax
movq %rcx, %rsi
subq %rdi, %rsi
shrq $0x2, %rsi
addl %edx, %esi
addq $0x8, %rax
andq $-0x8, %rax
vpbroadcastd %esi, %ymm0
vpaddd 0x12de(%rip), %ymm0, %ymm0 # 0x30e0
vpsrlq $0x2, %zmm1, %zmm1
xorl %edx, %edx
vpmovsxbq 0x177b(%rip), %zmm2 # 0x3590
vpbroadcastd 0x1762(%rip), %ymm3 # 0x3580
vpbroadcastq %rdx, %zmm4
vporq %zmm2, %zmm4, %zmm4
vpcmpleuq %zmm1, %zmm4, %k1
vmovdqu32 %ymm0, (%rcx,%rdx,4) {%k1}
addq $0x8, %rdx
vpaddd %ymm3, %ymm0, %ymm0
cmpq %rdx, %rax
jne 0x1e1e
movq %rdi, %rax
vzeroupper
retq