#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 EXIT_SUCCESS;
int /*<<< orphan*/ allocParamAgent(int /*<<< orphan*/, char *,
                                   int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ runAgent(int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (argc != 5) {
    printf("Uso: start_agent <identity> <router_ip> <port_in> <port_out>\n");
    exit(0);
  }
  runAgent(
      allocParamAgent(atoi(argv[1]), argv[2], atoi(argv[3]), atoi(argv[4])));
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     1183 <main+0x33>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1050 <atoi@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
call   1070 <allocParamAgent@plt>
mov    %eax,%edi
call   1040 <runAgent@plt>
mov    0x2e05(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x5,%edi
jne    11ad <main+0x5d>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%r15d
mov    0x10(%rbx),%r14
mov    0x18(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    0x20(%rbx),%rdi
call   1050 <atoi@plt>
mov    %r15d,%edi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
call   1070 <allocParamAgent@plt>
mov    %eax,%edi
call   1040 <runAgent@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe4c(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"Uso: start_agent <identity> <router_ip> <port_in> <port_out>\0A\00"
@EXIT_SUCCESS = global i32 0
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 ne i32 %6, 5
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 3
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 4
%25 = load i8*, i8** %24
%26 = call i32 @atoi(i8* %25)
%27 = call i32 @allocParamAgent(i32 %15, i8* %18, i32 %22, i32 %26)
%28 = call i32 @runAgent(i32 %27)
%29 = load i32, i32* @EXIT_SUCCESS
ret i32 %29
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [61 x i8] c"Uso: start_agent <identity> <router_ip> <port_in> <port_out>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 5
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8*, i8** %1, i64 3
%14 = load i8*, i8** %13
%15 = tail call i32 @atoi(i8* %14)
%16 = getelementptr inbounds i8*, i8** %1, i64 4
%17 = load i8*, i8** %16
%18 = tail call i32 @atoi(i8* %17)
%19 = tail call i32 @allocParamAgent(i32 %10, i8* %12, i32 %15, i32 %18)
%20 = tail call i32 @runAgent(i32 %19)
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}