#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int t[2][2] = {1, 2, 4, 8};
  int s = 0, i, j;
  for (i = 2; i; i -= 2)
    for (j = 1; j < 2; j += 2)
      s += t[i - 1][j];
  printf("%d", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     11a0 <main+0x90>
movl   $0x1,-0x2c(%rbp)
cmpl   $0x2,-0x2c(%rbp)
jge    118d <main+0x7d>
mov    -0x28(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x20(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x2c(%rbp)
jmp    1154 <main+0x44>
jmp    1192 <main+0x82>
mov    -0x28(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x28(%rbp)
jmp    1143 <main+0x33>
mov    -0x24(%rbp),%esi
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}