#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_complement(int /*<<< orphan*/);
int /*<<< orphan*/ fsm_contains(int /*<<< orphan*/);
int /*<<< orphan*/ fsm_contains_one(int /*<<< orphan*/);
int /*<<< orphan*/ fsm_copy(struct fsm *);
int /*<<< orphan*/ fsm_destroy(struct fsm *);
struct fsm *fsm_union(int /*<<< orphan*/, int /*<<< orphan*/);
struct fsm *fsm_contains_opt_one(struct fsm *net) {
  struct fsm *ret;
  ret = fsm_union(fsm_contains_one(fsm_copy(net)),
                  fsm_complement(fsm_contains(fsm_copy(net))));
  fsm_destroy(net);
  return (ret);
}


x86 assembly (clang, -O0):
<fsm_contains_opt_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fsm_copy@plt>
mov    %eax,%edi
call   1060 <fsm_contains_one@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fsm_copy@plt>
mov    %eax,%edi
call   1030 <fsm_contains@plt>
mov    %eax,%edi
call   1040 <fsm_complement@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1080 <fsm_union@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <fsm_destroy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsm_contains_opt_one>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <fsm_copy@plt>
mov    %eax,%edi
call   1060 <fsm_contains_one@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <fsm_copy@plt>
mov    %eax,%edi
call   1030 <fsm_contains@plt>
mov    %eax,%edi
call   1040 <fsm_complement@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1080 <fsm_union@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1070 <fsm_destroy@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_contains_opt_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_one(i32 %5)
%7 = load %struct.fsm*, %struct.fsm** %2
%8 = call i32 @fsm_copy(%struct.fsm* %7)
%9 = call i32 @fsm_contains(i32 %8)
%10 = call i32 @fsm_complement(i32 %9)
%11 = call %struct.fsm* @fsm_union(i32 %6, i32 %10)
store %struct.fsm* %11, %struct.fsm** %3
%12 = load %struct.fsm*, %struct.fsm** %2
%13 = call i32 @fsm_destroy(%struct.fsm* %12)
%14 = load %struct.fsm*, %struct.fsm** %3
ret %struct.fsm* %14
}

LLVM IR (-O2):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_contains_opt_one(%struct.fsm* %0) {
%2 = tail call i32 @fsm_copy(%struct.fsm* %0)
%3 = tail call i32 @fsm_contains_one(i32 %2)
%4 = tail call i32 @fsm_copy(%struct.fsm* %0)
%5 = tail call i32 @fsm_contains(i32 %4)
%6 = tail call i32 @fsm_complement(i32 %5)
%7 = tail call %struct.fsm* @fsm_union(i32 %3, i32 %6)
%8 = tail call i32 @fsm_destroy(%struct.fsm* %0)
ret %struct.fsm* %7
}