#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 getopt(int, char *const *, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ run_n_server();
int main(int argc, char *const *argv) {
  int n;
  if (argc != 2) {
    puts("./main [option]\n");
    return -1;
  }
  while ((n = getopt(argc, argv, "cnh")) != -1) {
    switch (n) {
    case 'c':
      break;
    case 'n':
      run_n_server();
      break;
    case 'h':
      puts("-----------------------------\n");
      puts("-c option for normal chatting\n");
      puts("-n option for crypto chatting\n");
      puts("-----------------------------\n");
      break;
    default:
      puts("either -c or -n options please,\n");
      puts("any helps? -h option please,\n");
      puts("many thanks :)\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1168 <main+0x38>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1238 <main+0x108>
jmp    116d <main+0x3d>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe96(%rip),%rdx
call   1050 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1231 <main+0x101>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x63,%eax
je     11c2 <main+0x92>
jmp    11a0 <main+0x70>
mov    -0x18(%rbp),%eax
sub    $0x68,%eax
je     11d3 <main+0xa3>
jmp    11b1 <main+0x81>
mov    -0x18(%rbp),%eax
sub    $0x6e,%eax
je     11c7 <main+0x97>
jmp    1208 <main+0xd8>
jmp    122c <main+0xfc>
mov    $0x0,%al
call   1040 <run_n_server@plt>
jmp    122c <main+0xfc>
lea    0xe3b(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe61(%rip),%rdi
call   1030 <puts@plt>
lea    0xe17(%rip),%rdi
call   1030 <puts@plt>
jmp    122c <main+0xfc>
lea    0xe63(%rip),%rdi
call   1030 <puts@plt>
lea    0xe78(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8a(%rip),%rdi
call   1030 <puts@plt>
jmp    116d <main+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    11ec <main+0xbc>
mov    %rsi,%rbx
lea    0xec3(%rip),%r14
lea    0xf5c(%rip),%r13
lea    0xeb9(%rip),%rbp
lea    0xed1(%rip),%r15
lea    0xee9(%rip),%r12
jmp    1190 <main+0x60>
nopl   0x0(%rax)
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <getopt@plt>
cmp    $0x67,%eax
jle    11c0 <main+0x90>
cmp    $0x68,%eax
je     1170 <main+0x40>
cmp    $0x6e,%eax
jne    11ca <main+0x9a>
xor    %eax,%eax
call   1040 <run_n_server@plt>
jmp    1190 <main+0x60>
nopl   0x0(%rax,%rax,1)
cmp    $0x63,%eax
je     1190 <main+0x60>
cmp    $0xffffffff,%eax
je     11ff <main+0xcf>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
jmp    1190 <main+0x60>
lea    0xe0d(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
jmp    1201 <main+0xd1>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"./main [option]\0A\00"
@.str.1 = [4 x i8] c"cnh\00"
@.str.2 = [31 x i8] c"-----------------------------\0A\00"
@.str.3 = [31 x i8] c"-c option for normal chatting\0A\00"
@.str.4 = [31 x i8] c"-n option for crypto chatting\0A\00"
@.str.5 = [33 x i8] c"either -c or -n options please,\0A\00"
@.str.6 = [30 x i8] c"any helps? -h option please,\0A\00"
@.str.7 = [16 x i8] c"many thanks :)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %33
11: ; preds = %2
br label %12
12: ; preds = %31, %11
%13 = load i32, i32* %4
%14 = load i8**, i8*** %5
%15 = call i32 @getopt(i32 %13, i8** %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 %15, i32* %6
%16 = icmp ne i32 %15, -1
br i1 %16, label %17, label %32
17: ; preds = %12
%18 = load i32, i32* %6
switch i32 %18, label %27 [
i32 99, label %19
i32 110, label %20
i32 104, label %22
]
19: ; preds = %17
br label %31
20: ; preds = %17
%21 = call i32 (...) @run_n_server()
br label %31
22: ; preds = %17
%23 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%25 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%26 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %31
27: ; preds = %17
%28 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%29 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%30 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
br label %31
31: ; preds = %27, %22, %20, %19
br label %12
32: ; preds = %12
store i32 0, i32* %3
br label %33
33: ; preds = %32, %9
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
@.str = [17 x i8] c"./main [option]\0A\00"
@.str.1 = [4 x i8] c"cnh\00"
@.str.2 = [31 x i8] c"-----------------------------\0A\00"
@.str.3 = [31 x i8] c"-c option for normal chatting\0A\00"
@.str.4 = [31 x i8] c"-n option for crypto chatting\0A\00"
@.str.5 = [33 x i8] c"either -c or -n options please,\0A\00"
@.str.6 = [30 x i8] c"any helps? -h option please,\0A\00"
@.str.7 = [16 x i8] c"many thanks :)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %20
6: ; preds = %2, %8
%7 = tail call i32 @getopt(i32 2, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
switch i32 %7, label %16 [
i32 -1, label %20
i32 99, label %8
i32 110, label %9
i32 104, label %11
]
8: ; preds = %6, %16, %11, %9
br label %6
9: ; preds = %6
%10 = tail call i32 (...) @run_n_server()
br label %8
11: ; preds = %6
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %8
16: ; preds = %6
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
br label %8
20: ; preds = %6, %4
%21 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %21
}