#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*/ LCD_ClearScreen();
int /*<<< orphan*/ LCD_Cursor(int /*<<< orphan*/);
int /*<<< orphan*/ LCD_WriteData(int /*<<< orphan*/);
void LCD_DisplayString(unsigned char column, const unsigned char *string) {
  LCD_ClearScreen();
  unsigned char c = column;
  while (*string) {
    LCD_Cursor(c++);
    LCD_WriteData(*string++);
  }
}


x86 assembly (clang, -O0):
<LCD_DisplayString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <LCD_ClearScreen@plt>
mov    -0x1(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     118b <LCD_DisplayString+0x5b>
mov    -0x11(%rbp),%al
mov    %al,%cl
add    $0x1,%cl
mov    %cl,-0x11(%rbp)
movzbl %al,%edi
call   1040 <LCD_Cursor@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%edi
call   1050 <LCD_WriteData@plt>
jmp    114f <LCD_DisplayString+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_DisplayString>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <LCD_ClearScreen@plt>
cmpb   $0x0,(%rbx)
je     116f <LCD_DisplayString+0x3f>
add    $0x1,%rbx
nopl   0x0(%rax,%rax,1)
movzbl %bpl,%edi
add    $0x1,%bpl
call   1040 <LCD_Cursor@plt>
movzbl -0x1(%rbx),%edi
call   1050 <LCD_WriteData@plt>
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1150 <LCD_DisplayString+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @LCD_DisplayString(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i8
store i8 %0, i8* %3
store i8* %1, i8** %4
%6 = call i32 (...) @LCD_ClearScreen()
%7 = load i8, i8* %3
store i8 %7, i8* %5
br label %8
8: ; preds = %12, %2
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i8, i8* %5
%14 = add i8 %13, 1
store i8 %14, i8* %5
%15 = zext i8 %13 to i32
%16 = call i32 @LCD_Cursor(i32 %15)
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %4
%19 = load i8, i8* %17
%20 = zext i8 %19 to i32
%21 = call i32 @LCD_WriteData(i32 %20)
br label %8
22: ; preds = %8
ret void
}

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