#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*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScalef(double, double, double);
int /*<<< orphan*/ glTranslatef(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ glutStrokeCharacter(void *, char);
void strokeString(int x, int y, char *msg, void *font) {
  glPushMatrix();
  glTranslatef(x, y, 0);
  glScalef(.04, .04, .04);
  while (*msg) {
    glutStrokeCharacter(font, *msg);
    msg++;
  }
  glPopMatrix();
}


x86 assembly (clang, -O0):
<strokeString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    $0x0,%al
call   1060 <glPushMatrix@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1070 <glTranslatef@plt>
movsd  0xe7e(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1050 <glScalef@plt>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11bb <strokeString+0x6b>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <glutStrokeCharacter@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    118d <strokeString+0x3d>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strokeString>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %edi,%ebp
xor    %eax,%eax
call   1060 <glPushMatrix@plt>
mov    %ebp,%edi
mov    %r15d,%esi
xor    %edx,%edx
call   1070 <glTranslatef@plt>
movsd  0xe83(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1050 <glScalef@plt>
mov    (%rbx),%al
test   %al,%al
je     11b6 <strokeString+0x66>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <glutStrokeCharacter@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    11a0 <strokeString+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <glPopMatrix@plt>

LLVM IR (-O0):
define void @strokeString(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = call i32 (...) @glPushMatrix()
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @glTranslatef(i32 %10, i32 %11, i32 0)
%13 = call i32 @glScalef(double 4.000000e-02, double 4.000000e-02, double 4.000000e-02)
br label %14
14: ; preds = %18, %4
%15 = load i8*, i8** %7
%16 = load i8, i8* %15
%17 = icmp ne i8 %16, 0
br i1 %17, label %18, label %25
18: ; preds = %14
%19 = load i8*, i8** %8
%20 = load i8*, i8** %7
%21 = load i8, i8* %20
%22 = call i32 @glutStrokeCharacter(i8* %19, i8 signext %21)
%23 = load i8*, i8** %7
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %7
br label %14
25: ; preds = %14
%26 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @strokeString(i32 %0, i32 %1, i8* nocapture %2, i8* %3) {
%5 = tail call i32 (...) @glPushMatrix()
%6 = tail call i32 @glTranslatef(i32 %0, i32 %1, i32 0)
%7 = tail call i32 @glScalef(double 4.000000e-02, double 4.000000e-02, double 4.000000e-02)
%8 = load i8, i8* %2
%9 = icmp eq i8 %8, 0
br i1 %9, label %17, label %10
10: ; preds = %4, %10
%11 = phi i8 [ %15, %10 ], [ %8, %4 ]
%12 = phi i8* [ %14, %10 ], [ %2, %4 ]
%13 = tail call i32 @glutStrokeCharacter(i8* %3, i8 signext %11)
%14 = getelementptr inbounds i8, i8* %12, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %10
17: ; preds = %10, %4
%18 = tail call i32 (...) @glPopMatrix()
ret void
}