#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 */
float M_PI;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  float r;
  char opcion;
  printf("\tCálculo de Área de Circunferencia\n\n");
  printf("¿Desea intrudocir el [D]iámetro o el [R]adio? ");
  scanf("%c", &opcion);
  printf("Introduzca el dato: ");
  scanf("%f", &r);
  if (opcion == 'd' || opcion == 'D') {
    r /= 2;
  }
  printf("El valor de la circunferencia con Radio %.2f es igual a: %.2f.\n", r,
         M_PI * (r * r));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x64,%eax
je     1197 <main+0x77>
movsbl -0x9(%rbp),%eax
cmp    $0x44,%eax
jne    11ad <main+0x8d>
movss  -0x8(%rbp),%xmm0
movss  0xe5c(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    0x2e2b(%rip),%rax
movss  (%rax),%xmm1
movss  -0x8(%rbp),%xmm2
mulss  -0x8(%rbp),%xmm2
mulss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe9d(%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    0xf58(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee3(%rip),%rdi
lea    0x3(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x3(%rsp),%al
and    $0xdf,%al
movss  0x4(%rsp),%xmm1
cmp    $0x44,%al
jne    119d <main+0x6d>
mulss  0xe69(%rip),%xmm1
movss  %xmm1,0x4(%rsp)
cvtss2sd %xmm1,%xmm0
mov    0x2e40(%rip),%rax
mulss  %xmm1,%xmm1
mulss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe95(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"\09C\C3\A1lculo de \C3\81rea de Circunferencia\0A\0A\00"
@.str.1 = [49 x i8] c"\C2\BFDesea intrudocir el [D]i\C3\A1metro o el [R]adio? \00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [21 x i8] c"Introduzca el dato: \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [64 x i8] c"El valor de la circunferencia con Radio %.2f es igual a: %.2f.\0A\00"
@M_PI = global float 0.000000e+00
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %2)
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 100
br i1 %11, label %16, label %12
12: ; preds = %0
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 68
br i1 %15, label %16, label %19
16: ; preds = %12, %0
%17 = load float, float* %2
%18 = fdiv float %17, 2.000000e+00
store float %18, float* %2
br label %19
19: ; preds = %16, %12
%20 = load float, float* %2
%21 = fpext float %20 to double
%22 = load float, float* @M_PI
%23 = load float, float* %2
%24 = load float, float* %2
%25 = fmul float %23, %24
%26 = fmul float %22, %25
%27 = fpext float %26 to double
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.5, i64 0, i64 0), double %21, double %27)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [49 x i8] c"\C2\BFDesea intrudocir el [D]i\C3\A1metro o el [R]adio? \00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [21 x i8] c"Introduzca el dato: \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [64 x i8] c"El valor de la circunferencia con Radio %.2f es igual a: %.2f.\0A\00"
@M_PI = global float 0.000000e+00
@str = [38 x i8] c"\09C\C3\A1lculo de \C3\81rea de Circunferencia\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i8
%3 = bitcast float* %1 to i8*
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %1)
%9 = load i8, i8* %2
%10 = and i8 %9, -33
%11 = icmp eq i8 %10, 68
%12 = load float, float* %1
br i1 %11, label %13, label %15
13: ; preds = %0
%14 = fmul float %12, 5.000000e-01
store float %14, float* %1
br label %15
15: ; preds = %0, %13
%16 = phi float [ %14, %13 ], [ %12, %0 ]
%17 = fpext float %16 to double
%18 = load float, float* @M_PI
%19 = fmul float %16, %16
%20 = fmul float %18, %19
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.5, i64 0, i64 0), double %17, double %21)
ret i32 0
}