#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, unsigned int *);
unsigned int sqrt(int);
int /*<<< orphan*/ stdin;
int main(void) {
  const double g = 9.80655;
  unsigned int h;
  printf("In welcher Hoehe verlaesst der Fallschirmspringer den Flieger (in "
         "Meter): ");
  scanf("%u", &h);
  unsigned int t = sqrt(2 * (h - 650) / g);
  printf("---> Der Springer muss nach %u Sekunden die Reissleine ziehen", t);
  fflush(stdin);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x40239cf41f212d77,%rax
9c 23 40
mov    %rax,-0x10(%rbp)
lea    0xe94(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x14(%rbp),%ecx
mov    %ecx,%eax
lea    -0x514(%rax,%rax,1),%eax
cvtsi2sd %rax,%xmm0
movsd  0xe5c(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1070 <sqrt@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e1c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
add    %eax,%eax
add    $0xfffffaec,%eax
cvtsi2sd %rax,%xmm0
divsd  0xe78(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1070 <sqrt@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [75 x i8] c"In welcher Hoehe verlaesst der Fallschirmspringer den Flieger (in Meter): \00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [62 x i8] c"---> Der Springer muss nach %u Sekunden die Reissleine ziehen\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store double 0x40239CF41F212D77, double* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 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), i32* %3)
%7 = load i32, i32* %3
%8 = sub i32 %7, 650
%9 = mul i32 2, %8
%10 = uitofp i32 %9 to double
%11 = fdiv double %10, 0x40239CF41F212D77
%12 = fptosi double %11 to i32
%13 = call i32 @sqrt(i32 %12)
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = load i32, i32* @stdin
%17 = call i32 @fflush(i32 %16)
%18 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [75 x i8] c"In welcher Hoehe verlaesst der Fallschirmspringer den Flieger (in Meter): \00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [62 x i8] c"---> Der Springer muss nach %u Sekunden die Reissleine ziehen\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = shl i32 %5, 1
%7 = add i32 %6, -1300
%8 = uitofp i32 %7 to double
%9 = fdiv double %8, 0x40239CF41F212D77
%10 = fptosi double %9 to i32
%11 = call i32 @sqrt(i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @stdin
%14 = call i32 @fflush(i32 %13)
%15 = call i32 (...) @getchar()
ret i32 0
}