#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*/ msg_recv(int, char *, int);
int /*<<< orphan*/ msg_send(int, char *);
int /*<<< orphan*/ printf(char *);
int reception(char *);
int main(int argc, char *argv[]) {
  char buffer[128];
  char *welcome = "Welcome to the land of Orca.\n";
  int fd_comm;
  printf("Orca server started...\n");
  fd_comm = reception(argv[1]);
  msg_send(fd_comm, welcome);
  while (1) {
    msg_recv(fd_comm, buffer, 128);
    msg_send(fd_comm, buffer);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea0(%rip),%rax
mov    %rax,-0x98(%rbp)
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <reception@plt>
mov    %eax,-0x9c(%rbp)
mov    -0x9c(%rbp),%edi
mov    -0x98(%rbp),%rsi
call   1060 <msg_send@plt>
mov    -0x9c(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    $0x80,%edx
call   1030 <msg_recv@plt>
mov    -0x9c(%rbp),%edi
lea    -0x90(%rbp),%rsi
call   1060 <msg_send@plt>
jmp    1198 <main+0x58>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rsi,%rbx
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rbx),%rdi
call   1050 <reception@plt>
mov    %eax,%ebx
lea    0xe95(%rip),%rsi
mov    %ebx,%edi
call   1060 <msg_send@plt>
mov    %rsp,%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x80,%edx
call   1030 <msg_recv@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1060 <msg_send@plt>
jmp    1180 <main+0x40>

LLVM IR (-O0):
@.str = [30 x i8] c"Welcome to the land of Orca.\0A\00"
@.str.1 = [24 x i8] c"Orca server started...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [128 x i8]
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @reception(i8* %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = load i8*, i8** %7
%16 = call i32 @msg_send(i32 %14, i8* %15)
br label %17
17: ; preds = %2, %17
%18 = load i32, i32* %8
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%20 = call i32 @msg_recv(i32 %18, i8* %19, i32 128)
%21 = load i32, i32* %8
%22 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%23 = call i32 @msg_send(i32 %21, i8* %22)
br label %17
}

LLVM IR (-O2):
@.str = [30 x i8] c"Welcome to the land of Orca.\0A\00"
@str = [23 x i8] c"Orca server started...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @reception(i8* %7)
%9 = tail call i32 @msg_send(i32 %8, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %10, %2
%11 = call i32 @msg_recv(i32 %8, i8* %4, i32 128)
%12 = call i32 @msg_send(i32 %8, i8* %4)
br label %10
}