#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 *malloc(int);
int /*<<< orphan*/ printf(char *);
int main() {
  int *a = malloc(100 * sizeof(int));
  for (int i = 0; i < 100; i++)
    a[i] = i;
  int error = 1, *b;
  for (int i = 0; i < 100; i++) {
    b = &a[i];
    if (i != *b)
      error = 0;
  }
  if (error)
    printf("PASS\n");
  else
    printf("ERROR\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    116a <main+0x4a>
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x64,-0x24(%rbp)
jge    11be <main+0x9e>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
je     11ab <main+0x8b>
movl   $0x0,-0x18(%rbp)
jmp    11b0 <main+0x90>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1178 <main+0x58>
cmpl   $0x0,-0x18(%rbp)
je     11d9 <main+0xb9>
lea    0xe31(%rip),%rdi
call   1030 <printf@plt>
jmp    11e5 <main+0xc5>
lea    0xe26(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x190,%edi
call   1040 <malloc@plt>
movaps 0xece(%rip),%xmm0
movups %xmm0,(%rax)
movaps 0xed4(%rip),%xmm0
movups %xmm0,0x10(%rax)
movaps 0xed9(%rip),%xmm0
movups %xmm0,0x20(%rax)
movaps 0xede(%rip),%xmm0
movups %xmm0,0x30(%rax)
movaps 0xee3(%rip),%xmm0
movups %xmm0,0x40(%rax)
movaps 0xee8(%rip),%xmm0
movups %xmm0,0x50(%rax)
movaps 0xeed(%rip),%xmm0
movups %xmm0,0x60(%rax)
movaps 0xef2(%rip),%xmm0
movups %xmm0,0x70(%rax)
movaps 0xef7(%rip),%xmm0
movups %xmm0,0x80(%rax)
movaps 0xef9(%rip),%xmm0
movups %xmm0,0x90(%rax)
movaps 0xefb(%rip),%xmm0
movups %xmm0,0xa0(%rax)
movaps 0xefd(%rip),%xmm0
movups %xmm0,0xb0(%rax)
movaps 0xeff(%rip),%xmm0
movups %xmm0,0xc0(%rax)
movaps 0xf01(%rip),%xmm0
movups %xmm0,0xd0(%rax)
movaps 0xf03(%rip),%xmm0
movups %xmm0,0xe0(%rax)
movaps 0xf05(%rip),%xmm0
movups %xmm0,0xf0(%rax)
movaps 0xf07(%rip),%xmm0
movups %xmm0,0x100(%rax)
movaps 0xf09(%rip),%xmm0
movups %xmm0,0x110(%rax)
movaps 0xf0b(%rip),%xmm0
movups %xmm0,0x120(%rax)
movaps 0xf0d(%rip),%xmm0
movups %xmm0,0x130(%rax)
movaps 0xf0f(%rip),%xmm0
movups %xmm0,0x140(%rax)
movaps 0xf11(%rip),%xmm0
movups %xmm0,0x150(%rax)
movaps 0xf13(%rip),%xmm0
movups %xmm0,0x160(%rax)
movaps 0xf15(%rip),%xmm0
movups %xmm0,0x170(%rax)
movaps 0xf17(%rip),%xmm0
movups %xmm0,0x180(%rax)
mov    $0x1,%r10d
xor    %r8d,%r8d
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
mov    (%rax,%rsi,4),%edi
mov    0x4(%rax,%rsi,4),%r9d
xor    %rsi,%rdi
lea    0x1(%rsi),%rdx
xor    %r9,%rdx
or     %rdi,%rdx
mov    0x8(%rax,%rsi,4),%r9d
lea    0x2(%rsi),%rdi
xor    %r9,%rdi
or     %rdx,%rdi
mov    0xc(%rax,%rsi,4),%r9d
lea    0x3(%rsi),%rdx
xor    %r9,%rdx
mov    0x10(%rax,%rsi,4),%r9d
lea    0x4(%rsi),%rcx
xor    %r9,%rcx
or     %rdx,%rcx
or     %rdi,%rcx
cmovne %r8d,%r10d
add    $0x5,%rsi
cmp    $0x64,%rsi
jne    1280 <main+0x160>
test   %r10d,%r10d
lea    0xeb6(%rip),%rax
lea    0xeb5(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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