#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 *, float *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
double sqrt(float);
int /*<<< orphan*/ stdout;
int main(void) {
  setbuf(stdout, NULL);
  float f = 0;
  printf("***Quadratwurzelrechner***\n\nBitte Geben Sie eine Zahl ein: ");
  scanf("%f", &f);
  (f > 0) ? printf("\nDie Quadratwurzel aus %f ist %f", f, sqrt(f))
          : printf("Bitte gib eine positive Zahl ein.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    11cb <main+0x8b>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
lea    0xe7d(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    11d9 <main+0x99>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <setbuf@plt>
movl   $0x0,0xc(%rsp)
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee9(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    11b4 <main+0x74>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
lea    0xe97(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x2,%al
call   1040 <printf@plt>
jmp    11c2 <main+0x82>
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [60 x i8] c"***Quadratwurzelrechner***\0A\0ABitte Geben Sie eine Zahl ein: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [33 x i8] c"\0ADie Quadratwurzel aus %f ist %f\00"
@.str.3 = [34 x i8] c"Bitte gib eine positive Zahl ein.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = load i32, i32* @stdout
%4 = call i32 @setbuf(i32 %3, i32* null)
store float 0.000000e+00, float* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%7 = load float, float* %2
%8 = fcmp ogt float %7, 0.000000e+00
br i1 %8, label %9, label %15
9: ; preds = %0
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = load float, float* %2
%13 = call double @sqrt(float %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), double %11, double %13)
br label %17
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %9
%18 = phi i32 [ %14, %9 ], [ %16, %15 ]
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [60 x i8] c"***Quadratwurzelrechner***\0A\0ABitte Geben Sie eine Zahl ein: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [33 x i8] c"\0ADie Quadratwurzel aus %f ist %f\00"
@.str.3 = [34 x i8] c"Bitte gib eine positive Zahl ein.\00"
define i32 @main() {
%1 = alloca float
%2 = load i32, i32* @stdout
%3 = tail call i32 @setbuf(i32 %2, i32* null)
%4 = bitcast float* %1 to i8*
store float 0.000000e+00, float* %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%7 = load float, float* %1
%8 = fcmp ogt float %7, 0.000000e+00
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = fpext float %7 to double
%11 = call double @sqrt(float %7)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), double %10, double %11)
br label %15
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %13, %9
ret i32 0
}