#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 biscSendByte(int);
int biscSendInt(int);
int biscDirectDrive(int rightVelocity, int leftVelocity) {
  if (rightVelocity < -500 || rightVelocity > 500)
    return -1;
  if (leftVelocity < -500 || leftVelocity > 500)
    return -1;
  if (biscSendByte(145) == -1)
    return -1;
  if (biscSendInt(rightVelocity) == -1)
    return -1;
  if (biscSendInt(leftVelocity) == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<biscDirectDrive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xfffffe0c,-0x8(%rbp)
jl     1148 <biscDirectDrive+0x28>
cmpl   $0x1f4,-0x8(%rbp)
jle    1154 <biscDirectDrive+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    11da <biscDirectDrive+0xba>
cmpl   $0xfffffe0c,-0xc(%rbp)
jl     116e <biscDirectDrive+0x4e>
cmpl   $0x1f4,-0xc(%rbp)
jle    117a <biscDirectDrive+0x5a>
movl   $0xffffffff,-0x4(%rbp)
jmp    11da <biscDirectDrive+0xba>
mov    $0x91,%edi
call   1030 <biscSendByte@plt>
cmp    $0xffffffff,%eax
jne    1199 <biscDirectDrive+0x79>
movl   $0xffffffff,-0x4(%rbp)
jmp    11da <biscDirectDrive+0xba>
mov    -0x8(%rbp),%edi
call   1040 <biscSendInt@plt>
cmp    $0xffffffff,%eax
jne    11b6 <biscDirectDrive+0x96>
movl   $0xffffffff,-0x4(%rbp)
jmp    11da <biscDirectDrive+0xba>
mov    -0xc(%rbp),%edi
call   1040 <biscSendInt@plt>
cmp    $0xffffffff,%eax
jne    11d3 <biscDirectDrive+0xb3>
movl   $0xffffffff,-0x4(%rbp)
jmp    11da <biscDirectDrive+0xba>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<biscDirectDrive>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
lea    -0x1f5(%rbx),%eax
mov    $0xffffffff,%ebp
cmp    $0xfffffc17,%eax
jb     1177 <biscDirectDrive+0x57>
mov    %esi,%r14d
lea    -0x1f5(%r14),%eax
cmp    $0xfffffc17,%eax
jb     1177 <biscDirectDrive+0x57>
mov    $0x91,%edi
call   1030 <biscSendByte@plt>
cmp    $0xffffffff,%eax
je     1177 <biscDirectDrive+0x57>
mov    %ebx,%edi
call   1040 <biscSendInt@plt>
cmp    $0xffffffff,%eax
je     1177 <biscDirectDrive+0x57>
mov    %r14d,%edi
call   1040 <biscSendInt@plt>
xor    %ebp,%ebp
cmp    $0xffffffff,%eax
sete   %bpl
neg    %ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @biscDirectDrive(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, -500
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 500
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 -1, i32* %3
br label %34
12: ; preds = %8
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, -500
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %5
%17 = icmp sgt i32 %16, 500
br i1 %17, label %18, label %19
18: ; preds = %15, %12
store i32 -1, i32* %3
br label %34
19: ; preds = %15
%20 = call i32 @biscSendByte(i32 145)
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 -1, i32* %3
br label %34
23: ; preds = %19
%24 = load i32, i32* %4
%25 = call i32 @biscSendInt(i32 %24)
%26 = icmp eq i32 %25, -1
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 -1, i32* %3
br label %34
28: ; preds = %23
%29 = load i32, i32* %5
%30 = call i32 @biscSendInt(i32 %29)
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %33
32: ; preds = %28
store i32 -1, i32* %3
br label %34
33: ; preds = %28
store i32 0, i32* %3
br label %34
34: ; preds = %33, %32, %27, %22, %18, %11
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @biscDirectDrive(i32 %0, i32 %1) {
%3 = add i32 %0, -501
%4 = icmp ult i32 %3, -1001
%5 = add i32 %1, -501
%6 = icmp ult i32 %5, -1001
%7 = or i1 %4, %6
br i1 %7, label %18, label %8
8: ; preds = %2
%9 = tail call i32 @biscSendByte(i32 145)
%10 = icmp eq i32 %9, -1
br i1 %10, label %18, label %11
11: ; preds = %8
%12 = tail call i32 @biscSendInt(i32 %0)
%13 = icmp eq i32 %12, -1
br i1 %13, label %18, label %14
14: ; preds = %11
%15 = tail call i32 @biscSendInt(i32 %1)
%16 = icmp eq i32 %15, -1
%17 = sext i1 %16 to i32
br label %18
18: ; preds = %14, %11, %8, %2
%19 = phi i32 [ -1, %2 ], [ -1, %8 ], [ -1, %11 ], [ %17, %14 ]
ret i32 %19
}