#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;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ GL_QUADS;
int /*<<< orphan*/ GL_QUAD_STRIP;
int /*<<< orphan*/ GL_TRIANGLES;
int /*<<< orphan*/ GL_TRIANGLE_FAN;
int /*<<< orphan*/ GL_TRIANGLE_STRIP;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, double *);
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glColor4fv(double *);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glNormal3fv(double *);
int /*<<< orphan*/ glRotatef(double, double, double, double);
int /*<<< orphan*/ glScalef(double, double, double);
int /*<<< orphan*/ glVertex3fv(double *);
double sqrt(double);
void drawresource(char *resourcename) {
  FILE *file;
  GLfloat a[4];
  GLfloat nlen;
  char x, tempchar;
  int begun = 0;
  file = fopen(resourcename, "r");
  if (file == NULL)
    return;
  while (!feof(file)) {
    x = fgetc(file);
    switch (x) {
    case 'F':
      if (!begun) {
        glBegin(GL_TRIANGLE_FAN);
        begun = 1;
      }
      break;
    case 'Q':
      if (!begun) {
        glBegin(GL_QUAD_STRIP);
        begun = 1;
      }
      break;
    case 'q':
      if (!begun) {
        glBegin(GL_QUADS);
        begun = 1;
      }
      break;
    case 'T':
      if (!begun) {
        glBegin(GL_TRIANGLE_STRIP);
        begun = 1;
      }
      break;
    case 'E':
      if (begun) {
        glEnd();
        begun = 0;
      }
      break;
    case 't':
      if (!begun) {
        glBegin(GL_TRIANGLES);
        begun = 1;
      }
      break;
    case 'S':
      fscanf(file, "%f", &a[0]);
      fscanf(file, "%f", &a[1]);
      fscanf(file, "%f", &a[2]);
      glScalef(a[0], a[1], a[2]);
      break;
    case 'R':
      fscanf(file, "%f", &a[0]);
      fscanf(file, "%f", &a[1]);
      fscanf(file, "%f", &a[2]);
      fscanf(file, "%f", &a[3]);
      glRotatef(a[0], a[1], a[2], a[3]);
      break;
    case 'c':
      fscanf(file, "%f", &a[0]);
      fscanf(file, "%f", &a[1]);
      fscanf(file, "%f", &a[2]);
      fscanf(file, "%f", &a[3]);
      glColor4fv(a);
      break;
    case '{':
      fscanf(file, "%f", &a[0]);
      fscanf(file, "%f", &a[1]);
      fscanf(file, "%f", &a[2]);
      if (begun)
        glVertex3fv(a);
      break;
    case '[':
      fscanf(file, "%f", &a[0]);
      fscanf(file, "%f", &a[1]);
      fscanf(file, "%f", &a[2]);
      nlen = sqrt((double)(a[0] * a[0] + a[1] * a[1] + a[2] * a[2]));
      if (nlen == 0.0)
        break;
      a[0] /= nlen;
      a[1] /= nlen;
      a[2] /= nlen;
      glNormal3fv(a);
      break;
    case '#':
      tempchar = fgetc(file);
      while (tempchar != '\n') {
        tempchar = fgetc(file);
      }
      break;
    default:;
    }
  }
  fclose(file);
  if (begun)
    glEnd();
}


x86 assembly (clang, -O0):
<drawresource>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xf76(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1207 <drawresource+0x37>
jmp    1601 <drawresource+0x431>
jmp    120c <drawresource+0x3c>
mov    -0x10(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    122a <drawresource+0x5a>
jmp    15e7 <drawresource+0x417>
mov    -0x10(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %al,-0x39(%rbp)
movsbl -0x39(%rbp),%eax
add    $0xffffffdd,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0x58,%eax
ja     15dd <drawresource+0x40d>
mov    -0x48(%rbp),%rax
lea    0xda9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x0,-0x40(%rbp)
jne    127f <drawresource+0xaf>
mov    0x2d4f(%rip),%rax
mov    (%rax),%edi
call   10e0 <glBegin@plt>
movl   $0x1,-0x40(%rbp)
jmp    15e2 <drawresource+0x412>
cmpl   $0x0,-0x40(%rbp)
jne    12a3 <drawresource+0xd3>
mov    0x2d43(%rip),%rax
mov    (%rax),%edi
call   10e0 <glBegin@plt>
movl   $0x1,-0x40(%rbp)
jmp    15e2 <drawresource+0x412>
cmpl   $0x0,-0x40(%rbp)
jne    12c7 <drawresource+0xf7>
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
call   10e0 <glBegin@plt>
movl   $0x1,-0x40(%rbp)
jmp    15e2 <drawresource+0x412>
cmpl   $0x0,-0x40(%rbp)
jne    12eb <drawresource+0x11b>
mov    0x2d1b(%rip),%rax
mov    (%rax),%edi
call   10e0 <glBegin@plt>
movl   $0x1,-0x40(%rbp)
jmp    15e2 <drawresource+0x412>
cmpl   $0x0,-0x40(%rbp)
je     1308 <drawresource+0x138>
mov    $0x0,%al
call   1080 <glEnd@plt>
movl   $0x0,-0x40(%rbp)
jmp    15e2 <drawresource+0x412>
cmpl   $0x0,-0x40(%rbp)
jne    132c <drawresource+0x15c>
mov    0x2caa(%rip),%rax
mov    (%rax),%edi
call   10e0 <glBegin@plt>
movl   $0x1,-0x40(%rbp)
jmp    15e2 <drawresource+0x412>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    0xe26(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
add    $0x8,%rdx
lea    0xe0e(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
add    $0x10,%rdx
lea    0xdf6(%rip),%rsi
call   1060 <fscanf@plt>
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   10a0 <glScalef@plt>
jmp    15e2 <drawresource+0x412>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    0xdc9(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
add    $0x8,%rdx
lea    0xdb1(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
add    $0x10,%rdx
lea    0xd99(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
add    $0x18,%rdx
lea    0xd81(%rip),%rsi
call   1060 <fscanf@plt>
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
call   10f0 <glRotatef@plt>
jmp    15e2 <drawresource+0x412>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    0xd4f(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
add    $0x8,%rdx
lea    0xd37(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
add    $0x10,%rdx
lea    0xd1f(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
add    $0x18,%rdx
lea    0xd07(%rip),%rsi
call   1060 <fscanf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <glColor4fv@plt>
jmp    15e2 <drawresource+0x412>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    0xce5(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
add    $0x8,%rdx
lea    0xccd(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
add    $0x10,%rdx
lea    0xcb5(%rip),%rsi
call   1060 <fscanf@plt>
cmpl   $0x0,-0x40(%rbp)
je     14c9 <drawresource+0x2f9>
lea    -0x30(%rbp),%rdi
call   10b0 <glVertex3fv@plt>
jmp    15e2 <drawresource+0x412>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    0xc89(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
add    $0x8,%rdx
lea    0xc71(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
add    $0x10,%rdx
lea    0xc59(%rip),%rsi
call   1060 <fscanf@plt>
movsd  -0x30(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   10d0 <sqrt@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1567 <drawresource+0x397>
jp     1567 <drawresource+0x397>
jmp    15e2 <drawresource+0x412>
movsd  -0x38(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x38(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x38(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
call   1050 <glNormal3fv@plt>
jmp    15e2 <drawresource+0x412>
mov    -0x10(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %al,-0x3a(%rbp)
movsbl -0x3a(%rbp),%eax
cmp    $0xa,%eax
je     15d8 <drawresource+0x408>
mov    -0x10(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %al,-0x3a(%rbp)
jmp    15ba <drawresource+0x3ea>
jmp    15e2 <drawresource+0x412>
jmp    15e2 <drawresource+0x412>
jmp    120c <drawresource+0x3c>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
cmpl   $0x0,-0x40(%rbp)
je     1601 <drawresource+0x431>
mov    $0x0,%al
call   1080 <glEnd@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawresource>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xf87(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     14ea <drawresource+0x31a>
mov    %rax,%rbx
mov    %rax,%rdi
call   1090 <feof@plt>
test   %eax,%eax
je     120f <drawresource+0x3f>
mov    %rbx,%rdi
call   1030 <fclose@plt>
jmp    14ea <drawresource+0x31a>
lea    0x10(%rsp),%r15
xor    %r14d,%r14d
lea    0xdea(%rip),%r12
lea    0xf49(%rip),%r13
mov    %rsp,%rbp
jmp    1247 <drawresource+0x77>
mov    (%rax),%edi
call   10e0 <glBegin@plt>
mov    $0x1,%r14d
mov    %rbx,%rdi
call   1090 <feof@plt>
test   %eax,%eax
jne    14d6 <drawresource+0x306>
mov    %rbx,%rdi
call   1070 <fgetc@plt>
movsbl %al,%eax
add    $0xffffffdd,%eax
cmp    $0x58,%eax
ja     1237 <drawresource+0x67>
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1070 <fgetc@plt>
cmp    $0xa,%al
jne    1270 <drawresource+0xa0>
jmp    1237 <drawresource+0x67>
test   %r14d,%r14d
mov    $0x0,%r14d
je     1237 <drawresource+0x67>
xor    %r14d,%r14d
xor    %eax,%eax
call   1080 <glEnd@plt>
jmp    1237 <drawresource+0x67>
test   %r14d,%r14d
jne    1231 <drawresource+0x61>
mov    0x2d1f(%rip),%rax
jmp    122a <drawresource+0x5a>
test   %r14d,%r14d
jne    1231 <drawresource+0x61>
mov    0x2d29(%rip),%rax
jmp    122a <drawresource+0x5a>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
lea    0x8(%rsp),%rdx
call   1060 <fscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
call   1060 <fscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
lea    0x18(%rsp),%rdx
call   1060 <fscanf@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
call   10f0 <glRotatef@plt>
jmp    1237 <drawresource+0x67>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
lea    0x8(%rsp),%rdx
call   1060 <fscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
call   1060 <fscanf@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
call   10a0 <glScalef@plt>
jmp    1237 <drawresource+0x67>
test   %r14d,%r14d
jne    1231 <drawresource+0x61>
mov    0x2c90(%rip),%rax
jmp    122a <drawresource+0x5a>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
lea    0x8(%rsp),%rdx
call   1060 <fscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
call   1060 <fscanf@plt>
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xc3a(%rip),%xmm0
jb     1486 <drawresource+0x2b6>
sqrtsd %xmm0,%xmm0
jmp    148b <drawresource+0x2bb>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
lea    0x8(%rsp),%rdx
call   1060 <fscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
call   1060 <fscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
lea    0x18(%rsp),%rdx
call   1060 <fscanf@plt>
mov    %rbp,%rdi
call   1040 <glColor4fv@plt>
jmp    1237 <drawresource+0x67>
test   %r14d,%r14d
jne    1231 <drawresource+0x61>
mov    0x2bb2(%rip),%rax
jmp    122a <drawresource+0x5a>
test   %r14d,%r14d
jne    1231 <drawresource+0x61>
mov    0x2b85(%rip),%rax
jmp    122a <drawresource+0x5a>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
lea    0x8(%rsp),%rdx
call   1060 <fscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
call   1060 <fscanf@plt>
test   %r14d,%r14d
je     14ce <drawresource+0x2fe>
mov    %rbp,%rdi
call   10b0 <glVertex3fv@plt>
jmp    1231 <drawresource+0x61>
call   10d0 <sqrt@plt>
ucomisd 0xb6d(%rip),%xmm0
jne    149b <drawresource+0x2cb>
jnp    1237 <drawresource+0x67>
movapd (%rsp),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
divpd  %xmm2,%xmm1
movapd %xmm1,(%rsp)
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    %rbp,%rdi
call   1050 <glNormal3fv@plt>
jmp    1237 <drawresource+0x67>
xor    %r14d,%r14d
jmp    1237 <drawresource+0x67>
mov    %rbx,%rdi
call   1030 <fclose@plt>
test   %r14d,%r14d
je     14ea <drawresource+0x31a>
xor    %eax,%eax
call   1080 <glEnd@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@GL_TRIANGLE_FAN = global i32 0
@GL_QUAD_STRIP = global i32 0
@GL_QUADS = global i32 0
@GL_TRIANGLE_STRIP = global i32 0
@GL_TRIANGLES = global i32 0
@.str.1 = [3 x i8] c"%f\00"
define void @drawresource(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca [4 x double]
%5 = alloca double
%6 = alloca i8
%7 = alloca i8
%8 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %8
%9 = load i8*, i8** %2
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %3
%11 = load i32*, i32** %3
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %14
13: ; preds = %1
br label %200
14: ; preds = %1
br label %15
15: ; preds = %192, %14
%16 = load i32*, i32** %3
%17 = call i32 @feof(i32* %16)
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
br i1 %19, label %20, label %193
20: ; preds = %15
%21 = load i32*, i32** %3
%22 = call signext i8 @fgetc(i32* %21)
store i8 %22, i8* %6
%23 = load i8, i8* %6
%24 = sext i8 %23 to i32
switch i32 %24, label %191 [
i32 70, label %25
i32 81, label %32
i32 113, label %39
i32 84, label %46
i32 69, label %53
i32 116, label %59
i32 83, label %66
i32 82, label %83
i32 99, label %105
i32 123, label %120
i32 91, label %136
i32 35, label %180
]
25: ; preds = %20
%26 = load i32, i32* %8
%27 = icmp ne i32 %26, 0
br i1 %27, label %31, label %28
28: ; preds = %25
%29 = load i32, i32* @GL_TRIANGLE_FAN
%30 = call i32 @glBegin(i32 %29)
store i32 1, i32* %8
br label %31
31: ; preds = %28, %25
br label %192
32: ; preds = %20
%33 = load i32, i32* %8
%34 = icmp ne i32 %33, 0
br i1 %34, label %38, label %35
35: ; preds = %32
%36 = load i32, i32* @GL_QUAD_STRIP
%37 = call i32 @glBegin(i32 %36)
store i32 1, i32* %8
br label %38
38: ; preds = %35, %32
br label %192
39: ; preds = %20
%40 = load i32, i32* %8
%41 = icmp ne i32 %40, 0
br i1 %41, label %45, label %42
42: ; preds = %39
%43 = load i32, i32* @GL_QUADS
%44 = call i32 @glBegin(i32 %43)
store i32 1, i32* %8
br label %45
45: ; preds = %42, %39
br label %192
46: ; preds = %20
%47 = load i32, i32* %8
%48 = icmp ne i32 %47, 0
br i1 %48, label %52, label %49
49: ; preds = %46
%50 = load i32, i32* @GL_TRIANGLE_STRIP
%51 = call i32 @glBegin(i32 %50)
store i32 1, i32* %8
br label %52
52: ; preds = %49, %46
br label %192
53: ; preds = %20
%54 = load i32, i32* %8
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = call i32 (...) @glEnd()
store i32 0, i32* %8
br label %58
58: ; preds = %56, %53
br label %192
59: ; preds = %20
%60 = load i32, i32* %8
%61 = icmp ne i32 %60, 0
br i1 %61, label %65, label %62
62: ; preds = %59
%63 = load i32, i32* @GL_TRIANGLES
%64 = call i32 @glBegin(i32 %63)
store i32 1, i32* %8
br label %65
65: ; preds = %62, %59
br label %192
66: ; preds = %20
%67 = load i32*, i32** %3
%68 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%69 = call i32 @fscanf(i32* %67, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %68)
%70 = load i32*, i32** %3
%71 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 1
%72 = call i32 @fscanf(i32* %70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %71)
%73 = load i32*, i32** %3
%74 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 2
%75 = call i32 @fscanf(i32* %73, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %74)
%76 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%77 = load double, double* %76
%78 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 1
%79 = load double, double* %78
%80 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 2
%81 = load double, double* %80
%82 = call i32 @glScalef(double %77, double %79, double %81)
br label %192
83: ; preds = %20
%84 = load i32*, i32** %3
%85 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%86 = call i32 @fscanf(i32* %84, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %85)
%87 = load i32*, i32** %3
%88 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 1
%89 = call i32 @fscanf(i32* %87, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %88)
%90 = load i32*, i32** %3
%91 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 2
%92 = call i32 @fscanf(i32* %90, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %91)
%93 = load i32*, i32** %3
%94 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 3
%95 = call i32 @fscanf(i32* %93, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %94)
%96 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%97 = load double, double* %96
%98 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 1
%99 = load double, double* %98
%100 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 2
%101 = load double, double* %100
%102 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 3
%103 = load double, double* %102
%104 = call i32 @glRotatef(double %97, double %99, double %101, double %103)
br label %192
105: ; preds = %20
%106 = load i32*, i32** %3
%107 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%108 = call i32 @fscanf(i32* %106, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %107)
%109 = load i32*, i32** %3
%110 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 1
%111 = call i32 @fscanf(i32* %109, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %110)
%112 = load i32*, i32** %3
%113 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 2
%114 = call i32 @fscanf(i32* %112, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %113)
%115 = load i32*, i32** %3
%116 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 3
%117 = call i32 @fscanf(i32* %115, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %116)
%118 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%119 = call i32 @glColor4fv(double* %118)
br label %192
120: ; preds = %20
%121 = load i32*, i32** %3
%122 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%123 = call i32 @fscanf(i32* %121, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %122)
%124 = load i32*, i32** %3
%125 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 1
%126 = call i32 @fscanf(i32* %124, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %125)
%127 = load i32*, i32** %3
%128 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 2
%129 = call i32 @fscanf(i32* %127, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %128)
%130 = load i32, i32* %8
%131 = icmp ne i32 %130, 0
br i1 %131, label %132, label %135
132: ; preds = %120
%133 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%134 = call i32 @glVertex3fv(double* %133)
br label %135
135: ; preds = %132, %120
br label %192
136: ; preds = %20
%137 = load i32*, i32** %3
%138 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%139 = call i32 @fscanf(i32* %137, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %138)
%140 = load i32*, i32** %3
%141 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 1
%142 = call i32 @fscanf(i32* %140, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %141)
%143 = load i32*, i32** %3
%144 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 2
%145 = call i32 @fscanf(i32* %143, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %144)
%146 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%147 = load double, double* %146
%148 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%149 = load double, double* %148
%150 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 1
%151 = load double, double* %150
%152 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 1
%153 = load double, double* %152
%154 = fmul double %151, %153
%155 = call double @llvm.fmuladd.f64(double %147, double %149, double %154)
%156 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 2
%157 = load double, double* %156
%158 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 2
%159 = load double, double* %158
%160 = call double @llvm.fmuladd.f64(double %157, double %159, double %155)
%161 = call double @sqrt(double %160)
store double %161, double* %5
%162 = load double, double* %5
%163 = fcmp oeq double %162, 0.000000e+00
br i1 %163, label %164, label %165
164: ; preds = %136
br label %192
165: ; preds = %136
%166 = load double, double* %5
%167 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%168 = load double, double* %167
%169 = fdiv double %168, %166
store double %169, double* %167
%170 = load double, double* %5
%171 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 1
%172 = load double, double* %171
%173 = fdiv double %172, %170
store double %173, double* %171
%174 = load double, double* %5
%175 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 2
%176 = load double, double* %175
%177 = fdiv double %176, %174
store double %177, double* %175
%178 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%179 = call i32 @glNormal3fv(double* %178)
br label %192
180: ; preds = %20
%181 = load i32*, i32** %3
%182 = call signext i8 @fgetc(i32* %181)
store i8 %182, i8* %7
br label %183
183: ; preds = %187, %180
%184 = load i8, i8* %7
%185 = sext i8 %184 to i32
%186 = icmp ne i32 %185, 10
br i1 %186, label %187, label %190
187: ; preds = %183
%188 = load i32*, i32** %3
%189 = call signext i8 @fgetc(i32* %188)
store i8 %189, i8* %7
br label %183
190: ; preds = %183
br label %192
191: ; preds = %20
br label %192
192: ; preds = %191, %190, %165, %164, %135, %105, %83, %66, %65, %58, %52, %45, %38, %31
br label %15
193: ; preds = %15
%194 = load i32*, i32** %3
%195 = call i32 @fclose(i32* %194)
%196 = load i32, i32* %8
%197 = icmp ne i32 %196, 0
br i1 %197, label %198, label %200
198: ; preds = %193
%199 = call i32 (...) @glEnd()
br label %200
200: ; preds = %13, %198, %193
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@GL_TRIANGLE_FAN = global i32 0
@GL_QUAD_STRIP = global i32 0
@GL_QUADS = global i32 0
@GL_TRIANGLE_STRIP = global i32 0
@GL_TRIANGLES = global i32 0
@.str.1 = [3 x i8] c"%f\00"
define void @drawresource(i8* nocapture %0) {
%2 = alloca [4 x double]
%3 = bitcast [4 x double]* %2 to i8*
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %117, label %6
6: ; preds = %1
%7 = call i32 @feof(i32* %4)
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = call i32 @fclose(i32* %4)
br label %117
11: ; preds = %6
%12 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%13 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 1
%14 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 2
%15 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 3
%16 = bitcast [4 x double]* %2 to <2 x double>*
%17 = bitcast [4 x double]* %2 to <2 x double>*
br label %18
18: ; preds = %11, %108
%19 = phi i32 [ 0, %11 ], [ %109, %108 ]
%20 = call signext i8 @fgetc(i32* %4)
%21 = sext i8 %20 to i32
switch i32 %21, label %108 [
i32 70, label %22
i32 81, label %27
i32 113, label %32
i32 84, label %37
i32 69, label %42
i32 116, label %46
i32 83, label %51
i32 82, label %59
i32 99, label %69
i32 123, label %75
i32 91, label %82
i32 35, label %102
]
22: ; preds = %18
%23 = icmp eq i32 %19, 0
br i1 %23, label %24, label %108
24: ; preds = %22
%25 = load i32, i32* @GL_TRIANGLE_FAN
%26 = call i32 @glBegin(i32 %25)
br label %108
27: ; preds = %18
%28 = icmp eq i32 %19, 0
br i1 %28, label %29, label %108
29: ; preds = %27
%30 = load i32, i32* @GL_QUAD_STRIP
%31 = call i32 @glBegin(i32 %30)
br label %108
32: ; preds = %18
%33 = icmp eq i32 %19, 0
br i1 %33, label %34, label %108
34: ; preds = %32
%35 = load i32, i32* @GL_QUADS
%36 = call i32 @glBegin(i32 %35)
br label %108
37: ; preds = %18
%38 = icmp eq i32 %19, 0
br i1 %38, label %39, label %108
39: ; preds = %37
%40 = load i32, i32* @GL_TRIANGLE_STRIP
%41 = call i32 @glBegin(i32 %40)
br label %108
42: ; preds = %18
%43 = icmp eq i32 %19, 0
br i1 %43, label %108, label %44
44: ; preds = %42
%45 = call i32 (...) @glEnd()
br label %108
46: ; preds = %18
%47 = icmp eq i32 %19, 0
br i1 %47, label %48, label %108
48: ; preds = %46
%49 = load i32, i32* @GL_TRIANGLES
%50 = call i32 @glBegin(i32 %49)
br label %108
51: ; preds = %18
%52 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %12)
%53 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %13)
%54 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %14)
%55 = load double, double* %12
%56 = load double, double* %13
%57 = load double, double* %14
%58 = call i32 @glScalef(double %55, double %56, double %57)
br label %108
59: ; preds = %18
%60 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %12)
%61 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %13)
%62 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %14)
%63 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %15)
%64 = load double, double* %12
%65 = load double, double* %13
%66 = load double, double* %14
%67 = load double, double* %15
%68 = call i32 @glRotatef(double %64, double %65, double %66, double %67)
br label %108
69: ; preds = %18
%70 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %12)
%71 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %13)
%72 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %14)
%73 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %15)
%74 = call i32 @glColor4fv(double* %12)
br label %108
75: ; preds = %18
%76 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %12)
%77 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %13)
%78 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %14)
%79 = icmp eq i32 %19, 0
br i1 %79, label %108, label %80
80: ; preds = %75
%81 = call i32 @glVertex3fv(double* %12)
br label %108
82: ; preds = %18
%83 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %12)
%84 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %13)
%85 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %14)
%86 = load double, double* %12
%87 = load double, double* %13
%88 = fmul double %87, %87
%89 = call double @llvm.fmuladd.f64(double %86, double %86, double %88)
%90 = load double, double* %14
%91 = call double @llvm.fmuladd.f64(double %90, double %90, double %89)
%92 = call double @sqrt(double %91)
%93 = fcmp oeq double %92, 0.000000e+00
br i1 %93, label %108, label %94
94: ; preds = %82
%95 = load <2 x double>, <2 x double>* %16
%96 = insertelement <2 x double> poison, double %92, i64 0
%97 = shufflevector <2 x double> %96, <2 x double> poison, <2 x i32> zeroinitializer
%98 = fdiv <2 x double> %95, %97
store <2 x double> %98, <2 x double>* %17
%99 = load double, double* %14
%100 = fdiv double %99, %92
store double %100, double* %14
%101 = call i32 @glNormal3fv(double* %12)
br label %108
102: ; preds = %18
%103 = call signext i8 @fgetc(i32* %4)
%104 = icmp eq i8 %103, 10
br i1 %104, label %108, label %105
105: ; preds = %102, %105
%106 = call signext i8 @fgetc(i32* %4)
%107 = icmp eq i8 %106, 10
br i1 %107, label %108, label %105
108: ; preds = %105, %102, %18, %82, %75, %80, %46, %48, %42, %44, %37, %39, %32, %34, %27, %29, %22, %24, %94, %69, %59, %51
%109 = phi i32 [ %19, %18 ], [ %19, %82 ], [ %19, %94 ], [ 1, %80 ], [ 0, %75 ], [ %19, %69 ], [ %19, %59 ], [ %19, %51 ], [ 1, %46 ], [ 1, %48 ], [ 0, %44 ], [ 0, %42 ], [ 1, %37 ], [ 1, %39 ], [ 1, %32 ], [ 1, %34 ], [ 1, %27 ], [ 1, %29 ], [ 1, %22 ], [ 1, %24 ], [ %19, %102 ], [ %19, %105 ]
%110 = call i32 @feof(i32* %4)
%111 = icmp eq i32 %110, 0
br i1 %111, label %18, label %112
112: ; preds = %108
%113 = call i32 @fclose(i32* %4)
%114 = icmp eq i32 %109, 0
br i1 %114, label %117, label %115
115: ; preds = %112
%116 = call i32 (...) @glEnd()
br label %117
117: ; preds = %9, %112, %115, %1
ret void
}