#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 */
double binlik_tam_sayiya_yuvarla(double);
double onluk_tam_sayiya_yuvarla(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
double tam_sayiya_yuvarla(double);
double yuzluk_tam_sayiya_yuvarla(double);
int main() {
  double sayi_limiti;
  printf("Kac sayinin yuvarlanmasini istiyosunuz giriniz: ");
  scanf("%lf", &sayi_limiti);
  int for_sayici;
  for (for_sayici = 1; for_sayici <= sayi_limiti; for_sayici++) {
    double yuvarlanacak_sayi;
    printf("Yuvarlanacak sayiyi giriniz: ");
    scanf("%lf", &yuvarlanacak_sayi);
    double yuvarlanmis_sayi;
    yuvarlanmis_sayi = tam_sayiya_yuvarla(yuvarlanacak_sayi);
    double onluk_hanede_yuvarlanmis_sayi;
    onluk_hanede_yuvarlanmis_sayi = onluk_tam_sayiya_yuvarla(yuvarlanacak_sayi);
    double yuzluk_hanede_yuvarlanmis_sayi;
    yuzluk_hanede_yuvarlanmis_sayi =
        yuzluk_tam_sayiya_yuvarla(yuvarlanacak_sayi);
    double binlik_hanede_yuvarlanmis_sayi;
    binlik_hanede_yuvarlanmis_sayi =
        binlik_tam_sayiya_yuvarla(yuvarlanacak_sayi);
    printf("%12s %15s %6s %7s %7s\n", "Orjinal Hali", "Yuvarlanmis Hali",
           "Onluga", "Yuzluge", "Binlige");
    printf("%12f %16.2f %4.4f %7.4f %7.4f\n", yuvarlanacak_sayi,
           yuvarlanmis_sayi, onluk_hanede_yuvarlanmis_sayi,
           yuzluk_hanede_yuvarlanmis_sayi, binlik_hanede_yuvarlanmis_sayi);
  }
  printf("Program Sonlanmistir :)");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xead(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <scanf@plt>
movl   $0x1,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1268 <main+0x108>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe74(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1080 <scanf@plt>
movsd  -0x20(%rbp),%xmm0
call   1050 <tam_sayiya_yuvarla@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1070 <onluk_tam_sayiya_yuvarla@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <yuzluk_tam_sayiya_yuvarla@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <binlik_tam_sayiya_yuvarla@plt>
movsd  %xmm0,-0x40(%rbp)
lea    0xe4a(%rip),%rdi
lea    0xe5a(%rip),%rsi
lea    0xe60(%rip),%rdx
lea    0xe6a(%rip),%rcx
lea    0xe6a(%rip),%r8
lea    0xe6b(%rip),%r9
mov    $0x0,%al
call   1060 <printf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
lea    0xe4c(%rip),%rdi
mov    $0x5,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1194 <main+0x34>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xe93(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1080 <scanf@plt>
movsd  0x10(%rsp),%xmm0
ucomisd 0xe65(%rip),%xmm0
jb     1296 <main+0x136>
mov    $0x2,%ebx
lea    0xed2(%rip),%rbp
lea    0xedc(%rip),%r14
lea    0xedc(%rip),%r15
lea    0xedd(%rip),%r12
lea    0xede(%rip),%r13
nopl   0x0(%rax)
lea    0xe66(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe54(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1080 <scanf@plt>
movsd  0x8(%rsp),%xmm0
call   1050 <tam_sayiya_yuvarla@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
call   1070 <onluk_tam_sayiya_yuvarla@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <yuzluk_tam_sayiya_yuvarla@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <binlik_tam_sayiya_yuvarla@plt>
movsd  %xmm0,0x18(%rsp)
lea    0xe21(%rip),%rdi
lea    0xe31(%rip),%rsi
mov    %rbp,%rdx
mov    %r14,%rcx
mov    %r15,%r8
mov    %r12,%r9
xor    %eax,%eax
call   1060 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    %r13,%rdi
movsd  0x30(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
movsd  0x18(%rsp),%xmm4
mov    $0x5,%al
call   1060 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  0x10(%rsp),%xmm1
add    $0x1,%ebx
ucomisd %xmm0,%xmm1
jae    11d0 <main+0x70>
lea    0xe29(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Kac sayinin yuvarlanmasini istiyosunuz giriniz: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [30 x i8] c"Yuvarlanacak sayiyi giriniz: \00"
@.str.3 = [23 x i8] c"%12s %15s %6s %7s %7s\0A\00"
@.str.4 = [13 x i8] c"Orjinal Hali\00"
@.str.5 = [17 x i8] c"Yuvarlanmis Hali\00"
@.str.6 = [7 x i8] c"Onluga\00"
@.str.7 = [8 x i8] c"Yuzluge\00"
@.str.8 = [8 x i8] c"Binlige\00"
@.str.9 = [31 x i8] c"%12f %16.2f %4.4f %7.4f %7.4f\0A\00"
@.str.10 = [24 x i8] c"Program Sonlanmistir :)\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
store i32 1, i32* %3
br label %11
11: ; preds = %34, %0
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to double
%14 = load double, double* %2
%15 = fcmp ole double %13, %14
br i1 %15, label %16, label %37
16: ; preds = %11
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%19 = load double, double* %4
%20 = call double @tam_sayiya_yuvarla(double %19)
store double %20, double* %5
%21 = load double, double* %4
%22 = call double @onluk_tam_sayiya_yuvarla(double %21)
store double %22, double* %6
%23 = load double, double* %4
%24 = call double @yuzluk_tam_sayiya_yuvarla(double %23)
store double %24, double* %7
%25 = load double, double* %4
%26 = call double @binlik_tam_sayiya_yuvarla(double %25)
store double %26, double* %8
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%28 = load double, double* %4
%29 = load double, double* %5
%30 = load double, double* %6
%31 = load double, double* %7
%32 = load double, double* %8
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), double %28, double %29, double %30, double %31, double %32)
br label %34
34: ; preds = %16
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %11
37: ; preds = %11
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"Kac sayinin yuvarlanmasini istiyosunuz giriniz: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [30 x i8] c"Yuvarlanacak sayiyi giriniz: \00"
@.str.3 = [23 x i8] c"%12s %15s %6s %7s %7s\0A\00"
@.str.4 = [13 x i8] c"Orjinal Hali\00"
@.str.5 = [17 x i8] c"Yuvarlanmis Hali\00"
@.str.6 = [7 x i8] c"Onluga\00"
@.str.7 = [8 x i8] c"Yuzluge\00"
@.str.8 = [8 x i8] c"Binlige\00"
@.str.9 = [31 x i8] c"%12f %16.2f %4.4f %7.4f %7.4f\0A\00"
@.str.10 = [24 x i8] c"Program Sonlanmistir :)\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%6 = load double, double* %1
%7 = fcmp ult double %6, 1.000000e+00
br i1 %7, label %29, label %8
8: ; preds = %0
%9 = bitcast double* %2 to i8*
br label %10
10: ; preds = %8, %10
%11 = phi i32 [ 1, %8 ], [ %25, %10 ]
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%14 = load double, double* %2
%15 = call double @tam_sayiya_yuvarla(double %14)
%16 = load double, double* %2
%17 = call double @onluk_tam_sayiya_yuvarla(double %16)
%18 = load double, double* %2
%19 = call double @yuzluk_tam_sayiya_yuvarla(double %18)
%20 = load double, double* %2
%21 = call double @binlik_tam_sayiya_yuvarla(double %20)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%23 = load double, double* %2
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), double %23, double %15, double %17, double %19, double %21)
%25 = add nuw nsw i32 %11, 1
%26 = sitofp i32 %25 to double
%27 = load double, double* %1
%28 = fcmp ult double %27, %26
br i1 %28, label %29, label %10
29: ; preds = %10, %0
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
ret i32 0
}