int isns_attr_list_split(char *line, char **argv, unsigned int argc_max) {
  char *src = line;
  unsigned int argc = 0, quoted = 0;
  if (!line)
    return 0;
  while (1) {
    char *dst;
    while (isspace(*src))
      ++src;
    if (!*src)
      break;
    argv[argc] = dst = src;
    while (*src) {
      char cc = *src++;
      if (cc == '"') {
        quoted = !quoted;
        continue;
      }
      if (!quoted && isspace(cc)) {
        *dst = '\0';
        break;
      }
      *dst++ = cc;
    }
    if (quoted) {
      isns_error("%s: Unterminated quoted string: \"%s\"\n", __FUNCTION__,
                 argv[argc]);
      return -1;
    }
    argc++;
  }
  return argc;
}


x86 assembly (clang, -O0):
<isns_attr_list_split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1160 <isns_attr_list_split+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1284 <isns_attr_list_split+0x164>
jmp    1165 <isns_attr_list_split+0x45>
jmp    116a <isns_attr_list_split+0x4a>
mov    -0x28(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%eax
je     1190 <isns_attr_list_split+0x70>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    116a <isns_attr_list_split+0x4a>
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
jne    11a2 <isns_attr_list_split+0x82>
jmp    127e <isns_attr_list_split+0x15e>
mov    -0x28(%rbp),%rdx
mov    %rdx,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %rdx,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
je     123a <isns_attr_list_split+0x11a>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%al
mov    %al,-0x39(%rbp)
movsbl -0x39(%rbp),%eax
cmp    $0x22,%eax
jne    11f9 <isns_attr_list_split+0xd9>
cmpl   $0x0,-0x30(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x30(%rbp)
jmp    11b5 <isns_attr_list_split+0x95>
cmpl   $0x0,-0x30(%rbp)
jne    1221 <isns_attr_list_split+0x101>
movsbl -0x39(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%eax
je     1221 <isns_attr_list_split+0x101>
mov    -0x38(%rbp),%rax
movb   $0x0,(%rax)
jmp    123a <isns_attr_list_split+0x11a>
mov    -0x39(%rbp),%cl
mov    -0x38(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x38(%rbp)
mov    %cl,(%rax)
jmp    11b5 <isns_attr_list_split+0x95>
cmpl   $0x0,-0x30(%rbp)
je     1270 <isns_attr_list_split+0x150>
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    (%rax,%rcx,8),%rdx
lea    0xdaa(%rip),%rdi
lea    0xdc9(%rip),%rsi
mov    $0x0,%al
call   1030 <isns_error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1284 <isns_attr_list_split+0x164>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1165 <isns_attr_list_split+0x45>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isns_attr_list_split>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,0x10(%rsp)
test   %rdi,%rdi
je     120e <isns_attr_list_split+0xee>
mov    %rdi,%r12
xor    %r13d,%r13d
jmp    1157 <isns_attr_list_split+0x37>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%r12
add    $0x1,%r13d
lea    -0x1(%r12),%r14
add    $0x1,%r12
mov    %r12,%rbp
movzbl 0x1(%r14),%ebx
add    $0x1,%r14
movsbl %bl,%edi
call   1040 <isspace@plt>
add    $0x1,%r12
test   %eax,%eax
jne    1160 <isns_attr_list_split+0x40>
test   %bl,%bl
je     1237 <isns_attr_list_split+0x117>
mov    %r13d,%ebx
mov    0x10(%rsp),%rax
mov    %r14,(%rax,%rbx,8)
mov    (%r14),%r15b
test   %r15b,%r15b
je     1150 <isns_attr_list_split+0x30>
mov    %r13d,0xc(%rsp)
xor    %r13d,%r13d
jmp    11ca <isns_attr_list_split+0xaa>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
test   %r13d,%r13d
sete   %al
mov    %eax,%r13d
movzbl (%r12),%r15d
lea    0x1(%r12),%rbp
test   %r15b,%r15b
je     11f0 <isns_attr_list_split+0xd0>
mov    %rbp,%r12
cmp    $0x22,%r15b
je     11b0 <isns_attr_list_split+0x90>
test   %r13d,%r13d
jne    11e5 <isns_attr_list_split+0xc5>
movsbl %r15b,%edi
call   1040 <isspace@plt>
test   %eax,%eax
jne    1203 <isns_attr_list_split+0xe3>
mov    %r15b,(%r14)
add    $0x1,%r14
jmp    11bb <isns_attr_list_split+0x9b>
xchg   %ax,%ax
test   %r13d,%r13d
mov    0xc(%rsp),%r13d
jne    1213 <isns_attr_list_split+0xf3>
add    $0x1,%r13d
jmp    1157 <isns_attr_list_split+0x37>
movb   $0x0,(%r14)
mov    0xc(%rsp),%r13d
jmp    11fa <isns_attr_list_split+0xda>
xor    %r13d,%r13d
jmp    1237 <isns_attr_list_split+0x117>
mov    0x10(%rsp),%rax
mov    (%rax,%rbx,8),%rdx
lea    0xddd(%rip),%rdi
lea    0xdfc(%rip),%rsi
xor    %eax,%eax
call   1030 <isns_error@plt>
mov    $0xffffffff,%r13d
mov    %r13d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"%s: Unterminated quoted string: \22%s\22\0A\00"
@__FUNCTION__.isns_attr_list_split = [21 x i8] c"isns_attr_list_split\00"
define i32 @isns_attr_list_split(i8* %0, i8** %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
%13 = load i8*, i8** %5
store i8* %13, i8** %8
store i32 0, i32* %9
store i32 0, i32* %10
%14 = load i8*, i8** %5
%15 = icmp ne i8* %14, null
br i1 %15, label %17, label %16
16: ; preds = %3
store i32 0, i32* %4
br label %84
17: ; preds = %3
br label %18
18: ; preds = %17, %79
br label %19
19: ; preds = %25, %18
%20 = load i8*, i8** %8
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = call i32 @isspace(i32 %22)
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %19
%26 = load i8*, i8** %8
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %8
br label %19
28: ; preds = %19
%29 = load i8*, i8** %8
%30 = load i8, i8* %29
%31 = icmp ne i8 %30, 0
br i1 %31, label %33, label %32
32: ; preds = %28
br label %82
33: ; preds = %28
%34 = load i8*, i8** %8
store i8* %34, i8** %11
%35 = load i8**, i8*** %6
%36 = load i32, i32* %9
%37 = zext i32 %36 to i64
%38 = getelementptr inbounds i8*, i8** %35, i64 %37
store i8* %34, i8** %38
br label %39
39: ; preds = %65, %50, %33
%40 = load i8*, i8** %8
%41 = load i8, i8* %40
%42 = icmp ne i8 %41, 0
br i1 %42, label %43, label %69
43: ; preds = %39
%44 = load i8*, i8** %8
%45 = getelementptr inbounds i8, i8* %44, i32 1
store i8* %45, i8** %8
%46 = load i8, i8* %44
store i8 %46, i8* %12
%47 = load i8, i8* %12
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 34
br i1 %49, label %50, label %55
50: ; preds = %43
%51 = load i32, i32* %10
%52 = icmp ne i32 %51, 0
%53 = xor i1 %52, true
%54 = zext i1 %53 to i32
store i32 %54, i32* %10
br label %39
55: ; preds = %43
%56 = load i32, i32* %10
%57 = icmp ne i32 %56, 0
br i1 %57, label %65, label %58
58: ; preds = %55
%59 = load i8, i8* %12
%60 = sext i8 %59 to i32
%61 = call i32 @isspace(i32 %60)
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %58
%64 = load i8*, i8** %11
store i8 0, i8* %64
br label %69
65: ; preds = %58, %55
%66 = load i8, i8* %12
%67 = load i8*, i8** %11
%68 = getelementptr inbounds i8, i8* %67, i32 1
store i8* %68, i8** %11
store i8 %66, i8* %67
br label %39
69: ; preds = %63, %39
%70 = load i32, i32* %10
%71 = icmp ne i32 %70, 0
br i1 %71, label %72, label %79
72: ; preds = %69
%73 = load i8**, i8*** %6
%74 = load i32, i32* %9
%75 = zext i32 %74 to i64
%76 = getelementptr inbounds i8*, i8** %73, i64 %75
%77 = load i8*, i8** %76
%78 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @isns_error to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.isns_attr_list_split, i64 0, i64 0), i8* %77)
store i32 -1, i32* %4
br label %84
79: ; preds = %69
%80 = load i32, i32* %9
%81 = add i32 %80, 1
store i32 %81, i32* %9
br label %18
82: ; preds = %32
%83 = load i32, i32* %9
store i32 %83, i32* %4
br label %84
84: ; preds = %82, %72, %16
%85 = load i32, i32* %4
ret i32 %85
}

LLVM IR (-O2):
@.str = [38 x i8] c"%s: Unterminated quoted string: \22%s\22\0A\00"
@__FUNCTION__.isns_attr_list_split = [21 x i8] c"isns_attr_list_split\00"
define i32 @isns_attr_list_split(i8* %0, i8** nocapture %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %55, label %5
5: ; preds = %3, %52
%6 = phi i8* [ %53, %52 ], [ %0, %3 ]
%7 = phi i32 [ %54, %52 ], [ 0, %3 ]
br label %8
8: ; preds = %8, %5
%9 = phi i8* [ %6, %5 ], [ %14, %8 ]
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = tail call i32 @isspace(i32 %11)
%13 = icmp eq i32 %12, 0
%14 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %13, label %15, label %8
15: ; preds = %8
%16 = icmp eq i8 %10, 0
br i1 %16, label %55, label %17
17: ; preds = %15
%18 = zext i32 %7 to i64
%19 = getelementptr inbounds i8*, i8** %1, i64 %18
store i8* %9, i8** %19
%20 = load i8, i8* %9
%21 = icmp eq i8 %20, 0
br i1 %21, label %52, label %22
22: ; preds = %17, %40
%23 = phi i8 [ %43, %40 ], [ %20, %17 ]
%24 = phi i8* [ %42, %40 ], [ %9, %17 ]
%25 = phi i32 [ %41, %40 ], [ 0, %17 ]
%26 = phi i8* [ %27, %40 ], [ %9, %17 ]
%27 = getelementptr inbounds i8, i8* %26, i64 1
%28 = sext i8 %23 to i32
%29 = icmp eq i8 %23, 34
%30 = icmp eq i32 %25, 0
br i1 %29, label %31, label %33
31: ; preds = %22
%32 = zext i1 %30 to i32
br label %40
33: ; preds = %22
br i1 %30, label %34, label %38
34: ; preds = %33
%35 = tail call i32 @isspace(i32 %28)
%36 = icmp eq i32 %35, 0
br i1 %36, label %38, label %37
37: ; preds = %34
store i8 0, i8* %24
br label %52
38: ; preds = %34, %33
%39 = getelementptr inbounds i8, i8* %24, i64 1
store i8 %23, i8* %24
br label %40
40: ; preds = %38, %31
%41 = phi i32 [ %32, %31 ], [ %25, %38 ]
%42 = phi i8* [ %24, %31 ], [ %39, %38 ]
%43 = load i8, i8* %27
%44 = icmp eq i8 %43, 0
br i1 %44, label %45, label %22
45: ; preds = %40
%46 = icmp eq i32 %41, 0
br i1 %46, label %52, label %47
47: ; preds = %45
%48 = zext i32 %7 to i64
%49 = getelementptr inbounds i8*, i8** %1, i64 %48
%50 = load i8*, i8** %49
%51 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @isns_error to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.isns_attr_list_split, i64 0, i64 0), i8* %50)
br label %55
52: ; preds = %17, %45, %37
%53 = phi i8* [ %27, %37 ], [ %27, %45 ], [ %9, %17 ]
%54 = add i32 %7, 1
br label %5
55: ; preds = %15, %47, %3
%56 = phi i32 [ 0, %3 ], [ -1, %47 ], [ %7, %15 ]
ret i32 %56
}