#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]), &max, &min);
  printf("a[0] = %d\n", a[0]);
  printf("max = %d\nmin = %d\n", max, min);
  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    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    $0x11,%esi
lea    -0x58(%rbp),%rdx
lea    -0x54(%rbp),%rcx
call   1050 <minmax@plt>
mov    -0x50(%rbp),%esi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x58(%rbp),%esi
mov    -0x54(%rbp),%edx
lea    0xec6(%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    0xee1(%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    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
lea    0xeb3(%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 = [22 x i8] c"main sizeof(a) = %lu\0A\00"
@.str.1 = [14 x i8] c"main *a = %p\0A\00"
@.str.2 = [11 x i8] c"a[0] = %d\0A\00"
@.str.3 = [19 x i8] c"max = %d\0Amin = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [17 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [17 x i32]* %2 to i8*
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 68)
%7 = getelementptr inbounds [17 x i32], [17 x i32]* %2, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = getelementptr inbounds [17 x i32], [17 x i32]* %2, i64 0, i64 0
%10 = call i32 @minmax(i32* %9, i32 17, i32* %4, i32* %3)
%11 = getelementptr inbounds [17 x i32], [17 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %14, i32 %15)
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 = [22 x i8] c"main sizeof(a) = %lu\0A\00"
@.str.1 = [14 x i8] c"main *a = %p\0A\00"
@.str.2 = [11 x i8] c"a[0] = %d\0A\00"
@.str.3 = [19 x i8] c"max = %d\0Amin = %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 ([22 x i8], [22 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 ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%10 = call i32 @minmax(i32* %8, i32 17, i32* %3, i32* %2)
%11 = load i32, i32* %8
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %13, i32 %14)
ret i32 0
}