#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 *, ...);
void fn_test1(int (*pa)[4]) {
  int i;
  int n = sizeof(*pa) / sizeof((*pa)[0]);
  printf("\n");
  for (i = 0; i < n; i++)
    printf("%d(%p), ", (*pa)[i], (*pa) + i);
  printf("\n");
}


x86 assembly (clang, -O0):
<fn_test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x4,-0x10(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    117a <fn_test1+0x6a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x8(%rbp),%rdx
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <fn_test1+0x28>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_test1>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rbx),%esi
lea    0xec6(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rbx),%rdx
mov    0x4(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rbx),%rdx
mov    0x8(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rbx),%esi
add    $0xc,%rbx
mov    %r14,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d(%p), \00"
define void @fn_test1([4 x i32]* %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 0
%4 = load i32, i32* %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32* %3)
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 1
%7 = load i32, i32* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32* %6)
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 2
%10 = load i32, i32* %9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32* %9)
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 3
%13 = load i32, i32* %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32* %12)
%15 = tail call i32 @putchar(i32 10)
ret void
}