#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 *, ...);
double sqrt(double);
int main(void) {
  int inside, outside;
  double r, x, y;
  printf("Please input coordinates for (x,y): ");
  scanf("%lf %lf", &x, &y);
  printf("Please input radius: ");
  scanf("%lf", &r);
  if (r == sqrt(x * x + y * y)) {
    printf("The coordinate (%.2lf,%.2lf) is ON the circle defined by radius: "
           "%.2lf",
           x, y, r);
  } else if (r > sqrt(x * x + y * y)) {
    printf("The coordinate (%.2lf,%.2lf) is INSIDE the circle defined by "
           "radius: %.2lf",
           x, y, r);
  } else {
    printf("The coordinate (%.2lf,%.2lf) is OUTSIDE the circle defined by "
           "radius: %.2lf\n",
           x, y, r);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    11e8 <main+0xb8>
jp     11e8 <main+0xb8>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    0xe67(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
jmp    1269 <main+0x139>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1247 <main+0x117>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    0xe4f(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
jmp    1264 <main+0x134>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    0xe78(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
jmp    1269 <main+0x139>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
lea    0x18(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x18(%rsp),%xmm2
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11a9 <main+0x79>
sqrtsd %xmm0,%xmm0
jmp    11ba <main+0x8a>
movsd  %xmm2,0x20(%rsp)
call   1050 <sqrt@plt>
movsd  0x20(%rsp),%xmm2
ucomisd %xmm0,%xmm2
jne    11dd <main+0xad>
jp     11dd <main+0xad>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
lea    0xe68(%rip),%rdi
jmp    1244 <main+0x114>
movsd  0x18(%rsp),%xmm2
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     120b <main+0xdb>
sqrtsd %xmm0,%xmm0
jmp    121c <main+0xec>
movsd  %xmm2,0x20(%rsp)
call   1050 <sqrt@plt>
movsd  0x20(%rsp),%xmm2
ucomisd %xmm0,%xmm2
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
jbe    123d <main+0x10d>
lea    0xe4f(%rip),%rdi
jmp    1244 <main+0x114>
lea    0xe91(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Please input coordinates for (x,y): \00"
@.str.1 = [8 x i8] c"%lf %lf\00"
@.str.2 = [22 x i8] c"Please input radius: \00"
@.str.3 = [4 x i8] c"%lf\00"
@.str.4 = [71 x i8] c"The coordinate (%.2lf,%.2lf) is ON the circle defined by radius: %.2lf\00"
@.str.5 = [75 x i8] c"The coordinate (%.2lf,%.2lf) is INSIDE the circle defined by radius: %.2lf\00"
@.str.6 = [77 x i8] c"The coordinate (%.2lf,%.2lf) is OUTSIDE the circle defined by radius: %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %5, double* %6)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %4)
%11 = load double, double* %4
%12 = load double, double* %5
%13 = load double, double* %5
%14 = load double, double* %6
%15 = load double, double* %6
%16 = fmul double %14, %15
%17 = call double @llvm.fmuladd.f64(double %12, double %13, double %16)
%18 = call double @sqrt(double %17)
%19 = fcmp oeq double %11, %18
br i1 %19, label %20, label %25
20: ; preds = %0
%21 = load double, double* %5
%22 = load double, double* %6
%23 = load double, double* %4
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.4, i64 0, i64 0), double %21, double %22, double %23)
br label %46
25: ; preds = %0
%26 = load double, double* %4
%27 = load double, double* %5
%28 = load double, double* %5
%29 = load double, double* %6
%30 = load double, double* %6
%31 = fmul double %29, %30
%32 = call double @llvm.fmuladd.f64(double %27, double %28, double %31)
%33 = call double @sqrt(double %32)
%34 = fcmp ogt double %26, %33
br i1 %34, label %35, label %40
35: ; preds = %25
%36 = load double, double* %5
%37 = load double, double* %6
%38 = load double, double* %4
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.5, i64 0, i64 0), double %36, double %37, double %38)
br label %45
40: ; preds = %25
%41 = load double, double* %5
%42 = load double, double* %6
%43 = load double, double* %4
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.6, i64 0, i64 0), double %41, double %42, double %43)
br label %45
45: ; preds = %40, %35
br label %46
46: ; preds = %45, %20
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Please input coordinates for (x,y): \00"
@.str.1 = [8 x i8] c"%lf %lf\00"
@.str.2 = [22 x i8] c"Please input radius: \00"
@.str.3 = [4 x i8] c"%lf\00"
@.str.4 = [71 x i8] c"The coordinate (%.2lf,%.2lf) is ON the circle defined by radius: %.2lf\00"
@.str.5 = [75 x i8] c"The coordinate (%.2lf,%.2lf) is INSIDE the circle defined by radius: %.2lf\00"
@.str.6 = [77 x i8] c"The coordinate (%.2lf,%.2lf) is OUTSIDE the circle defined by radius: %.2lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %1)
%11 = load double, double* %1
%12 = load double, double* %2
%13 = load double, double* %3
%14 = fmul double %13, %13
%15 = call double @llvm.fmuladd.f64(double %12, double %12, double %14)
%16 = call double @sqrt(double %15)
%17 = fcmp oeq double %11, %16
br i1 %17, label %18, label %23
18: ; preds = %0
%19 = load double, double* %2
%20 = load double, double* %3
%21 = load double, double* %1
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str.4, i64 0, i64 0), double %19, double %20, double %21)
br label %38
23: ; preds = %0
%24 = load double, double* %1
%25 = load double, double* %2
%26 = load double, double* %3
%27 = fmul double %26, %26
%28 = call double @llvm.fmuladd.f64(double %25, double %25, double %27)
%29 = call double @sqrt(double %28)
%30 = fcmp ogt double %24, %29
%31 = load double, double* %2
%32 = load double, double* %3
%33 = load double, double* %1
br i1 %30, label %34, label %36
34: ; preds = %23
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @.str.5, i64 0, i64 0), double %31, double %32, double %33)
br label %38
36: ; preds = %23
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.6, i64 0, i64 0), double %31, double %32, double %33)
br label %38
38: ; preds = %34, %36, %18
ret i32 0
}