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

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int findword(char *, int);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ memmove(char *, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *strchr(char *, char);
int strlen(char *);
int strncmp(char *, char *, int);
scalar_t__ strstr(char *, char *);
int /*<<< orphan*/ strupr(char *);
char *diction_define(char *word, char *buffer, int buflen) {
  static char *space;
  char text[15 + 1];
  int diff, len, seeklo, seekpt = 0, seekhi;
  int wordlen, red = 0, start = -1, earlier = buflen / 3;
  FILE *fid = fopen("string.fil", "rb");
  if (!fid)
    return 0;
  fseek(fid, 0, SEEK_END);
  len = ftell(fid);
  seeklo = 0;
  seekhi = len - buflen;
  sprintf(text, " %s ", word);
  strupr(text);
  wordlen = strlen(word) + 1;
  while (1) {
    if (seekpt == (seeklo + seekhi) >> 1) {
      break;
    }
    start = 0;
    seekpt = (seeklo + seekhi) >> 1;
    fseek(fid, seekpt, SEEK_SET);
    red = fread(buffer, 1, buflen, fid);
    buffer[buflen - 1] = 0;
    start = seekpt ? findword(buffer + earlier, red - earlier) : 0;
    if (start < 0) {
      assert(0);
      break;
    } else {
      start += earlier;
    }
    strupr(buffer + start);
    diff = strncmp(text + 1, buffer + start, wordlen);
    if (diff == 0) {
      break;
    } else if (diff > 0) {
      seeklo = seekpt;
    } else {
      seekhi = seekpt;
    }
  }
  fclose(fid);
  if (start < 0)
    return 0;
  start = seekpt ? findword(buffer, red) : 0;
  while (1) {
    strupr(buffer + start);
    if ((strncmp(text + 1, buffer + start, wordlen) == 0) ||
        strstr(buffer + start, text))
      break;
    start += strlen(buffer + start) + 1;
    if (start >= buflen - 1) {
      start = -1;
      break;
    }
  }
  if (start >= 0) {
    space = strchr(buffer + start, '\\');
    if (space)
      start = space - buffer + 2;
  }
  if (start > 0)
    memmove(buffer, buffer + start, strlen(buffer + start) + 1);
  return start >= 0 ? buffer : 0;
}


x86 assembly (clang, -O0):
<diction_define>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0xffffffff,-0x50(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x54(%rbp)
lea    0xde0(%rip),%rdi
lea    0xde4(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
jne    1248 <diction_define+0x68>
movq   $0x0,-0x8(%rbp)
jmp    1562 <diction_define+0x382>
mov    -0x60(%rbp),%rdi
mov    0x2d95(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    -0x60(%rbp),%rdi
call   10a0 <ftell@plt>
mov    %eax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x44(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xd87(%rip),%rsi
call   10f0 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   10b0 <strupr@plt>
mov    -0x10(%rbp),%rdi
call   1070 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
mov    -0x40(%rbp),%eax
mov    -0x3c(%rbp),%ecx
add    -0x44(%rbp),%ecx
sar    $0x1,%ecx
cmp    %ecx,%eax
jne    12bd <diction_define+0xdd>
jmp    13c7 <diction_define+0x1e7>
movl   $0x0,-0x50(%rbp)
mov    -0x3c(%rbp),%eax
add    -0x44(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x40(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x40(%rbp),%esi
mov    0x2cfa(%rip),%rax
mov    (%rax),%edx
call   10c0 <fseek@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x60(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fread@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
cmpl   $0x0,-0x40(%rbp)
je     1336 <diction_define+0x156>
mov    -0x18(%rbp),%rdi
movslq -0x54(%rbp),%rax
add    %rax,%rdi
mov    -0x4c(%rbp),%esi
sub    -0x54(%rbp),%esi
call   1030 <findword@plt>
mov    %eax,-0x64(%rbp)
jmp    1340 <diction_define+0x160>
xor    %eax,%eax
mov    %eax,-0x64(%rbp)
jmp    1340 <diction_define+0x160>
mov    -0x64(%rbp),%eax
mov    %eax,-0x50(%rbp)
cmpl   $0x0,-0x50(%rbp)
jge    135c <diction_define+0x17c>
xor    %edi,%edi
call   1090 <assert@plt>
jmp    13c7 <diction_define+0x1e7>
mov    -0x54(%rbp),%eax
add    -0x50(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x50(%rbp),%rax
add    %rax,%rdi
call   10b0 <strupr@plt>
lea    -0x30(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
movslq -0x50(%rbp),%rax
add    %rax,%rsi
mov    -0x48(%rbp),%edx
call   1040 <strncmp@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jne    13a2 <diction_define+0x1c2>
jmp    13c7 <diction_define+0x1e7>
cmpl   $0x0,-0x34(%rbp)
jle    13b7 <diction_define+0x1d7>
mov    -0x40(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    13bd <diction_define+0x1dd>
mov    -0x40(%rbp),%eax
mov    %eax,-0x44(%rbp)
jmp    13c2 <diction_define+0x1e2>
jmp    12a4 <diction_define+0xc4>
mov    -0x60(%rbp),%rdi
call   1060 <fclose@plt>
cmpl   $0x0,-0x50(%rbp)
jge    13e7 <diction_define+0x207>
movq   $0x0,-0x8(%rbp)
jmp    1562 <diction_define+0x382>
cmpl   $0x0,-0x40(%rbp)
je     1405 <diction_define+0x225>
mov    -0x18(%rbp),%rdi
mov    -0x4c(%rbp),%esi
call   1030 <findword@plt>
mov    %eax,-0x68(%rbp)
jmp    140f <diction_define+0x22f>
xor    %eax,%eax
mov    %eax,-0x68(%rbp)
jmp    140f <diction_define+0x22f>
mov    -0x68(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x50(%rbp),%rax
add    %rax,%rdi
call   10b0 <strupr@plt>
lea    -0x30(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
movslq -0x50(%rbp),%rax
add    %rax,%rsi
mov    -0x48(%rbp),%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
je     1467 <diction_define+0x287>
mov    -0x18(%rbp),%rdi
movslq -0x50(%rbp),%rax
add    %rax,%rdi
lea    -0x30(%rbp),%rsi
call   1100 <strstr@plt>
cmp    $0x0,%rax
je     146c <diction_define+0x28c>
jmp    14a7 <diction_define+0x2c7>
mov    -0x18(%rbp),%rdi
movslq -0x50(%rbp),%rax
add    %rax,%rdi
call   1070 <strlen@plt>
add    $0x1,%eax
add    -0x50(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jl     14a2 <diction_define+0x2c2>
movl   $0xffffffff,-0x50(%rbp)
jmp    14a7 <diction_define+0x2c7>
jmp    1415 <diction_define+0x235>
cmpl   $0x0,-0x50(%rbp)
jl     14f5 <diction_define+0x315>
mov    -0x18(%rbp),%rdi
movslq -0x50(%rbp),%rax
add    %rax,%rdi
mov    $0x5c,%esi
call   1080 <strchr@plt>
mov    %rax,0x2bcb(%rip)
cmpq   $0x0,0x2bc3(%rip)
je     14f0 <diction_define+0x310>
mov    0x2bb6(%rip),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
add    $0x2,%rax
mov    %eax,-0x50(%rbp)
jmp    14f5 <diction_define+0x315>
cmpl   $0x0,-0x50(%rbp)
jle    1538 <diction_define+0x358>
mov    -0x18(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x50(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x50(%rbp),%rax
add    %rax,%rdi
call   1070 <strlen@plt>
mov    -0x78(%rbp),%rdi
mov    -0x70(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
call   10d0 <memmove@plt>
cmpl   $0x0,-0x50(%rbp)
jl     154f <diction_define+0x36f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x80(%rbp)
jmp    155a <diction_define+0x37a>
xor    %eax,%eax
mov    %rax,-0x80(%rbp)
jmp    155a <diction_define+0x37a>
mov    -0x80(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diction_define>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %edx,%r13d
mov    %rsi,%rbp
mov    %rdi,%r15
lea    0xe02(%rip),%rdi
lea    0xe06(%rip),%rsi
call   10e0 <fopen@plt>
test   %rax,%rax
je     1496 <diction_define+0x2b6>
mov    %rax,%r12
mov    0x2dcb(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    %r12,%rdi
call   10a0 <ftell@plt>
mov    %eax,%r14d
sub    %r13d,%r14d
lea    0xdd0(%rip),%rsi
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rdx
call   10f0 <sprintf@plt>
mov    %rbx,%rdi
call   10b0 <strupr@plt>
mov    %r15,%rdi
call   1070 <strlen@plt>
cmp    $0x1,%r14d
ja     1271 <diction_define+0x91>
mov    %r12,%rdi
call   1060 <fclose@plt>
jmp    1496 <diction_define+0x2b6>
mov    %eax,%ebx
movl   $0x0,0xc(%rsp)
mov    %r12,0x10(%rsp)
mov    %r13d,0x4(%rsp)
movslq %r13d,%rcx
mov    %rcx,%rax
mov    %rcx,0x50(%rsp)
imul   $0x55555556,%rcx,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
shr    $0x20,%rcx
add    %eax,%ecx
add    $0x1,%ebx
mov    %r14d,%eax
sar    %eax
mov    %rcx,0x28(%rsp)
movslq %ecx,%rcx
mov    %rbp,0x18(%rsp)
add    %rbp,%rcx
mov    %rcx,0x48(%rsp)
mov    %r14d,%ecx
mov    %rcx,0x20(%rsp)
mov    %ebx,0x8(%rsp)
mov    0x10(%rsp),%rbp
jmp    12fb <diction_define+0x11b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x20(%rsp),%rax
lea    (%rcx,%rax,1),%r14d
mov    %r14d,%eax
sar    %eax
mov    %ecx,0xc(%rsp)
cmp    %eax,%r13d
je     13a3 <diction_define+0x1c3>
mov    %eax,%r13d
mov    0x2cd3(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
mov    %r13d,%esi
call   10c0 <fseek@plt>
mov    0x18(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    0x4(%rsp),%edx
mov    %rbp,%rcx
call   1050 <fread@plt>
mov    %eax,%r12d
mov    0x50(%rsp),%rax
movb   $0x0,-0x1(%rbx,%rax,1)
xor    %r15d,%r15d
cmp    $0x2,%r14d
jb     135d <diction_define+0x17d>
mov    %r12d,%esi
sub    0x28(%rsp),%esi
mov    0x48(%rsp),%rdi
call   1030 <findword@plt>
mov    %eax,%r15d
test   %eax,%eax
js     147e <diction_define+0x29e>
add    0x28(%rsp),%r15d
movslq %r15d,%rbx
add    0x18(%rsp),%rbx
mov    %rbx,%rdi
call   10b0 <strupr@plt>
lea    0x31(%rsp),%rdi
mov    %rbx,%rsi
mov    0x8(%rsp),%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     13a3 <diction_define+0x1c3>
mov    %r13d,%ecx
jg     12e0 <diction_define+0x100>
mov    %r13d,%eax
mov    %rax,0x20(%rsp)
mov    0xc(%rsp),%eax
mov    %eax,%ecx
jmp    12e0 <diction_define+0x100>
mov    0x10(%rsp),%rdi
call   1060 <fclose@plt>
xor    %ebp,%ebp
test   %r15d,%r15d
js     1496 <diction_define+0x2b6>
test   %r13d,%r13d
mov    0x18(%rsp),%r14
je     13cf <diction_define+0x1ef>
mov    %r14,%rdi
mov    %r12d,%esi
call   1030 <findword@plt>
mov    %eax,%ebp
lea    0x31(%rsp),%r12
mov    0x4(%rsp),%r13d
add    $0xffffffff,%r13d
lea    0x30(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %ebp,%rbx
add    %r14,%rbx
mov    %rbx,%rdi
call   10b0 <strupr@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    0x8(%rsp),%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     1435 <diction_define+0x255>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1100 <strstr@plt>
test   %rax,%rax
jne    1435 <diction_define+0x255>
mov    %rbx,%rdi
call   1070 <strlen@plt>
add    %eax,%ebp
add    $0x1,%ebp
cmp    %r13d,%ebp
jl     13f0 <diction_define+0x210>
jmp    1496 <diction_define+0x2b6>
test   %ebp,%ebp
js     1496 <diction_define+0x2b6>
mov    %ebp,%edi
add    %r14,%rdi
mov    $0x5c,%esi
call   1080 <strchr@plt>
mov    %rax,0x2c49(%rip)
mov    %eax,%ecx
sub    %r14d,%ecx
add    $0x2,%ecx
test   %rax,%rax
cmove  %ebp,%ecx
test   %ecx,%ecx
jle    1494 <diction_define+0x2b4>
mov    %ecx,%ebx
add    %r14,%rbx
mov    %rbx,%rdi
call   1070 <strlen@plt>
lea    0x1(%rax),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   10d0 <memmove@plt>
jmp    1499 <diction_define+0x2b9>
xor    %r14d,%r14d
xor    %edi,%edi
call   1090 <assert@plt>
mov    0x10(%rsp),%rdi
call   1060 <fclose@plt>
jmp    1499 <diction_define+0x2b9>
jns    1499 <diction_define+0x2b9>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@diction_define.space = internal global i8* null
@.str = [11 x i8] c"string.fil\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@.str.2 = [5 x i8] c" %s \00"
@SEEK_SET = global i32 0
define i8* @diction_define(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [16 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 0, i32* %12
store i32 0, i32* %15
store i32 -1, i32* %16
%19 = load i32, i32* %7
%20 = sdiv i32 %19, 3
store i32 %20, i32* %17
%21 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %21, i32** %18
%22 = load i32*, i32** %18
%23 = icmp ne i32* %22, null
br i1 %23, label %25, label %24
24: ; preds = %3
store i8* null, i8** %4
br label %215
25: ; preds = %3
%26 = load i32*, i32** %18
%27 = load i32, i32* @SEEK_END
%28 = call i32 @fseek(i32* %26, i32 0, i32 %27)
%29 = load i32*, i32** %18
%30 = call i32 @ftell(i32* %29)
store i32 %30, i32* %10
store i32 0, i32* %11
%31 = load i32, i32* %10
%32 = load i32, i32* %7
%33 = sub nsw i32 %31, %32
store i32 %33, i32* %13
%34 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 0
%35 = load i8*, i8** %5
%36 = call i32 @sprintf(i8* %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %35)
%37 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 0
%38 = call i32 @strupr(i8* %37)
%39 = load i8*, i8** %5
%40 = call i32 @strlen(i8* %39)
%41 = add nsw i32 %40, 1
store i32 %41, i32* %14
br label %42
42: ; preds = %25, %115
%43 = load i32, i32* %12
%44 = load i32, i32* %11
%45 = load i32, i32* %13
%46 = add nsw i32 %44, %45
%47 = ashr i32 %46, 1
%48 = icmp eq i32 %43, %47
br i1 %48, label %49, label %50
49: ; preds = %42
br label %116
50: ; preds = %42
store i32 0, i32* %16
%51 = load i32, i32* %11
%52 = load i32, i32* %13
%53 = add nsw i32 %51, %52
%54 = ashr i32 %53, 1
store i32 %54, i32* %12
%55 = load i32*, i32** %18
%56 = load i32, i32* %12
%57 = load i32, i32* @SEEK_SET
%58 = call i32 @fseek(i32* %55, i32 %56, i32 %57)
%59 = load i8*, i8** %6
%60 = load i32, i32* %7
%61 = load i32*, i32** %18
%62 = call i32 @fread(i8* %59, i32 1, i32 %60, i32* %61)
store i32 %62, i32* %15
%63 = load i8*, i8** %6
%64 = load i32, i32* %7
%65 = sub nsw i32 %64, 1
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8, i8* %63, i64 %66
store i8 0, i8* %67
%68 = load i32, i32* %12
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %79
70: ; preds = %50
%71 = load i8*, i8** %6
%72 = load i32, i32* %17
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8, i8* %71, i64 %73
%75 = load i32, i32* %15
%76 = load i32, i32* %17
%77 = sub nsw i32 %75, %76
%78 = call i32 @findword(i8* %74, i32 %77)
br label %80
79: ; preds = %50
br label %80
80: ; preds = %79, %70
%81 = phi i32 [ %78, %70 ], [ 0, %79 ]
store i32 %81, i32* %16
%82 = load i32, i32* %16
%83 = icmp slt i32 %82, 0
br i1 %83, label %84, label %86
84: ; preds = %80
%85 = call i32 @assert(i32 0)
br label %116
86: ; preds = %80
%87 = load i32, i32* %17
%88 = load i32, i32* %16
%89 = add nsw i32 %88, %87
store i32 %89, i32* %16
br label %90
90: ; preds = %86
%91 = load i8*, i8** %6
%92 = load i32, i32* %16
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8, i8* %91, i64 %93
%95 = call i32 @strupr(i8* %94)
%96 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 0
%97 = getelementptr inbounds i8, i8* %96, i64 1
%98 = load i8*, i8** %6
%99 = load i32, i32* %16
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i8, i8* %98, i64 %100
%102 = load i32, i32* %14
%103 = call i32 @strncmp(i8* %97, i8* %101, i32 %102)
store i32 %103, i32* %9
%104 = load i32, i32* %9
%105 = icmp eq i32 %104, 0
br i1 %105, label %106, label %107
106: ; preds = %90
br label %116
107: ; preds = %90
%108 = load i32, i32* %9
%109 = icmp sgt i32 %108, 0
br i1 %109, label %110, label %112
110: ; preds = %107
%111 = load i32, i32* %12
store i32 %111, i32* %11
br label %114
112: ; preds = %107
%113 = load i32, i32* %12
store i32 %113, i32* %13
br label %114
114: ; preds = %112, %110
br label %115
115: ; preds = %114
br label %42
116: ; preds = %106, %84, %49
%117 = load i32*, i32** %18
%118 = call i32 @fclose(i32* %117)
%119 = load i32, i32* %16
%120 = icmp slt i32 %119, 0
br i1 %120, label %121, label %122
121: ; preds = %116
store i8* null, i8** %4
br label %215
122: ; preds = %116
%123 = load i32, i32* %12
%124 = icmp ne i32 %123, 0
br i1 %124, label %125, label %129
125: ; preds = %122
%126 = load i8*, i8** %6
%127 = load i32, i32* %15
%128 = call i32 @findword(i8* %126, i32 %127)
br label %130
129: ; preds = %122
br label %130
130: ; preds = %129, %125
%131 = phi i32 [ %128, %125 ], [ 0, %129 ]
store i32 %131, i32* %16
br label %132
132: ; preds = %130, %170
%133 = load i8*, i8** %6
%134 = load i32, i32* %16
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds i8, i8* %133, i64 %135
%137 = call i32 @strupr(i8* %136)
%138 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 0
%139 = getelementptr inbounds i8, i8* %138, i64 1
%140 = load i8*, i8** %6
%141 = load i32, i32* %16
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds i8, i8* %140, i64 %142
%144 = load i32, i32* %14
%145 = call i32 @strncmp(i8* %139, i8* %143, i32 %144)
%146 = icmp eq i32 %145, 0
br i1 %146, label %155, label %147
147: ; preds = %132
%148 = load i8*, i8** %6
%149 = load i32, i32* %16
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i8, i8* %148, i64 %150
%152 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 0
%153 = call i64 @strstr(i8* %151, i8* %152)
%154 = icmp ne i64 %153, 0
br i1 %154, label %155, label %156
155: ; preds = %147, %132
br label %171
156: ; preds = %147
%157 = load i8*, i8** %6
%158 = load i32, i32* %16
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds i8, i8* %157, i64 %159
%161 = call i32 @strlen(i8* %160)
%162 = add nsw i32 %161, 1
%163 = load i32, i32* %16
%164 = add nsw i32 %163, %162
store i32 %164, i32* %16
%165 = load i32, i32* %16
%166 = load i32, i32* %7
%167 = sub nsw i32 %166, 1
%168 = icmp sge i32 %165, %167
br i1 %168, label %169, label %170
169: ; preds = %156
store i32 -1, i32* %16
br label %171
170: ; preds = %156
br label %132
171: ; preds = %169, %155
%172 = load i32, i32* %16
%173 = icmp sge i32 %172, 0
br i1 %173, label %174, label %191
174: ; preds = %171
%175 = load i8*, i8** %6
%176 = load i32, i32* %16
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds i8, i8* %175, i64 %177
%179 = call i8* @strchr(i8* %178, i8 signext 92)
store i8* %179, i8** @diction_define.space
%180 = load i8*, i8** @diction_define.space
%181 = icmp ne i8* %180, null
br i1 %181, label %182, label %190
182: ; preds = %174
%183 = load i8*, i8** @diction_define.space
%184 = load i8*, i8** %6
%185 = ptrtoint i8* %183 to i64
%186 = ptrtoint i8* %184 to i64
%187 = sub i64 %185, %186
%188 = add nsw i64 %187, 2
%189 = trunc i64 %188 to i32
store i32 %189, i32* %16
br label %190
190: ; preds = %182, %174
br label %191
191: ; preds = %190, %171
%192 = load i32, i32* %16
%193 = icmp sgt i32 %192, 0
br i1 %193, label %194, label %207
194: ; preds = %191
%195 = load i8*, i8** %6
%196 = load i8*, i8** %6
%197 = load i32, i32* %16
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds i8, i8* %196, i64 %198
%200 = load i8*, i8** %6
%201 = load i32, i32* %16
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds i8, i8* %200, i64 %202
%204 = call i32 @strlen(i8* %203)
%205 = add nsw i32 %204, 1
%206 = call i32 @memmove(i8* %195, i8* %199, i32 %205)
br label %207
207: ; preds = %194, %191
%208 = load i32, i32* %16
%209 = icmp sge i32 %208, 0
br i1 %209, label %210, label %212
210: ; preds = %207
%211 = load i8*, i8** %6
br label %213
212: ; preds = %207
br label %213
213: ; preds = %212, %210
%214 = phi i8* [ %211, %210 ], [ null, %212 ]
store i8* %214, i8** %4
br label %215
215: ; preds = %213, %121, %24
%216 = load i8*, i8** %4
ret i8* %216
}

LLVM IR (-O2):
@diction_define.space = internal unnamed_addr global i8* null
@.str = [11 x i8] c"string.fil\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@.str.2 = [5 x i8] c" %s \00"
@SEEK_SET = global i32 0
define i8* @diction_define(i8* %0, i8* %1, i32 %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = sdiv i32 %2, 3
%7 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %109, label %9
9: ; preds = %3
%10 = load i32, i32* @SEEK_END
%11 = tail call i32 @fseek(i32* %7, i32 0, i32 %10)
%12 = tail call i32 @ftell(i32* %7)
%13 = sub nsw i32 %12, %2
%14 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%15 = call i32 @strupr(i8* %5)
%16 = call i32 @strlen(i8* %0)
%17 = add nsw i32 %16, 1
%18 = icmp ult i32 %13, 2
br i1 %18, label %19, label %21
19: ; preds = %9
%20 = call i32 @fclose(i32* %7)
br label %109
21: ; preds = %9
%22 = ashr i32 %13, 1
%23 = add nsw i32 %2, -1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %1, i64 %24
%26 = sext i32 %6 to i64
%27 = getelementptr inbounds i8, i8* %1, i64 %26
%28 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 1
br label %29
29: ; preds = %21, %53
%30 = phi i32 [ %22, %21 ], [ %58, %53 ]
%31 = phi i32 [ %13, %21 ], [ %57, %53 ]
%32 = phi i32 [ 0, %21 ], [ %56, %53 ]
%33 = phi i32 [ %13, %21 ], [ %55, %53 ]
%34 = load i32, i32* @SEEK_SET
%35 = call i32 @fseek(i32* %7, i32 %30, i32 %34)
%36 = call i32 @fread(i8* %1, i32 1, i32 %2, i32* %7)
store i8 0, i8* %25
%37 = icmp ult i32 %31, 2
br i1 %37, label %45, label %38
38: ; preds = %29
%39 = sub nsw i32 %36, %6
%40 = call i32 @findword(i8* %27, i32 %39)
%41 = icmp slt i32 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %38
%43 = call i32 @assert(i32 0)
%44 = call i32 @fclose(i32* %7)
br label %109
45: ; preds = %29, %38
%46 = phi i32 [ %40, %38 ], [ 0, %29 ]
%47 = add nsw i32 %46, %6
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8, i8* %1, i64 %48
%50 = call i32 @strupr(i8* %49)
%51 = call i32 @strncmp(i8* %28, i8* %49, i32 %17)
%52 = icmp eq i32 %51, 0
br i1 %52, label %60, label %53
53: ; preds = %45
%54 = icmp sgt i32 %51, 0
%55 = select i1 %54, i32 %33, i32 %30
%56 = select i1 %54, i32 %30, i32 %32
%57 = add nsw i32 %56, %55
%58 = ashr i32 %57, 1
%59 = icmp eq i32 %30, %58
br i1 %59, label %60, label %29
60: ; preds = %53, %45
%61 = icmp slt i32 %47, 0
%62 = call i32 @fclose(i32* %7)
br i1 %61, label %109, label %63
63: ; preds = %60
%64 = icmp eq i32 %30, 0
br i1 %64, label %67, label %65
65: ; preds = %63
%66 = call i32 @findword(i8* %1, i32 %36)
br label %67
67: ; preds = %63, %65
%68 = phi i32 [ %66, %65 ], [ 0, %63 ]
%69 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 1
%70 = add nsw i32 %2, -1
br label %71
71: ; preds = %81, %67
%72 = phi i32 [ %68, %67 ], [ %84, %81 ]
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8, i8* %1, i64 %73
%75 = call i32 @strupr(i8* %74)
%76 = call i32 @strncmp(i8* %69, i8* %74, i32 %17)
%77 = icmp eq i32 %76, 0
br i1 %77, label %86, label %78
78: ; preds = %71
%79 = call i64 @strstr(i8* %74, i8* %5)
%80 = icmp eq i64 %79, 0
br i1 %80, label %81, label %86
81: ; preds = %78
%82 = call i32 @strlen(i8* %74)
%83 = add i32 %72, 1
%84 = add i32 %83, %82
%85 = icmp slt i32 %84, %70
br i1 %85, label %71, label %109
86: ; preds = %71, %78
%87 = icmp sgt i32 %72, -1
br i1 %87, label %88, label %109
88: ; preds = %86
%89 = zext i32 %72 to i64
%90 = getelementptr inbounds i8, i8* %1, i64 %89
%91 = call i8* @strchr(i8* dereferenceable(1) %90, i8 signext 92)
store i8* %91, i8** @diction_define.space
%92 = icmp eq i8* %91, null
%93 = ptrtoint i8* %91 to i64
%94 = ptrtoint i8* %1 to i64
%95 = sub i64 %93, %94
%96 = trunc i64 %95 to i32
%97 = add i32 %96, 2
%98 = select i1 %92, i32 %72, i32 %97
%99 = icmp sgt i32 %98, 0
br i1 %99, label %100, label %106
100: ; preds = %88
%101 = zext i32 %98 to i64
%102 = getelementptr inbounds i8, i8* %1, i64 %101
%103 = call i32 @strlen(i8* %102)
%104 = add nsw i32 %103, 1
%105 = call i32 @memmove(i8* %1, i8* %102, i32 %104)
br label %108
106: ; preds = %88
%107 = icmp sgt i32 %98, -1
br i1 %107, label %108, label %109
108: ; preds = %100, %106
br label %109
109: ; preds = %81, %19, %86, %108, %106, %42, %60, %3
%110 = phi i8* [ null, %3 ], [ null, %60 ], [ null, %42 ], [ %1, %108 ], [ null, %106 ], [ null, %86 ], [ null, %19 ], [ null, %81 ]
ret i8* %110
}