#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 check_command(char const *, char const *);
scalar_t__ isspace(char);
char *strtok(char *, char *);
bool parse_line(char *l) {
  const char *command;
  const char *argument;
  for (; isspace(*l); l++)
    ;
  command = strtok(l, " \n");
  argument = strtok(NULL, " \n");
  if (!command)
    return true;
  return check_command(command, argument);
}


x86 assembly (clang, -O0):
<parse_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1168 <parse_line+0x38>
jmp    1157 <parse_line+0x27>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113c <parse_line+0xc>
mov    -0x10(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe79(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11a7 <parse_line+0x77>
movl   $0x1,-0x4(%rbp)
jmp    11b7 <parse_line+0x87>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <check_command@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_line>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1140 <parse_line+0x10>
lea    0xea7(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strtok@plt>
mov    %rax,%rbx
xor    %edi,%edi
mov    %r14,%rsi
call   1050 <strtok@plt>
test   %rbx,%rbx
je     1188 <parse_line+0x58>
mov    %rbx,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <check_command@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c" \0A\00"
define i32 @parse_line(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
br label %6
6: ; preds = %12, %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = call i64 @isspace(i8 signext %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %6
br label %12
12: ; preds = %11
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
br label %6
15: ; preds = %6
%16 = load i8*, i8** %3
%17 = call i8* @strtok(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %17, i8** %4
%18 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %18, i8** %5
%19 = load i8*, i8** %4
%20 = icmp ne i8* %19, null
br i1 %20, label %22, label %21
21: ; preds = %15
store i32 1, i32* %2
br label %26
22: ; preds = %15
%23 = load i8*, i8** %4
%24 = load i8*, i8** %5
%25 = call i32 @check_command(i8* %23, i8* %24)
store i32 %25, i32* %2
br label %26
26: ; preds = %22, %21
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
@.str = [3 x i8] c" \0A\00"
define i32 @parse_line(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = tail call i8* @strtok(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i8* %9, null
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = tail call i32 @check_command(i8* %9, i8* %10)
br label %14
14: ; preds = %8, %12
%15 = phi i32 [ %13, %12 ], [ 1, %8 ]
ret i32 %15
}