#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);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float radius;
  scanf("%f", &radius);
  float perimetar = 2 * radius * 3.14;
  float plostina = radius * radius * 3.14;
  printf("L = %f\n", perimetar);
  printf("P = %f\n", plostina);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xec1(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea8(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe85(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm1
movaps %xmm1,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb5(%rip),%xmm2
mulsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
mulss  %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,(%rsp)
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
lea    0xe98(%rip),%rdi
movss  (%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [8 x i8] c"L = %f\0A\00"
@.str.2 = [8 x i8] c"P = %f\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 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%6 = load float, float* %2
%7 = fmul float 2.000000e+00, %6
%8 = fpext float %7 to double
%9 = fmul double %8, 3.140000e+00
%10 = fptrunc double %9 to float
store float %10, float* %3
%11 = load float, float* %2
%12 = load float, float* %2
%13 = fmul float %11, %12
%14 = fpext float %13 to double
%15 = fmul double %14, 3.140000e+00
%16 = fptrunc double %15 to float
store float %16, float* %4
%17 = load float, float* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), float %17)
%19 = load float, float* %4
%20 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), float %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [8 x i8] c"L = %f\0A\00"
@.str.2 = [8 x i8] c"P = %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fmul float %4, 2.000000e+00
%6 = fpext float %5 to double
%7 = fmul double %6, 3.140000e+00
%8 = fptrunc double %7 to float
%9 = fmul float %4, %4
%10 = fpext float %9 to double
%11 = fmul double %10, 3.140000e+00
%12 = fptrunc double %11 to float
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), float %8)
%14 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), float %12)
ret i32 0
}