#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 Formike128x128x16LineDrawH(void *pvDisplayData, long lX1, long lX2,
                                long lY, unsigned long ulValue) {
  WriteCommand(0x2a);
  WriteData(lX1);
  WriteData(lX2);
  WriteCommand(0x2b);
  WriteData(lY + 1);
  WriteData(lY + 1);
  WriteCommand(0x2c);
  while (lX1++ <= lX2) {
    WriteData(ulValue >> 8);
    WriteData(ulValue);
  }
}


x86 assembly (clang, -O0):
<Formike128x128x16LineDrawH>:
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    -0x18(%rbp),%rdi
call   1030 <WriteData@plt>
mov    $0x2b,%edi
call   1040 <WriteCommand@plt>
mov    -0x20(%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    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmp    -0x18(%rbp),%rax
jg     11ba <Formike128x128x16LineDrawH+0x9a>
mov    -0x28(%rbp),%rdi
shr    $0x8,%rdi
call   1030 <WriteData@plt>
mov    -0x28(%rbp),%rdi
call   1030 <WriteData@plt>
jmp    1186 <Formike128x128x16LineDrawH+0x66>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Formike128x128x16LineDrawH(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* %8
%15 = call i32 @WriteData(i64 %14)
%16 = call i32 @WriteCommand(i32 43)
%17 = load i64, i64* %9
%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* %7
%26 = add nsw i64 %25, 1
store i64 %26, i64* %7
%27 = load i64, i64* %8
%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 @Formike128x128x16LineDrawH(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 %2)
%9 = tail call i32 @WriteCommand(i32 43)
%10 = add nsw i64 %3, 1
%11 = tail call i32 @WriteData(i64 %10)
%12 = tail call i32 @WriteData(i64 %10)
%13 = tail call i32 @WriteCommand(i32 44)
%14 = icmp sgt i64 %1, %2
br i1 %14, label %23, label %15
15: ; preds = %5
%16 = lshr i64 %4, 8
br label %17
17: ; preds = %15, %17
%18 = phi i64 [ %1, %15 ], [ %19, %17 ]
%19 = add i64 %18, 1
%20 = tail call i32 @WriteData(i64 %16)
%21 = tail call i32 @WriteData(i64 %4)
%22 = icmp eq i64 %18, %2
br i1 %22, label %23, label %17
23: ; preds = %17, %5
ret void
}