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

/* Variables and functions */
int /*<<< orphan*/ fsm_concat(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ fsm_contains(int /*<<< orphan*/);
int /*<<< orphan*/ fsm_copy(struct fsm *);
int /*<<< orphan*/ fsm_destroy(struct fsm *);
int /*<<< orphan*/ fsm_identity();
int /*<<< orphan*/ fsm_intersect(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ fsm_kleene_plus(int /*<<< orphan*/);
struct fsm *fsm_minus(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ fsm_union(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ fsm_universal();
struct fsm *fsm_contains_one(struct fsm *net) {
  struct fsm *ret;
  ret = fsm_minus(
      fsm_contains(fsm_copy(net)),
      fsm_contains(fsm_union(
          fsm_intersect(fsm_concat(fsm_kleene_plus(fsm_identity()),
                                   fsm_concat(fsm_copy(net), fsm_universal())),
                        fsm_concat(fsm_copy(net), fsm_universal())),
          fsm_intersect(
              fsm_concat(fsm_copy(net), fsm_kleene_plus(fsm_identity())),
              fsm_copy(net)))));
  fsm_destroy(net);
  return (ret);
}


x86 assembly (clang, -O0):
<fsm_contains_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fsm_copy@plt>
mov    %eax,%edi
call   1030 <fsm_contains@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1080 <fsm_identity@plt>
mov    %eax,%edi
call   1040 <fsm_kleene_plus@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fsm_copy@plt>
mov    %eax,-0x30(%rbp)
mov    $0x0,%al
call   10b0 <fsm_universal@plt>
mov    -0x30(%rbp),%edi
mov    %eax,%esi
call   10a0 <fsm_concat@plt>
mov    -0x2c(%rbp),%edi
mov    %eax,%esi
call   10a0 <fsm_concat@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fsm_copy@plt>
mov    %eax,-0x28(%rbp)
mov    $0x0,%al
call   10b0 <fsm_universal@plt>
mov    -0x28(%rbp),%edi
mov    %eax,%esi
call   10a0 <fsm_concat@plt>
mov    -0x24(%rbp),%edi
mov    %eax,%esi
call   10c0 <fsm_intersect@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fsm_copy@plt>
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1080 <fsm_identity@plt>
mov    %eax,%edi
call   1040 <fsm_kleene_plus@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%esi
call   10a0 <fsm_concat@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fsm_copy@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   10c0 <fsm_intersect@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
call   1090 <fsm_union@plt>
mov    %eax,%edi
call   1030 <fsm_contains@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1070 <fsm_minus@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <fsm_destroy@plt>
mov    -0x10(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsm_contains_one>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <fsm_copy@plt>
mov    %eax,%edi
call   1030 <fsm_contains@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1080 <fsm_identity@plt>
mov    %eax,%edi
call   1040 <fsm_kleene_plus@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1050 <fsm_copy@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   10b0 <fsm_universal@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   10a0 <fsm_concat@plt>
mov    %r15d,%edi
mov    %eax,%esi
call   10a0 <fsm_concat@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1050 <fsm_copy@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   10b0 <fsm_universal@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   10a0 <fsm_concat@plt>
mov    %r15d,%edi
mov    %eax,%esi
call   10c0 <fsm_intersect@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1050 <fsm_copy@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1080 <fsm_identity@plt>
mov    %eax,%edi
call   1040 <fsm_kleene_plus@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   10a0 <fsm_concat@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <fsm_copy@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   10c0 <fsm_intersect@plt>
mov    %r15d,%edi
mov    %eax,%esi
call   1090 <fsm_union@plt>
mov    %eax,%edi
call   1030 <fsm_contains@plt>
mov    %r14d,%edi
mov    %eax,%esi
call   1070 <fsm_minus@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1060 <fsm_destroy@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_contains_one(%struct.fsm* %0) {
%2 = alloca %struct.fsm*
%3 = alloca %struct.fsm*
store %struct.fsm* %0, %struct.fsm** %2
%4 = load %struct.fsm*, %struct.fsm** %2
%5 = call i32 @fsm_copy(%struct.fsm* %4)
%6 = call i32 @fsm_contains(i32 %5)
%7 = call i32 (...) @fsm_identity()
%8 = call i32 @fsm_kleene_plus(i32 %7)
%9 = load %struct.fsm*, %struct.fsm** %2
%10 = call i32 @fsm_copy(%struct.fsm* %9)
%11 = call i32 (...) @fsm_universal()
%12 = call i32 @fsm_concat(i32 %10, i32 %11)
%13 = call i32 @fsm_concat(i32 %8, i32 %12)
%14 = load %struct.fsm*, %struct.fsm** %2
%15 = call i32 @fsm_copy(%struct.fsm* %14)
%16 = call i32 (...) @fsm_universal()
%17 = call i32 @fsm_concat(i32 %15, i32 %16)
%18 = call i32 @fsm_intersect(i32 %13, i32 %17)
%19 = load %struct.fsm*, %struct.fsm** %2
%20 = call i32 @fsm_copy(%struct.fsm* %19)
%21 = call i32 (...) @fsm_identity()
%22 = call i32 @fsm_kleene_plus(i32 %21)
%23 = call i32 @fsm_concat(i32 %20, i32 %22)
%24 = load %struct.fsm*, %struct.fsm** %2
%25 = call i32 @fsm_copy(%struct.fsm* %24)
%26 = call i32 @fsm_intersect(i32 %23, i32 %25)
%27 = call i32 @fsm_union(i32 %18, i32 %26)
%28 = call i32 @fsm_contains(i32 %27)
%29 = call %struct.fsm* @fsm_minus(i32 %6, i32 %28)
store %struct.fsm* %29, %struct.fsm** %3
%30 = load %struct.fsm*, %struct.fsm** %2
%31 = call i32 @fsm_destroy(%struct.fsm* %30)
%32 = load %struct.fsm*, %struct.fsm** %3
ret %struct.fsm* %32
}

LLVM IR (-O2):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_contains_one(%struct.fsm* %0) {
%2 = tail call i32 @fsm_copy(%struct.fsm* %0)
%3 = tail call i32 @fsm_contains(i32 %2)
%4 = tail call i32 (...) @fsm_identity()
%5 = tail call i32 @fsm_kleene_plus(i32 %4)
%6 = tail call i32 @fsm_copy(%struct.fsm* %0)
%7 = tail call i32 (...) @fsm_universal()
%8 = tail call i32 @fsm_concat(i32 %6, i32 %7)
%9 = tail call i32 @fsm_concat(i32 %5, i32 %8)
%10 = tail call i32 @fsm_copy(%struct.fsm* %0)
%11 = tail call i32 (...) @fsm_universal()
%12 = tail call i32 @fsm_concat(i32 %10, i32 %11)
%13 = tail call i32 @fsm_intersect(i32 %9, i32 %12)
%14 = tail call i32 @fsm_copy(%struct.fsm* %0)
%15 = tail call i32 (...) @fsm_identity()
%16 = tail call i32 @fsm_kleene_plus(i32 %15)
%17 = tail call i32 @fsm_concat(i32 %14, i32 %16)
%18 = tail call i32 @fsm_copy(%struct.fsm* %0)
%19 = tail call i32 @fsm_intersect(i32 %17, i32 %18)
%20 = tail call i32 @fsm_union(i32 %13, i32 %19)
%21 = tail call i32 @fsm_contains(i32 %20)
%22 = tail call %struct.fsm* @fsm_minus(i32 %3, i32 %21)
%23 = tail call i32 @fsm_destroy(%struct.fsm* %0)
ret %struct.fsm* %22
}