#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*/ a3;
typedef int /*<<< orphan*/ a2;
typedef int /*<<< orphan*/ a1;

/* Variables and functions */
int INT_MAX;
int INT_MIN;
int /*<<< orphan*/ test(int *, int);
int main(void) {
  int a1[] = {4, -3, 6, 8, 2, 7};
  test(a1, (sizeof(a1) / sizeof(a1[0])));
  int a2[] = {1398, -6, 24, -1, 13, 65, 24, -490, -2000};
  test(a2, (sizeof(a2) / sizeof(a2[0])));
  int a3[] = {INT_MAX, INT_MIN};
  test(a3, (sizeof(a3) / sizeof(a3[0])));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1040 <test@plt>
lea    -0x50(%rbp),%rdi
lea    0xebe(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x50(%rbp),%rdi
mov    $0x9,%esi
call   1040 <test@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
mov    0x2e53(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
lea    -0x58(%rbp),%rdi
mov    $0x2,%esi
call   1040 <test@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x6,%esi
call   1030 <test@plt>
mov    0xeff(%rip),%eax
mov    %eax,0x50(%rsp)
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0x30(%rsp),%rdi
mov    $0x9,%esi
call   1030 <test@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    0x2e60(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x2,%esi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.a1 = [6 x i32] [i32 4, i32 -3, i32 6, i32 8, i32 2, i32 7]
@__const.main.a2 = [9 x i32] [i32 1398, i32 -6, i32 24, i32 -1, i32 13, i32 65, i32 24, i32 -490, i32 -2000]
@INT_MAX = global i32 0
@INT_MIN = global i32 0
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca [9 x i32]
%3 = alloca [2 x i32]
%4 = bitcast [6 x i32]* %1 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = call i32 @test(i32* %5, i32 6)
%7 = bitcast [9 x i32]* %2 to i8*
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%9 = call i32 @test(i32* %8, i32 9)
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%11 = load i32, i32* @INT_MAX
store i32 %11, i32* %10
%12 = getelementptr inbounds i32, i32* %10, i64 1
%13 = load i32, i32* @INT_MIN
store i32 %13, i32* %12
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%15 = call i32 @test(i32* %14, i32 2)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a1 = [6 x i32] [i32 4, i32 -3, i32 6, i32 8, i32 2, i32 7]
@__const.main.a2 = [9 x i32] [i32 1398, i32 -6, i32 24, i32 -1, i32 13, i32 65, i32 24, i32 -490, i32 -2000]
@INT_MAX = global i32 0
@INT_MIN = global i32 0
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca [9 x i32]
%3 = alloca [2 x i32]
%4 = bitcast [6 x i32]* %1 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = call i32 @test(i32* %5, i32 6)
%7 = bitcast [9 x i32]* %2 to i8*
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%9 = call i32 @test(i32* %8, i32 9)
%10 = bitcast [2 x i32]* %3 to i8*
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%12 = load i32, i32* @INT_MAX
store i32 %12, i32* %11
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%14 = load i32, i32* @INT_MIN
store i32 %14, i32* %13
%15 = call i32 @test(i32* %11, i32 2)
ret i32 0
}