#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_STROKE_MONO_ROMAN;
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScalef(double, double, double);
int /*<<< orphan*/ glTranslatef(int, double, double);
int /*<<< orphan*/ glutStrokeCharacter(int /*<<< orphan*/, int);
void renderText(int x, int y, const char *text) {
  glPushMatrix();
  float fx = (float)x;
  float fy = (float)y;
  glTranslatef(fx, fy, 0.0);
  glScalef(0.1, 0.1, 0.1);
  for (int i = 0; text[i] != '\0'; i++) {
    glTranslatef(32, 0.0, 0.0);
    glColor3f(0.8, 0.0, 0.0);
    int ch = text[i];
    glutStrokeCharacter(GLUT_STROKE_MONO_ROMAN, ch);
  }
  glPopMatrix();
}


x86 assembly (clang, -O0):
<renderText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    $0x0,%al
call   1070 <glPushMatrix@plt>
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
cvttss2si -0x14(%rbp),%edi
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1080 <glTranslatef@plt>
movsd  0xe55(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1060 <glScalef@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1223 <renderText+0xc3>
mov    $0x20,%edi
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1080 <glTranslatef@plt>
movsd  0xe1e(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1050 <glColor3f@plt>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x20(%rbp)
mov    0x2ddd(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%esi
call   1030 <glutStrokeCharacter@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11bd <renderText+0x5d>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renderText>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %eax,%eax
call   1070 <glPushMatrix@plt>
cvtsi2ss %ebp,%xmm0
cvtsi2ss %r14d,%xmm1
cvttss2si %xmm0,%edi
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
xorps  %xmm1,%xmm1
call   1080 <glTranslatef@plt>
movsd  0xe69(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1060 <glScalef@plt>
cmpb   $0x0,(%rbx)
je     11f8 <renderText+0x98>
add    $0x1,%rbx
mov    0x2e36(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
mov    $0x20,%edi
call   1080 <glTranslatef@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movsd  0xe2a(%rip),%xmm0
call   1050 <glColor3f@plt>
movsbl -0x1(%rbx),%esi
mov    0x0(%rbp),%edi
call   1030 <glutStrokeCharacter@plt>
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    11c0 <renderText+0x60>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <glPopMatrix@plt>

LLVM IR (-O0):
@GLUT_STROKE_MONO_ROMAN = global i32 0
define void @renderText(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca float
%8 = alloca float
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%11 = call i32 (...) @glPushMatrix()
%12 = load i32, i32* %4
%13 = sitofp i32 %12 to float
store float %13, float* %7
%14 = load i32, i32* %5
%15 = sitofp i32 %14 to float
store float %15, float* %8
%16 = load float, float* %7
%17 = fptosi float %16 to i32
%18 = load float, float* %8
%19 = fpext float %18 to double
%20 = call i32 @glTranslatef(i32 %17, double %19, double 0.000000e+00)
%21 = call i32 @glScalef(double 1.000000e-01, double 1.000000e-01, double 1.000000e-01)
store i32 0, i32* %9
br label %22
22: ; preds = %42, %3
%23 = load i8*, i8** %6
%24 = load i32, i32* %9
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %45
30: ; preds = %22
%31 = call i32 @glTranslatef(i32 32, double 0.000000e+00, double 0.000000e+00)
%32 = call i32 @glColor3f(double 8.000000e-01, double 0.000000e+00, double 0.000000e+00)
%33 = load i8*, i8** %6
%34 = load i32, i32* %9
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %33, i64 %35
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
store i32 %38, i32* %10
%39 = load i32, i32* @GLUT_STROKE_MONO_ROMAN
%40 = load i32, i32* %10
%41 = call i32 @glutStrokeCharacter(i32 %39, i32 %40)
br label %42
42: ; preds = %30
%43 = load i32, i32* %9
%44 = add nsw i32 %43, 1
store i32 %44, i32* %9
br label %22
45: ; preds = %22
%46 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
@GLUT_STROKE_MONO_ROMAN = global i32 0
define void @renderText(i32 %0, i32 %1, i8* nocapture %2) {
%4 = tail call i32 (...) @glPushMatrix()
%5 = sitofp i32 %0 to float
%6 = sitofp i32 %1 to float
%7 = fptosi float %5 to i32
%8 = fpext float %6 to double
%9 = tail call i32 @glTranslatef(i32 %7, double %8, double 0.000000e+00)
%10 = tail call i32 @glScalef(double 1.000000e-01, double 1.000000e-01, double 1.000000e-01)
%11 = load i8, i8* %2
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %15, %3
%14 = tail call i32 (...) @glPopMatrix()
ret void
15: ; preds = %3, %15
%16 = phi i64 [ %24, %15 ], [ 0, %3 ]
%17 = phi i8* [ %25, %15 ], [ %2, %3 ]
%18 = tail call i32 @glTranslatef(i32 32, double 0.000000e+00, double 0.000000e+00)
%19 = tail call i32 @glColor3f(double 8.000000e-01, double 0.000000e+00, double 0.000000e+00)
%20 = load i8, i8* %17
%21 = sext i8 %20 to i32
%22 = load i32, i32* @GLUT_STROKE_MONO_ROMAN
%23 = tail call i32 @glutStrokeCharacter(i32 %22, i32 %21)
%24 = add nuw i64 %16, 1
%25 = getelementptr inbounds i8, i8* %2, i64 %24
%26 = load i8, i8* %25
%27 = icmp eq i8 %26, 0
br i1 %27, label %13, label %15
}