#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*/ put_charx4(char, int, int, int, int, unsigned char *);
int strlen(char *);
void vmwTextXYx4(char *string, int x, int y, int color, int which_font,
                 unsigned char *buffer) {
  int i;
  for (i = 0; i < strlen(string); i++) {
    put_charx4(string[i], x + (i * 8 * 4), y, color, which_font, buffer);
  }
}


x86 assembly (clang, -O0):
<vmwTextXYx4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
cmp    %ecx,%eax
jge    119d <vmwTextXYx4+0x7d>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0xc(%rbp),%esi
mov    -0x24(%rbp),%ecx
shl    $0x3,%ecx
shl    $0x2,%ecx
add    %ecx,%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x20(%rbp),%r9
movsbl %al,%edi
call   1040 <put_charx4@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1144 <vmwTextXYx4+0x24>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmwTextXYx4>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,(%rsp)
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebx
mov    %rdi,%rbp
call   1030 <strlen@plt>
test   %eax,%eax
jle    1180 <vmwTextXYx4+0x60>
xor    %r14d,%r14d
nopl   0x0(%rax)
movsbl 0x0(%rbp,%r14,1),%edi
mov    %ebx,%esi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    (%rsp),%r9
call   1040 <put_charx4@plt>
add    $0x1,%r14
mov    %rbp,%rdi
call   1030 <strlen@plt>
cltq
add    $0x20,%ebx
cmp    %rax,%r14
jl     1150 <vmwTextXYx4+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @vmwTextXYx4(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
store i8* %0, i8** %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
store i32 0, i32* %13
br label %14
14: ; preds = %35, %6
%15 = load i32, i32* %13
%16 = load i8*, i8** %7
%17 = call i32 @strlen(i8* %16)
%18 = icmp slt i32 %15, %17
br i1 %18, label %19, label %38
19: ; preds = %14
%20 = load i8*, i8** %7
%21 = load i32, i32* %13
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = load i32, i32* %8
%26 = load i32, i32* %13
%27 = mul nsw i32 %26, 8
%28 = mul nsw i32 %27, 4
%29 = add nsw i32 %25, %28
%30 = load i32, i32* %9
%31 = load i32, i32* %10
%32 = load i32, i32* %11
%33 = load i8*, i8** %12
%34 = call i32 @put_charx4(i8 signext %24, i32 %29, i32 %30, i32 %31, i32 %32, i8* %33)
br label %35
35: ; preds = %19
%36 = load i32, i32* %13
%37 = add nsw i32 %36, 1
store i32 %37, i32* %13
br label %14
38: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @vmwTextXYx4(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = tail call i32 @strlen(i8* %0)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %6, %9
%10 = phi i64 [ %17, %9 ], [ 0, %6 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = trunc i64 %10 to i32
%14 = shl i32 %13, 5
%15 = add i32 %14, %1
%16 = tail call i32 @put_charx4(i8 signext %12, i32 %15, i32 %2, i32 %3, i32 %4, i8* %5)
%17 = add nuw nsw i64 %10, 1
%18 = tail call i32 @strlen(i8* %0)
%19 = sext i32 %18 to i64
%20 = icmp slt i64 %17, %19
br i1 %20, label %9, label %21
21: ; preds = %9, %6
ret void
}