#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 *);
int main() {
  double a, b, x, y;
  float O;
  printf("Harmonik ortalamasi alinacak degerleri sirasi ile giriniz");
  printf("\n1.Tam Sayi");
  scanf("%lf", &a);
  printf("2.Tam Sayi");
  scanf("%lf", &b);
  x = 2 * a * b;
  y = a + b;
  O = x / (a + b);
  printf("\a---------------------------------------------");
  printf("\n                      2*%.0lf*%.0lf          %.0lf   ", a, b, x);
  printf("\nHarmonik Ortalama = ------------- = ------------ = %.2f", O);
  printf("\n                       %.0lf+%.0lf           %.0lf   ", a, b, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xe86(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    0xeb4(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xef0(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefe(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xeee(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm2
addsd  %xmm1,%xmm2
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x20(%rsp)
addsd  %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
movapd %xmm2,%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x1c(%rsp)
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
lea    0xeb9(%rip),%rdi
movsd  0x20(%rsp),%xmm2
mov    $0x3,%al
call   1030 <printf@plt>
movss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
lea    0xef1(%rip),%rdi
movsd  0x28(%rsp),%xmm2
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [58 x i8] c"Harmonik ortalamasi alinacak degerleri sirasi ile giriniz\00"
@.str.1 = [12 x i8] c"\0A1.Tam Sayi\00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [11 x i8] c"2.Tam Sayi\00"
@.str.4 = [47 x i8] c"\07---------------------------------------------\00"
@.str.5 = [55 x i8] c"\0A 2*%.0lf*%.0lf %.0lf \00"
@.str.6 = [57 x i8] c"\0AHarmonik Ortalama = ------------- = ------------ = %.2f\00"
@.str.7 = [55 x i8] c"\0A %.0lf+%.0lf %.0lf \00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca float
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %1)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %2)
%11 = load double, double* %1
%12 = fmul double 2.000000e+00, %11
%13 = load double, double* %2
%14 = fmul double %12, %13
store double %14, double* %3
%15 = load double, double* %1
%16 = load double, double* %2
%17 = fadd double %15, %16
store double %17, double* %4
%18 = load double, double* %3
%19 = load double, double* %1
%20 = load double, double* %2
%21 = fadd double %19, %20
%22 = fdiv double %18, %21
%23 = fptrunc double %22 to float
store float %23, float* %5
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%25 = load double, double* %1
%26 = load double, double* %2
%27 = load double, double* %3
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0), double %25, double %26, double %27)
%29 = load float, float* %5
%30 = fpext float %29 to double
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0), double %30)
%32 = load double, double* %1
%33 = load double, double* %2
%34 = load double, double* %4
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0), double %32, double %33, double %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [58 x i8] c"Harmonik ortalamasi alinacak degerleri sirasi ile giriniz\00"
@.str.1 = [12 x i8] c"\0A1.Tam Sayi\00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [11 x i8] c"2.Tam Sayi\00"
@.str.4 = [47 x i8] c"\07---------------------------------------------\00"
@.str.5 = [55 x i8] c"\0A 2*%.0lf*%.0lf %.0lf \00"
@.str.6 = [57 x i8] c"\0AHarmonik Ortalama = ------------- = ------------ = %.2f\00"
@.str.7 = [55 x i8] c"\0A %.0lf+%.0lf %.0lf \00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %1)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %2)
%10 = load double, double* %1
%11 = fmul double %10, 2.000000e+00
%12 = load double, double* %2
%13 = fmul double %11, %12
%14 = fadd double %10, %12
%15 = fdiv double %13, %14
%16 = fptrunc double %15 to float
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%18 = load double, double* %1
%19 = load double, double* %2
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0), double %18, double %19, double %13)
%21 = fpext float %16 to double
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.6, i64 0, i64 0), double %21)
%23 = load double, double* %1
%24 = load double, double* %2
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0), double %23, double %24, double %14)
ret i32 0
}