#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*/ f();
int sum(int i, int j, int k, int y) {
  f();
  int i1 = 1;
  int i2 = 2;
  int i3 = 3;
  int i4 = 4;
  int i5 = 5;
  int i6 = 6;
  int i7 = 7;
  int i8 = 8;
  int i9 = 9;
  int i10 = 10;
  int i11 = 11;
  int i12 = 12;
  int i13 = 13;
  int i14 = 14;
  int i15 = 15;
  int i16 = 16;
  int i17 = 17;
  int i18 = 18;
  int i19 = 19;
  int i20 = 20;
  return i + j + k + y;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
movl   $0x1,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
movl   $0x3,-0x1c(%rbp)
movl   $0x4,-0x20(%rbp)
movl   $0x5,-0x24(%rbp)
movl   $0x6,-0x28(%rbp)
movl   $0x7,-0x2c(%rbp)
movl   $0x8,-0x30(%rbp)
movl   $0x9,-0x34(%rbp)
movl   $0xa,-0x38(%rbp)
movl   $0xb,-0x3c(%rbp)
movl   $0xc,-0x40(%rbp)
movl   $0xd,-0x44(%rbp)
movl   $0xe,-0x48(%rbp)
movl   $0xf,-0x4c(%rbp)
movl   $0x10,-0x50(%rbp)
movl   $0x11,-0x54(%rbp)
movl   $0x12,-0x58(%rbp)
movl   $0x13,-0x5c(%rbp)
movl   $0x14,-0x60(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <f@plt>
add    %ebx,%ebp
add    %r15d,%ebp
add    %r14d,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sum(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%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
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%29 = call i32 (...) @f()
store i32 1, i32* %9
store i32 2, i32* %10
store i32 3, i32* %11
store i32 4, i32* %12
store i32 5, i32* %13
store i32 6, i32* %14
store i32 7, i32* %15
store i32 8, i32* %16
store i32 9, i32* %17
store i32 10, i32* %18
store i32 11, i32* %19
store i32 12, i32* %20
store i32 13, i32* %21
store i32 14, i32* %22
store i32 15, i32* %23
store i32 16, i32* %24
store i32 17, i32* %25
store i32 18, i32* %26
store i32 19, i32* %27
store i32 20, i32* %28
%30 = load i32, i32* %5
%31 = load i32, i32* %6
%32 = add nsw i32 %30, %31
%33 = load i32, i32* %7
%34 = add nsw i32 %32, %33
%35 = load i32, i32* %8
%36 = add nsw i32 %34, %35
ret i32 %36
}

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (...) @f()
%6 = add nsw i32 %1, %0
%7 = add nsw i32 %6, %2
%8 = add nsw i32 %7, %3
ret i32 %8
}