#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*/ print(char *);
int /*<<< orphan*/ test_builtin();
int /*<<< orphan*/ test_float(double, double, double, double);
int /*<<< orphan*/ test_int(int, int, int, int, int);
int /*<<< orphan*/ test_mix(char *, double, int, char *, int);
int /*<<< orphan*/ test_va_list();
void testmain() {
  print("varargs");
  test_builtin();
  test_int(1, 2, 3, 5, 8);
  test_float(1.0, 2.0, 4.0, 8.0);
  test_mix("abc", 2.0, 4, "d", 5);
  test_va_list();
}


x86 assembly (clang, -O0):
<testmain>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <print@plt>
mov    $0x0,%al
call   1050 <test_builtin@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x5,%ecx
mov    $0x8,%r8d
call   1070 <test_int@plt>
movsd  0xe6a(%rip),%xmm0
movsd  0xe5a(%rip),%xmm1
movsd  0xe62(%rip),%xmm2
movsd  0xe62(%rip),%xmm3
call   1030 <test_float@plt>
lea    0xe66(%rip),%rdi
movsd  0xe36(%rip),%xmm0
mov    $0x4,%esi
lea    0xe56(%rip),%rdx
mov    $0x5,%ecx
call   1060 <test_mix@plt>
mov    $0x0,%al
call   1080 <test_va_list@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testmain>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <print@plt>
xor    %eax,%eax
call   1050 <test_builtin@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x5,%ecx
mov    $0x8,%r8d
call   1070 <test_int@plt>
movsd  0xe65(%rip),%xmm0
movsd  0xe65(%rip),%xmm1
movsd  0xe65(%rip),%xmm2
movsd  0xe65(%rip),%xmm3
call   1030 <test_float@plt>
lea    0xe69(%rip),%rdi
lea    0xe66(%rip),%rdx
movsd  0xe3a(%rip),%xmm0
mov    $0x4,%esi
mov    $0x5,%ecx
call   1060 <test_mix@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <test_va_list@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"varargs\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [2 x i8] c"d\00"
define void @testmain() {
%1 = call i32 @print(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @test_builtin()
%3 = call i32 @test_int(i32 1, i32 2, i32 3, i32 5, i32 8)
%4 = call i32 @test_float(double 1.000000e+00, double 2.000000e+00, double 4.000000e+00, double 8.000000e+00)
%5 = call i32 @test_mix(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double 2.000000e+00, i32 4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 5)
%6 = call i32 (...) @test_va_list()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"varargs\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [2 x i8] c"d\00"
define void @testmain() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @test_builtin()
%3 = tail call i32 @test_int(i32 1, i32 2, i32 3, i32 5, i32 8)
%4 = tail call i32 @test_float(double 1.000000e+00, double 2.000000e+00, double 4.000000e+00, double 8.000000e+00)
%5 = tail call i32 @test_mix(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double 2.000000e+00, i32 4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 5)
%6 = tail call i32 (...) @test_va_list()
ret void
}