#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*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ isgraph(char);
int /*<<< orphan*/ stderr;
int strlen(char *);
int split_command_line(char *line, char **argv) {
  int in_quote = 0;
  int argc = 0;
  line[strlen(line) - 1] = '\0';
  while (argc < (16) && *line) {
    while (!isgraph(*line))
      ++line;
    if (*line == '\"') {
      ++line;
      in_quote = 1;
    }
    argv[argc] = line;
    ++argc;
    if (in_quote == 0) {
      while (isgraph(*line))
        ++line;
    } else {
      while (*line && *line != '\"')
        ++line;
      in_quote = 0;
    }
    if (*line == '\0')
      break;
    *line = '\0';
    ++line;
  }
  while ((*line == '\t' || *line == ' ') && *line != '\0')
    ++line;
  if (*line != '\0') {
    fprintf(stderr, "Not all arguments has been parsed. "
                    "Increase MAX_ARGS.\n");
    argc = 0;
  }
  return argc;
}


x86 assembly (clang, -O0):
<split_command_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
xor    %eax,%eax
cmpl   $0x10,-0x18(%rbp)
mov    %al,-0x21(%rbp)
jge    118e <split_command_line+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    119e <split_command_line+0x6e>
jmp    12cc <split_command_line+0x19c>
jmp    11a3 <split_command_line+0x73>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isgraph@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11c5 <split_command_line+0x95>
jmp    11d6 <split_command_line+0xa6>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    11a3 <split_command_line+0x73>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    11f9 <split_command_line+0xc9>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    124d <split_command_line+0x11d>
jmp    1221 <split_command_line+0xf1>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isgraph@plt>
cmp    $0x0,%rax
je     1248 <split_command_line+0x118>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1221 <split_command_line+0xf1>
jmp    129f <split_command_line+0x16f>
jmp    1252 <split_command_line+0x122>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x22(%rbp)
je     1277 <split_command_line+0x147>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
setne  %al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
test   $0x1,%al
jne    1287 <split_command_line+0x157>
jmp    1298 <split_command_line+0x168>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1252 <split_command_line+0x122>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    12b4 <split_command_line+0x184>
jmp    12cc <split_command_line+0x19c>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    116f <split_command_line+0x3f>
jmp    12d1 <split_command_line+0x1a1>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     12f6 <split_command_line+0x1c6>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x23(%rbp)
jne    1306 <split_command_line+0x1d6>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x23(%rbp)
mov    -0x23(%rbp),%al
test   $0x1,%al
jne    1316 <split_command_line+0x1e6>
jmp    1327 <split_command_line+0x1f7>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    12d1 <split_command_line+0x1a1>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1353 <split_command_line+0x223>
mov    0x2ca2(%rip),%rax
mov    (%rax),%edi
lea    0xcb9(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<split_command_line>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r12
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r12,1)
xor    %r14d,%r14d
xchg   %ax,%ax
mov    (%r12),%al
test   %al,%al
je     1214 <split_command_line+0xe4>
movsbl %al,%edi
call   1050 <isgraph@plt>
mov    %r12,%rbx
test   %rax,%rax
jne    1182 <split_command_line+0x52>
nopl   0x0(%rax)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1050 <isgraph@plt>
test   %rax,%rax
je     1170 <split_command_line+0x40>
mov    (%rbx),%cl
xor    %eax,%eax
cmp    $0x22,%cl
sete   %al
lea    (%rbx,%rax,1),%r12
mov    %r12,(%r15,%r14,8)
cmp    $0x22,%cl
jne    11c0 <split_command_line+0x90>
nopl   0x0(%rax)
movzbl (%r12),%eax
test   %al,%al
je     11e8 <split_command_line+0xb8>
cmp    $0x22,%al
je     11e8 <split_command_line+0xb8>
add    $0x1,%r12
jmp    11a0 <split_command_line+0x70>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rbx,%rax,1),%r12
add    $0xffffffffffffffff,%r12
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%r12),%edi
add    $0x1,%r12
call   1050 <isgraph@plt>
test   %rax,%rax
jne    11d0 <split_command_line+0xa0>
mov    (%r12),%al
add    $0x1,%r14
test   %al,%al
je     1214 <split_command_line+0xe4>
movb   $0x0,(%r12)
add    $0x1,%r12
cmp    $0x10,%r14
jne    1150 <split_command_line+0x20>
mov    $0x10,%r14d
jmp    1214 <split_command_line+0xe4>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12
movzbl (%r12),%eax
cmp    $0x9,%al
je     1210 <split_command_line+0xe0>
cmp    $0x20,%al
je     1210 <split_command_line+0xe0>
test   %al,%al
je     123d <split_command_line+0x10d>
mov    0x2db4(%rip),%rax
mov    (%rax),%edi
lea    0xdcb(%rip),%rsi
call   1040 <fprintf@plt>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"Not all arguments has been parsed. Increase MAX_ARGS.\0A\00"
define i32 @split_command_line(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8** %1, i8*** %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = load i8*, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
%10 = sub nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %7, i64 %11
store i8 0, i8* %12
br label %13
13: ; preds = %84, %2
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 16
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br label %21
21: ; preds = %16, %13
%22 = phi i1 [ false, %13 ], [ %20, %16 ]
br i1 %22, label %23, label %88
23: ; preds = %21
br label %24
24: ; preds = %30, %23
%25 = load i8*, i8** %3
%26 = load i8, i8* %25
%27 = call i64 @isgraph(i8 signext %26)
%28 = icmp ne i64 %27, 0
%29 = xor i1 %28, true
br i1 %29, label %30, label %33
30: ; preds = %24
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %3
br label %24
33: ; preds = %24
%34 = load i8*, i8** %3
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 34
br i1 %37, label %38, label %41
38: ; preds = %33
%39 = load i8*, i8** %3
%40 = getelementptr inbounds i8, i8* %39, i32 1
store i8* %40, i8** %3
store i32 1, i32* %5
br label %41
41: ; preds = %38, %33
%42 = load i8*, i8** %3
%43 = load i8**, i8*** %4
%44 = load i32, i32* %6
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8*, i8** %43, i64 %45
store i8* %42, i8** %46
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 1
store i32 %48, i32* %6
%49 = load i32, i32* %5
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %61
51: ; preds = %41
br label %52
52: ; preds = %57, %51
%53 = load i8*, i8** %3
%54 = load i8, i8* %53
%55 = call i64 @isgraph(i8 signext %54)
%56 = icmp ne i64 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %52
%58 = load i8*, i8** %3
%59 = getelementptr inbounds i8, i8* %58, i32 1
store i8* %59, i8** %3
br label %52
60: ; preds = %52
br label %78
61: ; preds = %41
br label %62
62: ; preds = %74, %61
%63 = load i8*, i8** %3
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp ne i32 %65, 0
br i1 %66, label %67, label %72
67: ; preds = %62
%68 = load i8*, i8** %3
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp ne i32 %70, 34
br label %72
72: ; preds = %67, %62
%73 = phi i1 [ false, %62 ], [ %71, %67 ]
br i1 %73, label %74, label %77
74: ; preds = %72
%75 = load i8*, i8** %3
%76 = getelementptr inbounds i8, i8* %75, i32 1
store i8* %76, i8** %3
br label %62
77: ; preds = %72
store i32 0, i32* %5
br label %78
78: ; preds = %77, %60
%79 = load i8*, i8** %3
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp eq i32 %81, 0
br i1 %82, label %83, label %84
83: ; preds = %78
br label %88
84: ; preds = %78
%85 = load i8*, i8** %3
store i8 0, i8* %85
%86 = load i8*, i8** %3
%87 = getelementptr inbounds i8, i8* %86, i32 1
store i8* %87, i8** %3
br label %13
88: ; preds = %83, %21
br label %89
89: ; preds = %106, %88
%90 = load i8*, i8** %3
%91 = load i8, i8* %90
%92 = sext i8 %91 to i32
%93 = icmp eq i32 %92, 9
br i1 %93, label %99, label %94
94: ; preds = %89
%95 = load i8*, i8** %3
%96 = load i8, i8* %95
%97 = sext i8 %96 to i32
%98 = icmp eq i32 %97, 32
br i1 %98, label %99, label %104
99: ; preds = %94, %89
%100 = load i8*, i8** %3
%101 = load i8, i8* %100
%102 = sext i8 %101 to i32
%103 = icmp ne i32 %102, 0
br label %104
104: ; preds = %99, %94
%105 = phi i1 [ false, %94 ], [ %103, %99 ]
br i1 %105, label %106, label %109
106: ; preds = %104
%107 = load i8*, i8** %3
%108 = getelementptr inbounds i8, i8* %107, i32 1
store i8* %108, i8** %3
br label %89
109: ; preds = %104
%110 = load i8*, i8** %3
%111 = load i8, i8* %110
%112 = sext i8 %111 to i32
%113 = icmp ne i32 %112, 0
br i1 %113, label %114, label %117
114: ; preds = %109
%115 = load i32, i32* @stderr
%116 = call i32 @fprintf(i32 %115, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %6
br label %117
117: ; preds = %114, %109
%118 = load i32, i32* %6
ret i32 %118
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"Not all arguments has been parsed. Increase MAX_ARGS.\0A\00"
define i32 @split_command_line(i8* %0, i8** nocapture writeonly %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
br label %7
7: ; preds = %2, %46
%8 = phi i64 [ 0, %2 ], [ %28, %46 ]
%9 = phi i8* [ %0, %2 ], [ %47, %46 ]
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %51, label %12
12: ; preds = %7
%13 = tail call i64 @isgraph(i8 signext %10)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %12, %15
%16 = phi i8* [ %17, %15 ], [ %9, %12 ]
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = tail call i64 @isgraph(i8 signext %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %15, label %21
21: ; preds = %15, %12
%22 = phi i8* [ %9, %12 ], [ %17, %15 ]
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 34
%25 = zext i1 %24 to i64
%26 = getelementptr i8, i8* %22, i64 %25
%27 = getelementptr inbounds i8*, i8** %1, i64 %8
store i8* %26, i8** %27
%28 = add nuw nsw i64 %8, 1
br i1 %24, label %35, label %29
29: ; preds = %21, %29
%30 = phi i8* [ %34, %29 ], [ %26, %21 ]
%31 = load i8, i8* %30
%32 = tail call i64 @isgraph(i8 signext %31)
%33 = icmp eq i64 %32, 0
%34 = getelementptr inbounds i8, i8* %30, i64 1
br i1 %33, label %40, label %29
35: ; preds = %21, %38
%36 = phi i8* [ %39, %38 ], [ %26, %21 ]
%37 = load i8, i8* %36
switch i8 %37, label %38 [
i8 0, label %42
i8 34, label %42
]
38: ; preds = %35
%39 = getelementptr inbounds i8, i8* %36, i64 1
br label %35
40: ; preds = %29
%41 = load i8, i8* %30
br label %42
42: ; preds = %35, %35, %40
%43 = phi i8 [ %41, %40 ], [ %37, %35 ], [ %37, %35 ]
%44 = phi i8* [ %30, %40 ], [ %36, %35 ], [ %36, %35 ]
%45 = icmp eq i8 %43, 0
br i1 %45, label %49, label %46
46: ; preds = %42
store i8 0, i8* %44
%47 = getelementptr inbounds i8, i8* %44, i64 1
%48 = icmp eq i64 %28, 16
br i1 %48, label %53, label %7
49: ; preds = %42
%50 = trunc i64 %28 to i32
br label %53
51: ; preds = %7
%52 = trunc i64 %8 to i32
br label %53
53: ; preds = %46, %51, %49
%54 = phi i8* [ %44, %49 ], [ %9, %51 ], [ %47, %46 ]
%55 = phi i32 [ %50, %49 ], [ %52, %51 ], [ 16, %46 ]
br label %56
56: ; preds = %59, %53
%57 = phi i8* [ %54, %53 ], [ %60, %59 ]
%58 = load i8, i8* %57
switch i8 %58, label %61 [
i8 9, label %59
i8 32, label %59
i8 0, label %64
]
59: ; preds = %56, %56
%60 = getelementptr inbounds i8, i8* %57, i64 1
br label %56
61: ; preds = %56
%62 = load i32, i32* @stderr
%63 = tail call i32 @fprintf(i32 %62, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
br label %64
64: ; preds = %56, %61
%65 = phi i32 [ 0, %61 ], [ %55, %56 ]
ret i32 %65
}