int main() {
  int q[] = {123, 456, 789};
  int *has_ptr_to_local_var[] = {q};
  char s[][8] = {"hello", "rucc", "world"};
  int a[2];
  a[0] = 12;
  a[1] = 23;
  a[0] = a[0] + a[1];
  printf("%d %d\n", a[0], 0 [a]);
  for (int i = 0; i < 3; i++)
    puts(s[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0xc,-0x38(%rbp)
movl   $0x17,-0x34(%rbp)
mov    -0x38(%rbp),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%esi
mov    -0x38(%rbp),%edx
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x3,-0x3c(%rbp)
jge    11cc <main+0xac>
movslq -0x3c(%rbp),%rax
lea    -0x30(%rbp),%rdi
shl    $0x3,%rax
add    %rax,%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    119e <main+0x7e>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xee4(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rbx
lea    0xed0(%rip),%rdi
mov    $0x23,%esi
mov    $0x23,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.q = [3 x i32] [i32 123, i32 456, i32 789]
@__const.main.s = [3 x [8 x i8]] [[8 x i8] c"hello\00\00\00", [8 x i8] c"rucc\00\00\00\00", [8 x i8] c"world\00\00\00"]
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca [1 x i32*]
%4 = alloca [3 x [8 x i8]]
%5 = alloca [2 x i32]
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [3 x i32]* %2 to i8*
%8 = getelementptr inbounds [1 x i32*], [1 x i32*]* %3, i64 0, i64 0
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32* %9, i32** %8
%10 = bitcast [3 x [8 x i8]]* %4 to i8*
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 12, i32* %11
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 23, i32* %12
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%14 = load i32, i32* %13
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%16 = load i32, i32* %15
%17 = add nsw i32 %14, %16
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %17, i32* %18
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%20 = load i32, i32* %19
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%22 = load i32, i32* %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %22)
store i32 0, i32* %6
br label %24
24: ; preds = %33, %0
%25 = load i32, i32* %6
%26 = icmp slt i32 %25, 3
br i1 %26, label %27, label %36
27: ; preds = %24
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [3 x [8 x i8]], [3 x [8 x i8]]* %4, i64 0, i64 %29
%31 = getelementptr inbounds [8 x i8], [8 x i8]* %30, i64 0, i64 0
%32 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %31)
br label %33
33: ; preds = %27
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %24
36: ; preds = %24
%37 = load i32, i32* %1
ret i32 %37
}

LLVM IR (-O2):
@__const.main.s = [3 x [8 x i8]] [[8 x i8] c"hello\00\00\00", [8 x i8] c"rucc\00\00\00\00", [8 x i8] c"world\00\00\00"]
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca [3 x [8 x i8]]
%2 = getelementptr inbounds [3 x [8 x i8]], [3 x [8 x i8]]* %1, i64 0, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 35, i32 35)
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %2)
%5 = getelementptr inbounds [3 x [8 x i8]], [3 x [8 x i8]]* %1, i64 0, i64 1, i64 0
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %5)
%7 = getelementptr inbounds [3 x [8 x i8]], [3 x [8 x i8]]* %1, i64 0, i64 2, i64 0
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %7)
ret i32 0
}