#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*/ LCDSend(unsigned char);
int /*<<< orphan*/ LCDSetXY(unsigned char, unsigned char);
void LCDFill(unsigned char xs, unsigned char ys, unsigned char width,
             unsigned char height, unsigned char color) {
  unsigned char i, j;
  for (i = 0; i < height; i++) {
    LCDSetXY(xs, ys + i);
    LCDSend(0x12C);
    for (j = 0; j < width; j++)
      LCDSend(color);
  }
}


x86 assembly (clang, -O0):
<LCDFill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %r8b,%al
mov    %dil,-0x1(%rbp)
mov    %sil,-0x2(%rbp)
mov    %dl,-0x3(%rbp)
mov    %cl,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movb   $0x0,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
movzbl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    11ae <LCDFill+0x8e>
mov    -0x1(%rbp),%cl
movzbl -0x2(%rbp),%eax
movzbl -0x6(%rbp),%edx
add    %edx,%eax
movzbl %cl,%edi
movzbl %al,%esi
call   1040 <LCDSetXY@plt>
mov    $0x2c,%edi
call   1030 <LCDSend@plt>
movb   $0x0,-0x7(%rbp)
movzbl -0x7(%rbp),%eax
movzbl -0x3(%rbp),%ecx
cmp    %ecx,%eax
jge    119c <LCDFill+0x7c>
movzbl -0x5(%rbp),%edi
call   1030 <LCDSend@plt>
mov    -0x7(%rbp),%al
add    $0x1,%al
mov    %al,-0x7(%rbp)
jmp    1176 <LCDFill+0x56>
jmp    11a1 <LCDFill+0x81>
mov    -0x6(%rbp),%al
add    $0x1,%al
mov    %al,-0x6(%rbp)
jmp    1140 <LCDFill+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDFill>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,(%rsp)
test   %ecx,%ecx
je     118f <LCDFill+0x6f>
mov    %ecx,%r15d
mov    %edx,%r13d
xor    %ebp,%ebp
movzbl %dil,%r12d
movzbl %r8b,%ebx
jmp    1159 <LCDFill+0x39>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%bpl
cmp    %r15b,%bpl
je     118f <LCDFill+0x6f>
mov    (%rsp),%rax
add    %ebp,%eax
movzbl %al,%esi
mov    %r12d,%edi
call   1040 <LCDSetXY@plt>
mov    $0x2c,%edi
call   1030 <LCDSend@plt>
test   %r13b,%r13b
je     1150 <LCDFill+0x30>
mov    %r13d,%r14d
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <LCDSend@plt>
add    $0xff,%r14b
jne    1180 <LCDFill+0x60>
jmp    1150 <LCDFill+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @LCDFill(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8 zeroext %4) {
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
store i8 %0, i8* %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i8 %3, i8* %9
store i8 %4, i8* %10
store i8 0, i8* %11
br label %13
13: ; preds = %42, %5
%14 = load i8, i8* %11
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = icmp slt i32 %15, %17
br i1 %18, label %19, label %45
19: ; preds = %13
%20 = load i8, i8* %6
%21 = load i8, i8* %7
%22 = zext i8 %21 to i32
%23 = load i8, i8* %11
%24 = zext i8 %23 to i32
%25 = add nsw i32 %22, %24
%26 = trunc i32 %25 to i8
%27 = call i32 @LCDSetXY(i8 zeroext %20, i8 zeroext %26)
%28 = call i32 @LCDSend(i8 zeroext 44)
store i8 0, i8* %12
br label %29
29: ; preds = %38, %19
%30 = load i8, i8* %12
%31 = zext i8 %30 to i32
%32 = load i8, i8* %8
%33 = zext i8 %32 to i32
%34 = icmp slt i32 %31, %33
br i1 %34, label %35, label %41
35: ; preds = %29
%36 = load i8, i8* %10
%37 = call i32 @LCDSend(i8 zeroext %36)
br label %38
38: ; preds = %35
%39 = load i8, i8* %12
%40 = add i8 %39, 1
store i8 %40, i8* %12
br label %29
41: ; preds = %29
br label %42
42: ; preds = %41
%43 = load i8, i8* %11
%44 = add i8 %43, 1
store i8 %44, i8* %11
br label %13
45: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @LCDFill(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8 zeroext %4) {
%6 = icmp eq i8 %3, 0
br i1 %6, label %22, label %7
7: ; preds = %5
%8 = icmp eq i8 %2, 0
br label %9
9: ; preds = %7, %19
%10 = phi i8 [ 0, %7 ], [ %20, %19 ]
%11 = add i8 %10, %1
%12 = tail call i32 @LCDSetXY(i8 zeroext %0, i8 zeroext %11)
%13 = tail call i32 @LCDSend(i8 zeroext 44)
br i1 %8, label %19, label %14
14: ; preds = %9, %14
%15 = phi i8 [ %17, %14 ], [ 0, %9 ]
%16 = tail call i32 @LCDSend(i8 zeroext %4)
%17 = add nuw i8 %15, 1
%18 = icmp eq i8 %17, %2
br i1 %18, label %19, label %14
19: ; preds = %14, %9
%20 = add nuw i8 %10, 1
%21 = icmp eq i8 %20, %3
br i1 %21, label %22, label %9
22: ; preds = %19, %5
ret void
}