#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*/ displayUsage();
double milesToMinutes(double, double);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ sscanf(char *, char *, double *);
int main(int numArgs, char *args[]) {
  if (numArgs != 3) {
    displayUsage();
    return -1;
  }
  double miles = 0;
  double mph = 0;
  sscanf(args[1], "%lf", &miles);
  sscanf(args[2], "%lf", &mph);
  if (miles == 0 || mph == 0) {
    displayUsage();
    return -2;
  }
  double minutes = milesToMinutes(miles, mph);
  printf("%.1f\n", minutes);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1173 <main+0x33>
mov    $0x0,%al
call   1060 <displayUsage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1227 <main+0xe7>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6e(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe56(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1050 <sscanf@plt>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11d0 <main+0x90>
jp     11d0 <main+0x90>
jmp    11e8 <main+0xa8>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11fb <main+0xbb>
jp     11fb <main+0xbb>
mov    $0x0,%al
call   1060 <displayUsage@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1227 <main+0xe7>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1040 <milesToMinutes@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xde9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
cmp    $0x3,%edi
jne    11bf <main+0x7f>
mov    %rsi,%rbx
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
mov    0x8(%rsi),%rdi
lea    0xe94(%rip),%r14
lea    0x10(%rsp),%rdx
mov    %r14,%rsi
call   1050 <sscanf@plt>
mov    0x10(%rbx),%rdi
lea    0x8(%rsp),%rdx
mov    %r14,%rsi
call   1050 <sscanf@plt>
movsd  0x10(%rsp),%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    119c <main+0x5c>
jnp    11cd <main+0x8d>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm2,%xmm1
jne    11aa <main+0x6a>
jnp    11cd <main+0x8d>
call   1040 <milesToMinutes@plt>
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
jmp    11d9 <main+0x99>
xor    %eax,%eax
call   1060 <displayUsage@plt>
mov    $0xffffffff,%eax
jmp    11d9 <main+0x99>
xor    %eax,%eax
call   1060 <displayUsage@plt>
mov    $0xfffffffe,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [6 x i8] c"%.1f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 3
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @displayUsage()
store i32 -1, i32* %3
br label %35
13: ; preds = %2
store double 0.000000e+00, double* %6
store double 0.000000e+00, double* %7
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @sscanf(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call i32 @sscanf(i8* %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %7)
%22 = load double, double* %6
%23 = fcmp oeq double %22, 0.000000e+00
br i1 %23, label %27, label %24
24: ; preds = %13
%25 = load double, double* %7
%26 = fcmp oeq double %25, 0.000000e+00
br i1 %26, label %27, label %29
27: ; preds = %24, %13
%28 = call i32 (...) @displayUsage()
store i32 -2, i32* %3
br label %35
29: ; preds = %24
%30 = load double, double* %6
%31 = load double, double* %7
%32 = call double @milesToMinutes(double %30, double %31)
store double %32, double* %8
%33 = load double, double* %8
%34 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %33)
store i32 0, i32* %3
br label %35
35: ; preds = %29, %27, %11
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [6 x i8] c"%.1f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca double
%4 = alloca double
%5 = icmp eq i32 %0, 3
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @displayUsage()
br label %29
8: ; preds = %2
%9 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%10 = bitcast double* %4 to i8*
store double 0.000000e+00, double* %4
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @sscanf(i8* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = call i32 @sscanf(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%17 = load double, double* %3
%18 = fcmp oeq double %17, 0.000000e+00
%19 = load double, double* %4
%20 = fcmp oeq double %19, 0.000000e+00
%21 = select i1 %18, i1 true, i1 %20
br i1 %21, label %22, label %24
22: ; preds = %8
%23 = call i32 (...) @displayUsage()
br label %27
24: ; preds = %8
%25 = call double @milesToMinutes(double %17, double %19)
%26 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %25)
br label %27
27: ; preds = %24, %22
%28 = phi i32 [ -2, %22 ], [ 0, %24 ]
br label %29
29: ; preds = %27, %6
%30 = phi i32 [ -1, %6 ], [ %28, %27 ]
ret i32 %30
}