#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;
  y = 5;
  printf("Input x variable\n");
  scanf("%f", &x);
  y = (4 * x + 8);
  printf("This is the y intercept %f\n", y);
  float radius;
  printf("What is the radius of the circle?\n");
  scanf("%f", &radius);
  float circum;
  circum = 3.14 * (2 * radius);
  float area;
  area = 3.14 * (radius * radius);
  printf("This is the area %f\n", area);
  printf("This is the circum %f\n", circum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xea5(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe9d(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe82(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xe4f(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe36(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe13(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe62(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe60(%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    0xf1f(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
mulss  0xe9d(%rip),%xmm0
addss  0xe99(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm0
movaps %xmm0,%xmm1
addss  %xmm0,%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe59(%rip),%xmm2
mulsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,0x4(%rsp)
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe57(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe54(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Input x variable\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [28 x i8] c"This is the y intercept %f\0A\00"
@.str.3 = [35 x i8] c"What is the radius of the circle?\0A\00"
@.str.4 = [21 x i8] c"This is the area %f\0A\00"
@.str.5 = [23 x i8] c"This is the circum %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
store float 5.000000e+00, float* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 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 = load float, float* %2
%10 = call float @llvm.fmuladd.f32(float 4.000000e+00, float %9, float 8.000000e+00)
store float %10, float* %3
%11 = load float, float* %3
%12 = fpext float %11 to double
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%16 = load float, float* %4
%17 = fmul float 2.000000e+00, %16
%18 = fpext float %17 to double
%19 = fmul double 3.140000e+00, %18
%20 = fptrunc double %19 to float
store float %20, float* %5
%21 = load float, float* %4
%22 = load float, float* %4
%23 = fmul float %21, %22
%24 = fpext float %23 to double
%25 = fmul double 3.140000e+00, %24
%26 = fptrunc double %25 to float
store float %26, float* %6
%27 = load float, float* %6
%28 = fpext float %27 to double
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), double %28)
%30 = load float, float* %5
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), double %31)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [28 x i8] c"This is the y intercept %f\0A\00"
@.str.4 = [21 x i8] c"This is the area %f\0A\00"
@.str.5 = [23 x i8] c"This is the circum %f\0A\00"
@str = [17 x i8] c"Input x variable\00"
@str.6 = [34 x i8] c"What is the radius of the circle?\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = tail call i32 @puts(i8* dereferenceable(1) 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 = call float @llvm.fmuladd.f32(float %6, float 4.000000e+00, float 8.000000e+00)
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %8)
%10 = bitcast float* %2 to i8*
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.6, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%13 = load float, float* %2
%14 = fmul float %13, 2.000000e+00
%15 = fpext float %14 to double
%16 = fmul double %15, 3.140000e+00
%17 = fptrunc double %16 to float
%18 = fmul float %13, %13
%19 = fpext float %18 to double
%20 = fmul double %19, 3.140000e+00
%21 = fptrunc double %20 to float
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), double %22)
%24 = fpext float %17 to double
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), double %24)
ret i32 0
}