#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 /*<<< orphan*/ scanf(char *, double *);
double 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);
    printf("%12s %15s\n", "Orjinal Hali", "Yuvarlanmis Hali");
    printf("%12.2f %16.2f\n", yuvarlanacak_sayi, yuvarlanmis_sayi);
  }
  printf("Program sonlanmistir :)");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x1,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     11e7 <main+0xb7>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x20(%rbp),%xmm0
call   1030 <tam_sayiya_yuvarla@plt>
movsd  %xmm0,-0x28(%rbp)
lea    0xea7(%rip),%rdi
lea    0xeab(%rip),%rsi
lea    0xeb1(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0xeaa(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <main+0x34>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee6(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
movsd  0x8(%rsp),%xmm0
ucomisd 0xe95(%rip),%xmm0
jb     120a <main+0xda>
mov    $0x2,%r15d
mov    %rsp,%r12
lea    0xeda(%rip),%r13
lea    0xede(%rip),%rbx
lea    0xee4(%rip),%rbp
lea    0xeee(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
lea    0xe96(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe84(%rip),%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1030 <tam_sayiya_yuvarla@plt>
movsd  %xmm0,0x10(%rsp)
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
movsd  (%rsp),%xmm0
mov    %r14,%rdi
movsd  0x10(%rsp),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
movsd  0x8(%rsp),%xmm1
add    $0x1,%r15d
ucomisd %xmm0,%xmm1
jae    11a0 <main+0x70>
lea    0xe82(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%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 = [11 x i8] c"%12s %15s\0A\00"
@.str.4 = [13 x i8] c"Orjinal Hali\00"
@.str.5 = [17 x i8] c"Yuvarlanmis Hali\00"
@.str.6 = [15 x i8] c"%12.2f %16.2f\0A\00"
@.str.7 = [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
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%7 = 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 %8
8: ; preds = %22, %0
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to double
%11 = load double, double* %2
%12 = fcmp ole double %10, %11
br i1 %12, label %13, label %25
13: ; preds = %8
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%16 = load double, double* %4
%17 = call double @tam_sayiya_yuvarla(double %16)
store double %17, double* %5
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 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))
%19 = load double, double* %4
%20 = load double, double* %5
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), double %19, double %20)
br label %22
22: ; preds = %13
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %8
25: ; preds = %8
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, 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 = [11 x i8] c"%12s %15s\0A\00"
@.str.4 = [13 x i8] c"Orjinal Hali\00"
@.str.5 = [17 x i8] c"Yuvarlanmis Hali\00"
@.str.6 = [15 x i8] c"%12.2f %16.2f\0A\00"
@.str.7 = [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 %23, label %8
8: ; preds = %0
%9 = bitcast double* %2 to i8*
br label %10
10: ; preds = %8, %10
%11 = phi i32 [ 1, %8 ], [ %19, %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 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 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))
%17 = load double, double* %2
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), double %17, double %15)
%19 = add nuw nsw i32 %11, 1
%20 = sitofp i32 %19 to double
%21 = load double, double* %1
%22 = fcmp ult double %21, %20
br i1 %22, label %23, label %10
23: ; preds = %10, %0
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}