#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*/ GLUT_BITMAP_TIMES_ROMAN_24;
int /*<<< orphan*/ glRasterPos3f(float, float, float);
int /*<<< orphan*/ glutBitmapCharacter(int /*<<< orphan*/, int);
int strlen(char *);
void drawText(char *text, float x, float y, float z) {
  glRasterPos3f(x, y, z);
  int i;
  for (i = 0; i < strlen(text); i++) {
    glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, (int)text[i]);
  }
}


x86 assembly (clang, -O0):
<drawText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1030 <glRasterPos3f@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    11aa <drawText+0x7a>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
call   1040 <glutBitmapCharacter@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1166 <drawText+0x36>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawText>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <glRasterPos3f@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    1180 <drawText+0x50>
xor    %ebx,%ebx
mov    0x2e8e(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15),%edi
movsbl (%r14,%rbx,1),%esi
call   1040 <glutBitmapCharacter@plt>
add    $0x1,%rbx
mov    %r14,%rdi
call   1050 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1160 <drawText+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

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

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