double ucret_hesapla(double saat) {
  int minumum_ucret_saati = 3;
  double minumum_ucret = 2;
  double maksimum_ucret = 10;
  double saatlik_gecikme_ucreti = 0.5;
  double ucret;
  if (saat <= minumum_ucret_saati) {
    return minumum_ucret;
  } else if (saat >= 20) {
    return maksimum_ucret;
  } else {
    ucret =
        minumum_ucret + ((saat - minumum_ucret_saati) * saatlik_gecikme_ucreti);
    return ucret;
  }
}


x86 assembly (clang, -O0):
<ucret_hesapla>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
movsd  0xef8(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xee3(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x14(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     115a <ucret_hesapla+0x5a>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11af <ucret_hesapla+0xaf>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1180 <ucret_hesapla+0x80>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11af <ucret_hesapla+0xaf>
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm2
subsd  %xmm2,%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucret_hesapla>:
movsd  0xf00(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1131 <ucret_hesapla+0x31>
ucomisd 0xf02(%rip),%xmm0
jae    113a <ucret_hesapla+0x3a>
addsd  0xf00(%rip),%xmm0
mulsd  0xf00(%rip),%xmm0
addsd  0xed0(%rip),%xmm0
ret
movsd  0xec7(%rip),%xmm0
ret
movsd  0xece(%rip),%xmm0
ret

LLVM IR (-O0):
define double @ucret_hesapla(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %3
store i32 3, i32* %4
store double 2.000000e+00, double* %5
store double 1.000000e+01, double* %6
store double 5.000000e-01, double* %7
%9 = load double, double* %3
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = fcmp ole double %9, %11
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load double, double* %5
store double %14, double* %2
br label %29
15: ; preds = %1
%16 = load double, double* %3
%17 = fcmp oge double %16, 2.000000e+01
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = load double, double* %6
store double %19, double* %2
br label %29
20: ; preds = %15
%21 = load double, double* %5
%22 = load double, double* %3
%23 = load i32, i32* %4
%24 = sitofp i32 %23 to double
%25 = fsub double %22, %24
%26 = load double, double* %7
%27 = call double @llvm.fmuladd.f64(double %25, double %26, double %21)
store double %27, double* %8
%28 = load double, double* %8
store double %28, double* %2
br label %29
29: ; preds = %20, %18, %13
%30 = load double, double* %2
ret double %30
}

LLVM IR (-O2):
define double @ucret_hesapla(double %0) {
%2 = fcmp ugt double %0, 3.000000e+00
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = fcmp ult double %0, 2.000000e+01
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = fadd double %0, -3.000000e+00
%7 = tail call double @llvm.fmuladd.f64(double %6, double 5.000000e-01, double 2.000000e+00)
br label %8
8: ; preds = %3, %1, %5
%9 = phi double [ %7, %5 ], [ 2.000000e+00, %1 ], [ 1.000000e+01, %3 ]
ret double %9
}