#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 */
char *pass_space_label(char *);
int str32_strindex(char *, char *);
long str32_strlen(char *);
int /*<<< orphan*/ text_sender(char *);
int /*<<< orphan*/ text_sender_length(char *, unsigned long);
unsigned char command_print(char *target_str) {
  char *temp_str = pass_space_label(target_str);
  unsigned long int temp_str_index;
  while (str32_strlen(temp_str)) {
    if (str32_strindex(temp_str, "\\n\0") != -1) {
      temp_str_index = str32_strindex(temp_str, "\\n\0");
      text_sender_length(temp_str, temp_str_index);
      text_sender("\r\n\0");
      temp_str += temp_str_index;
      temp_str += 2;
    } else if (str32_strindex(temp_str, "\\s\0") != -1) {
      temp_str_index = str32_strindex(temp_str, "\\s\0");
      text_sender_length(temp_str, temp_str_index);
      text_sender(" \0");
      temp_str += temp_str_index;
      temp_str += 2;
    } else if (str32_strindex(temp_str, "\\e\0") != -1) {
      temp_str_index = str32_strindex(temp_str, "\\e\0");
      text_sender_length(temp_str, temp_str_index);
      text_sender("\x1B\0");
      temp_str += temp_str_index;
      temp_str += 2;
    } else {
      temp_str_index = str32_strlen(temp_str);
      text_sender_length(temp_str, temp_str_index);
      temp_str += temp_str_index;
    }
  }
  return ((unsigned char)1);
}


x86 assembly (clang, -O0):
<command_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <pass_space_label@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <str32_strlen@plt>
cmp    $0x0,%rax
je     12e0 <command_print+0x190>
mov    -0x10(%rbp),%rdi
lea    0xe79(%rip),%rsi
call   1040 <str32_strindex@plt>
cmp    $0xffffffff,%eax
je     11e1 <command_print+0x91>
mov    -0x10(%rbp),%rdi
lea    0xe60(%rip),%rsi
call   1040 <str32_strindex@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <text_sender_length@plt>
lea    0xe45(%rip),%rdi
call   1070 <text_sender@plt>
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    12db <command_print+0x18b>
mov    -0x10(%rbp),%rdi
lea    0xe1c(%rip),%rsi
call   1040 <str32_strindex@plt>
cmp    $0xffffffff,%eax
je     1246 <command_print+0xf6>
mov    -0x10(%rbp),%rdi
lea    0xe03(%rip),%rsi
call   1040 <str32_strindex@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <text_sender_length@plt>
lea    0xdec(%rip),%rdi
call   1070 <text_sender@plt>
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    12d6 <command_print+0x186>
mov    -0x10(%rbp),%rdi
lea    0xdbb(%rip),%rsi
call   1040 <str32_strindex@plt>
cmp    $0xffffffff,%eax
je     12ab <command_print+0x15b>
mov    -0x10(%rbp),%rdi
lea    0xda2(%rip),%rsi
call   1040 <str32_strindex@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <text_sender_length@plt>
lea    0xd8a(%rip),%rdi
call   1070 <text_sender@plt>
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    12d1 <command_print+0x181>
mov    -0x10(%rbp),%rdi
call   1050 <str32_strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <text_sender_length@plt>
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    12d6 <command_print+0x186>
jmp    12db <command_print+0x18b>
jmp    1169 <command_print+0x19>
mov    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_print>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
call   1060 <pass_space_label@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <str32_strlen@plt>
test   %rax,%rax
je     1275 <command_print+0x125>
lea    0xe85(%rip),%r14
lea    0xe86(%rip),%r15
lea    0xe83(%rip),%rbp
lea    0xe74(%rip),%r13
jmp    11d6 <command_print+0x86>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rsi
call   1040 <str32_strindex@plt>
movslq %eax,%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <text_sender_length@plt>
mov    %r13,%rdi
call   1070 <text_sender@plt>
add    %r12,%rbx
add    $0x2,%rbx
mov    %rbx,%rdi
call   1050 <str32_strlen@plt>
test   %rax,%rax
je     1275 <command_print+0x125>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <str32_strindex@plt>
mov    %rbx,%rdi
cmp    $0xffffffff,%eax
jne    11a0 <command_print+0x50>
mov    %r15,%rsi
call   1040 <str32_strindex@plt>
mov    %rbx,%rdi
cmp    $0xffffffff,%eax
je     1218 <command_print+0xc8>
mov    %r15,%rsi
call   1040 <str32_strindex@plt>
movslq %eax,%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <text_sender_length@plt>
lea    0xdfa(%rip),%rdi
jmp    1245 <command_print+0xf5>
mov    %rbp,%rsi
call   1040 <str32_strindex@plt>
mov    %rbx,%rdi
cmp    $0xffffffff,%eax
je     125d <command_print+0x10d>
mov    %rbp,%rsi
call   1040 <str32_strindex@plt>
movslq %eax,%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <text_sender_length@plt>
lea    0xdce(%rip),%rdi
call   1070 <text_sender@plt>
add    %rbp,%rbx
add    $0x2,%rbx
lea    0xdb4(%rip),%rbp
jmp    11c5 <command_print+0x75>
call   1050 <str32_strlen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <text_sender_length@plt>
add    %rbp,%rbx
jmp    1251 <command_print+0x101>
mov    $0x1,%al
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\\n\00\00"
@.str.1 = [4 x i8] c"\0D\0A\00\00"
@.str.2 = [4 x i8] c"\\s\00\00"
@.str.3 = [3 x i8] c" \00\00"
@.str.4 = [4 x i8] c"\\e\00\00"
@.str.5 = [3 x i8] c"\1B\00\00"
define zeroext i8 @command_print(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @pass_space_label(i8* %5)
store i8* %6, i8** %3
br label %7
7: ; preds = %73, %1
%8 = load i8*, i8** %3
%9 = call i64 @str32_strlen(i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %74
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = call i32 @str32_strindex(i8* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%14 = icmp ne i32 %13, -1
br i1 %14, label %15, label %28
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = call i32 @str32_strindex(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%18 = sext i32 %17 to i64
store i64 %18, i64* %4
%19 = load i8*, i8** %3
%20 = load i64, i64* %4
%21 = call i32 @text_sender_length(i8* %19, i64 %20)
%22 = call i32 @text_sender(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%23 = load i64, i64* %4
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 %23
store i8* %25, i8** %3
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 2
store i8* %27, i8** %3
br label %73
28: ; preds = %11
%29 = load i8*, i8** %3
%30 = call i32 @str32_strindex(i8* %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%31 = icmp ne i32 %30, -1
br i1 %31, label %32, label %45
32: ; preds = %28
%33 = load i8*, i8** %3
%34 = call i32 @str32_strindex(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%35 = sext i32 %34 to i64
store i64 %35, i64* %4
%36 = load i8*, i8** %3
%37 = load i64, i64* %4
%38 = call i32 @text_sender_length(i8* %36, i64 %37)
%39 = call i32 @text_sender(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%40 = load i64, i64* %4
%41 = load i8*, i8** %3
%42 = getelementptr inbounds i8, i8* %41, i64 %40
store i8* %42, i8** %3
%43 = load i8*, i8** %3
%44 = getelementptr inbounds i8, i8* %43, i64 2
store i8* %44, i8** %3
br label %72
45: ; preds = %28
%46 = load i8*, i8** %3
%47 = call i32 @str32_strindex(i8* %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%48 = icmp ne i32 %47, -1
br i1 %48, label %49, label %62
49: ; preds = %45
%50 = load i8*, i8** %3
%51 = call i32 @str32_strindex(i8* %50, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%52 = sext i32 %51 to i64
store i64 %52, i64* %4
%53 = load i8*, i8** %3
%54 = load i64, i64* %4
%55 = call i32 @text_sender_length(i8* %53, i64 %54)
%56 = call i32 @text_sender(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%57 = load i64, i64* %4
%58 = load i8*, i8** %3
%59 = getelementptr inbounds i8, i8* %58, i64 %57
store i8* %59, i8** %3
%60 = load i8*, i8** %3
%61 = getelementptr inbounds i8, i8* %60, i64 2
store i8* %61, i8** %3
br label %71
62: ; preds = %45
%63 = load i8*, i8** %3
%64 = call i64 @str32_strlen(i8* %63)
store i64 %64, i64* %4
%65 = load i8*, i8** %3
%66 = load i64, i64* %4
%67 = call i32 @text_sender_length(i8* %65, i64 %66)
%68 = load i64, i64* %4
%69 = load i8*, i8** %3
%70 = getelementptr inbounds i8, i8* %69, i64 %68
store i8* %70, i8** %3
br label %71
71: ; preds = %62, %49
br label %72
72: ; preds = %71, %32
br label %73
73: ; preds = %72, %15
br label %7
74: ; preds = %7
ret i8 1
}

LLVM IR (-O2):
@.str = [4 x i8] c"\\n\00\00"
@.str.1 = [4 x i8] c"\0D\0A\00\00"
@.str.2 = [4 x i8] c"\\s\00\00"
@.str.3 = [3 x i8] c" \00\00"
@.str.4 = [4 x i8] c"\\e\00\00"
@.str.5 = [3 x i8] c"\1B\00\00"
define zeroext i8 @command_print(i8* %0) {
%2 = tail call i8* @pass_space_label(i8* %0)
%3 = tail call i64 @str32_strlen(i8* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %44, label %5
5: ; preds = %1, %40
%6 = phi i8* [ %41, %40 ], [ %2, %1 ]
%7 = tail call i32 @str32_strindex(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, -1
br i1 %8, label %16, label %9
9: ; preds = %5
%10 = tail call i32 @str32_strindex(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = sext i32 %10 to i64
%12 = tail call i32 @text_sender_length(i8* %6, i64 %11)
%13 = tail call i32 @text_sender(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%14 = getelementptr inbounds i8, i8* %6, i64 2
%15 = getelementptr inbounds i8, i8* %14, i64 %11
br label %40
16: ; preds = %5
%17 = tail call i32 @str32_strindex(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i32 %17, -1
br i1 %18, label %26, label %19
19: ; preds = %16
%20 = tail call i32 @str32_strindex(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%21 = sext i32 %20 to i64
%22 = tail call i32 @text_sender_length(i8* %6, i64 %21)
%23 = tail call i32 @text_sender(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%24 = getelementptr inbounds i8, i8* %6, i64 2
%25 = getelementptr inbounds i8, i8* %24, i64 %21
br label %40
26: ; preds = %16
%27 = tail call i32 @str32_strindex(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%28 = icmp eq i32 %27, -1
br i1 %28, label %36, label %29
29: ; preds = %26
%30 = tail call i32 @str32_strindex(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%31 = sext i32 %30 to i64
%32 = tail call i32 @text_sender_length(i8* %6, i64 %31)
%33 = tail call i32 @text_sender(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%34 = getelementptr inbounds i8, i8* %6, i64 2
%35 = getelementptr inbounds i8, i8* %34, i64 %31
br label %40
36: ; preds = %26
%37 = tail call i64 @str32_strlen(i8* %6)
%38 = tail call i32 @text_sender_length(i8* %6, i64 %37)
%39 = getelementptr inbounds i8, i8* %6, i64 %37
br label %40
40: ; preds = %19, %36, %29, %9
%41 = phi i8* [ %15, %9 ], [ %25, %19 ], [ %35, %29 ], [ %39, %36 ]
%42 = tail call i64 @str32_strlen(i8* %41)
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %5
44: ; preds = %40, %1
ret i8 1
}