const unsigned short *_initPlain_gbk() {
  static unsigned short plain[0x8000];
  unsigned short c = 0;
  for (c = 0; c < 0x8000; c++)
    plain[c] = (((unsigned short)(c | 0x8000) >> 8) |
                (unsigned short)(c | 0x8000) << 8);
  return plain;
}


x86 assembly (clang, -O0):
<_initPlain_gbk>:
push   %rbp
mov    %rsp,%rbp
movw   $0x0,-0x2(%rbp)
movw   $0x0,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x8000,%eax
jge    1165 <_initPlain_gbk+0x65>
movzwl -0x2(%rbp),%eax
or     $0x8000,%eax
movzwl %ax,%eax
sar    $0x8,%eax
movzwl -0x2(%rbp),%ecx
or     $0x8000,%ecx
movzwl %cx,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %ax,%dx
movzwl -0x2(%rbp),%eax
mov    %eax,%ecx
lea    0x2ee0(%rip),%rax
mov    %dx,(%rax,%rcx,2)
mov    -0x2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x2(%rbp)
jmp    1110 <_initPlain_gbk+0x10>
lea    0x2ec4(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_initPlain_gbk>:
movdqa 0xef8(%rip),%xmm0
xor    %eax,%eax
movdqa 0xefe(%rip),%xmm1
movdqa 0xf06(%rip),%xmm2
lea    0x2f0f(%rip),%rcx
movdqa 0xf07(%rip),%xmm3
nopl   0x0(%rax)
movdqa %xmm0,%xmm4
paddw  %xmm1,%xmm4
movdqa %xmm0,%xmm5
por    %xmm2,%xmm5
movdqa %xmm4,%xmm6
por    %xmm2,%xmm6
psrlw  $0x8,%xmm5
movdqa %xmm0,%xmm7
psllw  $0x8,%xmm7
por    %xmm5,%xmm7
psrlw  $0x8,%xmm6
psllw  $0x8,%xmm4
por    %xmm6,%xmm4
movdqa %xmm7,(%rcx,%rax,2)
movdqa %xmm4,0x10(%rcx,%rax,2)
add    $0x10,%rax
paddw  %xmm3,%xmm0
cmp    $0x8000,%rax
jne    1130 <_initPlain_gbk+0x30>
lea    0x2ea6(%rip),%rax
ret

LLVM IR (-O0):
@_initPlain_gbk.plain = internal global [32768 x i16] zeroinitializer
define i16* @_initPlain_gbk() {
%1 = alloca i16
store i16 0, i16* %1
store i16 0, i16* %1
br label %2
2: ; preds = %24, %0
%3 = load i16, i16* %1
%4 = zext i16 %3 to i32
%5 = icmp slt i32 %4, 32768
br i1 %5, label %6, label %27
6: ; preds = %2
%7 = load i16, i16* %1
%8 = zext i16 %7 to i32
%9 = or i32 %8, 32768
%10 = trunc i32 %9 to i16
%11 = zext i16 %10 to i32
%12 = ashr i32 %11, 8
%13 = load i16, i16* %1
%14 = zext i16 %13 to i32
%15 = or i32 %14, 32768
%16 = trunc i32 %15 to i16
%17 = zext i16 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %12, %18
%20 = trunc i32 %19 to i16
%21 = load i16, i16* %1
%22 = zext i16 %21 to i64
%23 = getelementptr inbounds [32768 x i16], [32768 x i16]* @_initPlain_gbk.plain, i64 0, i64 %22
store i16 %20, i16* %23
br label %24
24: ; preds = %6
%25 = load i16, i16* %1
%26 = add i16 %25, 1
store i16 %26, i16* %1
br label %2
27: ; preds = %2
ret i16* getelementptr inbounds ([32768 x i16], [32768 x i16]* @_initPlain_gbk.plain, i64 0, i64 0)
}

LLVM IR (-O2):
@_initPlain_gbk.plain = internal global [32768 x i16] zeroinitializer
define i16* @_initPlain_gbk() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %13, %1 ]
%3 = phi <8 x i16> [ <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7>, %0 ], [ %14, %1 ]
%4 = add <8 x i16> %3, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
%5 = or <8 x i16> %3, <i16 -32768, i16 -32768, i16 -32768, i16 -32768, i16 -32768, i16 -32768, i16 -32768, i16 -32768>
%6 = or <8 x i16> %4, <i16 -32768, i16 -32768, i16 -32768, i16 -32768, i16 -32768, i16 -32768, i16 -32768, i16 -32768>
%7 = call <8 x i16> @llvm.fshl.v8i16(<8 x i16> %3, <8 x i16> %5, <8 x i16> <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>)
%8 = call <8 x i16> @llvm.fshl.v8i16(<8 x i16> %4, <8 x i16> %6, <8 x i16> <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>)
%9 = getelementptr inbounds [32768 x i16], [32768 x i16]* @_initPlain_gbk.plain, i64 0, i64 %2
%10 = bitcast i16* %9 to <8 x i16>*
store <8 x i16> %7, <8 x i16>* %10
%11 = getelementptr inbounds i16, i16* %9, i64 8
%12 = bitcast i16* %11 to <8 x i16>*
store <8 x i16> %8, <8 x i16>* %12
%13 = add nuw i64 %2, 16
%14 = add <8 x i16> %3, <i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16>
%15 = icmp eq i64 %13, 32768
br i1 %15, label %16, label %1
16: ; preds = %1
ret i16* getelementptr inbounds ([32768 x i16], [32768 x i16]* @_initPlain_gbk.plain, i64 0, i64 0)
}