#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 */
double pow(float, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
void main() {
  float raio, area, perimetro;
  printf("Informe o raio: ");
  scanf("%f", &raio);
  perimetro = (2 * 3.141592) * raio;
  area = 3.141592 * pow(raio, 2);
  printf("Perimetro dessa circunferencia: %.2f\n", perimetro);
  printf("Area dessa circunferencia: %.2f\n", area);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea1(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe72(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe79(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe88(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm1
mulsd  0xe9b(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0x10(%rsp)
mov    $0x2,%edi
call   1050 <pow@plt>
mulsd  0xe87(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe88(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe96(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Informe o raio: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [38 x i8] c"Perimetro dessa circunferencia: %.2f\0A\00"
@.str.3 = [33 x i8] c"Area dessa circunferencia: %.2f\0A\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = fmul double 0x401921FAFC8B007A, %7
%9 = fptrunc double %8 to float
store float %9, float* %3
%10 = load float, float* %1
%11 = call double @pow(float %10, i32 2)
%12 = fmul double 0x400921FAFC8B007A, %11
%13 = fptrunc double %12 to float
store float %13, float* %2
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), double %15)
%17 = load float, float* %2
%18 = fpext float %17 to double
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), double %18)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Informe o raio: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [38 x i8] c"Perimetro dessa circunferencia: %.2f\0A\00"
@.str.3 = [33 x i8] c"Area dessa circunferencia: %.2f\0A\00"
define void @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 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 float, float* %1
%6 = fpext float %5 to double
%7 = fmul double %6, 0x401921FAFC8B007A
%8 = fptrunc double %7 to float
%9 = call double @pow(float %5, i32 2)
%10 = fmul double %9, 0x400921FAFC8B007A
%11 = fptrunc double %10 to float
%12 = fpext float %8 to double
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), double %12)
%14 = fpext float %11 to double
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), double %14)
ret void
}