#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ pce_client_main(int, char **);
int /*<<< orphan*/ pce_server_main(int, char **);
int /*<<< orphan*/ pce_usage(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (argc > 1 && (strcmp(argv[1], "server") == 0)) {
    argc--;
    argv++;
    pce_server_main(argc, argv);
  } else if (argc > 1 && (strcmp(argv[1], "client") == 0)) {
    argc--;
    argv++;
    pce_client_main(argc, argv);
  } else if (argc > 1 && (strcmp(argv[1], "help") == 0)) {
    pce_usage(stderr);
    exit(EXIT_FAILURE);
  } else {
    pce_usage(stderr);
    exit(EXIT_FAILURE);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11b4 <main+0x64>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe81(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11b4 <main+0x64>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <pce_server_main@plt>
jmp    1267 <main+0x117>
cmpl   $0x1,-0x8(%rbp)
jle    1202 <main+0xb2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3a(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1202 <main+0xb2>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <pce_client_main@plt>
jmp    1262 <main+0x112>
cmpl   $0x1,-0x8(%rbp)
jle    1246 <main+0xf6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf3(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1246 <main+0xf6>
mov    0x2daf(%rip),%rax
mov    (%rax),%edi
call   1060 <pce_usage@plt>
mov    0x2d99(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    0x2d93(%rip),%rax
mov    (%rax),%edi
call   1060 <pce_usage@plt>
mov    0x2d7d(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
jmp    1267 <main+0x117>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     11c1 <main+0x71>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
add    $0x8,%rbx
lea    0xe94(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1199 <main+0x49>
mov    (%rbx),%rdi
lea    0xe87(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    11af <main+0x5f>
add    $0xffffffff,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <pce_client_main@plt>
jmp    11a6 <main+0x56>
add    $0xffffffff,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <pce_server_main@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    (%rbx),%rdi
lea    0xe55(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
call   1060 <pce_usage@plt>
mov    0x2e02(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"server\00"
@.str.1 = [7 x i8] c"client\00"
@.str.2 = [5 x i8] c"help\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %22
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %8
%15 = load i32, i32* %4
%16 = add nsw i32 %15, -1
store i32 %16, i32* %4
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i32 1
store i8** %18, i8*** %5
%19 = load i32, i32* %4
%20 = load i8**, i8*** %5
%21 = call i32 @pce_server_main(i32 %19, i8** %20)
br label %59
22: ; preds = %8, %2
%23 = load i32, i32* %4
%24 = icmp sgt i32 %23, 1
br i1 %24, label %25, label %39
25: ; preds = %22
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %39
31: ; preds = %25
%32 = load i32, i32* %4
%33 = add nsw i32 %32, -1
store i32 %33, i32* %4
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i32 1
store i8** %35, i8*** %5
%36 = load i32, i32* %4
%37 = load i8**, i8*** %5
%38 = call i32 @pce_client_main(i32 %36, i8** %37)
br label %58
39: ; preds = %25, %22
%40 = load i32, i32* %4
%41 = icmp sgt i32 %40, 1
br i1 %41, label %42, label %53
42: ; preds = %39
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 1
%45 = load i8*, i8** %44
%46 = call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %53
48: ; preds = %42
%49 = load i32, i32* @stderr
%50 = call i32 @pce_usage(i32 %49)
%51 = load i32, i32* @EXIT_FAILURE
%52 = call i32 @exit(i32 %51)
unreachable
53: ; preds = %42, %39
%54 = load i32, i32* @stderr
%55 = call i32 @pce_usage(i32 %54)
%56 = load i32, i32* @EXIT_FAILURE
%57 = call i32 @exit(i32 %56)
unreachable
58: ; preds = %31
br label %59
59: ; preds = %58, %14
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"server\00"
@.str.1 = [7 x i8] c"client\00"
@.str.2 = [5 x i8] c"help\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %28
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = add nsw i32 %0, -1
%11 = tail call i32 @pce_server_main(i32 %10, i8** %5)
br label %33
12: ; preds = %4
%13 = load i8*, i8** %5
%14 = tail call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = add nsw i32 %0, -1
%18 = tail call i32 @pce_client_main(i32 %17, i8** %5)
br label %33
19: ; preds = %12
%20 = load i8*, i8** %5
%21 = tail call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i32, i32* @stderr
%25 = tail call i32 @pce_usage(i32 %24)
%26 = load i32, i32* @EXIT_FAILURE
%27 = tail call i32 @exit(i32 %26)
unreachable
28: ; preds = %2, %19
%29 = load i32, i32* @stderr
%30 = tail call i32 @pce_usage(i32 %29)
%31 = load i32, i32* @EXIT_FAILURE
%32 = tail call i32 @exit(i32 %31)
unreachable
33: ; preds = %16, %9
ret i32 0
}