#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 */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int member_0;
  int member_1;
};
struct TYPE_3__ {
  int member_0;
  int member_1;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int t[1][2][2] = {{{1, 2}, {3, 4}}};
  int s = 0, i, j, k;
  for (i = 1; i > 0; i -= 2)
    for (j = 1; j < 2; j += 2)
      for (k = 0; k < 3; k += 3)
        s += t[k][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   $0x1,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jle    11cf <main+0xbf>
movl   $0x1,-0x2c(%rbp)
cmpl   $0x2,-0x2c(%rbp)
jge    11bc <main+0xac>
movl   $0x0,-0x30(%rbp)
cmpl   $0x3,-0x30(%rbp)
jge    11a9 <main+0x99>
movslq -0x30(%rbp),%rcx
lea    -0x20(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x30(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x30(%rbp)
jmp    1165 <main+0x55>
jmp    11ae <main+0x9e>
mov    -0x2c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x2c(%rbp)
jmp    1154 <main+0x44>
jmp    11c1 <main+0xb1>
mov    -0x28(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x28(%rbp)
jmp    1143 <main+0x33>
mov    -0x24(%rbp),%esi
lea    0xe37(%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    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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