#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 */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ WriteCommand(int);
int /*<<< orphan*/ WriteData(int);
void Kentec320x240x16_SSD2119LineDrawH(void *pvDisplayData, int32_t i32X1,
                                       int32_t i32X2, int32_t i32Y,
                                       uint32_t ui32Value) {
  WriteCommand(0x11);
  WriteData(((0x6830 & 0xff00) | (0x30)));
  WriteCommand(0x4e);
  WriteData((i32X1));
  WriteCommand(0x4f);
  WriteData((i32Y));
  WriteCommand(0x22);
  while (i32X1++ <= i32X2) {
    WriteData(ui32Value);
  }
}


x86 assembly (clang, -O0):
<Kentec320x240x16_SSD2119LineDrawH>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    $0x11,%edi
call   1040 <WriteCommand@plt>
mov    $0x6830,%edi
call   1030 <WriteData@plt>
mov    $0x4e,%edi
call   1040 <WriteCommand@plt>
mov    -0xc(%rbp),%edi
call   1030 <WriteData@plt>
mov    $0x4f,%edi
call   1040 <WriteCommand@plt>
mov    -0x14(%rbp),%edi
call   1030 <WriteData@plt>
mov    $0x22,%edi
call   1040 <WriteCommand@plt>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    -0x10(%rbp),%eax
jg     119c <Kentec320x240x16_SSD2119LineDrawH+0x7c>
mov    -0x18(%rbp),%edi
call   1030 <WriteData@plt>
jmp    117b <Kentec320x240x16_SSD2119LineDrawH+0x5b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kentec320x240x16_SSD2119LineDrawH>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%ebx
mov    %ecx,%r15d
mov    %edx,%ebp
mov    %esi,%r14d
mov    $0x11,%edi
call   1040 <WriteCommand@plt>
mov    $0x6830,%edi
call   1030 <WriteData@plt>
mov    $0x4e,%edi
call   1040 <WriteCommand@plt>
mov    %r14d,%edi
call   1030 <WriteData@plt>
mov    $0x4f,%edi
call   1040 <WriteCommand@plt>
mov    %r15d,%edi
call   1030 <WriteData@plt>
mov    $0x22,%edi
call   1040 <WriteCommand@plt>
cmp    %ebp,%r14d
jg     118c <Kentec320x240x16_SSD2119LineDrawH+0x6c>
sub    %r14d,%ebp
add    $0x1,%ebp
nop
mov    %ebx,%edi
call   1030 <WriteData@plt>
add    $0xffffffff,%ebp
jne    1180 <Kentec320x240x16_SSD2119LineDrawH+0x60>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Kentec320x240x16_SSD2119LineDrawH(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @WriteCommand(i32 17)
%7 = tail call i32 @WriteData(i32 26672)
%8 = tail call i32 @WriteCommand(i32 78)
%9 = tail call i32 @WriteData(i32 %1)
%10 = tail call i32 @WriteCommand(i32 79)
%11 = tail call i32 @WriteData(i32 %3)
%12 = tail call i32 @WriteCommand(i32 34)
%13 = icmp sgt i32 %1, %2
br i1 %13, label %19, label %14
14: ; preds = %5, %14
%15 = phi i32 [ %16, %14 ], [ %1, %5 ]
%16 = add i32 %15, 1
%17 = tail call i32 @WriteData(i32 %4)
%18 = icmp eq i32 %15, %2
br i1 %18, label %19, label %14
19: ; preds = %14, %5
ret void
}