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

/* Variables and functions */
int length(int *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int test[10] = {10, 11, 9, 5, 9};
  int l = length(test);
  printf("%d\n", (int)(sizeof(test) / sizeof(test[0])));
  printf("---------------%p\n", test);
  printf("%d\n", l);
  printf("%d\n", '1' - '0');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
movl   $0xa,-0x30(%rbp)
movl   $0xb,-0x2c(%rbp)
movl   $0x9,-0x28(%rbp)
movl   $0x5,-0x24(%rbp)
movl   $0x9,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <length@plt>
mov    %eax,-0x34(%rbp)
lea    0xe7b(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe45(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movaps 0xec0(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x9,0x10(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <length@plt>
mov    %eax,%ebp
lea    0xeb0(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9e(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [19 x i8] c"---------------%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
%5 = bitcast i8* %4 to [10 x i32]*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i32 0, i32 0
store i32 10, i32* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i32 0, i32 1
store i32 11, i32* %7
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i32 0, i32 2
store i32 9, i32* %8
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i32 0, i32 3
store i32 5, i32* %9
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i32 0, i32 4
store i32 9, i32* %10
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%12 = call i32 @length(i32* %11)
store i32 %12, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = load i32, i32* %3
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [19 x i8] c"---------------%p\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%4 = bitcast i32* %3 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = bitcast [10 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 10, i32 11, i32 9, i32 5>, <4 x i32>* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
store i32 9, i32* %7
%8 = call i32 @length(i32* %5)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}