const unsigned short *_initPlain_utf16() {
  static unsigned short plain[0x10000];
  unsigned short c = 0;
  for (c = 1; c; c++)
    plain[c] = c;
  plain[0] = 0;
  return plain;
}


x86 assembly (clang, -O0):
<_initPlain_utf16>:
push   %rbp
mov    %rsp,%rbp
movw   $0x0,-0x2(%rbp)
movw   $0x1,-0x2(%rbp)
cmpw   $0x0,-0x2(%rbp)
je     1141 <_initPlain_utf16+0x41>
mov    -0x2(%rbp),%dx
movzwl -0x2(%rbp),%eax
mov    %eax,%ecx
lea    0x2f04(%rip),%rax
mov    %dx,(%rax,%rcx,2)
mov    -0x2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x2(%rbp)
jmp    1110 <_initPlain_utf16+0x10>
movw   $0x0,0x2ee6(%rip)
lea    0x2edf(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_initPlain_utf16>:
movdqa 0xef8(%rip),%xmm0
xor    %eax,%eax
movdqa 0xefd(%rip),%xmm8
lea    0x2f16(%rip),%rcx
movdqa 0xefe(%rip),%xmm2
movdqa 0xf06(%rip),%xmm3
movdqa 0xf0e(%rip),%xmm4
movdqa 0xf16(%rip),%xmm5
movdqa 0xf1e(%rip),%xmm6
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movdqa %xmm0,%xmm7
paddw  %xmm8,%xmm7
movdqu %xmm0,0x2(%rcx,%rax,2)
movdqu %xmm7,0x12(%rcx,%rax,2)
movdqa %xmm0,%xmm7
paddw  %xmm2,%xmm7
movdqa %xmm0,%xmm1
paddw  %xmm3,%xmm1
movdqu %xmm7,0x22(%rcx,%rax,2)
movdqu %xmm1,0x32(%rcx,%rax,2)
movdqa %xmm0,%xmm1
paddw  %xmm4,%xmm1
movdqa %xmm0,%xmm7
paddw  %xmm5,%xmm7
movdqu %xmm1,0x42(%rcx,%rax,2)
movdqu %xmm7,0x52(%rcx,%rax,2)
add    $0x30,%rax
paddw  %xmm6,%xmm0
cmp    $0xfff0,%rax
jne    1150 <_initPlain_utf16+0x50>
movaps 0xebc(%rip),%xmm0
movups %xmm0,0x22e57(%rip)
lea    0x2e6e(%rip),%rax
movabs $0xfffcfffbfffafff9,%rcx
ff fc ff
mov    %rcx,0x22e4f(%rip)
movl   $0xfffefffd,0x22e4d(%rip)
ff fe ff
movw   $0xffff,0x22e48(%rip)
ff ff
movw   $0x0,0x2e41(%rip)
ret

LLVM IR (-O0):
@_initPlain_utf16.plain = internal global [65536 x i16] zeroinitializer
define i16* @_initPlain_utf16() {
%1 = alloca i16
store i16 0, i16* %1
store i16 1, i16* %1
br label %2
2: ; preds = %10, %0
%3 = load i16, i16* %1
%4 = icmp ne i16 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = load i16, i16* %1
%7 = load i16, i16* %1
%8 = zext i16 %7 to i64
%9 = getelementptr inbounds [65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 %8
store i16 %6, i16* %9
br label %10
10: ; preds = %5
%11 = load i16, i16* %1
%12 = add i16 %11, 1
store i16 %12, i16* %1
br label %2
13: ; preds = %2
store i16 0, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 0)
ret i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 0)
}

LLVM IR (-O2):
@_initPlain_utf16.plain = internal global [65536 x i16] zeroinitializer
define i16* @_initPlain_utf16() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %26, %1 ]
%3 = phi <8 x i16> [ <i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 8>, %0 ], [ %27, %1 ]
%4 = or i64 %2, 1
%5 = add <8 x i16> %3, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%6 = getelementptr inbounds [65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 %4
%7 = bitcast i16* %6 to <8 x i16>*
store <8 x i16> %3, <8 x i16>* %7
%8 = getelementptr inbounds i16, i16* %6, i64 8
%9 = bitcast i16* %8 to <8 x i16>*
store <8 x i16> %5, <8 x i16>* %9
%10 = add nuw nsw i64 %2, 16
%11 = add <8 x i16> %3, <i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16>
%12 = or i64 %10, 1
%13 = add <8 x i16> %3, <i16 24, i16 24, i16 24, i16 24, i16 24, i16 24, i16 24, i16 24>
%14 = getelementptr inbounds [65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 %12
%15 = bitcast i16* %14 to <8 x i16>*
store <8 x i16> %11, <8 x i16>* %15
%16 = getelementptr inbounds i16, i16* %14, i64 8
%17 = bitcast i16* %16 to <8 x i16>*
store <8 x i16> %13, <8 x i16>* %17
%18 = add nuw nsw i64 %2, 32
%19 = add <8 x i16> %3, <i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32>
%20 = or i64 %18, 1
%21 = add <8 x i16> %3, <i16 40, i16 40, i16 40, i16 40, i16 40, i16 40, i16 40, i16 40>
%22 = getelementptr inbounds [65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 %20
%23 = bitcast i16* %22 to <8 x i16>*
store <8 x i16> %19, <8 x i16>* %23
%24 = getelementptr inbounds i16, i16* %22, i64 8
%25 = bitcast i16* %24 to <8 x i16>*
store <8 x i16> %21, <8 x i16>* %25
%26 = add nuw nsw i64 %2, 48
%27 = add <8 x i16> %3, <i16 48, i16 48, i16 48, i16 48, i16 48, i16 48, i16 48, i16 48>
%28 = icmp eq i64 %26, 65520
br i1 %28, label %29, label %1
29: ; preds = %1
store i16 -15, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 65521)
store i16 -14, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 65522)
store i16 -13, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 65523)
store i16 -12, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 65524)
store i16 -11, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 65525)
store i16 -10, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 65526)
store i16 -9, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 65527)
store i16 -8, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 65528)
store i16 -7, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 65529)
store i16 -6, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 65530)
store i16 -5, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 65531)
store i16 -4, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 65532)
store i16 -3, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 65533)
store i16 -2, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 65534)
store i16 -1, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 65535)
store i16 0, i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 0)
ret i16* getelementptr inbounds ([65536 x i16], [65536 x i16]* @_initPlain_utf16.plain, i64 0, i64 0)
}