#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*/ find_two_excessive(int *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int sum = 0;
  int arr[9];
  for (int i = 0; i < 9; i++) {
    scanf("%d", &arr[i]);
    sum += arr[i];
  }
  find_two_excessive(arr, sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x9,-0x34(%rbp)
jge    117e <main+0x5e>
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea3(%rip),%rdi
call   1030 <scanf@plt>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    113d <main+0x1d>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <find_two_excessive@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
lea    0xed1(%rip),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <scanf@plt>
mov    (%rsp),%ebp
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <scanf@plt>
lea    0x8(%rsp),%rsi
movss  0x4(%rsp),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rbx,%rdi
call   1030 <scanf@plt>
lea    0xc(%rsp),%rsi
movss  0x8(%rsp),%xmm0
unpcklps 0x40(%rsp),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rbx,%rdi
call   1030 <scanf@plt>
lea    0x10(%rsp),%rsi
movss  0xc(%rsp),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %rbx,%rdi
call   1030 <scanf@plt>
lea    0x14(%rsp),%rsi
movss  0x10(%rsp),%xmm0
unpcklps 0x30(%rsp),%xmm0
unpcklpd 0x40(%rsp),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rbx,%rdi
call   1030 <scanf@plt>
lea    0x18(%rsp),%rsi
movss  0x14(%rsp),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %rbx,%rdi
call   1030 <scanf@plt>
lea    0x1c(%rsp),%rsi
movss  0x18(%rsp),%xmm0
unpcklps 0x30(%rsp),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %rbx,%rdi
call   1030 <scanf@plt>
lea    0x20(%rsp),%rsi
movss  0x1c(%rsp),%xmm0
movaps %xmm0,0x50(%rsp)
mov    %rbx,%rdi
call   1030 <scanf@plt>
movd   0x20(%rsp),%xmm0
punpckldq 0x50(%rsp),%xmm0
punpcklqdq 0x30(%rsp),%xmm0
paddd  0x40(%rsp),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%esi
add    %ebp,%esi
mov    %r14,%rdi
call   1040 <find_two_excessive@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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