#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 */
scalar_t__ a1();
scalar_t__ a2();
scalar_t__ b1();
scalar_t__ b2();
char *basename(char *);
scalar_t__ c1();
scalar_t__ c2();
scalar_t__ c3();
int /*<<< orphan*/ printf(char *, char *, int);
int main(int argc, char *argv[]) {
  int i = 0;
  i += a1() + a2();
  i += b1() + b2();
  i += c1() + c2() + c3();
  printf("%s: %d\n", basename(argv[0]), i);
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1050 <a1@plt>
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   10a0 <a2@plt>
mov    -0x38(%rbp),%rcx
add    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   10b0 <b1@plt>
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   1070 <b2@plt>
mov    -0x30(%rbp),%rcx
add    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1090 <c1@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1030 <c2@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1080 <c3@plt>
mov    -0x20(%rbp),%rcx
add    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <basename@plt>
mov    %rax,%rsi
mov    -0x14(%rbp),%edx
lea    0xdbc(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,0x10(%rsp)
xor    %eax,%eax
call   1050 <a1@plt>
mov    %rax,0x8(%rsp)
xor    %eax,%eax
call   10a0 <a2@plt>
mov    %rax,%r12
xor    %eax,%eax
call   10b0 <b1@plt>
mov    %rax,%r13
xor    %eax,%eax
call   1070 <b2@plt>
mov    %rax,%rbp
xor    %eax,%eax
call   1090 <c1@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <c2@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1080 <c3@plt>
mov    %rax,%rbx
add    0x8(%rsp),%r12d
add    %r12d,%r13d
add    %r13d,%ebp
add    %ebp,%r14d
add    %r14d,%r15d
add    %r15d,%ebx
mov    0x10(%rsp),%rax
mov    (%rax),%rdi
call   1060 <basename@plt>
lea    0xded(%rip),%rdi
mov    %rax,%rsi
mov    %ebx,%edx
call   1040 <printf@plt>
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i64 (...) @a1()
%8 = call i64 (...) @a2()
%9 = add nsw i64 %7, %8
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %9
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = call i64 (...) @b1()
%15 = call i64 (...) @b2()
%16 = add nsw i64 %14, %15
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = add nsw i64 %18, %16
%20 = trunc i64 %19 to i32
store i32 %20, i32* %6
%21 = call i64 (...) @c1()
%22 = call i64 (...) @c2()
%23 = add nsw i64 %21, %22
%24 = call i64 (...) @c3()
%25 = add nsw i64 %23, %24
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = add nsw i64 %27, %25
%29 = trunc i64 %28 to i32
store i32 %29, i32* %6
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 0
%32 = load i8*, i8** %31
%33 = call i8* @basename(i8* %32)
%34 = load i32, i32* %6
%35 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %33, i32 %34)
%36 = load i32, i32* %6
ret i32 %36
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i64 (...) @a1()
%4 = tail call i64 (...) @a2()
%5 = tail call i64 (...) @b1()
%6 = tail call i64 (...) @b2()
%7 = tail call i64 (...) @c1()
%8 = tail call i64 (...) @c2()
%9 = tail call i64 (...) @c3()
%10 = add i64 %4, %3
%11 = add i64 %10, %5
%12 = add i64 %11, %6
%13 = add i64 %12, %7
%14 = add i64 %13, %8
%15 = add i64 %14, %9
%16 = trunc i64 %15 to i32
%17 = load i8*, i8** %1
%18 = tail call i8* @basename(i8* %17)
%19 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %18, i32 %16)
ret i32 %16
}