#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*/ variadic_enable_if(int, ...);
void variadic_test() {
  variadic_enable_if(1);
  variadic_enable_if(1, 2);
  variadic_enable_if(1, "c", 3);
  variadic_enable_if(0);
  variadic_enable_if(0, 2);
  variadic_enable_if(0, "c", 3);
  int m;
  variadic_enable_if(1);
  variadic_enable_if(1, m);
  variadic_enable_if(1, m, "c");
  variadic_enable_if(0);
  variadic_enable_if(0, m);
  variadic_enable_if(0, m, 3);
}


x86 assembly (clang, -O0):
<variadic_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <variadic_enable_if@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <variadic_enable_if@plt>
mov    $0x1,%edi
lea    0xebf(%rip),%rsi
mov    $0x3,%edx
mov    $0x0,%al
call   1030 <variadic_enable_if@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <variadic_enable_if@plt>
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <variadic_enable_if@plt>
xor    %edi,%edi
lea    0xe93(%rip),%rsi
mov    $0x3,%edx
mov    $0x0,%al
call   1030 <variadic_enable_if@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <variadic_enable_if@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <variadic_enable_if@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
lea    0xe5d(%rip),%rdx
mov    $0x0,%al
call   1030 <variadic_enable_if@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <variadic_enable_if@plt>
mov    -0x4(%rbp),%esi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <variadic_enable_if@plt>
mov    -0x4(%rbp),%esi
xor    %edi,%edi
mov    $0x3,%edx
mov    $0x0,%al
call   1030 <variadic_enable_if@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<variadic_test>:
push   %rbx
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <variadic_enable_if@plt>
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <variadic_enable_if@plt>
lea    0xecb(%rip),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <variadic_enable_if@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1030 <variadic_enable_if@plt>
xor    %edi,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <variadic_enable_if@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <variadic_enable_if@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <variadic_enable_if@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <variadic_enable_if@plt>
mov    $0x1,%edi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <variadic_enable_if@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1030 <variadic_enable_if@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1030 <variadic_enable_if@plt>
xor    %edi,%edi
mov    $0x3,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <variadic_enable_if@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"c\00"
define void @variadic_test() {
%1 = alloca i32
%2 = call i32 (i32, ...) @variadic_enable_if(i32 1)
%3 = call i32 (i32, ...) @variadic_enable_if(i32 1, i32 2)
%4 = call i32 (i32, ...) @variadic_enable_if(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = call i32 (i32, ...) @variadic_enable_if(i32 0)
%6 = call i32 (i32, ...) @variadic_enable_if(i32 0, i32 2)
%7 = call i32 (i32, ...) @variadic_enable_if(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 3)
%8 = call i32 (i32, ...) @variadic_enable_if(i32 1)
%9 = load i32, i32* %1
%10 = call i32 (i32, ...) @variadic_enable_if(i32 1, i32 %9)
%11 = load i32, i32* %1
%12 = call i32 (i32, ...) @variadic_enable_if(i32 1, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (i32, ...) @variadic_enable_if(i32 0)
%14 = load i32, i32* %1
%15 = call i32 (i32, ...) @variadic_enable_if(i32 0, i32 %14)
%16 = load i32, i32* %1
%17 = call i32 (i32, ...) @variadic_enable_if(i32 0, i32 %16, i32 3)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"c\00"
define void @variadic_test() {
%1 = tail call i32 (i32, ...) @variadic_enable_if(i32 1)
%2 = tail call i32 (i32, ...) @variadic_enable_if(i32 1, i32 2)
%3 = tail call i32 (i32, ...) @variadic_enable_if(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 (i32, ...) @variadic_enable_if(i32 0)
%5 = tail call i32 (i32, ...) @variadic_enable_if(i32 0, i32 2)
%6 = tail call i32 (i32, ...) @variadic_enable_if(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 3)
%7 = tail call i32 (i32, ...) @variadic_enable_if(i32 1)
%8 = tail call i32 (i32, ...) @variadic_enable_if(i32 1, i32 undef)
%9 = tail call i32 (i32, ...) @variadic_enable_if(i32 1, i32 undef, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 (i32, ...) @variadic_enable_if(i32 0)
%11 = tail call i32 (i32, ...) @variadic_enable_if(i32 0, i32 undef)
%12 = tail call i32 (i32, ...) @variadic_enable_if(i32 0, i32 undef, i32 3)
ret void
}