#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*/ getch(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double pi, radius, area;
  pi = 3.1416;
  printf("Enter the radius of the circle in cm\n");
  scanf("%lf", &radius);
  area = pi * radius * radius;
  printf("The Area of this circle is %.2f cm\n", area);
  getch(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeaf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <getch@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm1
movsd  0xe97(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
lea    0xe94(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <getch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Enter the radius of the circle in cm\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [36 x i8] c"The Area of this circle is %.2f cm\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
store double 3.141600e+00, double* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %1
%7 = load double, double* %2
%8 = fmul double %6, %7
%9 = load double, double* %2
%10 = fmul double %8, %9
store double %10, double* %3
%11 = load double, double* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double %11)
%13 = call i32 @getch(i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [36 x i8] c"The Area of this circle is %.2f cm\0A\00"
@str = [37 x i8] c"Enter the radius of the circle in cm\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fmul double %5, 3.141600e+00
%7 = fmul double %5, %6
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double %7)
%9 = call i32 @getch(i32 0)
ret i32 0
}