#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 M_PI;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float c_rad, c_circ, c_area;
  printf("\nIngrese el valor del radio del circulo: ");
  scanf("%f", &c_rad);
  c_circ = M_PI * 2 * c_rad;
  c_area = M_PI * (c_rad * c_rad);
  printf("\nCircunferencia: %.2f\t\tArea: %.2f\n\n", c_circ, c_area);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    0x2e7a(%rip),%rax
cvtsi2ssl (%rax),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe8f(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
lea    (%rax,%rax,1),%ecx
cvtsi2ss %ecx,%xmm0
movss  0x4(%rsp),%xmm1
mulss  %xmm1,%xmm0
cvtsi2ss %eax,%xmm2
mulss  %xmm1,%xmm1
mulss  %xmm2,%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
lea    0xeb8(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"\0AIngrese el valor del radio del circulo: \00"
@.str.1 = [3 x i8] c"%f\00"
@M_PI = global i32 0
@.str.2 = [36 x i8] c"\0ACircunferencia: %.2f\09\09Area: %.2f\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 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), float* %2)
%7 = load i32, i32* @M_PI
%8 = mul nsw i32 %7, 2
%9 = sitofp i32 %8 to float
%10 = load float, float* %2
%11 = fmul float %9, %10
store float %11, float* %3
%12 = load i32, i32* @M_PI
%13 = sitofp i32 %12 to float
%14 = load float, float* %2
%15 = load float, float* %2
%16 = fmul float %14, %15
%17 = fmul float %13, %16
store float %17, float* %4
%18 = load float, float* %3
%19 = fpext float %18 to double
%20 = load float, float* %4
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double %19, double %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [42 x i8] c"\0AIngrese el valor del radio del circulo: \00"
@.str.1 = [3 x i8] c"%f\00"
@M_PI = global i32 0
@.str.2 = [36 x i8] c"\0ACircunferencia: %.2f\09\09Area: %.2f\0A\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load i32, i32* @M_PI
%6 = shl nsw i32 %5, 1
%7 = sitofp i32 %6 to float
%8 = load float, float* %1
%9 = fmul float %8, %7
%10 = sitofp i32 %5 to float
%11 = fmul float %8, %8
%12 = fmul float %11, %10
%13 = fpext float %9 to double
%14 = fpext float %12 to double
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double %13, double %14)
ret i32 0
}