#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 *, int *);
int main() {
  int siparis;
  printf("siparis adetini giriniz...\n");
  scanf("%d", &siparis);
  float indirim;
  if (siparis > 50) {
    indirim = 0.3;
  } else if (siparis > 20) {
    indirim = 0.2;
  } else if (siparis > 10) {
    indirim = 0.02;
  } else {
    indirim = 1;
  }
  int fiyat = 10;
  float toplam = (siparis * fiyat) - (siparis * fiyat * indirim);
  float miktar = siparis * fiyat * indirim;
  float indirimsiz = siparis * fiyat;
  printf("indirimli fiyat: %f\n", toplam);
  printf("indirimsiz fiyat: %f\n", indirimsiz);
  printf("indirim miktari: %f\n", miktar);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x32,-0x8(%rbp)
jle    1169 <main+0x49>
movss  0xead(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    11b8 <main+0x98>
cmpl   $0x14,-0x8(%rbp)
jle    1185 <main+0x65>
movss  0xe8d(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    11b3 <main+0x93>
cmpl   $0xa,-0x8(%rbp)
jle    11a1 <main+0x81>
movss  0xe6d(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    11ae <main+0x8e>
movss  0xe57(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    11b3 <main+0x93>
jmp    11b8 <main+0x98>
movl   $0xa,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
cvtsi2ss %eax,%xmm1
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  -0xc(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
cvtsi2ss %eax,%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe06(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe04(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe03(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x14(%rsp),%eax
cmp    $0x32,%eax
jle    1164 <main+0x34>
movss  0xe9e(%rip),%xmm0
jmp    1187 <main+0x57>
cmp    $0x14,%eax
jle    1173 <main+0x43>
movss  0xe93(%rip),%xmm0
jmp    1187 <main+0x57>
xor    %ecx,%ecx
cmp    $0xb,%eax
setge  %cl
lea    0xe86(%rip),%rdx
movss  (%rdx,%rcx,4),%xmm0
add    %eax,%eax
lea    (%rax,%rax,4),%eax
cvtsi2ss %eax,%xmm2
movss  %xmm2,0xc(%rsp)
mulss  %xmm2,%xmm0
movaps %xmm0,%xmm1
movss  %xmm0,0x10(%rsp)
movaps %xmm2,%xmm0
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5e(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe59(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"siparis adetini giriniz...\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"indirimli fiyat: %f\0A\00"
@.str.3 = [22 x i8] c"indirimsiz fiyat: %f\0A\00"
@.str.4 = [21 x i8] c"indirim miktari: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 50
br i1 %11, label %12, label %13
12: ; preds = %0
store float 0x3FD3333340000000, float* %3
br label %24
13: ; preds = %0
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 20
br i1 %15, label %16, label %17
16: ; preds = %13
store float 0x3FC99999A0000000, float* %3
br label %23
17: ; preds = %13
%18 = load i32, i32* %2
%19 = icmp sgt i32 %18, 10
br i1 %19, label %20, label %21
20: ; preds = %17
store float 0x3F947AE140000000, float* %3
br label %22
21: ; preds = %17
store float 1.000000e+00, float* %3
br label %22
22: ; preds = %21, %20
br label %23
23: ; preds = %22, %16
br label %24
24: ; preds = %23, %12
store i32 10, i32* %4
%25 = load i32, i32* %2
%26 = load i32, i32* %4
%27 = mul nsw i32 %25, %26
%28 = sitofp i32 %27 to float
%29 = load i32, i32* %2
%30 = load i32, i32* %4
%31 = mul nsw i32 %29, %30
%32 = sitofp i32 %31 to float
%33 = load float, float* %3
%34 = fneg float %32
%35 = call float @llvm.fmuladd.f32(float %34, float %33, float %28)
store float %35, float* %5
%36 = load i32, i32* %2
%37 = load i32, i32* %4
%38 = mul nsw i32 %36, %37
%39 = sitofp i32 %38 to float
%40 = load float, float* %3
%41 = fmul float %39, %40
store float %41, float* %6
%42 = load i32, i32* %2
%43 = load i32, i32* %4
%44 = mul nsw i32 %42, %43
%45 = sitofp i32 %44 to float
store float %45, float* %7
%46 = load float, float* %5
%47 = fpext float %46 to double
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %47)
%49 = load float, float* %7
%50 = fpext float %49 to double
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), double %50)
%52 = load float, float* %6
%53 = fpext float %52 to double
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), double %53)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"indirimli fiyat: %f\0A\00"
@.str.3 = [22 x i8] c"indirimsiz fiyat: %f\0A\00"
@.str.4 = [21 x i8] c"indirim miktari: %f\0A\00"
@str = [27 x i8] c"siparis adetini giriniz...\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 50
br i1 %6, label %12, label %7
7: ; preds = %0
%8 = icmp sgt i32 %5, 20
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp sgt i32 %5, 10
%11 = select i1 %10, float 0x3F947AE140000000, float 1.000000e+00
br label %12
12: ; preds = %9, %7, %0
%13 = phi float [ 0x3FD3333340000000, %0 ], [ 0x3FC99999A0000000, %7 ], [ %11, %9 ]
%14 = mul nsw i32 %5, 10
%15 = sitofp i32 %14 to float
%16 = fneg float %15
%17 = call float @llvm.fmuladd.f32(float %16, float %13, float %15)
%18 = fmul float %13, %15
%19 = fpext float %17 to double
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %19)
%21 = fpext float %15 to double
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), double %21)
%23 = fpext float %18 to double
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), double %23)
ret i32 0
}