#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 /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
scalar_t__ strncmp(char *, char *, int);
void ftphelp(char *prompt) {
  if (prompt == NULL) {
    printf("Usage:\nget [FILENAME]\nput [FILENAME]\npwd\ndir\nls\ncd "
           "[PATH]\n?\nquit\n");
    fflush(stdout);
    return;
  }
  if (strncmp(prompt, "get", 3) == 0) {
    printf("Usage:\nget [Remote-path-to-file]\n");
    fflush(stdout);
  } else if (strncmp(prompt, "put", 3) == 0) {
    printf("Usage:\nput [Local-path-to-file]\n");
    fflush(stdout);
  } else if (strncmp(prompt, "pwd", 3) == 0) {
    printf("Usage:\npwd\n");
    fflush(stdout);
  } else if (strncmp(prompt, "dir", 3) == 0) {
    printf("Usage:\ndir\n");
    fflush(stdout);
  } else if (strncmp(prompt, "cd", 2) == 0) {
    printf("Usage:\ncd [Remote-path-to-folder]\n");
    fflush(stdout);
  } else if (strncmp(prompt, "?", 1) == 0) {
    printf("Usage:\n? [Command-name]\n");
    fflush(stdout);
  } else if (strncmp(prompt, "quit", 4) == 0) {
    printf("Usage:\nquit\n");
    fflush(stdout);
  } else {
    printf("Usage:\nget [FILENAME]\nput [FILENAME]\npwd\ndir\nls\ncd "
           "[PATH]\n?\nquit\n");
    fflush(stdout);
  }
  return;
}


x86 assembly (clang, -O0):
<ftphelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1166 <ftphelp+0x36>
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    1355 <ftphelp+0x225>
mov    -0x8(%rbp),%rdi
lea    0xed1(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11a4 <ftphelp+0x74>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    1350 <ftphelp+0x220>
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11e2 <ftphelp+0xb2>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    134b <ftphelp+0x21b>
mov    -0x8(%rbp),%rdi
lea    0xea0(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1220 <ftphelp+0xf0>
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
mov    0x2dcc(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    1346 <ftphelp+0x216>
mov    -0x8(%rbp),%rdi
lea    0xe72(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    125e <ftphelp+0x12e>
lea    0xe5b(%rip),%rdi
call   1040 <printf@plt>
mov    0x2d8e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    1341 <ftphelp+0x211>
mov    -0x8(%rbp),%rdi
lea    0xe44(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    129c <ftphelp+0x16c>
lea    0xe2c(%rip),%rdi
call   1040 <printf@plt>
mov    0x2d50(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    133c <ftphelp+0x20c>
mov    -0x8(%rbp),%rdi
lea    0xe2c(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    12da <ftphelp+0x1aa>
lea    0xe13(%rip),%rdi
call   1040 <printf@plt>
mov    0x2d12(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    1337 <ftphelp+0x207>
mov    -0x8(%rbp),%rdi
lea    0xe09(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1318 <ftphelp+0x1e8>
lea    0xdf3(%rip),%rdi
call   1040 <printf@plt>
mov    0x2cd4(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    1332 <ftphelp+0x202>
lea    0xce1(%rip),%rdi
call   1040 <printf@plt>
mov    0x2cb5(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    1337 <ftphelp+0x207>
jmp    133c <ftphelp+0x20c>
jmp    1341 <ftphelp+0x211>
jmp    1346 <ftphelp+0x216>
jmp    134b <ftphelp+0x21b>
jmp    1350 <ftphelp+0x220>
jmp    1355 <ftphelp+0x225>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftphelp>:
push   %rbx
test   %rdi,%rdi
je     120b <ftphelp+0xdb>
mov    %rdi,%rbx
lea    0xebc(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1214 <ftphelp+0xe4>
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     121d <ftphelp+0xed>
lea    0xeea(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1226 <ftphelp+0xf6>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     122f <ftphelp+0xff>
lea    0xe53(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1238 <ftphelp+0x108>
lea    0xe3d(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1241 <ftphelp+0x111>
lea    0xe2d(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
lea    0xe0f(%rip),%rax
lea    0xea5(%rip),%rdi
cmove  %rax,%rdi
jmp    1248 <ftphelp+0x118>
lea    0xe98(%rip),%rdi
jmp    1248 <ftphelp+0x118>
lea    0xe6e(%rip),%rdi
jmp    1248 <ftphelp+0x118>
lea    0xe45(%rip),%rdi
jmp    1248 <ftphelp+0x118>
lea    0xe31(%rip),%rdi
jmp    1248 <ftphelp+0x118>
lea    0xe1d(%rip),%rdi
jmp    1248 <ftphelp+0x118>
lea    0xdf2(%rip),%rdi
jmp    1248 <ftphelp+0x118>
lea    0xdd1(%rip),%rdi
call   1040 <puts@plt>
mov    0x2d8c(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@.str = [66 x i8] c"Usage:\0Aget [FILENAME]\0Aput [FILENAME]\0Apwd\0Adir\0Als\0Acd [PATH]\0A?\0Aquit\0A\00"
@stdout = global i32 0
@.str.1 = [4 x i8] c"get\00"
@.str.2 = [34 x i8] c"Usage:\0Aget [Remote-path-to-file]\0A\00"
@.str.3 = [4 x i8] c"put\00"
@.str.4 = [33 x i8] c"Usage:\0Aput [Local-path-to-file]\0A\00"
@.str.5 = [4 x i8] c"pwd\00"
@.str.6 = [12 x i8] c"Usage:\0Apwd\0A\00"
@.str.7 = [4 x i8] c"dir\00"
@.str.8 = [12 x i8] c"Usage:\0Adir\0A\00"
@.str.9 = [3 x i8] c"cd\00"
@.str.10 = [35 x i8] c"Usage:\0Acd [Remote-path-to-folder]\0A\00"
@.str.11 = [2 x i8] c"?\00"
@.str.12 = [25 x i8] c"Usage:\0A? [Command-name]\0A\00"
@.str.13 = [5 x i8] c"quit\00"
@.str.14 = [13 x i8] c"Usage:\0Aquit\0A\00"
define void @ftphelp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
br label %76
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i64 @strncmp(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* @stdout
%16 = call i32 @fflush(i32 %15)
br label %75
17: ; preds = %9
%18 = load i8*, i8** %2
%19 = call i64 @strncmp(i8* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%23 = load i32, i32* @stdout
%24 = call i32 @fflush(i32 %23)
br label %74
25: ; preds = %17
%26 = load i8*, i8** %2
%27 = call i64 @strncmp(i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 3)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%31 = load i32, i32* @stdout
%32 = call i32 @fflush(i32 %31)
br label %73
33: ; preds = %25
%34 = load i8*, i8** %2
%35 = call i64 @strncmp(i8* %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 3)
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %41
37: ; preds = %33
%38 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%39 = load i32, i32* @stdout
%40 = call i32 @fflush(i32 %39)
br label %72
41: ; preds = %33
%42 = load i8*, i8** %2
%43 = call i64 @strncmp(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32 2)
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %41
%46 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0))
%47 = load i32, i32* @stdout
%48 = call i32 @fflush(i32 %47)
br label %71
49: ; preds = %41
%50 = load i8*, i8** %2
%51 = call i64 @strncmp(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i32 1)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %57
53: ; preds = %49
%54 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0))
%55 = load i32, i32* @stdout
%56 = call i32 @fflush(i32 %55)
br label %70
57: ; preds = %49
%58 = load i8*, i8** %2
%59 = call i64 @strncmp(i8* %58, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i32 4)
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %65
61: ; preds = %57
%62 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0))
%63 = load i32, i32* @stdout
%64 = call i32 @fflush(i32 %63)
br label %69
65: ; preds = %57
%66 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%67 = load i32, i32* @stdout
%68 = call i32 @fflush(i32 %67)
br label %69
69: ; preds = %65, %61
br label %70
70: ; preds = %69, %53
br label %71
71: ; preds = %70, %45
br label %72
72: ; preds = %71, %37
br label %73
73: ; preds = %72, %29
br label %74
74: ; preds = %73, %21
br label %75
75: ; preds = %74, %13
br label %76
76: ; preds = %75, %5
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str.1 = [4 x i8] c"get\00"
@.str.3 = [4 x i8] c"put\00"
@.str.5 = [4 x i8] c"pwd\00"
@.str.7 = [4 x i8] c"dir\00"
@.str.9 = [3 x i8] c"cd\00"
@.str.11 = [2 x i8] c"?\00"
@.str.13 = [5 x i8] c"quit\00"
@str.15 = [12 x i8] c"Usage:\0Aquit\00"
@str.16 = [24 x i8] c"Usage:\0A? [Command-name]\00"
@str.17 = [34 x i8] c"Usage:\0Acd [Remote-path-to-folder]\00"
@str.18 = [11 x i8] c"Usage:\0Adir\00"
@str.19 = [11 x i8] c"Usage:\0Apwd\00"
@str.20 = [32 x i8] c"Usage:\0Aput [Local-path-to-file]\00"
@str.21 = [33 x i8] c"Usage:\0Aget [Remote-path-to-file]\00"
@str.22 = [65 x i8] c"Usage:\0Aget [FILENAME]\0Aput [FILENAME]\0Apwd\0Adir\0Als\0Acd [PATH]\0A?\0Aquit\00"
define void @ftphelp(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %25, label %3
3: ; preds = %1
%4 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %25, label %6
6: ; preds = %3
%7 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %25, label %9
9: ; preds = %6
%10 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 3)
%11 = icmp eq i64 %10, 0
br i1 %11, label %25, label %12
12: ; preds = %9
%13 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 3)
%14 = icmp eq i64 %13, 0
br i1 %14, label %25, label %15
15: ; preds = %12
%16 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32 2)
%17 = icmp eq i64 %16, 0
br i1 %17, label %25, label %18
18: ; preds = %15
%19 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i32 1)
%20 = icmp eq i64 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %18
%22 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i32 4)
%23 = icmp eq i64 %22, 0
%24 = select i1 %23, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.15, i64 0, i64 0), i8* getelementptr inbounds ([65 x i8], [65 x i8]* @str.22, i64 0, i64 0)
br label %25
25: ; preds = %21, %18, %15, %12, %9, %6, %3, %1
%26 = phi i8* [ getelementptr inbounds ([65 x i8], [65 x i8]* @str.22, i64 0, i64 0), %1 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @str.21, i64 0, i64 0), %3 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @str.20, i64 0, i64 0), %6 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @str.19, i64 0, i64 0), %9 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @str.18, i64 0, i64 0), %12 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @str.17, i64 0, i64 0), %15 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @str.16, i64 0, i64 0), %18 ], [ %24, %21 ]
%27 = tail call i32 @puts(i8* dereferenceable(1) %26)
%28 = load i32, i32* @stdout
%29 = tail call i32 @fflush(i32 %28)
ret void
}