#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*/ glRasterPos3f(float, float, float);
int /*<<< orphan*/ glutBitmapCharacter(void *, char);
void renderBitmapString(float x, float y, float z, void *font, char *string) {
  char *c;
  glRasterPos3f(x, y, z);
  for (c = string; *c != '\0'; c++) {
    glutBitmapCharacter(font, *c);
  }
}


x86 assembly (clang, -O0):
<renderBitmapString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <glRasterPos3f@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     118c <renderBitmapString+0x6c>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rax
movsbl (%rax),%esi
call   1040 <glutBitmapCharacter@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    115b <renderBitmapString+0x3b>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renderBitmapString>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <glRasterPos3f@plt>
mov    (%rbx),%al
test   %al,%al
je     1156 <renderBitmapString+0x36>
add    $0x1,%rbx
nopl   0x0(%rax)
movsbl %al,%esi
mov    %r14,%rdi
call   1040 <glutBitmapCharacter@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <renderBitmapString+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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