#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fill_in_table();
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ generate_initial_state();
int /*<<< orphan*/ generate_other_states();
int /*<<< orphan*/ print_states();
int /*<<< orphan*/ write_table(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  FILE *outfile;
  generate_initial_state();
  generate_other_states();
  print_states();
  fill_in_table();
  outfile = fopen("parse_table.h", "w");
  write_table(outfile);
  fclose(outfile);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <generate_initial_state@plt>
mov    $0x0,%al
call   1090 <generate_other_states@plt>
mov    $0x0,%al
call   1050 <print_states@plt>
mov    $0x0,%al
call   1030 <fill_in_table@plt>
lea    0xe57(%rip),%rdi
lea    0xe5e(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <write_table@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <generate_initial_state@plt>
xor    %eax,%eax
call   1090 <generate_other_states@plt>
xor    %eax,%eax
call   1050 <print_states@plt>
xor    %eax,%eax
call   1030 <fill_in_table@plt>
lea    0xe6c(%rip),%rdi
lea    0xe73(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1080 <write_table@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"parse_table.h\00"
@.str.1 = [2 x i8] c"w\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @generate_initial_state()
%8 = call i32 (...) @generate_other_states()
%9 = call i32 (...) @print_states()
%10 = call i32 (...) @fill_in_table()
%11 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %11, i32** %6
%12 = load i32*, i32** %6
%13 = call i32 @write_table(i32* %12)
%14 = load i32*, i32** %6
%15 = call i32 @fclose(i32* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"parse_table.h\00"
@.str.1 = [2 x i8] c"w\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @generate_initial_state()
%4 = tail call i32 (...) @generate_other_states()
%5 = tail call i32 (...) @print_states()
%6 = tail call i32 (...) @fill_in_table()
%7 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @write_table(i32* %7)
%9 = tail call i32 @fclose(i32* %7)
ret i32 0
}