#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 area_of_circle(int num1) {
  float area;
  int radius = num1;
  printf("Finding area of Circle");
  printf("Radius: %d\n", radius);
  area = (float)(3.14 * radius * radius);
  printf("Area: %f", area);
  return area;
}


x86 assembly (clang, -O0):
<area_of_circle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xeb3(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<area_of_circle>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xeea(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cvtsi2sd %ebx,%xmm0
movsd  0xebf(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xeca(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Finding area of Circle\00"
@.str.1 = [12 x i8] c"Radius: %d\0A\00"
@.str.2 = [9 x i8] c"Area: %f\00"
define float @area_of_circle(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to double
%11 = fmul double 3.140000e+00, %10
%12 = load i32, i32* %4
%13 = sitofp i32 %12 to double
%14 = fmul double %11, %13
%15 = fptrunc double %14 to float
store float %15, float* %3
%16 = load float, float* %3
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %17)
%19 = load float, float* %3
ret float %19
}

LLVM IR (-O2):
@.str = [23 x i8] c"Finding area of Circle\00"
@.str.1 = [12 x i8] c"Radius: %d\0A\00"
@.str.2 = [9 x i8] c"Area: %f\00"
define float @area_of_circle(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%4 = sitofp i32 %0 to double
%5 = fmul double %4, 3.140000e+00
%6 = fmul double %5, %4
%7 = fptrunc double %6 to float
%8 = fpext float %7 to double
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %8)
ret float %7
}