#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 double GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GLUT_STROKE_ROMAN;
int /*<<< orphan*/ glLineWidth(double);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScalef(double, double, double);
int /*<<< orphan*/ glutStrokeCharacter(int /*<<< orphan*/, char);
scalar_t__ strlen(char *);
void drawText(char *s) {
  int i;
  GLfloat k = 0.001;
  glPushMatrix();
  glLineWidth(2.0);
  glScalef(k, k, k);
  for (i = 0; i < (int)strlen(s); i++) {
    glutStrokeCharacter(GLUT_STROKE_ROMAN, s[i]);
  }
  glPopMatrix();
}


x86 assembly (clang, -O0):
<drawText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xe94(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1080 <glPushMatrix@plt>
movsd  0xe78(%rip),%xmm0
call   1030 <glLineWidth@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1070 <glScalef@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    11ed <drawText+0x8d>
mov    0x2e1c(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
call   1050 <glutStrokeCharacter@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11a8 <drawText+0x48>
mov    $0x0,%al
call   1060 <glPopMatrix@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawText>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1080 <glPushMatrix@plt>
movsd  0xe89(%rip),%xmm0
call   1030 <glLineWidth@plt>
movsd  0xe84(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1070 <glScalef@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    11d0 <drawText+0x70>
xor    %ebx,%ebx
mov    0x2e44(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r15),%edi
movsbl (%r14,%rbx,1),%esi
call   1050 <glutStrokeCharacter@plt>
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     11b0 <drawText+0x50>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <glPopMatrix@plt>

LLVM IR (-O0):
@GLUT_STROKE_ROMAN = global i32 0
define void @drawText(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca double
store i8* %0, i8** %2
store double 1.000000e-03, double* %4
%5 = call i32 (...) @glPushMatrix()
%6 = call i32 @glLineWidth(double 2.000000e+00)
%7 = load double, double* %4
%8 = load double, double* %4
%9 = load double, double* %4
%10 = call i32 @glScalef(double %7, double %8, double %9)
store i32 0, i32* %3
br label %11
11: ; preds = %25, %1
%12 = load i32, i32* %3
%13 = load i8*, i8** %2
%14 = call i64 @strlen(i8* %13)
%15 = trunc i64 %14 to i32
%16 = icmp slt i32 %12, %15
br i1 %16, label %17, label %28
17: ; preds = %11
%18 = load i32, i32* @GLUT_STROKE_ROMAN
%19 = load i8*, i8** %2
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = call i32 @glutStrokeCharacter(i32 %18, i8 signext %23)
br label %25
25: ; preds = %17
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %11
28: ; preds = %11
%29 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
@GLUT_STROKE_ROMAN = global i32 0
define void @drawText(i8* nocapture %0) {
%2 = tail call i32 (...) @glPushMatrix()
%3 = tail call i32 @glLineWidth(double 2.000000e+00)
%4 = tail call i32 @glScalef(double 1.000000e-03, double 1.000000e-03, double 1.000000e-03)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = trunc i64 %5 to i32
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %1, %8
%9 = phi i64 [ %14, %8 ], [ 0, %1 ]
%10 = load i32, i32* @GLUT_STROKE_ROMAN
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = tail call i32 @glutStrokeCharacter(i32 %10, i8 signext %12)
%14 = add nuw nsw i64 %9, 1
%15 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%16 = shl i64 %15, 32
%17 = ashr exact i64 %16, 32
%18 = icmp slt i64 %14, %17
br i1 %18, label %8, label %19
19: ; preds = %8, %1
%20 = tail call i32 (...) @glPopMatrix()
ret void
}