#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*/ StrStrip(char *, char *);
char *StrCommaSeparatedListScan(char **inscan, char *out) {
  char *outscan = out;
  while ((**inscan != '\0') && (**inscan != ','))
    *(outscan++) = *((*inscan)++);
  if (**inscan == ',')
    (*inscan)++;
  *outscan = '\0';
  StrStrip(out, out);
  return out;
}


x86 assembly (clang, -O0):
<StrCommaSeparatedListScan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1153 <StrCommaSeparatedListScan+0x43>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1163 <StrCommaSeparatedListScan+0x53>
jmp    118c <StrCommaSeparatedListScan+0x7c>
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1128 <StrCommaSeparatedListScan+0x18>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    11ad <StrCommaSeparatedListScan+0x9d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <StrStrip@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrCommaSeparatedListScan>:
push   %rbx
mov    %rsi,%rbx
mov    %rsi,%rax
nopw   0x0(%rax,%rax,1)
mov    (%rdi),%rcx
movzbl (%rcx),%edx
test   %dl,%dl
je     1148 <StrCommaSeparatedListScan+0x38>
cmp    $0x2c,%dl
je     1141 <StrCommaSeparatedListScan+0x31>
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
movzbl (%rcx),%ecx
mov    %cl,(%rax)
add    $0x1,%rax
jmp    1120 <StrCommaSeparatedListScan+0x10>
add    $0x1,%rcx
mov    %rcx,(%rdi)
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <StrStrip@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @StrCommaSeparatedListScan(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
br label %7
7: ; preds = %21, %2
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %7
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 44
br label %19
19: ; preds = %13, %7
%20 = phi i1 [ false, %7 ], [ %18, %13 ]
br i1 %20, label %21, label %28
21: ; preds = %19
%22 = load i8**, i8*** %3
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %22
%25 = load i8, i8* %23
%26 = load i8*, i8** %5
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %5
store i8 %25, i8* %26
br label %7
28: ; preds = %19
%29 = load i8**, i8*** %3
%30 = load i8*, i8** %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 44
br i1 %33, label %34, label %38
34: ; preds = %28
%35 = load i8**, i8*** %3
%36 = load i8*, i8** %35
%37 = getelementptr inbounds i8, i8* %36, i32 1
store i8* %37, i8** %35
br label %38
38: ; preds = %34, %28
%39 = load i8*, i8** %5
store i8 0, i8* %39
%40 = load i8*, i8** %4
%41 = load i8*, i8** %4
%42 = call i32 @StrStrip(i8* %40, i8* %41)
%43 = load i8*, i8** %4
ret i8* %43
}

LLVM IR (-O2):
define i8* @StrCommaSeparatedListScan(i8** nocapture %0, i8* returned %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %10, %7 ]
%5 = load i8*, i8** %0
%6 = load i8, i8* %5
switch i8 %6, label %7 [
i8 44, label %11
i8 0, label %13
]
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %8, i8** %0
%9 = load i8, i8* %5
%10 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %9, i8* %4
br label %3
11: ; preds = %3
%12 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %12, i8** %0
br label %13
13: ; preds = %3, %11
store i8 0, i8* %4
%14 = tail call i32 @StrStrip(i8* %1, i8* %1)
ret i8* %1
}