#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 ucret_hesapla(double);
int main() {
  double birinci_araba_ucret, ikinci_araba_ucret, ucuncu_araba_ucret;
  double birinci_araba_saat, ikinci_araba_saat, ucuncu_araba_saat;
  printf("Birinci arabanin park saatini giriniz: ");
  scanf("%lf", &birinci_araba_saat);
  birinci_araba_ucret = ucret_hesapla(birinci_araba_saat);
  printf("Ikinci arabanin park saatini giriniz: ");
  scanf("%lf", &ikinci_araba_saat);
  ikinci_araba_ucret = ucret_hesapla(ikinci_araba_saat);
  printf("Ucuncu arabanin park saatini giriniz: ");
  scanf("%lf", &ucuncu_araba_saat);
  ucuncu_araba_ucret = ucret_hesapla(ucuncu_araba_saat);
  printf("%5s%10s%10s", "Araba", "Saat", "Ucret\n");
  printf("1 %13.1f %8.2f\n", birinci_araba_saat, birinci_araba_ucret);
  printf("2 %13.1f %8.2f\n", ikinci_araba_saat, ikinci_araba_ucret);
  printf("3 %13.1f %8.2f\n", ucuncu_araba_saat, ucuncu_araba_ucret);
  int toplam_saat;
  double toplam_ucret;
  toplam_saat = birinci_araba_saat + ikinci_araba_saat + ucuncu_araba_saat;
  toplam_ucret = birinci_araba_ucret + ikinci_araba_ucret + ucuncu_araba_ucret;
  printf("Toplam %8d %8.2f", toplam_saat, toplam_ucret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x28(%rbp),%xmm0
call   1040 <ucret_hesapla@plt>
movsd  %xmm0,-0x10(%rbp)
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x30(%rbp),%xmm0
call   1040 <ucret_hesapla@plt>
movsd  %xmm0,-0x18(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7a(%rip),%rdi
lea    -0x38(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x38(%rbp),%xmm0
call   1040 <ucret_hesapla@plt>
movsd  %xmm0,-0x20(%rbp)
lea    0xead(%rip),%rdi
lea    0xeb2(%rip),%rsi
lea    0xeb1(%rip),%rdx
lea    0xeaf(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xe9e(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe96(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xe8e(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x3c(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x3c(%rbp),%esi
movsd  -0x48(%rbp),%xmm0
lea    0xe5e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsd  0x10(%rsp),%xmm0
call   1040 <ucret_hesapla@plt>
movsd  %xmm0,0x28(%rsp)
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsd  0x8(%rsp),%xmm0
call   1040 <ucret_hesapla@plt>
movsd  %xmm0,0x20(%rsp)
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1040 <ucret_hesapla@plt>
movsd  %xmm0,0x18(%rsp)
lea    0xeb6(%rip),%rdi
lea    0xebb(%rip),%rsi
lea    0xeba(%rip),%rdx
lea    0xeb8(%rip),%rcx
xor    %eax,%eax
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
lea    0xeab(%rip),%rdi
movsd  0x28(%rsp),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
lea    0xea1(%rip),%rdi
movsd  0x20(%rsp),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
lea    0xe98(%rip),%rdi
movsd  0x18(%rsp),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
cvttsd2si %xmm0,%esi
movsd  0x28(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
lea    0xe6d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Birinci arabanin park saatini giriniz: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [39 x i8] c"Ikinci arabanin park saatini giriniz: \00"
@.str.3 = [39 x i8] c"Ucuncu arabanin park saatini giriniz: \00"
@.str.4 = [12 x i8] c"%5s%10s%10s\00"
@.str.5 = [6 x i8] c"Araba\00"
@.str.6 = [5 x i8] c"Saat\00"
@.str.7 = [7 x i8] c"Ucret\0A\00"
@.str.8 = [16 x i8] c"1 %13.1f %8.2f\0A\00"
@.str.9 = [16 x i8] c"2 %13.1f %8.2f\0A\00"
@.str.10 = [16 x i8] c"3 %13.1f %8.2f\0A\00"
@.str.11 = [17 x i8] c"Toplam %8d %8.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca double
store i32 0, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %5)
%12 = load double, double* %5
%13 = call double @ucret_hesapla(double %12)
store double %13, double* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 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* %6)
%16 = load double, double* %6
%17 = call double @ucret_hesapla(double %16)
store double %17, double* %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %7)
%20 = load double, double* %7
%21 = call double @ucret_hesapla(double %20)
store double %21, double* %4
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%23 = load double, double* %5
%24 = load double, double* %2
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), double %23, double %24)
%26 = load double, double* %6
%27 = load double, double* %3
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), double %26, double %27)
%29 = load double, double* %7
%30 = load double, double* %4
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), double %29, double %30)
%32 = load double, double* %5
%33 = load double, double* %6
%34 = fadd double %32, %33
%35 = load double, double* %7
%36 = fadd double %34, %35
%37 = fptosi double %36 to i32
store i32 %37, i32* %8
%38 = load double, double* %2
%39 = load double, double* %3
%40 = fadd double %38, %39
%41 = load double, double* %4
%42 = fadd double %40, %41
store double %42, double* %9
%43 = load i32, i32* %8
%44 = load double, double* %9
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i32 %43, double %44)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Birinci arabanin park saatini giriniz: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [39 x i8] c"Ikinci arabanin park saatini giriniz: \00"
@.str.3 = [39 x i8] c"Ucuncu arabanin park saatini giriniz: \00"
@.str.4 = [12 x i8] c"%5s%10s%10s\00"
@.str.5 = [6 x i8] c"Araba\00"
@.str.6 = [5 x i8] c"Saat\00"
@.str.7 = [7 x i8] c"Ucret\0A\00"
@.str.8 = [16 x i8] c"1 %13.1f %8.2f\0A\00"
@.str.9 = [16 x i8] c"2 %13.1f %8.2f\0A\00"
@.str.10 = [16 x i8] c"3 %13.1f %8.2f\0A\00"
@.str.11 = [17 x i8] c"Toplam %8d %8.2f\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%9 = load double, double* %1
%10 = call double @ucret_hesapla(double %9)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%13 = load double, double* %2
%14 = call double @ucret_hesapla(double %13)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%17 = load double, double* %3
%18 = call double @ucret_hesapla(double %17)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%20 = load double, double* %1
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), double %20, double %10)
%22 = load double, double* %2
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), double %22, double %14)
%24 = load double, double* %3
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), double %24, double %18)
%26 = load double, double* %1
%27 = load double, double* %2
%28 = fadd double %26, %27
%29 = load double, double* %3
%30 = fadd double %28, %29
%31 = fptosi double %30 to i32
%32 = fadd double %10, %14
%33 = fadd double %32, %18
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i32 %31, double %33)
ret i32 0
}