#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strlist(int, ...);
int main() {
  printf("Calling with three arguments\n");
  strlist(3, "string1", "string2", "string3");
  printf("Calling with two arguments\n");
  strlist(2, "string1", "string3");
  printf("Calling with 0 arguments\n");
  strlist(0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
lea    0xec7(%rip),%rsi
lea    0xec8(%rip),%rdx
lea    0xec9(%rip),%rcx
mov    $0x0,%al
call   1030 <strlist@plt>
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
lea    0xe9a(%rip),%rsi
lea    0xea3(%rip),%rdx
mov    $0x0,%al
call   1030 <strlist@plt>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <strlist@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%r14
lea    0xeba(%rip),%rdx
lea    0xebb(%rip),%rbx
mov    $0x3,%edi
mov    %r14,%rsi
mov    %rbx,%rcx
xor    %eax,%eax
call   1040 <strlist@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <strlist@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1040 <strlist@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Calling with three arguments\0A\00"
@.str.1 = [8 x i8] c"string1\00"
@.str.2 = [8 x i8] c"string2\00"
@.str.3 = [8 x i8] c"string3\00"
@.str.4 = [28 x i8] c"Calling with two arguments\0A\00"
@.str.5 = [26 x i8] c"Calling with 0 arguments\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i32, ...) @strlist(i32 3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%5 = call i32 (i32, ...) @strlist(i32 2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 (i32, ...) @strlist(i32 0)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"string1\00"
@.str.2 = [8 x i8] c"string2\00"
@.str.3 = [8 x i8] c"string3\00"
@str = [29 x i8] c"Calling with three arguments\00"
@str.6 = [27 x i8] c"Calling with two arguments\00"
@str.7 = [25 x i8] c"Calling with 0 arguments\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i32, ...) @strlist(i32 3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 (i32, ...) @strlist(i32 2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.7, i64 0, i64 0))
%6 = tail call i32 (i32, ...) @strlist(i32 0)
%7 = tail call i32 @exit(i32 0)
unreachable
}