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

/* Variables and functions */
char *quotstrtok(char *, char *, int *);
struct slist_t *slist_init(char *);
int /*<<< orphan*/ slist_push(struct slist_t *, char *);
int /*<<< orphan*/ strlen(char *);
int config_parse_users(char *line, struct slist_t **sl) {
  int offset = 0;
  char *entry;
  if (!line || !strlen(line)) {
    *sl = (struct slist_t *)0;
    return 0;
  }
  while ((entry = quotstrtok(line, " \t", &offset))) {
    if (!*sl) {
      *sl = slist_init(entry);
    } else {
      slist_push(*sl, entry);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<config_parse_users>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1174 <config_parse_users+0x34>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%eax
jne    118b <config_parse_users+0x4b>
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    11f4 <config_parse_users+0xb4>
jmp    1190 <config_parse_users+0x50>
mov    -0x10(%rbp),%rdi
lea    0xe65(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <quotstrtok@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     11ed <config_parse_users+0xad>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    11d8 <config_parse_users+0x98>
mov    -0x28(%rbp),%rdi
call   1050 <slist_init@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    11e8 <config_parse_users+0xa8>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x28(%rbp),%rsi
call   1060 <slist_push@plt>
jmp    1190 <config_parse_users+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_parse_users>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
movl   $0x0,0x4(%rsp)
test   %rdi,%rdi
je     11c0 <config_parse_users+0x80>
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
je     11c0 <config_parse_users+0x80>
lea    0xe95(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %r14,%rdi
call   1030 <quotstrtok@plt>
test   %rax,%rax
je     11c7 <config_parse_users+0x87>
lea    0xe7c(%rip),%r15
lea    0x4(%rsp),%r12
jmp    11ab <config_parse_users+0x6b>
nopl   0x0(%rax,%rax,1)
mov    %rax,%rsi
call   1060 <slist_push@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <quotstrtok@plt>
test   %rax,%rax
je     11c7 <config_parse_users+0x87>
mov    (%rbx),%rdi
test   %rdi,%rdi
jne    1190 <config_parse_users+0x50>
mov    %rax,%rdi
call   1050 <slist_init@plt>
mov    %rax,(%rbx)
jmp    1198 <config_parse_users+0x58>
movq   $0x0,(%rbx)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.slist_t = type { i32 }
@.str = [3 x i8] c" \09\00"
define i32 @config_parse_users(i8* %0, %struct.slist_t** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.slist_t**
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store %struct.slist_t** %1, %struct.slist_t*** %5
store i32 0, i32* %6
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @strlen(i8* %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %10, %2
%15 = load %struct.slist_t**, %struct.slist_t*** %5
store %struct.slist_t* null, %struct.slist_t** %15
store i32 0, i32* %3
br label %36
16: ; preds = %10
br label %17
17: ; preds = %34, %16
%18 = load i8*, i8** %4
%19 = call i8* @quotstrtok(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
store i8* %19, i8** %7
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %35
21: ; preds = %17
%22 = load %struct.slist_t**, %struct.slist_t*** %5
%23 = load %struct.slist_t*, %struct.slist_t** %22
%24 = icmp ne %struct.slist_t* %23, null
br i1 %24, label %29, label %25
25: ; preds = %21
%26 = load i8*, i8** %7
%27 = call %struct.slist_t* @slist_init(i8* %26)
%28 = load %struct.slist_t**, %struct.slist_t*** %5
store %struct.slist_t* %27, %struct.slist_t** %28
br label %34
29: ; preds = %21
%30 = load %struct.slist_t**, %struct.slist_t*** %5
%31 = load %struct.slist_t*, %struct.slist_t** %30
%32 = load i8*, i8** %7
%33 = call i32 @slist_push(%struct.slist_t* %31, i8* %32)
br label %34
34: ; preds = %29, %25
br label %17
35: ; preds = %17
store i32 0, i32* %3
br label %36
36: ; preds = %35, %14
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
%struct.slist_t = type { i32 }
@.str = [3 x i8] c" \09\00"
define i32 @config_parse_users(i8* %0, %struct.slist_t** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = icmp eq i8* %0, null
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = call i8* @quotstrtok(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%11 = icmp eq i8* %10, null
br i1 %11, label %24, label %13
12: ; preds = %6, %2
store %struct.slist_t* null, %struct.slist_t** %1
br label %24
13: ; preds = %9, %21
%14 = phi i8* [ %22, %21 ], [ %10, %9 ]
%15 = load %struct.slist_t*, %struct.slist_t** %1
%16 = icmp eq %struct.slist_t* %15, null
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call %struct.slist_t* @slist_init(i8* %14)
store %struct.slist_t* %18, %struct.slist_t** %1
br label %21
19: ; preds = %13
%20 = call i32 @slist_push(%struct.slist_t* %15, i8* %14)
br label %21
21: ; preds = %19, %17
%22 = call i8* @quotstrtok(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %13
24: ; preds = %21, %9, %12
ret i32 0
}