#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*/ printf(char *, int, int, int, int, int, int, int, int, int,
                          int);
int addnums(int n0, int n1, int n2, int n3, int n4, int n5, int n6, int n7,
            int n8, int n9) {
  int result;
  printf("addnums(): n0=%d n1=%d n2=%d n3=%d n4=%d n5=%d n6=%d n7=%d n8=%d "
         "n9=%d\n",
         n0, n1, n2, n3, n4, n5, n6, n7, n8, n9);
  result = n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8 + n9;
  return result;
}


x86 assembly (clang, -O0):
<addnums>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x14(%rbp)
mov    %esi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
mov    -0x28(%rbp),%r14d
mov    0x10(%rbp),%ebx
mov    0x18(%rbp),%r11d
mov    0x20(%rbp),%r10d
mov    0x28(%rbp),%eax
lea    0xe9b(%rip),%rdi
mov    %r14d,(%rsp)
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
add    0x10(%rbp),%eax
add    0x18(%rbp),%eax
add    0x20(%rbp),%eax
add    0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<addnums>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x48(%rsp),%r11d
mov    0x50(%rsp),%r10d
mov    0x58(%rsp),%eax
sub    $0x8,%rsp
lea    0xebc(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    %r15d,%r9d
push   %rax
push   %r10
push   %r11
mov    0x60(%rsp),%eax
push   %rax
push   %r14
call   1030 <printf@plt>
add    $0x30,%rsp
add    %ebp,%ebx
add    %r13d,%ebx
add    %r12d,%ebx
add    %r15d,%ebx
add    %r14d,%ebx
mov    0x40(%rsp),%eax
add    %eax,%ebx
mov    0x48(%rsp),%eax
add    %eax,%ebx
mov    0x50(%rsp),%eax
add    %eax,%ebx
mov    0x58(%rsp),%eax
add    %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [72 x i8] c"addnums(): n0=%d n1=%d n2=%d n3=%d n4=%d n5=%d n6=%d n7=%d n8=%d n9=%d\0A\00"
define i32 @addnums(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i32 %0, i32* %11
store i32 %1, i32* %12
store i32 %2, i32* %13
store i32 %3, i32* %14
store i32 %4, i32* %15
store i32 %5, i32* %16
store i32 %6, i32* %17
store i32 %7, i32* %18
store i32 %8, i32* %19
store i32 %9, i32* %20
%22 = load i32, i32* %11
%23 = load i32, i32* %12
%24 = load i32, i32* %13
%25 = load i32, i32* %14
%26 = load i32, i32* %15
%27 = load i32, i32* %16
%28 = load i32, i32* %17
%29 = load i32, i32* %18
%30 = load i32, i32* %19
%31 = load i32, i32* %20
%32 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i32 %22, i32 %23, i32 %24, i32 %25, i32 %26, i32 %27, i32 %28, i32 %29, i32 %30, i32 %31)
%33 = load i32, i32* %11
%34 = load i32, i32* %12
%35 = add nsw i32 %33, %34
%36 = load i32, i32* %13
%37 = add nsw i32 %35, %36
%38 = load i32, i32* %14
%39 = add nsw i32 %37, %38
%40 = load i32, i32* %15
%41 = add nsw i32 %39, %40
%42 = load i32, i32* %16
%43 = add nsw i32 %41, %42
%44 = load i32, i32* %17
%45 = add nsw i32 %43, %44
%46 = load i32, i32* %18
%47 = add nsw i32 %45, %46
%48 = load i32, i32* %19
%49 = add nsw i32 %47, %48
%50 = load i32, i32* %20
%51 = add nsw i32 %49, %50
store i32 %51, i32* %21
%52 = load i32, i32* %21
ret i32 %52
}

LLVM IR (-O2):
@.str = [72 x i8] c"addnums(): n0=%d n1=%d n2=%d n3=%d n4=%d n5=%d n6=%d n7=%d n8=%d n9=%d\0A\00"
define i32 @addnums(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = tail call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9)
%12 = add nsw i32 %1, %0
%13 = add nsw i32 %12, %2
%14 = add nsw i32 %13, %3
%15 = add nsw i32 %14, %4
%16 = add nsw i32 %15, %5
%17 = add nsw i32 %16, %6
%18 = add nsw i32 %17, %7
%19 = add nsw i32 %18, %8
%20 = add nsw i32 %19, %9
ret i32 %20
}