#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*/ foo1(int, void *);
int /*<<< orphan*/ foo12(int);
int /*<<< orphan*/ foo5(int, void *, int, ...);
int /*<<< orphan*/ foo6(int, void *, int, int, int, int, int);
int /*<<< orphan*/ foo7(int, ...);
int main() {
  foo1(1, (void *)0);
  foo1(1, 0);
  foo5(1, (void *)0, 2);
  foo5(1, 2, (void *)0, 1);
  foo5(1, (void *)0, 2, 1);
  foo6(1, 2, 3, 4, 5, 6, 7);
  foo6(1, (void *)0, 3, 4, 5, 6, 7);
  foo7(1);
  foo7(1, (void *)0);
  foo12(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <foo1@plt>
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <foo1@plt>
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x2,%edx
mov    $0x0,%al
call   1050 <foo5@plt>
mov    $0x1,%ecx
mov    $0x2,%esi
xor    %edx,%edx
mov    %ecx,%edi
mov    $0x0,%al
call   1050 <foo5@plt>
mov    $0x1,%ecx
xor    %eax,%eax
mov    %eax,%esi
mov    $0x2,%edx
mov    %ecx,%edi
mov    $0x0,%al
call   1050 <foo5@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movl   $0x7,(%rsp)
call   1040 <foo6@plt>
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movl   $0x7,(%rsp)
call   1040 <foo6@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1070 <foo7@plt>
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x0,%al
call   1070 <foo7@plt>
mov    $0x1,%edi
call   1030 <foo12@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1060 <foo1@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1060 <foo1@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1050 <foo5@plt>
mov    $0x2,%esi
mov    $0x1,%edi
xor    %edx,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1050 <foo5@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1050 <foo5@plt>
movl   $0x7,(%rsp)
mov    $0x2,%esi
mov    $0x1,%edi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
call   1040 <foo6@plt>
movl   $0x7,(%rsp)
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
call   1040 <foo6@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1070 <foo7@plt>
mov    $0x1,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1070 <foo7@plt>
mov    $0x1,%edi
call   1030 <foo12@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @foo1(i32 1, i8* null)
%2 = call i32 @foo1(i32 1, i8* null)
%3 = call i32 (i32, i8*, i32, ...) @foo5(i32 1, i8* null, i32 2)
%4 = call i32 (i32, i8*, i32, ...) @foo5(i32 1, i8* inttoptr (i64 2 to i8*), i32 0, i32 1)
%5 = call i32 (i32, i8*, i32, ...) @foo5(i32 1, i8* null, i32 2, i32 1)
%6 = call i32 @foo6(i32 1, i8* inttoptr (i64 2 to i8*), i32 3, i32 4, i32 5, i32 6, i32 7)
%7 = call i32 @foo6(i32 1, i8* null, i32 3, i32 4, i32 5, i32 6, i32 7)
%8 = call i32 (i32, ...) @foo7(i32 1)
%9 = call i32 (i32, ...) @foo7(i32 1, i8* null)
%10 = call i32 @foo12(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo1(i32 1, i8* null)
%2 = tail call i32 @foo1(i32 1, i8* null)
%3 = tail call i32 (i32, i8*, i32, ...) @foo5(i32 1, i8* null, i32 2)
%4 = tail call i32 (i32, i8*, i32, ...) @foo5(i32 1, i8* inttoptr (i64 2 to i8*), i32 0, i32 1)
%5 = tail call i32 (i32, i8*, i32, ...) @foo5(i32 1, i8* null, i32 2, i32 1)
%6 = tail call i32 @foo6(i32 1, i8* inttoptr (i64 2 to i8*), i32 3, i32 4, i32 5, i32 6, i32 7)
%7 = tail call i32 @foo6(i32 1, i8* null, i32 3, i32 4, i32 5, i32 6, i32 7)
%8 = tail call i32 (i32, ...) @foo7(i32 1)
%9 = tail call i32 (i32, ...) @foo7(i32 1, i8* null)
%10 = tail call i32 @foo12(i32 1)
ret i32 0
}