#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 */

/* Variables and functions */
int /*<<< orphan*/ assert(char *);
int /*<<< orphan*/ execute(char *, char *, char *);
int /*<<< orphan*/ free(char *);
scalar_t__ isPlaying();
int /*<<< orphan*/ putTextItemToQueue(char *, char *, char *);
void play(char *synthCommand, char *playerCommand, char *text) {
  assert(synthCommand);
  assert(playerCommand);
  assert(text);
  if (isPlaying()) {
    putTextItemToQueue(synthCommand, playerCommand, text);
    return;
  }
  execute(synthCommand, playerCommand, text);
  free(synthCommand);
  free(playerCommand);
  free(text);
}


x86 assembly (clang, -O0):
<play>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1070 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1070 <assert@plt>
mov    $0x0,%al
call   1050 <isPlaying@plt>
cmp    $0x0,%rax
je     11a6 <play+0x56>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <putTextItemToQueue@plt>
jmp    11d2 <play+0x82>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1060 <execute@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<play>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1070 <assert@plt>
mov    %r15,%rdi
call   1070 <assert@plt>
mov    %r14,%rdi
call   1070 <assert@plt>
xor    %eax,%eax
call   1050 <isPlaying@plt>
test   %rax,%rax
je     1192 <play+0x42>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <putTextItemToQueue@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1060 <execute@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @play(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = call i32 @assert(i8* %7)
%9 = load i8*, i8** %5
%10 = call i32 @assert(i8* %9)
%11 = load i8*, i8** %6
%12 = call i32 @assert(i8* %11)
%13 = call i64 (...) @isPlaying()
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i8*, i8** %4
%17 = load i8*, i8** %5
%18 = load i8*, i8** %6
%19 = call i32 @putTextItemToQueue(i8* %16, i8* %17, i8* %18)
br label %31
20: ; preds = %3
%21 = load i8*, i8** %4
%22 = load i8*, i8** %5
%23 = load i8*, i8** %6
%24 = call i32 @execute(i8* %21, i8* %22, i8* %23)
%25 = load i8*, i8** %4
%26 = call i32 @free(i8* %25)
%27 = load i8*, i8** %5
%28 = call i32 @free(i8* %27)
%29 = load i8*, i8** %6
%30 = call i32 @free(i8* %29)
br label %31
31: ; preds = %20, %15
ret void
}

LLVM IR (-O2):
define void @play(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @assert(i8* %0)
%5 = tail call i32 @assert(i8* %1)
%6 = tail call i32 @assert(i8* %2)
%7 = tail call i64 (...) @isPlaying()
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @putTextItemToQueue(i8* %0, i8* %1, i8* %2)
br label %16
11: ; preds = %3
%12 = tail call i32 @execute(i8* %0, i8* %1, i8* %2)
%13 = tail call i32 @free(i8* %0)
%14 = tail call i32 @free(i8* %1)
%15 = tail call i32 @free(i8* %2)
br label %16
16: ; preds = %11, %9
ret void
}