#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 atoi(char *);
char *getDir();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sendDir(char const *, int);
int /*<<< orphan*/ sendFile(char *, int);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ *strstr(char const *, char *);
int tokenizedCommandHandler(int cmdCnt, char **cmds) {
  int cF1, cF2, cF3, cF4 = 0;
  int port = 0;
  if (cmdCnt == 3) {
    if (strcmp(cmds[0], "LIST") == 0) {
      cF1 = 1;
    } else {
      printf("server : invalid command token 1: Expected LIST or RET\n");
      printf("token 1 :: %s\n", cmds[0]);
    }
    port = atoi(cmds[1]);
    if ((port > 1020) && (port < 65535)) {
      cF2 = 1;
    } else {
      printf("server : invalid command token 2 : Expected port range "
             "1024-65535\n");
      printf("Entered Port:: %d\n", port);
    }
    if (strcmp(cmds[2], "<CRLF>") == 0) {
      cF3 = 1;
    } else {
      printf(
          "server : invalid command token 3 : Expected <CRLF> termination\n");
      printf("token 3 :: %s\n", cmds[2]);
    }
    if ((cF1 == 1) && (cF2 == 1) && (cF2 == 1) && (cF4 == 0)) {
      const char *dir = getDir();
      sendDir(dir, port);
    }
  } else if (cmdCnt == 4) {
    if (strcmp(cmds[0], "RET") == 0) {
      cF1 = 1;
    } else {
      printf("server : invalid command token 1: Expected LIST or RET\n");
      printf("token 1 :: %s\n", cmds[0]);
    }
    const char *dir = getDir();
    if (strstr(dir, cmds[1]) != NULL) {
      cF2 = 1;
    } else {
      printf("server : invalid command token 2: Expected Valid File Name\n");
      printf("token 2 :: %s\n", cmds[1]);
      cF2 = -1;
    }
    port = atoi(cmds[2]);
    if ((port > 1020) && (port < 65535)) {
      cF3 = 1;
    } else {
      printf("server : invalid command token 3 : Expected port range "
             "1024-65535\n");
      printf("Entered Port:: %d\n", port);
    }
    if (strcmp(cmds[3], "<CRLF>") == 0) {
      cF4 = 1;
    } else {
      printf(
          "server : invalid command token 4 : Expected <CRLF> termination\n");
      printf("token 4 :: %s\n", cmds[3]);
    }
    if ((cF1 == 1) && (cF2 == 1) && (cF2 == 1) && (cF4 == 1)) {
      sendFile(cmds[1], port);
    }
  } else if (cmdCnt > 4) {
    printf("server : invailed command :: Command Count > 4\n");
  }
  if (cF2 == -1) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<tokenizedCommandHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    12ca <tokenizedCommandHandler+0x15a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe5b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11c0 <tokenizedCommandHandler+0x50>
movl   $0x1,-0x14(%rbp)
jmp    11e3 <tokenizedCommandHandler+0x73>
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x3fc,-0x24(%rbp)
jle    1219 <tokenizedCommandHandler+0xa9>
cmpl   $0xffff,-0x24(%rbp)
jge    1219 <tokenizedCommandHandler+0xa9>
movl   $0x1,-0x18(%rbp)
jmp    1238 <tokenizedCommandHandler+0xc8>
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe5b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1262 <tokenizedCommandHandler+0xf2>
movl   $0x1,-0x1c(%rbp)
jmp    1286 <tokenizedCommandHandler+0x116>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    12c5 <tokenizedCommandHandler+0x155>
cmpl   $0x1,-0x18(%rbp)
jne    12c5 <tokenizedCommandHandler+0x155>
cmpl   $0x1,-0x18(%rbp)
jne    12c5 <tokenizedCommandHandler+0x155>
cmpl   $0x0,-0x20(%rbp)
jne    12c5 <tokenizedCommandHandler+0x155>
mov    $0x0,%al
call   1030 <getDir@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1070 <sendDir@plt>
jmp    147f <tokenizedCommandHandler+0x30f>
cmpl   $0x4,-0x8(%rbp)
jne    145d <tokenizedCommandHandler+0x2ed>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe16(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12fd <tokenizedCommandHandler+0x18d>
movl   $0x1,-0x14(%rbp)
jmp    1320 <tokenizedCommandHandler+0x1b0>
lea    0xd01(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xd24(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getDir@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1090 <strstr@plt>
cmp    $0x0,%rax
je     1352 <tokenizedCommandHandler+0x1e2>
movl   $0x1,-0x18(%rbp)
jmp    137d <tokenizedCommandHandler+0x20d>
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x3fc,-0x24(%rbp)
jle    13b3 <tokenizedCommandHandler+0x243>
cmpl   $0xffff,-0x24(%rbp)
jge    13b3 <tokenizedCommandHandler+0x243>
movl   $0x1,-0x1c(%rbp)
jmp    13d2 <tokenizedCommandHandler+0x262>
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xcc4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xcc1(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    13fc <tokenizedCommandHandler+0x28c>
movl   $0x1,-0x20(%rbp)
jmp    1420 <tokenizedCommandHandler+0x2b0>
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xdb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    1458 <tokenizedCommandHandler+0x2e8>
cmpl   $0x1,-0x18(%rbp)
jne    1458 <tokenizedCommandHandler+0x2e8>
cmpl   $0x1,-0x18(%rbp)
jne    1458 <tokenizedCommandHandler+0x2e8>
cmpl   $0x1,-0x20(%rbp)
jne    1458 <tokenizedCommandHandler+0x2e8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x24(%rbp),%esi
call   1060 <sendFile@plt>
jmp    147a <tokenizedCommandHandler+0x30a>
cmpl   $0x4,-0x8(%rbp)
jle    1475 <tokenizedCommandHandler+0x305>
lea    0xd6b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    147a <tokenizedCommandHandler+0x30a>
jmp    147f <tokenizedCommandHandler+0x30f>
cmpl   $0xffffffff,-0x18(%rbp)
jne    1495 <tokenizedCommandHandler+0x325>
movl   $0xffffffff,-0x4(%rbp)
jmp    149c <tokenizedCommandHandler+0x32c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tokenizedCommandHandler>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
cmp    $0x4,%edi
je     1248 <tokenizedCommandHandler+0xc8>
cmp    $0x3,%edi
jne    1321 <tokenizedCommandHandler+0x1a1>
mov    (%rbx),%rdi
lea    0xe5d(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11ca <tokenizedCommandHandler+0x4a>
lea    0xf92(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%rsi
lea    0xe42(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%ebp
add    $0xfffffc03,%eax
cmp    $0xfc02,%eax
jb     11fd <tokenizedCommandHandler+0x7d>
lea    0xf95(%rip),%rdi
call   1040 <puts@plt>
lea    0xe20(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rbx),%rdi
lea    0xe1f(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1230 <tokenizedCommandHandler+0xb0>
lea    0xfa6(%rip),%rdi
call   1040 <puts@plt>
mov    0x10(%rbx),%rsi
lea    0xe05(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getDir@plt>
mov    %rax,%rdi
mov    %ebp,%esi
call   1080 <sendDir@plt>
jmp    134d <tokenizedCommandHandler+0x1cd>
mov    (%rbx),%rdi
lea    0xf27(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1279 <tokenizedCommandHandler+0xf9>
lea    0xee3(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%rsi
lea    0xd93(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <getDir@plt>
mov    0x8(%rbx),%rsi
mov    %rax,%rdi
call   10a0 <strstr@plt>
mov    %rax,%r14
test   %rax,%rax
jne    12b2 <tokenizedCommandHandler+0x132>
lea    0xdef(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rbx),%rsi
lea    0xd92(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%ebp
add    $0xfffffc03,%eax
cmp    $0xfc02,%eax
jb     12e5 <tokenizedCommandHandler+0x165>
lea    0xdf5(%rip),%rdi
call   1040 <puts@plt>
lea    0xd38(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rbx),%rdi
lea    0xd37(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1334 <tokenizedCommandHandler+0x1b4>
lea    0xe06(%rip),%rdi
call   1040 <puts@plt>
mov    0x18(%rbx),%rsi
lea    0xd3b(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <printf@plt>
test   %r14,%r14
jne    134d <tokenizedCommandHandler+0x1cd>
jmp    1348 <tokenizedCommandHandler+0x1c8>
cmp    $0x5,%edi
jl     1348 <tokenizedCommandHandler+0x1c8>
lea    0xd2e(%rip),%rdi
call   1040 <puts@plt>
jmp    1348 <tokenizedCommandHandler+0x1c8>
test   %r14,%r14
je     1348 <tokenizedCommandHandler+0x1c8>
mov    0x8(%rbx),%rdi
mov    %ebp,%esi
call   1070 <sendFile@plt>
xor    %ebx,%ebx
jmp    134d <tokenizedCommandHandler+0x1cd>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"LIST\00"
@.str.1 = [56 x i8] c"server : invalid command token 1: Expected LIST or RET\0A\00"
@.str.2 = [15 x i8] c"token 1 :: %s\0A\00"
@.str.3 = [67 x i8] c"server : invalid command token 2 : Expected port range 1024-65535\0A\00"
@.str.4 = [19 x i8] c"Entered Port:: %d\0A\00"
@.str.5 = [7 x i8] c"<CRLF>\00"
@.str.6 = [64 x i8] c"server : invalid command token 3 : Expected <CRLF> termination\0A\00"
@.str.7 = [15 x i8] c"token 3 :: %s\0A\00"
@.str.8 = [4 x i8] c"RET\00"
@.str.9 = [60 x i8] c"server : invalid command token 2: Expected Valid File Name\0A\00"
@.str.10 = [15 x i8] c"token 2 :: %s\0A\00"
@.str.11 = [67 x i8] c"server : invalid command token 3 : Expected port range 1024-65535\0A\00"
@.str.12 = [64 x i8] c"server : invalid command token 4 : Expected <CRLF> termination\0A\00"
@.str.13 = [15 x i8] c"token 4 :: %s\0A\00"
@.str.14 = [48 x i8] c"server : invailed command :: Command Count > 4\0A\00"
define i32 @tokenizedCommandHandler(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %9
store i32 0, i32* %10
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 3
br i1 %14, label %15, label %74
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %15
store i32 1, i32* %6
br label %28
22: ; preds = %15
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %26)
br label %28
28: ; preds = %22, %21
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32 @atoi(i8* %31)
store i32 %32, i32* %10
%33 = load i32, i32* %10
%34 = icmp sgt i32 %33, 1020
br i1 %34, label %35, label %39
35: ; preds = %28
%36 = load i32, i32* %10
%37 = icmp slt i32 %36, 65535
br i1 %37, label %38, label %39
38: ; preds = %35
store i32 1, i32* %7
br label %43
39: ; preds = %35, %28
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.3, i64 0, i64 0))
%41 = load i32, i32* %10
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %39, %38
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 2
%46 = load i8*, i8** %45
%47 = call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %50
49: ; preds = %43
store i32 1, i32* %8
br label %56
50: ; preds = %43
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.6, i64 0, i64 0))
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 2
%54 = load i8*, i8** %53
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8* %54)
br label %56
56: ; preds = %50, %49
%57 = load i32, i32* %6
%58 = icmp eq i32 %57, 1
br i1 %58, label %59, label %73
59: ; preds = %56
%60 = load i32, i32* %7
%61 = icmp eq i32 %60, 1
br i1 %61, label %62, label %73
62: ; preds = %59
%63 = load i32, i32* %7
%64 = icmp eq i32 %63, 1
br i1 %64, label %65, label %73
65: ; preds = %62
%66 = load i32, i32* %9
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %73
68: ; preds = %65
%69 = call i8* (...) @getDir()
store i8* %69, i8** %11
%70 = load i8*, i8** %11
%71 = load i32, i32* %10
%72 = call i32 @sendDir(i8* %70, i32 %71)
br label %73
73: ; preds = %68, %65, %62, %59, %56
br label %159
74: ; preds = %2
%75 = load i32, i32* %4
%76 = icmp eq i32 %75, 4
br i1 %76, label %77, label %152
77: ; preds = %74
%78 = load i8**, i8*** %5
%79 = getelementptr inbounds i8*, i8** %78, i64 0
%80 = load i8*, i8** %79
%81 = call i64 @strcmp(i8* %80, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %84
83: ; preds = %77
store i32 1, i32* %6
br label %90
84: ; preds = %77
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%86 = load i8**, i8*** %5
%87 = getelementptr inbounds i8*, i8** %86, i64 0
%88 = load i8*, i8** %87
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %88)
br label %90
90: ; preds = %84, %83
%91 = call i8* (...) @getDir()
store i8* %91, i8** %12
%92 = load i8*, i8** %12
%93 = load i8**, i8*** %5
%94 = getelementptr inbounds i8*, i8** %93, i64 1
%95 = load i8*, i8** %94
%96 = call i32* @strstr(i8* %92, i8* %95)
%97 = icmp ne i32* %96, null
br i1 %97, label %98, label %99
98: ; preds = %90
store i32 1, i32* %7
br label %105
99: ; preds = %90
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.9, i64 0, i64 0))
%101 = load i8**, i8*** %5
%102 = getelementptr inbounds i8*, i8** %101, i64 1
%103 = load i8*, i8** %102
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i8* %103)
store i32 -1, i32* %7
br label %105
105: ; preds = %99, %98
%106 = load i8**, i8*** %5
%107 = getelementptr inbounds i8*, i8** %106, i64 2
%108 = load i8*, i8** %107
%109 = call i32 @atoi(i8* %108)
store i32 %109, i32* %10
%110 = load i32, i32* %10
%111 = icmp sgt i32 %110, 1020
br i1 %111, label %112, label %116
112: ; preds = %105
%113 = load i32, i32* %10
%114 = icmp slt i32 %113, 65535
br i1 %114, label %115, label %116
115: ; preds = %112
store i32 1, i32* %8
br label %120
116: ; preds = %112, %105
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.11, i64 0, i64 0))
%118 = load i32, i32* %10
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %118)
br label %120
120: ; preds = %116, %115
%121 = load i8**, i8*** %5
%122 = getelementptr inbounds i8*, i8** %121, i64 3
%123 = load i8*, i8** %122
%124 = call i64 @strcmp(i8* %123, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%125 = icmp eq i64 %124, 0
br i1 %125, label %126, label %127
126: ; preds = %120
store i32 1, i32* %9
br label %133
127: ; preds = %120
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.12, i64 0, i64 0))
%129 = load i8**, i8*** %5
%130 = getelementptr inbounds i8*, i8** %129, i64 3
%131 = load i8*, i8** %130
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i8* %131)
br label %133
133: ; preds = %127, %126
%134 = load i32, i32* %6
%135 = icmp eq i32 %134, 1
br i1 %135, label %136, label %151
136: ; preds = %133
%137 = load i32, i32* %7
%138 = icmp eq i32 %137, 1
br i1 %138, label %139, label %151
139: ; preds = %136
%140 = load i32, i32* %7
%141 = icmp eq i32 %140, 1
br i1 %141, label %142, label %151
142: ; preds = %139
%143 = load i32, i32* %9
%144 = icmp eq i32 %143, 1
br i1 %144, label %145, label %151
145: ; preds = %142
%146 = load i8**, i8*** %5
%147 = getelementptr inbounds i8*, i8** %146, i64 1
%148 = load i8*, i8** %147
%149 = load i32, i32* %10
%150 = call i32 @sendFile(i8* %148, i32 %149)
br label %151
151: ; preds = %145, %142, %139, %136, %133
br label %158
152: ; preds = %74
%153 = load i32, i32* %4
%154 = icmp sgt i32 %153, 4
br i1 %154, label %155, label %157
155: ; preds = %152
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.14, i64 0, i64 0))
br label %157
157: ; preds = %155, %152
br label %158
158: ; preds = %157, %151
br label %159
159: ; preds = %158, %73
%160 = load i32, i32* %7
%161 = icmp eq i32 %160, -1
br i1 %161, label %162, label %163
162: ; preds = %159
store i32 -1, i32* %3
br label %164
163: ; preds = %159
store i32 0, i32* %3
br label %164
164: ; preds = %163, %162
%165 = load i32, i32* %3
ret i32 %165
}

LLVM IR (-O2):
@.str = [5 x i8] c"LIST\00"
@.str.2 = [15 x i8] c"token 1 :: %s\0A\00"
@.str.4 = [19 x i8] c"Entered Port:: %d\0A\00"
@.str.5 = [7 x i8] c"<CRLF>\00"
@.str.7 = [15 x i8] c"token 3 :: %s\0A\00"
@.str.8 = [4 x i8] c"RET\00"
@.str.10 = [15 x i8] c"token 2 :: %s\0A\00"
@.str.13 = [15 x i8] c"token 4 :: %s\0A\00"
@str = [47 x i8] c"server : invailed command :: Command Count > 4\00"
@str.16 = [59 x i8] c"server : invalid command token 2: Expected Valid File Name\00"
@str.17 = [66 x i8] c"server : invalid command token 3 : Expected port range 1024-65535\00"
@str.18 = [63 x i8] c"server : invalid command token 4 : Expected <CRLF> termination\00"
@str.19 = [55 x i8] c"server : invalid command token 1: Expected LIST or RET\00"
@str.20 = [66 x i8] c"server : invalid command token 2 : Expected port range 1024-65535\00"
@str.21 = [63 x i8] c"server : invalid command token 3 : Expected <CRLF> termination\00"
define i32 @tokenizedCommandHandler(i32 %0, i8** nocapture %1) {
switch i32 %0, label %68 [
i32 3, label %3
i32 4, label %32
]
3: ; preds = %2
%4 = load i8*, i8** %1
%5 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.19, i64 0, i64 0))
%9 = load i8*, i8** %1
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %3, %7
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32 @atoi(i8* %13)
%15 = add i32 %14, -1021
%16 = icmp ult i32 %15, 64514
br i1 %16, label %20, label %17
17: ; preds = %11
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.20, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %14)
br label %20
20: ; preds = %11, %17
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %29, label %25
25: ; preds = %20
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.21, i64 0, i64 0))
%27 = load i8*, i8** %21
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8* %27)
br label %29
29: ; preds = %20, %25
%30 = tail call i8* (...) @getDir()
%31 = tail call i32 @sendDir(i8* %30, i32 %14)
br label %77
32: ; preds = %2
%33 = load i8*, i8** %1
%34 = tail call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %40, label %36
36: ; preds = %32
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.19, i64 0, i64 0))
%38 = load i8*, i8** %1
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %38)
br label %40
40: ; preds = %32, %36
%41 = tail call i8* (...) @getDir()
%42 = getelementptr inbounds i8*, i8** %1, i64 1
%43 = load i8*, i8** %42
%44 = tail call i32* @strstr(i8* dereferenceable(1) %41, i8* dereferenceable(1) %43)
%45 = icmp eq i32* %44, null
br i1 %45, label %46, label %50
46: ; preds = %40
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.16, i64 0, i64 0))
%48 = load i8*, i8** %42
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i8* %48)
br label %50
50: ; preds = %40, %46
%51 = getelementptr inbounds i8*, i8** %1, i64 2
%52 = load i8*, i8** %51
%53 = tail call i32 @atoi(i8* %52)
%54 = add i32 %53, -1021
%55 = icmp ult i32 %54, 64514
br i1 %55, label %59, label %56
56: ; preds = %50
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.17, i64 0, i64 0))
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %53)
br label %59
59: ; preds = %50, %56
%60 = getelementptr inbounds i8*, i8** %1, i64 3
%61 = load i8*, i8** %60
%62 = tail call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %72
64: ; preds = %59
br i1 %45, label %76, label %65
65: ; preds = %64
%66 = load i8*, i8** %42
%67 = tail call i32 @sendFile(i8* %66, i32 %53)
br label %77
68: ; preds = %2
%69 = icmp sgt i32 %0, 4
br i1 %69, label %70, label %76
70: ; preds = %68
%71 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
br label %76
72: ; preds = %59
%73 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.18, i64 0, i64 0))
%74 = load i8*, i8** %60
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i8* %74)
br i1 %45, label %76, label %77
76: ; preds = %64, %68, %70, %72
br label %77
77: ; preds = %65, %29, %72, %76
%78 = phi i32 [ -1, %76 ], [ 0, %72 ], [ 0, %29 ], [ 0, %65 ]
ret i32 %78
}