#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 ExternalLibrary();
int byproduct1();
int byproduct2();
int byproduct3();
int byproduct4();
int byproduct5();
int byproduct6();
int byproduct7();
int byproduct8();
int main(void) {
  return (byproduct1() + byproduct2() + byproduct3() + byproduct4() +
          byproduct5() + byproduct6() + byproduct7() + byproduct8() +
          ExternalLibrary() + 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   10b0 <byproduct1@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1070 <byproduct2@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   10a0 <byproduct3@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1060 <byproduct4@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1090 <byproduct5@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <byproduct6@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1080 <byproduct7@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <byproduct8@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <ExternalLibrary@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x0,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   10b0 <byproduct1@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <byproduct2@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   10a0 <byproduct3@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1060 <byproduct4@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1090 <byproduct5@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1050 <byproduct6@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1080 <byproduct7@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1040 <byproduct8@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1030 <ExternalLibrary@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @byproduct1()
%3 = call i32 (...) @byproduct2()
%4 = add nsw i32 %2, %3
%5 = call i32 (...) @byproduct3()
%6 = add nsw i32 %4, %5
%7 = call i32 (...) @byproduct4()
%8 = add nsw i32 %6, %7
%9 = call i32 (...) @byproduct5()
%10 = add nsw i32 %8, %9
%11 = call i32 (...) @byproduct6()
%12 = add nsw i32 %10, %11
%13 = call i32 (...) @byproduct7()
%14 = add nsw i32 %12, %13
%15 = call i32 (...) @byproduct8()
%16 = add nsw i32 %14, %15
%17 = call i32 (...) @ExternalLibrary()
%18 = add nsw i32 %16, %17
%19 = add nsw i32 %18, 0
ret i32 %19
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @byproduct1()
%2 = tail call i32 (...) @byproduct2()
%3 = add nsw i32 %2, %1
%4 = tail call i32 (...) @byproduct3()
%5 = add nsw i32 %3, %4
%6 = tail call i32 (...) @byproduct4()
%7 = add nsw i32 %5, %6
%8 = tail call i32 (...) @byproduct5()
%9 = add nsw i32 %7, %8
%10 = tail call i32 (...) @byproduct6()
%11 = add nsw i32 %9, %10
%12 = tail call i32 (...) @byproduct7()
%13 = add nsw i32 %11, %12
%14 = tail call i32 (...) @byproduct8()
%15 = add nsw i32 %13, %14
%16 = tail call i32 (...) @ExternalLibrary()
%17 = add nsw i32 %15, %16
ret i32 %17
}