#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;
  {
    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 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
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>
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
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>
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 @strncpy(i8* %6, i8* %7, i32 500)
%9 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 499
store i8 0, i8* %9
%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)
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 @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 0
}