#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*/ client(char *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ server(char *, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("./test -c / -s\n");
    return 0;
  }
  if (!strcmp(argv[1], "-c"))
    client("127.0.0.1", 2333);
  if (!strcmp(argv[1], "-s"))
    server("127.0.0.1", 2333);
  while (1) {
    sleep(1);
  }
  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   $0x2,-0x8(%rbp)
je     1184 <main+0x34>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe7d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11b2 <main+0x62>
lea    0xe6b(%rip),%rdi
mov    $0x91d,%esi
call   1060 <client@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe5c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11e0 <main+0x90>
lea    0xe3d(%rip),%rdi
mov    $0x91d,%esi
call   1050 <server@plt>
jmp    11e5 <main+0x95>
mov    $0x1,%edi
call   1070 <sleep@plt>
jmp    11e5 <main+0x95>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    11bc <main+0x6c>
mov    %rsi,%r14
mov    0x8(%rsi),%rbx
lea    0xe99(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1188 <main+0x38>
lea    0xe89(%rip),%rdi
mov    $0x91d,%esi
call   1060 <client@plt>
mov    0x8(%r14),%rbx
lea    0xe8a(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    11b0 <main+0x60>
lea    0xe61(%rip),%rdi
mov    $0x91d,%esi
call   1050 <server@plt>
nopl   0x0(%rax)
mov    $0x1,%edi
call   1070 <sleep@plt>
jmp    11b0 <main+0x60>
lea    0xe4a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"./test -c / -s\0A\00"
@.str.1 = [3 x i8] c"-c\00"
@.str.2 = [10 x i8] c"127.0.0.1\00"
@.str.3 = [3 x i8] c"-s\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 i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %10
%17 = call i32 @client(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 2333)
br label %18
18: ; preds = %16, %10
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @strcmp(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp ne i32 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %18
%25 = call i32 @server(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 2333)
br label %26
26: ; preds = %24, %18
br label %27
27: ; preds = %26, %27
%28 = call i32 @sleep(i32 1)
br label %27
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"-c\00"
@.str.2 = [10 x i8] c"127.0.0.1\00"
@.str.3 = [3 x i8] c"-s\00"
@str = [15 x i8] c"./test -c / -s\00"
define i32 @main(i32 %0, i8** nocapture %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 ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %8, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = tail call i32 @client(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 2333)
%13 = load i8*, i8** %7
br label %14
14: ; preds = %11, %6
%15 = phi i8* [ %13, %11 ], [ %8, %6 ]
%16 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = tail call i32 @server(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 2333)
br label %20
20: ; preds = %18, %14
br label %21
21: ; preds = %20, %21
%22 = tail call i32 @sleep(i32 1)
br label %21
}