#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*/ multi_brcommands;

/* Variables and functions */
int /*<<< orphan*/ add_command_list_brcommand_sub(char *);
char *strchr(char *, char);
int /*<<< orphan*/ strncpy(char *, char *, int);
int add_command_list_brcommand(char *command) {
  char multi_brcommands[500];
  char *p, *start;
  int i;
  {
    strncpy(multi_brcommands, command, sizeof(multi_brcommands));
    multi_brcommands[sizeof(multi_brcommands) - 1] = 0;
  };
  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)
lea    -0x200(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x1f4,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0xd(%rbp)
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     11fe <add_command_list_brcommand+0xce>
mov    -0x208(%rbp),%rax
lea    -0x200(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
jbe    11df <add_command_list_brcommand+0xaf>
mov    -0x208(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x20,%eax
je     11cf <add_command_list_brcommand+0x9f>
mov    -0x208(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x9,%eax
jne    11da <add_command_list_brcommand+0xaa>
mov    -0x208(%rbp),%rax
movb   $0x0,-0x1(%rax)
jmp    11df <add_command_list_brcommand+0xaf>
mov    -0x210(%rbp),%rdi
call   1040 <add_command_list_brcommand_sub@plt>
mov    -0x208(%rbp),%rax
mov    %rax,-0x210(%rbp)
jmp    1166 <add_command_list_brcommand+0x36>
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
mov    $0x1f4,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x1f3(%rsp)
lea    0x1(%rsp),%r14
mov    %r14,%rdi
mov    $0x2d,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     11b5 <add_command_list_brcommand+0x85>
mov    %rsp,%rbx
jmp    119c <add_command_list_brcommand+0x6c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
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     11b5 <add_command_list_brcommand+0x85>
mov    %rbx,%rdi
mov    %rax,%rbx
cmp    %r14,%rax
jbe    1184 <add_command_list_brcommand+0x54>
movzbl -0x1(%rbx),%eax
cmp    $0x20,%al
je     1180 <add_command_list_brcommand+0x50>
cmp    $0x9,%al
je     1180 <add_command_list_brcommand+0x50>
jmp    1184 <add_command_list_brcommand+0x54>
mov    %rbx,%rdi
call   1040 <add_command_list_brcommand_sub@plt>
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
%7 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
%8 = load i8*, i8** %2
%9 = call i32 @strncpy(i8* %7, i8* %8, i32 500)
%10 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 499
store i8 0, i8* %10
%11 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
store i8* %11, i8** %5
br label %12
12: ; preds = %38, %1
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = call i8* @strchr(i8* %14, i8 signext 45)
store i8* %15, i8** %4
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %42
17: ; preds = %12
%18 = load i8*, i8** %4
%19 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
%20 = getelementptr inbounds i8, i8* %19, i64 1
%21 = icmp ugt i8* %18, %20
br i1 %21, label %22, label %38
22: ; preds = %17
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 -1
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 32
br i1 %27, label %34, label %28
28: ; preds = %22
%29 = load i8*, i8** %4
%30 = getelementptr inbounds i8, i8* %29, i64 -1
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 9
br i1 %33, label %34, label %37
34: ; preds = %28, %22
%35 = load i8*, i8** %4
%36 = getelementptr inbounds i8, i8* %35, i64 -1
store i8 0, i8* %36
br label %37
37: ; preds = %34, %28
br label %38
38: ; preds = %37, %17
%39 = load i8*, i8** %5
%40 = call i32 @add_command_list_brcommand_sub(i8* %39)
%41 = load i8*, i8** %4
store i8* %41, i8** %5
br label %12
42: ; preds = %12
%43 = load i8*, i8** %5
%44 = call i32 @add_command_list_brcommand_sub(i8* %43)
%45 = load i32, i32* %6
ret i32 %45
}

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 @strncpy(i8* %3, i8* %0, i32 500)
%5 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 499
store i8 0, i8* %5
%6 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 1
%7 = call i8* @strchr(i8* %6, i8 signext 45)
%8 = icmp eq i8* %7, null
br i1 %8, label %22, label %9
9: ; preds = %1, %17
%10 = phi i8* [ %20, %17 ], [ %7, %1 ]
%11 = phi i8* [ %10, %17 ], [ %3, %1 ]
%12 = icmp ugt i8* %10, %6
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = getelementptr inbounds i8, i8* %10, i64 -1
%15 = load i8, i8* %14
switch i8 %15, label %17 [
i8 32, label %16
i8 9, label %16
]
16: ; preds = %13, %13
store i8 0, i8* %14
br label %17
17: ; preds = %13, %16, %9
%18 = call i32 @add_command_list_brcommand_sub(i8* %11)
%19 = getelementptr inbounds i8, i8* %10, i64 1
%20 = call i8* @strchr(i8* %19, i8 signext 45)
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %9
22: ; preds = %17, %1
%23 = phi i8* [ %3, %1 ], [ %10, %17 ]
%24 = call i32 @add_command_list_brcommand_sub(i8* %23)
ret i32 undef
}