// File: /workspace/github_c_makefile_star2_O3/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
movl $0x640, %edi            # imm = 0x640
callq 0x1070
movq %rsp, %rbx
movq %rax, (%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 0x17e6
movq (%rsp), %rbx
movq %rbx, %r8
andq $0x3, %r8
jne 0x12a1
movl $0x190, %r8d            # imm = 0x190
movl $0xd, %eax
movq %rbx, %rdi
jmp 0x12de
movl $0xd, %eax
movq %rbx, %rdi
cmpq $0x3, %r8
je 0x12cf
cmpl $0x2, %r8d
je 0x12c7
movq %rbx, %rdi
addq $0x4, %rdi
movl $0xd, (%rbx)
movl $0xe, %eax
movl %eax, (%rdi)
addq $0x4, %rdi
incl %eax
orq $0x18c, %r8             # imm = 0x18C
movl %eax, (%rdi)
addq $0x4, %rdi
incl %eax
testb $0xf, %dil
jne 0x1746
leal 0x1(%rax), %ecx
movd %eax, %xmm0
movd %ecx, %xmm1
pshufd $0x50, %xmm0, %xmm2     # xmm2 = xmm0[0,0,1,1]
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
paddd 0xd0c(%rip), %xmm2      # 0x2010
punpcklqdq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0]
leal -0xd(,%r8,4), %ecx
shrl $0x4, %ecx
incl %ecx
andl $0x3, %ecx
jne 0x131f
movq %rdi, %rdx
jmp 0x133f
shll $0x4, %ecx
movdqa 0xcf6(%rip), %xmm1      # 0x2020
movq %rdi, %rdx
movdqa %xmm0, (%rdx)
paddd %xmm1, %xmm0
addq $0x10, %rdx
addq $-0x10, %rcx
jne 0x132d
leaq (%rdi,%r8,4), %rsi
movq %rdx, %r9
subq %rdi, %r9
movdqa 0xccf(%rip), %xmm1      # 0x2020
movdqa 0xcd7(%rip), %xmm2      # 0x2030
movdqa 0xcdf(%rip), %xmm3      # 0x2040
movdqa 0xce7(%rip), %xmm4      # 0x2050
movdqa %xmm0, (%rdx)
movdqa %xmm0, %xmm5
paddd %xmm1, %xmm5
movdqa %xmm5, 0x10(%rdx)
movdqa %xmm0, %xmm5
paddd %xmm2, %xmm5
movdqa %xmm5, 0x20(%rdx)
movdqa %xmm0, %xmm5
paddd %xmm3, %xmm5
movdqa %xmm5, 0x30(%rdx)
paddd %xmm4, %xmm0
addq $0x40, %rdx
movq %rsi, %rcx
subq %rdx, %rcx
addq $0x40, %r9
cmpq $0xc, %rcx
jg 0x1369
movabsq $0x7ffffffffffffff0, %rcx # imm = 0x7FFFFFFFFFFFFFF0
cmpq %rsi, %rdx
jae 0x1502
leaq (%rcx,%r8,4), %r8
addq $0x3, %r8
andq %rcx, %r8
leaq (%r8,%rdi), %r10
addq $0x14, %r10
cmpq %rsi, %r10
cmovaq %r10, %rsi
addq $-0x11, %rsi
movq %rsi, %r11
subq %r8, %r11
subq %rdi, %r11
movq %r11, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
psrlq $0x2, %xmm0
subq %rdi, %rsi
subq %r8, %rsi
shrq $0x2, %rsi
addq $0x4, %rsi
andq $-0x4, %rsi
shrq $0x2, %r9
addl %r9d, %eax
xorl %edi, %edi
movdqa 0xc48(%rip), %xmm1      # 0x2060
movdqa 0xc50(%rip), %xmm2      # 0x2070
movdqa 0xc58(%rip), %xmm3      # 0x2080
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movq %rdi, %xmm5
pshufd $0x44, %xmm5, %xmm5     # xmm5 = xmm5[0,1,0,1]
movdqa %xmm5, %xmm6
por %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %r8d
notl %r8d
testb $0x1, %r8b
je 0x147d
leaq (%rax,%rdi), %r8
movl %r8d, (%rdx,%rdi,4)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %r8d
testb $0x1, %r8b
je 0x1499
leal (%rax,%rdi), %r8d
incl %r8d
movl %r8d, 0x4(%rdx,%rdi,4)
por %xmm1, %xmm5
pxor %xmm3, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
pxor %xmm4, %xmm5
pextrw $0x0, %xmm5, %r8d
testb $0x1, %r8b
je 0x14dc
leal (%rax,%rdi), %r8d
addl $0x2, %r8d
movl %r8d, 0x8(%rdx,%rdi,4)
pextrw $0x4, %xmm5, %r8d
testb $0x1, %r8b
je 0x14f5
leal (%rax,%rdi), %r8d
addl $0x3, %r8d
movl %r8d, 0xc(%rdx,%rdi,4)
addq $0x4, %rdi
cmpq %rdi, %rsi
jne 0x1430
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rax
cmpq %rax, %rsi
je 0x1612
subq %rsi, %rax
addq $-0x4, %rax
movq %rax, %xmm0
shrq $0x2, %rax
addq $0x4, %rax
addq $0xc, %rcx
andq %rax, %rcx
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
psrlq $0x2, %xmm0
xorl %eax, %eax
movdqa 0xb1c(%rip), %xmm1      # 0x2060
movdqa 0xb24(%rip), %xmm2      # 0x2070
movdqa 0xb2c(%rip), %xmm3      # 0x2080
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movq %rax, %xmm5
pshufd $0x44, %xmm5, %xmm5     # xmm5 = xmm5[0,1,0,1]
movdqa %xmm5, %xmm6
por %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %edx
notl %edx
testb $0x1, %dl
je 0x15a4
leal 0xd(%rax), %edx
movl %edx, (%rsi,%rax,4)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0x15b9
leal 0xe(%rax), %edx
movl %edx, 0x4(%rsi,%rax,4)
por %xmm1, %xmm5
pxor %xmm3, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
pxor %xmm4, %xmm5
pextrw $0x0, %xmm5, %edx
testb $0x1, %dl
je 0x15f4
leal 0xf(%rax), %edx
movl %edx, 0x8(%rsi,%rax,4)
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x1605
leal 0x10(%rax), %edx
movl %edx, 0xc(%rsi,%rax,4)
addq $0x4, %rax
cmpq %rax, %rcx
jne 0x155c
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
subq %rdi, %rdx
je 0x162d
callq 0x1090
testl %eax, %eax
jne 0x1765
movq %rbx, %rdi
callq 0x10f0
movq 0x29a4(%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, %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 0x1866
movdqa 0x9ef(%rip), %xmm0      # 0x2090
xorl %eax, %eax
movdqa 0x9f5(%rip), %xmm1      # 0x20a0
movdqu %xmm0, (%r14,%rax,8)
addq $0x2, %rax
paddq %xmm1, %xmm0
cmpq $0x190, %rax            # imm = 0x190
jne 0x16ab
movq $-0x8, %r13
leaq 0xa64(%rip), %r15       # 0x2133
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 0x16cf
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 0x1720
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x1080
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1736
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 0x9eb(%rip), %rdi       # 0x2138
leaq 0xa05(%rip), %rsi       # 0x2159
leaq 0xa0d(%rip), %rcx       # 0x2168
movl $0x47, %edx
callq 0x1050
leaq 0x974(%rip), %rdi       # 0x20e0
leaq 0x9a0(%rip), %rsi       # 0x2113
leaq 0x9aa(%rip), %rcx       # 0x2124
movl $0xc, %edx
callq 0x1050
movq %rax, %r15
movl $0xc80, %esi            # imm = 0xC80
movq %r14, %rdi
callq 0x1080
jmp 0x1799
movq %rax, %r15
movl $0xc80, %esi            # imm = 0xC80
movq %rbx, %rdi
callq 0x1080
jmp 0x17ab
movq %rax, %r15
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x17c7
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x1080
jmp 0x17c7
movq %rax, %r15
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x17dd
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x1080
movq %r15, %rdi
callq 0x10d0
nop