// File: /workspace/github_c_makefile_star2_O1/dnbaker[P]fastiota/testfastiota.cpp
// Function: main
int main() {
    int n = 400;
    std::vector<uint32_t> dat(n), datcmp(dat);
    uint32_t *ptr = dat.data();
    fastiota32(ptr, n, 13);
    std::iota(datcmp.begin(), datcmp.end(), 13u);
    assert(std::equal(dat.begin(), dat.end(), datcmp.begin()));
    for(uint32_t *s = ptr; s < ptr + n; ++s) fprintf(stderr, "%u,", *s);
    fputc('\n', stderr);
    std::vector<uint64_t> d64(n), dc64(n);
    fastiota::iota(d64.data(), d64.size(), 420);
    std::iota(dc64.data(), dc64.data() + n, uint64_t(420));
    for(auto s = d64.data(); s < d64.data() + n; ++s) fprintf(stderr, "%lu,", (unsigned long)*s);
    assert(std::equal(d64.begin(), d64.end(), d64.begin()));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
pxor %xmm0, %xmm0
movq %rsp, %rbx
movdqa %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movl $0x640, %edi            # imm = 0x640
callq 0x1070
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
leaq 0x640(%rax), %r14
movq %r14, 0x10(%rbx)
movl $0x640, %edx            # imm = 0x640
movq %rax, %rdi
xorl %esi, %esi
callq 0x1040
movq %r14, 0x8(%rbx)
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x15d2
movq (%rsp), %rbx
movq %rbx, %rdx
andq $0x3, %rdx
jne 0x12b4
movl $0x190, %edx            # imm = 0x190
movl $0xd, %eax
movq %rbx, %rcx
jmp 0x12ed
movl $0xd, %eax
movq %rbx, %rcx
cmpq $0x3, %rdx
je 0x12de
cmpl $0x2, %edx
je 0x12d6
leaq 0x4(%rbx), %rcx
movl $0xd, (%rbx)
movl $0xe, %eax
movl %eax, (%rcx)
addq $0x4, %rcx
incl %eax
orq $0x18c, %rdx            # imm = 0x18C
movl %eax, (%rcx)
addq $0x4, %rcx
incl %eax
testb $0xf, %cl
jne 0x1532
leal 0x1(%rax), %esi
leal 0x2(%rax), %edi
leal 0x3(%rax), %r8d
movd %r8d, %xmm0
movd %edi, %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd %eax, %xmm0
movd %esi, %xmm2
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
punpcklqdq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0]
leal (,%rdx,4), %edi
leal -0xd(,%rdx,4), %r8d
shrl $0x4, %r8d
incl %r8d
andl $0x3, %r8d
jne 0x133e
movq %rcx, %rsi
jmp 0x135f
shll $0x4, %r8d
movdqa 0xcc6(%rip), %xmm1      # 0x2010
movq %rcx, %rsi
movdqa %xmm0, (%rsi)
paddd %xmm1, %xmm0
addq $0x10, %rsi
addq $-0x10, %r8
jne 0x134d
leaq (%rcx,%rdx,4), %rdx
subq %rsi, %rcx
movdqa 0xca2(%rip), %xmm1      # 0x2010
movdqa 0xcaa(%rip), %xmm2      # 0x2020
movdqa 0xcb2(%rip), %xmm3      # 0x2030
movdqa 0xcba(%rip), %xmm4      # 0x2040
movdqa %xmm0, (%rsi)
movdqa %xmm0, %xmm5
paddd %xmm1, %xmm5
movdqa %xmm5, 0x10(%rsi)
movdqa %xmm0, %xmm5
paddd %xmm2, %xmm5
movdqa %xmm5, 0x20(%rsi)
movdqa %xmm0, %xmm5
paddd %xmm3, %xmm5
movdqa %xmm5, 0x30(%rsi)
paddd %xmm4, %xmm0
addq $0x40, %rsi
leaq (%rdi,%rcx), %r8
addq $-0x40, %r8
addq $-0x40, %rcx
cmpq $0xc, %r8
jg 0x1386
cmpq %rdx, %rsi
jae 0x13e6
negq %rcx
shrq $0x2, %rcx
addl %ecx, %eax
movl %eax, (%rsi)
addq $0x4, %rsi
incl %eax
cmpq %rdx, %rsi
jb 0x13d9
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rax
cmpq %rax, %rsi
je 0x140a
movl $0xd, %ecx
movq %rsi, %rdx
movl %ecx, (%rdx)
incl %ecx
addq $0x4, %rdx
cmpq %rax, %rdx
jne 0x13fd
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
je 0x1425
callq 0x1090
testl %eax, %eax
jne 0x1551
movq %rbx, %rdi
callq 0x10f0
movq 0x2bac(%rip), %r12      # 0x3fe0
movq (%r12), %rsi
movl $0xa, %edi
callq 0x10a0
movl $0xc80, %edi            # imm = 0xC80
callq 0x1070
movq %rax, %rbx
movl $0xc80, %edx            # imm = 0xC80
movq %rax, %rdi
xorl %esi, %esi
callq 0x1040
movl $0xc80, %edi            # imm = 0xC80
callq 0x1070
movq %rax, %r14
movl $0xc80, %r15d           # imm = 0xC80
movl $0xc80, %edx            # imm = 0xC80
movq %rax, %rdi
xorl %esi, %esi
callq 0x1040
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
movl $0x1a4, %edx            # imm = 0x1A4
movl $0x1, %ecx
callq 0x1652
movl $0x1a4, %eax            # imm = 0x1A4
movq %rax, -0xd20(%r14,%rax,8)
incq %rax
addq $-0x8, %r15
jne 0x149c
movq $-0x8, %r13
leaq 0xc28(%rip), %r15       # 0x20e3
movq (%r12), %rdi
movq 0x8(%rbx,%r13), %rdx
movq %r15, %rsi
xorl %eax, %eax
callq 0x10b0
addq $0x8, %r13
cmpq $0xc78, %r13            # imm = 0xC78
jb 0x14bb
movl $0xc80, %esi            # imm = 0xC80
movq %r14, %rdi
callq 0x1080
movl $0xc80, %esi            # imm = 0xC80
movq %rbx, %rdi
callq 0x1080
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x150c
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x1080
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1522
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x1080
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0xbaf(%rip), %rdi       # 0x20e8
leaq 0xbc9(%rip), %rsi       # 0x2109
leaq 0xbd1(%rip), %rcx       # 0x2118
movl $0x47, %edx
callq 0x1050
leaq 0xb38(%rip), %rdi       # 0x2090
leaq 0xb64(%rip), %rsi       # 0x20c3
leaq 0xb6e(%rip), %rcx       # 0x20d4
movl $0xc, %edx
callq 0x1050
movq %rax, %r15
movl $0xc80, %esi            # imm = 0xC80
movq %r14, %rdi
callq 0x1080
jmp 0x1585
movq %rax, %r15
movl $0xc80, %esi            # imm = 0xC80
movq %rbx, %rdi
callq 0x1080
jmp 0x1597
movq %rax, %r15
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x15b3
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x1080
jmp 0x15b3
movq %rax, %r15
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x15c9
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x1080
movq %r15, %rdi
callq 0x10d0
nop