#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*/ printf(char *, int, ...);
int /*<<< orphan*/ puts(char *);
int main() {
  puts("printf test");
  printf("%f\n", 1.125);
  printf("%f %f\n", 1.2, 2.3);
  printf("%d %f %f\n", 10, 20.20, 30.30);
  printf("%d %d %f\n", 10, 20, 30.30);
  printf("%d %d %d %d %d\n", 10, 20, 30, 40, 50);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xef2(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x1,%esi
movsd  0xeae(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    $0xa,%esi
movsd  0xe8b(%rip),%xmm0
movsd  0xe7b(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xe9b(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
movsd  0xe5b(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe85(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
mov    $0x1e,%ecx
mov    $0x28,%r8d
mov    $0x32,%r9d
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xf00(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
movsd  0xeb1(%rip),%xmm0
mov    $0x1,%esi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
movsd  0xe9e(%rip),%xmm0
movsd  0xe9e(%rip),%xmm1
mov    $0xa,%esi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
movsd  0xe79(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe93(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
mov    $0x1e,%ecx
mov    $0x28,%r8d
mov    $0x32,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"printf test\00"
@.str.1 = [4 x i8] c"%f\0A\00"
@.str.2 = [7 x i8] c"%f %f\0A\00"
@.str.3 = [10 x i8] c"%d %f %f\0A\00"
@.str.4 = [10 x i8] c"%d %d %f\0A\00"
@.str.5 = [16 x i8] c"%d %d %d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
%4 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 1, double 2.300000e+00)
%5 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 10, double 2.020000e+01, double 3.030000e+01)
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 10, i32 20, double 3.030000e+01)
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 10, i32 20, i32 30, i32 40, i32 50)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"printf test\00"
@.str.1 = [4 x i8] c"%f\0A\00"
@.str.2 = [7 x i8] c"%f %f\0A\00"
@.str.3 = [10 x i8] c"%d %f %f\0A\00"
@.str.4 = [10 x i8] c"%d %d %f\0A\00"
@.str.5 = [16 x i8] c"%d %d %d %d %d\0A\00"
define i32 @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 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 1, double 2.300000e+00)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 10, double 2.020000e+01, double 3.030000e+01)
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 10, i32 20, double 3.030000e+01)
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 10, i32 20, i32 30, i32 40, i32 50)
ret i32 0
}