int main() {
  int p[4] = {16, 32, 64, 128};
  int q[4] = {8, 4, 2, 1};
  asm volatile("" : : "g"(p), "g"(q) : "memory");
  foo(p, q);
  if (p[0] != 17 || p[1] != 34 || p[2] != 66 || p[3] != 129)
    __builtin_abort();
  return 0;
}


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)
mov    0xec4(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rcx
lea    -0x30(%rbp),%rax
mov    %rcx,-0x38(%rbp)
mov    %rax,-0x40(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1040 <foo@plt>
cmpl   $0x11,-0x20(%rbp)
jne    11a5 <main+0x85>
cmpl   $0x22,-0x1c(%rbp)
jne    11a5 <main+0x85>
cmpl   $0x42,-0x18(%rbp)
jne    11a5 <main+0x85>
cmpl   $0x81,-0x14(%rbp)
je     11aa <main+0x8a>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x10(%rsp),%rdi
mov    %rdi,0x8(%rsp)
lea    0x20(%rsp),%rsi
mov    %rsi,(%rsp)
xor    %eax,%eax
call   1040 <foo@plt>
movdqa 0x10(%rsp),%xmm0
pcmpeqd 0xe9c(%rip),%xmm0
movmskps %xmm0,%eax
cmp    $0xf,%eax
jne    1173 <main+0x53>
xor    %eax,%eax
add    $0x38,%rsp
ret
call   1030 <abort@plt>

LLVM IR (-O0):
@__const.main.p = [4 x i32] [i32 16, i32 32, i32 64, i32 128]
@__const.main.q = [4 x i32] [i32 8, i32 4, i32 2, i32 1]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca [4 x i32]
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %2 to i8*
%5 = bitcast [4 x i32]* %3 to i8*
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @foo to i32 (i32*, i32*, ...)*)(i32* %8, i32* %9)
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %11
%13 = icmp ne i32 %12, 17
br i1 %13, label %26, label %14
14: ; preds = %0
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, 34
br i1 %17, label %26, label %18
18: ; preds = %14
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%20 = load i32, i32* %19
%21 = icmp ne i32 %20, 66
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
%24 = load i32, i32* %23
%25 = icmp ne i32 %24, 129
br i1 %25, label %26, label %27
26: ; preds = %22, %18, %14, %0
unreachable
27: ; preds = %22
ret i32 0
}

LLVM IR (-O2):
@__const.main.p = [4 x i32] [i32 16, i32 32, i32 64, i32 128]
@__const.main.q = [4 x i32] [i32 8, i32 4, i32 2, i32 1]
define i32 @main() {
%1 = alloca <4 x i32>
%2 = alloca [4 x i32]
%3 = bitcast <4 x i32>* %1 to i8*
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds <4 x i32>, <4 x i32>* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @foo to i32 (i32*, i32*, ...)*)(i32* %5, i32* %6)
%8 = load <4 x i32>, <4 x i32>* %1
%9 = freeze <4 x i32> %8
%10 = icmp ne <4 x i32> %9, <i32 17, i32 34, i32 66, i32 129>
%11 = bitcast <4 x i1> %10 to i4
%12 = icmp eq i4 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %0
unreachable
14: ; preds = %0
ret i32 0
}