#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*/ add_name(char const *, char *);
char *strtok(char *, char *);
void proc_names(const char *chan, char *names) {
  char *p;
  if (!(p = strtok(names, " ")))
    return;
  do {
    if (*p == '@' || *p == '+')
      p++;
    add_name(chan, p);
  } while ((p = strtok(NULL, " ")));
}


x86 assembly (clang, -O0):
<proc_names>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1153 <proc_names+0x33>
jmp    11af <proc_names+0x8f>
jmp    1158 <proc_names+0x38>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
je     1178 <proc_names+0x58>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    1184 <proc_names+0x64>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <add_name@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe64(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1158 <proc_names+0x38>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_names>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0xecf(%rip),%rsi
mov    %rax,%rdi
call   1040 <strtok@plt>
test   %rax,%rax
je     117d <proc_names+0x5d>
lea    0xebb(%rip),%r14
jmp    116e <proc_names+0x4e>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <add_name@plt>
xor    %edi,%edi
mov    %r14,%rsi
call   1040 <strtok@plt>
test   %rax,%rax
je     117d <proc_names+0x5d>
movzbl (%rax),%ecx
cmp    $0x40,%cl
je     1150 <proc_names+0x30>
cmp    $0x2b,%cl
je     1150 <proc_names+0x30>
jmp    1154 <proc_names+0x34>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @proc_names(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
%7 = call i8* @strtok(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %2
br label %31
10: ; preds = %2
br label %11
11: ; preds = %28, %10
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 64
br i1 %15, label %21, label %16
16: ; preds = %11
%17 = load i8*, i8** %5
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 43
br i1 %20, label %21, label %24
21: ; preds = %16, %11
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %5
br label %24
24: ; preds = %21, %16
%25 = load i8*, i8** %3
%26 = load i8*, i8** %5
%27 = call i32 @add_name(i8* %25, i8* %26)
br label %28
28: ; preds = %24
%29 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %29, i8** %5
%30 = icmp ne i8* %29, null
br i1 %30, label %11, label %31
31: ; preds = %9, %28
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @proc_names(i8* %0, i8* %1) {
%3 = tail call i8* @strtok(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %15, label %5
5: ; preds = %2, %10
%6 = phi i8* [ %13, %10 ], [ %3, %2 ]
%7 = load i8, i8* %6
switch i8 %7, label %10 [
i8 64, label %8
i8 43, label %8
]
8: ; preds = %5, %5
%9 = getelementptr inbounds i8, i8* %6, i64 1
br label %10
10: ; preds = %5, %8
%11 = phi i8* [ %9, %8 ], [ %6, %5 ]
%12 = tail call i32 @add_name(i8* %0, i8* %11)
%13 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %5
15: ; preds = %10, %2
ret void
}