#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*/ WriteCommand(int);
int /*<<< orphan*/ WriteData(unsigned long);
void Formike128x128x16LineDrawV(void *pvDisplayData, long lX, long lY1,
                                long lY2, unsigned long ulValue) {
  WriteCommand(0x2a);
  WriteData(lX);
  WriteData(lX);
  WriteCommand(0x2b);
  WriteData(lY1 + 1);
  WriteData(lY2 + 1);
  WriteCommand(0x2c);
  while (lY1++ <= lY2) {
    WriteData(ulValue >> 8);
    WriteData(ulValue);
  }
}


x86 assembly (clang, -O0):
<Formike128x128x16LineDrawV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    $0x2a,%edi
call   1040 <WriteCommand@plt>
mov    -0x10(%rbp),%rdi
call   1030 <WriteData@plt>
mov    -0x10(%rbp),%rdi
call   1030 <WriteData@plt>
mov    $0x2b,%edi
call   1040 <WriteCommand@plt>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1030 <WriteData@plt>
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1030 <WriteData@plt>
mov    $0x2c,%edi
call   1040 <WriteCommand@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
cmp    -0x20(%rbp),%rax
jg     11ba <Formike128x128x16LineDrawV+0x9a>
mov    -0x28(%rbp),%rdi
shr    $0x8,%rdi
call   1030 <WriteData@plt>
mov    -0x28(%rbp),%rdi
call   1030 <WriteData@plt>
jmp    1186 <Formike128x128x16LineDrawV+0x66>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Formike128x128x16LineDrawV>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%rbx
mov    %rdx,%r15
mov    %rsi,%r12
mov    $0x2a,%edi
call   1040 <WriteCommand@plt>
mov    %r12,%rdi
call   1030 <WriteData@plt>
mov    %r12,%rdi
call   1030 <WriteData@plt>
mov    $0x2b,%edi
call   1040 <WriteCommand@plt>
lea    0x1(%r15),%rdi
call   1030 <WriteData@plt>
lea    0x1(%rbx),%rdi
call   1030 <WriteData@plt>
mov    $0x2c,%edi
call   1040 <WriteCommand@plt>
cmp    %rbx,%r15
jg     11a6 <Formike128x128x16LineDrawV+0x86>
mov    %r14,%r12
shr    $0x8,%r12
sub    %r15,%rbx
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1030 <WriteData@plt>
mov    %r14,%rdi
call   1030 <WriteData@plt>
add    $0xffffffffffffffff,%rbx
jne    1190 <Formike128x128x16LineDrawV+0x70>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Formike128x128x16LineDrawV(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = call i32 @WriteCommand(i32 42)
%12 = load i64, i64* %7
%13 = call i32 @WriteData(i64 %12)
%14 = load i64, i64* %7
%15 = call i32 @WriteData(i64 %14)
%16 = call i32 @WriteCommand(i32 43)
%17 = load i64, i64* %8
%18 = add nsw i64 %17, 1
%19 = call i32 @WriteData(i64 %18)
%20 = load i64, i64* %9
%21 = add nsw i64 %20, 1
%22 = call i32 @WriteData(i64 %21)
%23 = call i32 @WriteCommand(i32 44)
br label %24
24: ; preds = %29, %5
%25 = load i64, i64* %8
%26 = add nsw i64 %25, 1
store i64 %26, i64* %8
%27 = load i64, i64* %9
%28 = icmp sle i64 %25, %27
br i1 %28, label %29, label %35
29: ; preds = %24
%30 = load i64, i64* %10
%31 = lshr i64 %30, 8
%32 = call i32 @WriteData(i64 %31)
%33 = load i64, i64* %10
%34 = call i32 @WriteData(i64 %33)
br label %24
35: ; preds = %24
ret void
}

LLVM IR (-O2):
define void @Formike128x128x16LineDrawV(i8* nocapture readnone %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i32 @WriteCommand(i32 42)
%7 = tail call i32 @WriteData(i64 %1)
%8 = tail call i32 @WriteData(i64 %1)
%9 = tail call i32 @WriteCommand(i32 43)
%10 = add nsw i64 %2, 1
%11 = tail call i32 @WriteData(i64 %10)
%12 = add i64 %3, 1
%13 = tail call i32 @WriteData(i64 %12)
%14 = tail call i32 @WriteCommand(i32 44)
%15 = icmp sgt i64 %2, %3
br i1 %15, label %24, label %16
16: ; preds = %5
%17 = lshr i64 %4, 8
br label %18
18: ; preds = %16, %18
%19 = phi i64 [ %2, %16 ], [ %20, %18 ]
%20 = add i64 %19, 1
%21 = tail call i32 @WriteData(i64 %17)
%22 = tail call i32 @WriteData(i64 %4)
%23 = icmp eq i64 %19, %3
br i1 %23, label %24, label %18
24: ; preds = %18, %5
ret void
}