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

/* Variables and functions */
int /*<<< orphan*/ minmax(int *, int, int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int a[] = {1, 3, 5, 6, 8, 19};
  int min, max;
  printf("main sizeof(a)=%lu\n", sizeof(a));
  printf("main a=%p\n", a);
  minmax(a, sizeof(a) / sizeof(a[0]), &min, &max);
  printf("a[0]=%d\n", a[0]);
  printf("min=%d, max=%d\n", min, max);
  int *p = &min;
  printf("*p=%d\n", *p);
  printf("p[0]=%d\n", p[0]);
  printf("*a=%d\n", *a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec1(%rip),%rdi
mov    $0x18,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
lea    -0x24(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1040 <minmax@plt>
mov    -0x20(%rbp),%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x24(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xee4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xed4(%rip),%rdi
mov    $0x18,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <minmax@plt>
mov    0x10(%rsp),%esi
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xea0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xe95(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
lea    0xe8c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [6 x i32] [i32 1, i32 3, i32 5, i32 6, i32 8, i32 19]
@.str = [20 x i8] c"main sizeof(a)=%lu\0A\00"
@.str.1 = [11 x i8] c"main a=%p\0A\00"
@.str.2 = [9 x i8] c"a[0]=%d\0A\00"
@.str.3 = [16 x i8] c"min=%d, max=%d\0A\00"
@.str.4 = [7 x i8] c"*p=%d\0A\00"
@.str.5 = [9 x i8] c"p[0]=%d\0A\00"
@.str.6 = [7 x i8] c"*a=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 0, i32* %1
%6 = bitcast [6 x i32]* %2 to i8*
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 24)
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%10 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%11 = call i32 @minmax(i32* %10, i32 6, i32* %3, i32* %4)
%12 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%13 = load i32, i32* %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %15, i32 %16)
store i32* %3, i32** %5
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %19)
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i64 0
%23 = load i32, i32* %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %23)
%25 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 %26)
ret i32 0
}

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