#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, y, radius, circumference, area;
  printf("What is the X coordinate of the line?:");
  scanf("%f", &x);
  y = 2.0;
  y *= x;
  y += 1.0;
  printf("What is the radius of the circle?:");
  scanf("%f", &radius);
  area = 3.14159;
  area *= radius;
  area *= radius;
  circumference = 2;
  circumference *= 3.14159;
  circumference *= radius;
  printf("\nY Coordinate: %f\nArea: %f\nCircumference: %f \n", y, area,
         circumference);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xebb(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8e(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xe67(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe38(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe12(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x14(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe39(%rip),%rdi
mov    $0x3,%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    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef9(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  %xmm0,%xmm0
addss  0xea7(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x8(%rsp),%xmm2
movss  0xe7c(%rip),%xmm1
mulss  %xmm2,%xmm1
mulss  %xmm2,%xmm1
mulss  0xe70(%rip),%xmm2
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
lea    0xea8(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"What is the X coordinate of the line?:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [35 x i8] c"What is the radius of the circle?:\00"
@.str.3 = [47 x i8] c"\0AY Coordinate: %f\0AArea: %f\0ACircumference: %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 ([39 x i8], [39 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)
store float 2.000000e+00, float* %3
%9 = load float, float* %2
%10 = load float, float* %3
%11 = fmul float %10, %9
store float %11, float* %3
%12 = load float, float* %3
%13 = fpext float %12 to double
%14 = fadd double %13, 1.000000e+00
%15 = fptrunc double %14 to float
store float %15, float* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
store float 0x400921FA00000000, float* %6
%18 = load float, float* %4
%19 = load float, float* %6
%20 = fmul float %19, %18
store float %20, float* %6
%21 = load float, float* %4
%22 = load float, float* %6
%23 = fmul float %22, %21
store float %23, float* %6
store float 2.000000e+00, float* %5
%24 = load float, float* %5
%25 = fpext float %24 to double
%26 = fmul double %25, 3.141590e+00
%27 = fptrunc double %26 to float
store float %27, float* %5
%28 = load float, float* %4
%29 = load float, float* %5
%30 = fmul float %29, %28
store float %30, float* %5
%31 = load float, float* %3
%32 = fpext float %31 to double
%33 = load float, float* %6
%34 = fpext float %33 to double
%35 = load float, float* %5
%36 = fpext float %35 to double
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), double %32, double %34, double %36)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"What is the X coordinate of the line?:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [35 x i8] c"What is the radius of the circle?:\00"
@.str.3 = [47 x i8] c"\0AY Coordinate: %f\0AArea: %f\0ACircumference: %f \0A\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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 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 = load float, float* %1
%8 = fmul float %7, 2.000000e+00
%9 = fadd float %8, 1.000000e+00
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%12 = load float, float* %2
%13 = fmul float %12, 0x400921FA00000000
%14 = fmul float %12, %13
%15 = fmul float %12, 0x401921FA00000000
%16 = fpext float %9 to double
%17 = fpext float %14 to double
%18 = fpext float %15 to double
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), double %16, double %17, double %18)
ret i32 0
}