#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*/ draw_font(unsigned long, unsigned long, unsigned int,
                             unsigned char);
void outtextxy(unsigned long x, unsigned long y, unsigned int color,
               unsigned char *string) {
  unsigned long point;
  for (point = 0; string[point] != 0x00; point++) {
    draw_font(x, y, color, string[point]);
    x += 8;
  }
}


x86 assembly (clang, -O0):
<outtextxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     117d <outtextxy+0x6d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
movzbl (%rax,%rcx,1),%ecx
call   1030 <draw_font@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    112f <outtextxy+0x1f>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outtextxy>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    (%rcx),%al
test   %al,%al
je     1150 <outtextxy+0x40>
mov    %rcx,%rbx
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
add    $0x1,%rbx
nopl   (%rax)
movzbl %al,%ecx
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1030 <draw_font@plt>
add    $0x8,%rbp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <outtextxy+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @outtextxy(i64 %0, i64 %1, i32 %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 i64 [ %13, %7 ], [ 0, %4 ]
%10 = phi i64 [ %12, %7 ], [ %0, %4 ]
%11 = tail call i32 @draw_font(i64 %10, i64 %1, i32 %2, i8 zeroext %8)
%12 = add i64 %10, 8
%13 = add i64 %9, 1
%14 = getelementptr inbounds i8, i8* %3, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %4
ret void
}