// File: /workspace/github_c_makefile_star2_O2/dnbaker[P]fastiota/./fastiota.h
// Function: unsigned long* fastiota::iota<unsigned long, int, int>(unsigned long*, unsigned long, int, int)
IT *iota(IT *start, size_t nelem, IT2 firstv=0, IT3 inc=1) {
    if(sizeof(IT) == 4) {
        return reinterpret_cast<IT *>(fastiota32_inc(reinterpret_cast<uint32_t *>(start), nelem, firstv, inc));
    }
    if(sizeof(IT) == 8) {
        return reinterpret_cast<IT *>(fastiota64_inc(reinterpret_cast<uint64_t *>(start), nelem, firstv, inc));
    }
    IT *ptr = start;
    const IT *const end = start + nelem;
    if(inc == 1) {
        while(ptr + 8 <= end) {
            ptr[0] = firstv;
            ptr[1] = firstv + 1;
            ptr[2] = firstv + 2;
            ptr[3] = firstv + 3;
            ptr[4] = firstv + 4;
            ptr[5] = firstv + 5;
            ptr[6] = firstv + 6;
            ptr[7] = firstv + 7;
            ptr += 8;
            firstv += 8;
        }
        while(ptr < end) *ptr++ = firstv++;
    } else {
        const std::array<const IT, 8> tmp {IT(0), IT(1) * inc, IT(2) * inc, IT(3) * inc, IT(4) * inc, IT(5) * inc, IT(6) * inc, IT(7) * inc};
        for(const IT blockinc = 8 * inc;ptr + 8 <= end;ptr += 8, firstv += blockinc) {
            ptr[0] = firstv;
            ptr[1] = firstv + tmp[1];
            ptr[2] = firstv + tmp[2];
            ptr[3] = firstv + tmp[3];
            ptr[4] = firstv + tmp[4];
            ptr[5] = firstv + tmp[5];
            ptr[6] = firstv + tmp[6];
            ptr[7] = firstv + tmp[7];
        }
        while(ptr < end) *ptr++ = (firstv += inc);
    }
    return start;
}

// Assembly:
movq %rdi, %rax
movslq %edx, %rdx
cmpl $0x1, %ecx
jne 0x1731
testb $0x1, %al
je 0x167d
decq %rsi
movq %rdx, (%rax)
addq $0x8, %rax
incq %rdx
leaq (%rax,%rsi,8), %rcx
leaq 0x1(%rdx), %rdi
movq %rdx, %xmm0
movq %rdi, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
shlq $0x3, %rsi
xorl %edi, %edi
movdqa 0x9bf(%rip), %xmm1      # 0x2060
movdqa 0x9c7(%rip), %xmm2      # 0x2070
movdqa 0x9cf(%rip), %xmm3      # 0x2080
movdqa 0x9d7(%rip), %xmm4      # 0x2090
movq %rax, %r8
cmpq $0x9, %rsi
jl 0x1842
movdqa %xmm0, (%rax,%rdi)
leaq -0x10(%rsi), %r9
cmpq $0x9, %r9
jl 0x184a
movdqa %xmm0, %xmm5
paddq %xmm1, %xmm5
movdqa %xmm5, 0x10(%rax,%rdi)
leaq -0x20(%rsi), %r9
cmpq $0x9, %r9
jl 0x185d
movdqa %xmm0, %xmm5
paddq %xmm2, %xmm5
movdqa %xmm5, 0x20(%rax,%rdi)
leaq -0x30(%rsi), %r9
cmpq $0x9, %r9
jl 0x1870
movdqa %xmm0, %xmm5
paddq %xmm3, %xmm5
movdqa %xmm5, 0x30(%rax,%rdi)
paddq %xmm4, %xmm0
addq $0x40, %r8
addq $0x40, %rdi
addq $-0x40, %rsi
jmp 0x16bc
movslq %ecx, %rcx
addq %rdx, %rcx
movq %rcx, %xmm1
movq %rdx, %xmm0
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
leaq (,%rsi,8), %rdi
movdqa 0x90b(%rip), %xmm1      # 0x2060
movdqa 0x913(%rip), %xmm2      # 0x2070
movdqa 0x91b(%rip), %xmm3      # 0x2080
movdqa 0x923(%rip), %xmm4      # 0x2090
movq %rax, %rcx
testb $0xf, %al
je 0x183a
cmpq $0x9, %rdi
jl 0x189a
movdqu %xmm0, (%rcx)
leaq -0x10(%rdi), %r8
cmpq $0x9, %r8
jl 0x1857
movdqa %xmm0, %xmm5
paddq %xmm1, %xmm5
movdqu %xmm5, 0x10(%rcx)
leaq -0x20(%rdi), %r8
cmpq $0x9, %r8
jl 0x186a
movdqa %xmm0, %xmm5
paddq %xmm2, %xmm5
movdqu %xmm5, 0x20(%rcx)
leaq -0x30(%rdi), %r8
cmpq $0x9, %r8
jl 0x1896
movdqa %xmm0, %xmm5
paddq %xmm3, %xmm5
movdqu %xmm5, 0x30(%rcx)
paddq %xmm4, %xmm0
addq $0x40, %rcx
addq $-0x40, %rdi
jmp 0x1778
movdqa %xmm0, (%rcx)
leaq -0x10(%rdi), %r8
cmpq $0x9, %r8
jl 0x1857
movdqa %xmm0, %xmm5
paddq %xmm1, %xmm5
movdqa %xmm5, 0x10(%rcx)
leaq -0x20(%rdi), %r8
cmpq $0x9, %r8
jl 0x186a
movdqa %xmm0, %xmm5
paddq %xmm2, %xmm5
movdqa %xmm5, 0x20(%rcx)
leaq -0x30(%rdi), %r8
cmpq $0x9, %r8
jl 0x1896
movdqa %xmm0, %xmm5
paddq %xmm3, %xmm5
movdqa %xmm5, 0x30(%rcx)
paddq %xmm4, %xmm0
addq $0x40, %rcx
addq $-0x40, %rdi
cmpq $0x9, %rdi
jge 0x17e5
jmp 0x189a
addq %rax, %rdi
movq %rdi, %r8
jmp 0x187b
addq $0x10, %r8
addq %rax, %rdi
addq $0x10, %rdi
jmp 0x187b
addq $0x10, %rcx
jmp 0x189a
addq $0x20, %r8
addq %rax, %rdi
addq $0x20, %rdi
jmp 0x187b
addq $0x20, %rcx
jmp 0x189a
addq $0x30, %r8
addq %rax, %rdi
addq $0x30, %rdi
subq %rax, %r8
sarq $0x3, %r8
addq %rdx, %r8
cmpq %rcx, %rdi
jae 0x18bc
movq %r8, (%rdi)
addq $0x8, %rdi
incq %r8
jmp 0x1885
addq $0x30, %rcx
leaq (%rax,%rsi,8), %rsi
movq %rcx, %rdi
subq %rax, %rdi
sarq $0x3, %rdi
addq %rdx, %rdi
cmpq %rsi, %rcx
jae 0x18bc
movq %rdi, (%rcx)
addq $0x8, %rcx
incq %rdi
jmp 0x18ab
retq
nop