#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*/ atoi(char *);
int /*<<< orphan*/ client(char *, char *, char *, char *, char *,
                          int /*<<< orphan*/);
int /*<<< orphan*/ server(char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (strcmp(argv[1], "client") == 0 && argc == 8) {
    client(argv[2], argv[3], argv[4], argv[5], argv[6], atoi(argv[7]));
  } else if (strcmp(argv[1], "server") == 0 && argc == 3) {
    server(argv[2]);
  } else {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11e8 <main+0xa8>
cmpl   $0x8,-0x8(%rbp)
jne    11e8 <main+0xa8>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x38(%rax),%rdi
call   1050 <atoi@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    %eax,%r9d
call   1060 <client@plt>
jmp    1233 <main+0xf3>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe10(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1222 <main+0xe2>
cmpl   $0x3,-0x8(%rbp)
jne    1222 <main+0xe2>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <server@plt>
jmp    122e <main+0xee>
movl   $0x1,-0x4(%rbp)
jmp    123a <main+0xfa>
jmp    1233 <main+0xf3>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xea5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x8,%ebp
jne    11a0 <main+0x60>
test   %rax,%rax
jne    11a0 <main+0x60>
mov    0x10(%rbx),%rbp
mov    0x18(%rbx),%r14
mov    0x20(%rbx),%r15
mov    0x28(%rbx),%r12
mov    0x30(%rbx),%r13
mov    0x38(%rbx),%rdi
call   1050 <atoi@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %r13,%r8
mov    %eax,%r9d
call   1060 <client@plt>
jmp    11cb <main+0x8b>
mov    0x8(%rbx),%rdi
lea    0xe5c(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%eax
cmp    $0x3,%ebp
jne    11cd <main+0x8d>
test   %rcx,%rcx
jne    11cd <main+0x8d>
mov    0x10(%rbx),%rdi
call   1040 <server@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"client\00"
@.str.1 = [7 x i8] c"server\00"
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %35
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 8
br i1 %13, label %14, label %35
14: ; preds = %11
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 3
%20 = load i8*, i8** %19
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 4
%23 = load i8*, i8** %22
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 5
%26 = load i8*, i8** %25
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 6
%29 = load i8*, i8** %28
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 7
%32 = load i8*, i8** %31
%33 = call i32 @atoi(i8* %32)
%34 = call i32 @client(i8* %17, i8* %20, i8* %23, i8* %26, i8* %29, i32 %33)
br label %51
35: ; preds = %11, %2
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %49
41: ; preds = %35
%42 = load i32, i32* %4
%43 = icmp eq i32 %42, 3
br i1 %43, label %44, label %49
44: ; preds = %41
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 2
%47 = load i8*, i8** %46
%48 = call i32 @server(i8* %47)
br label %50
49: ; preds = %41, %35
store i32 1, i32* %3
br label %52
50: ; preds = %44
br label %51
51: ; preds = %50, %14
store i32 0, i32* %3
br label %52
52: ; preds = %51, %49
%53 = load i32, i32* %3
ret i32 %53
}

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