#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 */
typedef int /*<<< orphan*/ option;

/* Variables and functions */
int add_command_list(char *, char *);
char *strchr(char *, char);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int add_command_list_brcommand_sub(char *command) {
  char option[100], *p1, *p2;
  char value[100];
  strncpy(option, command, sizeof(option) - 1);
  option[sizeof(option)] = 0;
  p1 = strchr(option, ' ');
  p2 = strchr(option, '\t');
  if (p1 > p2 && p2 != NULL)
    p1 = p2;
  if (p1 == NULL) {
    return 0;
  }
  *p1 = 0;
  p1++;
  while (*p1 == ' ' || *p1 == '\t')
    p1++;
  strcpy(value, p1);
  return add_command_list(option, value);
}


x86 assembly (clang, -O0):
<add_command_list_brcommand_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x63,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x1c(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x20,%esi
call   1060 <strchr@plt>
mov    %rax,-0x88(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x9,%esi
call   1060 <strchr@plt>
mov    %rax,-0x90(%rbp)
mov    -0x88(%rbp),%rax
cmp    -0x90(%rbp),%rax
jbe    11bf <add_command_list_brcommand_sub+0x7f>
cmpq   $0x0,-0x90(%rbp)
je     11bf <add_command_list_brcommand_sub+0x7f>
mov    -0x90(%rbp),%rax
mov    %rax,-0x88(%rbp)
cmpq   $0x0,-0x88(%rbp)
jne    11d9 <add_command_list_brcommand_sub+0x99>
movl   $0x0,-0x4(%rbp)
jmp    1276 <add_command_list_brcommand_sub+0x136>
mov    -0x88(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x88(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x101(%rbp)
je     1226 <add_command_list_brcommand_sub+0xe6>
mov    -0x88(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x101(%rbp)
mov    -0x101(%rbp),%al
test   $0x1,%al
jne    1239 <add_command_list_brcommand_sub+0xf9>
jmp    1250 <add_command_list_brcommand_sub+0x110>
mov    -0x88(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
jmp    11f5 <add_command_list_brcommand_sub+0xb5>
lea    -0x100(%rbp),%rdi
mov    -0x88(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x80(%rbp),%rdi
lea    -0x100(%rbp),%rsi
call   1050 <add_command_list@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_command_list_brcommand_sub>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
mov    %rdi,%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x63,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x64(%rsp)
mov    %r14,%rdi
mov    $0x20,%esi
call   1060 <strchr@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x9,%esi
call   1060 <strchr@plt>
test   %rax,%rax
mov    %rbx,%rsi
cmovne %rax,%rsi
cmp    %rax,%rbx
cmovbe %rbx,%rsi
test   %rsi,%rsi
je     11c9 <add_command_list_brcommand_sub+0x89>
movb   $0x0,(%rsi)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rsi
movzbl (%rsi),%eax
cmp    $0x20,%al
je     11a0 <add_command_list_brcommand_sub+0x60>
cmp    $0x9,%al
je     11a0 <add_command_list_brcommand_sub+0x60>
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1050 <add_command_list@plt>
jmp    11cb <add_command_list_brcommand_sub+0x8b>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @add_command_list_brcommand_sub(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [100 x i8]
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [100 x i8]
store i8* %0, i8** %3
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = load i8*, i8** %3
%10 = call i32 @strncpy(i8* %8, i8* %9, i32 99)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 100
store i8 0, i8* %11
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%13 = call i8* @strchr(i8* %12, i8 signext 32)
store i8* %13, i8** %5
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%15 = call i8* @strchr(i8* %14, i8 signext 9)
store i8* %15, i8** %6
%16 = load i8*, i8** %5
%17 = load i8*, i8** %6
%18 = icmp ugt i8* %16, %17
br i1 %18, label %19, label %24
19: ; preds = %1
%20 = load i8*, i8** %6
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = load i8*, i8** %6
store i8* %23, i8** %5
br label %24
24: ; preds = %22, %19, %1
%25 = load i8*, i8** %5
%26 = icmp eq i8* %25, null
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 0, i32* %2
br label %54
28: ; preds = %24
%29 = load i8*, i8** %5
store i8 0, i8* %29
%30 = load i8*, i8** %5
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %5
br label %32
32: ; preds = %44, %28
%33 = load i8*, i8** %5
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 32
br i1 %36, label %42, label %37
37: ; preds = %32
%38 = load i8*, i8** %5
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 9
br label %42
42: ; preds = %37, %32
%43 = phi i1 [ true, %32 ], [ %41, %37 ]
br i1 %43, label %44, label %47
44: ; preds = %42
%45 = load i8*, i8** %5
%46 = getelementptr inbounds i8, i8* %45, i32 1
store i8* %46, i8** %5
br label %32
47: ; preds = %42
%48 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%49 = load i8*, i8** %5
%50 = call i32 @strcpy(i8* %48, i8* %49)
%51 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%52 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%53 = call i32 @add_command_list(i8* %51, i8* %52)
store i32 %53, i32* %2
br label %54
54: ; preds = %47, %27
%55 = load i32, i32* %2
ret i32 %55
}

LLVM IR (-O2):
define i32 @add_command_list_brcommand_sub(i8* %0) {
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = call i32 @strncpy(i8* %4, i8* %0, i32 99)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 100
store i8 0, i8* %7
%8 = call i8* @strchr(i8* %4, i8 signext 32)
%9 = call i8* @strchr(i8* %4, i8 signext 9)
%10 = icmp ugt i8* %8, %9
%11 = icmp ne i8* %9, null
%12 = and i1 %10, %11
%13 = select i1 %12, i8* %9, i8* %8
%14 = icmp eq i8* %13, null
br i1 %14, label %24, label %15
15: ; preds = %1
store i8 0, i8* %13
br label %16
16: ; preds = %20, %15
%17 = phi i8* [ %13, %15 ], [ %18, %20 ]
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
switch i8 %19, label %21 [
i8 32, label %20
i8 9, label %20
]
20: ; preds = %16, %16
br label %16
21: ; preds = %16
%22 = call i32 @strcpy(i8* %5, i8* %18)
%23 = call i32 @add_command_list(i8* %4, i8* %5)
br label %24
24: ; preds = %1, %21
%25 = phi i32 [ %23, %21 ], [ 0, %1 ]
ret i32 %25
}