#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 **, int *, int, int);
int main() {
  int num[] = {10, 20, 30, 40, 50};
  int i, *j;
  j = num;
  for (i = 0; i < 5; i++) {
    printf("%p %p %d %d\n", &j, &j[i], *j, num[i]);
    j++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    119f <main+0x8f>
mov    -0x30(%rbp),%rdx
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%r8d
lea    0xe98(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x30(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    114d <main+0x3d>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    0xef3(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdx
mov    %rdx,0x8(%rsp)
lea    0xed6(%rip),%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%ecx
mov    $0xa,%r8d
call   1030 <printf@plt>
mov    0x8(%rsp),%rdx
lea    0x4(%rdx),%rax
mov    %rax,0x8(%rsp)
mov    0x4(%rdx),%ecx
add    $0x8,%rdx
mov    0x14(%rsp),%r8d
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    0x8(%rsp),%rdx
lea    0x4(%rdx),%rax
mov    %rax,0x8(%rsp)
mov    0x4(%rdx),%ecx
add    $0xc,%rdx
mov    0x18(%rsp),%r8d
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    0x8(%rsp),%rdx
lea    0x4(%rdx),%rax
mov    %rax,0x8(%rsp)
mov    0x4(%rdx),%ecx
add    $0x10,%rdx
mov    0x1c(%rsp),%r8d
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    0x8(%rsp),%rdx
lea    0x4(%rdx),%rax
mov    %rax,0x8(%rsp)
mov    0x4(%rdx),%ecx
add    $0x14,%rdx
mov    0x20(%rsp),%r8d
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.num = [5 x i32] [i32 10, i32 20, i32 30, i32 40, i32 50]
@.str = [13 x i8] c"%p %p %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
%5 = bitcast [5 x i32]* %2 to i8*
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
store i32* %6, i32** %4
store i32 0, i32* %3
br label %7
7: ; preds = %24, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %27
10: ; preds = %7
%11 = load i32*, i32** %4
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32** %4, i32* %14, i32 %16, i32 %20)
%22 = load i32*, i32** %4
%23 = getelementptr inbounds i32, i32* %22, i32 1
store i32* %23, i32** %4
br label %24
24: ; preds = %10
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %7
27: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@__const.main.num = [5 x i32] [i32 10, i32 20, i32 30, i32 40, i32 50]
@.str = [13 x i8] c"%p %p %d %d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca i32*
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast i32** %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
store i32* %5, i32** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32** %2, i32* %5, i32 10, i32 10)
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
store i32* %8, i32** %2
%9 = getelementptr inbounds i32, i32* %7, i64 2
%10 = load i32, i32* %8
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32** %2, i32* %9, i32 %10, i32 %12)
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32* %15, i32** %2
%16 = getelementptr inbounds i32, i32* %14, i64 3
%17 = load i32, i32* %15
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32** %2, i32* %16, i32 %17, i32 %19)
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 1
store i32* %22, i32** %2
%23 = getelementptr inbounds i32, i32* %21, i64 4
%24 = load i32, i32* %22
%25 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%26 = load i32, i32* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32** %2, i32* %23, i32 %24, i32 %26)
%28 = load i32*, i32** %2
%29 = getelementptr inbounds i32, i32* %28, i64 1
store i32* %29, i32** %2
%30 = getelementptr inbounds i32, i32* %28, i64 5
%31 = load i32, i32* %29
%32 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
%33 = load i32, i32* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32** %2, i32* %30, i32 %31, i32 %33)
ret i32 0
}