#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*/ StopAllTasks();
int /*<<< orphan*/ nxtDisplayCenteredTextLine(int, char *, ...);
int /*<<< orphan*/ wait1Msec(int);
int checkParameterRange(float mRot, float mRotPerSec) {
  if (mRot < 0) {
    nxtDisplayCenteredTextLine(5, "ERR: MtrRots");
    nxtDisplayCenteredTextLine(7, "%.0f (min %d)", mRot, 0);
    wait1Msec(5000);
    StopAllTasks();
    return -1;
  }
  if (mRotPerSec < 0) {
    nxtDisplayCenteredTextLine(5, "ERR: MtrSpeed");
    nxtDisplayCenteredTextLine(7, "%.2f (min %.2f)", mRotPerSec, 0);
    wait1Msec(5000);
    StopAllTasks();
    return -1;
  }
  if (mRotPerSec > 2.0) {
    nxtDisplayCenteredTextLine(5, "ERR: MtrSpeed");
    nxtDisplayCenteredTextLine(7, "%.2f (max %.2f)", mRotPerSec, 2.0);
    wait1Msec(5000);
    StopAllTasks();
    return -1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<checkParameterRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    119d <checkParameterRange+0x6d>
mov    $0x5,%edi
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1030 <nxtDisplayCenteredTextLine@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x7,%edi
lea    0xe9e(%rip),%rsi
xor    %edx,%edx
mov    $0x1,%al
call   1030 <nxtDisplayCenteredTextLine@plt>
mov    $0x1388,%edi
call   1040 <wait1Msec@plt>
mov    $0x0,%al
call   1050 <StopAllTasks@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    126e <checkParameterRange+0x13e>
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    11f8 <checkParameterRange+0xc8>
mov    $0x5,%edi
lea    0xe6d(%rip),%rsi
mov    $0x0,%al
call   1030 <nxtDisplayCenteredTextLine@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x7,%edi
lea    0xe5f(%rip),%rsi
xor    %edx,%edx
mov    $0x1,%al
call   1030 <nxtDisplayCenteredTextLine@plt>
mov    $0x1388,%edi
call   1040 <wait1Msec@plt>
mov    $0x0,%al
call   1050 <StopAllTasks@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    126e <checkParameterRange+0x13e>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdf7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1267 <checkParameterRange+0x137>
mov    $0x5,%edi
lea    0xe04(%rip),%rsi
mov    $0x0,%al
call   1030 <nxtDisplayCenteredTextLine@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x7,%edi
lea    0xe06(%rip),%rsi
movsd  0xdbd(%rip),%xmm1
mov    $0x2,%al
call   1030 <nxtDisplayCenteredTextLine@plt>
mov    $0x1388,%edi
call   1040 <wait1Msec@plt>
mov    $0x0,%al
call   1050 <StopAllTasks@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    126e <checkParameterRange+0x13e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkParameterRange>:
push   %rax
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
jbe    1163 <checkParameterRange+0x33>
lea    0xed0(%rip),%rsi
mov    $0x5,%edi
xor    %eax,%eax
movss  %xmm0,(%rsp)
call   1030 <nxtDisplayCenteredTextLine@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xebc(%rip),%rsi
jmp    1190 <checkParameterRange+0x60>
ucomiss %xmm1,%xmm2
jbe    11b6 <checkParameterRange+0x86>
lea    0xebc(%rip),%rsi
mov    $0x5,%edi
xor    %eax,%eax
movss  %xmm1,(%rsp)
call   1030 <nxtDisplayCenteredTextLine@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea9(%rip),%rsi
mov    $0x7,%edi
xor    %edx,%edx
mov    $0x1,%al
call   1030 <nxtDisplayCenteredTextLine@plt>
mov    $0x1388,%edi
call   1040 <wait1Msec@plt>
xor    %eax,%eax
call   1050 <StopAllTasks@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    $0x1,%eax
ucomiss 0xe3e(%rip),%xmm1
jbe    11b4 <checkParameterRange+0x84>
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  %xmm0,(%rsp)
lea    0xe54(%rip),%rsi
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <nxtDisplayCenteredTextLine@plt>
lea    0xe5f(%rip),%rsi
movsd  0xe16(%rip),%xmm1
mov    $0x7,%edi
movsd  (%rsp),%xmm0
mov    $0x2,%al
call   1030 <nxtDisplayCenteredTextLine@plt>
jmp    119e <checkParameterRange+0x6e>

LLVM IR (-O0):
@.str = [13 x i8] c"ERR: MtrRots\00"
@.str.1 = [14 x i8] c"%.0f (min %d)\00"
@.str.2 = [14 x i8] c"ERR: MtrSpeed\00"
@.str.3 = [16 x i8] c"%.2f (min %.2f)\00"
@.str.4 = [16 x i8] c"%.2f (max %.2f)\00"
define i32 @checkParameterRange(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%10 = load float, float* %4
%11 = fpext float %10 to double
%12 = call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %11, i32 0)
%13 = call i32 @wait1Msec(i32 5000)
%14 = call i32 (...) @StopAllTasks()
store i32 -1, i32* %3
br label %37
15: ; preds = %2
%16 = load float, float* %5
%17 = fcmp olt float %16, 0.000000e+00
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%20 = load float, float* %5
%21 = fpext float %20 to double
%22 = call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %21, i32 0)
%23 = call i32 @wait1Msec(i32 5000)
%24 = call i32 (...) @StopAllTasks()
store i32 -1, i32* %3
br label %37
25: ; preds = %15
%26 = load float, float* %5
%27 = fpext float %26 to double
%28 = fcmp ogt double %27, 2.000000e+00
br i1 %28, label %29, label %36
29: ; preds = %25
%30 = call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%31 = load float, float* %5
%32 = fpext float %31 to double
%33 = call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %32, double 2.000000e+00)
%34 = call i32 @wait1Msec(i32 5000)
%35 = call i32 (...) @StopAllTasks()
store i32 -1, i32* %3
br label %37
36: ; preds = %25
store i32 1, i32* %3
br label %37
37: ; preds = %36, %29, %18, %8
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
@.str = [13 x i8] c"ERR: MtrRots\00"
@.str.1 = [14 x i8] c"%.0f (min %d)\00"
@.str.2 = [14 x i8] c"ERR: MtrSpeed\00"
@.str.3 = [16 x i8] c"%.2f (min %.2f)\00"
@.str.4 = [16 x i8] c"%.2f (max %.2f)\00"
define i32 @checkParameterRange(float %0, float %1) {
%3 = fcmp olt float %0, 0.000000e+00
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = fpext float %0 to double
%7 = tail call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %6, i32 0)
br label %20
8: ; preds = %2
%9 = fcmp olt float %1, 0.000000e+00
br i1 %9, label %10, label %14
10: ; preds = %8
%11 = tail call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%12 = fpext float %1 to double
%13 = tail call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %12, i32 0)
br label %20
14: ; preds = %8
%15 = fcmp ogt float %1, 2.000000e+00
br i1 %15, label %16, label %23
16: ; preds = %14
%17 = fpext float %1 to double
%18 = tail call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%19 = tail call i32 (i32, i8*, ...) @nxtDisplayCenteredTextLine(i32 7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %17, double 2.000000e+00)
br label %20
20: ; preds = %4, %10, %16
%21 = tail call i32 @wait1Msec(i32 5000)
%22 = tail call i32 (...) @StopAllTasks()
br label %23
23: ; preds = %20, %14
%24 = phi i32 [ 1, %14 ], [ -1, %20 ]
ret i32 %24
}