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

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int getc(int /*<<< orphan*/ *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int searchwhatis(FILE *wf, char *title, char **ppage, char **psection) {
  static char page[256], section[32];
  char alias[256];
  int found = 0;
  int c;
  do {
    int first = 1;
    char *pc = section;
    c = fgetc(wf);
    do {
      char *pa = alias;
      while (c == ' ' || c == '\t' || c == ',')
        c = fgetc(wf);
      while (c != ' ' && c != '\t' && c != ',' && c != '(' && c != '\n' &&
             c != EOF) {
        if (pa < ((alias) + (sizeof(alias) / sizeof((alias)[0]))) - 1)
          *pa++ = c;
        c = getc(wf);
      }
      *pa = 0;
      if (first) {
        strcpy(page, alias);
        first = 0;
      }
      if (strcmp(alias, title) == 0)
        found = 1;
    } while (c != '(' && c != '\n' && c != EOF);
    if (c != '(') {
      found = 0;
    } else {
      while ((c = fgetc(wf)) != ')' && c != '\n' && c != EOF) {
        if ('A' <= c && c <= 'Z')
          c = c - 'A' + 'a';
        if (pc < ((section) + (sizeof(section) / sizeof((section)[0]))) - 1)
          *pc++ = c;
      }
      *pc = 0;
      if (c != ')' || pc == section)
        found = 0;
    }
    while (c != EOF && c != '\n')
      c = getc(wf);
  } while (!found && c != EOF);
  if (found) {
    *ppage = page;
    *psection = section;
  }
  return c == EOF ? -1 : found;
}


x86 assembly (clang, -O0):
<searchwhatis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x124(%rbp)
movl   $0x1,-0x12c(%rbp)
lea    0x2fda(%rip),%rax
mov    %rax,-0x138(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x128(%rbp)
lea    -0x120(%rbp),%rax
mov    %rax,-0x140(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x128(%rbp)
mov    %al,-0x141(%rbp)
je     11d4 <searchwhatis+0x94>
mov    $0x1,%al
cmpl   $0x9,-0x128(%rbp)
mov    %al,-0x141(%rbp)
je     11d4 <searchwhatis+0x94>
cmpl   $0x2c,-0x128(%rbp)
sete   %al
mov    %al,-0x141(%rbp)
mov    -0x141(%rbp),%al
test   $0x1,%al
jne    11e7 <searchwhatis+0xa7>
jmp    11fb <searchwhatis+0xbb>
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x128(%rbp)
jmp    119a <searchwhatis+0x5a>
jmp    1200 <searchwhatis+0xc0>
xor    %eax,%eax
cmpl   $0x20,-0x128(%rbp)
mov    %al,-0x142(%rbp)
je     1281 <searchwhatis+0x141>
xor    %eax,%eax
cmpl   $0x9,-0x128(%rbp)
mov    %al,-0x142(%rbp)
je     1281 <searchwhatis+0x141>
xor    %eax,%eax
cmpl   $0x2c,-0x128(%rbp)
mov    %al,-0x142(%rbp)
je     1281 <searchwhatis+0x141>
xor    %eax,%eax
cmpl   $0x28,-0x128(%rbp)
mov    %al,-0x142(%rbp)
je     1281 <searchwhatis+0x141>
xor    %eax,%eax
cmpl   $0xa,-0x128(%rbp)
mov    %al,-0x142(%rbp)
je     1281 <searchwhatis+0x141>
mov    -0x128(%rbp),%eax
mov    0x2d72(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x142(%rbp)
mov    -0x142(%rbp),%al
test   $0x1,%al
jne    1294 <searchwhatis+0x154>
jmp    12e9 <searchwhatis+0x1a9>
mov    -0x140(%rbp),%rax
lea    -0x120(%rbp),%rcx
add    $0x100,%rcx
add    $0xffffffffffffffff,%rcx
cmp    %rcx,%rax
jae    12d5 <searchwhatis+0x195>
mov    -0x128(%rbp),%eax
mov    %al,%cl
mov    -0x140(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x140(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rdi
call   1060 <getc@plt>
mov    %eax,-0x128(%rbp)
jmp    1200 <searchwhatis+0xc0>
mov    -0x140(%rbp),%rax
movb   $0x0,(%rax)
cmpl   $0x0,-0x12c(%rbp)
je     131d <searchwhatis+0x1dd>
lea    -0x120(%rbp),%rsi
lea    0x2d42(%rip),%rdi
call   1030 <strcpy@plt>
movl   $0x0,-0x12c(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1341 <searchwhatis+0x201>
movl   $0x1,-0x124(%rbp)
jmp    1346 <searchwhatis+0x206>
xor    %eax,%eax
cmpl   $0x28,-0x128(%rbp)
mov    %al,-0x143(%rbp)
je     1388 <searchwhatis+0x248>
xor    %eax,%eax
cmpl   $0xa,-0x128(%rbp)
mov    %al,-0x143(%rbp)
je     1388 <searchwhatis+0x248>
mov    -0x128(%rbp),%eax
mov    0x2c6b(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x143(%rbp)
mov    -0x143(%rbp),%al
test   $0x1,%al
jne    118c <searchwhatis+0x4c>
cmpl   $0x28,-0x128(%rbp)
je     13b2 <searchwhatis+0x272>
movl   $0x0,-0x124(%rbp)
jmp    14bf <searchwhatis+0x37f>
jmp    13b7 <searchwhatis+0x277>
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,%ecx
mov    %ecx,-0x128(%rbp)
xor    %eax,%eax
cmp    $0x29,%ecx
mov    %al,-0x144(%rbp)
je     1406 <searchwhatis+0x2c6>
xor    %eax,%eax
cmpl   $0xa,-0x128(%rbp)
mov    %al,-0x144(%rbp)
je     1406 <searchwhatis+0x2c6>
mov    -0x128(%rbp),%eax
mov    0x2bed(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x144(%rbp)
mov    -0x144(%rbp),%al
test   $0x1,%al
jne    1419 <searchwhatis+0x2d9>
jmp    1485 <searchwhatis+0x345>
mov    $0x41,%eax
cmp    -0x128(%rbp),%eax
jg     1449 <searchwhatis+0x309>
cmpl   $0x5a,-0x128(%rbp)
jg     1449 <searchwhatis+0x309>
mov    -0x128(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x128(%rbp)
lea    0x2d00(%rip),%rax
add    $0x1f,%rax
cmp    %rax,-0x138(%rbp)
jae    1480 <searchwhatis+0x340>
mov    -0x128(%rbp),%eax
mov    %al,%cl
mov    -0x138(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x138(%rbp)
mov    %cl,(%rax)
jmp    13b7 <searchwhatis+0x277>
mov    -0x138(%rbp),%rax
movb   $0x0,(%rax)
cmpl   $0x29,-0x128(%rbp)
jne    14b0 <searchwhatis+0x370>
lea    0x2cad(%rip),%rax
cmp    %rax,-0x138(%rbp)
jne    14ba <searchwhatis+0x37a>
movl   $0x0,-0x124(%rbp)
jmp    14bf <searchwhatis+0x37f>
jmp    14c4 <searchwhatis+0x384>
mov    -0x128(%rbp),%ecx
xor    %eax,%eax
mov    0x2b15(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x145(%rbp)
je     14f1 <searchwhatis+0x3b1>
cmpl   $0xa,-0x128(%rbp)
setne  %al
mov    %al,-0x145(%rbp)
mov    -0x145(%rbp),%al
test   $0x1,%al
jne    1504 <searchwhatis+0x3c4>
jmp    1518 <searchwhatis+0x3d8>
mov    -0x8(%rbp),%rdi
call   1060 <getc@plt>
mov    %eax,-0x128(%rbp)
jmp    14c4 <searchwhatis+0x384>
jmp    151d <searchwhatis+0x3dd>
xor    %eax,%eax
cmpl   $0x0,-0x124(%rbp)
mov    %al,-0x146(%rbp)
jne    154a <searchwhatis+0x40a>
mov    -0x128(%rbp),%eax
mov    0x2aa9(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x146(%rbp)
mov    -0x146(%rbp),%al
test   $0x1,%al
jne    1165 <searchwhatis+0x25>
cmpl   $0x0,-0x124(%rbp)
je     1581 <searchwhatis+0x441>
mov    -0x18(%rbp),%rax
lea    0x2ae0(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
lea    0x2bd2(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x128(%rbp),%eax
mov    0x2a5a(%rip),%rcx
cmp    (%rcx),%eax
jne    15a6 <searchwhatis+0x466>
mov    $0xffffffff,%eax
mov    %eax,-0x14c(%rbp)
jmp    15b2 <searchwhatis+0x472>
mov    -0x124(%rbp),%eax
mov    %eax,-0x14c(%rbp)
mov    -0x14c(%rbp),%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<searchwhatis>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
mov    %rcx,0x10(%rsp)
mov    %rdx,0x8(%rsp)
mov    %rsi,0x18(%rsp)
mov    %rdi,%rbx
lea    0x20(%rsp),%rbp
movabs $0x100100000200,%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <fgetc@plt>
mov    %eax,%r14d
xor    %r12d,%r12d
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x2c,%r14d
ja     11cb <searchwhatis+0x8b>
mov    %r14d,%eax
bt     %rax,%r13
jae    11cb <searchwhatis+0x8b>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
mov    %eax,%r14d
jmp    11a0 <searchwhatis+0x60>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %eax,%r14d
cmp    $0x2c,%r14d
ja     11e4 <searchwhatis+0xa4>
mov    %r14d,%eax
movabs $0x110100000600,%rcx
bt     %rax,%rcx
jb     1207 <searchwhatis+0xc7>
mov    0x2dfd(%rip),%rax
cmp    (%rax),%r14d
je     1207 <searchwhatis+0xc7>
lea    0x11f(%rsp),%rax
cmp    %rax,%rbp
jae    11c0 <searchwhatis+0x80>
mov    %r14b,0x0(%rbp)
add    $0x1,%rbp
jmp    11c0 <searchwhatis+0x80>
movb   $0x0,0x0(%rbp)
test   $0x1,%r15b
lea    0x20(%rsp),%rbp
jne    1225 <searchwhatis+0xe5>
lea    0x2e33(%rip),%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
mov    %rbp,%rdi
mov    0x18(%rsp),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
mov    $0x1,%eax
cmove  %eax,%r12d
mov    0x2da3(%rip),%rax
mov    (%rax),%eax
cmp    $0x28,%r14d
je     125f <searchwhatis+0x11f>
cmp    $0xa,%r14d
je     125f <searchwhatis+0x11f>
mov    $0x1,%r15b
cmp    %eax,%r14d
jne    11a0 <searchwhatis+0x60>
xor    %r15d,%r15d
cmp    $0x28,%r14d
jne    1310 <searchwhatis+0x1d0>
lea    0x2edd(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1040 <fgetc@plt>
mov    %eax,%r14d
cmp    $0xa,%eax
je     12d0 <searchwhatis+0x190>
cmp    $0x29,%r14d
je     12d0 <searchwhatis+0x190>
mov    0x2d4b(%rip),%rax
cmp    (%rax),%r14d
je     12d0 <searchwhatis+0x190>
lea    0x2ec6(%rip),%rax
cmp    %rax,%r15
jae    1280 <searchwhatis+0x140>
lea    -0x41(%r14),%eax
lea    0x20(%r14),%ecx
cmp    $0x1a,%eax
movzbl %cl,%eax
cmovae %r14d,%eax
mov    %al,(%r15)
add    $0x1,%r15
jmp    1280 <searchwhatis+0x140>
nopl   0x0(%rax)
cmp    $0x29,%r14d
setne  %al
lea    0x2e72(%rip),%rcx
cmp    %rcx,%r15
sete   %cl
or     %al,%cl
mov    $0x0,%eax
cmovne %eax,%r12d
movb   $0x0,(%r15)
mov    $0x29,%eax
cmove  %eax,%r14d
mov    0x2ce5(%rip),%rax
mov    (%rax),%eax
mov    %r12d,%r15d
nopl   0x0(%rax,%rax,1)
cmp    %eax,%r14d
setne  %cl
cmp    $0xa,%r14d
je     1340 <searchwhatis+0x200>
cmp    %eax,%r14d
je     1340 <searchwhatis+0x200>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %eax,%r14d
mov    0x2cb5(%rip),%rax
mov    (%rax),%eax
jmp    1310 <searchwhatis+0x1d0>
nopw   0x0(%rax,%rax,1)
test   %r15d,%r15d
jne    134d <searchwhatis+0x20d>
test   %cl,%cl
jne    1180 <searchwhatis+0x40>
test   %r15d,%r15d
je     1370 <searchwhatis+0x230>
mov    0x8(%rsp),%rcx
lea    0x2cf2(%rip),%rdx
mov    %rdx,(%rcx)
lea    0x2de8(%rip),%rcx
mov    0x10(%rsp),%rdx
mov    %rcx,(%rdx)
cmp    %eax,%r14d
mov    $0xffffffff,%eax
cmove  %eax,%r15d
mov    %r15d,%eax
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@searchwhatis.page = internal global [256 x i8] zeroinitializer
@searchwhatis.section = internal global [32 x i8] zeroinitializer
@EOF = global i32 0
define i32 @searchwhatis(i32* nocapture %0, i8* %1, i8** nocapture writeonly %2, i8** nocapture writeonly %3) {
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 255
br label %8
8: ; preds = %83, %4
%9 = call i32 @fgetc(i32* %0)
br label %10
10: ; preds = %37, %8
%11 = phi i32 [ 0, %8 ], [ %40, %37 ]
%12 = phi i32 [ %9, %8 ], [ %19, %37 ]
%13 = phi i1 [ false, %8 ], [ true, %37 ]
br label %14
14: ; preds = %16, %10
%15 = phi i32 [ %12, %10 ], [ %17, %16 ]
switch i32 %15, label %18 [
i32 44, label %16
i32 32, label %16
i32 9, label %16
]
16: ; preds = %14, %14, %14
%17 = call i32 @fgetc(i32* %0)
br label %14
18: ; preds = %14, %29
%19 = phi i32 [ %31, %29 ], [ %15, %14 ]
%20 = phi i8* [ %30, %29 ], [ %6, %14 ]
switch i32 %19, label %21 [
i32 44, label %32
i32 40, label %32
i32 32, label %32
i32 10, label %32
i32 9, label %32
]
21: ; preds = %18
%22 = load i32, i32* @EOF
%23 = icmp eq i32 %19, %22
br i1 %23, label %32, label %24
24: ; preds = %21
%25 = icmp ult i8* %20, %7
br i1 %25, label %26, label %29
26: ; preds = %24
%27 = trunc i32 %19 to i8
%28 = getelementptr inbounds i8, i8* %20, i64 1
store i8 %27, i8* %20
br label %29
29: ; preds = %26, %24
%30 = phi i8* [ %28, %26 ], [ %20, %24 ]
%31 = call i32 @getc(i32* %0)
br label %18
32: ; preds = %18, %18, %18, %18, %18, %21
%33 = icmp ne i32 %19, 40
%34 = icmp ne i32 %19, 10
store i8 0, i8* %20
br i1 %13, label %37, label %35
35: ; preds = %32
%36 = call i32 @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @searchwhatis.page, i64 0, i64 0), i8* %6)
br label %37
37: ; preds = %35, %32
%38 = call i64 @strcmp(i8* %6, i8* %1)
%39 = icmp eq i64 %38, 0
%40 = select i1 %39, i32 1, i32 %11
%41 = and i1 %33, %34
%42 = xor i1 %41, true
%43 = load i32, i32* @EOF
%44 = icmp eq i32 %19, %43
%45 = select i1 %42, i1 true, i1 %44
br i1 %45, label %46, label %10
46: ; preds = %37
br i1 %33, label %70, label %47
47: ; preds = %46, %56
%48 = phi i8* [ %62, %56 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @searchwhatis.section, i64 0, i64 0), %46 ]
%49 = icmp ult i8* %48, getelementptr inbounds ([32 x i8], [32 x i8]* @searchwhatis.section, i64 0, i64 31)
br label %50
50: ; preds = %47, %55
%51 = call i32 @fgetc(i32* %0)
switch i32 %51, label %52 [
i32 41, label %63
i32 10, label %63
]
52: ; preds = %50
%53 = load i32, i32* @EOF
%54 = icmp eq i32 %51, %53
br i1 %54, label %63, label %55
55: ; preds = %52
br i1 %49, label %56, label %50
56: ; preds = %55
%57 = add i32 %51, -65
%58 = icmp ult i32 %57, 26
%59 = add nsw i32 %51, 32
%60 = select i1 %58, i32 %59, i32 %51
%61 = trunc i32 %60 to i8
%62 = getelementptr inbounds i8, i8* %48, i64 1
store i8 %61, i8* %48
br label %47
63: ; preds = %50, %50, %52
%64 = icmp ne i32 %51, 41
store i8 0, i8* %48
%65 = icmp eq i8* %48, getelementptr inbounds ([32 x i8], [32 x i8]* @searchwhatis.section, i64 0, i64 0)
%66 = select i1 %64, i1 true, i1 %65
%67 = select i1 %66, i32 0, i32 %40
%68 = select i1 %66, i32 %51, i32 41
%69 = load i32, i32* @EOF
br label %70
70: ; preds = %63, %46
%71 = phi i32 [ %43, %46 ], [ %69, %63 ]
%72 = phi i32 [ 0, %46 ], [ %67, %63 ]
%73 = phi i32 [ %19, %46 ], [ %68, %63 ]
%74 = icmp ne i32 %73, %71
%75 = icmp ne i32 %73, 10
%76 = and i1 %75, %74
br i1 %76, label %77, label %83
77: ; preds = %70, %77
%78 = call i32 @getc(i32* %0)
%79 = load i32, i32* @EOF
%80 = icmp ne i32 %78, %79
%81 = icmp ne i32 %78, 10
%82 = and i1 %81, %80
br i1 %82, label %77, label %83
83: ; preds = %77, %70
%84 = phi i32 [ %73, %70 ], [ %78, %77 ]
%85 = phi i32 [ %71, %70 ], [ %79, %77 ]
%86 = phi i1 [ %74, %70 ], [ %80, %77 ]
%87 = icmp eq i32 %72, 0
%88 = select i1 %87, i1 %86, i1 false
br i1 %88, label %8, label %89
89: ; preds = %83
br i1 %87, label %91, label %90
90: ; preds = %89
store i8* getelementptr inbounds ([256 x i8], [256 x i8]* @searchwhatis.page, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @searchwhatis.section, i64 0, i64 0), i8** %3
br label %91
91: ; preds = %90, %89
%92 = icmp eq i32 %84, %85
%93 = select i1 %92, i32 -1, i32 %72
ret i32 %93
}