#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*/ temp;
typedef int /*<<< orphan*/ line;
typedef int /*<<< orphan*/ fo;
typedef int /*<<< orphan*/ fi;

/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ execute_by_child(char *, char **, char *, char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ replace_char_last(char *, int, char, int /*<<< orphan*/);
int searchIndex(size_t, char **, char);
size_t strlen(char *);
size_t tokenize(char *, char **, char *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ wstring_copy_except(char *, char *, char, char, char);
int /*<<< orphan*/ wsubstr(char *, char *, int, int);
int main() {
  char line[128], temp[128];
  char *buffer[12];
  while (1) {
    memset(&line[0], 0, sizeof(line));
    memset(&temp[0], 0, sizeof(temp));
    write(STDOUT_FILENO, "C/S Lab 6> ", 11);
    read(STDIN_FILENO, line, 128);
    if ('\n' == line[0])
      break;
    replace_char_last(line, strlen(line) - 1, '\n', 0);
    wstring_copy_except(line, temp, '<', '>', ' ');
    size_t c = tokenize(temp, buffer, " ");
    char *commands[c];
    size_t i;
    for (i = 0; i < c; i++) {
      commands[i] = buffer[i];
    }
    commands[i] = NULL;
    int rdi = searchIndex(c - 1, commands, '<');
    int rdo = searchIndex(c - 1, commands, '>');
    int szi = (0 < rdi) ? strlen(commands[rdi]) : i;
    char fi[szi - 1];
    memset(&fi[0], 0, sizeof(fi));
    if (0 < rdi)
      wsubstr(commands[rdi], fi, 1, szi);
    int szo = (0 < rdo) ? strlen(commands[rdo]) : i;
    char fo[szo - 1];
    memset(&fo[0], 0, sizeof(fo));
    if (0 < rdo)
      wsubstr(commands[rdo], fo, 1, szo);
    if (0 <= rdi + rdo) {
      rdi = rdi < 0 ? rdo : rdi;
      rdo = rdo < 0 ? rdi : rdo;
      int min = rdi < rdo ? rdi : rdo;
      size_t x = i;
      for (i = min; i < x; i++) {
        commands[i] = NULL;
      }
    }
    execute_by_child(commands[0], commands, fi, fo);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1070 <memset@plt>
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1070 <memset@plt>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
lea    0xe18(%rip),%rsi
mov    $0xb,%edx
call   1030 <write@plt>
mov    0x2ddf(%rip),%rax
mov    (%rax),%edi
lea    -0x90(%rbp),%rsi
mov    $0x80,%edx
call   1080 <read@plt>
movsbl -0x90(%rbp),%ecx
mov    $0xa,%eax
cmp    %ecx,%eax
jne    1225 <main+0x85>
jmp    1632 <main+0x492>
lea    -0x90(%rbp),%rdi
mov    %rdi,-0x1e0(%rbp)
call   1050 <strlen@plt>
mov    -0x1e0(%rbp),%rdi
mov    %eax,%esi
add    $0xffffffff,%esi
mov    $0xa,%edx
xor    %ecx,%ecx
call   10b0 <replace_char_last@plt>
mov    -0x1e0(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    %rsi,-0x1d8(%rbp)
mov    $0x3c,%edx
mov    $0x3e,%ecx
mov    $0x20,%r8d
call   10a0 <wstring_copy_except@plt>
mov    -0x1d8(%rbp),%rdi
lea    0xd82(%rip),%rdx
lea    -0x170(%rbp),%rsi
call   1090 <tokenize@plt>
mov    %rax,-0x178(%rbp)
mov    -0x178(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x180(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x1d0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x188(%rbp)
movq   $0x0,-0x190(%rbp)
mov    -0x190(%rbp),%rax
cmp    -0x178(%rbp),%rax
jae    1326 <main+0x186>
mov    -0x1d0(%rbp),%rax
mov    -0x190(%rbp),%rcx
mov    -0x170(%rbp,%rcx,8),%rdx
ff
mov    -0x190(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x190(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x190(%rbp)
jmp    12da <main+0x13a>
mov    -0x1d0(%rbp),%rsi
mov    -0x190(%rbp),%rax
movq   $0x0,(%rsi,%rax,8)
mov    -0x178(%rbp),%rdi
sub    $0x1,%rdi
mov    $0x3c,%edx
call   1060 <searchIndex@plt>
mov    -0x1d0(%rbp),%rsi
mov    %eax,-0x194(%rbp)
mov    -0x178(%rbp),%rdi
sub    $0x1,%rdi
mov    $0x3e,%edx
call   1060 <searchIndex@plt>
mov    %eax,-0x198(%rbp)
xor    %eax,%eax
cmp    -0x194(%rbp),%eax
jge    13aa <main+0x20a>
mov    -0x1d0(%rbp),%rax
movslq -0x194(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x1e8(%rbp)
jmp    13b8 <main+0x218>
mov    -0x190(%rbp),%rax
mov    %rax,-0x1e8(%rbp)
mov    -0x1e8(%rbp),%rax
mov    %eax,-0x19c(%rbp)
mov    -0x19c(%rbp),%eax
add    $0xffffffff,%eax
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x1f0(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x1a8(%rbp)
mov    %eax,%edx
xor    %esi,%esi
call   1070 <memset@plt>
xor    %eax,%eax
cmp    -0x194(%rbp),%eax
jge    1430 <main+0x290>
mov    -0x1f0(%rbp),%rsi
mov    -0x1d0(%rbp),%rax
movslq -0x194(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x19c(%rbp),%ecx
mov    $0x1,%edx
call   10c0 <wsubstr@plt>
xor    %eax,%eax
cmp    -0x198(%rbp),%eax
jge    1461 <main+0x2c1>
mov    -0x1d0(%rbp),%rax
movslq -0x198(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x1f8(%rbp)
jmp    146f <main+0x2cf>
mov    -0x190(%rbp),%rax
mov    %rax,-0x1f8(%rbp)
mov    -0x1f8(%rbp),%rax
mov    %eax,-0x1ac(%rbp)
mov    -0x1ac(%rbp),%eax
add    $0xffffffff,%eax
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x200(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x1b8(%rbp)
mov    %eax,%edx
xor    %esi,%esi
call   1070 <memset@plt>
xor    %eax,%eax
cmp    -0x198(%rbp),%eax
jge    14e7 <main+0x347>
mov    -0x200(%rbp),%rsi
mov    -0x1d0(%rbp),%rax
movslq -0x198(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x1ac(%rbp),%ecx
mov    $0x1,%edx
call   10c0 <wsubstr@plt>
mov    -0x194(%rbp),%ecx
add    -0x198(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     1606 <main+0x466>
cmpl   $0x0,-0x194(%rbp)
jge    151b <main+0x37b>
mov    -0x198(%rbp),%eax
mov    %eax,-0x204(%rbp)
jmp    1527 <main+0x387>
mov    -0x194(%rbp),%eax
mov    %eax,-0x204(%rbp)
mov    -0x204(%rbp),%eax
mov    %eax,-0x194(%rbp)
cmpl   $0x0,-0x198(%rbp)
jge    1551 <main+0x3b1>
mov    -0x194(%rbp),%eax
mov    %eax,-0x208(%rbp)
jmp    155d <main+0x3bd>
mov    -0x198(%rbp),%eax
mov    %eax,-0x208(%rbp)
mov    -0x208(%rbp),%eax
mov    %eax,-0x198(%rbp)
mov    -0x194(%rbp),%eax
cmp    -0x198(%rbp),%eax
jge    158c <main+0x3ec>
mov    -0x194(%rbp),%eax
mov    %eax,-0x20c(%rbp)
jmp    1598 <main+0x3f8>
mov    -0x198(%rbp),%eax
mov    %eax,-0x20c(%rbp)
mov    -0x20c(%rbp),%eax
mov    %eax,-0x1bc(%rbp)
mov    -0x190(%rbp),%rax
mov    %rax,-0x1c8(%rbp)
movslq -0x1bc(%rbp),%rax
mov    %rax,-0x190(%rbp)
mov    -0x190(%rbp),%rax
cmp    -0x1c8(%rbp),%rax
jae    1601 <main+0x461>
mov    -0x1d0(%rbp),%rax
mov    -0x190(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x190(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x190(%rbp)
jmp    15c0 <main+0x420>
jmp    1606 <main+0x466>
mov    -0x200(%rbp),%rcx
mov    -0x1f0(%rbp),%rdx
mov    -0x1d0(%rbp),%rsi
mov    (%rsi),%rdi
call   1040 <execute_by_child@plt>
mov    -0x180(%rbp),%rax
mov    %rax,%rsp
jmp    11b2 <main+0x12>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x188,%rsp
jmp    11e6 <main+0x36>
cs nopw 0x0(%rax,%rax,1)
mov    (%r12),%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %r15,%rcx
call   1040 <execute_by_child@plt>
mov    -0x48(%rbp),%rsp
lea    -0xd0(%rbp),%rbx
lea    -0x1b0(%rbp),%r14
lea    -0x130(%rbp),%r15
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1070 <memset@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1070 <memset@plt>
mov    0x2dd0(%rip),%rax
mov    (%rax),%edi
lea    0xdd7(%rip),%rsi
mov    $0xb,%edx
call   1030 <write@plt>
mov    0x2d9e(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
mov    $0x80,%edx
call   1080 <read@plt>
cmpb   $0xa,-0xd0(%rbp)
je     143c <main+0x28c>
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    -0x1(%rax),%esi
mov    %rbx,%rdi
mov    $0xa,%edx
xor    %ecx,%ecx
call   10c0 <replace_char_last@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3c,%edx
mov    $0x3e,%ecx
mov    $0x20,%r8d
call   10b0 <wstring_copy_except@plt>
mov    %r14,%rdi
mov    %r15,%rsi
lea    0xd72(%rip),%rdx
call   10a0 <tokenize@plt>
mov    %rax,%rbx
mov    %rsp,-0x48(%rbp)
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r12
sub    %rax,%r12
mov    %r12,%rsp
test   %rbx,%rbx
je     12d1 <main+0x121>
lea    0x0(,%rbx,8),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1090 <memcpy@plt>
movq   $0x0,(%r12,%rbx,8)
mov    %rbx,%r15
add    $0xffffffffffffffff,%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x3c,%edx
call   1060 <searchIndex@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x3e,%edx
call   1060 <searchIndex@plt>
mov    %eax,%r14d
test   %r13d,%r13d
mov    %r15,-0x38(%rbp)
jle    13b0 <main+0x200>
mov    %r13d,%eax
mov    %rax,-0x30(%rbp)
mov    (%r12,%rax,8),%rdi
call   1050 <strlen@plt>
mov    %rax,%r15
lea    -0x1(%rax),%edx
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x30(%rbp),%rax
mov    (%r12,%rax,8),%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
mov    %r15d,%ecx
call   10d0 <wsubstr@plt>
test   %r14d,%r14d
jle    13d4 <main+0x224>
mov    %r14d,%eax
mov    %rax,-0x30(%rbp)
mov    (%r12,%rax,8),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x40(%rbp)
lea    -0x1(%rax),%edx
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r15
sub    %rax,%r15
mov    %r15,%rsp
mov    %r15,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x30(%rbp),%rax
mov    (%r12,%rax,8),%rdi
mov    %r15,%rsi
mov    $0x1,%edx
mov    -0x40(%rbp),%rcx
call   10d0 <wsubstr@plt>
jmp    13f6 <main+0x246>
xchg   %ax,%ax
lea    -0x1(%r15),%edx
mov    %rsp,%rbx
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
test   %r14d,%r14d
jg     1361 <main+0x1b1>
mov    -0x38(%rbp),%rax
lea    -0x1(%rax),%edx
mov    %rsp,%r15
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    %r15,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
mov    %r14d,%eax
add    %r13d,%eax
js     11d0 <main+0x20>
test   %r13d,%r13d
cmovs  %r14d,%r13d
test   %r14d,%r14d
cmovs  %r13d,%r14d
cmp    %r14d,%r13d
cmovl  %r13d,%r14d
movslq %r14d,%rax
sub    %rax,-0x38(%rbp)
jbe    11d0 <main+0x20>
lea    (%r12,%rax,8),%rdi
mov    -0x38(%rbp),%rdx
shl    $0x3,%rdx
xor    %esi,%esi
call   1070 <memset@plt>
jmp    11d0 <main+0x20>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [12 x i8] c"C/S Lab 6> \00"
@STDIN_FILENO = global i32 0
@.str.1 = [2 x i8] c" \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
%3 = alloca [128 x i8]
%4 = alloca [12 x i8*]
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i64
%13 = alloca i32
%14 = alloca i64
%15 = alloca i32
%16 = alloca i64
store i32 0, i32* %1
br label %17
17: ; preds = %0, %174
%18 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%19 = call i32 @memset(i8* %18, i32 0, i32 128)
%20 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%21 = call i32 @memset(i8* %20, i32 0, i32 128)
%22 = load i32, i32* @STDOUT_FILENO
%23 = call i32 @write(i32 %22, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 11)
%24 = load i32, i32* @STDIN_FILENO
%25 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%26 = call i32 @read(i32 %24, i8* %25, i32 128)
%27 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 10, %29
br i1 %30, label %31, label %32
31: ; preds = %17
br label %179
32: ; preds = %17
%33 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%34 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%35 = call i64 @strlen(i8* %34)
%36 = sub i64 %35, 1
%37 = trunc i64 %36 to i32
%38 = call i32 @replace_char_last(i8* %33, i32 %37, i8 signext 10, i32 0)
%39 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%40 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%41 = call i32 @wstring_copy_except(i8* %39, i8* %40, i8 signext 60, i8 signext 62, i8 signext 32)
%42 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%43 = getelementptr inbounds [12 x i8*], [12 x i8*]* %4, i64 0, i64 0
%44 = call i64 @tokenize(i8* %42, i8** %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i64 %44, i64* %5
%45 = load i64, i64* %5
%46 = call i8* @llvm.stacksave()
store i8* %46, i8** %6
%47 = alloca i8*, i64 %45
store i64 %45, i64* %7
store i64 0, i64* %8
br label %48
48: ; preds = %58, %32
%49 = load i64, i64* %8
%50 = load i64, i64* %5
%51 = icmp ult i64 %49, %50
br i1 %51, label %52, label %61
52: ; preds = %48
%53 = load i64, i64* %8
%54 = getelementptr inbounds [12 x i8*], [12 x i8*]* %4, i64 0, i64 %53
%55 = load i8*, i8** %54
%56 = load i64, i64* %8
%57 = getelementptr inbounds i8*, i8** %47, i64 %56
store i8* %55, i8** %57
br label %58
58: ; preds = %52
%59 = load i64, i64* %8
%60 = add i64 %59, 1
store i64 %60, i64* %8
br label %48
61: ; preds = %48
%62 = load i64, i64* %8
%63 = getelementptr inbounds i8*, i8** %47, i64 %62
store i8* null, i8** %63
%64 = load i64, i64* %5
%65 = sub i64 %64, 1
%66 = call i32 @searchIndex(i64 %65, i8** %47, i8 signext 60)
store i32 %66, i32* %9
%67 = load i64, i64* %5
%68 = sub i64 %67, 1
%69 = call i32 @searchIndex(i64 %68, i8** %47, i8 signext 62)
store i32 %69, i32* %10
%70 = load i32, i32* %9
%71 = icmp slt i32 0, %70
br i1 %71, label %72, label %78
72: ; preds = %61
%73 = load i32, i32* %9
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i8*, i8** %47, i64 %74
%76 = load i8*, i8** %75
%77 = call i64 @strlen(i8* %76)
br label %80
78: ; preds = %61
%79 = load i64, i64* %8
br label %80
80: ; preds = %78, %72
%81 = phi i64 [ %77, %72 ], [ %79, %78 ]
%82 = trunc i64 %81 to i32
store i32 %82, i32* %11
%83 = load i32, i32* %11
%84 = sub nsw i32 %83, 1
%85 = zext i32 %84 to i64
%86 = alloca i8, i64 %85
store i64 %85, i64* %12
%87 = getelementptr inbounds i8, i8* %86, i64 0
%88 = trunc i64 %85 to i32
%89 = call i32 @memset(i8* %87, i32 0, i32 %88)
%90 = load i32, i32* %9
%91 = icmp slt i32 0, %90
br i1 %91, label %92, label %99
92: ; preds = %80
%93 = load i32, i32* %9
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i8*, i8** %47, i64 %94
%96 = load i8*, i8** %95
%97 = load i32, i32* %11
%98 = call i32 @wsubstr(i8* %96, i8* %86, i32 1, i32 %97)
br label %99
99: ; preds = %92, %80
%100 = load i32, i32* %10
%101 = icmp slt i32 0, %100
br i1 %101, label %102, label %108
102: ; preds = %99
%103 = load i32, i32* %10
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i8*, i8** %47, i64 %104
%106 = load i8*, i8** %105
%107 = call i64 @strlen(i8* %106)
br label %110
108: ; preds = %99
%109 = load i64, i64* %8
br label %110
110: ; preds = %108, %102
%111 = phi i64 [ %107, %102 ], [ %109, %108 ]
%112 = trunc i64 %111 to i32
store i32 %112, i32* %13
%113 = load i32, i32* %13
%114 = sub nsw i32 %113, 1
%115 = zext i32 %114 to i64
%116 = alloca i8, i64 %115
store i64 %115, i64* %14
%117 = getelementptr inbounds i8, i8* %116, i64 0
%118 = trunc i64 %115 to i32
%119 = call i32 @memset(i8* %117, i32 0, i32 %118)
%120 = load i32, i32* %10
%121 = icmp slt i32 0, %120
br i1 %121, label %122, label %129
122: ; preds = %110
%123 = load i32, i32* %10
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i8*, i8** %47, i64 %124
%126 = load i8*, i8** %125
%127 = load i32, i32* %13
%128 = call i32 @wsubstr(i8* %126, i8* %116, i32 1, i32 %127)
br label %129
129: ; preds = %122, %110
%130 = load i32, i32* %9
%131 = load i32, i32* %10
%132 = add nsw i32 %130, %131
%133 = icmp sle i32 0, %132
br i1 %133, label %134, label %174
134: ; preds = %129
%135 = load i32, i32* %9
%136 = icmp slt i32 %135, 0
br i1 %136, label %137, label %139
137: ; preds = %134
%138 = load i32, i32* %10
br label %141
139: ; preds = %134
%140 = load i32, i32* %9
br label %141
141: ; preds = %139, %137
%142 = phi i32 [ %138, %137 ], [ %140, %139 ]
store i32 %142, i32* %9
%143 = load i32, i32* %10
%144 = icmp slt i32 %143, 0
br i1 %144, label %145, label %147
145: ; preds = %141
%146 = load i32, i32* %9
br label %149
147: ; preds = %141
%148 = load i32, i32* %10
br label %149
149: ; preds = %147, %145
%150 = phi i32 [ %146, %145 ], [ %148, %147 ]
store i32 %150, i32* %10
%151 = load i32, i32* %9
%152 = load i32, i32* %10
%153 = icmp slt i32 %151, %152
br i1 %153, label %154, label %156
154: ; preds = %149
%155 = load i32, i32* %9
br label %158
156: ; preds = %149
%157 = load i32, i32* %10
br label %158
158: ; preds = %156, %154
%159 = phi i32 [ %155, %154 ], [ %157, %156 ]
store i32 %159, i32* %15
%160 = load i64, i64* %8
store i64 %160, i64* %16
%161 = load i32, i32* %15
%162 = sext i32 %161 to i64
store i64 %162, i64* %8
br label %163
163: ; preds = %170, %158
%164 = load i64, i64* %8
%165 = load i64, i64* %16
%166 = icmp ult i64 %164, %165
br i1 %166, label %167, label %173
167: ; preds = %163
%168 = load i64, i64* %8
%169 = getelementptr inbounds i8*, i8** %47, i64 %168
store i8* null, i8** %169
br label %170
170: ; preds = %167
%171 = load i64, i64* %8
%172 = add i64 %171, 1
store i64 %172, i64* %8
br label %163
173: ; preds = %163
br label %174
174: ; preds = %173, %129
%175 = getelementptr inbounds i8*, i8** %47, i64 0
%176 = load i8*, i8** %175
%177 = call i32 @execute_by_child(i8* %176, i8** %47, i8* %86, i8* %116)
%178 = load i8*, i8** %6
br label %17
179: ; preds = %31
ret i32 0
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [12 x i8] c"C/S Lab 6> \00"
@STDIN_FILENO = global i32 0
@.str.1 = [2 x i8] c" \00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = alloca [128 x i8]
%3 = alloca [12 x i8*]
%4 = bitcast [12 x i8*]* %3 to i8*
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [12 x i8*], [12 x i8*]* %3, i64 0, i64 0
br label %8
8: ; preds = %93, %0
%9 = call i32 @memset(i8* %5, i32 0, i32 128)
%10 = call i32 @memset(i8* %6, i32 0, i32 128)
%11 = load i32, i32* @STDOUT_FILENO
%12 = call i32 @write(i32 %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 11)
%13 = load i32, i32* @STDIN_FILENO
%14 = call i32 @read(i32 %13, i8* %5, i32 128)
%15 = load i8, i8* %5
%16 = icmp eq i8 %15, 10
br i1 %16, label %96, label %17
17: ; preds = %8
%18 = call i64 @strlen(i8* %5)
%19 = trunc i64 %18 to i32
%20 = add i32 %19, -1
%21 = call i32 @replace_char_last(i8* %5, i32 %20, i8 signext 10, i32 0)
%22 = call i32 @wstring_copy_except(i8* %5, i8* %6, i8 signext 60, i8 signext 62, i8 signext 32)
%23 = call i64 @tokenize(i8* %6, i8** %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = call i8* @llvm.stacksave()
%25 = alloca i8*, i64 %23
%26 = icmp eq i64 %23, 0
br i1 %26, label %30, label %27
27: ; preds = %17
%28 = bitcast i8** %25 to i8*
%29 = shl nuw i64 %23, 3
br label %30
30: ; preds = %27, %17
%31 = getelementptr inbounds i8*, i8** %25, i64 %23
store i8* null, i8** %31
%32 = add i64 %23, -1
%33 = call i32 @searchIndex(i64 %32, i8** %25, i8 signext 60)
%34 = call i32 @searchIndex(i64 %32, i8** %25, i8 signext 62)
%35 = icmp sgt i32 %33, 0
br i1 %35, label %42, label %36
36: ; preds = %30
%37 = trunc i64 %23 to i32
%38 = add nsw i32 %37, -1
%39 = zext i32 %38 to i64
%40 = alloca i8, i64 %39
%41 = call i32 @memset(i8* %40, i32 0, i32 %38)
br label %54
42: ; preds = %30
%43 = zext i32 %33 to i64
%44 = getelementptr inbounds i8*, i8** %25, i64 %43
%45 = load i8*, i8** %44
%46 = call i64 @strlen(i8* dereferenceable(1) %45)
%47 = trunc i64 %46 to i32
%48 = add nsw i32 %47, -1
%49 = zext i32 %48 to i64
%50 = alloca i8, i64 %49
%51 = call i32 @memset(i8* %50, i32 0, i32 %48)
%52 = load i8*, i8** %44
%53 = call i32 @wsubstr(i8* %52, i8* %50, i32 1, i32 %47)
br label %54
54: ; preds = %36, %42
%55 = phi i8* [ %50, %42 ], [ %40, %36 ]
%56 = icmp sgt i32 %34, 0
br i1 %56, label %63, label %57
57: ; preds = %54
%58 = trunc i64 %23 to i32
%59 = add nsw i32 %58, -1
%60 = zext i32 %59 to i64
%61 = alloca i8, i64 %60
%62 = call i32 @memset(i8* %61, i32 0, i32 %59)
br label %75
63: ; preds = %54
%64 = zext i32 %34 to i64
%65 = getelementptr inbounds i8*, i8** %25, i64 %64
%66 = load i8*, i8** %65
%67 = call i64 @strlen(i8* dereferenceable(1) %66)
%68 = trunc i64 %67 to i32
%69 = add nsw i32 %68, -1
%70 = zext i32 %69 to i64
%71 = alloca i8, i64 %70
%72 = call i32 @memset(i8* %71, i32 0, i32 %69)
%73 = load i8*, i8** %65
%74 = call i32 @wsubstr(i8* %73, i8* %71, i32 1, i32 %68)
br label %75
75: ; preds = %57, %63
%76 = phi i8* [ %71, %63 ], [ %61, %57 ]
%77 = add nsw i32 %34, %33
%78 = icmp sgt i32 %77, -1
br i1 %78, label %79, label %93
79: ; preds = %75
%80 = icmp slt i32 %33, 0
%81 = select i1 %80, i32 %34, i32 %33
%82 = icmp slt i32 %34, 0
%83 = select i1 %82, i32 %81, i32 %34
%84 = icmp slt i32 %81, %83
%85 = select i1 %84, i32 %81, i32 %83
%86 = sext i32 %85 to i64
%87 = icmp ugt i64 %23, %86
br i1 %87, label %88, label %93
88: ; preds = %79
%89 = getelementptr i8*, i8** %25, i64 %86
%90 = bitcast i8** %89 to i8*
%91 = sub i64 %23, %86
%92 = shl i64 %91, 3
br label %93
93: ; preds = %88, %79, %75
%94 = load i8*, i8** %25
%95 = call i32 @execute_by_child(i8* %94, i8** %25, i8* %55, i8* %76)
br label %8
96: ; preds = %8
ret i32 0
}