#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 *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncmp(char *, char *, int /*<<< orphan*/);
int help_set(int argc, char **argv) {
  if (argc == 3 && !strncmp(argv[1], "dump", strlen(argv[1])) &&
      (!strcmp(argv[2], "?") || !strncmp(argv[2], "help", strlen(argv[2])))) {
    printf("\n\033[1mset dump [detail|mac|raw|all|off]\033[0m\n"
           "  Set the packet dump flag for this VPC\n"
           "    detail  print protocol\n"
           "    mac     print ether address\n"
           "    raw     print the first 40 bytes\n"
           "    all     all the packets including incoming\n"
           "            must use [detail|mac|raw] as well as 'all'\n"
           "    off     clear all the flags\n");
    return 1;
  }
  if (argc == 3 && !strncmp(argv[1], "echo", strlen(argv[1])) &&
      (!strcmp(argv[2], "?") || !strncmp(argv[2], "help", strlen(argv[2])))) {
    printf("\n\033[1mset echo [on|off]\033[0m\n"
           "  Sets the state of the echo flag used when loading script files.\n"
           "  See \033[1mload [filename]\033[0m.\n");
    return 1;
  }
  printf("\n\033[1mset [lport|rport|rhost|pcname|echo|dump|]\033[0m\n"
         "  Set hostname, connection port, dump options and echo on or off\n"
         "    lport <port>    local port\n"
         "    rport <port>    remote peer port\n"
         "    rhost <ip>      remote peer host IPv4 address\n"
         "    pcname <name>   set the hostname of the current VPC\n"
         "    echo [on|off]   set echoing on or off during script execution\n"
         "    dump [options]  set the packet dump flag for this VPC. \n"
         "                    Options:\n"
         "                      detail  print protocol\n"
         "                      mac     print ether address\n"
         "                      raw     print the first 40 bytes\n"
         "                      all     all the packets including incoming.\n"
         "                              must use [detail|mac|raw] as well as "
         "'all'\n"
         "                      off     clear all the flag\n");
  return 1;
}


x86 assembly (clang, -O0):
<help_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    11f6 <help_set+0xb6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
lea    0xe81(%rip),%rsi
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11f6 <help_set+0xb6>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe69(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     11de <help_set+0x9e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%edx
lea    0xe37(%rip),%rsi
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11f6 <help_set+0xb6>
lea    0xe27(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12b0 <help_set+0x170>
cmpl   $0x3,-0x8(%rbp)
jne    129d <help_set+0x15d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%edx
lea    0xf20(%rip),%rsi
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    129d <help_set+0x15d>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdc2(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     1285 <help_set+0x145>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%edx
lea    0xd90(%rip),%rsi
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    129d <help_set+0x15d>
lea    0xebf(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12b0 <help_set+0x170>
lea    0xf24(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_set>:
push   %r15
push   %r14
push   %rbx
cmp    $0x3,%edi
jne    118f <help_set+0x4f>
mov    %rsi,%r14
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0xea0(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     11a9 <help_set+0x69>
mov    0x8(%r14),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0xe8b(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     11e6 <help_set+0xa6>
lea    0xe7b(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x10(%r14),%r15
lea    0xe51(%rip),%rsi
mov    %r15,%rdi
call   1060 <strcmp@plt>
lea    0x11d9(%rip),%rbx
test   %eax,%eax
je     1196 <help_set+0x56>
mov    %r15,%rdi
call   1050 <strlen@plt>
lea    0xe31(%rip),%rsi
mov    %r15,%rdi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    116e <help_set+0x2e>
jmp    1196 <help_set+0x56>
mov    0x10(%r14),%r14
lea    0xe14(%rip),%rsi
mov    %r14,%rdi
call   1060 <strcmp@plt>
lea    0x1120(%rip),%rbx
test   %eax,%eax
je     1196 <help_set+0x56>
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    0xdf4(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    118f <help_set+0x4f>
jmp    1196 <help_set+0x56>

LLVM IR (-O0):
@.str = [5 x i8] c"dump\00"
@.str.1 = [2 x i8] c"?\00"
@.str.2 = [5 x i8] c"help\00"
@.str.3 = [314 x i8] c"\0A\1B[1mset dump [detail|mac|raw|all|off]\1B[0m\0A Set the packet dump flag for this VPC\0A detail print protocol\0A mac print ether address\0A raw print the first 40 bytes\0A all all the packets including incoming\0A must use [detail|mac|raw] as well as 'all'\0A off clear all the flags\0A\00"
@.str.4 = [5 x i8] c"echo\00"
@.str.5 = [125 x i8] c"\0A\1B[1mset echo [on|off]\1B[0m\0A Sets the state of the echo flag used when loading script files.\0A See \1B[1mload [filename]\1B[0m.\0A\00"
@.str.6 = [784 x i8] c"\0A\1B[1mset [lport|rport|rhost|pcname|echo|dump|]\1B[0m\0A Set hostname, connection port, dump options and echo on or off\0A lport <port> local port\0A rport <port> remote peer port\0A rhost <ip> remote peer host IPv4 address\0A pcname <name> set the hostname of the current VPC\0A echo [on|off] set echoing on or off during script execution\0A dump [options] set the packet dump flag for this VPC. \0A Options:\0A detail print protocol\0A mac print ether address\0A raw print the first 40 bytes\0A all all the packets including incoming.\0A must use [detail|mac|raw] as well as 'all'\0A off clear all the flag\0A\00"
define i32 @help_set(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 3
br i1 %7, label %8, label %36
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @strlen(i8* %14)
%16 = call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %36, label %18
18: ; preds = %8
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 2
%21 = load i8*, i8** %20
%22 = call i32 @strcmp(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %34
24: ; preds = %18
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i32 @strlen(i8* %30)
%32 = call i32 @strncmp(i8* %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %31)
%33 = icmp ne i32 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %24, %18
%35 = call i32 @printf(i8* getelementptr inbounds ([314 x i8], [314 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %69
36: ; preds = %24, %8, %2
%37 = load i32, i32* %4
%38 = icmp eq i32 %37, 3
br i1 %38, label %39, label %67
39: ; preds = %36
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 1
%45 = load i8*, i8** %44
%46 = call i32 @strlen(i8* %45)
%47 = call i32 @strncmp(i8* %42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %46)
%48 = icmp ne i32 %47, 0
br i1 %48, label %67, label %49
49: ; preds = %39
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 2
%52 = load i8*, i8** %51
%53 = call i32 @strcmp(i8* %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%54 = icmp ne i32 %53, 0
br i1 %54, label %55, label %65
55: ; preds = %49
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 2
%58 = load i8*, i8** %57
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 2
%61 = load i8*, i8** %60
%62 = call i32 @strlen(i8* %61)
%63 = call i32 @strncmp(i8* %58, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %62)
%64 = icmp ne i32 %63, 0
br i1 %64, label %67, label %65
65: ; preds = %55, %49
%66 = call i32 @printf(i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %3
br label %69
67: ; preds = %55, %39, %36
%68 = call i32 @printf(i8* getelementptr inbounds ([784 x i8], [784 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %69
69: ; preds = %67, %65, %34
%70 = load i32, i32* %3
ret i32 %70
}

LLVM IR (-O2):
@.str = [5 x i8] c"dump\00"
@.str.1 = [2 x i8] c"?\00"
@.str.2 = [5 x i8] c"help\00"
@.str.4 = [5 x i8] c"echo\00"
@str = [783 x i8] c"\0A\1B[1mset [lport|rport|rhost|pcname|echo|dump|]\1B[0m\0A Set hostname, connection port, dump options and echo on or off\0A lport <port> local port\0A rport <port> remote peer port\0A rhost <ip> remote peer host IPv4 address\0A pcname <name> set the hostname of the current VPC\0A echo [on|off] set echoing on or off during script execution\0A dump [options] set the packet dump flag for this VPC. \0A Options:\0A detail print protocol\0A mac print ether address\0A raw print the first 40 bytes\0A all all the packets including incoming.\0A must use [detail|mac|raw] as well as 'all'\0A off clear all the flag\00"
@str.7 = [124 x i8] c"\0A\1B[1mset echo [on|off]\1B[0m\0A Sets the state of the echo flag used when loading script files.\0A See \1B[1mload [filename]\1B[0m.\00"
@str.8 = [313 x i8] c"\0A\1B[1mset dump [detail|mac|raw|all|off]\1B[0m\0A Set the packet dump flag for this VPC\0A detail print protocol\0A mac print ether address\0A raw print the first 40 bytes\0A all all the packets including incoming\0A must use [detail|mac|raw] as well as 'all'\0A off clear all the flags\00"
define i32 @help_set(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %33
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strlen(i8* %6)
%8 = tail call i32 @strncmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %4
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %34, label %15
15: ; preds = %10
%16 = tail call i32 @strlen(i8* %12)
%17 = tail call i32 @strncmp(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = icmp eq i32 %17, 0
br i1 %18, label %34, label %19
19: ; preds = %4, %15
%20 = load i8*, i8** %5
%21 = tail call i32 @strlen(i8* %20)
%22 = tail call i32 @strncmp(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %21)
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %33
24: ; preds = %19
%25 = getelementptr inbounds i8*, i8** %1, i64 2
%26 = load i8*, i8** %25
%27 = tail call i32 @strcmp(i8* dereferenceable(1) %26, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
br i1 %28, label %34, label %29
29: ; preds = %24
%30 = tail call i32 @strlen(i8* %26)
%31 = tail call i32 @strncmp(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%32 = icmp eq i32 %31, 0
br i1 %32, label %34, label %33
33: ; preds = %2, %29, %19
br label %34
34: ; preds = %24, %29, %10, %15, %33
%35 = phi i8* [ getelementptr inbounds ([783 x i8], [783 x i8]* @str, i64 0, i64 0), %33 ], [ getelementptr inbounds ([313 x i8], [313 x i8]* @str.8, i64 0, i64 0), %15 ], [ getelementptr inbounds ([313 x i8], [313 x i8]* @str.8, i64 0, i64 0), %10 ], [ getelementptr inbounds ([124 x i8], [124 x i8]* @str.7, i64 0, i64 0), %29 ], [ getelementptr inbounds ([124 x i8], [124 x i8]* @str.7, i64 0, i64 0), %24 ]
%36 = tail call i32 @puts(i8* dereferenceable(1) %35)
ret i32 1
}