#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ copy(int *, int *);
int main() {
  int A[100][100], B[100];
  for (int i = 0; i < 100; ++i)
    B[i] = i;
#pragma scop
  for (int i = 0; i < 100; ++i)
    copy(A[i], B);
#pragma endscop
  for (int i = 0; i < 100; ++i)
    for (int j = 0; j < 100; ++j)
      if (A[j][i] != B[i])
        return EXIT_FAILURE;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9df0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x9de4(%rbp)
cmpl   $0x64,-0x9de4(%rbp)
jge    1161 <main+0x51>
mov    -0x9de4(%rbp),%ecx
movslq -0x9de4(%rbp),%rax
mov    %ecx,-0x9de0(%rbp,%rax,4)
mov    -0x9de4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9de4(%rbp)
jmp    112c <main+0x1c>
movl   $0x0,-0x9de8(%rbp)
cmpl   $0x64,-0x9de8(%rbp)
jge    11b0 <main+0xa0>
movslq -0x9de8(%rbp),%rax
lea    -0x9c50(%rbp),%rdi
imul   $0x190,%rax,%rax
add    %rax,%rdi
lea    -0x9de0(%rbp),%rsi
call   1030 <copy@plt>
mov    -0x9de8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9de8(%rbp)
jmp    116b <main+0x5b>
movl   $0x0,-0x9dec(%rbp)
cmpl   $0x64,-0x9dec(%rbp)
jge    1257 <main+0x147>
movl   $0x0,-0x9df0(%rbp)
cmpl   $0x64,-0x9df0(%rbp)
jge    123e <main+0x12e>
movslq -0x9df0(%rbp),%rcx
lea    -0x9c50(%rbp),%rax
imul   $0x190,%rcx,%rcx
add    %rcx,%rax
movslq -0x9dec(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
movslq -0x9dec(%rbp),%rcx
cmp    -0x9de0(%rbp,%rcx,4),%eax
je     1225 <main+0x115>
mov    0x2dc5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1263 <main+0x153>
jmp    122a <main+0x11a>
mov    -0x9df0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9df0(%rbp)
jmp    11d1 <main+0xc1>
jmp    1243 <main+0x133>
mov    -0x9dec(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9dec(%rbp)
jmp    11ba <main+0xaa>
mov    0x2d7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x9df0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x9dd8,%rsp
movaps 0xedf(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeec(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xef0(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xef8(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xefc(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xf00(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xf01(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xf02(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xf03(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xf04(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xf06(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xf07(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0xf08(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x110(%rsp)
movaps 0xf0a(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movaps 0xf0b(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
movaps 0xf0c(%rip),%xmm0
movaps %xmm0,0x140(%rsp)
movaps 0xf0d(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
movaps 0xf0e(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
movaps 0xf0f(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
movaps 0xf10(%rip),%xmm0
movaps %xmm0,0x180(%rsp)
xor    %ebx,%ebx
mov    %rsp,%r14
nopl   (%rax)
lea    (%rsp,%rbx,1),%rdi
add    $0x190,%rdi
mov    %r14,%rsi
call   1030 <copy@plt>
add    $0x190,%rbx
cmp    $0x9c40,%rbx
jne    1280 <main+0x170>
lea    0x190(%rsp),%rcx
xor    %edx,%edx
mov    0x2d2c(%rip),%rax
mov    0x2d1d(%rip),%rsi
mov    (%rsp,%rdx,4),%edi
mov    $0x640,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %edi,-0x640(%rcx,%rbx,1)
jne    131a <main+0x20a>
cmp    %edi,-0x4b0(%rcx,%rbx,1)
jne    131a <main+0x20a>
cmp    %edi,-0x320(%rcx,%rbx,1)
jne    131a <main+0x20a>
cmp    %edi,-0x190(%rcx,%rbx,1)
jne    131a <main+0x20a>
cmp    %edi,(%rcx,%rbx,1)
jne    131a <main+0x20a>
add    $0x7d0,%rbx
cmp    $0xa280,%rbx
jne    12d0 <main+0x1c0>
add    $0x1,%rdx
add    $0x4,%rcx
cmp    $0x64,%rdx
jne    12bb <main+0x1ab>
mov    %rsi,%rax
mov    (%rax),%eax
add    $0x9dd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x [100 x i32]]
%3 = alloca [100 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
br label %8
8: ; preds = %16, %0
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 100
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32, i32* %4
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %14
store i32 %12, i32* %15
br label %16
16: ; preds = %11
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %8
19: ; preds = %8
store i32 0, i32* %5
br label %20
20: ; preds = %30, %19
%21 = load i32, i32* %5
%22 = icmp slt i32 %21, 100
br i1 %22, label %23, label %33
23: ; preds = %20
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %2, i64 0, i64 %25
%27 = getelementptr inbounds [100 x i32], [100 x i32]* %26, i64 0, i64 0
%28 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%29 = call i32 @copy(i32* %27, i32* %28)
br label %30
30: ; preds = %23
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %20
33: ; preds = %20
store i32 0, i32* %6
br label %34
34: ; preds = %61, %33
%35 = load i32, i32* %6
%36 = icmp slt i32 %35, 100
br i1 %36, label %37, label %64
37: ; preds = %34
store i32 0, i32* %7
br label %38
38: ; preds = %57, %37
%39 = load i32, i32* %7
%40 = icmp slt i32 %39, 100
br i1 %40, label %41, label %60
41: ; preds = %38
%42 = load i32, i32* %7
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %2, i64 0, i64 %43
%45 = load i32, i32* %6
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [100 x i32], [100 x i32]* %44, i64 0, i64 %46
%48 = load i32, i32* %47
%49 = load i32, i32* %6
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = icmp ne i32 %48, %52
br i1 %53, label %54, label %56
54: ; preds = %41
%55 = load i32, i32* @EXIT_FAILURE
store i32 %55, i32* %1
br label %66
56: ; preds = %41
br label %57
57: ; preds = %56
%58 = load i32, i32* %7
%59 = add nsw i32 %58, 1
store i32 %59, i32* %7
br label %38
60: ; preds = %38
br label %61
61: ; preds = %60
%62 = load i32, i32* %6
%63 = add nsw i32 %62, 1
store i32 %63, i32* %6
br label %34
64: ; preds = %34
%65 = load i32, i32* @EXIT_SUCCESS
store i32 %65, i32* %1
br label %66
66: ; preds = %64, %54
%67 = load i32, i32* %1
ret i32 %67
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [100 x [100 x i32]]
%2 = alloca [100 x i32]
%3 = bitcast [100 x [100 x i32]]* %1 to i8*
%4 = bitcast [100 x i32]* %2 to i8*
%5 = bitcast [100 x i32]* %2 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %5
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %7
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 8
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, <4 x i32>* %9
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 12
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, <4 x i32>* %11
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 16
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 16, i32 17, i32 18, i32 19>, <4 x i32>* %13
%14 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 20
%15 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> <i32 20, i32 21, i32 22, i32 23>, <4 x i32>* %15
%16 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 24
%17 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 24, i32 25, i32 26, i32 27>, <4 x i32>* %17
%18 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 28
%19 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> <i32 28, i32 29, i32 30, i32 31>, <4 x i32>* %19
%20 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 32
%21 = bitcast i32* %20 to <4 x i32>*
store <4 x i32> <i32 32, i32 33, i32 34, i32 35>, <4 x i32>* %21
%22 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 36
%23 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> <i32 36, i32 37, i32 38, i32 39>, <4 x i32>* %23
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 40
%25 = bitcast i32* %24 to <4 x i32>*
store <4 x i32> <i32 40, i32 41, i32 42, i32 43>, <4 x i32>* %25
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 44
%27 = bitcast i32* %26 to <4 x i32>*
store <4 x i32> <i32 44, i32 45, i32 46, i32 47>, <4 x i32>* %27
%28 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 48
%29 = bitcast i32* %28 to <4 x i32>*
store <4 x i32> <i32 48, i32 49, i32 50, i32 51>, <4 x i32>* %29
%30 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 52
%31 = bitcast i32* %30 to <4 x i32>*
store <4 x i32> <i32 52, i32 53, i32 54, i32 55>, <4 x i32>* %31
%32 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 56
%33 = bitcast i32* %32 to <4 x i32>*
store <4 x i32> <i32 56, i32 57, i32 58, i32 59>, <4 x i32>* %33
%34 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 60
%35 = bitcast i32* %34 to <4 x i32>*
store <4 x i32> <i32 60, i32 61, i32 62, i32 63>, <4 x i32>* %35
%36 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 64
%37 = bitcast i32* %36 to <4 x i32>*
store <4 x i32> <i32 64, i32 65, i32 66, i32 67>, <4 x i32>* %37
%38 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 68
%39 = bitcast i32* %38 to <4 x i32>*
store <4 x i32> <i32 68, i32 69, i32 70, i32 71>, <4 x i32>* %39
%40 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 72
%41 = bitcast i32* %40 to <4 x i32>*
store <4 x i32> <i32 72, i32 73, i32 74, i32 75>, <4 x i32>* %41
%42 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 76
%43 = bitcast i32* %42 to <4 x i32>*
store <4 x i32> <i32 76, i32 77, i32 78, i32 79>, <4 x i32>* %43
%44 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 80
%45 = bitcast i32* %44 to <4 x i32>*
store <4 x i32> <i32 80, i32 81, i32 82, i32 83>, <4 x i32>* %45
%46 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 84
%47 = bitcast i32* %46 to <4 x i32>*
store <4 x i32> <i32 84, i32 85, i32 86, i32 87>, <4 x i32>* %47
%48 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 88
%49 = bitcast i32* %48 to <4 x i32>*
store <4 x i32> <i32 88, i32 89, i32 90, i32 91>, <4 x i32>* %49
%50 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 92
%51 = bitcast i32* %50 to <4 x i32>*
store <4 x i32> <i32 92, i32 93, i32 94, i32 95>, <4 x i32>* %51
%52 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 96
%53 = bitcast i32* %52 to <4 x i32>*
store <4 x i32> <i32 96, i32 97, i32 98, i32 99>, <4 x i32>* %53
%54 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
br label %55
55: ; preds = %0, %55
%56 = phi i64 [ 0, %0 ], [ %59, %55 ]
%57 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %1, i64 0, i64 %56, i64 0
%58 = call i32 @copy(i32* %57, i32* %54)
%59 = add nuw nsw i64 %56, 1
%60 = icmp eq i64 %59, 100
br i1 %60, label %61, label %55
61: ; preds = %55, %93
%62 = phi i64 [ %94, %93 ], [ 0, %55 ]
%63 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %62
%64 = load i32, i32* %63
br label %88
65: ; preds = %88
%66 = add nuw nsw i64 %89, 1
%67 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %1, i64 0, i64 %66, i64 %62
%68 = load i32, i32* %67
%69 = icmp eq i32 %68, %64
br i1 %69, label %70, label %96
70: ; preds = %65
%71 = add nuw nsw i64 %89, 2
%72 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %1, i64 0, i64 %71, i64 %62
%73 = load i32, i32* %72
%74 = icmp eq i32 %73, %64
br i1 %74, label %75, label %96
75: ; preds = %70
%76 = add nuw nsw i64 %89, 3
%77 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %1, i64 0, i64 %76, i64 %62
%78 = load i32, i32* %77
%79 = icmp eq i32 %78, %64
br i1 %79, label %80, label %96
80: ; preds = %75
%81 = add nuw nsw i64 %89, 4
%82 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %1, i64 0, i64 %81, i64 %62
%83 = load i32, i32* %82
%84 = icmp eq i32 %83, %64
br i1 %84, label %85, label %96
85: ; preds = %80
%86 = add nuw nsw i64 %89, 5
%87 = icmp eq i64 %86, 100
br i1 %87, label %93, label %88
88: ; preds = %85, %61
%89 = phi i64 [ 0, %61 ], [ %86, %85 ]
%90 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %1, i64 0, i64 %89, i64 %62
%91 = load i32, i32* %90
%92 = icmp eq i32 %91, %64
br i1 %92, label %65, label %96
93: ; preds = %85
%94 = add nuw nsw i64 %62, 1
%95 = icmp eq i64 %94, 100
br i1 %95, label %96, label %61
96: ; preds = %93, %88, %65, %70, %75, %80
%97 = phi i32* [ @EXIT_FAILURE, %80 ], [ @EXIT_FAILURE, %75 ], [ @EXIT_FAILURE, %70 ], [ @EXIT_FAILURE, %65 ], [ @EXIT_FAILURE, %88 ], [ @EXIT_SUCCESS, %93 ]
%98 = load i32, i32* %97
ret i32 %98
}