#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 */
scalar_t__ isalpha(unsigned char);
scalar_t__ isdigit(unsigned char);
int /*<<< orphan*/ printf(char *, unsigned char *);
void scan_libs(unsigned char *readbuffer, int filesize) {
  int counter = 0;
  int libnamecounter = 0;
  int founddot = 0;
  int gotname = 0;
  int start = 0;
  char libname[200];
  while (counter != filesize) {
    if (libnamecounter > 2 && founddot == 4) {
      if (isdigit(readbuffer[counter])) {
        libname[libnamecounter] = readbuffer[counter];
        libnamecounter++;
      } else {
        libname[libnamecounter] = 0;
        gotname = 1;
      }
    }
    if (libnamecounter > 2 && founddot == 3) {
      if (readbuffer[counter] == '.') {
        libname[libnamecounter] = readbuffer[counter];
        libnamecounter++;
        founddot++;
      } else {
        libnamecounter = 0;
        founddot = 0;
      }
    }
    if (libnamecounter > 2 && founddot == 2) {
      if (readbuffer[counter] == 'o') {
        libname[libnamecounter] = readbuffer[counter];
        libnamecounter++;
        founddot++;
      } else {
        libnamecounter = 0;
        founddot = 0;
      }
    }
    if (libnamecounter > 2 && founddot == 1) {
      if (readbuffer[counter] == 's') {
        libname[libnamecounter] = readbuffer[counter];
        libnamecounter++;
        founddot++;
      } else {
        libnamecounter = 0;
        founddot = 0;
      }
    }
    if (libnamecounter > 2 && founddot == 0) {
      if (isalpha(readbuffer[counter]) || isdigit(readbuffer[counter]) ||
          readbuffer[counter] == '-' || readbuffer[counter] == '+' ||
          readbuffer[counter] == '.') {
        if (readbuffer[counter] == '.' && readbuffer[counter + 1] == 's') {
          founddot = 1;
        }
        libname[libnamecounter] = readbuffer[counter];
        libnamecounter++;
      } else {
        libnamecounter = 0;
      }
    }
    if (libnamecounter == 2) {
      if (readbuffer[counter] == 'b') {
        libname[libnamecounter] = readbuffer[counter];
        libnamecounter++;
      } else {
        libnamecounter = 0;
      }
    }
    if (libnamecounter == 1) {
      if (readbuffer[counter] == 'i') {
        libname[libnamecounter] = readbuffer[counter];
        libnamecounter++;
      } else {
        libnamecounter = 0;
      }
    }
    if (libnamecounter == 0) {
      if (readbuffer[counter] == 'l') {
        libname[libnamecounter] = readbuffer[counter];
        libnamecounter++;
        start = counter;
      }
    }
    counter++;
    if (gotname == 1) {
      printf("            <QPM:RequiresLibrary>%s</QPM:RequiresLibrary>\n",
             readbuffer + start);
      libnamecounter = 0;
      founddot = 0;
      libnamecounter = 0;
      gotname = 0;
    }
  }
}


x86 assembly (clang, -O0):
<scan_libs>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1538 <scan_libs+0x408>
cmpl   $0x2,-0x14(%rbp)
jle    11dc <scan_libs+0xac>
cmpl   $0x4,-0x18(%rbp)
jne    11dc <scan_libs+0xac>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     11c4 <scan_libs+0x94>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0xf0(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d7 <scan_libs+0xa7>
movslq -0x14(%rbp),%rax
movb   $0x0,-0xf0(%rbp,%rax,1)
movl   $0x1,-0x1c(%rbp)
jmp    11dc <scan_libs+0xac>
cmpl   $0x2,-0x14(%rbp)
jle    1245 <scan_libs+0x115>
cmpl   $0x3,-0x18(%rbp)
jne    1245 <scan_libs+0x115>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    1232 <scan_libs+0x102>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0xf0(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1240 <scan_libs+0x110>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
jmp    1245 <scan_libs+0x115>
cmpl   $0x2,-0x14(%rbp)
jle    12ae <scan_libs+0x17e>
cmpl   $0x2,-0x18(%rbp)
jne    12ae <scan_libs+0x17e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x6f,%eax
jne    129b <scan_libs+0x16b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0xf0(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12a9 <scan_libs+0x179>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
jmp    12ae <scan_libs+0x17e>
cmpl   $0x2,-0x14(%rbp)
jle    1317 <scan_libs+0x1e7>
cmpl   $0x1,-0x18(%rbp)
jne    1317 <scan_libs+0x1e7>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x73,%eax
jne    1304 <scan_libs+0x1d4>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0xf0(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1312 <scan_libs+0x1e2>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
jmp    1317 <scan_libs+0x1e7>
cmpl   $0x2,-0x14(%rbp)
jle    1406 <scan_libs+0x2d6>
cmpl   $0x0,-0x18(%rbp)
jne    1406 <scan_libs+0x2d6>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%rax
jne    13a0 <scan_libs+0x270>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
jne    13a0 <scan_libs+0x270>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x2d,%eax
je     13a0 <scan_libs+0x270>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x2b,%eax
je     13a0 <scan_libs+0x270>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    13fa <scan_libs+0x2ca>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    13d6 <scan_libs+0x2a6>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x73,%eax
jne    13d6 <scan_libs+0x2a6>
movl   $0x1,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0xf0(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1401 <scan_libs+0x2d1>
movl   $0x0,-0x14(%rbp)
jmp    1406 <scan_libs+0x2d6>
cmpl   $0x2,-0x14(%rbp)
jne    1455 <scan_libs+0x325>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x62,%eax
jne    1449 <scan_libs+0x319>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0xf0(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1450 <scan_libs+0x320>
movl   $0x0,-0x14(%rbp)
jmp    1455 <scan_libs+0x325>
cmpl   $0x1,-0x14(%rbp)
jne    14a4 <scan_libs+0x374>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x69,%eax
jne    1498 <scan_libs+0x368>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0xf0(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    149f <scan_libs+0x36f>
movl   $0x0,-0x14(%rbp)
jmp    14a4 <scan_libs+0x374>
cmpl   $0x0,-0x14(%rbp)
jne    14ed <scan_libs+0x3bd>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x6c,%eax
jne    14e8 <scan_libs+0x3b8>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0xf0(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    14ed <scan_libs+0x3bd>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    1533 <scan_libs+0x403>
mov    -0x8(%rbp),%rsi
movslq -0x20(%rbp),%rax
add    %rax,%rsi
lea    0xaee(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
jmp    1165 <scan_libs+0x35>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_libs>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     12f8 <scan_libs+0x1c8>
mov    %rdi,%rbx
mov    %esi,%r15d
xor    %r12d,%r12d
xor    %ebp,%ebp
xor    %r13d,%r13d
xor    %eax,%eax
xor    %r14d,%r14d
jmp    1171 <scan_libs+0x41>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r14d
add    $0x1,%rbp
cmp    %rbp,%r15
je     12f8 <scan_libs+0x1c8>
cmp    $0x3,%r14d
jl     11a0 <scan_libs+0x70>
cmp    $0x4,%eax
jne    11a0 <scan_libs+0x70>
movzbl (%rbx,%rbp,1),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     11f1 <scan_libs+0xc1>
add    $0x1,%r14d
mov    $0x4,%eax
jmp    1164 <scan_libs+0x34>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x3,%r14d
jl     11d0 <scan_libs+0xa0>
cmp    $0x3,%eax
jne    11d0 <scan_libs+0xa0>
add    $0x1,%r14d
xor    %eax,%eax
cmpb   $0x2e,(%rbx,%rbp,1)
sete   %al
cmovne %r12d,%r14d
shl    $0x2,%eax
jmp    1230 <scan_libs+0x100>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x3,%r14d
jl     120d <scan_libs+0xdd>
cmp    $0x2,%eax
jne    120d <scan_libs+0xdd>
add    $0x1,%r14d
xor    %eax,%eax
cmpb   $0x6f,(%rbx,%rbp,1)
sete   %al
cmovne %r12d,%r14d
lea    (%rax,%rax,2),%eax
jmp    1230 <scan_libs+0x100>
movslq %r13d,%rsi
add    %rbx,%rsi
lea    0xe02(%rip),%rdi
call   1040 <printf@plt>
xor    %r14d,%r14d
xor    %eax,%eax
jmp    1164 <scan_libs+0x34>
cmp    $0x3,%r14d
jl     1230 <scan_libs+0x100>
cmp    $0x1,%eax
jne    1230 <scan_libs+0x100>
add    $0x1,%r14d
xor    %eax,%eax
cmpb   $0x73,(%rbx,%rbp,1)
sete   %al
cmovne %r12d,%r14d
add    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmp    $0x3,%r14d
jl     1280 <scan_libs+0x150>
test   %eax,%eax
jne    1280 <scan_libs+0x150>
movzbl (%rbx,%rbp,1),%edi
call   1050 <isalpha@plt>
test   %rax,%rax
jne    125a <scan_libs+0x12a>
movzbl (%rbx,%rbp,1),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     12d6 <scan_libs+0x1a6>
movzbl (%rbx,%rbp,1),%ecx
xor    %eax,%eax
cmp    $0x2e,%cl
jne    1160 <scan_libs+0x30>
xor    %eax,%eax
cmpb   $0x73,0x1(%rbx,%rbp,1)
sete   %al
jmp    1160 <scan_libs+0x30>
nopl   0x0(%rax,%rax,1)
cmp    $0x2,%r14d
je     129b <scan_libs+0x16b>
cmp    $0x1,%r14d
je     12b0 <scan_libs+0x180>
test   %r14d,%r14d
jne    1164 <scan_libs+0x34>
movzbl (%rbx,%rbp,1),%ecx
jmp    12c3 <scan_libs+0x193>
movzbl (%rbx,%rbp,1),%ecx
mov    $0x3,%r14d
cmp    $0x62,%cl
je     1164 <scan_libs+0x34>
jmp    12c3 <scan_libs+0x193>
movzbl (%rbx,%rbp,1),%ecx
mov    $0x2,%r14d
cmp    $0x69,%cl
je     1164 <scan_libs+0x34>
xor    %r14d,%r14d
cmp    $0x6c,%cl
sete   %r14b
cmove  %ebp,%r13d
jmp    1164 <scan_libs+0x34>
movzbl (%rbx,%rbp,1),%ecx
xor    %eax,%eax
cmp    $0x2e,%rcx
ja     12c3 <scan_libs+0x193>
movabs $0x680000000000,%rdx
bt     %rcx,%rdx
jb     125e <scan_libs+0x12e>
jmp    12c3 <scan_libs+0x193>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [59 x i8] c" <QPM:RequiresLibrary>%s</QPM:RequiresLibrary>\0A\00"
define void @scan_libs(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [200 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
br label %11
11: ; preds = %292, %2
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %293
15: ; preds = %11
%16 = load i32, i32* %6
%17 = icmp sgt i32 %16, 2
br i1 %17, label %18, label %45
18: ; preds = %15
%19 = load i32, i32* %7
%20 = icmp eq i32 %19, 4
br i1 %20, label %21, label %45
21: ; preds = %18
%22 = load i8*, i8** %3
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = call i64 @isdigit(i8 zeroext %26)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %40
29: ; preds = %21
%30 = load i8*, i8** %3
%31 = load i32, i32* %5
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
%34 = load i8, i8* %33
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 %36
store i8 %34, i8* %37
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
br label %44
40: ; preds = %21
%41 = load i32, i32* %6
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 %42
store i8 0, i8* %43
store i32 1, i32* %8
br label %44
44: ; preds = %40, %29
br label %45
45: ; preds = %44, %18, %15
%46 = load i32, i32* %6
%47 = icmp sgt i32 %46, 2
br i1 %47, label %48, label %74
48: ; preds = %45
%49 = load i32, i32* %7
%50 = icmp eq i32 %49, 3
br i1 %50, label %51, label %74
51: ; preds = %48
%52 = load i8*, i8** %3
%53 = load i32, i32* %5
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8, i8* %52, i64 %54
%56 = load i8, i8* %55
%57 = zext i8 %56 to i32
%58 = icmp eq i32 %57, 46
br i1 %58, label %59, label %72
59: ; preds = %51
%60 = load i8*, i8** %3
%61 = load i32, i32* %5
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8, i8* %60, i64 %62
%64 = load i8, i8* %63
%65 = load i32, i32* %6
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 %66
store i8 %64, i8* %67
%68 = load i32, i32* %6
%69 = add nsw i32 %68, 1
store i32 %69, i32* %6
%70 = load i32, i32* %7
%71 = add nsw i32 %70, 1
store i32 %71, i32* %7
br label %73
72: ; preds = %51
store i32 0, i32* %6
store i32 0, i32* %7
br label %73
73: ; preds = %72, %59
br label %74
74: ; preds = %73, %48, %45
%75 = load i32, i32* %6
%76 = icmp sgt i32 %75, 2
br i1 %76, label %77, label %103
77: ; preds = %74
%78 = load i32, i32* %7
%79 = icmp eq i32 %78, 2
br i1 %79, label %80, label %103
80: ; preds = %77
%81 = load i8*, i8** %3
%82 = load i32, i32* %5
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8, i8* %81, i64 %83
%85 = load i8, i8* %84
%86 = zext i8 %85 to i32
%87 = icmp eq i32 %86, 111
br i1 %87, label %88, label %101
88: ; preds = %80
%89 = load i8*, i8** %3
%90 = load i32, i32* %5
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i8, i8* %89, i64 %91
%93 = load i8, i8* %92
%94 = load i32, i32* %6
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 %95
store i8 %93, i8* %96
%97 = load i32, i32* %6
%98 = add nsw i32 %97, 1
store i32 %98, i32* %6
%99 = load i32, i32* %7
%100 = add nsw i32 %99, 1
store i32 %100, i32* %7
br label %102
101: ; preds = %80
store i32 0, i32* %6
store i32 0, i32* %7
br label %102
102: ; preds = %101, %88
br label %103
103: ; preds = %102, %77, %74
%104 = load i32, i32* %6
%105 = icmp sgt i32 %104, 2
br i1 %105, label %106, label %132
106: ; preds = %103
%107 = load i32, i32* %7
%108 = icmp eq i32 %107, 1
br i1 %108, label %109, label %132
109: ; preds = %106
%110 = load i8*, i8** %3
%111 = load i32, i32* %5
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i8, i8* %110, i64 %112
%114 = load i8, i8* %113
%115 = zext i8 %114 to i32
%116 = icmp eq i32 %115, 115
br i1 %116, label %117, label %130
117: ; preds = %109
%118 = load i8*, i8** %3
%119 = load i32, i32* %5
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds i8, i8* %118, i64 %120
%122 = load i8, i8* %121
%123 = load i32, i32* %6
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 %124
store i8 %122, i8* %125
%126 = load i32, i32* %6
%127 = add nsw i32 %126, 1
store i32 %127, i32* %6
%128 = load i32, i32* %7
%129 = add nsw i32 %128, 1
store i32 %129, i32* %7
br label %131
130: ; preds = %109
store i32 0, i32* %6
store i32 0, i32* %7
br label %131
131: ; preds = %130, %117
br label %132
132: ; preds = %131, %106, %103
%133 = load i32, i32* %6
%134 = icmp sgt i32 %133, 2
br i1 %134, label %135, label %209
135: ; preds = %132
%136 = load i32, i32* %7
%137 = icmp eq i32 %136, 0
br i1 %137, label %138, label %209
138: ; preds = %135
%139 = load i8*, i8** %3
%140 = load i32, i32* %5
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds i8, i8* %139, i64 %141
%143 = load i8, i8* %142
%144 = call i64 @isalpha(i8 zeroext %143)
%145 = icmp ne i64 %144, 0
br i1 %145, label %178, label %146
146: ; preds = %138
%147 = load i8*, i8** %3
%148 = load i32, i32* %5
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i8, i8* %147, i64 %149
%151 = load i8, i8* %150
%152 = call i64 @isdigit(i8 zeroext %151)
%153 = icmp ne i64 %152, 0
br i1 %153, label %178, label %154
154: ; preds = %146
%155 = load i8*, i8** %3
%156 = load i32, i32* %5
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds i8, i8* %155, i64 %157
%159 = load i8, i8* %158
%160 = zext i8 %159 to i32
%161 = icmp eq i32 %160, 45
br i1 %161, label %178, label %162
162: ; preds = %154
%163 = load i8*, i8** %3
%164 = load i32, i32* %5
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds i8, i8* %163, i64 %165
%167 = load i8, i8* %166
%168 = zext i8 %167 to i32
%169 = icmp eq i32 %168, 43
br i1 %169, label %178, label %170
170: ; preds = %162
%171 = load i8*, i8** %3
%172 = load i32, i32* %5
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds i8, i8* %171, i64 %173
%175 = load i8, i8* %174
%176 = zext i8 %175 to i32
%177 = icmp eq i32 %176, 46
br i1 %177, label %178, label %207
178: ; preds = %170, %162, %154, %146, %138
%179 = load i8*, i8** %3
%180 = load i32, i32* %5
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds i8, i8* %179, i64 %181
%183 = load i8, i8* %182
%184 = zext i8 %183 to i32
%185 = icmp eq i32 %184, 46
br i1 %185, label %186, label %196
186: ; preds = %178
%187 = load i8*, i8** %3
%188 = load i32, i32* %5
%189 = add nsw i32 %188, 1
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds i8, i8* %187, i64 %190
%192 = load i8, i8* %191
%193 = zext i8 %192 to i32
%194 = icmp eq i32 %193, 115
br i1 %194, label %195, label %196
195: ; preds = %186
store i32 1, i32* %7
br label %196
196: ; preds = %195, %186, %178
%197 = load i8*, i8** %3
%198 = load i32, i32* %5
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds i8, i8* %197, i64 %199
%201 = load i8, i8* %200
%202 = load i32, i32* %6
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 %203
store i8 %201, i8* %204
%205 = load i32, i32* %6
%206 = add nsw i32 %205, 1
store i32 %206, i32* %6
br label %208
207: ; preds = %170
store i32 0, i32* %6
br label %208
208: ; preds = %207, %196
br label %209
209: ; preds = %208, %135, %132
%210 = load i32, i32* %6
%211 = icmp eq i32 %210, 2
br i1 %211, label %212, label %233
212: ; preds = %209
%213 = load i8*, i8** %3
%214 = load i32, i32* %5
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds i8, i8* %213, i64 %215
%217 = load i8, i8* %216
%218 = zext i8 %217 to i32
%219 = icmp eq i32 %218, 98
br i1 %219, label %220, label %231
220: ; preds = %212
%221 = load i8*, i8** %3
%222 = load i32, i32* %5
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds i8, i8* %221, i64 %223
%225 = load i8, i8* %224
%226 = load i32, i32* %6
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 %227
store i8 %225, i8* %228
%229 = load i32, i32* %6
%230 = add nsw i32 %229, 1
store i32 %230, i32* %6
br label %232
231: ; preds = %212
store i32 0, i32* %6
br label %232
232: ; preds = %231, %220
br label %233
233: ; preds = %232, %209
%234 = load i32, i32* %6
%235 = icmp eq i32 %234, 1
br i1 %235, label %236, label %257
236: ; preds = %233
%237 = load i8*, i8** %3
%238 = load i32, i32* %5
%239 = sext i32 %238 to i64
%240 = getelementptr inbounds i8, i8* %237, i64 %239
%241 = load i8, i8* %240
%242 = zext i8 %241 to i32
%243 = icmp eq i32 %242, 105
br i1 %243, label %244, label %255
244: ; preds = %236
%245 = load i8*, i8** %3
%246 = load i32, i32* %5
%247 = sext i32 %246 to i64
%248 = getelementptr inbounds i8, i8* %245, i64 %247
%249 = load i8, i8* %248
%250 = load i32, i32* %6
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 %251
store i8 %249, i8* %252
%253 = load i32, i32* %6
%254 = add nsw i32 %253, 1
store i32 %254, i32* %6
br label %256
255: ; preds = %236
store i32 0, i32* %6
br label %256
256: ; preds = %255, %244
br label %257
257: ; preds = %256, %233
%258 = load i32, i32* %6
%259 = icmp eq i32 %258, 0
br i1 %259, label %260, label %281
260: ; preds = %257
%261 = load i8*, i8** %3
%262 = load i32, i32* %5
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds i8, i8* %261, i64 %263
%265 = load i8, i8* %264
%266 = zext i8 %265 to i32
%267 = icmp eq i32 %266, 108
br i1 %267, label %268, label %280
268: ; preds = %260
%269 = load i8*, i8** %3
%270 = load i32, i32* %5
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds i8, i8* %269, i64 %271
%273 = load i8, i8* %272
%274 = load i32, i32* %6
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 %275
store i8 %273, i8* %276
%277 = load i32, i32* %6
%278 = add nsw i32 %277, 1
store i32 %278, i32* %6
%279 = load i32, i32* %5
store i32 %279, i32* %9
br label %280
280: ; preds = %268, %260
br label %281
281: ; preds = %280, %257
%282 = load i32, i32* %5
%283 = add nsw i32 %282, 1
store i32 %283, i32* %5
%284 = load i32, i32* %8
%285 = icmp eq i32 %284, 1
br i1 %285, label %286, label %292
286: ; preds = %281
%287 = load i8*, i8** %3
%288 = load i32, i32* %9
%289 = sext i32 %288 to i64
%290 = getelementptr inbounds i8, i8* %287, i64 %289
%291 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %290)
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %6
store i32 0, i32* %8
br label %292
292: ; preds = %286, %281
br label %11
293: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c" <QPM:RequiresLibrary>%s</QPM:RequiresLibrary>\0A\00"
define void @scan_libs(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %110, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %104
%7 = phi i64 [ 0, %4 ], [ %108, %104 ]
%8 = phi i32 [ 0, %4 ], [ %105, %104 ]
%9 = phi i32 [ 0, %4 ], [ %107, %104 ]
%10 = phi i32 [ 0, %4 ], [ %106, %104 ]
%11 = icmp sgt i32 %10, 2
%12 = icmp eq i32 %9, 4
%13 = select i1 %11, i1 %12, i1 false
br i1 %13, label %94, label %14
14: ; preds = %6
%15 = icmp eq i32 %9, 3
%16 = select i1 %11, i1 %15, i1 false
br i1 %16, label %17, label %24
17: ; preds = %14
%18 = getelementptr inbounds i8, i8* %0, i64 %7
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 46
%21 = add nuw nsw i32 %10, 1
%22 = select i1 %20, i32 %21, i32 0
%23 = select i1 %20, i32 4, i32 0
br label %44
24: ; preds = %14
%25 = icmp eq i32 %9, 2
%26 = select i1 %11, i1 %25, i1 false
br i1 %26, label %27, label %34
27: ; preds = %24
%28 = getelementptr inbounds i8, i8* %0, i64 %7
%29 = load i8, i8* %28
%30 = icmp eq i8 %29, 111
%31 = add nuw nsw i32 %10, 1
%32 = select i1 %30, i32 %31, i32 0
%33 = select i1 %30, i32 3, i32 0
br label %44
34: ; preds = %24
%35 = icmp eq i32 %9, 1
%36 = select i1 %11, i1 %35, i1 false
br i1 %36, label %37, label %44
37: ; preds = %34
%38 = getelementptr inbounds i8, i8* %0, i64 %7
%39 = load i8, i8* %38
%40 = icmp eq i8 %39, 115
%41 = add nuw nsw i32 %10, 1
%42 = select i1 %40, i32 %41, i32 0
%43 = select i1 %40, i32 2, i32 0
br label %44
44: ; preds = %17, %27, %37, %34
%45 = phi i32 [ %10, %34 ], [ %42, %37 ], [ %32, %27 ], [ %22, %17 ]
%46 = phi i32 [ %9, %34 ], [ %43, %37 ], [ %33, %27 ], [ %23, %17 ]
%47 = icmp sgt i32 %45, 2
%48 = icmp eq i32 %46, 0
%49 = select i1 %47, i1 %48, i1 false
br i1 %49, label %50, label %75
50: ; preds = %44
%51 = getelementptr inbounds i8, i8* %0, i64 %7
%52 = load i8, i8* %51
%53 = tail call i64 @isalpha(i8 zeroext %52)
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %61
55: ; preds = %50
%56 = load i8, i8* %51
%57 = tail call i64 @isdigit(i8 zeroext %56)
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %55
%60 = load i8, i8* %51
switch i8 %60, label %87 [
i8 45, label %63
i8 43, label %63
i8 46, label %63
]
61: ; preds = %50, %55
%62 = load i8, i8* %51
br label %63
63: ; preds = %61, %59, %59, %59
%64 = phi i8 [ %62, %61 ], [ %60, %59 ], [ %60, %59 ], [ %60, %59 ]
%65 = icmp eq i8 %64, 46
br i1 %65, label %66, label %72
66: ; preds = %63
%67 = add nuw nsw i64 %7, 1
%68 = getelementptr inbounds i8, i8* %0, i64 %67
%69 = load i8, i8* %68
%70 = icmp eq i8 %69, 115
%71 = zext i1 %70 to i32
br label %72
72: ; preds = %63, %66
%73 = phi i32 [ 0, %63 ], [ %71, %66 ]
%74 = add nuw nsw i32 %45, 1
br label %104
75: ; preds = %44
switch i32 %45, label %104 [
i32 2, label %79
i32 1, label %83
i32 0, label %76
]
76: ; preds = %75
%77 = getelementptr inbounds i8, i8* %0, i64 %7
%78 = load i8, i8* %77
br label %87
79: ; preds = %75
%80 = getelementptr inbounds i8, i8* %0, i64 %7
%81 = load i8, i8* %80
%82 = icmp eq i8 %81, 98
br i1 %82, label %104, label %87
83: ; preds = %75
%84 = getelementptr inbounds i8, i8* %0, i64 %7
%85 = load i8, i8* %84
%86 = icmp eq i8 %85, 105
br i1 %86, label %104, label %87
87: ; preds = %76, %59, %79, %83
%88 = phi i8 [ %85, %83 ], [ %81, %79 ], [ %60, %59 ], [ %78, %76 ]
%89 = phi i32 [ %46, %83 ], [ %46, %79 ], [ 0, %59 ], [ %46, %76 ]
%90 = icmp eq i8 %88, 108
%91 = zext i1 %90 to i32
%92 = trunc i64 %7 to i32
%93 = select i1 %90, i32 %92, i32 %8
br label %104
94: ; preds = %6
%95 = getelementptr inbounds i8, i8* %0, i64 %7
%96 = load i8, i8* %95
%97 = tail call i64 @isdigit(i8 zeroext %96)
%98 = icmp eq i64 %97, 0
%99 = add nuw nsw i32 %10, 1
br i1 %98, label %100, label %104
100: ; preds = %94
%101 = sext i32 %8 to i64
%102 = getelementptr inbounds i8, i8* %0, i64 %101
%103 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %102)
br label %104
104: ; preds = %79, %83, %87, %75, %72, %100, %94
%105 = phi i32 [ %8, %100 ], [ %8, %94 ], [ %8, %72 ], [ %8, %79 ], [ %8, %83 ], [ %93, %87 ], [ %8, %75 ]
%106 = phi i32 [ 0, %100 ], [ %99, %94 ], [ %74, %72 ], [ 3, %79 ], [ 2, %83 ], [ %91, %87 ], [ %45, %75 ]
%107 = phi i32 [ 0, %100 ], [ 4, %94 ], [ %73, %72 ], [ %46, %79 ], [ %46, %83 ], [ %89, %87 ], [ %46, %75 ]
%108 = add nuw nsw i64 %7, 1
%109 = icmp eq i64 %108, %5
br i1 %109, label %110, label %6
110: ; preds = %104, %2
ret void
}