#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*/ printf(char *);
int main() {
  int intarray[5] = {10, 20, 30, 40, 50};
  int *pointer = &intarray[2];
  int *parray[3];
  int i;
  for (i = 0; i < 3; i++) {
    parray[i] = pointer + i;
  }
  for (i = 0; i < 3; i++) {
    if (parray[i] == &pointer[i]) {
      printf("Matched!\n");
    } else {
      printf("Fail\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x3,-0x44(%rbp)
jge    1181 <main+0x71>
mov    -0x28(%rbp),%rcx
movslq -0x44(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
movslq -0x44(%rbp),%rax
mov    %rcx,-0x40(%rbp,%rax,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1151 <main+0x41>
movl   $0x0,-0x44(%rbp)
cmpl   $0x3,-0x44(%rbp)
jge    11e3 <main+0xd3>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rax
mov    -0x28(%rbp),%rcx
movslq -0x44(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jne    11c4 <main+0xb4>
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
jmp    11d0 <main+0xc0>
lea    0xe53(%rip),%rdi
call   1030 <printf@plt>
jmp    11d5 <main+0xc5>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1188 <main+0x78>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str.2 = [9 x i8] c"Matched!\00"
define i32 @main() {
%1 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.2, i64 0, i64 0))
%2 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.2, i64 0, i64 0))
%3 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}