#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*/ free(int *);
int *make_array(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ regular_array(int *, int);
int /*<<< orphan*/ static_array(int *);
int /*<<< orphan*/ vlc_array(int, int *);
int /*<<< orphan*/ vlcstatic_array(int, int *);
void array_params(void) {
  printf("--array params--\n");
  int foo[5];
  regular_array(foo, 5);
  vlc_array(5, foo);
  static_array(foo);
  vlcstatic_array(5, foo);
  int *beef = NULL;
  static_array(beef);
  int bar[10];
  regular_array(bar, 10);
  vlc_array(2, bar);
  static_array(bar);
  vlcstatic_array(5, bar);
  regular_array(NULL, 0);
  vlc_array(0, NULL);
  static_array(NULL);
  vlcstatic_array(0, NULL);
  int baz[20];
  regular_array(baz, 20);
  vlc_array(20, baz);
  static_array(baz);
  vlcstatic_array(20, baz);
  int *pfoo = make_array(10);
  regular_array(pfoo, 10);
  vlc_array(10, pfoo);
  static_array(pfoo);
  vlcstatic_array(10, pfoo);
  free(pfoo);
}


x86 assembly (clang, -O0):
<array_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1080 <regular_array@plt>
lea    -0x20(%rbp),%rsi
mov    $0x5,%edi
call   1060 <vlc_array@plt>
lea    -0x20(%rbp),%rdi
call   1050 <static_array@plt>
lea    -0x20(%rbp),%rsi
mov    $0x5,%edi
call   1070 <vlcstatic_array@plt>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <static_array@plt>
lea    -0x50(%rbp),%rdi
mov    $0xa,%esi
call   1080 <regular_array@plt>
lea    -0x50(%rbp),%rsi
mov    $0x2,%edi
call   1060 <vlc_array@plt>
lea    -0x50(%rbp),%rdi
call   1050 <static_array@plt>
lea    -0x50(%rbp),%rsi
mov    $0x5,%edi
call   1070 <vlcstatic_array@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1080 <regular_array@plt>
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <vlc_array@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <static_array@plt>
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <vlcstatic_array@plt>
lea    -0xa0(%rbp),%rdi
mov    $0x14,%esi
call   1080 <regular_array@plt>
lea    -0xa0(%rbp),%rsi
mov    $0x14,%edi
call   1060 <vlc_array@plt>
lea    -0xa0(%rbp),%rdi
call   1050 <static_array@plt>
lea    -0xa0(%rbp),%rsi
mov    $0x14,%edi
call   1070 <vlcstatic_array@plt>
mov    $0xa,%edi
call   1090 <make_array@plt>
mov    %rax,-0xa8(%rbp)
mov    -0xa8(%rbp),%rdi
mov    $0xa,%esi
call   1080 <regular_array@plt>
mov    -0xa8(%rbp),%rsi
mov    $0xa,%edi
call   1060 <vlc_array@plt>
mov    -0xa8(%rbp),%rdi
call   1050 <static_array@plt>
mov    -0xa8(%rbp),%rsi
mov    $0xa,%edi
call   1070 <vlcstatic_array@plt>
mov    -0xa8(%rbp),%rdi
call   1030 <free@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_params>:
push   %rbx
sub    $0xa0,%rsp
lea    0xe81(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1080 <regular_array@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
call   1060 <vlc_array@plt>
mov    %rbx,%rdi
call   1050 <static_array@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
call   1070 <vlcstatic_array@plt>
xor    %edi,%edi
call   1050 <static_array@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <regular_array@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1060 <vlc_array@plt>
mov    %rbx,%rdi
call   1050 <static_array@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
call   1070 <vlcstatic_array@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1080 <regular_array@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1060 <vlc_array@plt>
xor    %edi,%edi
call   1050 <static_array@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <vlcstatic_array@plt>
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1080 <regular_array@plt>
mov    $0x14,%edi
mov    %rbx,%rsi
call   1060 <vlc_array@plt>
mov    %rbx,%rdi
call   1050 <static_array@plt>
mov    $0x14,%edi
mov    %rbx,%rsi
call   1070 <vlcstatic_array@plt>
mov    $0xa,%edi
call   1090 <make_array@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
call   1080 <regular_array@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1060 <vlc_array@plt>
mov    %rbx,%rdi
call   1050 <static_array@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1070 <vlcstatic_array@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
add    $0xa0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"--array params--\0A\00"
define void @array_params() {
%1 = alloca [5 x i32]
%2 = alloca i32*
%3 = alloca [10 x i32]
%4 = alloca [20 x i32]
%5 = alloca i32*
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%8 = call i32 @regular_array(i32* %7, i32 5)
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%10 = call i32 @vlc_array(i32 5, i32* %9)
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%12 = call i32 @static_array(i32* %11)
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%14 = call i32 @vlcstatic_array(i32 5, i32* %13)
store i32* null, i32** %2
%15 = load i32*, i32** %2
%16 = call i32 @static_array(i32* %15)
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%18 = call i32 @regular_array(i32* %17, i32 10)
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%20 = call i32 @vlc_array(i32 2, i32* %19)
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%22 = call i32 @static_array(i32* %21)
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%24 = call i32 @vlcstatic_array(i32 5, i32* %23)
%25 = call i32 @regular_array(i32* null, i32 0)
%26 = call i32 @vlc_array(i32 0, i32* null)
%27 = call i32 @static_array(i32* null)
%28 = call i32 @vlcstatic_array(i32 0, i32* null)
%29 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 0
%30 = call i32 @regular_array(i32* %29, i32 20)
%31 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 0
%32 = call i32 @vlc_array(i32 20, i32* %31)
%33 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 0
%34 = call i32 @static_array(i32* %33)
%35 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 0
%36 = call i32 @vlcstatic_array(i32 20, i32* %35)
%37 = call i32* @make_array(i32 10)
store i32* %37, i32** %5
%38 = load i32*, i32** %5
%39 = call i32 @regular_array(i32* %38, i32 10)
%40 = load i32*, i32** %5
%41 = call i32 @vlc_array(i32 10, i32* %40)
%42 = load i32*, i32** %5
%43 = call i32 @static_array(i32* %42)
%44 = load i32*, i32** %5
%45 = call i32 @vlcstatic_array(i32 10, i32* %44)
%46 = load i32*, i32** %5
%47 = call i32 @free(i32* %46)
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"--array params--\00"
define void @array_params() {
%1 = alloca [5 x i32]
%2 = alloca [10 x i32]
%3 = alloca [20 x i32]
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%5 = bitcast [5 x i32]* %1 to i8*
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%7 = call i32 @regular_array(i32* %6, i32 5)
%8 = call i32 @vlc_array(i32 5, i32* %6)
%9 = call i32 @static_array(i32* %6)
%10 = call i32 @vlcstatic_array(i32 5, i32* %6)
%11 = call i32 @static_array(i32* null)
%12 = bitcast [10 x i32]* %2 to i8*
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%14 = call i32 @regular_array(i32* %13, i32 10)
%15 = call i32 @vlc_array(i32 2, i32* %13)
%16 = call i32 @static_array(i32* %13)
%17 = call i32 @vlcstatic_array(i32 5, i32* %13)
%18 = call i32 @regular_array(i32* null, i32 0)
%19 = call i32 @vlc_array(i32 0, i32* null)
%20 = call i32 @static_array(i32* null)
%21 = call i32 @vlcstatic_array(i32 0, i32* null)
%22 = bitcast [20 x i32]* %3 to i8*
%23 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%24 = call i32 @regular_array(i32* %23, i32 20)
%25 = call i32 @vlc_array(i32 20, i32* %23)
%26 = call i32 @static_array(i32* %23)
%27 = call i32 @vlcstatic_array(i32 20, i32* %23)
%28 = call i32* @make_array(i32 10)
%29 = call i32 @regular_array(i32* %28, i32 10)
%30 = call i32 @vlc_array(i32 10, i32* %28)
%31 = call i32 @static_array(i32* %28)
%32 = call i32 @vlcstatic_array(i32 10, i32* %28)
%33 = call i32 @free(i32* %28)
ret void
}