#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*/ _response(char const *);
int /*<<< orphan*/ strcasecmp(char const *, char *);
int /*<<< orphan*/ strlen(char const *);
int do_help(const char *args) {
  const char help[] =
      "214-The following commands are implemented.\r\n"
      "214-USER    QUIT    PASS    SYST    HELP    PORT    PASV    LIST\r\n"
      "214-NLST    RETR    STOR    TYPE    MKD     RMD     DELE    PWD\r\n"
      "214-CWD     SITE    CDUP    RNFR    RNTO    NOOP    NLST\r\n"
      "214 End of list.\r\n";
  const char helpsite[] = "214-The following SITE commands are implemented.\r\n"
                          "214-CHMOD   HELP\r\n"
                          "214 End of list.\r\n";
  const char nohelp[] = "214 There is no help for that command.\r\n";
  if (!strlen(args)) {
    _response(help);
  } else if (!strcasecmp(args, "SITE")) {
    _response(helpsite);
  } else {
    _response(nohelp);
  }
  return 0;
}


x86 assembly (clang, -O0):
<do_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
lea    0xea3(%rip),%rsi
mov    $0xfd,%edx
call   1060 <memcpy@plt>
lea    -0x170(%rbp),%rdi
lea    0xf8b(%rip),%rsi
mov    $0x57,%edx
call   1060 <memcpy@plt>
lea    -0x1a0(%rbp),%rdi
lea    0xfd3(%rip),%rsi
mov    $0x29,%edx
call   1060 <memcpy@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%eax
jne    11ba <do_help+0x7a>
lea    -0x110(%rbp),%rdi
call   1050 <_response@plt>
jmp    11f5 <do_help+0xb5>
mov    -0x8(%rbp),%rdi
lea    0xfc4(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11e4 <do_help+0xa4>
lea    -0x170(%rbp),%rdi
call   1050 <_response@plt>
jmp    11f0 <do_help+0xb0>
lea    -0x1a0(%rbp),%rdi
call   1050 <_response@plt>
jmp    11f5 <do_help+0xb5>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_help>:
push   %r14
push   %rbx
sub    $0x198,%rsp
mov    %rdi,%r14
lea    0x90(%rsp),%rbx
lea    0xea4(%rip),%rsi
mov    $0xfd,%edx
mov    %rbx,%rdi
call   1060 <memcpy@plt>
movaps 0xfd0(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xfb4(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf98(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf7c(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf60(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movabs $0xa0d2e7473696c,%rax
mov    %rax,0x7f(%rsp)
movups 0xfbe(%rip),%xmm0
movups %xmm0,0x19(%rsp)
movaps 0xfa9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xf8d(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %r14,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
je     1200 <do_help+0xc0>
lea    0xf9f(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
lea    0x30(%rsp),%rax
mov    %rsp,%rbx
cmove  %rax,%rbx
mov    %rbx,%rdi
call   1050 <_response@plt>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.do_help.help = [253 x i8] c"214-The following commands are implemented.\0D\0A214-USER QUIT PASS SYST HELP PORT PASV LIST\0D\0A214-NLST RETR STOR TYPE MKD RMD DELE PWD\0D\0A214-CWD SITE CDUP RNFR RNTO NOOP NLST\0D\0A214 End of list.\0D\0A\00"
@__const.do_help.helpsite = [87 x i8] c"214-The following SITE commands are implemented.\0D\0A214-CHMOD HELP\0D\0A214 End of list.\0D\0A\00"
@__const.do_help.nohelp = [41 x i8] c"214 There is no help for that command.\0D\0A\00"
@.str = [5 x i8] c"SITE\00"
define i32 @do_help(i8* %0) {
%2 = alloca i8*
%3 = alloca [253 x i8]
%4 = alloca [87 x i8]
%5 = alloca [41 x i8]
store i8* %0, i8** %2
%6 = bitcast [253 x i8]* %3 to i8*
%7 = bitcast [87 x i8]* %4 to i8*
%8 = bitcast [41 x i8]* %5 to i8*
%9 = load i8*, i8** %2
%10 = call i32 @strlen(i8* %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %1
%13 = getelementptr inbounds [253 x i8], [253 x i8]* %3, i64 0, i64 0
%14 = call i32 @_response(i8* %13)
br label %26
15: ; preds = %1
%16 = load i8*, i8** %2
%17 = call i32 @strcasecmp(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %15
%20 = getelementptr inbounds [87 x i8], [87 x i8]* %4, i64 0, i64 0
%21 = call i32 @_response(i8* %20)
br label %25
22: ; preds = %15
%23 = getelementptr inbounds [41 x i8], [41 x i8]* %5, i64 0, i64 0
%24 = call i32 @_response(i8* %23)
br label %25
25: ; preds = %22, %19
br label %26
26: ; preds = %25, %12
ret i32 0
}

LLVM IR (-O2):
@__const.do_help.help = [253 x i8] c"214-The following commands are implemented.\0D\0A214-USER QUIT PASS SYST HELP PORT PASV LIST\0D\0A214-NLST RETR STOR TYPE MKD RMD DELE PWD\0D\0A214-CWD SITE CDUP RNFR RNTO NOOP NLST\0D\0A214 End of list.\0D\0A\00"
@__const.do_help.helpsite = [87 x i8] c"214-The following SITE commands are implemented.\0D\0A214-CHMOD HELP\0D\0A214 End of list.\0D\0A\00"
@__const.do_help.nohelp = [41 x i8] c"214 There is no help for that command.\0D\0A\00"
@.str = [5 x i8] c"SITE\00"
define i32 @do_help(i8* %0) {
%2 = alloca [253 x i8]
%3 = alloca [87 x i8]
%4 = alloca [41 x i8]
%5 = getelementptr inbounds [253 x i8], [253 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [87 x i8], [87 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [41 x i8], [41 x i8]* %4, i64 0, i64 0
%8 = tail call i32 @strlen(i8* %0)
%9 = icmp eq i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %1
%11 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i8* %6, i8* %7
br label %14
14: ; preds = %10, %1
%15 = phi i8* [ %5, %1 ], [ %13, %10 ]
%16 = call i32 @_response(i8* %15)
ret i32 0
}