#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_c_client();
int /*<<< orphan*/ run_n_client();
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':
      run_c_client();
      break;
    case 'n':
      run_n_client();
      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     1178 <main+0x38>
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    124f <main+0x10f>
jmp    117d <main+0x3d>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe86(%rip),%rdx
call   1060 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1248 <main+0x108>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x63,%eax
je     11d2 <main+0x92>
jmp    11b0 <main+0x70>
mov    -0x18(%rbp),%eax
sub    $0x68,%eax
je     11ea <main+0xaa>
jmp    11c1 <main+0x81>
mov    -0x18(%rbp),%eax
sub    $0x6e,%eax
je     11de <main+0x9e>
jmp    121f <main+0xdf>
mov    $0x0,%al
call   1040 <run_c_client@plt>
jmp    1243 <main+0x103>
mov    $0x0,%al
call   1050 <run_n_client@plt>
jmp    1243 <main+0x103>
lea    0xe24(%rip),%rdi
call   1030 <puts@plt>
lea    0xe37(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe00(%rip),%rdi
call   1030 <puts@plt>
jmp    1243 <main+0x103>
lea    0xe4c(%rip),%rdi
call   1030 <puts@plt>
lea    0xe61(%rip),%rdi
call   1030 <puts@plt>
lea    0xe73(%rip),%rdi
call   1030 <puts@plt>
jmp    117d <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    1205 <main+0xc5>
mov    %rsi,%rbx
lea    0xeb3(%rip),%r14
lea    0xf4c(%rip),%r13
lea    0xea9(%rip),%rbp
lea    0xec1(%rip),%r15
lea    0xed9(%rip),%r12
jmp    11a0 <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   1060 <getopt@plt>
cmp    $0x67,%eax
jle    11d0 <main+0x90>
cmp    $0x68,%eax
je     1180 <main+0x40>
cmp    $0x6e,%eax
jne    11e3 <main+0xa3>
xor    %eax,%eax
call   1050 <run_n_client@plt>
jmp    11a0 <main+0x60>
nopl   0x0(%rax,%rax,1)
cmp    $0x63,%eax
jne    11de <main+0x9e>
xor    %eax,%eax
call   1040 <run_c_client@plt>
jmp    11a0 <main+0x60>
cmp    $0xffffffff,%eax
je     1218 <main+0xd8>
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
jmp    11a0 <main+0x60>
lea    0xdf4(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
jmp    121a <main+0xda>
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 %34
11: ; preds = %2
br label %12
12: ; preds = %32, %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 %33
17: ; preds = %12
%18 = load i32, i32* %6
switch i32 %18, label %28 [
i32 99, label %19
i32 110, label %21
i32 104, label %23
]
19: ; preds = %17
%20 = call i32 (...) @run_c_client()
br label %32
21: ; preds = %17
%22 = call i32 (...) @run_n_client()
br label %32
23: ; preds = %17
%24 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%25 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%27 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %32
28: ; preds = %17
%29 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%30 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%31 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
br label %32
32: ; preds = %28, %23, %21, %19
br label %12
33: ; preds = %12
store i32 0, i32* %3
br label %34
34: ; preds = %33, %9
%35 = load i32, i32* %3
ret i32 %35
}

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 %22
6: ; preds = %2, %21
%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 %17 [
i32 -1, label %22
i32 99, label %8
i32 110, label %10
i32 104, label %12
]
8: ; preds = %6
%9 = tail call i32 (...) @run_c_client()
br label %21
10: ; preds = %6
%11 = tail call i32 (...) @run_n_client()
br label %21
12: ; preds = %6
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %21
17: ; preds = %6
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
br label %21
21: ; preds = %17, %12, %10, %8
br label %6
22: ; preds = %6, %4
%23 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %23
}