int main(int argc, char *argv[]) {
  short a[4] = {1, 2, 3, 4};
  short b[4] = {-4, -3, -2, -1};
  int c[2];
  int i = 4, j = 1, k = 0;
  asm volatile("movq %0,%%mm0" : : "m"(a[0]));
  asm volatile("movq %0,%%mm1" : : "m"(b[0]));
  asm volatile("nop" ::"a"(a[0]));
  asm volatile("nop" ::"b"(b[0]));
  asm volatile("add %eax,%ebx");
  asm volatile("nop" : "=b"(c[0]));
  asm volatile("emms");
  printf("%3d\n", k);
  for (i = 0; i < 4; i++)
    printf(" %3d", a[i]);
  printf("\n");
  for (i = 0; i < 4; i++)
    printf(" %3d", b[i]);
  printf("\n");
  for (i = 0; i < 2; i++)
    printf(" %3d", c[i]);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x38,%rsp
movl   $0x0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0xed2(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xecf(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x4,-0x34(%rbp)
movl   $0x1,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
lea    -0x20(%rbp),%rax
movq   (%rax),%mm0
lea    -0x28(%rbp),%rax
movq   (%rax),%mm1
mov    -0x20(%rbp),%ax
nop
mov    -0x28(%rbp),%bx
nop
add    %eax,%ebx
nop
mov    %ebx,-0x30(%rbp)
emms
mov    -0x3c(%rbp),%esi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x4,-0x34(%rbp)
jge    11b9 <main+0xa9>
movslq -0x34(%rbp),%rax
movswl -0x20(%rbp,%rax,2),%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    118a <main+0x7a>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x4,-0x34(%rbp)
jge    11fd <main+0xed>
movslq -0x34(%rbp),%rax
movswl -0x28(%rbp,%rax,2),%esi
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11ce <main+0xbe>
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x2,-0x34(%rbp)
jge    1240 <main+0x130>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1212 <main+0x102>
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x4000300020001,%rax
mov    %rax,0x10(%rsp)
movabs $0xfffffffefffdfffc,%rax
ff ff ff
mov    %rax,0x8(%rsp)
movq   0x10(%rsp),%mm0
movq   0x8(%rsp),%mm1
movzwl 0x10(%rsp),%eax
nop
movzwl 0x8(%rsp),%ebx
nop
add    %eax,%ebx
nop
emms
lea    0xe99(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movswl 0x10(%rsp),%esi
lea    0xe89(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movswl 0x12(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movswl 0x14(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movswl 0x16(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movswl 0x8(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movswl 0xa(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movswl 0xc(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movswl 0xe(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

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