#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() {
  int a = 12345;
  double b = 1.2345;
  printf("%.10d\n", a);
  printf("%.8d\n", a);
  printf("%.6d\n", a);
  printf("%.3d\n", a);
  printf("%11.1d\n", a);
  printf("%.5f\n", b);
  printf("%.4f\n", b);
  printf("%.3f\n", b);
  printf("%.2f\n", b);
  printf("%.1f\n", b);
  printf("%.0f\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3039,-0x8(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
movsd  0xecc(%rip),%xmm0
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
movsd  0xeb8(%rip),%xmm0
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
movsd  0xea4(%rip),%xmm0
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
movsd  0xe90(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
movsd  0xe84(%rip),%xmm0
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
movsd  0xe70(%rip),%xmm0
call   1030 <printf@plt>
lea    0xe99(%rip),%rdi
movsd  0xe5c(%rip),%xmm0
call   1030 <printf@plt>
lea    0xe8b(%rip),%rdi
movsd  0xe48(%rip),%xmm0
call   1030 <printf@plt>
lea    0xe7d(%rip),%rdi
movsd  0xe34(%rip),%xmm0
call   1030 <printf@plt>
lea    0xe6f(%rip),%rdi
movsd  0xe20(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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