#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;
  int i = 0;
  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 i;
}


x86 assembly (clang, -O0):
<add_command_list_brcommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x214(%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     11ff <add_command_list_brcommand+0xcf>
mov    -0x208(%rbp),%rax
lea    -0x200(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
jbe    11e0 <add_command_list_brcommand+0xb0>
mov    -0x208(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x20,%eax
je     11d0 <add_command_list_brcommand+0xa0>
mov    -0x208(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x9,%eax
jne    11db <add_command_list_brcommand+0xab>
mov    -0x208(%rbp),%rax
movb   $0x0,-0x1(%rax)
jmp    11e0 <add_command_list_brcommand+0xb0>
mov    -0x210(%rbp),%rdi
call   1040 <add_command_list_brcommand_sub@plt>
mov    -0x208(%rbp),%rax
mov    %rax,-0x210(%rbp)
jmp    1167 <add_command_list_brcommand+0x37>
mov    -0x210(%rbp),%rdi
call   1040 <add_command_list_brcommand_sub@plt>
mov    -0x214(%rbp),%eax
add    $0x220,%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*
%6 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %6
%7 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
%8 = load i8*, i8** %2
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
store i8* %10, i8** %5
br label %11
11: ; preds = %37, %1
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = call i8* @strchr(i8* %13, i8 signext 45)
store i8* %14, i8** %4
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %41
16: ; preds = %11
%17 = load i8*, i8** %4
%18 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = icmp ugt i8* %17, %19
br i1 %20, label %21, label %37
21: ; preds = %16
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 -1
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 32
br i1 %26, label %33, label %27
27: ; preds = %21
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i64 -1
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 9
br i1 %32, label %33, label %36
33: ; preds = %27, %21
%34 = load i8*, i8** %4
%35 = getelementptr inbounds i8, i8* %34, i64 -1
store i8 0, i8* %35
br label %36
36: ; preds = %33, %27
br label %37
37: ; preds = %36, %16
%38 = load i8*, i8** %5
%39 = call i32 @add_command_list_brcommand_sub(i8* %38)
%40 = load i8*, i8** %4
store i8* %40, i8** %5
br label %11
41: ; preds = %11
%42 = load i8*, i8** %5
%43 = call i32 @add_command_list_brcommand_sub(i8* %42)
%44 = load i32, i32* %6
ret i32 %44
}

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
}