#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 */
struct fsm_trie_handle {
  int dummy;
};
struct fsm {
  int dummy;
};

/* Variables and functions */
char *file_to_mem(char *);
struct fsm *fsm_trie_done(struct fsm_trie_handle *);
int /*<<< orphan*/ fsm_trie_end_word(struct fsm_trie_handle *);
struct fsm_trie_handle *fsm_trie_init();
int /*<<< orphan*/ fsm_trie_symbol(struct fsm_trie_handle *, char *, char *);
char *spacedtext_get_next_line(char **);
char *spacedtext_get_next_token(char **);
scalar_t__ strcmp(char *, char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ xxfree(char *);
struct fsm *fsm_read_spaced_text_file(char *filename) {
  struct fsm_trie_handle *th;
  char *text, *textorig, *insym, *outsym, *t1, *t2, *l1, *l2;
  text = textorig = file_to_mem(filename);
  if (text == NULL)
    return NULL;
  th = fsm_trie_init();
  for (;;) {
    for (; *text != '\0' && *text == '\n'; text++) {
    }
    t1 = spacedtext_get_next_line(&text);
    if (t1 == NULL)
      break;
    if (strlen(t1) == 0)
      continue;
    t2 = spacedtext_get_next_line(&text);
    if (t2 == NULL || strlen(t2) == 0) {
      for (l1 = t1; (insym = spacedtext_get_next_token(&l1)) != NULL;) {
        if (strcmp(insym, "0") == 0)
          fsm_trie_symbol(th, "@_EPSILON_SYMBOL_@", "@_EPSILON_SYMBOL_@");
        else if (strcmp(insym, "%0") == 0)
          fsm_trie_symbol(th, "0", "0");
        else
          fsm_trie_symbol(th, insym, insym);
      }
      fsm_trie_end_word(th);
    } else {
      for (l1 = t1, l2 = t2;;) {
        insym = spacedtext_get_next_token(&l1);
        outsym = spacedtext_get_next_token(&l2);
        if (insym == NULL && outsym == NULL)
          break;
        if (insym == NULL || strcmp(insym, "0") == 0)
          insym = "@_EPSILON_SYMBOL_@";
        if (strcmp(insym, "%0") == 0)
          insym = "0";
        if (outsym == NULL || strcmp(outsym, "0") == 0)
          outsym = "@_EPSILON_SYMBOL_@";
        if (strcmp(outsym, "%0") == 0)
          outsym = "0";
        fsm_trie_symbol(th, insym, outsym);
      }
      fsm_trie_end_word(th);
    }
  }
  xxfree(textorig);
  return (fsm_trie_done(th));
}


x86 assembly (clang, -O0):
<fsm_read_spaced_text_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <file_to_mem@plt>
mov    %rax,-0x28(%rbp)
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11d5 <fsm_read_spaced_text_file+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1465 <fsm_read_spaced_text_file+0x2c5>
mov    $0x0,%al
call   10a0 <fsm_trie_init@plt>
mov    %rax,-0x18(%rbp)
jmp    11e5 <fsm_read_spaced_text_file+0x45>
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x59(%rbp)
je     120a <fsm_read_spaced_text_file+0x6a>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x59(%rbp)
mov    -0x59(%rbp),%al
test   $0x1,%al
jne    121a <fsm_read_spaced_text_file+0x7a>
jmp    1230 <fsm_read_spaced_text_file+0x90>
jmp    121f <fsm_read_spaced_text_file+0x7f>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    11e5 <fsm_read_spaced_text_file+0x45>
lea    -0x20(%rbp),%rdi
call   1070 <spacedtext_get_next_line@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    124d <fsm_read_spaced_text_file+0xad>
jmp    144f <fsm_read_spaced_text_file+0x2af>
mov    -0x40(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jne    1265 <fsm_read_spaced_text_file+0xc5>
jmp    11e0 <fsm_read_spaced_text_file+0x40>
lea    -0x20(%rbp),%rdi
call   1070 <spacedtext_get_next_line@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     1290 <fsm_read_spaced_text_file+0xf0>
mov    -0x48(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jne    133c <fsm_read_spaced_text_file+0x19c>
mov    -0x40(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x50(%rbp),%rdi
call   10b0 <spacedtext_get_next_token@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
je     132e <fsm_read_spaced_text_file+0x18e>
mov    -0x30(%rbp),%rdi
lea    0xd5a(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    12e1 <fsm_read_spaced_text_file+0x141>
mov    -0x18(%rbp),%rdi
lea    0xd2c(%rip),%rdx
mov    %rdx,%rsi
call   1050 <fsm_trie_symbol@plt>
jmp    1329 <fsm_read_spaced_text_file+0x189>
mov    -0x30(%rbp),%rdi
lea    0xd27(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1313 <fsm_read_spaced_text_file+0x173>
mov    -0x18(%rbp),%rdi
lea    0xd0e(%rip),%rdx
mov    %rdx,%rsi
call   1050 <fsm_trie_symbol@plt>
jmp    1324 <fsm_read_spaced_text_file+0x184>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1050 <fsm_trie_symbol@plt>
jmp    1329 <fsm_read_spaced_text_file+0x189>
jmp    1298 <fsm_read_spaced_text_file+0xf8>
mov    -0x18(%rbp),%rdi
call   1090 <fsm_trie_end_word@plt>
jmp    144a <fsm_read_spaced_text_file+0x2aa>
mov    -0x40(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    -0x50(%rbp),%rdi
call   10b0 <spacedtext_get_next_token@plt>
mov    %rax,-0x30(%rbp)
lea    -0x58(%rbp),%rdi
call   10b0 <spacedtext_get_next_token@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1381 <fsm_read_spaced_text_file+0x1e1>
cmpq   $0x0,-0x38(%rbp)
jne    1381 <fsm_read_spaced_text_file+0x1e1>
jmp    1441 <fsm_read_spaced_text_file+0x2a1>
cmpq   $0x0,-0x30(%rbp)
je     13a6 <fsm_read_spaced_text_file+0x206>
mov    -0x30(%rbp),%rdi
lea    0xc7d(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    13b1 <fsm_read_spaced_text_file+0x211>
lea    0xc53(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xc57(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    13d6 <fsm_read_spaced_text_file+0x236>
lea    0xc42(%rip),%rax
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     13fb <fsm_read_spaced_text_file+0x25b>
mov    -0x38(%rbp),%rdi
lea    0xc28(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1406 <fsm_read_spaced_text_file+0x266>
lea    0xbfe(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xc02(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    142b <fsm_read_spaced_text_file+0x28b>
lea    0xbed(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
call   1050 <fsm_trie_symbol@plt>
jmp    134c <fsm_read_spaced_text_file+0x1ac>
mov    -0x18(%rbp),%rdi
call   1090 <fsm_trie_end_word@plt>
jmp    11e0 <fsm_read_spaced_text_file+0x40>
mov    -0x28(%rbp),%rdi
call   10c0 <xxfree@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fsm_trie_done@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsm_read_spaced_text_file>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
call   1050 <file_to_mem@plt>
mov    %rax,0x10(%rsp)
test   %rax,%rax
je     139c <fsm_read_spaced_text_file+0x20c>
mov    %rax,%rbp
xor    %eax,%eax
call   1090 <fsm_trie_init@plt>
mov    %rax,%rbx
lea    0x10(%rsp),%r15
lea    0xe4a(%rip),%r13
lea    0xe42(%rip),%r14
mov    %rbp,0x20(%rsp)
mov    %rbp,%rax
jmp    11f2 <fsm_read_spaced_text_file+0x62>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1080 <fsm_trie_end_word@plt>
lea    0x10(%rsp),%r15
mov    0x10(%rsp),%rax
cmpb   $0xa,(%rax)
jne    120e <fsm_read_spaced_text_file+0x7e>
add    $0x1,%rax
nopl   0x0(%rax,%rax,1)
mov    %rax,0x10(%rsp)
cmpb   $0xa,(%rax)
lea    0x1(%rax),%rax
je     1200 <fsm_read_spaced_text_file+0x70>
mov    %r15,%rdi
call   1060 <spacedtext_get_next_line@plt>
test   %rax,%rax
je     1388 <fsm_read_spaced_text_file+0x1f8>
mov    %rax,%rbp
cmpb   $0x0,(%rax)
je     11ed <fsm_read_spaced_text_file+0x5d>
mov    %r15,%rdi
call   1060 <spacedtext_get_next_line@plt>
test   %rax,%rax
je     1300 <fsm_read_spaced_text_file+0x170>
cmpb   $0x0,(%rax)
je     1300 <fsm_read_spaced_text_file+0x170>
mov    %rbp,0x8(%rsp)
mov    %rax,0x18(%rsp)
jmp    1277 <fsm_read_spaced_text_file+0xe7>
nopl   (%rax)
lea    0xda9(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
cmove  %r13,%r15
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
call   1040 <fsm_trie_symbol@plt>
lea    0x8(%rsp),%rdi
call   10a0 <spacedtext_get_next_token@plt>
mov    %rax,%rbp
lea    0x18(%rsp),%rdi
call   10a0 <spacedtext_get_next_token@plt>
mov    %rax,%r15
test   %rbp,%rbp
sete   %al
test   %r15,%r15
sete   %r12b
mov    %rbp,%rcx
or     %r15,%rcx
je     11e0 <fsm_read_spaced_text_file+0x50>
test   $0x1,%al
jne    12be <fsm_read_spaced_text_file+0x12e>
mov    %rbp,%rdi
mov    %r13,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    12c5 <fsm_read_spaced_text_file+0x135>
lea    0xd3b(%rip),%rbp
mov    %rbp,%rdi
mov    %r14,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
cmove  %r13,%rbp
test   $0x1,%r12b
jne    1250 <fsm_read_spaced_text_file+0xc0>
mov    %r15,%rdi
mov    %r13,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    1257 <fsm_read_spaced_text_file+0xc7>
jmp    1250 <fsm_read_spaced_text_file+0xc0>
nopw   0x0(%rax,%rax,1)
mov    %rbp,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   10a0 <spacedtext_get_next_token@plt>
test   %rax,%rax
je     11e0 <fsm_read_spaced_text_file+0x50>
mov    %rax,%rbp
jmp    1348 <fsm_read_spaced_text_file+0x1b8>
nopl   (%rax)
mov    %rbx,%rdi
lea    0xcd6(%rip),%rdx
mov    %rdx,%rsi
call   1040 <fsm_trie_symbol@plt>
lea    0x8(%rsp),%rdi
call   10a0 <spacedtext_get_next_token@plt>
mov    %rax,%rbp
test   %rax,%rax
je     11e0 <fsm_read_spaced_text_file+0x50>
mov    %rbp,%rdi
mov    %r13,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1320 <fsm_read_spaced_text_file+0x190>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1070 <strcmp@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     1380 <fsm_read_spaced_text_file+0x1f0>
mov    %rbp,%rsi
mov    %rbp,%rdx
jmp    132d <fsm_read_spaced_text_file+0x19d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13,%rsi
mov    %r13,%rdx
jmp    132d <fsm_read_spaced_text_file+0x19d>
mov    0x20(%rsp),%rdi
call   10b0 <xxfree@plt>
mov    %rbx,%rdi
call   1030 <fsm_trie_done@plt>
jmp    139e <fsm_read_spaced_text_file+0x20e>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.fsm = type { i32 }
%struct.fsm_trie_handle = type { i32 }
@.str = [2 x i8] c"0\00"
@.str.1 = [19 x i8] c"@_EPSILON_SYMBOL_@\00"
@.str.2 = [3 x i8] c"%0\00"
define %struct.fsm* @fsm_read_spaced_text_file(i8* %0) {
%2 = alloca %struct.fsm*
%3 = alloca i8*
%4 = alloca %struct.fsm_trie_handle*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %3
%13 = load i8*, i8** %3
%14 = call i8* @file_to_mem(i8* %13)
store i8* %14, i8** %6
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %18
17: ; preds = %1
store %struct.fsm* null, %struct.fsm** %2
br label %136
18: ; preds = %1
%19 = call %struct.fsm_trie_handle* (...) @fsm_trie_init()
store %struct.fsm_trie_handle* %19, %struct.fsm_trie_handle** %4
br label %20
20: ; preds = %130, %46, %18
br label %21
21: ; preds = %34, %20
%22 = load i8*, i8** %5
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %31
26: ; preds = %21
%27 = load i8*, i8** %5
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 10
br label %31
31: ; preds = %26, %21
%32 = phi i1 [ false, %21 ], [ %30, %26 ]
br i1 %32, label %33, label %37
33: ; preds = %31
br label %34
34: ; preds = %33
%35 = load i8*, i8** %5
%36 = getelementptr inbounds i8, i8* %35, i32 1
store i8* %36, i8** %5
br label %21
37: ; preds = %31
%38 = call i8* @spacedtext_get_next_line(i8** %5)
store i8* %38, i8** %9
%39 = load i8*, i8** %9
%40 = icmp eq i8* %39, null
br i1 %40, label %41, label %42
41: ; preds = %37
br label %131
42: ; preds = %37
%43 = load i8*, i8** %9
%44 = call i64 @strlen(i8* %43)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %42
br label %20
47: ; preds = %42
%48 = call i8* @spacedtext_get_next_line(i8** %5)
store i8* %48, i8** %10
%49 = load i8*, i8** %10
%50 = icmp eq i8* %49, null
br i1 %50, label %55, label %51
51: ; preds = %47
%52 = load i8*, i8** %10
%53 = call i64 @strlen(i8* %52)
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %84
55: ; preds = %51, %47
%56 = load i8*, i8** %9
store i8* %56, i8** %11
br label %57
57: ; preds = %80, %55
%58 = call i8* @spacedtext_get_next_token(i8** %11)
store i8* %58, i8** %7
%59 = icmp ne i8* %58, null
br i1 %59, label %60, label %81
60: ; preds = %57
%61 = load i8*, i8** %7
%62 = call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %60
%65 = load %struct.fsm_trie_handle*, %struct.fsm_trie_handle** %4
%66 = call i32 @fsm_trie_symbol(%struct.fsm_trie_handle* %65, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %80
67: ; preds = %60
%68 = load i8*, i8** %7
%69 = call i64 @strcmp(i8* %68, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %74
71: ; preds = %67
%72 = load %struct.fsm_trie_handle*, %struct.fsm_trie_handle** %4
%73 = call i32 @fsm_trie_symbol(%struct.fsm_trie_handle* %72, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %79
74: ; preds = %67
%75 = load %struct.fsm_trie_handle*, %struct.fsm_trie_handle** %4
%76 = load i8*, i8** %7
%77 = load i8*, i8** %7
%78 = call i32 @fsm_trie_symbol(%struct.fsm_trie_handle* %75, i8* %76, i8* %77)
br label %79
79: ; preds = %74, %71
br label %80
80: ; preds = %79, %64
br label %57
81: ; preds = %57
%82 = load %struct.fsm_trie_handle*, %struct.fsm_trie_handle** %4
%83 = call i32 @fsm_trie_end_word(%struct.fsm_trie_handle* %82)
br label %130
84: ; preds = %51
%85 = load i8*, i8** %9
store i8* %85, i8** %11
%86 = load i8*, i8** %10
store i8* %86, i8** %12
br label %87
87: ; preds = %122, %84
%88 = call i8* @spacedtext_get_next_token(i8** %11)
store i8* %88, i8** %7
%89 = call i8* @spacedtext_get_next_token(i8** %12)
store i8* %89, i8** %8
%90 = load i8*, i8** %7
%91 = icmp eq i8* %90, null
br i1 %91, label %92, label %96
92: ; preds = %87
%93 = load i8*, i8** %8
%94 = icmp eq i8* %93, null
br i1 %94, label %95, label %96
95: ; preds = %92
br label %127
96: ; preds = %92, %87
%97 = load i8*, i8** %7
%98 = icmp eq i8* %97, null
br i1 %98, label %103, label %99
99: ; preds = %96
%100 = load i8*, i8** %7
%101 = call i64 @strcmp(i8* %100, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%102 = icmp eq i64 %101, 0
br i1 %102, label %103, label %104
103: ; preds = %99, %96
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8** %7
br label %104
104: ; preds = %103, %99
%105 = load i8*, i8** %7
%106 = call i64 @strcmp(i8* %105, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%107 = icmp eq i64 %106, 0
br i1 %107, label %108, label %109
108: ; preds = %104
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %7
br label %109
109: ; preds = %108, %104
%110 = load i8*, i8** %8
%111 = icmp eq i8* %110, null
br i1 %111, label %116, label %112
112: ; preds = %109
%113 = load i8*, i8** %8
%114 = call i64 @strcmp(i8* %113, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%115 = icmp eq i64 %114, 0
br i1 %115, label %116, label %117
116: ; preds = %112, %109
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8** %8
br label %117
117: ; preds = %116, %112
%118 = load i8*, i8** %8
%119 = call i64 @strcmp(i8* %118, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%120 = icmp eq i64 %119, 0
br i1 %120, label %121, label %122
121: ; preds = %117
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %8
br label %122
122: ; preds = %121, %117
%123 = load %struct.fsm_trie_handle*, %struct.fsm_trie_handle** %4
%124 = load i8*, i8** %7
%125 = load i8*, i8** %8
%126 = call i32 @fsm_trie_symbol(%struct.fsm_trie_handle* %123, i8* %124, i8* %125)
br label %87
127: ; preds = %95
%128 = load %struct.fsm_trie_handle*, %struct.fsm_trie_handle** %4
%129 = call i32 @fsm_trie_end_word(%struct.fsm_trie_handle* %128)
br label %130
130: ; preds = %127, %81
br label %20
131: ; preds = %41
%132 = load i8*, i8** %6
%133 = call i32 @xxfree(i8* %132)
%134 = load %struct.fsm_trie_handle*, %struct.fsm_trie_handle** %4
%135 = call %struct.fsm* @fsm_trie_done(%struct.fsm_trie_handle* %134)
store %struct.fsm* %135, %struct.fsm** %2
br label %136
136: ; preds = %131, %17
%137 = load %struct.fsm*, %struct.fsm** %2
ret %struct.fsm* %137
}

LLVM IR (-O2):
%struct.fsm = type { i32 }
%struct.fsm_trie_handle = type { i32 }
@.str = [2 x i8] c"0\00"
@.str.1 = [19 x i8] c"@_EPSILON_SYMBOL_@\00"
@.str.2 = [3 x i8] c"%0\00"
define %struct.fsm* @fsm_read_spaced_text_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = bitcast i8** %2 to i8*
%6 = bitcast i8** %3 to i8*
%7 = bitcast i8** %4 to i8*
%8 = tail call i8* @file_to_mem(i8* %0)
store i8* %8, i8** %2
%9 = icmp eq i8* %8, null
br i1 %9, label %94, label %10
10: ; preds = %1
%11 = tail call %struct.fsm_trie_handle* (...) @fsm_trie_init()
br label %12
12: ; preds = %89, %10
%13 = phi i8* [ %90, %89 ], [ %8, %10 ]
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 10
br i1 %15, label %16, label %21
16: ; preds = %12, %16
%17 = phi i8* [ %18, %16 ], [ %13, %12 ]
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8* %18, i8** %2
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 10
br i1 %20, label %16, label %21
21: ; preds = %16, %12
%22 = call i8* @spacedtext_get_next_line(i8** %2)
%23 = icmp eq i8* %22, null
br i1 %23, label %91, label %24
24: ; preds = %21
%25 = load i8, i8* %22
%26 = icmp eq i8 %25, 0
br i1 %26, label %89, label %27
27: ; preds = %24
%28 = call i8* @spacedtext_get_next_line(i8** %2)
%29 = icmp eq i8* %28, null
br i1 %29, label %33, label %30
30: ; preds = %27
%31 = load i8, i8* %28
%32 = icmp eq i8 %31, 0
br i1 %32, label %33, label %52
33: ; preds = %30, %27
store i8* %22, i8** %3
%34 = call i8* @spacedtext_get_next_token(i8** %3)
%35 = icmp eq i8* %34, null
br i1 %35, label %87, label %36
36: ; preds = %33, %49
%37 = phi i8* [ %50, %49 ], [ %34, %33 ]
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %36
%41 = call i32 @fsm_trie_symbol(%struct.fsm_trie_handle* %11, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %49
42: ; preds = %36
%43 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 @fsm_trie_symbol(%struct.fsm_trie_handle* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %49
47: ; preds = %42
%48 = call i32 @fsm_trie_symbol(%struct.fsm_trie_handle* %11, i8* %37, i8* %37)
br label %49
49: ; preds = %45, %47, %40
%50 = call i8* @spacedtext_get_next_token(i8** %3)
%51 = icmp eq i8* %50, null
br i1 %51, label %87, label %36
52: ; preds = %30
store i8* %22, i8** %3
store i8* %28, i8** %4
%53 = call i8* @spacedtext_get_next_token(i8** %3)
%54 = call i8* @spacedtext_get_next_token(i8** %4)
%55 = icmp eq i8* %53, null
%56 = icmp eq i8* %54, null
%57 = select i1 %55, i1 %56, i1 false
br i1 %57, label %87, label %58
58: ; preds = %52, %76
%59 = phi i1 [ %85, %76 ], [ %56, %52 ]
%60 = phi i1 [ %84, %76 ], [ %55, %52 ]
%61 = phi i8* [ %83, %76 ], [ %54, %52 ]
%62 = phi i8* [ %82, %76 ], [ %53, %52 ]
br i1 %60, label %66, label %63
63: ; preds = %58
%64 = call i64 @strcmp(i8* %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %63, %58
br label %67
67: ; preds = %66, %63
%68 = phi i8* [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), %66 ], [ %62, %63 ]
%69 = call i64 @strcmp(i8* %68, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%70 = icmp eq i64 %69, 0
%71 = select i1 %70, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %68
br i1 %59, label %75, label %72
72: ; preds = %67
%73 = call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %76
75: ; preds = %72, %67
br label %76
76: ; preds = %75, %72
%77 = phi i8* [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), %75 ], [ %61, %72 ]
%78 = call i64 @strcmp(i8* %77, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%79 = icmp eq i64 %78, 0
%80 = select i1 %79, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %77
%81 = call i32 @fsm_trie_symbol(%struct.fsm_trie_handle* %11, i8* %71, i8* %80)
%82 = call i8* @spacedtext_get_next_token(i8** %3)
%83 = call i8* @spacedtext_get_next_token(i8** %4)
%84 = icmp eq i8* %82, null
%85 = icmp eq i8* %83, null
%86 = select i1 %84, i1 %85, i1 false
br i1 %86, label %87, label %58
87: ; preds = %76, %49, %52, %33
%88 = call i32 @fsm_trie_end_word(%struct.fsm_trie_handle* %11)
br label %89
89: ; preds = %87, %24
%90 = load i8*, i8** %2
br label %12
91: ; preds = %21
%92 = call i32 @xxfree(i8* %8)
%93 = call %struct.fsm* @fsm_trie_done(%struct.fsm_trie_handle* %11)
br label %94
94: ; preds = %1, %91
%95 = phi %struct.fsm* [ %93, %91 ], [ null, %1 ]
ret %struct.fsm* %95
}