#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*/ add_command_list_brcommand_sub(char *);
char *strchr(char *, char);
int /*<<< orphan*/ strcpy(char *, char *);
int add_command_list_brcommand(char *command) {
  char multi_brcommands[500];
  char *p, *start;
  strcpy(multi_brcommands, command);
  start = multi_brcommands;
  while ((p = strchr(start + 1, '-'))) {
    if (p > multi_brcommands + 1) {
      if (*(p - 1) == ' ' || *(p - 1) == '\t') {
        *(p - 1) = 0;
      }
    }
    add_command_list_brcommand_sub(start);
    start = p;
  }
  add_command_list_brcommand_sub(start);
  return 0;
}


x86 assembly (clang, -O0):
<add_command_list_brcommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x200(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x200(%rbp),%rax
mov    %rax,-0x210(%rbp)
mov    -0x210(%rbp),%rdi
add    $0x1,%rdi
mov    $0x2d,%esi
call   1050 <strchr@plt>
mov    %rax,-0x208(%rbp)
cmp    $0x0,%rax
je     11f5 <add_command_list_brcommand+0xc5>
mov    -0x208(%rbp),%rax
lea    -0x200(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
jbe    11d6 <add_command_list_brcommand+0xa6>
mov    -0x208(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x20,%eax
je     11c6 <add_command_list_brcommand+0x96>
mov    -0x208(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x9,%eax
jne    11d1 <add_command_list_brcommand+0xa1>
mov    -0x208(%rbp),%rax
movb   $0x0,-0x1(%rax)
jmp    11d6 <add_command_list_brcommand+0xa6>
mov    -0x210(%rbp),%rdi
call   1040 <add_command_list_brcommand_sub@plt>
mov    -0x208(%rbp),%rax
mov    %rax,-0x210(%rbp)
jmp    115d <add_command_list_brcommand+0x2d>
mov    -0x210(%rbp),%rdi
call   1040 <add_command_list_brcommand_sub@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_command_list_brcommand>:
push   %r14
push   %rbx
sub    $0x1f8,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0x1(%rsp),%r14
mov    %r14,%rdi
mov    $0x2d,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     11a5 <add_command_list_brcommand+0x75>
mov    %rsp,%rbx
jmp    118c <add_command_list_brcommand+0x5c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movb   $0x0,-0x1(%rbx)
call   1040 <add_command_list_brcommand_sub@plt>
lea    0x1(%rbx),%rdi
mov    $0x2d,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     11a5 <add_command_list_brcommand+0x75>
mov    %rbx,%rdi
mov    %rax,%rbx
cmp    %r14,%rax
jbe    1174 <add_command_list_brcommand+0x44>
movzbl -0x1(%rbx),%eax
cmp    $0x20,%al
je     1170 <add_command_list_brcommand+0x40>
cmp    $0x9,%al
je     1170 <add_command_list_brcommand+0x40>
jmp    1174 <add_command_list_brcommand+0x44>
mov    %rbx,%rdi
call   1040 <add_command_list_brcommand_sub@plt>
xor    %eax,%eax
add    $0x1f8,%rsp
pop    %rbx
pop    %r14
ret

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

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