void test_1(void) {
  static unsigned int bm[16];
  int j;
  for (j = 0; j < 16; j++)
    bm[j] <<= 8;
}


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    113e <test_1+0x3e>
movslq -0x4(%rbp),%rcx
lea    0x2f10(%rip),%rax
mov    (%rax,%rcx,4),%edx
shl    $0x8,%edx
lea    0x2f03(%rip),%rax
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_1+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
shll   $0x8,0x2f29(%rip)
shll   $0x8,0x2f32(%rip)
shll   $0x8,0x2f33(%rip)
shll   $0x8,0x2f34(%rip)
shll   $0x8,0x2f3d(%rip)
shll   $0x8,0x2f46(%rip)
shll   $0x8,0x2f47(%rip)
shll   $0x8,0x2f48(%rip)
shll   $0x8,0x2f51(%rip)
shll   $0x8,0x2f5a(%rip)
shll   $0x8,0x2f5b(%rip)
shll   $0x8,0x2f5c(%rip)
shll   $0x8,0x2f65(%rip)
shll   $0x8,0x2f6e(%rip)
shll   $0x8,0x2f6f(%rip)
shll   $0x8,0x2f70(%rip)
ret

LLVM IR (-O0):
@test_1.bm = internal global [16 x i32] zeroinitializer
define void @test_1() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %11, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 16
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = load i32, i32* %1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [16 x i32], [16 x i32]* @test_1.bm, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
store i32 %10, i32* %8
br label %11
11: ; preds = %5
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %2
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@test_1.bm.0 = internal unnamed_addr global i32 0
@test_1.bm.1 = internal unnamed_addr global i32 0
@test_1.bm.2 = internal unnamed_addr global i32 0
@test_1.bm.3 = internal unnamed_addr global i32 0
@test_1.bm.4 = internal unnamed_addr global i32 0
@test_1.bm.5 = internal unnamed_addr global i32 0
@test_1.bm.6 = internal unnamed_addr global i32 0
@test_1.bm.7 = internal unnamed_addr global i32 0
@test_1.bm.8 = internal unnamed_addr global i32 0
@test_1.bm.9 = internal unnamed_addr global i32 0
@test_1.bm.10 = internal unnamed_addr global i32 0
@test_1.bm.11 = internal unnamed_addr global i32 0
@test_1.bm.12 = internal unnamed_addr global i32 0
@test_1.bm.13 = internal unnamed_addr global i32 0
@test_1.bm.14 = internal unnamed_addr global i32 0
@test_1.bm.15 = internal unnamed_addr global i32 0
define void @test_1() {
%1 = load i32, i32* @test_1.bm.0
%2 = shl i32 %1, 8
store i32 %2, i32* @test_1.bm.0
%3 = load i32, i32* @test_1.bm.1
%4 = shl i32 %3, 8
store i32 %4, i32* @test_1.bm.1
%5 = load i32, i32* @test_1.bm.2
%6 = shl i32 %5, 8
store i32 %6, i32* @test_1.bm.2
%7 = load i32, i32* @test_1.bm.3
%8 = shl i32 %7, 8
store i32 %8, i32* @test_1.bm.3
%9 = load i32, i32* @test_1.bm.4
%10 = shl i32 %9, 8
store i32 %10, i32* @test_1.bm.4
%11 = load i32, i32* @test_1.bm.5
%12 = shl i32 %11, 8
store i32 %12, i32* @test_1.bm.5
%13 = load i32, i32* @test_1.bm.6
%14 = shl i32 %13, 8
store i32 %14, i32* @test_1.bm.6
%15 = load i32, i32* @test_1.bm.7
%16 = shl i32 %15, 8
store i32 %16, i32* @test_1.bm.7
%17 = load i32, i32* @test_1.bm.8
%18 = shl i32 %17, 8
store i32 %18, i32* @test_1.bm.8
%19 = load i32, i32* @test_1.bm.9
%20 = shl i32 %19, 8
store i32 %20, i32* @test_1.bm.9
%21 = load i32, i32* @test_1.bm.10
%22 = shl i32 %21, 8
store i32 %22, i32* @test_1.bm.10
%23 = load i32, i32* @test_1.bm.11
%24 = shl i32 %23, 8
store i32 %24, i32* @test_1.bm.11
%25 = load i32, i32* @test_1.bm.12
%26 = shl i32 %25, 8
store i32 %26, i32* @test_1.bm.12
%27 = load i32, i32* @test_1.bm.13
%28 = shl i32 %27, 8
store i32 %28, i32* @test_1.bm.13
%29 = load i32, i32* @test_1.bm.14
%30 = shl i32 %29, 8
store i32 %30, i32* @test_1.bm.14
%31 = load i32, i32* @test_1.bm.15
%32 = shl i32 %31, 8
store i32 %32, i32* @test_1.bm.15
ret void
}