#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*/ foo(int);
int main() {
  int c[100][200];
  int a;
  int x;
  for (a = 1; a < 50; a++) {
    x = a;
    c[x - 7][1] = c[x + 2][3] + c[x - 1][2];
    c[x][2] = c[x + 2][3];
  }
  foo(c[12][13]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x138a0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x13894(%rbp)
cmpl   $0x32,-0x13894(%rbp)
jge    11f4 <main+0xe4>
mov    -0x13894(%rbp),%eax
mov    %eax,-0x13898(%rbp)
mov    -0x13898(%rbp),%eax
add    $0x2,%eax
movslq %eax,%rcx
lea    -0x13890(%rbp),%rax
imul   $0x320,%rcx,%rcx
add    %rcx,%rax
mov    0xc(%rax),%ecx
mov    -0x13898(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rdx
lea    -0x13890(%rbp),%rax
imul   $0x320,%rdx,%rdx
add    %rdx,%rax
add    0x8(%rax),%ecx
mov    -0x13898(%rbp),%eax
sub    $0x7,%eax
movslq %eax,%rdx
lea    -0x13890(%rbp),%rax
imul   $0x320,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,0x4(%rax)
mov    -0x13898(%rbp),%eax
add    $0x2,%eax
movslq %eax,%rcx
lea    -0x13890(%rbp),%rax
imul   $0x320,%rcx,%rcx
add    %rcx,%rax
mov    0xc(%rax),%ecx
movslq -0x13898(%rbp),%rdx
lea    -0x13890(%rbp),%rax
imul   $0x320,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,0x8(%rax)
mov    -0x13894(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x13894(%rbp)
jmp    112c <main+0x1c>
mov    -0x112dc(%rbp),%edi
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x138a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x13888,%rsp
mov    $0xc8c,%eax
nopl   0x0(%rax)
mov    -0x320(%rsp,%rax,1),%edx
add    %edx,%ecx
mov    %ecx,-0x1f48(%rsp,%rax,1)
mov    %edx,-0x964(%rsp,%rax,1)
cmp    $0xa28c,%rax
je     115a <main+0x4a>
mov    (%rsp,%rax,1),%ecx
add    %ecx,%edx
mov    %edx,-0x1c28(%rsp,%rax,1)
mov    %ecx,-0x644(%rsp,%rax,1)
add    $0x640,%rax
jmp    1120 <main+0x10>
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x13888,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x [200 x i32]]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
br label %5
5: ; preds = %38, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 50
br i1 %7, label %8, label %41
8: ; preds = %5
%9 = load i32, i32* %3
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %2, i64 0, i64 %12
%14 = getelementptr inbounds [200 x i32], [200 x i32]* %13, i64 0, i64 3
%15 = load i32, i32* %14
%16 = load i32, i32* %4
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %2, i64 0, i64 %18
%20 = getelementptr inbounds [200 x i32], [200 x i32]* %19, i64 0, i64 2
%21 = load i32, i32* %20
%22 = add nsw i32 %15, %21
%23 = load i32, i32* %4
%24 = sub nsw i32 %23, 7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %2, i64 0, i64 %25
%27 = getelementptr inbounds [200 x i32], [200 x i32]* %26, i64 0, i64 1
store i32 %22, i32* %27
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 2
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %2, i64 0, i64 %30
%32 = getelementptr inbounds [200 x i32], [200 x i32]* %31, i64 0, i64 3
%33 = load i32, i32* %32
%34 = load i32, i32* %4
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %2, i64 0, i64 %35
%37 = getelementptr inbounds [200 x i32], [200 x i32]* %36, i64 0, i64 2
store i32 %33, i32* %37
br label %38
38: ; preds = %8
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %5
41: ; preds = %5
%42 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %2, i64 0, i64 12
%43 = getelementptr inbounds [200 x i32], [200 x i32]* %42, i64 0, i64 13
%44 = load i32, i32* %43
%45 = call i32 @foo(i32 %44)
%46 = load i32, i32* %1
ret i32 %46
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x [200 x i32]]
%2 = bitcast [100 x [200 x i32]]* %1 to i8*
br label %3
3: ; preds = %15, %0
%4 = phi i32 [ undef, %0 ], [ %18, %15 ]
%5 = phi i64 [ 1, %0 ], [ %23, %15 ]
%6 = add nuw nsw i64 %5, 2
%7 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %6, i64 3
%8 = load i32, i32* %7
%9 = add nsw i32 %4, %8
%10 = add nsw i64 %5, -7
%11 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %10, i64 1
store i32 %9, i32* %11
%12 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %5, i64 2
store i32 %8, i32* %12
%13 = add nuw nsw i64 %5, 1
%14 = icmp eq i64 %13, 50
br i1 %14, label %24, label %15
15: ; preds = %3
%16 = add nuw nsw i64 %5, 3
%17 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %16, i64 3
%18 = load i32, i32* %17
%19 = add nsw i32 %8, %18
%20 = add nsw i64 %5, -6
%21 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %20, i64 1
store i32 %19, i32* %21
%22 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %13, i64 2
store i32 %18, i32* %22
%23 = add nuw nsw i64 %5, 2
br label %3
24: ; preds = %3
%25 = tail call i32 @foo(i32 undef)
ret i32 0
}