#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 *, double *);
int main() {
  double pointX, pointY;
  printf("Please enter X coordinate: ");
  scanf("%lf", &pointX);
  printf("Please enter Y coordinate: ");
  scanf("%lf", &pointY);
  double centerX = 0, centerY = 0, radius = 2;
  int isInCircle = ((pointX - centerX) * (pointX - centerX) +
                    (pointY - centerY) * (pointY - centerY)) <= radius * radius;
  printf("Is point (%f,%f) in circle? -> %s\n", pointX, pointY,
         isInCircle ? "Yes" : "No");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe7d(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm3
subsd  -0x28(%rbp),%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x34(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x34(%rbp),%ecx
lea    0xe82(%rip),%rsi
lea    0xe77(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe46(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeea(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xeda(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
movsd  0xe79(%rip),%xmm2
ucomisd %xmm3,%xmm2
lea    0xed5(%rip),%rax
lea    0xed2(%rip),%rsi
cmovae %rax,%rsi
lea    0xea0(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Please enter X coordinate: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [28 x i8] c"Please enter Y coordinate: \00"
@.str.3 = [35 x i8] c"Is point (%f,%f) in circle? -> %s\0A\00"
@.str.4 = [4 x i8] c"Yes\00"
@.str.5 = [3 x i8] c"No\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
store double 0.000000e+00, double* %4
store double 0.000000e+00, double* %5
store double 2.000000e+00, double* %6
%12 = load double, double* %2
%13 = load double, double* %4
%14 = fsub double %12, %13
%15 = load double, double* %2
%16 = load double, double* %4
%17 = fsub double %15, %16
%18 = load double, double* %3
%19 = load double, double* %5
%20 = fsub double %18, %19
%21 = load double, double* %3
%22 = load double, double* %5
%23 = fsub double %21, %22
%24 = fmul double %20, %23
%25 = call double @llvm.fmuladd.f64(double %14, double %17, double %24)
%26 = load double, double* %6
%27 = load double, double* %6
%28 = fmul double %26, %27
%29 = fcmp ole double %25, %28
%30 = zext i1 %29 to i32
store i32 %30, i32* %7
%31 = load double, double* %2
%32 = load double, double* %3
%33 = load i32, i32* %7
%34 = icmp ne i32 %33, 0
%35 = zext i1 %34 to i64
%36 = select i1 %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), double %31, double %32, i8* %36)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Please enter X coordinate: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [28 x i8] c"Please enter Y coordinate: \00"
@.str.3 = [35 x i8] c"Is point (%f,%f) in circle? -> %s\0A\00"
@.str.4 = [4 x i8] c"Yes\00"
@.str.5 = [3 x i8] c"No\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%9 = load double, double* %1
%10 = load double, double* %2
%11 = fmul double %10, %10
%12 = call double @llvm.fmuladd.f64(double %9, double %9, double %11)
%13 = fcmp ole double %12, 4.000000e+00
%14 = select i1 %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), double %9, double %10, i8* %14)
ret i32 0
}