#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 biscSendLedCommand();
int biscDrive(int velocity, int radius) {
  if (velocity < -500 || velocity > 500)
    return -1;
  if (biscSendByte(137) == -1)
    return -1;
  if (biscSendInt(velocity) == -1)
    return -1;
  if (biscSendInt(radius) == -1)
    return -1;
  if (biscSendLedCommand() == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<biscDrive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xfffffe0c,-0x8(%rbp)
jl     1158 <biscDrive+0x28>
cmpl   $0x1f4,-0x8(%rbp)
jle    1164 <biscDrive+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    11e0 <biscDrive+0xb0>
mov    $0x89,%edi
call   1040 <biscSendByte@plt>
cmp    $0xffffffff,%eax
jne    1183 <biscDrive+0x53>
movl   $0xffffffff,-0x4(%rbp)
jmp    11e0 <biscDrive+0xb0>
mov    -0x8(%rbp),%edi
call   1050 <biscSendInt@plt>
cmp    $0xffffffff,%eax
jne    11a0 <biscDrive+0x70>
movl   $0xffffffff,-0x4(%rbp)
jmp    11e0 <biscDrive+0xb0>
mov    -0xc(%rbp),%edi
call   1050 <biscSendInt@plt>
cmp    $0xffffffff,%eax
jne    11bd <biscDrive+0x8d>
movl   $0xffffffff,-0x4(%rbp)
jmp    11e0 <biscDrive+0xb0>
mov    $0x0,%al
call   1030 <biscSendLedCommand@plt>
cmp    $0xffffffff,%eax
jne    11d9 <biscDrive+0xa9>
movl   $0xffffffff,-0x4(%rbp)
jmp    11e0 <biscDrive+0xb0>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<biscDrive>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
lea    -0x1f5(%rbp),%eax
mov    $0xffffffff,%ebx
cmp    $0xfffffc17,%eax
jb     1184 <biscDrive+0x54>
mov    %esi,%r14d
mov    $0x89,%edi
call   1040 <biscSendByte@plt>
cmp    $0xffffffff,%eax
je     1184 <biscDrive+0x54>
mov    %ebp,%edi
call   1050 <biscSendInt@plt>
cmp    $0xffffffff,%eax
je     1184 <biscDrive+0x54>
mov    %r14d,%edi
call   1050 <biscSendInt@plt>
cmp    $0xffffffff,%eax
je     1184 <biscDrive+0x54>
xor    %eax,%eax
call   1030 <biscSendLedCommand@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
sete   %bl
neg    %ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @biscDrive(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 %31
12: ; preds = %8
%13 = call i32 @biscSendByte(i32 137)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 -1, i32* %3
br label %31
16: ; preds = %12
%17 = load i32, i32* %4
%18 = call i32 @biscSendInt(i32 %17)
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 -1, i32* %3
br label %31
21: ; preds = %16
%22 = load i32, i32* %5
%23 = call i32 @biscSendInt(i32 %22)
%24 = icmp eq i32 %23, -1
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 -1, i32* %3
br label %31
26: ; preds = %21
%27 = call i32 (...) @biscSendLedCommand()
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %30
29: ; preds = %26
store i32 -1, i32* %3
br label %31
30: ; preds = %26
store i32 0, i32* %3
br label %31
31: ; preds = %30, %29, %25, %20, %15, %11
%32 = load i32, i32* %3
ret i32 %32
}

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