#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 */
char *strsep(char **, char *);
char **parse_line(char *str) {
  static char *args[8];
  char *token;
  int n = 0;
  while ((token = strsep(&str, "\n\t ,")) != NULL) {
    if (token[0] == '#' || n + 1 == 8)
      break;
    if (token[0] == '\0')
      continue;
    args[n++] = token;
  }
  args[n] = NULL;
  return args;
}


x86 assembly (clang, -O0):
<parse_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <strsep@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     119c <parse_line+0x8c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     1160 <parse_line+0x50>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cmp    $0x8,%eax
jne    1165 <parse_line+0x55>
jmp    119c <parse_line+0x8c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    117a <parse_line+0x6a>
jmp    1123 <parse_line+0x13>
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2ead(%rip),%rax
mov    %rdx,(%rax,%rcx,8)
jmp    1123 <parse_line+0x13>
movslq -0x14(%rbp),%rcx
lea    0x2e99(%rip),%rax
movq   $0x0,(%rax,%rcx,8)
lea    0x2e8a(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_line>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdi,0x8(%rsp)
xor    %r12d,%r12d
lea    0xed4(%rip),%r15
lea    0x8(%rsp),%r13
lea    0x2f08(%rip),%r14
lea    0x1(%r12),%rbx
nopl   (%rax)
mov    %r13,%rdi
mov    %r15,%rsi
call   1030 <strsep@plt>
test   %rax,%rax
je     116b <parse_line+0x5b>
movzbl (%rax),%ecx
cmp    $0x23,%cl
je     116b <parse_line+0x5b>
cmp    $0x8,%rbx
je     116b <parse_line+0x5b>
test   %cl,%cl
je     1140 <parse_line+0x30>
mov    %rax,(%r14,%r12,8)
mov    %rbx,%r12
jmp    1138 <parse_line+0x28>
mov    %r12d,%eax
movq   $0x0,(%r14,%rax,8)
mov    %r14,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@parse_line.args = internal global [8 x i8*] zeroinitializer
@.str = [5 x i8] c"\0A\09 ,\00"
define i8** @parse_line(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
br label %5
5: ; preds = %26, %25, %1
%6 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %32
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 35
br i1 %13, label %18, label %14
14: ; preds = %8
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = icmp eq i32 %16, 8
br i1 %17, label %18, label %19
18: ; preds = %14, %8
br label %32
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %19
br label %5
26: ; preds = %19
%27 = load i8*, i8** %3
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
%30 = sext i32 %28 to i64
%31 = getelementptr inbounds [8 x i8*], [8 x i8*]* @parse_line.args, i64 0, i64 %30
store i8* %27, i8** %31
br label %5
32: ; preds = %18, %5
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [8 x i8*], [8 x i8*]* @parse_line.args, i64 0, i64 %34
store i8* null, i8** %35
ret i8** getelementptr inbounds ([8 x i8*], [8 x i8*]* @parse_line.args, i64 0, i64 0)
}

LLVM IR (-O2):
@parse_line.args = internal global [8 x i8*] zeroinitializer
@.str = [5 x i8] c"\0A\09 ,\00"
define i8** @parse_line(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = phi i64 [ %5, %16 ], [ 0, %1 ]
%5 = add nuw nsw i64 %4, 1
%6 = icmp eq i64 %5, 8
br label %7
7: ; preds = %3, %14
%8 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i8* %8, null
br i1 %9, label %18, label %10
10: ; preds = %7
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 35
%13 = select i1 %12, i1 true, i1 %6
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = icmp eq i8 %11, 0
br i1 %15, label %7, label %16
16: ; preds = %14
%17 = getelementptr inbounds [8 x i8*], [8 x i8*]* @parse_line.args, i64 0, i64 %4
store i8* %8, i8** %17
br label %3
18: ; preds = %10, %7
%19 = and i64 %4, 4294967295
%20 = getelementptr inbounds [8 x i8*], [8 x i8*]* @parse_line.args, i64 0, i64 %19
store i8* null, i8** %20
ret i8** getelementptr inbounds ([8 x i8*], [8 x i8*]* @parse_line.args, i64 0, i64 0)
}