#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 ilk, son;
  printf("Ilk endeksi giriniz: ");
  scanf("%d", &ilk);
  printf("Son endeksi giriniz: ");
  scanf("%d", &son);
  printf("---------------------------\n");
  int miktar = son - ilk;
  float tuketim = miktar * 0.159838;
  float KDV = tuketim * 22 / 100;
  float Toplam = tuketim + KDV;
  printf("Tuketim miktari(Son endeks - Ilk endeks): %d \n", miktar);
  printf("Tuketim Tutari: %.2f\n", tuketim);
  printf("KDV (%%22)     : %.3f\n", KDV);
  printf("----------------------\n");
  printf("Toplam        : %.3f\n", Toplam);
  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    0xee2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xe79(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe60(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  0xe4f(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe92(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedc(%rip),%rbx
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf38(%rip),%rdi
call   1030 <puts@plt>
mov    0x18(%rsp),%esi
sub    0x1c(%rsp),%esi
cvtsi2sd %esi,%xmm0
mulsd  0xe6e(%rip),%xmm0
cvtsd2ss %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
movss  0xe64(%rip),%xmm0
mulss  %xmm1,%xmm0
divss  0xe5c(%rip),%xmm0
movss  %xmm0,0x10(%rsp)
addss  %xmm1,%xmm0
movss  %xmm0,0x14(%rsp)
lea    0xe78(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe80(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Ilk endeksi giriniz: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Son endeksi giriniz: \00"
@.str.3 = [29 x i8] c"---------------------------\0A\00"
@.str.4 = [47 x i8] c"Tuketim miktari(Son endeks - Ilk endeks): %d \0A\00"
@.str.5 = [22 x i8] c"Tuketim Tutari: %.2f\0A\00"
@.str.6 = [23 x i8] c"KDV (%%22) : %.3f\0A\00"
@.str.7 = [24 x i8] c"----------------------\0A\00"
@.str.8 = [22 x i8] c"Toplam : %.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%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 ([22 x i8], [22 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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = sub nsw i32 %13, %14
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = sitofp i32 %16 to double
%18 = fmul double %17, 1.598380e-01
%19 = fptrunc double %18 to float
store float %19, float* %5
%20 = load float, float* %5
%21 = fmul float %20, 2.200000e+01
%22 = fdiv float %21, 1.000000e+02
store float %22, float* %6
%23 = load float, float* %5
%24 = load float, float* %6
%25 = fadd float %23, %24
store float %25, float* %7
%26 = load i32, i32* %4
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0), i32 %26)
%28 = load float, float* %5
%29 = fpext float %28 to double
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), double %29)
%31 = load float, float* %6
%32 = fpext float %31 to double
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), double %32)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%35 = load float, float* %7
%36 = fpext float %35 to double
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), double %36)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Ilk endeksi giriniz: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Son endeksi giriniz: \00"
@.str.4 = [47 x i8] c"Tuketim miktari(Son endeks - Ilk endeks): %d \0A\00"
@.str.5 = [22 x i8] c"Tuketim Tutari: %.2f\0A\00"
@.str.6 = [23 x i8] c"KDV (%%22) : %.3f\0A\00"
@.str.8 = [22 x i8] c"Toplam : %.3f\0A\00"
@str = [28 x i8] c"---------------------------\00"
@str.9 = [23 x i8] c"----------------------\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%10 = load i32, i32* %2
%11 = load i32, i32* %1
%12 = sub nsw i32 %10, %11
%13 = sitofp i32 %12 to double
%14 = fmul double %13, 1.598380e-01
%15 = fptrunc double %14 to float
%16 = fmul float %15, 2.200000e+01
%17 = fdiv float %16, 1.000000e+02
%18 = fadd float %17, %15
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%20 = fpext float %15 to double
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), double %20)
%22 = fpext float %17 to double
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), double %22)
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.9, i64 0, i64 0))
%25 = fpext float %18 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), double %25)
ret i32 0
}