#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 *, ...);
main() {
  double f = 123.456;
  printf("\nf = 123.456\n\n");
  printf("%%f: %f\n", f);
  printf("%%20f:    %20f\n", f);
  printf("%%020f:   %020f\n", f);
  printf("%%020.2f: %020.2f\n", f);
  printf("%%20.2f:  %20.2f\n", f);
  printf("%%.2f: %.2f\n", f);
  printf("%%10.2e: %10.2e\n", f);
  printf("%%.2g: %.2g\n", f);
  printf("%%.4g: %.4g\n", f);
  printf("%%+f: %+f\n", f);
  printf("%%-20f: %-20f", f);
  printf("%%020f: %020f", f);
  printf("%%*.*f: %*.*e\n", 20, 2, f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xed8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xece(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xecb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xec9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xec9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xec8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xec2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xec0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xeb4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xeac(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xea7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xea2(%rip),%rdi
mov    $0x14,%esi
mov    $0x2,%edx
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf9d(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
movsd  0xec4(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
movsd  0xeae(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
movsd  0xe98(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
movsd  0xe82(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xeb9(%rip),%rdi
movsd  0xe6c(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xeb5(%rip),%rdi
movsd  0xe56(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
movsd  0xe40(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xea7(%rip),%rdi
movsd  0xe2a(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe9e(%rip),%rdi
movsd  0xe14(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
movsd  0xdfe(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe8a(%rip),%rdi
movsd  0xde8(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe82(%rip),%rdi
movsd  0xdd2(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe7a(%rip),%rdi
mov    $0x14,%esi
mov    $0x2,%edx
movsd  0xdb2(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\0Af = 123.456\0A\0A\00"
@.str.1 = [9 x i8] c"%%f: %f\0A\00"
@.str.2 = [16 x i8] c"%%20f: %20f\0A\00"
@.str.3 = [17 x i8] c"%%020f: %020f\0A\00"
@.str.4 = [19 x i8] c"%%020.2f: %020.2f\0A\00"
@.str.5 = [18 x i8] c"%%20.2f: %20.2f\0A\00"
@.str.6 = [13 x i8] c"%%.2f: %.2f\0A\00"
@.str.7 = [17 x i8] c"%%10.2e: %10.2e\0A\00"
@.str.8 = [13 x i8] c"%%.2g: %.2g\0A\00"
@.str.9 = [13 x i8] c"%%.4g: %.4g\0A\00"
@.str.10 = [11 x i8] c"%%+f: %+f\0A\00"
@.str.11 = [14 x i8] c"%%-20f: %-20f\00"
@.str.12 = [14 x i8] c"%%020f: %020f\00"
@.str.13 = [15 x i8] c"%%*.*f: %*.*e\0A\00"
define i32 @main() {
%1 = alloca double
store double 1.234560e+02, double* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load double, double* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = load double, double* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %5)
%7 = load double, double* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), double %7)
%9 = load double, double* %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), double %9)
%11 = load double, double* %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), double %11)
%13 = load double, double* %1
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), double %13)
%15 = load double, double* %1
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), double %15)
%17 = load double, double* %1
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), double %17)
%19 = load double, double* %1
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), double %19)
%21 = load double, double* %1
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), double %21)
%23 = load double, double* %1
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0), double %23)
%25 = load double, double* %1
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), double %25)
%27 = load double, double* %1
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i32 20, i32 2, double %27)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%%f: %f\0A\00"
@.str.2 = [16 x i8] c"%%20f: %20f\0A\00"
@.str.3 = [17 x i8] c"%%020f: %020f\0A\00"
@.str.4 = [19 x i8] c"%%020.2f: %020.2f\0A\00"
@.str.5 = [18 x i8] c"%%20.2f: %20.2f\0A\00"
@.str.6 = [13 x i8] c"%%.2f: %.2f\0A\00"
@.str.7 = [17 x i8] c"%%10.2e: %10.2e\0A\00"
@.str.8 = [13 x i8] c"%%.2g: %.2g\0A\00"
@.str.9 = [13 x i8] c"%%.4g: %.4g\0A\00"
@.str.10 = [11 x i8] c"%%+f: %+f\0A\00"
@.str.11 = [14 x i8] c"%%-20f: %-20f\00"
@.str.12 = [14 x i8] c"%%020f: %020f\00"
@.str.13 = [15 x i8] c"%%*.*f: %*.*e\0A\00"
@str = [14 x i8] c"\0Af = 123.456\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double 1.234560e+02)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 1.234560e+02)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), double 1.234560e+02)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), double 1.234560e+02)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), double 1.234560e+02)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), double 1.234560e+02)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), double 1.234560e+02)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), double 1.234560e+02)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), double 1.234560e+02)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), double 1.234560e+02)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0), double 1.234560e+02)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), double 1.234560e+02)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i32 20, i32 2, double 1.234560e+02)
ret i32 0
}