#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 *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float raio, diametro, comprimento = 0;
  float PI = 3.14159265;
  printf("Digite o raio da circunferencia: ");
  scanf("%f", &raio);
  diametro = raio * 2;
  comprimento = 2 * PI * raio;
  printf("O diâmetro é da circunferencia é %f\n", diametro);
  printf("O comprimento da circunferencia é %f\n", comprimento);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xe96(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xe84(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe92(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm1
movaps %xmm1,%xmm0
addss  %xmm1,%xmm0
mulss  0xeab(%rip),%xmm1
movss  %xmm1,(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xec4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Digite o raio da circunferencia: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [40 x i8] c"O di\C3\A2metro \C3\A9 da circunferencia \C3\A9 %f\0A\00"
@.str.3 = [39 x i8] c"O comprimento da circunferencia \C3\A9 %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %4
store float 0x400921FB60000000, float* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%8 = load float, float* %2
%9 = fmul float %8, 2.000000e+00
store float %9, float* %3
%10 = load float, float* %5
%11 = fmul float 2.000000e+00, %10
%12 = load float, float* %2
%13 = fmul float %11, %12
store float %13, float* %4
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), double %15)
%17 = load float, float* %4
%18 = fpext float %17 to double
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), double %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Digite o raio da circunferencia: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [40 x i8] c"O di\C3\A2metro \C3\A9 da circunferencia \C3\A9 %f\0A\00"
@.str.3 = [39 x i8] c"O comprimento da circunferencia \C3\A9 %f\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 ([34 x i8], [34 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 = fmul float %5, 2.000000e+00
%7 = fmul float %5, 0x401921FB60000000
%8 = fpext float %6 to double
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), double %8)
%10 = fpext float %7 to double
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), double %10)
ret i32 0
}