#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() {
  float x;
  float y;
  float area;
  float circumference;
  float radius;
  printf("what is the x ?\n");
  scanf("%f", &x);
  printf("what is the radius?\n");
  scanf("%f", &radius);
  y = 3 * x + 5;
  y = 3;
  y *= x;
  y += 5;
  printf("y = %.2f\n", y);
  area = 3.14 * radius * radius;
  area = 3.14;
  area *= radius;
  area *= radius;
  circumference = 2 * 3.14 * radius;
  circumference = 2;
  circumference *= 3.14;
  circumference *= radius;
  printf("the area is %f ?\n", area);
  printf("the circumference is %f ?\n", circumference);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xea4(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe94(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xe87(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xe67(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe1d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe0f(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x18(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x18(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdcf(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xdc2(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd9c(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x18(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdc3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdbe(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf0e(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
mulss  0xe84(%rip),%xmm0
addss  0xe80(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe84(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x8(%rsp),%xmm1
movss  0xe64(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
mulss  0xe58(%rip),%xmm1
movss  %xmm1,0x4(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xe58(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe52(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"what is the x ?\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [21 x i8] c"what is the radius?\0A\00"
@.str.3 = [10 x i8] c"y = %.2f\0A\00"
@.str.4 = [18 x i8] c"the area is %f ?\0A\00"
@.str.5 = [27 x i8] c"the circumference is %f ?\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %6)
%11 = load float, float* %2
%12 = call float @llvm.fmuladd.f32(float 3.000000e+00, float %11, float 5.000000e+00)
store float %12, float* %3
store float 3.000000e+00, float* %3
%13 = load float, float* %2
%14 = load float, float* %3
%15 = fmul float %14, %13
store float %15, float* %3
%16 = load float, float* %3
%17 = fadd float %16, 5.000000e+00
store float %17, float* %3
%18 = load float, float* %3
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double %19)
%21 = load float, float* %6
%22 = fpext float %21 to double
%23 = fmul double 3.140000e+00, %22
%24 = load float, float* %6
%25 = fpext float %24 to double
%26 = fmul double %23, %25
%27 = fptrunc double %26 to float
store float %27, float* %4
store float 0x40091EB860000000, float* %4
%28 = load float, float* %6
%29 = load float, float* %4
%30 = fmul float %29, %28
store float %30, float* %4
%31 = load float, float* %6
%32 = load float, float* %4
%33 = fmul float %32, %31
store float %33, float* %4
%34 = load float, float* %6
%35 = fpext float %34 to double
%36 = fmul double 6.280000e+00, %35
%37 = fptrunc double %36 to float
store float %37, float* %5
store float 2.000000e+00, float* %5
%38 = load float, float* %5
%39 = fpext float %38 to double
%40 = fmul double %39, 3.140000e+00
%41 = fptrunc double %40 to float
store float %41, float* %5
%42 = load float, float* %6
%43 = load float, float* %5
%44 = fmul float %43, %42
store float %44, float* %5
%45 = load float, float* %4
%46 = fpext float %45 to double
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), double %46)
%48 = load float, float* %5
%49 = fpext float %48 to double
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), double %49)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.3 = [10 x i8] c"y = %.2f\0A\00"
@.str.4 = [18 x i8] c"the area is %f ?\0A\00"
@.str.5 = [27 x i8] c"the circumference is %f ?\0A\00"
@str = [16 x i8] c"what is the x ?\00"
@str.6 = [20 x i8] c"what is the radius?\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 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* %1)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.6, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%9 = load float, float* %1
%10 = fmul float %9, 3.000000e+00
%11 = fadd float %10, 5.000000e+00
%12 = fpext float %11 to double
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double %12)
%14 = load float, float* %2
%15 = fmul float %14, 0x40091EB860000000
%16 = fmul float %14, %15
%17 = fmul float %14, 0x40191EB860000000
%18 = fpext float %16 to double
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), double %18)
%20 = fpext float %17 to double
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), double %20)
ret i32 0
}