#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_init(char *, int /*<<< orphan*/);
int /*<<< orphan*/ server_init(int /*<<< orphan*/);
int /*<<< orphan*/ start_shell(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  if (argv[1][0] == 'c')
    start_shell(client_init(argv[2], atoi(argv[3])));
  else
    start_shell(server_init(atoi(argv[2])));
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
jne    119a <main+0x5a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <atoi@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <client_init@plt>
mov    %eax,%edi
call   1060 <start_shell@plt>
jmp    11b5 <main+0x75>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <server_init@plt>
mov    %eax,%edi
call   1060 <start_shell@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rax
mov    0x10(%rsi),%rbx
cmpb   $0x63,(%rax)
jne    1163 <main+0x23>
mov    0x18(%rsi),%rdi
call   1050 <atoi@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <client_init@plt>
jmp    1172 <main+0x32>
mov    %rbx,%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <server_init@plt>
mov    %eax,%edi
call   1060 <start_shell@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
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 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 99
br i1 %12, label %13, label %23
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 3
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
%21 = call i32 @client_init(i8* %16, i32 %20)
%22 = call i32 @start_shell(i32 %21)
br label %30
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 2
%26 = load i8*, i8** %25
%27 = call i32 @atoi(i8* %26)
%28 = call i32 @server_init(i32 %27)
%29 = call i32 @start_shell(i32 %28)
br label %30
30: ; preds = %23, %13
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 99
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
br i1 %6, label %9, label %14
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 3
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = tail call i32 @client_init(i8* %8, i32 %12)
br label %17
14: ; preds = %2
%15 = tail call i32 @atoi(i8* %8)
%16 = tail call i32 @server_init(i32 %15)
br label %17
17: ; preds = %14, %9
%18 = phi i32 [ %16, %14 ], [ %13, %9 ]
%19 = tail call i32 @start_shell(i32 %18)
ret i32 0
}