#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*/ sum(int, int, ...);
int /*<<< orphan*/ sum2(int, int, ...);
int /*<<< orphan*/ sum3(int, int, ...);
int /*<<< orphan*/ sum4(int, int, ...);
int main() {
  sum(1, 2);
  sum(3, 1, 2, 3);
  sum2(1, 2);
  sum2(3, 1, 2, 3);
  sum3(1, 2);
  sum3(3, 1, 2, 3);
  sum4(1, 2);
  sum4(3, 1, 2, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1040 <sum@plt>
mov    $0x3,%ecx
mov    $0x1,%esi
mov    $0x2,%edx
mov    %ecx,%edi
mov    $0x0,%al
call   1040 <sum@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1050 <sum2@plt>
mov    $0x3,%ecx
mov    $0x1,%esi
mov    $0x2,%edx
mov    %ecx,%edi
mov    $0x0,%al
call   1050 <sum2@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <sum3@plt>
mov    $0x3,%ecx
mov    $0x1,%esi
mov    $0x2,%edx
mov    %ecx,%edi
mov    $0x0,%al
call   1030 <sum3@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1060 <sum4@plt>
mov    $0x3,%ecx
mov    $0x1,%esi
mov    $0x2,%edx
mov    %ecx,%edi
mov    $0x0,%al
call   1060 <sum4@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <sum@plt>
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1040 <sum@plt>
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <sum2@plt>
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1050 <sum2@plt>
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <sum3@plt>
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <sum3@plt>
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1060 <sum4@plt>
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1060 <sum4@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i32, i32, ...) @sum(i32 1, i32 2)
%3 = call i32 (i32, i32, ...) @sum(i32 3, i32 1, i32 2, i32 3)
%4 = call i32 (i32, i32, ...) @sum2(i32 1, i32 2)
%5 = call i32 (i32, i32, ...) @sum2(i32 3, i32 1, i32 2, i32 3)
%6 = call i32 (i32, i32, ...) @sum3(i32 1, i32 2)
%7 = call i32 (i32, i32, ...) @sum3(i32 3, i32 1, i32 2, i32 3)
%8 = call i32 (i32, i32, ...) @sum4(i32 1, i32 2)
%9 = call i32 (i32, i32, ...) @sum4(i32 3, i32 1, i32 2, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, i32, ...) @sum(i32 1, i32 2)
%2 = tail call i32 (i32, i32, ...) @sum(i32 3, i32 1, i32 2, i32 3)
%3 = tail call i32 (i32, i32, ...) @sum2(i32 1, i32 2)
%4 = tail call i32 (i32, i32, ...) @sum2(i32 3, i32 1, i32 2, i32 3)
%5 = tail call i32 (i32, i32, ...) @sum3(i32 1, i32 2)
%6 = tail call i32 (i32, i32, ...) @sum3(i32 3, i32 1, i32 2, i32 3)
%7 = tail call i32 (i32, i32, ...) @sum4(i32 1, i32 2)
%8 = tail call i32 (i32, i32, ...) @sum4(i32 3, i32 1, i32 2, i32 3)
ret i32 0
}