#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 DBL_DIG;
int FLT_DIG;
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int a = 10;
  double f = 10.03;
  char str[] = "0123456789";
  printf("%.5d\n", a);
  printf("%5d\n", a);
  printf("% 5d\n", a);
  printf("%+5d\n", a);
  printf("%-5d-\n", a);
  printf("%10.5d\n", a);
  printf("%.f\n", f);
  printf("%.0f\n", f);
  printf("%4.4e\n", f);
  printf("%.5s\n", str);
  printf("%5s\n", str);
  printf("nihao 			nihao.\n");
  printf("nihao "
         "nihao.\n");
  float f1 = 1.0f / 3.0f;
  double d = 1.0 / 3.0;
  printf("%.4f %.4f\n", f1, d);
  printf("%.12f %.12f\n", f1, d);
  printf("%.16f %.16f\n", f1, d);
  printf("%d %d\n", FLT_DIG, DBL_DIG);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x2b(%rbp)
mov    0xed0(%rip),%ax
mov    %ax,-0x23(%rbp)
mov    0xec8(%rip),%al
mov    %al,-0x21(%rbp)
mov    -0x14(%rbp),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe7a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe6c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe5f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    -0x2b(%rbp),%rsi
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x2b(%rbp),%rsi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xdd0(%rip),%xmm0
movss  %xmm0,-0x30(%rbp)
movsd  0xdb3(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x38(%rbp),%xmm1
lea    0xe1a(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x38(%rbp),%xmm1
lea    0xe09(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x38(%rbp),%xmm1
lea    0xdfa(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    0x2d4b(%rip),%rax
mov    (%rax),%esi
mov    0x2d2a(%rip),%rax
mov    (%rax),%edx
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x3736353433323130,%rax
35 36 37
mov    %rax,(%rsp)
movl   $0x393837,0x7(%rsp)
lea    0xee1(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb9(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea0(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
movsd  0xe44(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe84(%rip),%rdi
movsd  0xe2e(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe74(%rip),%rdi
movsd  0xe18(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe65(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe57(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe77(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7b(%rip),%rdi
call   1030 <puts@plt>
lea    0xe33(%rip),%rdi
movsd  0xdcd(%rip),%xmm0
movsd  0xdcd(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xe20(%rip),%rdi
movsd  0xdaf(%rip),%xmm0
movsd  0xdaf(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xe0f(%rip),%rdi
movsd  0xd91(%rip),%xmm0
movsd  0xd91(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
mov    0x2d6b(%rip),%rax
mov    (%rax),%esi
mov    0x2d4a(%rip),%rax
mov    (%rax),%edx
lea    0xdec(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [11 x i8] c"0123456789\00"
@.str = [6 x i8] c"%.5d\0A\00"
@.str.1 = [5 x i8] c"%5d\0A\00"
@.str.2 = [6 x i8] c"% 5d\0A\00"
@.str.3 = [6 x i8] c"%+5d\0A\00"
@.str.4 = [7 x i8] c"%-5d-\0A\00"
@.str.5 = [8 x i8] c"%10.5d\0A\00"
@.str.6 = [5 x i8] c"%.f\0A\00"
@.str.7 = [6 x i8] c"%.0f\0A\00"
@.str.8 = [7 x i8] c"%4.4e\0A\00"
@.str.9 = [6 x i8] c"%.5s\0A\00"
@.str.10 = [5 x i8] c"%5s\0A\00"
@.str.11 = [17 x i8] c"nihao \09\09\09nihao.\0A\00"
@.str.12 = [14 x i8] c"nihao nihao.\0A\00"
@.str.13 = [11 x i8] c"%.4f %.4f\0A\00"
@.str.14 = [13 x i8] c"%.12f %.12f\0A\00"
@.str.15 = [13 x i8] c"%.16f %.16f\0A\00"
@.str.16 = [7 x i8] c"%d %d\0A\00"
@FLT_DIG = global i32 0
@DBL_DIG = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
%8 = alloca [11 x i8]
%9 = alloca float
%10 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
store double 1.003000e+01, double* %7
%11 = bitcast [11 x i8]* %8 to i8*
%12 = load i32, i32* %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %6
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %6
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %6
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 %22)
%24 = load double, double* %7
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), double %24)
%26 = load double, double* %7
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double %26)
%28 = load double, double* %7
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), double %28)
%30 = getelementptr inbounds [11 x i8], [11 x i8]* %8, i64 0, i64 0
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %30)
%32 = getelementptr inbounds [11 x i8], [11 x i8]* %8, i64 0, i64 0
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %32)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0))
store float 0x3FD5555560000000, float* %9
store double 0x3FD5555555555555, double* %10
%36 = load float, float* %9
%37 = fpext float %36 to double
%38 = load double, double* %10
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), double %37, double %38)
%40 = load float, float* %9
%41 = fpext float %40 to double
%42 = load double, double* %10
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0), double %41, double %42)
%44 = load float, float* %9
%45 = fpext float %44 to double
%46 = load double, double* %10
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0), double %45, double %46)
%48 = load i32, i32* @FLT_DIG
%49 = load i32, i32* @DBL_DIG
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i32 %48, i32 %49)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [11 x i8] c"0123456789\00"
@.str = [6 x i8] c"%.5d\0A\00"
@.str.1 = [5 x i8] c"%5d\0A\00"
@.str.2 = [6 x i8] c"% 5d\0A\00"
@.str.3 = [6 x i8] c"%+5d\0A\00"
@.str.4 = [7 x i8] c"%-5d-\0A\00"
@.str.5 = [8 x i8] c"%10.5d\0A\00"
@.str.6 = [5 x i8] c"%.f\0A\00"
@.str.7 = [6 x i8] c"%.0f\0A\00"
@.str.8 = [7 x i8] c"%4.4e\0A\00"
@.str.9 = [6 x i8] c"%.5s\0A\00"
@.str.10 = [5 x i8] c"%5s\0A\00"
@.str.13 = [11 x i8] c"%.4f %.4f\0A\00"
@.str.14 = [13 x i8] c"%.12f %.12f\0A\00"
@.str.15 = [13 x i8] c"%.16f %.16f\0A\00"
@.str.16 = [7 x i8] c"%d %d\0A\00"
@FLT_DIG = global i32 0
@DBL_DIG = global i32 0
@str = [16 x i8] c"nihao \09\09\09nihao.\00"
@str.17 = [13 x i8] c"nihao nihao.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [11 x i8]
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 10)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 10)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 10)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 10)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 10)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 10)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), double 1.003000e+01)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), double 1.003000e+01)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), double 1.003000e+01)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %4)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %4)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.17, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), double 0x3FD5555560000000, double 0x3FD5555555555555)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0), double 0x3FD5555560000000, double 0x3FD5555555555555)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0), double 0x3FD5555560000000, double 0x3FD5555555555555)
%21 = load i32, i32* @FLT_DIG
%22 = load i32, i32* @DBL_DIG
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i32 %21, i32 %22)
ret i32 0
}