#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 *, int);
int main() {
  double sayi1 = 1234.2568;
  int sayi2 = 123;
  printf("%.5f\n", sayi1);
  printf("%10.3f\n", sayi1);
  printf("%012f\n", sayi1);
  printf("%2f\n", sayi1);
  printf("%d\n", sayi2);
  printf("%10d\n", sayi2);
  printf("%-10d! \n", sayi2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x7b,-0x14(%rbp)
cvttsd2si -0x10(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
cvttsd2si -0x10(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
cvttsd2si -0x10(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
cvttsd2si -0x10(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe8d(%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
mov    $0x4d2,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x4d2,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x4d2,%esi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
mov    $0x4d2,%esi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x7b,%esi
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x7b,%esi
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
mov    $0x7b,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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