#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 *, double *);
int /*<<< orphan*/ stdin;
int main(void) {
  double distance, timeins, mps;
  printf("Gib die Strecke ein (in Meter): ");
  scanf("%lf", &distance);
  printf("Gib die Zeit ein, die dafür benötigt wird (in Sekunden): ");
  scanf("%lf", &timeins);
  mps = distance / timeins;
  printf("Das entspricht folgender Geschwindigkeit:\n");
  printf("  %lf m/sec =\n", mps);
  printf("    %lf km/h =\n", mps * 3.6);
  printf("      %lf m/d =\n", mps * 3.6 * 24 * 1000);
  printf("        %lf km/d", mps * 3.6 * 24);
  fflush(stdin);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xef0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xe45(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
lea    0xee4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xe2a(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe15(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe19(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xec1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xdf7(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xde2(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xeab(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2db1(%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   %rbx
sub    $0x20,%rsp
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecf(%rip),%rbx
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
movsd  0x18(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
lea    0xec2(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0xe2e(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xea9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0xe14(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xe0e(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xe8b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe8e(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x2db9(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Gib die Strecke ein (in Meter): \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [60 x i8] c"Gib die Zeit ein, die daf\C3\BCr ben\C3\B6tigt wird (in Sekunden): \00"
@.str.3 = [43 x i8] c"Das entspricht folgender Geschwindigkeit:\0A\00"
@.str.4 = [15 x i8] c" %lf m/sec =\0A\00"
@.str.5 = [16 x i8] c" %lf km/h =\0A\00"
@.str.6 = [17 x i8] c" %lf m/d =\0A\00"
@.str.7 = [17 x i8] c" %lf km/d\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 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* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%9 = load double, double* %2
%10 = load double, double* %3
%11 = fdiv double %9, %10
store double %11, double* %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%13 = load double, double* %4
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %13)
%15 = load double, double* %4
%16 = fmul double %15, 3.600000e+00
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), double %16)
%18 = load double, double* %4
%19 = fmul double %18, 3.600000e+00
%20 = fmul double %19, 2.400000e+01
%21 = fmul double %20, 1.000000e+03
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), double %21)
%23 = load double, double* %4
%24 = fmul double %23, 3.600000e+00
%25 = fmul double %24, 2.400000e+01
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), double %25)
%27 = load i32, i32* @stdin
%28 = call i32 @fflush(i32 %27)
%29 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Gib die Strecke ein (in Meter): \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [60 x i8] c"Gib die Zeit ein, die daf\C3\BCr ben\C3\B6tigt wird (in Sekunden): \00"
@.str.4 = [15 x i8] c" %lf m/sec =\0A\00"
@.str.5 = [16 x i8] c" %lf km/h =\0A\00"
@.str.6 = [17 x i8] c" %lf m/d =\0A\00"
@.str.7 = [17 x i8] c" %lf km/d\00"
@stdin = global i32 0
@str = [42 x i8] c"Das entspricht folgender Geschwindigkeit:\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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, 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 = fdiv double %9, %10
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %11)
%14 = fmul double %11, 3.600000e+00
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), double %14)
%16 = fmul double %14, 2.400000e+01
%17 = fmul double %16, 1.000000e+03
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), double %17)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), double %16)
%20 = load i32, i32* @stdin
%21 = call i32 @fflush(i32 %20)
%22 = call i32 (...) @getchar()
ret i32 0
}