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

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ get_max_min(int *, unsigned short, int *, int *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int vec_of_int[] = {98, 42, 54, 60, 70, 68, 11, 76, 54, 12, 98, 76,
                      99, 40, 84, 56, 23, 31, 24, 49, 73, 51, 43, 20};
  int max_value, min_value;
  unsigned short vector_size = sizeof(vec_of_int) / sizeof(vec_of_int[0]);
  get_max_min(vec_of_int, vector_size, &max_value, &min_value);
  printf("Largest integer is: %d\n", max_value);
  printf("Smaller integer is: %d\n", min_value);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x60,%edx
call   1050 <memcpy@plt>
movw   $0x18,-0x7a(%rbp)
lea    -0x70(%rbp),%rdi
lea    -0x74(%rbp),%rdx
lea    -0x78(%rbp),%rcx
movzwl -0x7a(%rbp),%esi
call   1030 <get_max_min@plt>
mov    -0x74(%rbp),%esi
lea    0xee4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x78(%rbp),%esi
lea    0xeed(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e49(%rip),%rax
mov    (%rax),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x78,%rsp
movaps 0xf25(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    $0x18,%esi
call   1030 <get_max_min@plt>
mov    0xc(%rsp),%esi
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e34(%rip),%rax
mov    (%rax),%eax
add    $0x78,%rsp
ret

LLVM IR (-O0):
@__const.main.vec_of_int = [24 x i32] [i32 98, i32 42, i32 54, i32 60, i32 70, i32 68, i32 11, i32 76, i32 54, i32 12, i32 98, i32 76, i32 99, i32 40, i32 84, i32 56, i32 23, i32 31, i32 24, i32 49, i32 73, i32 51, i32 43, i32 20]
@.str = [24 x i8] c"Largest integer is: %d\0A\00"
@.str.1 = [24 x i8] c"Smaller integer is: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [24 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
store i32 0, i32* %1
%6 = bitcast [24 x i32]* %2 to i8*
store i16 24, i16* %5
%7 = getelementptr inbounds [24 x i32], [24 x i32]* %2, i64 0, i64 0
%8 = load i16, i16* %5
%9 = call i32 @get_max_min(i32* %7, i16 zeroext %8, i32* %3, i32* %4)
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@__const.main.vec_of_int = [24 x i32] [i32 98, i32 42, i32 54, i32 60, i32 70, i32 68, i32 11, i32 76, i32 54, i32 12, i32 98, i32 76, i32 99, i32 40, i32 84, i32 56, i32 23, i32 31, i32 24, i32 49, i32 73, i32 51, i32 43, i32 20]
@.str = [24 x i8] c"Largest integer is: %d\0A\00"
@.str.1 = [24 x i8] c"Smaller integer is: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [24 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [24 x i32]* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds [24 x i32], [24 x i32]* %1, i64 0, i64 0
%8 = call i32 @get_max_min(i32* %7, i16 zeroext 24, i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}