#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) {
  double r, x, y, hypotenusen;
  printf("Bestem radius paa din cirkel: \n");
  scanf("%lf", &r);
  printf("Bestem dine koordinater x og y: \n");
  scanf("%lf %lf", &x, &y);
  hypotenusen = sqrt((x * x) + (y * y));
  if (hypotenusen <= r)
    printf("Punktet befinder sig inden i eller paa cirklen\n");
  else
    printf("Punktet befinder sig udenfor cirklen\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     11ca <main+0x9a>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
jmp    11d6 <main+0xa6>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xebd(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9a(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     119c <main+0x6c>
sqrtsd %xmm0,%xmm0
jmp    11a1 <main+0x71>
call   1050 <sqrt@plt>
movsd  0x10(%rsp),%xmm1
ucomisd %xmm0,%xmm1
lea    0xe96(%rip),%rax
lea    0xeb4(%rip),%rdi
cmovb  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Bestem radius paa din cirkel: \0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [34 x i8] c"Bestem dine koordinater x og y: \0A\00"
@.str.3 = [8 x i8] c"%lf %lf\00"
@.str.4 = [48 x i8] c"Punktet befinder sig inden i eller paa cirklen\0A\00"
@.str.5 = [38 x i8] c"Punktet befinder sig udenfor cirklen\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double* %3, double* %4)
%10 = load double, double* %3
%11 = load double, double* %3
%12 = load double, double* %4
%13 = load double, double* %4
%14 = fmul double %12, %13
%15 = call double @llvm.fmuladd.f64(double %10, double %11, double %14)
%16 = call double @sqrt(double %15)
store double %16, double* %5
%17 = load double, double* %5
%18 = load double, double* %2
%19 = fcmp ole double %17, %18
br i1 %19, label %20, label %22
20: ; preds = %0
%21 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
br label %24
22: ; preds = %0
%23 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
br label %24
24: ; preds = %22, %20
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@.str.3 = [8 x i8] c"%lf %lf\00"
@str = [31 x i8] c"Bestem radius paa din cirkel: \00"
@str.6 = [33 x i8] c"Bestem dine koordinater x og y: \00"
@str.7 = [37 x i8] c"Punktet befinder sig udenfor cirklen\00"
@str.8 = [47 x i8] c"Punktet befinder sig inden i eller paa cirklen\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 ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%8 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.6, i64 0, i64 0))
%10 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double* %2, double* %3)
%11 = load double, double* %2
%12 = load double, double* %3
%13 = fmul double %12, %12
%14 = call double @llvm.fmuladd.f64(double %11, double %11, double %13)
%15 = call double @sqrt(double %14)
%16 = load double, double* %1
%17 = fcmp ugt double %15, %16
%18 = select i1 %17, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @str.7, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @str.8, i64 0, i64 0)
%19 = call i32 @puts(i8* dereferenceable(1) %18)
ret i32 0
}