#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 atoi(char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
double kreis_flaeche(int);
int /*<<< orphan*/ printf(char *, int, double);
int /*<<< orphan*/ puts(char *);
double quadrat(int);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
double wurzel(int);
int main(int argc, char *argv[]) {
  char puffer[32];
  int eingabe;
  double ergebnis;
  puts("Bitte geben Sie eine Zahl ein: ");
  fflush(stdout);
  fgets(puffer, 32, stdin);
  eingabe = atoi(puffer);
  ergebnis = wurzel(eingabe);
  printf("Die Quadratwurzel der Zahl %d ist %f\n", eingabe, ergebnis);
  ergebnis = quadrat(eingabe);
  printf("Das Quadrat der Zahl %d ist %f\n", eingabe, ergebnis);
  puts("| Radius | Kreisfläche");
  for (int i = 1; i < 21; i++) {
    double f = kreis_flaeche(i);
    printf("| %d \t | %f \n", i, f);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe63(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
lea    -0x30(%rbp),%rdi
mov    0x2e2d(%rip),%rax
mov    (%rax),%edx
mov    $0x20,%esi
call   1070 <fgets@plt>
lea    -0x30(%rbp),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%edi
call   1060 <wurzel@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x34(%rbp),%esi
movsd  -0x40(%rbp),%xmm0
lea    0xe31(%rip),%rdi
call   1040 <printf@plt>
mov    -0x34(%rbp),%edi
call   1050 <quadrat@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x34(%rbp),%esi
movsd  -0x40(%rbp),%xmm0
lea    0xe36(%rip),%rdi
call   1040 <printf@plt>
lea    0xe4a(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x44(%rbp)
cmpl   $0x15,-0x44(%rbp)
jge    1261 <main+0xe1>
mov    -0x44(%rbp),%edi
call   1090 <kreis_flaeche@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x44(%rbp),%esi
movsd  -0x50(%rbp),%xmm0
lea    0xe30(%rip),%rdi
call   1040 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1228 <main+0xa8>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xe74(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   10a0 <atoi@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1060 <wurzel@plt>
lea    0xe50(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    %ebx,%edi
call   1050 <quadrat@plt>
lea    0xe61(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
lea    0xe73(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1090 <kreis_flaeche@plt>
lea    0xe75(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <printf@plt>
mov    $0x4,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
mov    $0x6,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <printf@plt>
mov    $0x7,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <printf@plt>
mov    $0x8,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
mov    $0x9,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
mov    $0xb,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <printf@plt>
mov    $0xc,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1040 <printf@plt>
mov    $0xd,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1040 <printf@plt>
mov    $0xe,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
call   1040 <printf@plt>
mov    $0xf,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
call   1040 <printf@plt>
mov    $0x10,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <printf@plt>
mov    $0x11,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
call   1040 <printf@plt>
mov    $0x12,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0x12,%esi
call   1040 <printf@plt>
mov    $0x13,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
call   1040 <printf@plt>
mov    $0x14,%edi
call   1090 <kreis_flaeche@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Bitte geben Sie eine Zahl ein: \00"
@stdout = global i32 0
@stdin = global i32 0
@.str.1 = [38 x i8] c"Die Quadratwurzel der Zahl %d ist %f\0A\00"
@.str.2 = [32 x i8] c"Das Quadrat der Zahl %d ist %f\0A\00"
@.str.3 = [24 x i8] c"| Radius | Kreisfl\C3\A4che\00"
@.str.4 = [14 x i8] c"| %d \09 | %f \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [32 x i8]
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
%10 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 @puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @stdout
%13 = call i32 @fflush(i32 %12)
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%15 = load i32, i32* @stdin
%16 = call i32 @fgets(i8* %14, i32 32, i32 %15)
%17 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%18 = call i32 @atoi(i8* %17)
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = call double @wurzel(i32 %19)
store double %20, double* %8
%21 = load i32, i32* %7
%22 = load double, double* %8
%23 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %21, double %22)
%24 = load i32, i32* %7
%25 = call double @quadrat(i32 %24)
store double %25, double* %8
%26 = load i32, i32* %7
%27 = load double, double* %8
%28 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %26, double %27)
%29 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %9
br label %30
30: ; preds = %39, %2
%31 = load i32, i32* %9
%32 = icmp slt i32 %31, 21
br i1 %32, label %33, label %42
33: ; preds = %30
%34 = load i32, i32* %9
%35 = call double @kreis_flaeche(i32 %34)
store double %35, double* %10
%36 = load i32, i32* %9
%37 = load double, double* %10
%38 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %36, double %37)
br label %39
39: ; preds = %33
%40 = load i32, i32* %9
%41 = add nsw i32 %40, 1
store i32 %41, i32* %9
br label %30
42: ; preds = %30
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Bitte geben Sie eine Zahl ein: \00"
@stdout = global i32 0
@stdin = global i32 0
@.str.1 = [38 x i8] c"Die Quadratwurzel der Zahl %d ist %f\0A\00"
@.str.2 = [32 x i8] c"Das Quadrat der Zahl %d ist %f\0A\00"
@.str.3 = [24 x i8] c"| Radius | Kreisfl\C3\A4che\00"
@.str.4 = [14 x i8] c"| %d \09 | %f \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %4, i32 32, i32 %8)
%10 = call i32 @atoi(i8* %4)
%11 = call double @wurzel(i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %10, double %11)
%13 = call double @quadrat(i32 %10)
%14 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %10, double %13)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%16 = call double @kreis_flaeche(i32 1)
%17 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 1, double %16)
%18 = call double @kreis_flaeche(i32 2)
%19 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 2, double %18)
%20 = call double @kreis_flaeche(i32 3)
%21 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 3, double %20)
%22 = call double @kreis_flaeche(i32 4)
%23 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 4, double %22)
%24 = call double @kreis_flaeche(i32 5)
%25 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 5, double %24)
%26 = call double @kreis_flaeche(i32 6)
%27 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 6, double %26)
%28 = call double @kreis_flaeche(i32 7)
%29 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 7, double %28)
%30 = call double @kreis_flaeche(i32 8)
%31 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 8, double %30)
%32 = call double @kreis_flaeche(i32 9)
%33 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 9, double %32)
%34 = call double @kreis_flaeche(i32 10)
%35 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 10, double %34)
%36 = call double @kreis_flaeche(i32 11)
%37 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 11, double %36)
%38 = call double @kreis_flaeche(i32 12)
%39 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 12, double %38)
%40 = call double @kreis_flaeche(i32 13)
%41 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 13, double %40)
%42 = call double @kreis_flaeche(i32 14)
%43 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 14, double %42)
%44 = call double @kreis_flaeche(i32 15)
%45 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 15, double %44)
%46 = call double @kreis_flaeche(i32 16)
%47 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 16, double %46)
%48 = call double @kreis_flaeche(i32 17)
%49 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 17, double %48)
%50 = call double @kreis_flaeche(i32 18)
%51 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 18, double %50)
%52 = call double @kreis_flaeche(i32 19)
%53 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 19, double %52)
%54 = call double @kreis_flaeche(i32 20)
%55 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 20, double %54)
ret i32 0
}