#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*/ LCDChrXY(unsigned char, unsigned char, unsigned char const);
int /*<<< orphan*/ LCDChrXYInverse(unsigned char, unsigned char,
                                   unsigned char const);
int /*<<< orphan*/ LCDUpdate();
void LCDStr(unsigned char row, const unsigned char *dataPtr,
            unsigned char inv) {
  unsigned char x = 0;
  while (*dataPtr) {
    if (inv) {
      LCDChrXYInverse(x, row, (*dataPtr));
    } else {
      LCDChrXY(x, row, (*dataPtr));
    }
    x++;
    dataPtr++;
  }
  LCDUpdate();
}


x86 assembly (clang, -O0):
<LCDStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11b0 <LCDStr+0x80>
cmpb   $0x0,-0x11(%rbp)
je     117f <LCDStr+0x4f>
mov    -0x12(%rbp),%dl
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
movzbl %dl,%edi
movzbl %cl,%esi
movzbl (%rax),%edx
call   1030 <LCDChrXYInverse@plt>
jmp    1197 <LCDStr+0x67>
mov    -0x12(%rbp),%dl
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
movzbl %dl,%edi
movzbl %cl,%esi
movzbl (%rax),%edx
call   1040 <LCDChrXY@plt>
mov    -0x12(%rbp),%al
add    $0x1,%al
mov    %al,-0x12(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    114b <LCDStr+0x1b>
mov    $0x0,%al
call   1050 <LCDUpdate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDStr>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1177 <LCDStr+0x47>
mov    %edx,%r14d
mov    %rsi,%r15
xor    %ebx,%ebx
movzbl %dil,%ebp
jmp    1163 <LCDStr+0x33>
nopl   0x0(%rax,%rax,1)
call   1040 <LCDChrXY@plt>
movzbl 0x1(%r15,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
je     1177 <LCDStr+0x47>
movzbl %al,%edx
movzbl %bl,%edi
mov    %ebp,%esi
test   %r14b,%r14b
je     1150 <LCDStr+0x20>
call   1030 <LCDChrXYInverse@plt>
jmp    1155 <LCDStr+0x25>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <LCDUpdate@plt>

LLVM IR (-O0):
define void @LCDStr(i8 zeroext %0, i8* %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8
store i8 %0, i8* %4
store i8* %1, i8** %5
store i8 %2, i8* %6
store i8 0, i8* %7
br label %8
8: ; preds = %27, %3
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %32
12: ; preds = %8
%13 = load i8, i8* %6
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i8, i8* %7
%17 = load i8, i8* %4
%18 = load i8*, i8** %5
%19 = load i8, i8* %18
%20 = call i32 @LCDChrXYInverse(i8 zeroext %16, i8 zeroext %17, i8 zeroext %19)
br label %27
21: ; preds = %12
%22 = load i8, i8* %7
%23 = load i8, i8* %4
%24 = load i8*, i8** %5
%25 = load i8, i8* %24
%26 = call i32 @LCDChrXY(i8 zeroext %22, i8 zeroext %23, i8 zeroext %25)
br label %27
27: ; preds = %21, %15
%28 = load i8, i8* %7
%29 = add i8 %28, 1
store i8 %29, i8* %7
%30 = load i8*, i8** %5
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %5
br label %8
32: ; preds = %8
%33 = call i32 (...) @LCDUpdate()
ret void
}

LLVM IR (-O2):
define void @LCDStr(i8 zeroext %0, i8* nocapture %1, i8 zeroext %2) {
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %21, label %6
6: ; preds = %3
%7 = icmp eq i8 %2, 0
br label %8
8: ; preds = %6, %16
%9 = phi i8 [ %4, %6 ], [ %19, %16 ]
%10 = phi i8 [ 0, %6 ], [ %17, %16 ]
%11 = phi i8* [ %1, %6 ], [ %18, %16 ]
br i1 %7, label %14, label %12
12: ; preds = %8
%13 = tail call i32 @LCDChrXYInverse(i8 zeroext %10, i8 zeroext %0, i8 zeroext %9)
br label %16
14: ; preds = %8
%15 = tail call i32 @LCDChrXY(i8 zeroext %10, i8 zeroext %0, i8 zeroext %9)
br label %16
16: ; preds = %14, %12
%17 = add i8 %10, 1
%18 = getelementptr inbounds i8, i8* %11, i64 1
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %21, label %8
21: ; preds = %16, %3
%22 = tail call i32 (...) @LCDUpdate()
ret void
}