#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 *, double);
int main() {
  printf("%d\n", 7);
  printf("%4d\n", 7);
  printf("%-4d\n", 7);
  printf("%04d\n", 7);
  printf("%c\n", 'a');
  printf("%f\n", 1.5f);
  printf("%5.2f\n", 1.5f);
  printf("%g\n", 1.5f);
  printf("%lg\n", 1.5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xef2(%rip),%rdi
movsd  0xee2(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
movsd  0xece(%rip),%xmm0
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
movsd  0xeba(%rip),%xmm0
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
movsd  0xea6(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
movsd  0xe8a(%rip),%xmm0
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
movsd  0xe6e(%rip),%xmm0
call   1030 <printf@plt>
lea    0xe97(%rip),%rdi
movsd  0xe5a(%rip),%xmm0
call   1030 <printf@plt>
lea    0xe8a(%rip),%rdi
movsd  0xe46(%rip),%xmm0
call   1030 <printf@plt>
lea    0xe7a(%rip),%rdi
movsd  0xe32(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf00(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
movsd  0xecc(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
movsd  0xeb8(%rip),%xmm0
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
movsd  0xea4(%rip),%xmm0
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
movsd  0xe98(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
movsd  0xe8c(%rip),%xmm0
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
movsd  0xe78(%rip),%xmm0
call   1030 <printf@plt>
lea    0xe98(%rip),%rdi
movsd  0xe64(%rip),%xmm0
call   1030 <printf@plt>
lea    0xe88(%rip),%rdi
movsd  0xe50(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [5 x i8] c"%4d\0A\00"
@.str.2 = [6 x i8] c"%-4d\0A\00"
@.str.3 = [6 x i8] c"%04d\0A\00"
@.str.4 = [4 x i8] c"%c\0A\00"
@.str.5 = [4 x i8] c"%f\0A\00"
@.str.6 = [7 x i8] c"%5.2f\0A\00"
@.str.7 = [4 x i8] c"%g\0A\00"
@.str.8 = [5 x i8] c"%lg\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 7.000000e+00)
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double 7.000000e+00)
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double 7.000000e+00)
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double 7.000000e+00)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double 9.700000e+01)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double 1.500000e+00)
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), double 1.500000e+00)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), double 1.500000e+00)
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [5 x i8] c"%4d\0A\00"
@.str.2 = [6 x i8] c"%-4d\0A\00"
@.str.3 = [6 x i8] c"%04d\0A\00"
@.str.4 = [4 x i8] c"%c\0A\00"
@.str.5 = [4 x i8] c"%f\0A\00"
@.str.6 = [7 x i8] c"%5.2f\0A\00"
@.str.7 = [4 x i8] c"%g\0A\00"
@.str.8 = [5 x i8] c"%lg\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 7.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double 7.000000e+00)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double 7.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double 7.000000e+00)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double 9.700000e+01)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double 1.500000e+00)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), double 1.500000e+00)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), double 1.500000e+00)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), double 1.500000e+00)
ret i32 0
}