#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*/ create_write_byte(int);
int /*<<< orphan*/ script_write_byte(int);
void create_align_back_CW(unsigned int speed) {
  script_write_byte(145);
  script_write_byte(((-speed & 0xFFFF) >> 8));
  script_write_byte((-speed & 0xFF));
  script_write_byte(((-speed & 0xFFFF) >> 8));
  script_write_byte((-speed & 0xFF));
  create_write_byte(158);
  create_write_byte(11);
  script_write_byte(145);
  script_write_byte(((-speed & 0xFFFF) >> 8));
  script_write_byte((-speed & 0xFF));
  script_write_byte(((0 & 0xFFFF) >> 8));
  script_write_byte((0 & 0xFF));
  create_write_byte(158);
  create_write_byte(14);
}


x86 assembly (clang, -O0):
<create_align_back_CW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x91,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
and    $0xffff,%edi
shr    $0x8,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
and    $0xffff,%edi
shr    $0x8,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <script_write_byte@plt>
mov    $0x9e,%edi
call   1040 <create_write_byte@plt>
mov    $0xb,%edi
call   1040 <create_write_byte@plt>
mov    $0x91,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
and    $0xffff,%edi
shr    $0x8,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
call   1030 <script_write_byte@plt>
mov    $0x9e,%edi
call   1040 <create_write_byte@plt>
mov    $0xe,%edi
call   1040 <create_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_align_back_CW>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x91,%edi
call   1030 <script_write_byte@plt>
neg    %ebx
movzbl %bh,%edi
mov    %edi,%r14d
call   1030 <script_write_byte@plt>
movzbl %bl,%ebp
mov    %ebp,%edi
call   1030 <script_write_byte@plt>
mov    %r14d,%edi
call   1030 <script_write_byte@plt>
mov    %ebp,%edi
call   1030 <script_write_byte@plt>
mov    $0x9e,%edi
call   1040 <create_write_byte@plt>
mov    $0xb,%edi
call   1040 <create_write_byte@plt>
mov    $0x91,%edi
call   1030 <script_write_byte@plt>
mov    %r14d,%edi
call   1030 <script_write_byte@plt>
mov    %ebp,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
call   1030 <script_write_byte@plt>
mov    $0x9e,%edi
call   1040 <create_write_byte@plt>
mov    $0xe,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <create_write_byte@plt>

LLVM IR (-O0):
define void @create_align_back_CW(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @script_write_byte(i32 145)
%4 = load i32, i32* %2
%5 = sub i32 0, %4
%6 = and i32 %5, 65535
%7 = lshr i32 %6, 8
%8 = call i32 @script_write_byte(i32 %7)
%9 = load i32, i32* %2
%10 = sub i32 0, %9
%11 = and i32 %10, 255
%12 = call i32 @script_write_byte(i32 %11)
%13 = load i32, i32* %2
%14 = sub i32 0, %13
%15 = and i32 %14, 65535
%16 = lshr i32 %15, 8
%17 = call i32 @script_write_byte(i32 %16)
%18 = load i32, i32* %2
%19 = sub i32 0, %18
%20 = and i32 %19, 255
%21 = call i32 @script_write_byte(i32 %20)
%22 = call i32 @create_write_byte(i32 158)
%23 = call i32 @create_write_byte(i32 11)
%24 = call i32 @script_write_byte(i32 145)
%25 = load i32, i32* %2
%26 = sub i32 0, %25
%27 = and i32 %26, 65535
%28 = lshr i32 %27, 8
%29 = call i32 @script_write_byte(i32 %28)
%30 = load i32, i32* %2
%31 = sub i32 0, %30
%32 = and i32 %31, 255
%33 = call i32 @script_write_byte(i32 %32)
%34 = call i32 @script_write_byte(i32 0)
%35 = call i32 @script_write_byte(i32 0)
%36 = call i32 @create_write_byte(i32 158)
%37 = call i32 @create_write_byte(i32 14)
ret void
}

LLVM IR (-O2):
define void @create_align_back_CW(i32 %0) {
%2 = tail call i32 @script_write_byte(i32 145)
%3 = sub i32 0, %0
%4 = lshr i32 %3, 8
%5 = and i32 %4, 255
%6 = tail call i32 @script_write_byte(i32 %5)
%7 = and i32 %3, 255
%8 = tail call i32 @script_write_byte(i32 %7)
%9 = tail call i32 @script_write_byte(i32 %5)
%10 = tail call i32 @script_write_byte(i32 %7)
%11 = tail call i32 @create_write_byte(i32 158)
%12 = tail call i32 @create_write_byte(i32 11)
%13 = tail call i32 @script_write_byte(i32 145)
%14 = tail call i32 @script_write_byte(i32 %5)
%15 = tail call i32 @script_write_byte(i32 %7)
%16 = tail call i32 @script_write_byte(i32 0)
%17 = tail call i32 @script_write_byte(i32 0)
%18 = tail call i32 @create_write_byte(i32 158)
%19 = tail call i32 @create_write_byte(i32 14)
ret void
}