#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*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int ftp_help(char **params, int cnt) {
  if (cnt == 1)
    printf("cd\tget\thelp\topen\tput\npwd\tquit\trget\trput\n");
  if (cnt > 1) {
    if (strcmp(params[1], "cd") == 0)
      printf("cd\tchange remote working directory\n");
    else if (strcmp(params[1], "get") == 0)
      printf("get\treceive file\n");
    else if (strcmp(params[1], "put") == 0)
      printf("put\tsend one file\n");
    else if (strcmp(params[1], "pwd") == 0)
      printf("pwd\tprint working directory on remote machine\n");
    else if (strcmp(params[1], "quit") == 0)
      printf("quit\tterminate ftp session and quit\n");
    else if (strcmp(params[1], "rget") == 0)
      printf("rget\treceive directory\n");
    else if (strcmp(params[1], "rput") == 0)
      printf("rput\tsend one directory\n");
    else if (strcmp(params[1], "help") == 0)
      printf("help\tprint local help information\n");
    else if (strcmp(params[1], "open") == 0)
      printf("open\tconnect to remote ftp\n");
    else
      printf("%s\tunknown command\n", params[1]);
  }
}


x86 assembly (clang, -O0):
<ftp_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1147 <ftp_help+0x27>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x14(%rbp)
jle    134d <ftp_help+0x22d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1182 <ftp_help+0x62>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1348 <ftp_help+0x228>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xf42(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11b3 <ftp_help+0x93>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1343 <ftp_help+0x223>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xf2e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11e4 <ftp_help+0xc4>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    133e <ftp_help+0x21e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe82(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1215 <ftp_help+0xf5>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1339 <ftp_help+0x219>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe84(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1246 <ftp_help+0x126>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1334 <ftp_help+0x214>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe7d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1277 <ftp_help+0x157>
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    132f <ftp_help+0x20f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe69(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12a8 <ftp_help+0x188>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    132a <ftp_help+0x20a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe56(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12d9 <ftp_help+0x1b9>
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1325 <ftp_help+0x205>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe4d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    130a <ftp_help+0x1ea>
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1320 <ftp_help+0x200>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1325 <ftp_help+0x205>
jmp    132a <ftp_help+0x20a>
jmp    132f <ftp_help+0x20f>
jmp    1334 <ftp_help+0x214>
jmp    1339 <ftp_help+0x219>
jmp    133e <ftp_help+0x21e>
jmp    1343 <ftp_help+0x223>
jmp    1348 <ftp_help+0x228>
jmp    134d <ftp_help+0x22d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftp_help>:
push   %rbx
cmp    $0x1,%esi
jne    1144 <ftp_help+0x14>
lea    0xff1(%rip),%rdi
call   1030 <puts@plt>
pop    %rbx
ret
jle    1238 <ftp_help+0x108>
mov    %rdi,%rbx
mov    0x8(%rdi),%rdi
lea    0xea8(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     123a <ftp_help+0x10a>
mov    0x8(%rbx),%rdi
lea    0xe97(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1246 <ftp_help+0x116>
mov    0x8(%rbx),%rdi
lea    0xfc8(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1252 <ftp_help+0x122>
mov    0x8(%rbx),%rdi
lea    0xe60(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     125e <ftp_help+0x12e>
mov    0x8(%rbx),%rdi
lea    0xef9(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     126a <ftp_help+0x13a>
mov    0x8(%rbx),%rdi
lea    0xe32(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1276 <ftp_help+0x146>
mov    0x8(%rbx),%rdi
lea    0xf63(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1282 <ftp_help+0x152>
mov    0x8(%rbx),%rdi
lea    0xe05(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     128e <ftp_help+0x15e>
mov    0x8(%rbx),%rdi
lea    0xdf5(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     129a <ftp_help+0x16a>
mov    0x8(%rbx),%rsi
lea    0xde5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rbx
ret
lea    0xeca(%rip),%rdi
jmp    113d <ftp_help+0xd>
lea    0xead(%rip),%rdi
jmp    113d <ftp_help+0xd>
lea    0xe8f(%rip),%rdi
jmp    113d <ftp_help+0xd>
lea    0xe55(%rip),%rdi
jmp    113d <ftp_help+0xd>
lea    0xe25(%rip),%rdi
jmp    113d <ftp_help+0xd>
lea    0xe02(%rip),%rdi
jmp    113d <ftp_help+0xd>
lea    0xdde(%rip),%rdi
jmp    113d <ftp_help+0xd>
lea    0xdb0(%rip),%rdi
jmp    113d <ftp_help+0xd>
lea    0xd89(%rip),%rdi
jmp    113d <ftp_help+0xd>

LLVM IR (-O0):
@.str = [41 x i8] c"cd\09get\09help\09open\09put\0Apwd\09quit\09rget\09rput\0A\00"
@.str.1 = [3 x i8] c"cd\00"
@.str.2 = [36 x i8] c"cd\09change remote working directory\0A\00"
@.str.3 = [4 x i8] c"get\00"
@.str.4 = [18 x i8] c"get\09receive file\0A\00"
@.str.5 = [4 x i8] c"put\00"
@.str.6 = [19 x i8] c"put\09send one file\0A\00"
@.str.7 = [4 x i8] c"pwd\00"
@.str.8 = [47 x i8] c"pwd\09print working directory on remote machine\0A\00"
@.str.9 = [5 x i8] c"quit\00"
@.str.10 = [37 x i8] c"quit\09terminate ftp session and quit\0A\00"
@.str.11 = [5 x i8] c"rget\00"
@.str.12 = [24 x i8] c"rget\09receive directory\0A\00"
@.str.13 = [5 x i8] c"rput\00"
@.str.14 = [25 x i8] c"rput\09send one directory\0A\00"
@.str.15 = [5 x i8] c"help\00"
@.str.16 = [35 x i8] c"help\09print local help information\0A\00"
@.str.17 = [5 x i8] c"open\00"
@.str.18 = [28 x i8] c"open\09connect to remote ftp\0A\00"
@.str.19 = [20 x i8] c"%s\09unknown command\0A\00"
define i32 @ftp_help(i8** %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i32, i32* %5
%12 = icmp sgt i32 %11, 1
br i1 %12, label %13, label %99
13: ; preds = %10
%14 = load i8**, i8*** %4
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
br label %98
21: ; preds = %13
%22 = load i8**, i8*** %4
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %21
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
br label %97
29: ; preds = %21
%30 = load i8**, i8*** %4
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %29
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
br label %96
37: ; preds = %29
%38 = load i8**, i8*** %4
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %37
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0))
br label %95
45: ; preds = %37
%46 = load i8**, i8*** %4
%47 = getelementptr inbounds i8*, i8** %46, i64 1
%48 = load i8*, i8** %47
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %45
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
br label %94
53: ; preds = %45
%54 = load i8**, i8*** %4
%55 = getelementptr inbounds i8*, i8** %54, i64 1
%56 = load i8*, i8** %55
%57 = call i64 @strcmp(i8* %56, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %53
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0))
br label %93
61: ; preds = %53
%62 = load i8**, i8*** %4
%63 = getelementptr inbounds i8*, i8** %62, i64 1
%64 = load i8*, i8** %63
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %61
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.14, i64 0, i64 0))
br label %92
69: ; preds = %61
%70 = load i8**, i8*** %4
%71 = getelementptr inbounds i8*, i8** %70, i64 1
%72 = load i8*, i8** %71
%73 = call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %77
75: ; preds = %69
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.16, i64 0, i64 0))
br label %91
77: ; preds = %69
%78 = load i8**, i8*** %4
%79 = getelementptr inbounds i8*, i8** %78, i64 1
%80 = load i8*, i8** %79
%81 = call i64 @strcmp(i8* %80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %85
83: ; preds = %77
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.18, i64 0, i64 0))
br label %90
85: ; preds = %77
%86 = load i8**, i8*** %4
%87 = getelementptr inbounds i8*, i8** %86, i64 1
%88 = load i8*, i8** %87
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.19, i64 0, i64 0), i8* %88)
br label %90
90: ; preds = %85, %83
br label %91
91: ; preds = %90, %75
br label %92
92: ; preds = %91, %67
br label %93
93: ; preds = %92, %59
br label %94
94: ; preds = %93, %51
br label %95
95: ; preds = %94, %43
br label %96
96: ; preds = %95, %35
br label %97
97: ; preds = %96, %27
br label %98
98: ; preds = %97, %19
br label %99
99: ; preds = %98, %10
%100 = load i32, i32* %3
ret i32 %100
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"cd\00"
@.str.3 = [4 x i8] c"get\00"
@.str.5 = [4 x i8] c"put\00"
@.str.7 = [4 x i8] c"pwd\00"
@.str.9 = [5 x i8] c"quit\00"
@.str.11 = [5 x i8] c"rget\00"
@.str.13 = [5 x i8] c"rput\00"
@.str.15 = [5 x i8] c"help\00"
@.str.17 = [5 x i8] c"open\00"
@.str.19 = [20 x i8] c"%s\09unknown command\0A\00"
@str = [27 x i8] c"open\09connect to remote ftp\00"
@str.20 = [34 x i8] c"help\09print local help information\00"
@str.21 = [24 x i8] c"rput\09send one directory\00"
@str.22 = [23 x i8] c"rget\09receive directory\00"
@str.23 = [36 x i8] c"quit\09terminate ftp session and quit\00"
@str.24 = [46 x i8] c"pwd\09print working directory on remote machine\00"
@str.25 = [18 x i8] c"put\09send one file\00"
@str.26 = [17 x i8] c"get\09receive file\00"
@str.27 = [35 x i8] c"cd\09change remote working directory\00"
@str.28 = [40 x i8] c"cd\09get\09help\09open\09put\0Apwd\09quit\09rget\09rput\00"
define i32 @ftp_help(i8** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.28, i64 0, i64 0))
br label %66
6: ; preds = %2
%7 = icmp sgt i32 %1, 1
br i1 %7, label %8, label %66
8: ; preds = %6
%9 = getelementptr inbounds i8*, i8** %0, i64 1
%10 = load i8*, i8** %9
%11 = tail call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.27, i64 0, i64 0))
br label %66
15: ; preds = %8
%16 = load i8*, i8** %9
%17 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.26, i64 0, i64 0))
br label %66
21: ; preds = %15
%22 = load i8*, i8** %9
%23 = tail call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.25, i64 0, i64 0))
br label %66
27: ; preds = %21
%28 = load i8*, i8** %9
%29 = tail call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.24, i64 0, i64 0))
br label %66
33: ; preds = %27
%34 = load i8*, i8** %9
%35 = tail call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.23, i64 0, i64 0))
br label %66
39: ; preds = %33
%40 = load i8*, i8** %9
%41 = tail call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.22, i64 0, i64 0))
br label %66
45: ; preds = %39
%46 = load i8*, i8** %9
%47 = tail call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.21, i64 0, i64 0))
br label %66
51: ; preds = %45
%52 = load i8*, i8** %9
%53 = tail call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.20, i64 0, i64 0))
br label %66
57: ; preds = %51
%58 = load i8*, i8** %9
%59 = tail call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %57
%62 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %66
63: ; preds = %57
%64 = load i8*, i8** %9
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.19, i64 0, i64 0), i8* %64)
br label %66
66: ; preds = %4, %13, %25, %37, %49, %61, %63, %55, %43, %31, %19, %6
ret i32 undef
}