#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 */
typedef int /*<<< orphan*/ pta;
typedef int /*<<< orphan*/ aop;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int a[10];
  int(*pta)[10];
  int *aop[10];
  int i;
  printf("sizeof(pta):%d\n", sizeof(pta));
  printf("sizeof(aop):%d\n", sizeof(aop));
  pta = &a;
  for (i = 0; i < 10; i++) {
    aop[i] = &a[i];
  }
  printf("&a:%p pta:%p\n", &a, pta);
  for (i = 0; i < 10; i++) {
    printf("&a[%d]:%p aop[%d]:%p\n", i, &a[i], i, aop[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed7(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x50,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x94(%rbp)
cmpl   $0xa,-0x94(%rbp)
jge    119c <main+0x8c>
movslq -0x94(%rbp),%rax
lea    -0x30(%rbp),%rcx
shl    $0x2,%rax
add    %rax,%rcx
movslq -0x94(%rbp),%rax
mov    %rcx,-0x90(%rbp,%rax,8)
ff
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    115a <main+0x4a>
mov    -0x38(%rbp),%rdx
lea    0xe79(%rip),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0xa,-0x94(%rbp)
jge    1218 <main+0x108>
mov    -0x94(%rbp),%esi
movslq -0x94(%rbp),%rax
lea    -0x30(%rbp),%rdx
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x94(%rbp),%ecx
movslq -0x94(%rbp),%rax
mov    -0x90(%rbp,%rax,8),%r8
ff
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    11bc <main+0xac>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xedb(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x50,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%r13
lea    0x8(%rsp),%r12
lea    0xc(%rsp),%r15
lea    0x10(%rsp),%r14
lea    0xec1(%rip),%rdi
mov    %rsp,%rbp
mov    %rbp,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %rbp,%rdx
xor    %ecx,%ecx
mov    %rbp,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r13,%rdx
mov    $0x1,%ecx
mov    %r13,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %r12,%rdx
mov    $0x2,%ecx
mov    %r12,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %r15,%rdx
mov    $0x3,%ecx
mov    %r15,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r14,%rdx
mov    $0x4,%ecx
mov    %r14,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
lea    0x14(%rsp),%rdx
mov    $0x5,%ecx
mov    %rdx,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
lea    0x18(%rsp),%rdx
mov    $0x6,%ecx
mov    %rdx,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
lea    0x1c(%rsp),%rdx
mov    $0x7,%ecx
mov    %rdx,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
lea    0x20(%rsp),%rdx
mov    $0x8,%ecx
mov    %rdx,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
lea    0x24(%rsp),%rdx
mov    $0x9,%ecx
mov    %rdx,%r8
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"sizeof(pta):%d\0A\00"
@.str.1 = [16 x i8] c"sizeof(aop):%d\0A\00"
@.str.2 = [14 x i8] c"&a:%p pta:%p\0A\00"
@.str.3 = [22 x i8] c"&a[%d]:%p aop[%d]:%p\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 8)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i64 80)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), [10 x i32]* %1, [10 x i32]* %1)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 0, i32* %5, i32 0, i32* %5)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 1, i32* %6, i32 1, i32* %6)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 2, i32* %7, i32 2, i32* %7)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 3, i32* %8, i32 3, i32* %8)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 4, i32* %9, i32 4, i32* %9)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 5, i32* %10, i32 5, i32* %10)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 6, i32* %11, i32 6, i32* %11)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 7, i32* %12, i32 7, i32* %12)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 8, i32* %13, i32 8, i32* %13)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 9, i32* %14, i32 9, i32* %14)
ret i32 0
}