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

/* Variables and functions */
int /*<<< orphan*/ findMinMax(long *, long *, long *);
int /*<<< orphan*/ printf(char *, long, long);
int /*<<< orphan*/ scanf(char *, long *);
int main() {
  long int nums[5], min, max, sum = 0;
  for (int i = 0; i < 5; i++) {
    scanf("%ld", &nums[i]);
    sum += nums[i];
  }
  min = max = nums[0];
  findMinMax(nums, &min, &max);
  printf("%ld %ld", sum - max, sum - min);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
cmpl   $0x5,-0x4c(%rbp)
jge    1192 <main+0x62>
movslq -0x4c(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe96(%rip),%rdi
call   1050 <scanf@plt>
movslq -0x4c(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rax
add    -0x48(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    114e <main+0x1e>
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1030 <findMinMax@plt>
mov    -0x48(%rbp),%rsi
sub    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdx
sub    -0x38(%rbp),%rdx
lea    0xe3a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x60,%rsp
lea    0xec4(%rip),%rbx
lea    0x10(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    0x10(%rsp),%r15
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x20(%rsp),%rsi
movsd  0x18(%rsp),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x28(%rsp),%rsi
movsd  0x20(%rsp),%xmm0
unpcklpd 0x40(%rsp),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x30(%rsp),%rsi
movsd  0x28(%rsp),%xmm0
movaps %xmm0,0x50(%rsp)
mov    %rbx,%rdi
call   1050 <scanf@plt>
movq   0x30(%rsp),%xmm0
punpcklqdq 0x50(%rsp),%xmm0
paddq  0x40(%rsp),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddq  %xmm0,%xmm1
movq   %xmm1,%rbx
add    %r15,%rbx
mov    0x10(%rsp),%rax
mov    %rax,(%rsp)
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
mov    %r14,%rdi
call   1030 <findMinMax@plt>
mov    %rbx,%rsi
sub    (%rsp),%rsi
sub    0x8(%rsp),%rbx
lea    0xdfc(%rip),%rdi
mov    %rbx,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [8 x i8] c"%ld %ld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i64]
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i32 0, i32* %1
store i64 0, i64* %5
store i32 0, i32* %6
br label %7
7: ; preds = %21, %0
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [5 x i64], [5 x i64]* %2, i64 0, i64 %12
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %13)
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [5 x i64], [5 x i64]* %2, i64 0, i64 %16
%18 = load i64, i64* %17
%19 = load i64, i64* %5
%20 = add nsw i64 %19, %18
store i64 %20, i64* %5
br label %21
21: ; preds = %10
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %7
24: ; preds = %7
%25 = getelementptr inbounds [5 x i64], [5 x i64]* %2, i64 0, i64 0
%26 = load i64, i64* %25
store i64 %26, i64* %4
store i64 %26, i64* %3
%27 = getelementptr inbounds [5 x i64], [5 x i64]* %2, i64 0, i64 0
%28 = call i32 @findMinMax(i64* %27, i64* %3, i64* %4)
%29 = load i64, i64* %5
%30 = load i64, i64* %4
%31 = sub nsw i64 %29, %30
%32 = load i64, i64* %5
%33 = load i64, i64* %3
%34 = sub nsw i64 %32, %33
%35 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 %31, i64 %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [8 x i8] c"%ld %ld\00"
define i32 @main() {
%1 = alloca [5 x i64]
%2 = alloca i64
%3 = alloca i64
%4 = bitcast [5 x i64]* %1 to i8*
%5 = bitcast i64* %2 to i8*
%6 = bitcast i64* %3 to i8*
%7 = getelementptr inbounds [5 x i64], [5 x i64]* %1, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %7)
%9 = load i64, i64* %7
%10 = getelementptr inbounds [5 x i64], [5 x i64]* %1, i64 0, i64 1
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %10)
%12 = load i64, i64* %10
%13 = getelementptr inbounds [5 x i64], [5 x i64]* %1, i64 0, i64 2
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %13)
%15 = load i64, i64* %13
%16 = getelementptr inbounds [5 x i64], [5 x i64]* %1, i64 0, i64 3
%17 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %16)
%18 = load i64, i64* %16
%19 = getelementptr inbounds [5 x i64], [5 x i64]* %1, i64 0, i64 4
%20 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %19)
%21 = load i64, i64* %19
%22 = insertelement <4 x i64> poison, i64 %21, i64 0
%23 = insertelement <4 x i64> %22, i64 %18, i64 1
%24 = insertelement <4 x i64> %23, i64 %15, i64 2
%25 = insertelement <4 x i64> %24, i64 %12, i64 3
%26 = call i64 @llvm.vector.reduce.add.v4i64(<4 x i64> %25)
%27 = add nsw i64 %26, %9
%28 = load i64, i64* %7
store i64 %28, i64* %3
store i64 %28, i64* %2
%29 = call i32 @findMinMax(i64* %7, i64* %2, i64* %3)
%30 = load i64, i64* %3
%31 = sub nsw i64 %27, %30
%32 = load i64, i64* %2
%33 = sub nsw i64 %27, %32
%34 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 %31, i64 %33)
ret i32 0
}