#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 *, float, float);
float sqrt(int);
int main() {
  int x1 = 0, x2 = 4, y1 = 0, y2 = 5;
  float r = sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
  float a = 3.14 * r * r;
  float p = 2 * 3.14 * r;
  printf("Area of Cirlce: %f \nPerimeter of the circle: %f\n", a, p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
imul   %eax,%edi
mov    -0x10(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0x14(%rbp),%ecx
imul   %ecx,%eax
add    %eax,%edi
call   1040 <sqrt@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe82(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe4f(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x29,%edi
call   1040 <sqrt@plt>
cvtss2sd %xmm0,%xmm1
movsd  0xec9(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mulsd  0xebd(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Area of Cirlce: %f \0APerimeter of the circle: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
store i32 4, i32* %3
store i32 0, i32* %4
store i32 5, i32* %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = sub nsw i32 %12, %13
%15 = mul nsw i32 %11, %14
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = sub nsw i32 %16, %17
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = sub nsw i32 %19, %20
%22 = mul nsw i32 %18, %21
%23 = add nsw i32 %15, %22
%24 = call float @sqrt(i32 %23)
store float %24, float* %6
%25 = load float, float* %6
%26 = fpext float %25 to double
%27 = fmul double 3.140000e+00, %26
%28 = load float, float* %6
%29 = fpext float %28 to double
%30 = fmul double %27, %29
%31 = fptrunc double %30 to float
store float %31, float* %7
%32 = load float, float* %6
%33 = fpext float %32 to double
%34 = fmul double 6.280000e+00, %33
%35 = fptrunc double %34 to float
store float %35, float* %8
%36 = load float, float* %7
%37 = load float, float* %8
%38 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), float %36, float %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"Area of Cirlce: %f \0APerimeter of the circle: %f\0A\00"
define i32 @main() {
%1 = tail call float @sqrt(i32 41)
%2 = fpext float %1 to double
%3 = fmul double %2, 3.140000e+00
%4 = fmul double %3, %2
%5 = fptrunc double %4 to float
%6 = fmul double %2, 6.280000e+00
%7 = fptrunc double %6 to float
%8 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), float %5, float %7)
ret i32 0
}