#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*/ abort();
int foo(int **);
int main(void) {
  int A[100][200];
  int i, j, res;
  for (i = 0; i < 100; i++)
    for (j = 0; j < 200; j++)
      A[i][j] = 2;
  res = foo(A);
  if (res != 8)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x138a0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x13894(%rbp)
cmpl   $0x64,-0x13894(%rbp)
jge    11b6 <main+0x96>
movl   $0x0,-0x13898(%rbp)
cmpl   $0xc8,-0x13898(%rbp)
jge    119d <main+0x7d>
movslq -0x13894(%rbp),%rcx
lea    -0x13890(%rbp),%rax
imul   $0x320,%rcx,%rcx
add    %rcx,%rax
movslq -0x13898(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0x13898(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x13898(%rbp)
jmp    1153 <main+0x33>
jmp    11a2 <main+0x82>
mov    -0x13894(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x13894(%rbp)
jmp    113c <main+0x1c>
lea    -0x13890(%rbp),%rdi
call   1040 <foo@plt>
mov    %eax,-0x1389c(%rbp)
cmpl   $0x8,-0x1389c(%rbp)
je     11dc <main+0xbc>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x138a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x13888,%rsp
mov    $0x310,%eax
movaps 0xecd(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movaps %xmm0,-0x310(%rsp,%rax,1)
ff
movaps %xmm0,-0x300(%rsp,%rax,1)
ff
movaps %xmm0,-0x2f0(%rsp,%rax,1)
ff
movaps %xmm0,-0x2e0(%rsp,%rax,1)
ff
movaps %xmm0,-0x2d0(%rsp,%rax,1)
ff
movaps %xmm0,-0x2c0(%rsp,%rax,1)
ff
movaps %xmm0,-0x2b0(%rsp,%rax,1)
ff
movaps %xmm0,-0x2a0(%rsp,%rax,1)
ff
movaps %xmm0,-0x290(%rsp,%rax,1)
ff
movaps %xmm0,-0x280(%rsp,%rax,1)
ff
movaps %xmm0,-0x270(%rsp,%rax,1)
ff
movaps %xmm0,-0x260(%rsp,%rax,1)
ff
movaps %xmm0,-0x250(%rsp,%rax,1)
ff
movaps %xmm0,-0x240(%rsp,%rax,1)
ff
movaps %xmm0,-0x230(%rsp,%rax,1)
ff
movaps %xmm0,-0x220(%rsp,%rax,1)
ff
movaps %xmm0,-0x210(%rsp,%rax,1)
ff
movaps %xmm0,-0x200(%rsp,%rax,1)
ff
movaps %xmm0,-0x1f0(%rsp,%rax,1)
ff
movaps %xmm0,-0x1e0(%rsp,%rax,1)
ff
movaps %xmm0,-0x1d0(%rsp,%rax,1)
ff
movaps %xmm0,-0x1c0(%rsp,%rax,1)
ff
movaps %xmm0,-0x1b0(%rsp,%rax,1)
ff
movaps %xmm0,-0x1a0(%rsp,%rax,1)
ff
movaps %xmm0,-0x190(%rsp,%rax,1)
ff
movaps %xmm0,-0x180(%rsp,%rax,1)
ff
movaps %xmm0,-0x170(%rsp,%rax,1)
ff
movaps %xmm0,-0x160(%rsp,%rax,1)
ff
movaps %xmm0,-0x150(%rsp,%rax,1)
ff
movaps %xmm0,-0x140(%rsp,%rax,1)
ff
movaps %xmm0,-0x130(%rsp,%rax,1)
ff
movaps %xmm0,-0x120(%rsp,%rax,1)
ff
movaps %xmm0,-0x110(%rsp,%rax,1)
ff
movaps %xmm0,-0x100(%rsp,%rax,1)
ff
movaps %xmm0,-0xf0(%rsp,%rax,1)
ff
movaps %xmm0,-0xe0(%rsp,%rax,1)
ff
movaps %xmm0,-0xd0(%rsp,%rax,1)
ff
movaps %xmm0,-0xc0(%rsp,%rax,1)
ff
movaps %xmm0,-0xb0(%rsp,%rax,1)
ff
movaps %xmm0,-0xa0(%rsp,%rax,1)
ff
movaps %xmm0,-0x90(%rsp,%rax,1)
ff
movaps %xmm0,-0x80(%rsp,%rax,1)
movaps %xmm0,-0x70(%rsp,%rax,1)
movaps %xmm0,-0x60(%rsp,%rax,1)
movaps %xmm0,-0x50(%rsp,%rax,1)
movaps %xmm0,-0x40(%rsp,%rax,1)
movaps %xmm0,-0x30(%rsp,%rax,1)
movaps %xmm0,-0x20(%rsp,%rax,1)
movaps %xmm0,-0x10(%rsp,%rax,1)
movaps %xmm0,(%rsp,%rax,1)
add    $0x320,%rax
cmp    $0x13b90,%rax
jne    1140 <main+0x20>
mov    %rsp,%rdi
call   1040 <foo@plt>
cmp    $0x8,%eax
jne    12dd <main+0x1bd>
xor    %eax,%eax
add    $0x13888,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

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 = %3, %0
%4 = phi i64 [ 0, %0 ], [ %105, %3 ]
%5 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 0
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %6
%7 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 4
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %8
%9 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 8
%10 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %10
%11 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 12
%12 = bitcast i32* %11 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %12
%13 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 16
%14 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %14
%15 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 20
%16 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %16
%17 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 24
%18 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %18
%19 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 28
%20 = bitcast i32* %19 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %20
%21 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 32
%22 = bitcast i32* %21 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %22
%23 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 36
%24 = bitcast i32* %23 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %24
%25 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 40
%26 = bitcast i32* %25 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %26
%27 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 44
%28 = bitcast i32* %27 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %28
%29 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 48
%30 = bitcast i32* %29 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %30
%31 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 52
%32 = bitcast i32* %31 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %32
%33 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 56
%34 = bitcast i32* %33 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %34
%35 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 60
%36 = bitcast i32* %35 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %36
%37 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 64
%38 = bitcast i32* %37 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %38
%39 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 68
%40 = bitcast i32* %39 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %40
%41 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 72
%42 = bitcast i32* %41 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %42
%43 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 76
%44 = bitcast i32* %43 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %44
%45 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 80
%46 = bitcast i32* %45 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %46
%47 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 84
%48 = bitcast i32* %47 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %48
%49 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 88
%50 = bitcast i32* %49 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %50
%51 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 92
%52 = bitcast i32* %51 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %52
%53 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 96
%54 = bitcast i32* %53 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %54
%55 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 100
%56 = bitcast i32* %55 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %56
%57 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 104
%58 = bitcast i32* %57 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %58
%59 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 108
%60 = bitcast i32* %59 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %60
%61 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 112
%62 = bitcast i32* %61 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %62
%63 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 116
%64 = bitcast i32* %63 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %64
%65 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 120
%66 = bitcast i32* %65 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %66
%67 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 124
%68 = bitcast i32* %67 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %68
%69 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 128
%70 = bitcast i32* %69 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %70
%71 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 132
%72 = bitcast i32* %71 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %72
%73 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 136
%74 = bitcast i32* %73 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %74
%75 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 140
%76 = bitcast i32* %75 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %76
%77 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 144
%78 = bitcast i32* %77 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %78
%79 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 148
%80 = bitcast i32* %79 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %80
%81 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 152
%82 = bitcast i32* %81 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %82
%83 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 156
%84 = bitcast i32* %83 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %84
%85 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 160
%86 = bitcast i32* %85 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %86
%87 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 164
%88 = bitcast i32* %87 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %88
%89 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 168
%90 = bitcast i32* %89 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %90
%91 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 172
%92 = bitcast i32* %91 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %92
%93 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 176
%94 = bitcast i32* %93 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %94
%95 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 180
%96 = bitcast i32* %95 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %96
%97 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 184
%98 = bitcast i32* %97 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %98
%99 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 188
%100 = bitcast i32* %99 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %100
%101 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 192
%102 = bitcast i32* %101 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %102
%103 = getelementptr inbounds [100 x [200 x i32]], [100 x [200 x i32]]* %1, i64 0, i64 %4, i64 196
%104 = bitcast i32* %103 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %104
%105 = add nuw nsw i64 %4, 1
%106 = icmp eq i64 %105, 100
br i1 %106, label %107, label %3
107: ; preds = %3
%108 = bitcast [100 x [200 x i32]]* %1 to i32**
%109 = call i32 @foo(i32** %108)
%110 = icmp eq i32 %109, 8
br i1 %110, label %113, label %111
111: ; preds = %107
%112 = call i32 (...) @abort()
unreachable
113: ; preds = %107
ret i32 0
}