#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 *, ...);
int main() {
  int x;
  int y;
  float area;
  float circumference;
  float radius;
  printf("what is the x coordinate of the line?\n");
  scanf("%d", &x);
  y = 2 * x + 8;
  y = 2;
  y *= x;
  y += 8;
  printf("\ny = %d \n", y);
  printf("\nWhat is the radius of the circle?\n");
  scanf("%f", &radius);
  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("\n\nThe y coordinate = %d \n", y);
  printf("The area = %.2f \n", area);
  printf("The circumference = %.2f \n", circumference);
  printf("\n\n\tSultan M.\n");
  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
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x8,%eax
mov    %eax,-0xc(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe49(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe3b(%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  0xdfb(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xdee(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdc8(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x18(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe18(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe13(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe20(%rip),%rdi
mov    $0x0,%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    0xf23(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
lea    (%rax,%rax,1),%ebx
add    $0x8,%ebx
lea    0xea6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf10(%rip),%rdi
call   1030 <puts@plt>
lea    0xe94(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm0
movss  0xe65(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
mulss  0xe54(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xe5b(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe56(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
call   1030 <puts@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?\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"\0Ay = %d \0A\00"
@.str.3 = [36 x i8] c"\0AWhat is the radius of the circle?\0A\00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [26 x i8] c"\0A\0AThe y coordinate = %d \0A\00"
@.str.6 = [18 x i8] c"The area = %.2f \0A\00"
@.str.7 = [27 x i8] c"The circumference = %.2f \0A\00"
@.str.8 = [14 x i8] c"\0A\0A\09Sultan M.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%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 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = mul nsw i32 2, %9
%11 = add nsw i32 %10, 8
store i32 %11, i32* %3
store i32 2, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = mul nsw i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 8
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %6)
%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 i32, i32* %3
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %45)
%47 = load float, float* %4
%48 = fpext float %47 to double
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), double %48)
%50 = load float, float* %5
%51 = fpext float %50 to double
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), double %51)
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"\0Ay = %d \0A\00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [26 x i8] c"\0A\0AThe y coordinate = %d \0A\00"
@.str.6 = [18 x i8] c"The area = %.2f \0A\00"
@.str.7 = [27 x i8] c"The circumference = %.2f \0A\00"
@str = [38 x i8] c"what is the x coordinate of the line?\00"
@str.9 = [35 x i8] c"\0AWhat is the radius of the circle?\00"
@str.10 = [13 x i8] c"\0A\0A\09Sultan M.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = shl nsw i32 %7, 1
%9 = add nsw i32 %8, 8
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.9, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %2)
%13 = load float, float* %2
%14 = fmul float %13, 0x40091EB860000000
%15 = fmul float %13, %14
%16 = fmul float %13, 0x40191EB860000000
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %9)
%18 = fpext float %15 to double
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), double %18)
%20 = fpext float %16 to double
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), double %20)
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.10, i64 0, i64 0))
ret i32 0
}