#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*/ GLCD_DisplayChar(unsigned int, int /*<<< orphan*/,
                                    unsigned char, int /*<<< orphan*/);
void GLCD_DisplayString(unsigned int ln, unsigned int col, unsigned char fi,
                        unsigned char *s) {
  while (*s) {
    GLCD_DisplayChar(ln, col++, fi, *s++);
  }
}


x86 assembly (clang, -O0):
<GLCD_DisplayString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <GLCD_DisplayString+0x54>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movzbl (%rcx),%ecx
movzbl %al,%edx
call   1030 <GLCD_DisplayChar@plt>
jmp    1127 <GLCD_DisplayString+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLCD_DisplayString>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    (%rcx),%al
test   %al,%al
je     114e <GLCD_DisplayString+0x3e>
mov    %rcx,%rbx
mov    %edi,%r14d
add    $0x1,%rbx
movzbl %dl,%r15d
nopl   0x0(%rax,%rax,1)
lea    0x1(%rsi),%ebp
movzbl %al,%ecx
mov    %r14d,%edi
mov    %r15d,%edx
call   1030 <GLCD_DisplayChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
mov    %ebp,%esi
test   %al,%al
jne    1130 <GLCD_DisplayString+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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