#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, int);
int main(void) {
  double var1 = 1.0 / 3.0;
  float var2 = 1.0 / 3.0;
  printf("%.4f %.4f\n", var1, var2);
  printf("%.12f %.12f\n", var1, var2);
  printf("%.16f %.16f\n", var1, var2);
  printf("%d %d\n", FLT_DIG, DBL_DIG);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
cvttsd2si -0x10(%rbp),%esi
cvttss2si -0x14(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
cvttsd2si -0x10(%rbp),%esi
cvttss2si -0x14(%rbp),%edx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
cvttsd2si -0x10(%rbp),%esi
cvttss2si -0x14(%rbp),%edx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
mov    0x2e55(%rip),%rax
mov    (%rax),%edx
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%.4f %.4f\0A\00"
@.str.1 = [13 x i8] c"%.12f %.12f\0A\00"
@.str.2 = [13 x i8] c"%.16f %.16f\0A\00"
@.str.3 = [7 x i8] c"%d %d\0A\00"
@FLT_DIG = global i32 0
@DBL_DIG = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca float
store i32 0, i32* %1
store double 0x3FD5555555555555, double* %2
store float 0x3FD5555560000000, float* %3
%4 = load double, double* %2
%5 = fptosi double %4 to i32
%6 = load float, float* %3
%7 = fptosi float %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
%9 = load double, double* %2
%10 = fptosi double %9 to i32
%11 = load float, float* %3
%12 = fptosi float %11 to i32
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %12)
%14 = load double, double* %2
%15 = fptosi double %14 to i32
%16 = load float, float* %3
%17 = fptosi float %16 to i32
%18 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %17)
%19 = load i32, i32* @FLT_DIG
%20 = load i32, i32* @DBL_DIG
%21 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %19, i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%.4f %.4f\0A\00"
@.str.1 = [13 x i8] c"%.12f %.12f\0A\00"
@.str.2 = [13 x i8] c"%.16f %.16f\0A\00"
@.str.3 = [7 x i8] c"%d %d\0A\00"
@FLT_DIG = global i32 0
@DBL_DIG = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0)
%4 = load i32, i32* @FLT_DIG
%5 = load i32, i32* @DBL_DIG
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %4, i32 %5)
ret i32 0
}