#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) {
  const double kmhtomps = 1000.0 / 3600;
  double hours, minutes, way, consumption, totaltime;
  printf("Gefahrene Stunden: ");
  scanf("%lf", &hours);
  printf("Gefahrene Minuten: ");
  scanf("%lf", &minutes);
  totaltime = hours + minutes / 60;
  printf("Gefahrene Kilometer: ");
  scanf("%lf", &way);
  printf("Gebrauchte Liter: ");
  scanf("%lf", &consumption);
  printf("   Durchschnittl. Geschwindigkeit: %.2lf km/h (%.2lf m/s)\n",
         way / totaltime, way / totaltime * kmhtomps);
  printf("   Durchschnittl. Benzinverbrauch: %.2lf l/100 km",
         consumption / way * 100);
  fflush(stdin);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1060 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xe66(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe60(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe42(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <scanf@plt>
movsd  -0x28(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
divsd  -0x38(%rbp),%xmm1
movsd  0xdf9(%rip),%xmm2
mulsd  %xmm2,%xmm1
lea    0xe53(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  0xdcd(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xe6a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2d9c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed2(%rip),%rbx
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movsd  0x20(%rsp),%xmm0
divsd  0xe70(%rip),%xmm0
addsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0xea1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movsd  0x8(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
movsd  0xe22(%rip),%xmm1
mulsd  %xmm0,%xmm1
lea    0xe7c(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  0x18(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
mulsd  0xe04(%rip),%xmm0
lea    0xe95(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2dc7(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Gefahrene Stunden: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [20 x i8] c"Gefahrene Minuten: \00"
@.str.3 = [22 x i8] c"Gefahrene Kilometer: \00"
@.str.4 = [19 x i8] c"Gebrauchte Liter: \00"
@.str.5 = [59 x i8] c" Durchschnittl. Geschwindigkeit: %.2lf km/h (%.2lf m/s)\0A\00"
@.str.6 = [50 x i8] c" Durchschnittl. Benzinverbrauch: %.2lf l/100 km\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 0, i32* %1
store double 0x3FD1C71C71C71C72, double* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%12 = load double, double* %3
%13 = load double, double* %4
%14 = fdiv double %13, 6.000000e+01
%15 = fadd double %12, %14
store double %15, double* %7
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %5)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %6)
%20 = load double, double* %5
%21 = load double, double* %7
%22 = fdiv double %20, %21
%23 = load double, double* %5
%24 = load double, double* %7
%25 = fdiv double %23, %24
%26 = fmul double %25, 0x3FD1C71C71C71C72
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0), double %22, double %26)
%28 = load double, double* %6
%29 = load double, double* %5
%30 = fdiv double %28, %29
%31 = fmul double %30, 1.000000e+02
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0), double %31)
%33 = load i32, i32* @stdin
%34 = call i32 @fflush(i32 %33)
%35 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Gefahrene Stunden: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [20 x i8] c"Gefahrene Minuten: \00"
@.str.3 = [22 x i8] c"Gefahrene Kilometer: \00"
@.str.4 = [19 x i8] c"Gebrauchte Liter: \00"
@.str.5 = [59 x i8] c" Durchschnittl. Geschwindigkeit: %.2lf km/h (%.2lf m/s)\0A\00"
@.str.6 = [50 x i8] c" Durchschnittl. Benzinverbrauch: %.2lf l/100 km\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %1 to i8*
%6 = bitcast double* %2 to i8*
%7 = bitcast double* %3 to i8*
%8 = bitcast double* %4 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%13 = load double, double* %1
%14 = load double, double* %2
%15 = fdiv double %14, 6.000000e+01
%16 = fadd double %13, %15
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%21 = load double, double* %3
%22 = fdiv double %21, %16
%23 = fmul double %22, 0x3FD1C71C71C71C72
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0), double %22, double %23)
%25 = load double, double* %4
%26 = load double, double* %3
%27 = fdiv double %25, %26
%28 = fmul double %27, 1.000000e+02
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0), double %28)
%30 = load i32, i32* @stdin
%31 = call i32 @fflush(i32 %30)
%32 = call i32 (...) @getchar()
ret i32 0
}