#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*/ array;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void test(int *);
int /*<<< orphan*/ test1(int *);
int /*<<< orphan*/ test2(int **);
int main01(void) {
  int i = 0;
  test(&i);
  printf("i = %d\n", i);
  printf("------------------------\n");
  int array[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  printf("sizeof(array) = %d\n", sizeof(array));
  test1(array);
  int array2[5][3] = {0};
  test2(array2);
  void (*p2)(int *);
  p2 = test;
  int a = 10;
  p2(&a);
  return 0;
}


x86 assembly (clang, -O0):
<main01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1088 <test@plt>
mov    -0x4(%rbp),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    0xeab(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
lea    0xe7c(%rip),%rdi
mov    $0x28,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <test1@plt>
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x3c,%edx
call   1050 <memset@plt>
lea    -0x70(%rbp),%rdi
call   1070 <test2@plt>
mov    0x2e1d(%rip),%rax
mov    %rax,-0x78(%rbp)
movl   $0xa,-0x7c(%rbp)
lea    -0x7c(%rbp),%rdi
call   *-0x78(%rbp)
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main01>:
sub    $0x88,%rsp
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1070 <test@plt>
mov    0x8(%rsp),%esi
lea    0xe8c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
mov    0xed2(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xeb6(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe9a(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xe56(%rip),%rdi
mov    $0x28,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x10(%rsp),%rdi
call   1040 <test1@plt>
xorps  %xmm0,%xmm0
movups %xmm0,0x6c(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
lea    0x40(%rsp),%rdi
call   1060 <test2@plt>
movl   $0xa,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1070 <test@plt>
xor    %eax,%eax
add    $0x88,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"i = %d\0A\00"
@.str.1 = [26 x i8] c"------------------------\0A\00"
@__const.main01.array = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str.2 = [20 x i8] c"sizeof(array) = %d\0A\00"
define i32 @main01() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [5 x [3 x i32]]
%4 = alloca void (i32*)*
%5 = alloca i32
store i32 0, i32* %1
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%9 = bitcast [10 x i32]* %2 to i8*
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i64 40)
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%12 = call i32 @test1(i32* %11)
%13 = bitcast [5 x [3 x i32]]* %3 to i8*
%14 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %3, i64 0, i64 0
%15 = bitcast [3 x i32]* %14 to i32**
%16 = call i32 @test2(i32** %15)
store void (i32*)* @test, void (i32*)** %4
store i32 10, i32* %5
%17 = load void (i32*)*, void (i32*)** %4
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"i = %d\0A\00"
@__const.main01.array = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str.2 = [20 x i8] c"sizeof(array) = %d\0A\00"
@str = [25 x i8] c"------------------------\00"
define i32 @main01() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [5 x [3 x i32]]
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%9 = bitcast [10 x i32]* %2 to i8*
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i64 40)
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%12 = call i32 @test1(i32* %11)
%13 = bitcast [5 x [3 x i32]]* %3 to i8*
%14 = bitcast [5 x [3 x i32]]* %3 to i32**
%15 = call i32 @test2(i32** %14)
%16 = bitcast i32* %4 to i8*
store i32 10, i32* %4
ret i32 0
}