#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 */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ glColor3f(int, int, int);
int /*<<< orphan*/ glRasterPos2f(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glutBitmapCharacter(void *, int /*<<< orphan*/);
void text(char tex[], GLfloat xtext, GLfloat ytext, void *font) {
  char *p;
  glColor3f(1, 1, 1);
  p = tex;
  glRasterPos2f(xtext, ytext);
  while (*p)
    glutBitmapCharacter(font, *p++);
}


x86 assembly (clang, -O0):
<text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    $0x1,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1050 <glColor3f@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <glRasterPos2f@plt>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1194 <text+0x64>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%esi
call   1030 <glutBitmapCharacter@plt>
jmp    1167 <text+0x37>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<text>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1050 <glColor3f@plt>
mov    %ebp,%edi
mov    %r15d,%esi
call   1040 <glRasterPos2f@plt>
mov    (%rbx),%al
test   %al,%al
je     1186 <text+0x56>
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <glutBitmapCharacter@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1170 <text+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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