#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_kleene_star(int /*<<< orphan*/);
struct fsm *fsm_symbol(char *);
int /*<<< orphan*/ fsm_term_negation(struct fsm *);
struct fsm *fsm_quantifier(char *string) {
  return (fsm_concat(
      fsm_kleene_star(fsm_term_negation(fsm_symbol(string))),
      fsm_concat(
          fsm_symbol(string),
          fsm_concat(fsm_kleene_star(fsm_term_negation(fsm_symbol(string))),
                     fsm_concat(fsm_symbol(string),
                                fsm_kleene_star(
                                    fsm_term_negation(fsm_symbol(string))))))));
}


x86 assembly (clang, -O0):
<fsm_quantifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,%rdi
call   1050 <fsm_term_negation@plt>
mov    %eax,%edi
call   1030 <fsm_kleene_star@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,%rdi
call   1050 <fsm_term_negation@plt>
mov    %eax,%edi
call   1030 <fsm_kleene_star@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,%rdi
call   1050 <fsm_term_negation@plt>
mov    %eax,%edi
call   1030 <fsm_kleene_star@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rsi
call   1060 <fsm_concat@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
call   1060 <fsm_concat@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
call   1060 <fsm_concat@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
call   1060 <fsm_concat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsm_quantifier>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%rbx
call   1040 <fsm_symbol@plt>
mov    %rax,%rdi
call   1050 <fsm_term_negation@plt>
mov    %eax,%edi
call   1030 <fsm_kleene_star@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,%rdi
call   1050 <fsm_term_negation@plt>
mov    %eax,%edi
call   1030 <fsm_kleene_star@plt>
mov    %rax,%r12
mov    %rbx,%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,%r13
mov    %rbx,%rdi
call   1040 <fsm_symbol@plt>
mov    %rax,%rdi
call   1050 <fsm_term_negation@plt>
mov    %eax,%edi
call   1030 <fsm_kleene_star@plt>
mov    %r13,%rdi
mov    %rax,%rsi
call   1060 <fsm_concat@plt>
mov    %r12,%rdi
mov    %rax,%rsi
call   1060 <fsm_concat@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1060 <fsm_concat@plt>
mov    %r14,%rdi
mov    %rax,%rsi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1060 <fsm_concat@plt>

LLVM IR (-O0):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_quantifier(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.fsm* @fsm_symbol(i8* %3)
%5 = call i32 @fsm_term_negation(%struct.fsm* %4)
%6 = call %struct.fsm* @fsm_kleene_star(i32 %5)
%7 = load i8*, i8** %2
%8 = call %struct.fsm* @fsm_symbol(i8* %7)
%9 = load i8*, i8** %2
%10 = call %struct.fsm* @fsm_symbol(i8* %9)
%11 = call i32 @fsm_term_negation(%struct.fsm* %10)
%12 = call %struct.fsm* @fsm_kleene_star(i32 %11)
%13 = load i8*, i8** %2
%14 = call %struct.fsm* @fsm_symbol(i8* %13)
%15 = load i8*, i8** %2
%16 = call %struct.fsm* @fsm_symbol(i8* %15)
%17 = call i32 @fsm_term_negation(%struct.fsm* %16)
%18 = call %struct.fsm* @fsm_kleene_star(i32 %17)
%19 = call %struct.fsm* @fsm_concat(%struct.fsm* %14, %struct.fsm* %18)
%20 = call %struct.fsm* @fsm_concat(%struct.fsm* %12, %struct.fsm* %19)
%21 = call %struct.fsm* @fsm_concat(%struct.fsm* %8, %struct.fsm* %20)
%22 = call %struct.fsm* @fsm_concat(%struct.fsm* %6, %struct.fsm* %21)
ret %struct.fsm* %22
}

LLVM IR (-O2):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_quantifier(i8* %0) {
%2 = tail call %struct.fsm* @fsm_symbol(i8* %0)
%3 = tail call i32 @fsm_term_negation(%struct.fsm* %2)
%4 = tail call %struct.fsm* @fsm_kleene_star(i32 %3)
%5 = tail call %struct.fsm* @fsm_symbol(i8* %0)
%6 = tail call %struct.fsm* @fsm_symbol(i8* %0)
%7 = tail call i32 @fsm_term_negation(%struct.fsm* %6)
%8 = tail call %struct.fsm* @fsm_kleene_star(i32 %7)
%9 = tail call %struct.fsm* @fsm_symbol(i8* %0)
%10 = tail call %struct.fsm* @fsm_symbol(i8* %0)
%11 = tail call i32 @fsm_term_negation(%struct.fsm* %10)
%12 = tail call %struct.fsm* @fsm_kleene_star(i32 %11)
%13 = tail call %struct.fsm* @fsm_concat(%struct.fsm* %9, %struct.fsm* %12)
%14 = tail call %struct.fsm* @fsm_concat(%struct.fsm* %8, %struct.fsm* %13)
%15 = tail call %struct.fsm* @fsm_concat(%struct.fsm* %5, %struct.fsm* %14)
%16 = tail call %struct.fsm* @fsm_concat(%struct.fsm* %4, %struct.fsm* %15)
ret %struct.fsm* %16
}