#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_SUCCESS;
int OptHandler(int, char **, char **);
int ReceiverModule();
int TransmitterModule(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  char *FileName = NULL;
  int WorkMode = 0;
  if ((WorkMode = OptHandler(argc, argv, &FileName)) == -1)
    exit(EXIT_FAILURE);
  if (WorkMode == 1)
    if (ReceiverModule() == -1)
      exit(EXIT_FAILURE);
  if (WorkMode == 2)
    if (TransmitterModule(FileName) == -1)
      exit(EXIT_FAILURE);
  exit(EXIT_SUCCESS);
}


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)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <OptHandler@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
jne    118f <main+0x4f>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
cmpl   $0x1,-0x1c(%rbp)
jne    11bc <main+0x7c>
mov    $0x0,%al
call   1030 <ReceiverModule@plt>
cmp    $0xffffffff,%eax
jne    11b7 <main+0x77>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
jmp    11bc <main+0x7c>
cmpl   $0x2,-0x1c(%rbp)
jne    11eb <main+0xab>
mov    -0x18(%rbp),%rdi
call   1050 <TransmitterModule@plt>
cmp    $0xffffffff,%eax
jne    11e6 <main+0xa6>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
jmp    11eb <main+0xab>
mov    0x2de6(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdx
call   1040 <OptHandler@plt>
cmp    $0x2,%eax
je     1175 <main+0x35>
cmp    $0x1,%eax
jne    1162 <main+0x22>
xor    %eax,%eax
call   1030 <ReceiverModule@plt>
cmp    $0xffffffff,%eax
jne    1183 <main+0x43>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    (%rsp),%rdi
call   1050 <TransmitterModule@plt>
cmp    $0xffffffff,%eax
je     1167 <main+0x27>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @OptHandler(i32 %8, i8** %9, i8** %6)
store i32 %10, i32* %7
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i32, i32* %7
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = call i32 (...) @ReceiverModule()
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* @EXIT_FAILURE
%23 = call i32 @exit(i32 %22)
unreachable
24: ; preds = %18
br label %25
25: ; preds = %24, %15
%26 = load i32, i32* %7
%27 = icmp eq i32 %26, 2
br i1 %27, label %28, label %36
28: ; preds = %25
%29 = load i8*, i8** %6
%30 = call i32 @TransmitterModule(i8* %29)
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = load i32, i32* @EXIT_FAILURE
%34 = call i32 @exit(i32 %33)
unreachable
35: ; preds = %28
br label %36
36: ; preds = %35, %25
%37 = load i32, i32* @EXIT_SUCCESS
%38 = call i32 @exit(i32 %37)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @OptHandler(i32 %0, i8** %1, i8** %3)
switch i32 %5, label %22 [
i32 -1, label %6
i32 1, label %9
i32 2, label %15
]
6: ; preds = %2
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = call i32 (...) @ReceiverModule()
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = call i32 @TransmitterModule(i8* %16)
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i32, i32* @EXIT_FAILURE
%21 = call i32 @exit(i32 %20)
unreachable
22: ; preds = %9, %2, %15
%23 = load i32, i32* @EXIT_SUCCESS
%24 = call i32 @exit(i32 %23)
unreachable
}