#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*/ printf(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ test_connect();
int /*<<< orphan*/ test_hostlisten();
int main(int argc, char *argv[]) {
  if (argc > 1 && !strcmp(argv[1], "ser")) {
    printf("run as ser\n");
    test_hostlisten();
  } else {
    test_connect();
  }
  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    1195 <main+0x55>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe91(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1195 <main+0x55>
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <test_hostlisten@plt>
jmp    119c <main+0x5c>
mov    $0x0,%al
call   1030 <test_connect@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     115a <main+0x1a>
mov    0x8(%rsi),%rdi
lea    0xeb6(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1163 <main+0x23>
xor    %eax,%eax
call   1040 <test_connect@plt>
jmp    1176 <main+0x36>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <test_hostlisten@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"ser\00"
@.str.1 = [12 x i8] c"run as ser\0A\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 sgt i32 %6, 1
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %8
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 (...) @test_hostlisten()
br label %19
17: ; preds = %8, %2
%18 = call i32 (...) @test_connect()
br label %19
19: ; preds = %17, %14
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"ser\00"
@str = [11 x i8] c"run as ser\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 (...) @test_hostlisten()
br label %14
12: ; preds = %4, %2
%13 = tail call i32 (...) @test_connect()
br label %14
14: ; preds = %12, %9
ret i32 0
}