#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 */
scalar_t__ strchr(char *, char);
char *strtok(char *, char *);
void parse_line(char *l, char **label, char **instr, char **arg) {
  char *t;
  *label = *instr = *arg = "";
  if (strchr(l, ':')) {
    if ((t = strtok(l, ":")) != NULL) {
      *label = t;
    }
    if ((t = strtok(NULL, " \t")) != NULL) {
      *instr = t;
    }
  } else {
    if ((t = strtok(l, " ")) != NULL) {
      *label = "";
      *instr = t;
    }
  }
  if ((t = strtok(NULL, " \t")) != NULL) {
    *arg = t;
  }
}


x86 assembly (clang, -O0):
<parse_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
lea    0xec1(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
lea    0xeb3(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
lea    0xea5(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     11d1 <parse_line+0xb1>
mov    -0x8(%rbp),%rdi
lea    0xe7b(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     11a3 <parse_line+0x83>
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe54(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     11cc <parse_line+0xac>
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    120d <parse_line+0xed>
mov    -0x8(%rbp),%rdi
lea    0xe29(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     1208 <parse_line+0xe8>
mov    -0x10(%rbp),%rax
lea    0xe0a(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    120d <parse_line+0xed>
xor    %eax,%eax
mov    %eax,%edi
lea    0xdea(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     1236 <parse_line+0x116>
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_line>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
lea    0xec8(%rip),%r13
mov    %r13,(%rcx)
mov    %r13,(%rdx)
mov    %r13,(%rsi)
mov    $0x3a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1181 <parse_line+0x61>
lea    0xea5(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strtok@plt>
test   %rax,%rax
je     116c <parse_line+0x4c>
mov    %rax,(%r12)
lea    0xe8f(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
test   %rax,%rax
jne    1199 <parse_line+0x79>
jmp    119c <parse_line+0x7c>
lea    0xe7d(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strtok@plt>
test   %rax,%rax
je     119c <parse_line+0x7c>
mov    %r13,(%r12)
mov    %rax,(%r15)
lea    0xe5f(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
test   %rax,%rax
je     11b2 <parse_line+0x92>
mov    %rax,(%r14)
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c":\00"
@.str.2 = [3 x i8] c" \09\00"
@.str.3 = [2 x i8] c" \00"
define void @parse_line(i8* %0, i8** nocapture writeonly %1, i8** nocapture writeonly %2, i8** nocapture writeonly %3) {
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %1
%5 = tail call i64 @strchr(i8* %0, i8 signext 58)
%6 = icmp eq i64 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %4
%8 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %7
store i8* %8, i8** %1
br label %11
11: ; preds = %10, %7
%12 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i8* %12, null
br i1 %13, label %20, label %18
14: ; preds = %4
%15 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%16 = icmp eq i8* %15, null
br i1 %16, label %20, label %17
17: ; preds = %14
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %1
br label %18
18: ; preds = %11, %17
%19 = phi i8* [ %15, %17 ], [ %12, %11 ]
store i8* %19, i8** %2
br label %20
20: ; preds = %18, %14, %11
%21 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i8* %21, null
br i1 %22, label %24, label %23
23: ; preds = %20
store i8* %21, i8** %3
br label %24
24: ; preds = %23, %20
ret void
}