#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*/ assert(int);
int fn1(int);
int main() {
  int i1 = fn1(2);
  int i2 = fn1(2);
  int i3 = fn1(2);
  int i4 = fn1(2);
  int i5 = fn1(2);
  int i6 = fn1(2);
  int i7 = fn1(2);
  int i8 = fn1(2);
  assert(i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 <= 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <fn1@plt>
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
call   1030 <fn1@plt>
mov    %eax,-0xc(%rbp)
mov    $0x2,%edi
call   1030 <fn1@plt>
mov    %eax,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <fn1@plt>
mov    %eax,-0x14(%rbp)
mov    $0x2,%edi
call   1030 <fn1@plt>
mov    %eax,-0x18(%rbp)
mov    $0x2,%edi
call   1030 <fn1@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x2,%edi
call   1030 <fn1@plt>
mov    %eax,-0x20(%rbp)
mov    $0x2,%edi
call   1030 <fn1@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
cmp    $0x8,%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x2,%edi
call   1030 <fn1@plt>
mov    %eax,0x4(%rsp)
mov    $0x2,%edi
call   1030 <fn1@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1030 <fn1@plt>
mov    %eax,%r15d
mov    $0x2,%edi
call   1030 <fn1@plt>
mov    %eax,%r12d
mov    $0x2,%edi
call   1030 <fn1@plt>
mov    %eax,%r13d
mov    $0x2,%edi
call   1030 <fn1@plt>
mov    %eax,%ebp
mov    $0x2,%edi
call   1030 <fn1@plt>
mov    %eax,%r14d
mov    $0x2,%edi
call   1030 <fn1@plt>
add    0x4(%rsp),%ebx
add    %r15d,%ebx
add    %r12d,%ebx
add    %r13d,%ebx
add    %ebp,%ebx
add    %r14d,%ebx
add    %eax,%ebx
xor    %edi,%edi
cmp    $0x9,%ebx
setl   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32 @fn1(i32 2)
store i32 %10, i32* %2
%11 = call i32 @fn1(i32 2)
store i32 %11, i32* %3
%12 = call i32 @fn1(i32 2)
store i32 %12, i32* %4
%13 = call i32 @fn1(i32 2)
store i32 %13, i32* %5
%14 = call i32 @fn1(i32 2)
store i32 %14, i32* %6
%15 = call i32 @fn1(i32 2)
store i32 %15, i32* %7
%16 = call i32 @fn1(i32 2)
store i32 %16, i32* %8
%17 = call i32 @fn1(i32 2)
store i32 %17, i32* %9
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = add nsw i32 %18, %19
%21 = load i32, i32* %4
%22 = add nsw i32 %20, %21
%23 = load i32, i32* %5
%24 = add nsw i32 %22, %23
%25 = load i32, i32* %6
%26 = add nsw i32 %24, %25
%27 = load i32, i32* %7
%28 = add nsw i32 %26, %27
%29 = load i32, i32* %8
%30 = add nsw i32 %28, %29
%31 = load i32, i32* %9
%32 = add nsw i32 %30, %31
%33 = icmp sle i32 %32, 8
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fn1(i32 2)
%2 = tail call i32 @fn1(i32 2)
%3 = tail call i32 @fn1(i32 2)
%4 = tail call i32 @fn1(i32 2)
%5 = tail call i32 @fn1(i32 2)
%6 = tail call i32 @fn1(i32 2)
%7 = tail call i32 @fn1(i32 2)
%8 = tail call i32 @fn1(i32 2)
%9 = add nsw i32 %2, %1
%10 = add nsw i32 %9, %3
%11 = add nsw i32 %10, %4
%12 = add nsw i32 %11, %5
%13 = add nsw i32 %12, %6
%14 = add nsw i32 %13, %7
%15 = add nsw i32 %14, %8
%16 = icmp slt i32 %15, 9
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
ret i32 0
}