#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() {
  int a[] = {
      1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 16, 17, 21, 23, 55,
  };
  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]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x44,%edx
call   1040 <memcpy@plt>
lea    0xee9(%rip),%rdi
mov    $0x44,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    $0x11,%esi
lea    -0x54(%rbp),%rdx
lea    -0x58(%rbp),%rcx
call   1050 <minmax@plt>
mov    -0x50(%rbp),%esi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x54(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    (%rax),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x60(%rbp),%rax
mov    (%rax),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
mov    0xf15(%rip),%eax
mov    %eax,0x50(%rsp)
movaps 0xefa(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xede(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xede(%rip),%rdi
mov    $0x44,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%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    $0x11,%esi
call   1040 <minmax@plt>
mov    0x10(%rsp),%esi
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [17 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 12, i32 13, i32 14, i32 16, i32 17, i32 21, i32 23, i32 55]
@.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 = [15 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"
define i32 @main() {
%1 = alloca i32
%2 = alloca [17 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 0, i32* %1
%6 = bitcast [17 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 68)
%8 = getelementptr inbounds [17 x i32], [17 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 [17 x i32], [17 x i32]* %2, i64 0, i64 0
%11 = call i32 @minmax(i32* %10, i32 17, i32* %3, i32* %4)
%12 = getelementptr inbounds [17 x i32], [17 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 ([15 x i8], [15 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)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [17 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 12, i32 13, i32 14, i32 16, i32 17, i32 21, i32 23, i32 55]
@.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 = [15 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"
define i32 @main() {
%1 = alloca [17 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [17 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 68)
%8 = getelementptr inbounds [17 x i32], [17 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 17, 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 ([15 x i8], [15 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)
ret i32 0
}