#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*/ dorefname(char *);
int /*<<< orphan*/ printf(char *, char const *, ...);
int /*<<< orphan*/ putchar(char);
char *strchr(char *, char);
void split(char *line, char *name) {
  char *cp, *dp;
  char *sp;
  const char *sep;
  cp = strchr(line, '-');
  if (cp == 0)
    return;
  sp = cp + 1;
  for (--cp; *cp == ' ' || *cp == '\t' || *cp == '\\'; cp--)
    ;
  *++cp = '\0';
  while (*sp && (*sp == ' ' || *sp == '\t'))
    sp++;
  for (sep = "", dp = line; dp && *dp; dp = cp, sep = "\n") {
    cp = strchr(dp, ',');
    if (cp) {
      char *tp;
      for (tp = cp - 1; *tp == ' ' || *tp == '\t'; tp--)
        ;
      *++tp = '\0';
      for (++cp; *cp == ' ' || *cp == '\t'; cp++)
        ;
    }
    (void)printf("%s%s\t", sep, dp);
    dorefname(name);
    (void)printf("\t- %s", sp);
  }
  (void)putchar('\n');
}


x86 assembly (clang, -O0):
<split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2d,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <split+0x32>
jmp    13d7 <split+0x297>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x39(%rbp)
je     11c4 <split+0x84>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x39(%rbp)
je     11c4 <split+0x84>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
sete   %al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%al
test   $0x1,%al
jne    11d4 <split+0x94>
jmp    11ea <split+0xaa>
jmp    11d9 <split+0x99>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    118a <split+0x4a>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,0x1(%rax)
mov    -0x28(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x3a(%rbp)
je     123d <split+0xfd>
mov    -0x28(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x3b(%rbp)
je     1237 <split+0xf7>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x3b(%rbp)
mov    -0x3b(%rbp),%al
mov    %al,-0x3a(%rbp)
mov    -0x3a(%rbp),%al
test   $0x1,%al
jne    124d <split+0x10d>
jmp    125e <split+0x11e>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11fd <split+0xbd>
lea    0xda0(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x3c(%rbp)
je     1291 <split+0x151>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x3c(%rbp)
mov    -0x3c(%rbp),%al
test   $0x1,%al
jne    12a1 <split+0x161>
jmp    13cd <split+0x28d>
mov    -0x20(%rbp),%rdi
mov    $0x2c,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1384 <split+0x244>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x3d(%rbp)
je     12ef <split+0x1af>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x3d(%rbp)
mov    -0x3d(%rbp),%al
test   $0x1,%al
jne    12ff <split+0x1bf>
jmp    1315 <split+0x1d5>
jmp    1304 <split+0x1c4>
mov    -0x38(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x38(%rbp)
jmp    12ca <split+0x18a>
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movb   $0x0,0x1(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x3e(%rbp)
je     1359 <split+0x219>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x3e(%rbp)
mov    -0x3e(%rbp),%al
test   $0x1,%al
jne    1369 <split+0x229>
jmp    137f <split+0x23f>
jmp    136e <split+0x22e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1334 <split+0x1f4>
jmp    1384 <split+0x244>
mov    -0x30(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xc6d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <dorefname@plt>
mov    -0x28(%rbp),%rsi
lea    0xc58(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xc48(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    1271 <split+0x131>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<split>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
mov    $0x2d,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     126d <split+0x12d>
mov    %rax,%rbx
mov    %rax,%rcx
nopw   0x0(%rax,%rax,1)
mov    %rcx,%rax
add    $0xffffffffffffffff,%rcx
movzbl -0x1(%rax),%edx
cmp    $0x9,%dl
je     1170 <split+0x30>
cmp    $0x20,%dl
je     1170 <split+0x30>
cmp    $0x5c,%dl
je     1170 <split+0x30>
movb   $0x0,(%rax)
nopl   (%rax)
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x20,%al
je     1190 <split+0x50>
cmp    $0x9,%al
je     1190 <split+0x50>
test   %r12,%r12
je     1255 <split+0x115>
lea    0xe56(%rip),%rbp
lea    0xe56(%rip),%r13
jmp    11fb <split+0xbb>
nopl   0x0(%rax,%rax,1)
xor    %r15d,%r15d
lea    0xe36(%rip),%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
call   1060 <dorefname@plt>
lea    0xe20(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rbp
mov    %r15,%r12
test   %r15,%r15
je     1255 <split+0x115>
cmpb   $0x0,(%r12)
je     1255 <split+0x115>
mov    %r12,%rdi
mov    $0x2c,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     11c0 <split+0x80>
mov    %rax,%r15
mov    %rax,%rcx
nopw   0x0(%rax,%rax,1)
mov    %rcx,%rax
add    $0xffffffffffffffff,%rcx
movzbl -0x1(%rax),%edx
cmp    $0x9,%dl
je     1220 <split+0xe0>
cmp    $0x20,%dl
je     1220 <split+0xe0>
movb   $0x0,(%rax)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15
movzbl (%r15),%eax
cmp    $0x20,%al
je     1240 <split+0x100>
cmp    $0x9,%al
je     1240 <split+0x100>
jmp    11c3 <split+0x83>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [6 x i8] c"%s%s\09\00"
@.str.2 = [6 x i8] c"\09- %s\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @split(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%10 = load i8*, i8** %3
%11 = call i8* @strchr(i8* %10, i8 signext 45)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %15
14: ; preds = %2
br label %136
15: ; preds = %2
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8* %17, i8** %7
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i32 -1
store i8* %19, i8** %5
br label %20
20: ; preds = %38, %15
%21 = load i8*, i8** %5
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 32
br i1 %24, label %35, label %25
25: ; preds = %20
%26 = load i8*, i8** %5
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 9
br i1 %29, label %35, label %30
30: ; preds = %25
%31 = load i8*, i8** %5
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 92
br label %35
35: ; preds = %30, %25, %20
%36 = phi i1 [ true, %25 ], [ true, %20 ], [ %34, %30 ]
br i1 %36, label %37, label %41
37: ; preds = %35
br label %38
38: ; preds = %37
%39 = load i8*, i8** %5
%40 = getelementptr inbounds i8, i8* %39, i32 -1
store i8* %40, i8** %5
br label %20
41: ; preds = %35
%42 = load i8*, i8** %5
%43 = getelementptr inbounds i8, i8* %42, i32 1
store i8* %43, i8** %5
store i8 0, i8* %43
br label %44
44: ; preds = %63, %41
%45 = load i8*, i8** %7
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %61
49: ; preds = %44
%50 = load i8*, i8** %7
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 32
br i1 %53, label %59, label %54
54: ; preds = %49
%55 = load i8*, i8** %7
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp eq i32 %57, 9
br label %59
59: ; preds = %54, %49
%60 = phi i1 [ true, %49 ], [ %58, %54 ]
br label %61
61: ; preds = %59, %44
%62 = phi i1 [ false, %44 ], [ %60, %59 ]
br i1 %62, label %63, label %66
63: ; preds = %61
%64 = load i8*, i8** %7
%65 = getelementptr inbounds i8, i8* %64, i32 1
store i8* %65, i8** %7
br label %44
66: ; preds = %61
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %8
%67 = load i8*, i8** %3
store i8* %67, i8** %6
br label %68
68: ; preds = %132, %66
%69 = load i8*, i8** %6
%70 = icmp ne i8* %69, null
br i1 %70, label %71, label %76
71: ; preds = %68
%72 = load i8*, i8** %6
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp ne i32 %74, 0
br label %76
76: ; preds = %71, %68
%77 = phi i1 [ false, %68 ], [ %75, %71 ]
br i1 %77, label %78, label %134
78: ; preds = %76
%79 = load i8*, i8** %6
%80 = call i8* @strchr(i8* %79, i8 signext 44)
store i8* %80, i8** %5
%81 = load i8*, i8** %5
%82 = icmp ne i8* %81, null
br i1 %82, label %83, label %124
83: ; preds = %78
%84 = load i8*, i8** %5
%85 = getelementptr inbounds i8, i8* %84, i64 -1
store i8* %85, i8** %9
br label %86
86: ; preds = %99, %83
%87 = load i8*, i8** %9
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = icmp eq i32 %89, 32
br i1 %90, label %96, label %91
91: ; preds = %86
%92 = load i8*, i8** %9
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = icmp eq i32 %94, 9
br label %96
96: ; preds = %91, %86
%97 = phi i1 [ true, %86 ], [ %95, %91 ]
br i1 %97, label %98, label %102
98: ; preds = %96
br label %99
99: ; preds = %98
%100 = load i8*, i8** %9
%101 = getelementptr inbounds i8, i8* %100, i32 -1
store i8* %101, i8** %9
br label %86
102: ; preds = %96
%103 = load i8*, i8** %9
%104 = getelementptr inbounds i8, i8* %103, i32 1
store i8* %104, i8** %9
store i8 0, i8* %104
%105 = load i8*, i8** %5
%106 = getelementptr inbounds i8, i8* %105, i32 1
store i8* %106, i8** %5
br label %107
107: ; preds = %120, %102
%108 = load i8*, i8** %5
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = icmp eq i32 %110, 32
br i1 %111, label %117, label %112
112: ; preds = %107
%113 = load i8*, i8** %5
%114 = load i8, i8* %113
%115 = sext i8 %114 to i32
%116 = icmp eq i32 %115, 9
br label %117
117: ; preds = %112, %107
%118 = phi i1 [ true, %107 ], [ %116, %112 ]
br i1 %118, label %119, label %123
119: ; preds = %117
br label %120
120: ; preds = %119
%121 = load i8*, i8** %5
%122 = getelementptr inbounds i8, i8* %121, i32 1
store i8* %122, i8** %5
br label %107
123: ; preds = %117
br label %124
124: ; preds = %123, %78
%125 = load i8*, i8** %8
%126 = load i8*, i8** %6
%127 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %125, i8* %126)
%128 = load i8*, i8** %4
%129 = call i32 @dorefname(i8* %128)
%130 = load i8*, i8** %7
%131 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %130)
br label %132
132: ; preds = %124
%133 = load i8*, i8** %5
store i8* %133, i8** %6
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %8
br label %68
134: ; preds = %76
%135 = call i32 @putchar(i8 signext 10)
br label %136
136: ; preds = %134, %14
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [6 x i8] c"%s%s\09\00"
@.str.2 = [6 x i8] c"\09- %s\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @split(i8* %0, i8* %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 45)
%4 = icmp eq i8* %3, null
br i1 %4, label %45, label %5
5: ; preds = %2, %9
%6 = phi i8* [ %7, %9 ], [ %3, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 -1
%8 = load i8, i8* %7
switch i8 %8, label %10 [
i8 32, label %9
i8 9, label %9
i8 92, label %9
]
9: ; preds = %5, %5, %5
br label %5
10: ; preds = %5
store i8 0, i8* %6
br label %11
11: ; preds = %15, %10
%12 = phi i8* [ %3, %10 ], [ %13, %15 ]
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
switch i8 %14, label %16 [
i8 9, label %15
i8 32, label %15
]
15: ; preds = %11, %11
br label %11
16: ; preds = %11
%17 = icmp eq i8* %0, null
br i1 %17, label %43, label %18
18: ; preds = %16, %37
%19 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %37 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %16 ]
%20 = phi i8* [ %38, %37 ], [ %0, %16 ]
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 0
br i1 %22, label %43, label %23
23: ; preds = %18
%24 = tail call i8* @strchr(i8* %20, i8 signext 44)
%25 = icmp eq i8* %24, null
br i1 %25, label %37, label %26
26: ; preds = %23, %30
%27 = phi i8* [ %28, %30 ], [ %24, %23 ]
%28 = getelementptr inbounds i8, i8* %27, i64 -1
%29 = load i8, i8* %28
switch i8 %29, label %31 [
i8 32, label %30
i8 9, label %30
]
30: ; preds = %26, %26
br label %26
31: ; preds = %26
store i8 0, i8* %27
br label %32
32: ; preds = %36, %31
%33 = phi i8* [ %24, %31 ], [ %34, %36 ]
%34 = getelementptr inbounds i8, i8* %33, i64 1
%35 = load i8, i8* %34
switch i8 %35, label %37 [
i8 32, label %36
i8 9, label %36
]
36: ; preds = %32, %32
br label %32
37: ; preds = %32, %23
%38 = phi i8* [ null, %23 ], [ %34, %32 ]
%39 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %19, i8* %20)
%40 = tail call i32 @dorefname(i8* %1)
%41 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%42 = icmp eq i8* %38, null
br i1 %42, label %43, label %18
43: ; preds = %18, %37, %16
%44 = tail call i32 @putchar(i8 signext 10)
br label %45
45: ; preds = %2, %43
ret void
}