#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 */
struct fsm *fsm_concat(struct fsm *, struct fsm *);
struct fsm *fsm_ignore(int /*<<< orphan*/, int /*<<< orphan*/, int);
struct fsm *fsm_symbol(char *);
int /*<<< orphan*/ fsm_union(struct fsm *, struct fsm *);
struct fsm *fsm_universal();
int /*<<< orphan*/ union_quantifiers();
struct fsm *fsm_logical_eq(char *string1, char *string2) {
  return (fsm_concat(
      fsm_universal(),
      fsm_concat(
          fsm_ignore(
              fsm_union(fsm_concat(fsm_symbol(string1), fsm_symbol(string2)),
                        fsm_concat(fsm_symbol(string2), fsm_symbol(string1))),
              union_quantifiers(), 1),
          fsm_concat(
              fsm_universal(),
              fsm_concat(fsm_ignore(fsm_union(fsm_concat(fsm_symbol(string1),
                                                         fsm_symbol(string2)),
                                              fsm_concat(fsm_symbol(string2),
                                                         fsm_symbol(string1))),
                                    union_quantifiers(), 1),
                         fsm_universal())))));
}


x86 assembly (clang, -O0):
<fsm_logical_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1080 <fsm_universal@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,-0x70(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fsm_symbol@plt>
mov    -0x70(%rbp),%rdi
mov    %rax,%rsi
call   1070 <fsm_concat@plt>
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,-0x68(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fsm_symbol@plt>
mov    -0x68(%rbp),%rdi
mov    %rax,%rsi
call   1070 <fsm_concat@plt>
mov    -0x60(%rbp),%rdi
mov    %rax,%rsi
call   1060 <fsm_union@plt>
mov    %eax,-0x54(%rbp)
mov    $0x0,%al
call   1030 <union_quantifiers@plt>
mov    -0x54(%rbp),%edi
mov    %eax,%esi
mov    $0x1,%edx
call   1050 <fsm_ignore@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1080 <fsm_universal@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fsm_symbol@plt>
mov    -0x50(%rbp),%rdi
mov    %rax,%rsi
call   1070 <fsm_concat@plt>
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fsm_symbol@plt>
mov    -0x48(%rbp),%rdi
mov    %rax,%rsi
call   1070 <fsm_concat@plt>
mov    -0x40(%rbp),%rdi
mov    %rax,%rsi
call   1060 <fsm_union@plt>
mov    %eax,-0x34(%rbp)
mov    $0x0,%al
call   1030 <union_quantifiers@plt>
mov    -0x34(%rbp),%edi
mov    %eax,%esi
mov    $0x1,%edx
call   1050 <fsm_ignore@plt>
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   1080 <fsm_universal@plt>
mov    -0x30(%rbp),%rdi
mov    %rax,%rsi
call   1070 <fsm_concat@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rsi
call   1070 <fsm_concat@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
call   1070 <fsm_concat@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
call   1070 <fsm_concat@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsm_logical_eq>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbp
mov    %rdi,%r15
xor    %eax,%eax
call   1080 <fsm_universal@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1040 <fsm_symbol@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1070 <fsm_concat@plt>
mov    %rax,%r12
mov    %rbp,%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <fsm_symbol@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1070 <fsm_concat@plt>
mov    %r12,%rdi
mov    %rax,%rsi
call   1060 <fsm_union@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <union_quantifiers@plt>
mov    %ebx,%edi
mov    %eax,%esi
mov    $0x1,%edx
call   1050 <fsm_ignore@plt>
mov    %rax,%r12
xor    %eax,%eax
call   1080 <fsm_universal@plt>
mov    %rax,%r13
mov    %r15,%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1040 <fsm_symbol@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1070 <fsm_concat@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,%rbp
mov    %r15,%rdi
call   1040 <fsm_symbol@plt>
mov    %rbp,%rdi
mov    %rax,%rsi
call   1070 <fsm_concat@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1060 <fsm_union@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <union_quantifiers@plt>
mov    %ebx,%edi
mov    %eax,%esi
mov    $0x1,%edx
call   1050 <fsm_ignore@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1080 <fsm_universal@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1070 <fsm_concat@plt>
mov    %r13,%rdi
mov    %rax,%rsi
call   1070 <fsm_concat@plt>
mov    %r12,%rdi
mov    %rax,%rsi
call   1070 <fsm_concat@plt>
mov    %r14,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <fsm_concat@plt>

LLVM IR (-O0):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_logical_eq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call %struct.fsm* (...) @fsm_universal()
%6 = load i8*, i8** %3
%7 = call %struct.fsm* @fsm_symbol(i8* %6)
%8 = load i8*, i8** %4
%9 = call %struct.fsm* @fsm_symbol(i8* %8)
%10 = call %struct.fsm* @fsm_concat(%struct.fsm* %7, %struct.fsm* %9)
%11 = load i8*, i8** %4
%12 = call %struct.fsm* @fsm_symbol(i8* %11)
%13 = load i8*, i8** %3
%14 = call %struct.fsm* @fsm_symbol(i8* %13)
%15 = call %struct.fsm* @fsm_concat(%struct.fsm* %12, %struct.fsm* %14)
%16 = call i32 @fsm_union(%struct.fsm* %10, %struct.fsm* %15)
%17 = call i32 (...) @union_quantifiers()
%18 = call %struct.fsm* @fsm_ignore(i32 %16, i32 %17, i32 1)
%19 = call %struct.fsm* (...) @fsm_universal()
%20 = load i8*, i8** %3
%21 = call %struct.fsm* @fsm_symbol(i8* %20)
%22 = load i8*, i8** %4
%23 = call %struct.fsm* @fsm_symbol(i8* %22)
%24 = call %struct.fsm* @fsm_concat(%struct.fsm* %21, %struct.fsm* %23)
%25 = load i8*, i8** %4
%26 = call %struct.fsm* @fsm_symbol(i8* %25)
%27 = load i8*, i8** %3
%28 = call %struct.fsm* @fsm_symbol(i8* %27)
%29 = call %struct.fsm* @fsm_concat(%struct.fsm* %26, %struct.fsm* %28)
%30 = call i32 @fsm_union(%struct.fsm* %24, %struct.fsm* %29)
%31 = call i32 (...) @union_quantifiers()
%32 = call %struct.fsm* @fsm_ignore(i32 %30, i32 %31, i32 1)
%33 = call %struct.fsm* (...) @fsm_universal()
%34 = call %struct.fsm* @fsm_concat(%struct.fsm* %32, %struct.fsm* %33)
%35 = call %struct.fsm* @fsm_concat(%struct.fsm* %19, %struct.fsm* %34)
%36 = call %struct.fsm* @fsm_concat(%struct.fsm* %18, %struct.fsm* %35)
%37 = call %struct.fsm* @fsm_concat(%struct.fsm* %5, %struct.fsm* %36)
ret %struct.fsm* %37
}

LLVM IR (-O2):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_logical_eq(i8* %0, i8* %1) {
%3 = tail call %struct.fsm* (...) @fsm_universal()
%4 = tail call %struct.fsm* @fsm_symbol(i8* %0)
%5 = tail call %struct.fsm* @fsm_symbol(i8* %1)
%6 = tail call %struct.fsm* @fsm_concat(%struct.fsm* %4, %struct.fsm* %5)
%7 = tail call %struct.fsm* @fsm_symbol(i8* %1)
%8 = tail call %struct.fsm* @fsm_symbol(i8* %0)
%9 = tail call %struct.fsm* @fsm_concat(%struct.fsm* %7, %struct.fsm* %8)
%10 = tail call i32 @fsm_union(%struct.fsm* %6, %struct.fsm* %9)
%11 = tail call i32 (...) @union_quantifiers()
%12 = tail call %struct.fsm* @fsm_ignore(i32 %10, i32 %11, i32 1)
%13 = tail call %struct.fsm* (...) @fsm_universal()
%14 = tail call %struct.fsm* @fsm_symbol(i8* %0)
%15 = tail call %struct.fsm* @fsm_symbol(i8* %1)
%16 = tail call %struct.fsm* @fsm_concat(%struct.fsm* %14, %struct.fsm* %15)
%17 = tail call %struct.fsm* @fsm_symbol(i8* %1)
%18 = tail call %struct.fsm* @fsm_symbol(i8* %0)
%19 = tail call %struct.fsm* @fsm_concat(%struct.fsm* %17, %struct.fsm* %18)
%20 = tail call i32 @fsm_union(%struct.fsm* %16, %struct.fsm* %19)
%21 = tail call i32 (...) @union_quantifiers()
%22 = tail call %struct.fsm* @fsm_ignore(i32 %20, i32 %21, i32 1)
%23 = tail call %struct.fsm* (...) @fsm_universal()
%24 = tail call %struct.fsm* @fsm_concat(%struct.fsm* %22, %struct.fsm* %23)
%25 = tail call %struct.fsm* @fsm_concat(%struct.fsm* %13, %struct.fsm* %24)
%26 = tail call %struct.fsm* @fsm_concat(%struct.fsm* %12, %struct.fsm* %25)
%27 = tail call %struct.fsm* @fsm_concat(%struct.fsm* %3, %struct.fsm* %26)
ret %struct.fsm* %27
}