#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 t_nfa {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_charset_n(struct t_nfa *, char *);
int /*<<< orphan*/ add_finalset_n(struct t_nfa *, int *, int);
int /*<<< orphan*/ add_move_n(struct t_nfa *, int, char, int);
int /*<<< orphan*/ add_startset_n(struct t_nfa *, int *, int);
int /*<<< orphan*/ add_state_n(struct t_nfa *, int);
int /*<<< orphan*/ free_nfa(struct t_nfa *);
struct t_nfa *make_nfa();
int /*<<< orphan*/ move_n(struct t_nfa *, int, char);
int /*<<< orphan*/ print_int(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  struct t_nfa *pn = make_nfa();
  add_state_n(pn, 5);
  add_charset_n(pn, "01");
  add_move_n(pn, 0, '0', 1);
  add_move_n(pn, 1, '1', 2);
  add_move_n(pn, 2, '0', 2);
  add_move_n(pn, 2, '1', 2);
  add_move_n(pn, 2, '1', 3);
  add_move_n(pn, 3, '0', 4);
  int fset[] = {4};
  int sset[] = {0};
  add_finalset_n(pn, fset, 1);
  add_startset_n(pn, sset, 1);
  print_int(move_n(pn, 2, '1'));
  print_int(move_n(pn, 0, '0'));
  free_nfa(pn);
  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   1040 <make_nfa@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
call   1090 <add_state_n@plt>
mov    -0x18(%rbp),%rdi
lea    0xe26(%rip),%rsi
call   10b0 <add_charset_n@plt>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
mov    $0x1,%ecx
call   1030 <add_move_n@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
mov    $0x31,%edx
mov    $0x2,%ecx
call   1030 <add_move_n@plt>
mov    -0x18(%rbp),%rdi
mov    $0x2,%ecx
mov    $0x30,%edx
mov    %ecx,%esi
call   1030 <add_move_n@plt>
mov    -0x18(%rbp),%rdi
mov    $0x2,%ecx
mov    $0x31,%edx
mov    %ecx,%esi
call   1030 <add_move_n@plt>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
mov    $0x31,%edx
mov    $0x3,%ecx
call   1030 <add_move_n@plt>
mov    -0x18(%rbp),%rdi
mov    $0x3,%esi
mov    $0x30,%edx
mov    $0x4,%ecx
call   1030 <add_move_n@plt>
mov    0xd98(%rip),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x1,%edx
call   1060 <add_finalset_n@plt>
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   10a0 <add_startset_n@plt>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
mov    $0x31,%edx
call   1080 <move_n@plt>
mov    %eax,%edi
call   1070 <print_int@plt>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1080 <move_n@plt>
mov    %eax,%edi
call   1070 <print_int@plt>
mov    -0x18(%rbp),%rdi
call   10c0 <free_nfa@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <make_nfa@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x5,%esi
call   1080 <add_state_n@plt>
lea    0xe4d(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <add_charset_n@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x30,%edx
mov    $0x1,%ecx
call   1030 <add_move_n@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x31,%edx
mov    $0x2,%ecx
call   1030 <add_move_n@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x30,%edx
mov    $0x2,%ecx
call   1030 <add_move_n@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x31,%edx
mov    $0x2,%ecx
call   1030 <add_move_n@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x31,%edx
mov    $0x3,%ecx
call   1030 <add_move_n@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x30,%edx
mov    $0x4,%ecx
call   1030 <add_move_n@plt>
movl   $0x4,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1050 <add_finalset_n@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1090 <add_startset_n@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x31,%edx
call   1070 <move_n@plt>
mov    %eax,%edi
call   1060 <print_int@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1070 <move_n@plt>
mov    %eax,%edi
call   1060 <print_int@plt>
mov    %rbx,%rdi
call   10b0 <free_nfa@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.t_nfa = type { i32 }
@.str = [3 x i8] c"01\00"
@__const.main.fset = [1 x i32] [i32 4]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.t_nfa*
%7 = alloca [1 x i32]
%8 = alloca [1 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call %struct.t_nfa* (...) @make_nfa()
store %struct.t_nfa* %9, %struct.t_nfa** %6
%10 = load %struct.t_nfa*, %struct.t_nfa** %6
%11 = call i32 @add_state_n(%struct.t_nfa* %10, i32 5)
%12 = load %struct.t_nfa*, %struct.t_nfa** %6
%13 = call i32 @add_charset_n(%struct.t_nfa* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = load %struct.t_nfa*, %struct.t_nfa** %6
%15 = call i32 @add_move_n(%struct.t_nfa* %14, i32 0, i8 signext 48, i32 1)
%16 = load %struct.t_nfa*, %struct.t_nfa** %6
%17 = call i32 @add_move_n(%struct.t_nfa* %16, i32 1, i8 signext 49, i32 2)
%18 = load %struct.t_nfa*, %struct.t_nfa** %6
%19 = call i32 @add_move_n(%struct.t_nfa* %18, i32 2, i8 signext 48, i32 2)
%20 = load %struct.t_nfa*, %struct.t_nfa** %6
%21 = call i32 @add_move_n(%struct.t_nfa* %20, i32 2, i8 signext 49, i32 2)
%22 = load %struct.t_nfa*, %struct.t_nfa** %6
%23 = call i32 @add_move_n(%struct.t_nfa* %22, i32 2, i8 signext 49, i32 3)
%24 = load %struct.t_nfa*, %struct.t_nfa** %6
%25 = call i32 @add_move_n(%struct.t_nfa* %24, i32 3, i8 signext 48, i32 4)
%26 = bitcast [1 x i32]* %7 to i8*
%27 = bitcast [1 x i32]* %8 to i8*
%28 = load %struct.t_nfa*, %struct.t_nfa** %6
%29 = getelementptr inbounds [1 x i32], [1 x i32]* %7, i64 0, i64 0
%30 = call i32 @add_finalset_n(%struct.t_nfa* %28, i32* %29, i32 1)
%31 = load %struct.t_nfa*, %struct.t_nfa** %6
%32 = getelementptr inbounds [1 x i32], [1 x i32]* %8, i64 0, i64 0
%33 = call i32 @add_startset_n(%struct.t_nfa* %31, i32* %32, i32 1)
%34 = load %struct.t_nfa*, %struct.t_nfa** %6
%35 = call i32 @move_n(%struct.t_nfa* %34, i32 2, i8 signext 49)
%36 = call i32 @print_int(i32 %35)
%37 = load %struct.t_nfa*, %struct.t_nfa** %6
%38 = call i32 @move_n(%struct.t_nfa* %37, i32 0, i8 signext 48)
%39 = call i32 @print_int(i32 %38)
%40 = load %struct.t_nfa*, %struct.t_nfa** %6
%41 = call i32 @free_nfa(%struct.t_nfa* %40)
ret i32 0
}

LLVM IR (-O2):
%struct.t_nfa = type { i32 }
@.str = [3 x i8] c"01\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1 x i32]
%4 = alloca [1 x i32]
%5 = tail call %struct.t_nfa* (...) @make_nfa()
%6 = tail call i32 @add_state_n(%struct.t_nfa* %5, i32 5)
%7 = tail call i32 @add_charset_n(%struct.t_nfa* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @add_move_n(%struct.t_nfa* %5, i32 0, i8 signext 48, i32 1)
%9 = tail call i32 @add_move_n(%struct.t_nfa* %5, i32 1, i8 signext 49, i32 2)
%10 = tail call i32 @add_move_n(%struct.t_nfa* %5, i32 2, i8 signext 48, i32 2)
%11 = tail call i32 @add_move_n(%struct.t_nfa* %5, i32 2, i8 signext 49, i32 2)
%12 = tail call i32 @add_move_n(%struct.t_nfa* %5, i32 2, i8 signext 49, i32 3)
%13 = tail call i32 @add_move_n(%struct.t_nfa* %5, i32 3, i8 signext 48, i32 4)
%14 = bitcast [1 x i32]* %3 to i8*
%15 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 4, i32* %15
%16 = bitcast [1 x i32]* %4 to i8*
%17 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
store i32 0, i32* %17
%18 = call i32 @add_finalset_n(%struct.t_nfa* %5, i32* %15, i32 1)
%19 = call i32 @add_startset_n(%struct.t_nfa* %5, i32* %17, i32 1)
%20 = call i32 @move_n(%struct.t_nfa* %5, i32 2, i8 signext 49)
%21 = call i32 @print_int(i32 %20)
%22 = call i32 @move_n(%struct.t_nfa* %5, i32 0, i8 signext 48)
%23 = call i32 @print_int(i32 %22)
%24 = call i32 @free_nfa(%struct.t_nfa* %5)
ret i32 0
}