int main() {
  int sum = 0;
  {
    int a[20];
    int *c;
    c = a;
    asm("" : "=r"(c) : "0"(c));
    *c = 0;
    asm("" : "=r"(c) : "0"(c));
    sum += *c;
  }
  {
    long b[10];
    long *c;
    c = b;
    asm("" : "=r"(c) : "0"(c));
    *c = 1;
    asm("" : "=r"(c) : "0"(c));
    sum += *c;
  }
  if (sum != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x68(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    (%rax),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0xc0(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0xc8(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0xc8(%rbp),%rax
movq   $0x1,(%rax)
mov    -0xc8(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0xc8(%rbp),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     11b2 <main+0xa2>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    %rsp,%rax
mov    %rax,%rcx
movl   $0x0,(%rcx)
mov    (%rcx),%ecx
movq   $0x1,(%rax)
add    (%rax),%ecx
cmp    $0x1,%ecx
jne    1137 <main+0x27>
xor    %eax,%eax
add    $0x58,%rsp
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [20 x i32]
%4 = alloca i32*
%5 = alloca [10 x i64]
%6 = alloca i64*
store i32 0, i32* %1
store i32 0, i32* %2
%7 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = call i32* asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32* %8)
store i32* %9, i32** %4
%10 = load i32*, i32** %4
store i32 0, i32* %10
%11 = load i32*, i32** %4
%12 = call i32* asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32* %11)
store i32* %12, i32** %4
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32, i32* %2
%16 = add nsw i32 %15, %14
store i32 %16, i32* %2
%17 = getelementptr inbounds [10 x i64], [10 x i64]* %5, i64 0, i64 0
store i64* %17, i64** %6
%18 = load i64*, i64** %6
%19 = call i64* asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64* %18)
store i64* %19, i64** %6
%20 = load i64*, i64** %6
store i64 1, i64* %20
%21 = load i64*, i64** %6
%22 = call i64* asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64* %21)
store i64* %22, i64** %6
%23 = load i64*, i64** %6
%24 = load i64, i64* %23
%25 = load i32, i32* %2
%26 = sext i32 %25 to i64
%27 = add nsw i64 %26, %24
%28 = trunc i64 %27 to i32
store i32 %28, i32* %2
%29 = load i32, i32* %2
%30 = icmp ne i32 %29, 1
br i1 %30, label %31, label %32
31: ; preds = %0
unreachable
32: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [20 x i32]
%2 = alloca [10 x i64]
%3 = bitcast [20 x i32]* %1 to i8*
%4 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%5 = call i32* asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32* %4)
store i32 0, i32* %5
%6 = call i32* asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32* %5)
%7 = load i32, i32* %6
%8 = bitcast [10 x i64]* %2 to i8*
%9 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 0
%10 = call i64* asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64* %9)
store i64 1, i64* %10
%11 = call i64* asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64* %10)
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = add i32 %7, %13
%15 = icmp eq i32 %14, 1
br i1 %15, label %17, label %16
16: ; preds = %0
tail call void @abort()
unreachable
17: ; preds = %0
ret i32 0
}