#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 *);
main() {
  float speed, distance, time;
  char beep;
  beep = '\a';
  printf("    ACME Software Development Company\n");
  printf("Road Runner Apprehension Probability Calculator\n");
  printf("\n");
  printf("Distance in meters to the Road Runner: ");
  scanf("%f", &distance);
  printf("Maximum speed in km/h of your Foyt-Coyote engine: ");
  scanf("%f", &speed);
  speed = 1000.0 * speed / 3600.0;
  time = distance / speed;
  printf("Time to reach Road Runner's position is %.2f seconds.\n", time);
  printf("... but he'll be gone!!! %c%c\n", beep, beep);
  printf("Probability of having Road Runner Stew is %d%%.\n", 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x7,-0xd(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xffc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf25(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf18(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf07(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe65(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe51(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
divss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeeb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsbl -0xd(%rbp),%esi
movsbl -0xd(%rbp),%edx
lea    0xf0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1d(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xfa9(%rip),%rdi
call   1040 <puts@plt>
lea    0xfc3(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xebc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe4a(%rip),%xmm0
divsd  0xe4a(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xc(%rsp),%xmm1
divss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe8e(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x7,%esi
mov    $0x7,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xebe(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c" ACME Software Development Company\0A\00"
@.str.1 = [49 x i8] c"Road Runner Apprehension Probability Calculator\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [40 x i8] c"Distance in meters to the Road Runner: \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [51 x i8] c"Maximum speed in km/h of your Foyt-Coyote engine: \00"
@.str.6 = [55 x i8] c"Time to reach Road Runner's position is %.2f seconds.\0A\00"
@.str.7 = [31 x i8] c"... but he'll be gone!!! %c%c\0A\00"
@.str.8 = [49 x i8] c"Probability of having Road Runner Stew is %d%%.\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca i8
store i8 7, i8* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %1)
%12 = load float, float* %1
%13 = fpext float %12 to double
%14 = fmul double 1.000000e+03, %13
%15 = fdiv double %14, 3.600000e+03
%16 = fptrunc double %15 to float
store float %16, float* %1
%17 = load float, float* %2
%18 = load float, float* %1
%19 = fdiv float %17, %18
store float %19, float* %3
%20 = load float, float* %3
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0), double %21)
%23 = load i8, i8* %4
%24 = sext i8 %23 to i32
%25 = load i8, i8* %4
%26 = sext i8 %25 to i32
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i32 %24, i32 %26)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0), i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [40 x i8] c"Distance in meters to the Road Runner: \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [51 x i8] c"Maximum speed in km/h of your Foyt-Coyote engine: \00"
@.str.6 = [55 x i8] c"Time to reach Road Runner's position is %.2f seconds.\0A\00"
@.str.7 = [31 x i8] c"... but he'll be gone!!! %c%c\0A\00"
@.str.8 = [49 x i8] c"Probability of having Road Runner Stew is %d%%.\0A\00"
@str = [38 x i8] c" ACME Software Development Company\00"
@str.9 = [48 x i8] c"Road Runner Apprehension Probability Calculator\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.9, i64 0, i64 0))
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %2)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %1)
%12 = load float, float* %1
%13 = fpext float %12 to double
%14 = fmul double %13, 1.000000e+03
%15 = fdiv double %14, 3.600000e+03
%16 = fptrunc double %15 to float
store float %16, float* %1
%17 = load float, float* %2
%18 = fdiv float %17, %16
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0), double %19)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i32 7, i32 7)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0), i32 0)
ret i32 0
}