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

/* Variables and functions */
char *nextQuotedWord(char **);
char *nextWord(char **);
int /*<<< orphan*/ slNameStore(struct slName **, char *);
int /*<<< orphan*/ slReverse(struct slName **);
struct slName *slNameListOfUniqueWords(char *text, int respectQuotes) {
  struct slName *list = NULL;
  char *word = NULL;
  while (text != NULL) {
    if (respectQuotes)
      word = nextQuotedWord(&text);
    else
      word = nextWord(&text);
    if (word)
      slNameStore(&list, word);
    else
      break;
  }
  slReverse(&list);
  return list;
}


x86 assembly (clang, -O0):
<slNameListOfUniqueWords>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     11ba <slNameListOfUniqueWords+0x7a>
cmpl   $0x0,-0xc(%rbp)
je     1186 <slNameListOfUniqueWords+0x46>
lea    -0x8(%rbp),%rdi
call   1060 <nextQuotedWord@plt>
mov    %rax,-0x20(%rbp)
jmp    1193 <slNameListOfUniqueWords+0x53>
lea    -0x8(%rbp),%rdi
call   1050 <nextWord@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11b0 <slNameListOfUniqueWords+0x70>
mov    -0x20(%rbp),%rsi
lea    -0x18(%rbp),%rdi
call   1040 <slNameStore@plt>
jmp    11b5 <slNameListOfUniqueWords+0x75>
jmp    11ba <slNameListOfUniqueWords+0x7a>
jmp    115f <slNameListOfUniqueWords+0x1f>
lea    -0x18(%rbp),%rdi
call   1030 <slReverse@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slNameListOfUniqueWords>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,0x8(%rsp)
movq   $0x0,(%rsp)
test   %rdi,%rdi
je     11ad <slNameListOfUniqueWords+0x6d>
mov    %esi,%ebx
lea    0x8(%rsp),%r14
mov    %rsp,%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
test   %ebx,%ebx
je     1190 <slNameListOfUniqueWords+0x50>
call   1060 <nextQuotedWord@plt>
test   %rax,%rax
jne    119a <slNameListOfUniqueWords+0x5a>
jmp    11ad <slNameListOfUniqueWords+0x6d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1050 <nextWord@plt>
test   %rax,%rax
je     11ad <slNameListOfUniqueWords+0x6d>
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <slNameStore@plt>
cmpq   $0x0,0x8(%rsp)
jne    1170 <slNameListOfUniqueWords+0x30>
mov    %rsp,%rdi
call   1030 <slReverse@plt>
mov    (%rsp),%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.slName = type { i32 }
define %struct.slName* @slNameListOfUniqueWords(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.slName*
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
store %struct.slName* null, %struct.slName** %5
store i8* null, i8** %6
br label %7
7: ; preds = %24, %2
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %25
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i8* @nextQuotedWord(i8** %3)
store i8* %14, i8** %6
br label %17
15: ; preds = %10
%16 = call i8* @nextWord(i8** %3)
store i8* %16, i8** %6
br label %17
17: ; preds = %15, %13
%18 = load i8*, i8** %6
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i8*, i8** %6
%22 = call i32 @slNameStore(%struct.slName** %5, i8* %21)
br label %24
23: ; preds = %17
br label %25
24: ; preds = %20
br label %7
25: ; preds = %23, %7
%26 = call i32 @slReverse(%struct.slName** %5)
%27 = load %struct.slName*, %struct.slName** %5
ret %struct.slName* %27
}

LLVM IR (-O2):
%struct.slName = type { i32 }
define %struct.slName* @slNameListOfUniqueWords(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca %struct.slName*
store i8* %0, i8** %3
%5 = bitcast %struct.slName** %4 to i8*
store %struct.slName* null, %struct.slName** %4
%6 = icmp eq i8* %0, null
br i1 %6, label %21, label %7
7: ; preds = %2
%8 = icmp eq i32 %1, 0
br label %9
9: ; preds = %7, %17
br i1 %8, label %12, label %10
10: ; preds = %9
%11 = call i8* @nextQuotedWord(i8** %3)
br label %14
12: ; preds = %9
%13 = call i8* @nextWord(i8** %3)
br label %14
14: ; preds = %12, %10
%15 = phi i8* [ %11, %10 ], [ %13, %12 ]
%16 = icmp eq i8* %15, null
br i1 %16, label %21, label %17
17: ; preds = %14
%18 = call i32 @slNameStore(%struct.slName** %4, i8* %15)
%19 = load i8*, i8** %3
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %9
21: ; preds = %17, %14, %2
%22 = call i32 @slReverse(%struct.slName** %4)
%23 = load %struct.slName*, %struct.slName** %4
ret %struct.slName* %23
}