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

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ SEEK_SET;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ lower_case(char *);
int read_compressed_int(int /*<<< orphan*/ *);
int seek_config_path(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ skip_array(int /*<<< orphan*/ *);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
int read_classes(FILE *f, char *config_path, char *array, int size,
                 size_t buffsize) {
  int i;
  int j;
  int success;
  uint8_t type;
  uint32_t num_entries;
  uint32_t fp;
  char target[512];
  char buffer[512];
  fseek(f, 16, SEEK_SET);
  success = seek_config_path(f, config_path);
  if (success)
    return success;
  while (fgetc(f) != 0)
    ;
  num_entries = read_compressed_int(f);
  for (i = 0; i < num_entries; i++) {
    fp = ftell(f);
    type = fgetc(f);
    if (type == 0) {
      if (fgets(buffer, sizeof(buffer), f) == NULL)
        return 1;
      for (j = 0; j < size; j++) {
        if (*(array + j * buffsize) == 0)
          break;
      }
      if (j == size)
        return 2;
      strncpy(array + j * buffsize, buffer, buffsize);
      fseek(f, fp + strlen(buffer) + 6, SEEK_SET);
    } else if (type == 1) {
      type = fgetc(f);
      if (fgets(buffer, sizeof(buffer), f) == NULL)
        return 1;
      lower_case(buffer);
      if (strcmp(buffer, target) == 0) {
        fseek(f, fp, SEEK_SET);
        return 0;
      }
      fseek(f, fp + strlen(buffer) + 3, SEEK_SET);
      if (type == 0 || type == 4)
        while (fgetc(f) != 0)
          ;
      else
        fseek(f, 4, SEEK_CUR);
    } else if (type == 2) {
      if (fgets(buffer, sizeof(buffer), f) == NULL)
        return 1;
      lower_case(buffer);
      if (strcmp(buffer, target) == 0) {
        fseek(f, fp, SEEK_SET);
        return 0;
      }
      fseek(f, fp + strlen(buffer) + 2, SEEK_SET);
      skip_array(f);
    } else {
      while (fgetc(f) != 0)
        ;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<read_classes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x480,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2dff(%rip),%rax
mov    (%rax),%edx
mov    $0x10,%esi
call   10c0 <fseek@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   10b0 <seek_config_path@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     120a <read_classes+0x5a>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1582 <read_classes+0x3d2>
jmp    120f <read_classes+0x5f>
mov    -0x10(%rbp),%rdi
call   1050 <fgetc@plt>
cmp    $0x0,%eax
je     1226 <read_classes+0x76>
jmp    120f <read_classes+0x5f>
mov    -0x10(%rbp),%rdi
call   1090 <read_compressed_int@plt>
mov    %eax,-0x44(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    157b <read_classes+0x3cb>
mov    -0x10(%rbp),%rdi
call   10a0 <ftell@plt>
mov    %eax,-0x48(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x40(%rbp)
jne    1354 <read_classes+0x1a4>
lea    -0x450(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x200,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    1292 <read_classes+0xe2>
movl   $0x1,-0x4(%rbp)
jmp    1582 <read_classes+0x3d2>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12d7 <read_classes+0x127>
mov    -0x20(%rbp),%rax
movslq -0x38(%rbp),%rcx
imul   -0x30(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    12c4 <read_classes+0x114>
jmp    12d7 <read_classes+0x127>
jmp    12c9 <read_classes+0x119>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1299 <read_classes+0xe9>
mov    -0x38(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    12ef <read_classes+0x13f>
movl   $0x2,-0x4(%rbp)
jmp    1582 <read_classes+0x3d2>
mov    -0x20(%rbp),%rdi
movslq -0x38(%rbp),%rax
imul   -0x30(%rbp),%rax
add    %rax,%rdi
lea    -0x450(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x458(%rbp)
mov    -0x48(%rbp),%eax
mov    %eax,-0x45c(%rbp)
lea    -0x450(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x45c(%rbp),%esi
mov    -0x458(%rbp),%rdi
add    %eax,%esi
add    $0x6,%esi
mov    0x2c90(%rip),%rax
mov    (%rax),%edx
call   10c0 <fseek@plt>
jmp    1568 <read_classes+0x3b8>
cmpl   $0x1,-0x40(%rbp)
jne    1470 <read_classes+0x2c0>
mov    -0x10(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %eax,-0x40(%rbp)
lea    -0x450(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x200,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    1395 <read_classes+0x1e5>
movl   $0x1,-0x4(%rbp)
jmp    1582 <read_classes+0x3d2>
lea    -0x450(%rbp),%rdi
call   10d0 <lower_case@plt>
lea    -0x450(%rbp),%rdi
lea    -0x250(%rbp),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    13df <read_classes+0x22f>
mov    -0x10(%rbp),%rdi
mov    -0x48(%rbp),%esi
mov    0x2c0c(%rip),%rax
mov    (%rax),%edx
call   10c0 <fseek@plt>
movl   $0x0,-0x4(%rbp)
jmp    1582 <read_classes+0x3d2>
mov    -0x10(%rbp),%rax
mov    %rax,-0x468(%rbp)
mov    -0x48(%rbp),%eax
mov    %eax,-0x46c(%rbp)
lea    -0x450(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x46c(%rbp),%esi
mov    -0x468(%rbp),%rdi
add    %eax,%esi
add    $0x3,%esi
mov    0x2bc0(%rip),%rax
mov    (%rax),%edx
call   10c0 <fseek@plt>
cmpl   $0x0,-0x40(%rbp)
je     1433 <read_classes+0x283>
cmpl   $0x4,-0x40(%rbp)
jne    1454 <read_classes+0x2a4>
jmp    1438 <read_classes+0x288>
mov    -0x10(%rbp),%rdi
call   1050 <fgetc@plt>
cmp    $0x0,%eax
je     144f <read_classes+0x29f>
jmp    1438 <read_classes+0x288>
jmp    146b <read_classes+0x2bb>
mov    -0x10(%rbp),%rdi
mov    0x2b89(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%esi
call   10c0 <fseek@plt>
jmp    1563 <read_classes+0x3b3>
cmpl   $0x2,-0x40(%rbp)
jne    153d <read_classes+0x38d>
lea    -0x450(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x200,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    14a5 <read_classes+0x2f5>
movl   $0x1,-0x4(%rbp)
jmp    1582 <read_classes+0x3d2>
lea    -0x450(%rbp),%rdi
call   10d0 <lower_case@plt>
lea    -0x450(%rbp),%rdi
lea    -0x250(%rbp),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    14ef <read_classes+0x33f>
mov    -0x10(%rbp),%rdi
mov    -0x48(%rbp),%esi
mov    0x2afc(%rip),%rax
mov    (%rax),%edx
call   10c0 <fseek@plt>
movl   $0x0,-0x4(%rbp)
jmp    1582 <read_classes+0x3d2>
mov    -0x10(%rbp),%rax
mov    %rax,-0x478(%rbp)
mov    -0x48(%rbp),%eax
mov    %eax,-0x47c(%rbp)
lea    -0x450(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x47c(%rbp),%esi
mov    -0x478(%rbp),%rdi
add    %eax,%esi
add    $0x2,%esi
mov    0x2ab0(%rip),%rax
mov    (%rax),%edx
call   10c0 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1080 <skip_array@plt>
jmp    155e <read_classes+0x3ae>
jmp    1542 <read_classes+0x392>
mov    -0x10(%rbp),%rdi
call   1050 <fgetc@plt>
cmp    $0x0,%eax
je     1559 <read_classes+0x3a9>
jmp    1542 <read_classes+0x392>
jmp    155e <read_classes+0x3ae>
jmp    1563 <read_classes+0x3b3>
jmp    1568 <read_classes+0x3b8>
jmp    156d <read_classes+0x3bd>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1239 <read_classes+0x89>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x480,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_classes>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x428,%rsp
mov    %r8,%r14
mov    %ecx,%r12d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    0x2e01(%rip),%rax
mov    (%rax),%edx
mov    $0x10,%esi
call   10c0 <fseek@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10b0 <seek_config_path@plt>
test   %eax,%eax
jne    146c <read_classes+0x2bc>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <fgetc@plt>
test   %eax,%eax
jne    1200 <read_classes+0x50>
mov    %rbx,%rdi
call   1090 <read_compressed_int@plt>
mov    %eax,0xc(%rsp)
test   %eax,%eax
jle    146a <read_classes+0x2ba>
mov    %r15,0x10(%rsp)
mov    %r12d,%eax
mov    %rax,0x18(%rsp)
xor    %ebp,%ebp
mov    %r12d,0x8(%rsp)
jmp    125e <read_classes+0xae>
mov    0x2dab(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x4,%esi
call   10c0 <fseek@plt>
mov    0x8(%rsp),%r12d
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
je     146a <read_classes+0x2ba>
mov    %rbx,%rdi
call   10a0 <ftell@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
call   1050 <fgetc@plt>
test   %eax,%eax
je     1320 <read_classes+0x170>
cmp    $0x1,%eax
je     1370 <read_classes+0x1c0>
cmp    $0x2,%eax
jne    1300 <read_classes+0x150>
lea    0x20(%rsp),%r15
mov    %r15,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     144f <read_classes+0x29f>
mov    %r15,%rdi
call   10d0 <lower_case@plt>
mov    %r15,%rdi
lea    0x220(%rsp),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1456 <read_classes+0x2a6>
mov    %r15,%rdi
call   1040 <strlen@plt>
lea    (%rax,%r13,1),%esi
add    $0x2,%esi
mov    0x2cfc(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
call   10c0 <fseek@plt>
mov    %rbx,%rdi
call   1080 <skip_array@plt>
jmp    124c <read_classes+0x9c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1050 <fgetc@plt>
test   %eax,%eax
jne    1300 <read_classes+0x150>
jmp    1251 <read_classes+0xa1>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x20(%rsp),%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     144f <read_classes+0x29f>
test   %r12d,%r12d
jle    1401 <read_classes+0x251>
mov    0x10(%rsp),%rcx
xor    %eax,%eax
mov    0x18(%rsp),%rdx
cmpb   $0x0,(%rcx)
je     1403 <read_classes+0x253>
add    $0x1,%rax
add    %r14,%rcx
cmp    %rax,%rdx
jne    1350 <read_classes+0x1a0>
jmp    1448 <read_classes+0x298>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <fgetc@plt>
mov    %eax,%r12d
lea    0x20(%rsp),%r15
mov    %r15,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     144f <read_classes+0x29f>
mov    %r15,%rdi
call   10d0 <lower_case@plt>
mov    %r15,%rdi
lea    0x220(%rsp),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1456 <read_classes+0x2a6>
mov    %r15,%rdi
call   1040 <strlen@plt>
lea    (%rax,%r13,1),%esi
add    $0x3,%esi
mov    0x2c08(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
call   10c0 <fseek@plt>
test   $0xfffffffb,%r12d
jne    1236 <read_classes+0x86>
mov    0x8(%rsp),%r12d
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1050 <fgetc@plt>
test   %eax,%eax
jne    13f0 <read_classes+0x240>
jmp    1251 <read_classes+0xa1>
xor    %eax,%eax
cmp    %r12d,%eax
je     1448 <read_classes+0x298>
mov    %eax,%edi
imul   %r14,%rdi
add    0x10(%rsp),%rdi
lea    0x20(%rsp),%r15
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
mov    %r15,%rdi
call   1040 <strlen@plt>
lea    (%rax,%r13,1),%esi
add    $0x6,%esi
mov    0x2b9f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
call   10c0 <fseek@plt>
jmp    1251 <read_classes+0xa1>
mov    $0x2,%eax
jmp    146c <read_classes+0x2bc>
mov    $0x1,%eax
jmp    146c <read_classes+0x2bc>
mov    0x2b7b(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r13d,%esi
call   10c0 <fseek@plt>
xor    %eax,%eax
add    $0x428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
@SEEK_CUR = global i32 0
define i32 @read_classes(i32* %0, i8* %1, i8* %2, i32 %3, i64 %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i64
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca [512 x i8]
%19 = alloca [512 x i8]
store i32* %0, i32** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i64 %4, i64* %11
%20 = load i32*, i32** %7
%21 = load i32, i32* @SEEK_SET
%22 = call i32 @fseek(i32* %20, i32 16, i32 %21)
%23 = load i32*, i32** %7
%24 = load i8*, i8** %8
%25 = call i32 @seek_config_path(i32* %23, i8* %24)
store i32 %25, i32* %14
%26 = load i32, i32* %14
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %5
%29 = load i32, i32* %14
store i32 %29, i32* %6
br label %194
30: ; preds = %5
br label %31
31: ; preds = %35, %30
%32 = load i32*, i32** %7
%33 = call i32 @fgetc(i32* %32)
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %31
br label %31
36: ; preds = %31
%37 = load i32*, i32** %7
%38 = call i32 @read_compressed_int(i32* %37)
store i32 %38, i32* %16
store i32 0, i32* %12
br label %39
39: ; preds = %190, %36
%40 = load i32, i32* %12
%41 = load i32, i32* %16
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %193
43: ; preds = %39
%44 = load i32*, i32** %7
%45 = call i32 @ftell(i32* %44)
store i32 %45, i32* %17
%46 = load i32*, i32** %7
%47 = call i32 @fgetc(i32* %46)
store i32 %47, i32* %15
%48 = load i32, i32* %15
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %99
50: ; preds = %43
%51 = getelementptr inbounds [512 x i8], [512 x i8]* %19, i64 0, i64 0
%52 = load i32*, i32** %7
%53 = call i32* @fgets(i8* %51, i32 512, i32* %52)
%54 = icmp eq i32* %53, null
br i1 %54, label %55, label %56
55: ; preds = %50
store i32 1, i32* %6
br label %194
56: ; preds = %50
store i32 0, i32* %13
br label %57
57: ; preds = %73, %56
%58 = load i32, i32* %13
%59 = load i32, i32* %10
%60 = icmp slt i32 %58, %59
br i1 %60, label %61, label %76
61: ; preds = %57
%62 = load i8*, i8** %9
%63 = load i32, i32* %13
%64 = sext i32 %63 to i64
%65 = load i64, i64* %11
%66 = mul i64 %64, %65
%67 = getelementptr inbounds i8, i8* %62, i64 %66
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %72
71: ; preds = %61
br label %76
72: ; preds = %61
br label %73
73: ; preds = %72
%74 = load i32, i32* %13
%75 = add nsw i32 %74, 1
store i32 %75, i32* %13
br label %57
76: ; preds = %71, %57
%77 = load i32, i32* %13
%78 = load i32, i32* %10
%79 = icmp eq i32 %77, %78
br i1 %79, label %80, label %81
80: ; preds = %76
store i32 2, i32* %6
br label %194
81: ; preds = %76
%82 = load i8*, i8** %9
%83 = load i32, i32* %13
%84 = sext i32 %83 to i64
%85 = load i64, i64* %11
%86 = mul i64 %84, %85
%87 = getelementptr inbounds i8, i8* %82, i64 %86
%88 = getelementptr inbounds [512 x i8], [512 x i8]* %19, i64 0, i64 0
%89 = load i64, i64* %11
%90 = call i32 @strncpy(i8* %87, i8* %88, i64 %89)
%91 = load i32*, i32** %7
%92 = load i32, i32* %17
%93 = getelementptr inbounds [512 x i8], [512 x i8]* %19, i64 0, i64 0
%94 = call i32 @strlen(i8* %93)
%95 = add nsw i32 %92, %94
%96 = add nsw i32 %95, 6
%97 = load i32, i32* @SEEK_SET
%98 = call i32 @fseek(i32* %91, i32 %96, i32 %97)
br label %189
99: ; preds = %43
%100 = load i32, i32* %15
%101 = icmp eq i32 %100, 1
br i1 %101, label %102, label %148
102: ; preds = %99
%103 = load i32*, i32** %7
%104 = call i32 @fgetc(i32* %103)
store i32 %104, i32* %15
%105 = getelementptr inbounds [512 x i8], [512 x i8]* %19, i64 0, i64 0
%106 = load i32*, i32** %7
%107 = call i32* @fgets(i8* %105, i32 512, i32* %106)
%108 = icmp eq i32* %107, null
br i1 %108, label %109, label %110
109: ; preds = %102
store i32 1, i32* %6
br label %194
110: ; preds = %102
%111 = getelementptr inbounds [512 x i8], [512 x i8]* %19, i64 0, i64 0
%112 = call i32 @lower_case(i8* %111)
%113 = getelementptr inbounds [512 x i8], [512 x i8]* %19, i64 0, i64 0
%114 = getelementptr inbounds [512 x i8], [512 x i8]* %18, i64 0, i64 0
%115 = call i64 @strcmp(i8* %113, i8* %114)
%116 = icmp eq i64 %115, 0
br i1 %116, label %117, label %122
117: ; preds = %110
%118 = load i32*, i32** %7
%119 = load i32, i32* %17
%120 = load i32, i32* @SEEK_SET
%121 = call i32 @fseek(i32* %118, i32 %119, i32 %120)
store i32 0, i32* %6
br label %194
122: ; preds = %110
%123 = load i32*, i32** %7
%124 = load i32, i32* %17
%125 = getelementptr inbounds [512 x i8], [512 x i8]* %19, i64 0, i64 0
%126 = call i32 @strlen(i8* %125)
%127 = add nsw i32 %124, %126
%128 = add nsw i32 %127, 3
%129 = load i32, i32* @SEEK_SET
%130 = call i32 @fseek(i32* %123, i32 %128, i32 %129)
%131 = load i32, i32* %15
%132 = icmp eq i32 %131, 0
br i1 %132, label %136, label %133
133: ; preds = %122
%134 = load i32, i32* %15
%135 = icmp eq i32 %134, 4
br i1 %135, label %136, label %143
136: ; preds = %133, %122
br label %137
137: ; preds = %141, %136
%138 = load i32*, i32** %7
%139 = call i32 @fgetc(i32* %138)
%140 = icmp ne i32 %139, 0
br i1 %140, label %141, label %142
141: ; preds = %137
br label %137
142: ; preds = %137
br label %147
143: ; preds = %133
%144 = load i32*, i32** %7
%145 = load i32, i32* @SEEK_CUR
%146 = call i32 @fseek(i32* %144, i32 4, i32 %145)
br label %147
147: ; preds = %143, %142
br label %188
148: ; preds = %99
%149 = load i32, i32* %15
%150 = icmp eq i32 %149, 2
br i1 %150, label %151, label %180
151: ; preds = %148
%152 = getelementptr inbounds [512 x i8], [512 x i8]* %19, i64 0, i64 0
%153 = load i32*, i32** %7
%154 = call i32* @fgets(i8* %152, i32 512, i32* %153)
%155 = icmp eq i32* %154, null
br i1 %155, label %156, label %157
156: ; preds = %151
store i32 1, i32* %6
br label %194
157: ; preds = %151
%158 = getelementptr inbounds [512 x i8], [512 x i8]* %19, i64 0, i64 0
%159 = call i32 @lower_case(i8* %158)
%160 = getelementptr inbounds [512 x i8], [512 x i8]* %19, i64 0, i64 0
%161 = getelementptr inbounds [512 x i8], [512 x i8]* %18, i64 0, i64 0
%162 = call i64 @strcmp(i8* %160, i8* %161)
%163 = icmp eq i64 %162, 0
br i1 %163, label %164, label %169
164: ; preds = %157
%165 = load i32*, i32** %7
%166 = load i32, i32* %17
%167 = load i32, i32* @SEEK_SET
%168 = call i32 @fseek(i32* %165, i32 %166, i32 %167)
store i32 0, i32* %6
br label %194
169: ; preds = %157
%170 = load i32*, i32** %7
%171 = load i32, i32* %17
%172 = getelementptr inbounds [512 x i8], [512 x i8]* %19, i64 0, i64 0
%173 = call i32 @strlen(i8* %172)
%174 = add nsw i32 %171, %173
%175 = add nsw i32 %174, 2
%176 = load i32, i32* @SEEK_SET
%177 = call i32 @fseek(i32* %170, i32 %175, i32 %176)
%178 = load i32*, i32** %7
%179 = call i32 @skip_array(i32* %178)
br label %187
180: ; preds = %148
br label %181
181: ; preds = %185, %180
%182 = load i32*, i32** %7
%183 = call i32 @fgetc(i32* %182)
%184 = icmp ne i32 %183, 0
br i1 %184, label %185, label %186
185: ; preds = %181
br label %181
186: ; preds = %181
br label %187
187: ; preds = %186, %169
br label %188
188: ; preds = %187, %147
br label %189
189: ; preds = %188, %81
br label %190
190: ; preds = %189
%191 = load i32, i32* %12
%192 = add nsw i32 %191, 1
store i32 %192, i32* %12
br label %39
193: ; preds = %39
store i32 0, i32* %6
br label %194
194: ; preds = %193, %164, %156, %117, %109, %80, %55, %28
%195 = load i32, i32* %6
ret i32 %195
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@SEEK_CUR = global i32 0
define i32 @read_classes(i32* %0, i8* %1, i8* %2, i32 %3, i64 %4) {
%6 = alloca [512 x i8]
%7 = alloca [512 x i8]
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%10 = load i32, i32* @SEEK_SET
%11 = tail call i32 @fseek(i32* %0, i32 16, i32 %10)
%12 = tail call i32 @seek_config_path(i32* %0, i8* %1)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %100
14: ; preds = %5, %14
%15 = tail call i32 @fgetc(i32* %0)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %14
17: ; preds = %14
%18 = tail call i32 @read_compressed_int(i32* %0)
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %100
20: ; preds = %17
%21 = icmp sgt i32 %3, 0
%22 = zext i32 %3 to i64
br label %23
23: ; preds = %20, %94
%24 = phi i32 [ 0, %20 ], [ %95, %94 ]
%25 = call i32 @ftell(i32* %0)
%26 = call i32 @fgetc(i32* %0)
switch i32 %26, label %91 [
i32 0, label %27
i32 1, label %55
i32 2, label %77
]
27: ; preds = %23
%28 = call i32* @fgets(i8* %9, i32 512, i32* %0)
%29 = icmp eq i32* %28, null
br i1 %29, label %100, label %30
30: ; preds = %27
br i1 %21, label %31, label %42
31: ; preds = %30, %37
%32 = phi i64 [ %38, %37 ], [ 0, %30 ]
%33 = mul i64 %32, %4
%34 = getelementptr inbounds i8, i8* %2, i64 %33
%35 = load i8, i8* %34
%36 = icmp eq i8 %35, 0
br i1 %36, label %40, label %37
37: ; preds = %31
%38 = add nuw nsw i64 %32, 1
%39 = icmp eq i64 %38, %22
br i1 %39, label %100, label %31
40: ; preds = %31
%41 = trunc i64 %32 to i32
br label %42
42: ; preds = %40, %30
%43 = phi i32 [ 0, %30 ], [ %41, %40 ]
%44 = icmp eq i32 %43, %3
br i1 %44, label %100, label %45
45: ; preds = %42
%46 = zext i32 %43 to i64
%47 = mul i64 %46, %4
%48 = getelementptr inbounds i8, i8* %2, i64 %47
%49 = call i32 @strncpy(i8* %48, i8* %9, i64 %4)
%50 = call i32 @strlen(i8* %9)
%51 = add i32 %25, 6
%52 = add i32 %51, %50
%53 = load i32, i32* @SEEK_SET
%54 = call i32 @fseek(i32* %0, i32 %52, i32 %53)
br label %94
55: ; preds = %23
%56 = call i32 @fgetc(i32* %0)
%57 = call i32* @fgets(i8* %9, i32 512, i32* %0)
%58 = icmp eq i32* %57, null
br i1 %58, label %100, label %59
59: ; preds = %55
%60 = call i32 @lower_case(i8* %9)
%61 = call i64 @strcmp(i8* %9, i8* %8)
%62 = icmp eq i64 %61, 0
br i1 %62, label %97, label %63
63: ; preds = %59
%64 = call i32 @strlen(i8* %9)
%65 = add i32 %25, 3
%66 = add i32 %65, %64
%67 = load i32, i32* @SEEK_SET
%68 = call i32 @fseek(i32* %0, i32 %66, i32 %67)
%69 = and i32 %56, -5
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %74
71: ; preds = %63, %71
%72 = call i32 @fgetc(i32* %0)
%73 = icmp eq i32 %72, 0
br i1 %73, label %94, label %71
74: ; preds = %63
%75 = load i32, i32* @SEEK_CUR
%76 = call i32 @fseek(i32* %0, i32 4, i32 %75)
br label %94
77: ; preds = %23
%78 = call i32* @fgets(i8* %9, i32 512, i32* %0)
%79 = icmp eq i32* %78, null
br i1 %79, label %100, label %80
80: ; preds = %77
%81 = call i32 @lower_case(i8* %9)
%82 = call i64 @strcmp(i8* %9, i8* %8)
%83 = icmp eq i64 %82, 0
br i1 %83, label %97, label %84
84: ; preds = %80
%85 = call i32 @strlen(i8* %9)
%86 = add i32 %25, 2
%87 = add i32 %86, %85
%88 = load i32, i32* @SEEK_SET
%89 = call i32 @fseek(i32* %0, i32 %87, i32 %88)
%90 = call i32 @skip_array(i32* %0)
br label %94
91: ; preds = %23, %91
%92 = call i32 @fgetc(i32* %0)
%93 = icmp eq i32 %92, 0
br i1 %93, label %94, label %91
94: ; preds = %71, %91, %45, %84, %74
%95 = add nuw nsw i32 %24, 1
%96 = icmp eq i32 %95, %18
br i1 %96, label %100, label %23
97: ; preds = %80, %59
%98 = load i32, i32* @SEEK_SET
%99 = call i32 @fseek(i32* %0, i32 %25, i32 %98)
br label %100
100: ; preds = %27, %42, %55, %77, %94, %37, %97, %17, %5
%101 = phi i32 [ %12, %5 ], [ 0, %17 ], [ 0, %97 ], [ 2, %37 ], [ 1, %27 ], [ 2, %42 ], [ 1, %55 ], [ 1, %77 ], [ 0, %94 ]
ret i32 %101
}