#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_HELVETICA_18;
int /*<<< orphan*/ glRasterPos2f(float, float);
int /*<<< orphan*/ glutBitmapCharacter(int /*<<< orphan*/, char);
void renderBitmapString(float x, float y, char *string) {
  glRasterPos2f(x, y);
  char *c;
  for (c = string; *c != '\0'; c++) {
    if ((*c) == '\n') {
      y -= 0.045;
      glRasterPos2f(x, y);
    } else
      glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, *c);
  }
}


x86 assembly (clang, -O0):
<renderBitmapString>:
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   1040 <glRasterPos2f@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11ca <renderBitmapString+0xaa>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    119f <renderBitmapString+0x7f>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe82(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <glRasterPos2f@plt>
jmp    11b4 <renderBitmapString+0x94>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
movsbl (%rax),%esi
call   1030 <glutBitmapCharacter@plt>
jmp    11b9 <renderBitmapString+0x99>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114d <renderBitmapString+0x2d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renderBitmapString>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movss  %xmm0,0x4(%rsp)
movss  %xmm1,(%rsp)
call   1040 <glRasterPos2f@plt>
mov    0x2ea2(%rip),%r14
jmp    116c <renderBitmapString+0x4c>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xeaf(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
movss  %xmm1,(%rsp)
call   1040 <glRasterPos2f@plt>
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0xa,%al
je     1140 <renderBitmapString+0x20>
test   %al,%al
je     1188 <renderBitmapString+0x68>
mov    (%r14),%edi
movsbl %al,%esi
call   1030 <glutBitmapCharacter@plt>
add    $0x1,%rbx
jmp    116c <renderBitmapString+0x4c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@GLUT_BITMAP_HELVETICA_18 = global i32 0
define void @renderBitmapString(float %0, float %1, i8* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i8*
%7 = alloca i8*
store float %0, float* %4
store float %1, float* %5
store i8* %2, i8** %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = call i32 @glRasterPos2f(float %8, float %9)
%11 = load i8*, i8** %6
store i8* %11, i8** %7
br label %12
12: ; preds = %36, %3
%13 = load i8*, i8** %7
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %39
17: ; preds = %12
%18 = load i8*, i8** %7
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 10
br i1 %21, label %22, label %30
22: ; preds = %17
%23 = load float, float* %5
%24 = fpext float %23 to double
%25 = fsub double %24, 4.500000e-02
%26 = fptrunc double %25 to float
store float %26, float* %5
%27 = load float, float* %4
%28 = load float, float* %5
%29 = call i32 @glRasterPos2f(float %27, float %28)
br label %35
30: ; preds = %17
%31 = load i32, i32* @GLUT_BITMAP_HELVETICA_18
%32 = load i8*, i8** %7
%33 = load i8, i8* %32
%34 = call i32 @glutBitmapCharacter(i32 %31, i8 signext %33)
br label %35
35: ; preds = %30, %22
br label %36
36: ; preds = %35
%37 = load i8*, i8** %7
%38 = getelementptr inbounds i8, i8* %37, i32 1
store i8* %38, i8** %7
br label %12
39: ; preds = %12
ret void
}

LLVM IR (-O2):
@GLUT_BITMAP_HELVETICA_18 = global i32 0
define void @renderBitmapString(float %0, float %1, i8* nocapture %2) {
%4 = tail call i32 @glRasterPos2f(float %0, float %1)
br label %5
5: ; preds = %17, %3
%6 = phi float [ %1, %3 ], [ %18, %17 ]
%7 = phi i8* [ %2, %3 ], [ %19, %17 ]
%8 = load i8, i8* %7
switch i8 %8, label %14 [
i8 0, label %20
i8 10, label %9
]
9: ; preds = %5
%10 = fpext float %6 to double
%11 = fadd double %10, -4.500000e-02
%12 = fptrunc double %11 to float
%13 = tail call i32 @glRasterPos2f(float %0, float %12)
br label %17
14: ; preds = %5
%15 = load i32, i32* @GLUT_BITMAP_HELVETICA_18
%16 = tail call i32 @glutBitmapCharacter(i32 %15, i8 signext %8)
br label %17
17: ; preds = %9, %14
%18 = phi float [ %12, %9 ], [ %6, %14 ]
%19 = getelementptr inbounds i8, i8* %7, i64 1
br label %5
20: ; preds = %5
ret void
}