#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_charx2(char, int, int, int, int, int, int,
                              unsigned char *);
int strlen(char *);
void vmwTextXYx2(char *string, int x, int y, int color, int background,
                 int overwrite, int which_font, unsigned char *buffer) {
  int i;
  for (i = 0; i < strlen(string); i++) {
    put_charx2(string[i], x + (i * 8 * 2), y, color, background, overwrite,
               which_font, buffer);
  }
}


x86 assembly (clang, -O0):
<vmwTextXYx2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
cmp    %ecx,%eax
jge    11b7 <vmwTextXYx2+0x97>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%dil
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%eax
shl    $0x3,%eax
shl    $0x1,%eax
add    %eax,%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%rax
movsbl %dil,%edi
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <put_charx2@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    114b <vmwTextXYx2+0x2b>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmwTextXYx2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,0x4(%rsp)
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebx
mov    %rdi,%rbp
call   1030 <strlen@plt>
test   %eax,%eax
jle    118e <vmwTextXYx2+0x6e>
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
movsbl 0x0(%rbp,%r14,1),%edi
mov    %ebx,%esi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    0x4(%rsp),%r9d
push   0x48(%rsp)
mov    0x48(%rsp),%eax
push   %rax
call   1040 <put_charx2@plt>
add    $0x10,%rsp
add    $0x1,%r14
mov    %rbp,%rdi
call   1030 <strlen@plt>
cltq
add    $0x10,%ebx
cmp    %rax,%r14
jl     1150 <vmwTextXYx2+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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