#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 *, double *);
int main(void) {
  double r, x, y;
  printf("Indtast radius, x og y\n");
  (void)scanf("%lf %lf %lf", &r, &x, &y);
  if (x * x + y * y < r * r) {
    printf("Punktet (%f, %f) er i cirklen med r = %f og centrum i (0, 0)\n", x,
           y, r);
  } else if (x * x + y * y == r * r)
    printf("Punktet (%f, %f) er på periferien af cirklen med r = %f og centrum "
           "i (0, 0)\n",
           x, y, r);
  else {
    printf(
        "Punktet (%f, %f) er ikke i cirklen med r = %f og centrum i (0, 0)\n",
        x, y, r);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11a7 <main+0x87>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
lea    0xe89(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
jmp    1221 <main+0x101>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    11ff <main+0xdf>
jp     11ff <main+0xdf>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
lea    0xe6f(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
jmp    121c <main+0xfc>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
lea    0xe9b(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
jmp    1221 <main+0x101>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xfa0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
call   1050 <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  0x10(%rsp),%xmm2
movapd %xmm2,%xmm4
mulsd  %xmm2,%xmm4
ucomisd %xmm4,%xmm3
lea    0xf07(%rip),%rax
lea    0xeb2(%rip),%rcx
cmovne %rax,%rcx
cmovp  %rax,%rcx
ucomisd %xmm3,%xmm4
lea    0xe61(%rip),%rdi
cmovbe %rcx,%rdi
mov    $0x3,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Indtast radius, x og y\0A\00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [62 x i8] c"Punktet (%f, %f) er i cirklen med r = %f og centrum i (0, 0)\0A\00"
@.str.3 = [78 x i8] c"Punktet (%f, %f) er p\C3\A5 periferien af cirklen med r = %f og centrum i (0, 0)\0A\00"
@.str.4 = [67 x i8] c"Punktet (%f, %f) er ikke i cirklen med r = %f og centrum i (0, 0)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3, double* %4)
%7 = load double, double* %3
%8 = load double, double* %3
%9 = load double, double* %4
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
%13 = load double, double* %2
%14 = load double, double* %2
%15 = fmul double %13, %14
%16 = fcmp olt double %12, %15
br i1 %16, label %17, label %22
17: ; preds = %0
%18 = load double, double* %3
%19 = load double, double* %4
%20 = load double, double* %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), double %18, double %19, double %20)
br label %44
22: ; preds = %0
%23 = load double, double* %3
%24 = load double, double* %3
%25 = load double, double* %4
%26 = load double, double* %4
%27 = fmul double %25, %26
%28 = call double @llvm.fmuladd.f64(double %23, double %24, double %27)
%29 = load double, double* %2
%30 = load double, double* %2
%31 = fmul double %29, %30
%32 = fcmp oeq double %28, %31
br i1 %32, label %33, label %38
33: ; preds = %22
%34 = load double, double* %3
%35 = load double, double* %4
%36 = load double, double* %2
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.3, i64 0, i64 0), double %34, double %35, double %36)
br label %43
38: ; preds = %22
%39 = load double, double* %3
%40 = load double, double* %4
%41 = load double, double* %2
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.4, i64 0, i64 0), double %39, double %40, double %41)
br label %43
43: ; preds = %38, %33
br label %44
44: ; preds = %43, %17
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [62 x i8] c"Punktet (%f, %f) er i cirklen med r = %f og centrum i (0, 0)\0A\00"
@.str.3 = [78 x i8] c"Punktet (%f, %f) er p\C3\A5 periferien af cirklen med r = %f og centrum i (0, 0)\0A\00"
@.str.4 = [67 x i8] c"Punktet (%f, %f) er ikke i cirklen med r = %f og centrum i (0, 0)\0A\00"
@str = [23 x i8] c"Indtast radius, x og y\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 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3)
%9 = load double, double* %2
%10 = load double, double* %3
%11 = fmul double %10, %10
%12 = call double @llvm.fmuladd.f64(double %9, double %9, double %11)
%13 = load double, double* %1
%14 = fmul double %13, %13
%15 = fcmp olt double %12, %14
%16 = fcmp oeq double %12, %14
%17 = select i1 %16, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.4, i64 0, i64 0)
%18 = select i1 %15, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), i8* %17
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %18, double %9, double %10, double %13)
ret i32 0
}