#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_8_BY_13;
int /*<<< orphan*/ glRasterPos2f(float, float);
int /*<<< orphan*/ glutBitmapCharacter(int /*<<< orphan*/, char);
scalar_t__ strlen(char *);
void output(float x, float y, char *string) {
  int len, i;
  glRasterPos2f(x, y);
  len = (int)strlen(string);
  for (i = 0; i < len; i++) {
    glutBitmapCharacter(GLUT_BITMAP_8_BY_13, string[i]);
  }
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1050 <glRasterPos2f@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    119c <output+0x6c>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
call   1030 <glutBitmapCharacter@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1168 <output+0x38>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <glRasterPos2f@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1177 <output+0x47>
mov    %eax,%r15d
xor    %ebx,%ebx
mov    0x2e88(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    (%r12),%edi
movsbl (%r14,%rbx,1),%esi
call   1030 <glutBitmapCharacter@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1160 <output+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@GLUT_BITMAP_8_BY_13 = global i32 0
define void @output(float %0, float %1, i8* nocapture %2) {
%4 = tail call i32 @glRasterPos2f(float %0, float %1)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%6 = trunc i64 %5 to i32
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %3
%9 = and i64 %5, 4294967295
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 0, %8 ], [ %16, %10 ]
%12 = load i32, i32* @GLUT_BITMAP_8_BY_13
%13 = getelementptr inbounds i8, i8* %2, i64 %11
%14 = load i8, i8* %13
%15 = tail call i32 @glutBitmapCharacter(i32 %12, i8 signext %14)
%16 = add nuw nsw i64 %11, 1
%17 = icmp eq i64 %16, %9
br i1 %17, label %18, label %10
18: ; preds = %10, %3
ret void
}