#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 */
int /*<<< orphan*/ close_story();
int /*<<< orphan*/ configure(int, int);
int /*<<< orphan*/ fix_dictionary();
int /*<<< orphan*/ load_cache();
int /*<<< orphan*/ open_story(char const *);
int /*<<< orphan*/ show_abbreviations();
int /*<<< orphan*/ show_dictionary(int);
int /*<<< orphan*/ show_header();
int /*<<< orphan*/ show_map();
int /*<<< orphan*/ show_objects(int);
int /*<<< orphan*/ show_tree();
int /*<<< orphan*/ show_verbs(int);
int /*<<< orphan*/ tx_printf(char *, char const *);
void process_story(const char *name, int *options, int columns, int symbolic) {
  tx_printf("\nStory file is %s\n", name);
  open_story(name);
  configure(1, 8);
  load_cache();
  fix_dictionary();
  if (options[1])
    show_header();
  if (options[6])
    show_map();
  if (options[0])
    show_abbreviations();
  if (options[2])
    show_objects(symbolic);
  if (options[3])
    show_tree();
  if (options[4])
    show_verbs(symbolic);
  if (options[5])
    show_dictionary(columns);
  close_story();
}


x86 assembly (clang, -O0):
<process_story>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe0f(%rip),%rdi
call   10e0 <tx_printf@plt>
mov    -0x8(%rbp),%rdi
call   10c0 <open_story@plt>
mov    $0x1,%edi
mov    $0x8,%esi
call   10a0 <configure@plt>
mov    $0x0,%al
call   10b0 <load_cache@plt>
mov    $0x0,%al
call   1090 <fix_dictionary@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x4(%rax)
je     1231 <process_story+0x61>
mov    $0x0,%al
call   1050 <show_header@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x18(%rax)
je     1246 <process_story+0x76>
mov    $0x0,%al
call   10f0 <show_map@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     125a <process_story+0x8a>
mov    $0x0,%al
call   1040 <show_abbreviations@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x8(%rax)
je     1270 <process_story+0xa0>
mov    -0x18(%rbp),%edi
call   1060 <show_objects@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0xc(%rax)
je     1285 <process_story+0xb5>
mov    $0x0,%al
call   1070 <show_tree@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x10(%rax)
je     129b <process_story+0xcb>
mov    -0x18(%rbp),%edi
call   1030 <show_verbs@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x14(%rax)
je     12b1 <process_story+0xe1>
mov    -0x14(%rbp),%edi
call   1080 <show_dictionary@plt>
mov    $0x0,%al
call   10d0 <close_story@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_story>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r15d
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xe16(%rip),%rdi
mov    %rbp,%rsi
call   10e0 <tx_printf@plt>
mov    %rbp,%rdi
call   10c0 <open_story@plt>
mov    $0x1,%edi
mov    $0x8,%esi
call   10a0 <configure@plt>
xor    %eax,%eax
call   10b0 <load_cache@plt>
xor    %eax,%eax
call   1090 <fix_dictionary@plt>
cmpl   $0x0,0x4(%rbx)
je     1224 <process_story+0x54>
xor    %eax,%eax
call   1050 <show_header@plt>
cmpl   $0x0,0x18(%rbx)
je     1231 <process_story+0x61>
xor    %eax,%eax
call   10f0 <show_map@plt>
cmpl   $0x0,(%rbx)
je     123d <process_story+0x6d>
xor    %eax,%eax
call   1040 <show_abbreviations@plt>
cmpl   $0x0,0x8(%rbx)
je     124b <process_story+0x7b>
mov    %r15d,%edi
call   1060 <show_objects@plt>
cmpl   $0x0,0xc(%rbx)
je     1258 <process_story+0x88>
xor    %eax,%eax
call   1070 <show_tree@plt>
cmpl   $0x0,0x10(%rbx)
je     1266 <process_story+0x96>
mov    %r15d,%edi
call   1030 <show_verbs@plt>
cmpl   $0x0,0x14(%rbx)
je     1274 <process_story+0xa4>
mov    %r14d,%edi
call   1080 <show_dictionary@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    10d0 <close_story@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\0AStory file is %s\0A\00"
define void @process_story(i8* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = call i32 @tx_printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @open_story(i8* %11)
%13 = call i32 @configure(i32 1, i32 8)
%14 = call i32 (...) @load_cache()
%15 = call i32 (...) @fix_dictionary()
%16 = load i32*, i32** %6
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %4
%21 = call i32 (...) @show_header()
br label %22
22: ; preds = %20, %4
%23 = load i32*, i32** %6
%24 = getelementptr inbounds i32, i32* %23, i64 6
%25 = load i32, i32* %24
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = call i32 (...) @show_map()
br label %29
29: ; preds = %27, %22
%30 = load i32*, i32** %6
%31 = getelementptr inbounds i32, i32* %30, i64 0
%32 = load i32, i32* %31
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %29
%35 = call i32 (...) @show_abbreviations()
br label %36
36: ; preds = %34, %29
%37 = load i32*, i32** %6
%38 = getelementptr inbounds i32, i32* %37, i64 2
%39 = load i32, i32* %38
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %36
%42 = load i32, i32* %8
%43 = call i32 @show_objects(i32 %42)
br label %44
44: ; preds = %41, %36
%45 = load i32*, i32** %6
%46 = getelementptr inbounds i32, i32* %45, i64 3
%47 = load i32, i32* %46
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %44
%50 = call i32 (...) @show_tree()
br label %51
51: ; preds = %49, %44
%52 = load i32*, i32** %6
%53 = getelementptr inbounds i32, i32* %52, i64 4
%54 = load i32, i32* %53
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %51
%57 = load i32, i32* %8
%58 = call i32 @show_verbs(i32 %57)
br label %59
59: ; preds = %56, %51
%60 = load i32*, i32** %6
%61 = getelementptr inbounds i32, i32* %60, i64 5
%62 = load i32, i32* %61
%63 = icmp ne i32 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %59
%65 = load i32, i32* %7
%66 = call i32 @show_dictionary(i32 %65)
br label %67
67: ; preds = %64, %59
%68 = call i32 (...) @close_story()
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0AStory file is %s\0A\00"
define void @process_story(i8* %0, i32* nocapture %1, i32 %2, i32 %3) {
%5 = tail call i32 @tx_printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @open_story(i8* %0)
%7 = tail call i32 @configure(i32 1, i32 8)
%8 = tail call i32 (...) @load_cache()
%9 = tail call i32 (...) @fix_dictionary()
%10 = getelementptr inbounds i32, i32* %1, i64 1
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %4
%14 = tail call i32 (...) @show_header()
br label %15
15: ; preds = %13, %4
%16 = getelementptr inbounds i32, i32* %1, i64 6
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %15
%20 = tail call i32 (...) @show_map()
br label %21
21: ; preds = %19, %15
%22 = load i32, i32* %1
%23 = icmp eq i32 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %21
%25 = tail call i32 (...) @show_abbreviations()
br label %26
26: ; preds = %24, %21
%27 = getelementptr inbounds i32, i32* %1, i64 2
%28 = load i32, i32* %27
%29 = icmp eq i32 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %26
%31 = tail call i32 @show_objects(i32 %3)
br label %32
32: ; preds = %30, %26
%33 = getelementptr inbounds i32, i32* %1, i64 3
%34 = load i32, i32* %33
%35 = icmp eq i32 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %32
%37 = tail call i32 (...) @show_tree()
br label %38
38: ; preds = %36, %32
%39 = getelementptr inbounds i32, i32* %1, i64 4
%40 = load i32, i32* %39
%41 = icmp eq i32 %40, 0
br i1 %41, label %44, label %42
42: ; preds = %38
%43 = tail call i32 @show_verbs(i32 %3)
br label %44
44: ; preds = %42, %38
%45 = getelementptr inbounds i32, i32* %1, i64 5
%46 = load i32, i32* %45
%47 = icmp eq i32 %46, 0
br i1 %47, label %50, label %48
48: ; preds = %44
%49 = tail call i32 @show_dictionary(i32 %2)
br label %50
50: ; preds = %48, %44
%51 = tail call i32 (...) @close_story()
ret void
}