#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 */
char *my_printf(char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ simple_va_fun(int, int, int, ...);
void main() {
  printf("Function 1:\n");
  simple_va_fun(-5, 100, -1);
  printf("Function 2:\n");
  simple_va_fun(-5, 100, 200, -1);
  printf("Function 3:\n");
  simple_va_fun(-5, 100, 200, 500, -1);
  my_printf("\n%d", my_printf("\nLook you printf %s", "I like!"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xfffffffb,%edi
mov    $0x64,%esi
mov    $0xffffffff,%edx
mov    $0x0,%al
call   1050 <simple_va_fun@plt>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    $0xfffffffb,%edi
mov    $0x64,%esi
mov    $0xc8,%edx
mov    $0xffffffff,%ecx
mov    $0x0,%al
call   1050 <simple_va_fun@plt>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    $0xfffffffb,%edi
mov    $0x64,%esi
mov    $0xc8,%edx
mov    $0x1f4,%ecx
mov    $0xffffffff,%r8d
mov    $0x0,%al
call   1050 <simple_va_fun@plt>
lea    0xe7a(%rip),%rdi
lea    0xe87(%rip),%rsi
call   1040 <my_printf@plt>
mov    %rax,%rsi
lea    0xe60(%rip),%rdi
call   1040 <my_printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffffb,%edi
mov    $0x64,%esi
mov    $0xffffffff,%edx
xor    %eax,%eax
call   1050 <simple_va_fun@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffffb,%edi
mov    $0x64,%esi
mov    $0xc8,%edx
mov    $0xffffffff,%ecx
xor    %eax,%eax
call   1050 <simple_va_fun@plt>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffffb,%edi
mov    $0x64,%esi
mov    $0xc8,%edx
mov    $0x1f4,%ecx
mov    $0xffffffff,%r8d
xor    %eax,%eax
call   1050 <simple_va_fun@plt>
lea    0xe56(%rip),%rdi
lea    0xe63(%rip),%rsi
call   1040 <my_printf@plt>
lea    0xe3f(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <my_printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Function 1:\0A\00"
@.str.1 = [13 x i8] c"Function 2:\0A\00"
@.str.2 = [13 x i8] c"Function 3:\0A\00"
@.str.3 = [4 x i8] c"\0A%d\00"
@.str.4 = [20 x i8] c"\0ALook you printf %s\00"
@.str.5 = [8 x i8] c"I like!\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i32, i32, i32, ...) @simple_va_fun(i32 -5, i32 100, i32 -1)
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i32, i32, i32, ...) @simple_va_fun(i32 -5, i32 100, i32 200, i32 -1)
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (i32, i32, i32, ...) @simple_va_fun(i32 -5, i32 100, i32 200, i32 500, i32 -1)
%7 = call i8* @my_printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%8 = call i8* @my_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str.3 = [4 x i8] c"\0A%d\00"
@.str.4 = [20 x i8] c"\0ALook you printf %s\00"
@.str.5 = [8 x i8] c"I like!\00"
@str = [12 x i8] c"Function 1:\00"
@str.6 = [12 x i8] c"Function 2:\00"
@str.7 = [12 x i8] c"Function 3:\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i32, i32, i32, ...) @simple_va_fun(i32 -5, i32 100, i32 -1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 (i32, i32, i32, ...) @simple_va_fun(i32 -5, i32 100, i32 200, i32 -1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0))
%6 = tail call i32 (i32, i32, i32, ...) @simple_va_fun(i32 -5, i32 100, i32 200, i32 500, i32 -1)
%7 = tail call i8* @my_printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i8* @my_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %7)
ret void
}