#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(int);
int /*<<< orphan*/ gen_crc_table();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ receiver();
int /*<<< orphan*/ sender(char *);
int main(int argc, char *argv[]) {
  int i;
  gen_crc_table();
  if (argc == 2) {
    printf("Calling Receiver\n");
    receiver();
  } else if (argc == 3) {
    printf("Calling Sender\n");
    sender(argv[2]);
  } else {
    printf("Wrong Arguments.....!!\nAborting....!!\n");
    exit(-1);
  }
  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    $0x0,%al
call   1050 <gen_crc_table@plt>
cmpl   $0x2,-0x8(%rbp)
jne    118f <main+0x3f>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <receiver@plt>
jmp    11d2 <main+0x82>
cmpl   $0x3,-0x8(%rbp)
jne    11b7 <main+0x67>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <sender@plt>
jmp    11cd <main+0x7d>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
jmp    11d2 <main+0x82>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <gen_crc_table@plt>
cmp    $0x3,%ebp
je     117e <main+0x2e>
cmp    $0x2,%ebp
jne    119c <main+0x4c>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <receiver@plt>
jmp    1193 <main+0x43>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
mov    0x10(%rbx),%rdi
call   1060 <sender@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe5d(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Calling Receiver\0A\00"
@.str.1 = [16 x i8] c"Calling Sender\0A\00"
@.str.2 = [39 x i8] c"Wrong Arguments.....!!\0AAborting....!!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @gen_crc_table()
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (...) @receiver()
br label %26
13: ; preds = %2
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 3
br i1 %15, label %16, label %22
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call i32 @sender(i8* %20)
br label %25
22: ; preds = %13
%23 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 @exit(i32 -1)
unreachable
25: ; preds = %16
br label %26
26: ; preds = %25, %10
ret i32 0
}

LLVM IR (-O2):
@str = [38 x i8] c"Wrong Arguments.....!!\0AAborting....!!\00"
@str.3 = [15 x i8] c"Calling Sender\00"
@str.4 = [17 x i8] c"Calling Receiver\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @gen_crc_table()
switch i32 %0, label %12 [
i32 2, label %4
i32 3, label %7
]
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0))
%6 = tail call i32 (...) @receiver()
br label %15
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.3, i64 0, i64 0))
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @sender(i8* %10)
br label %15
12: ; preds = %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%14 = tail call i32 @exit(i32 -1)
unreachable
15: ; preds = %7, %4
ret i32 0
}