// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x68, %rsp
leaq 0x38(%rsp), %rbx
movl $0x190, %r15d           # imm = 0x190
leaq 0x20(%rsp), %rdx
movl $0x190, %esi            # imm = 0x190
movq %rbx, %rdi
callq 0x156c
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x15be
movq 0x38(%rsp), %r14
movq %r14, %rdx
pushq $0xd
popq %rax
movq %r14, %rcx
andq $0x3, %rdx
je 0x127b
cmpq $0x3, %rdx
je 0x1269
cmpl $0x2, %edx
je 0x1261
movq %r14, %rcx
addq $0x4, %rcx
movl $0xd, (%r14)
pushq $0xe
popq %rax
movl %eax, (%rcx)
addq $0x4, %rcx
incl %eax
orq $0x18c, %rdx            # imm = 0x18C
movl %eax, (%rcx)
addq $0x4, %rcx
incl %eax
movq %rdx, %r15
testb $0xf, %cl
jne 0x14d8
leaq (%rcx,%r15,4), %rdx
leal 0x1(%rax), %esi
movd %eax, %xmm0
movd %esi, %xmm1
pshufd $0x50, %xmm0, %xmm2     # xmm2 = xmm0[0,0,1,1]
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
paddd 0xd6c(%rip), %xmm2      # 0x2010
punpcklqdq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0]
shll $0x2, %r15d
xorl %edi, %edi
movdqa 0xd6a(%rip), %xmm1      # 0x2020
movdqa 0xd72(%rip), %xmm2      # 0x2030
movdqa 0xd7a(%rip), %xmm3      # 0x2040
movdqa 0xd82(%rip), %xmm4      # 0x2050
movq %rcx, %rsi
cmpq $0xd, %r15
jl 0x1336
movdqa %xmm0, (%rcx,%rdi)
leaq -0x10(%r15), %r8
cmpq $0xd, %r8
jl 0x133e
movdqa %xmm0, %xmm5
paddd %xmm1, %xmm5
movdqa %xmm5, 0x10(%rcx,%rdi)
leaq -0x20(%r15), %r8
cmpq $0xd, %r8
jl 0x134c
movdqa %xmm0, %xmm5
paddd %xmm2, %xmm5
movdqa %xmm5, 0x20(%rcx,%rdi)
leaq -0x30(%r15), %r8
cmpq $0xd, %r8
jl 0x135a
movdqa %xmm0, %xmm5
paddd %xmm3, %xmm5
movdqa %xmm5, 0x30(%rcx,%rdi)
paddd %xmm4, %xmm0
addq $0x40, %rsi
addq $0x40, %rdi
addq $-0x40, %r15
jmp 0x12d1
movq %rcx, %r8
addq %rdi, %r8
jmp 0x1365
addq $0x10, %rsi
leaq (%rcx,%rdi), %r8
addq $0x10, %r8
jmp 0x1365
addq $0x20, %rsi
leaq (%rcx,%rdi), %r8
addq $0x20, %r8
jmp 0x1365
leaq (%rcx,%rdi), %r8
addq $0x30, %r8
movq %r8, %rsi
subq %rcx, %rsi
shrq $0x2, %rsi
addl %esi, %eax
cmpq %rdx, %r8
jae 0x137e
movl %eax, (%r8)
addq $0x4, %r8
incl %eax
jmp 0x136e
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rax
pushq $0xd
popq %rcx
movq %rdx, %rsi
cmpq %rax, %rsi
je 0x139d
movl %ecx, (%rsi)
incl %ecx
addq $0x4, %rsi
jmp 0x138e
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x19ce
testb %al, %al
je 0x14f1
movq 0x2c25(%rip), %r15      # 0x3fe0
leaq 0xd2d(%rip), %rbx       # 0x20ef
xorl %r12d, %r12d
cmpq $0x640, %r12            # imm = 0x640
jae 0x13e5
movq (%r15), %rdi
movl (%r14,%r12), %edx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10d0
addq $0x4, %r12
jmp 0x13c5
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x10c0
leaq 0x8(%rsp), %rdi
leaq 0x50(%rsp), %rdx
movl $0x190, %esi            # imm = 0x190
callq 0x160c
leaq 0x50(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movl $0x190, %esi            # imm = 0x190
callq 0x160c
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
sarq $0x3, %rsi
pushq $0x1
popq %rcx
movl $0x1a4, %edx            # imm = 0x1A4
callq 0x165d
movl $0x1a4, %eax            # imm = 0x1A4
movl $0xc80, %ecx            # imm = 0xC80
movq 0x50(%rsp), %rdx
testq %rcx, %rcx
je 0x145b
movq %rax, -0xd20(%rdx,%rax,8)
incq %rax
addq $-0x8, %rcx
jmp 0x1445
movq 0x8(%rsp), %rdi
leaq 0xc8c(%rip), %rbx       # 0x20f3
movq %rdi, %r14
leaq 0xc80(%rdi), %rax
cmpq %rax, %r14
jae 0x1491
movq (%r15), %rdi
movq (%r14), %rdx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10d0
addq $0x8, %r14
movq 0x8(%rsp), %rdi
jmp 0x146a
movq 0x10(%rsp), %rsi
movq %rdi, %rdx
callq 0x1b1a
testb %al, %al
je 0x150a
leaq 0x50(%rsp), %rdi
callq 0x1a40
leaq 0x8(%rsp), %rdi
callq 0x1a40
leaq 0x20(%rsp), %rdi
callq 0x18ea
leaq 0x38(%rsp), %rdi
callq 0x18ea
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xc49(%rip), %rdi       # 0x2128
leaq 0xc63(%rip), %rsi       # 0x2149
leaq 0xc6b(%rip), %rcx       # 0x2158
pushq $0x47
jmp 0x1521
leaq 0xba8(%rip), %rdi       # 0x20a0
leaq 0xbd4(%rip), %rsi       # 0x20d3
leaq 0xbde(%rip), %rcx       # 0x20e4
pushq $0xc
jmp 0x1521
leaq 0xbe7(%rip), %rdi       # 0x20f8
leaq 0xbbb(%rip), %rsi       # 0x20d3
leaq 0xbc5(%rip), %rcx       # 0x20e4
pushq $0x13
popq %rdx
callq 0x1080
movq %rax, %rbx
jmp 0x1545
jmp 0x152e
movq %rax, %rbx
jmp 0x154f
movq %rax, %rbx
jmp 0x1559
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x1a40
leaq 0x8(%rsp), %rdi
callq 0x1a40
leaq 0x20(%rsp), %rdi
callq 0x18ea
leaq 0x38(%rsp), %rdi
callq 0x18ea
movq %rbx, %rdi
callq 0x10f0
nop