#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*/ SerialWriteString(char *);
void iRobot_DriveDirect(unsigned short right_velocity_high,
                        unsigned short right_velocity_low,
                        unsigned short left_velocity_high,
                        unsigned short left_velocity_low) {
  char data[] = {145, right_velocity_high, right_velocity_low,
                 left_velocity_high, left_velocity_low};
  SerialWriteString(data);
}


x86 assembly (clang, -O0):
<iRobot_DriveDirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
movb   $0x91,-0xd(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,-0xc(%rbp)
mov    -0x4(%rbp),%ax
mov    %al,-0xb(%rbp)
mov    -0x6(%rbp),%ax
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%ax
mov    %al,-0x9(%rbp)
lea    -0xd(%rbp),%rdi
call   1030 <SerialWriteString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iRobot_DriveDirect>:
push   %rax
movb   $0x91,0x3(%rsp)
mov    %dil,0x4(%rsp)
mov    %sil,0x5(%rsp)
mov    %dl,0x6(%rsp)
mov    %cl,0x7(%rsp)
lea    0x3(%rsp),%rdi
call   1030 <SerialWriteString@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @iRobot_DriveDirect(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
%9 = alloca [5 x i8]
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
store i8 -111, i8* %10
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i16, i16* %5
%13 = trunc i16 %12 to i8
store i8 %13, i8* %11
%14 = getelementptr inbounds i8, i8* %11, i64 1
%15 = load i16, i16* %6
%16 = trunc i16 %15 to i8
store i8 %16, i8* %14
%17 = getelementptr inbounds i8, i8* %14, i64 1
%18 = load i16, i16* %7
%19 = trunc i16 %18 to i8
store i8 %19, i8* %17
%20 = getelementptr inbounds i8, i8* %17, i64 1
%21 = load i16, i16* %8
%22 = trunc i16 %21 to i8
store i8 %22, i8* %20
%23 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
%24 = call i32 @SerialWriteString(i8* %23)
ret void
}

LLVM IR (-O2):
define void @iRobot_DriveDirect(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = alloca [5 x i8]
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
store i8 -111, i8* %6
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 1
%8 = trunc i16 %0 to i8
store i8 %8, i8* %7
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 2
%10 = trunc i16 %1 to i8
store i8 %10, i8* %9
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 3
%12 = trunc i16 %2 to i8
store i8 %12, i8* %11
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 4
%14 = trunc i16 %3 to i8
store i8 %14, i8* %13
%15 = call i32 @SerialWriteString(i8* %6)
ret void
}