#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_ShowChar(unsigned int, unsigned int, unsigned int,
                                unsigned int, unsigned int, char);
void LCD_ShowString(unsigned int x, unsigned int y, unsigned int size,
                    unsigned int For_color, unsigned int Bk_color, char *p) {
  while (*p != '\0') {
    LCD_ShowChar(x, y, size, For_color, Bk_color, *p);
    y += 16;
    p++;
  }
}


x86 assembly (clang, -O0):
<LCD_ShowString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1173 <LCD_ShowString+0x63>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%rax
movsbl (%rax),%r9d
call   1030 <LCD_ShowChar@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <LCD_ShowString+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_ShowString>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    (%r9),%al
test   %al,%al
je     1165 <LCD_ShowString+0x55>
mov    %r9,%rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebp
mov    %edi,%r13d
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%r9d
mov    %r13d,%edi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <LCD_ShowChar@plt>
add    $0x10,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <LCD_ShowString+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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