// File: /workspace/github_c_makefile_star2_O1/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 0x16fc
testb $0x1, %al
je 0x1672
decq %rsi
movq %rdx, (%rax)
addq $0x8, %rax
incq %rdx
leaq (%rax,%rsi,8), %rcx
movq %rax, %r8
movq %rax, %rdi
cmpq $0x2, %rsi
jl 0x1864
leaq 0x1(%rdx), %rdi
movq %rdx, %xmm0
movq %rdi, %xmm1
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
leaq (,%rsi,8), %rdi
movl $0xf, %r8d
subq %rdi, %r8
cmpq $-0x8, %r8
movq $-0x9, %rdi
cmovgeq %r8, %rdi
leaq (%rdi,%rsi,8), %rsi
movl %esi, %edi
shrl $0x4, %edi
incl %edi
andl $0x3, %edi
je 0x17e9
movl %edi, %r9d
shll $0x4, %r9d
movdqa 0x975(%rip), %xmm1      # 0x2050
movq %rax, %r8
movdqa %xmm0, (%r8)
paddq %xmm1, %xmm0
addq $0x10, %r8
addq $-0x10, %r9
jne 0x16de
shll $0x4, %edi
addq %rax, %rdi
jmp 0x17ec
movslq %ecx, %rdi
leaq (%rax,%rsi,8), %rcx
addq %rdx, %rdi
movq %rdi, %xmm1
movq %rdx, %xmm0
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
movq %rax, %rdi
testb $0xf, %al
je 0x1782
cmpq $0x2, %rsi
jl 0x1969
leaq (,%rsi,8), %r8
movl $0xf, %edi
subq %r8, %rdi
cmpq $-0x8, %rdi
movq $-0x9, %r9
cmovgeq %rdi, %r9
leaq (%r9,%rsi,8), %rsi
movl %esi, %r9d
shrl $0x4, %r9d
incl %r9d
andl $0x3, %r9d
je 0x188b
shll $0x4, %r9d
movdqa 0x8e8(%rip), %xmm1      # 0x2050
movq %rax, %rdi
movdqu %xmm0, (%rdi)
paddq %xmm1, %xmm0
addq $0x10, %rdi
addq $-0x10, %r9
jne 0x176b
jmp 0x188e
cmpq $0x2, %rsi
jl 0x1969
leaq (,%rsi,8), %r8
movl $0xf, %edi
subq %r8, %rdi
cmpq $-0x8, %rdi
movq $-0x9, %r9
cmovgeq %rdi, %r9
leaq (%r9,%rsi,8), %rsi
movl %esi, %r9d
shrl $0x4, %r9d
incl %r9d
andl $0x3, %r9d
je 0x18fd
shll $0x4, %r9d
movdqa 0x881(%rip), %xmm1      # 0x2050
movq %rax, %rdi
movdqa %xmm0, (%rdi)
paddq %xmm1, %xmm0
addq $0x10, %rdi
addq $-0x10, %r9
jne 0x17d2
jmp 0x1900
movq %rax, %r8
cmpq $0x30, %rsi
jb 0x1864
movq %r8, %rdi
negq %rdi
movdqa 0x850(%rip), %xmm1      # 0x2050
movdqa 0x858(%rip), %xmm2      # 0x2060
movdqa 0x860(%rip), %xmm3      # 0x2070
movdqa 0x868(%rip), %xmm4      # 0x2080
movdqa %xmm0, (%r8)
movdqa %xmm0, %xmm5
paddq %xmm1, %xmm5
movdqa %xmm5, 0x10(%r8)
movdqa %xmm0, %xmm5
paddq %xmm2, %xmm5
movdqa %xmm5, 0x20(%r8)
movdqa %xmm0, %xmm5
paddq %xmm3, %xmm5
movdqa %xmm5, 0x30(%r8)
paddq %xmm4, %xmm0
addq $0x40, %r8
leaq (%rcx,%rdi), %rsi
addq $-0x40, %rsi
addq $-0x40, %rdi
cmpq $0x8, %rsi
jg 0x1818
negq %rdi
cmpq %rcx, %r8
jae 0x198a
subq %rax, %rdi
sarq $0x3, %rdi
addq %rdx, %rdi
movq %rdi, (%r8)
addq $0x8, %r8
incq %rdi
cmpq %rcx, %r8
jb 0x1877
jmp 0x198a
movq %rax, %rdi
cmpq $0x30, %rsi
jb 0x1969
addq %rax, %r8
subq %rdi, %r8
movdqa 0x7aa(%rip), %xmm1      # 0x2050
movdqa 0x7b2(%rip), %xmm2      # 0x2060
movdqa 0x7ba(%rip), %xmm3      # 0x2070
movdqa 0x7c2(%rip), %xmm4      # 0x2080
movdqu %xmm0, (%rdi)
movdqa %xmm0, %xmm5
paddq %xmm1, %xmm5
movdqu %xmm5, 0x10(%rdi)
movdqa %xmm0, %xmm5
paddq %xmm2, %xmm5
movdqu %xmm5, 0x20(%rdi)
movdqa %xmm0, %xmm5
paddq %xmm3, %xmm5
movdqu %xmm5, 0x30(%rdi)
paddq %xmm4, %xmm0
addq $0x40, %rdi
addq $-0x40, %r8
cmpq $0x8, %r8
jg 0x18be
jmp 0x1969
movq %rax, %rdi
cmpq $0x30, %rsi
jb 0x1969
addq %rax, %r8
subq %rdi, %r8
movdqa 0x73c(%rip), %xmm1      # 0x2050
movdqa 0x744(%rip), %xmm2      # 0x2060
movdqa 0x74c(%rip), %xmm3      # 0x2070
movdqa 0x754(%rip), %xmm4      # 0x2080
movdqa %xmm0, (%rdi)
movdqa %xmm0, %xmm5
paddq %xmm1, %xmm5
movdqa %xmm5, 0x10(%rdi)
movdqa %xmm0, %xmm5
paddq %xmm2, %xmm5
movdqa %xmm5, 0x20(%rdi)
movdqa %xmm0, %xmm5
paddq %xmm3, %xmm5
movdqa %xmm5, 0x30(%rdi)
paddq %xmm4, %xmm0
addq $0x40, %rdi
addq $-0x40, %r8
cmpq $0x8, %r8
jg 0x192c
cmpq %rcx, %rdi
jae 0x198a
movq %rdi, %rsi
subq %rax, %rsi
sarq $0x3, %rsi
addq %rdx, %rsi
movq %rsi, (%rdi)
addq $0x8, %rdi
incq %rsi
cmpq %rcx, %rdi
jb 0x197b
retq
nop