int main() {
  unsigned short int usarray[8] = {2, 1, 3, 1, 4, 1, 5, 1};
  unsigned int uitemp[4] = {0};
  memcpy((char *)uitemp, (char *)usarray, 16);
  int i = 0;
  for (i = 0; i < 8; i++)
    printf("%-8x: %-8d %-8x\n", &(usarray[i]), usarray[i], usarray[i]);
  printf("--------------------------------\n");
  for (i = 0; i < 4; i++)
    printf("%-8x: %-8d %-8x\n", &(uitemp[i]), uitemp[i], uitemp[i]);
  printf("\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x8,-0x34(%rbp)
jge    11ba <main+0x9a>
movslq -0x34(%rbp),%rax
lea    -0x20(%rbp),%rsi
shl    $0x1,%rax
add    %rax,%rsi
movslq -0x34(%rbp),%rax
movzwl -0x20(%rbp,%rax,2),%edx
movslq -0x34(%rbp),%rax
movzwl -0x20(%rbp,%rax,2),%ecx
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1173 <main+0x53>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x4,-0x34(%rbp)
jge    1214 <main+0xf4>
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edx
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11cf <main+0xaf>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xec4(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0xec4(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
mov    $0x2,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x2(%rsp),%rsi
movzwl 0x2(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x4(%rsp),%rsi
movzwl 0x4(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x6(%rsp),%rsi
movzwl 0x6(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x8(%rsp),%rsi
movzwl 0x8(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xa(%rsp),%rsi
movzwl 0xa(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc(%rsp),%rsi
movzwl 0xc(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe(%rsp),%rsi
movzwl 0xe(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe1d(%rip),%rdi
call   1040 <puts@plt>
mov    0x10(%rsp),%ecx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x14(%rsp),%rsi
mov    0x14(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x18(%rsp),%rsi
mov    0x18(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    0x1c(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.usarray = [8 x i16] [i16 2, i16 1, i16 3, i16 1, i16 4, i16 1, i16 5, i16 1]
@.str = [17 x i8] c"%-8x: %-8d %-8x\0A\00"
@.str.1 = [34 x i8] c"--------------------------------\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i16]
%3 = alloca [4 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [8 x i16]* %2 to i8*
%6 = bitcast [4 x i32]* %3 to i8*
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%8 = bitcast i32* %7 to i8*
%9 = getelementptr inbounds [8 x i16], [8 x i16]* %2, i64 0, i64 0
%10 = bitcast i16* %9 to i8*
store i32 0, i32* %4
store i32 0, i32* %4
br label %11
11: ; preds = %29, %0
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 8
br i1 %13, label %14, label %32
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [8 x i16], [8 x i16]* %2, i64 0, i64 %16
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [8 x i16], [8 x i16]* %2, i64 0, i64 %19
%21 = load i16, i16* %20
%22 = zext i16 %21 to i32
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [8 x i16], [8 x i16]* %2, i64 0, i64 %24
%26 = load i16, i16* %25
%27 = zext i16 %26 to i32
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i16* %17, i32 %22, i32 %27)
br label %29
29: ; preds = %14
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %11
32: ; preds = %11
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %4
br label %34
34: ; preds = %50, %32
%35 = load i32, i32* %4
%36 = icmp slt i32 %35, 4
br i1 %36, label %37, label %53
37: ; preds = %34
%38 = load i32, i32* %4
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %39
%41 = load i32, i32* %4
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %42
%44 = load i32, i32* %43
%45 = load i32, i32* %4
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %46
%48 = load i32, i32* %47
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %40, i32 %44, i32 %48)
br label %50
50: ; preds = %37
%51 = load i32, i32* %4
%52 = add nsw i32 %51, 1
store i32 %52, i32* %4
br label %34
53: ; preds = %34
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@__const.main.usarray = [8 x i16] [i16 2, i16 1, i16 3, i16 1, i16 4, i16 1, i16 5, i16 1]
@.str = [17 x i8] c"%-8x: %-8d %-8x\0A\00"
@str = [33 x i8] c"--------------------------------\00"
define i32 @main() {
%1 = alloca [8 x i16]
%2 = alloca [4 x i32]
%3 = bitcast [8 x i16]* %1 to i8*
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [8 x i16], [8 x i16]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i16* %5, i32 2, i32 2)
%7 = getelementptr inbounds [8 x i16], [8 x i16]* %1, i64 0, i64 1
%8 = load i16, i16* %7
%9 = zext i16 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i16* %7, i32 %9, i32 %9)
%11 = getelementptr inbounds [8 x i16], [8 x i16]* %1, i64 0, i64 2
%12 = load i16, i16* %11
%13 = zext i16 %12 to i32
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i16* %11, i32 %13, i32 %13)
%15 = getelementptr inbounds [8 x i16], [8 x i16]* %1, i64 0, i64 3
%16 = load i16, i16* %15
%17 = zext i16 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i16* %15, i32 %17, i32 %17)
%19 = getelementptr inbounds [8 x i16], [8 x i16]* %1, i64 0, i64 4
%20 = load i16, i16* %19
%21 = zext i16 %20 to i32
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i16* %19, i32 %21, i32 %21)
%23 = getelementptr inbounds [8 x i16], [8 x i16]* %1, i64 0, i64 5
%24 = load i16, i16* %23
%25 = zext i16 %24 to i32
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i16* %23, i32 %25, i32 %25)
%27 = getelementptr inbounds [8 x i16], [8 x i16]* %1, i64 0, i64 6
%28 = load i16, i16* %27
%29 = zext i16 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i16* %27, i32 %29, i32 %29)
%31 = getelementptr inbounds [8 x i16], [8 x i16]* %1, i64 0, i64 7
%32 = load i16, i16* %31
%33 = zext i16 %32 to i32
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i16* %31, i32 %33, i32 %33)
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%36 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%37 = load i32, i32* %36
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %36, i32 %37, i32 %37)
%39 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%40 = load i32, i32* %39
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %39, i32 %40, i32 %40)
%42 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%43 = load i32, i32* %42
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %42, i32 %43, i32 %43)
%45 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
%46 = load i32, i32* %45
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %45, i32 %46, i32 %46)
%48 = call i32 @putchar(i32 10)
ret i32 1
}