#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 */
double _sqrt(double, double);
double fabs(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
double sqrt(double);
int main() {
  double x;
  double t;
  printf("Geben Sie x ein\n");
  scanf("%lf", &x);
  printf("Geben Sie t ein\n");
  scanf("%lf", &t);
  double output = _sqrt(x, t);
  printf("Approx %f\n", output);
  printf("Genau %f\n", sqrt(x));
  printf("Fehler: %f", fabs(output - sqrt(x)));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea6(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <_sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe92(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x8(%rbp),%xmm0
call   1060 <sqrt@plt>
lea    0xe85(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movaps 0xe16(%rip),%xmm1
pand   %xmm1,%xmm0
lea    0xe56(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <_sqrt@plt>
lea    0xe79(%rip),%rdi
movaps %xmm0,0x10(%rsp)
mov    $0x1,%al
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11c4 <main+0x74>
sqrtsd %xmm0,%xmm0
jmp    11c9 <main+0x79>
call   1070 <sqrt@plt>
lea    0xe57(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
ucomisd 0xe2c(%rip),%xmm0
jb     11ec <main+0x9c>
sqrtsd %xmm0,%xmm0
jmp    11f1 <main+0xa1>
call   1070 <sqrt@plt>
movapd 0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
andpd  0xdfd(%rip),%xmm1
lea    0xe27(%rip),%rdi
movapd %xmm1,%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Geben Sie x ein\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [17 x i8] c"Geben Sie t ein\0A\00"
@.str.3 = [11 x i8] c"Approx %f\0A\00"
@.str.4 = [10 x i8] c"Genau %f\0A\00"
@.str.5 = [11 x i8] c"Fehler: %f\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%8 = load double, double* %1
%9 = load double, double* %2
%10 = call double @_sqrt(double %8, double %9)
store double %10, double* %3
%11 = load double, double* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %11)
%13 = load double, double* %1
%14 = call double @sqrt(double %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), double %14)
%16 = load double, double* %3
%17 = load double, double* %1
%18 = call double @sqrt(double %17)
%19 = fsub double %16, %18
%20 = call double @llvm.fabs.f64(double %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), double %20)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@.str.3 = [11 x i8] c"Approx %f\0A\00"
@.str.4 = [10 x i8] c"Genau %f\0A\00"
@.str.5 = [11 x i8] c"Fehler: %f\00"
@str = [16 x i8] c"Geben Sie x ein\00"
@str.6 = [16 x i8] c"Geben Sie t ein\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 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 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 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.6, 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 = call double @_sqrt(double %9, double %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %11)
%13 = load double, double* %1
%14 = call double @sqrt(double %13)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), double %14)
%16 = load double, double* %1
%17 = call double @sqrt(double %16)
%18 = fsub double %11, %17
%19 = call double @llvm.fabs.f64(double %18)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), double %19)
ret i32 0
}