#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, y;
  float radius, area, circumf;
  printf("What is the first x\n");
  scanf("%d", &x);
  y = 1;
  y *= 3 * x;
  y += 1;
  printf("What is the radius of the circle\n");
  scanf("%f", &radius);
  area = 1;
  area *= (3.14 * radius * radius);
  circumf = 1;
  circumf *= 2;
  circumf *= 3.14;
  circumf *= radius;
  printf("Y coord = %d\nArea = %.2f\nCircumference = %.2f", y, area, circumf);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
imul   $0x3,-0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  0xe81(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe5f(%rip),%xmm1
mulsd  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe3c(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe2b(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe08(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%esi
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe1d(%rip),%rdi
mov    $0x2,%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    0xf04(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
lea    (%rax,%rax,2),%ebx
add    $0x1,%ebx
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9e(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm0
movsd  0xe71(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
mulss  0xe62(%rip),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
lea    0xe5d(%rip),%rdi
mov    %ebx,%esi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"What is the first x\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [34 x i8] c"What is the radius of the circle\0A\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [46 x i8] c"Y coord = %d\0AArea = %.2f\0ACircumference = %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
store i32 1, i32* %2
%8 = load i32, i32* %1
%9 = mul nsw i32 3, %8
%10 = load i32, i32* %2
%11 = mul nsw i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
store float 1.000000e+00, float* %4
%16 = load float, float* %3
%17 = fpext float %16 to double
%18 = fmul double 3.140000e+00, %17
%19 = load float, float* %3
%20 = fpext float %19 to double
%21 = fmul double %18, %20
%22 = load float, float* %4
%23 = fpext float %22 to double
%24 = fmul double %23, %21
%25 = fptrunc double %24 to float
store float %25, float* %4
store float 1.000000e+00, float* %5
%26 = load float, float* %5
%27 = fmul float %26, 2.000000e+00
store float %27, float* %5
%28 = load float, float* %5
%29 = fpext float %28 to double
%30 = fmul double %29, 3.140000e+00
%31 = fptrunc double %30 to float
store float %31, float* %5
%32 = load float, float* %3
%33 = load float, float* %5
%34 = fmul float %33, %32
store float %34, float* %5
%35 = load i32, i32* %2
%36 = load float, float* %4
%37 = fpext float %36 to double
%38 = load float, float* %5
%39 = fpext float %38 to double
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i32 %35, double %37, double %39)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [46 x i8] c"Y coord = %d\0AArea = %.2f\0ACircumference = %.2f\00"
@str = [20 x i8] c"What is the first x\00"
@str.5 = [33 x i8] c"What is the radius of the circle\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 ([20 x i8], [20 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 = mul nsw i32 %7, 3
%9 = add nsw i32 %8, 1
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.5, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = fmul double %13, 3.140000e+00
%15 = fmul double %14, %13
%16 = fptrunc double %15 to float
%17 = fmul float %12, 0x40191EB860000000
%18 = fpext float %16 to double
%19 = fpext float %17 to double
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i32 %9, double %18, double %19)
ret i32 0
}