#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 */
struct sockaddr_in {
  void *sin_port;
  int /*<<< orphan*/ sin_addr;
  void *sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ escravoB;
typedef int /*<<< orphan*/ escravoA;

/* Variables and functions */
void *AF_INET;
int /*<<< orphan*/ IPPROTO_UDP;
int /*<<< orphan*/ SOCK_DGRAM;
int atoi(char *);
int /*<<< orphan*/ close(int);
void *htons(int);
scalar_t__ inet_aton(char *, int /*<<< orphan*/ *);
char *inet_ntoa(int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int ntohs(void *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ recvfrom(int, char *, int, int /*<<< orphan*/,
                            struct sockaddr *, int *);
int sendto(int, int **, int, int /*<<< orphan*/, struct sockaddr *, int);
int socket(void *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ testArguments(int, char **);
int main(int argc, char *argv[]) {
  struct sockaddr_in escravoA, escravoB;
  int sock_A, sock_B, i;
  socklen_t slen_A = sizeof(escravoA);
  socklen_t slen_B = sizeof(escravoB);
  char buf[512];
  testArguments(argc, argv);
  int PORT_A = atoi(argv[1]);
  int PORT_B = atoi(argv[2]);
  int vetorA[10];
  int vetorB[10];
  if ((sock_A = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
    printf("ERRO AO CRIAR SOCKET\n");
    return 1;
  }
  if ((sock_B = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
    printf("ERRO AO CRIAR SOCKET\n");
    return 1;
  }
  memset((char *)&escravoA, 0, sizeof(escravoA));
  escravoA.sin_family = AF_INET;
  escravoA.sin_port = htons(PORT_A);
  if (inet_aton("127.0.0.1", &escravoA.sin_addr) == 0) {
    printf("ERRO AO TRANSFORMAR ENDEREÇO\n");
    return 1;
  }
  memset((char *)&escravoB, 0, sizeof(escravoB));
  escravoB.sin_family = AF_INET;
  escravoB.sin_port = htons(PORT_B);
  if (inet_aton("127.0.0.1", &escravoB.sin_addr) == 0) {
    printf("ERRO AO TRANSFORMAR ENDEREÇO\n");
    return 1;
  }
  for (i = 0; i < 10; i++) {
    vetorA[i] = 99 - i;
    vetorB[i] = i + 1;
  }
  printf("Enviando o vetorA\n");
  if (sendto(sock_A, &vetorA, sizeof(int) * 10, 0, (struct sockaddr *)&escravoA,
             slen_A) == -1) {
    printf("ERRO AO ENVIAR PACOTE\n");
    return 1;
  }
  printf("Enviando o vetorB\n");
  if (sendto(sock_B, &vetorB, sizeof(int) * 10, 0, (struct sockaddr *)&escravoB,
             slen_B) == -1) {
    printf("ERRO AO ENVIAR PACOTE\n");
    return 1;
  }
  recvfrom(sock_A, buf, 512, 0, (struct sockaddr *)&escravoA, &slen_A);
  printf("Pacote recebido de %s:%d\nDado: %s\n", inet_ntoa(escravoA.sin_addr),
         ntohs(escravoA.sin_port), buf);
  close(sock_A);
  recvfrom(sock_B, buf, 512, 0, (struct sockaddr *)&escravoB, &slen_B);
  printf("Pacote recebido de %s:%d\nDado: %s\n", inet_ntoa(escravoB.sin_addr),
         ntohs(escravoB.sin_port), buf);
  close(sock_B);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2d0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x18,-0x50(%rbp)
movl   $0x18,-0x54(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10d0 <testArguments@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x264(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x268(%rbp)
mov    0x2dc8(%rip),%rax
mov    (%rax),%rdi
mov    0x2db6(%rip),%rax
mov    (%rax),%esi
mov    0x2d95(%rip),%rax
mov    (%rax),%edx
call   10e0 <socket@plt>
mov    %eax,-0x44(%rbp)
cmp    $0xffffffff,%eax
jne    1260 <main+0xa0>
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1511 <main+0x351>
mov    0x2d81(%rip),%rax
mov    (%rax),%rdi
mov    0x2d6f(%rip),%rax
mov    (%rax),%esi
mov    0x2d4e(%rip),%rax
mov    (%rax),%edx
call   10e0 <socket@plt>
mov    %eax,-0x48(%rbp)
cmp    $0xffffffff,%eax
jne    12a7 <main+0xe7>
lea    0xd6c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1511 <main+0x351>
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1060 <memset@plt>
mov    0x2d2a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x264(%rbp),%edi
call   1040 <htons@plt>
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rsi
add    $0x8,%rsi
lea    0xd33(%rip),%rdi
call   1090 <inet_aton@plt>
cmp    $0x0,%rax
jne    130c <main+0x14c>
lea    0xd27(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1511 <main+0x351>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1060 <memset@plt>
mov    0x2cc5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x268(%rbp),%edi
call   1040 <htons@plt>
mov    %rax,-0x40(%rbp)
lea    -0x40(%rbp),%rsi
add    $0x8,%rsi
lea    0xcce(%rip),%rdi
call   1090 <inet_aton@plt>
cmp    $0x0,%rax
jne    1371 <main+0x1b1>
lea    0xcc2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1511 <main+0x351>
movl   $0x0,-0x4c(%rbp)
cmpl   $0xa,-0x4c(%rbp)
jge    13b4 <main+0x1f4>
mov    $0x63,%ecx
sub    -0x4c(%rbp),%ecx
movslq -0x4c(%rbp),%rax
mov    %ecx,-0x290(%rbp,%rax,4)
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
movslq -0x4c(%rbp),%rax
mov    %ecx,-0x2c0(%rbp,%rax,4)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1378 <main+0x1b8>
lea    0xc84(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x44(%rbp),%edi
lea    -0x290(%rbp),%rsi
lea    -0x28(%rbp),%r8
mov    -0x50(%rbp),%r9d
mov    $0x28,%edx
xor    %ecx,%ecx
call   1070 <sendto@plt>
cmp    $0xffffffff,%eax
jne    1403 <main+0x243>
lea    0xc62(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1511 <main+0x351>
lea    0xc5f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x48(%rbp),%edi
lea    -0x2c0(%rbp),%rsi
lea    -0x40(%rbp),%r8
mov    -0x54(%rbp),%r9d
mov    $0x28,%edx
xor    %ecx,%ecx
call   1070 <sendto@plt>
cmp    $0xffffffff,%eax
jne    1452 <main+0x292>
lea    0xc13(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1511 <main+0x351>
mov    -0x44(%rbp),%edi
lea    -0x260(%rbp),%rsi
lea    -0x28(%rbp),%r8
mov    $0x200,%edx
xor    %ecx,%ecx
lea    -0x50(%rbp),%r9
call   10a0 <recvfrom@plt>
mov    -0x20(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,-0x2d0(%rbp)
mov    -0x28(%rbp),%rdi
call   10b0 <ntohs@plt>
mov    -0x2d0(%rbp),%rsi
mov    %eax,%edx
lea    -0x260(%rbp),%rcx
lea    0xbdd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x44(%rbp),%edi
call   1080 <close@plt>
mov    -0x48(%rbp),%edi
lea    -0x260(%rbp),%rsi
lea    -0x40(%rbp),%r8
mov    $0x200,%edx
xor    %ecx,%ecx
lea    -0x54(%rbp),%r9
call   10a0 <recvfrom@plt>
mov    -0x38(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,-0x2c8(%rbp)
mov    -0x40(%rbp),%rdi
call   10b0 <ntohs@plt>
mov    -0x2c8(%rbp),%rsi
mov    %eax,%edx
lea    -0x260(%rbp),%rcx
lea    0xb81(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x48(%rbp),%edi
call   1080 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2a8,%rsp
mov    %rsi,%rbx
movl   $0x18,0xc(%rsp)
movl   $0x18,0x8(%rsp)
call   10e0 <testArguments@plt>
mov    0x8(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,%r14d
mov    0x10(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,%r15d
mov    0x2dd0(%rip),%r13
mov    0x0(%r13),%rdi
mov    0x2dbd(%rip),%rbx
mov    (%rbx),%esi
mov    0x2d9c(%rip),%rbp
mov    0x0(%rbp),%edx
call   10f0 <socket@plt>
cmp    $0xffffffff,%eax
je     143f <main+0x26f>
mov    %eax,%r12d
mov    0x0(%r13),%rdi
mov    (%rbx),%esi
mov    0x0(%rbp),%edx
call   10f0 <socket@plt>
cmp    $0xffffffff,%eax
je     143f <main+0x26f>
mov    %eax,%ebp
lea    0x28(%rsp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1070 <memset@plt>
mov    0x0(%r13),%rax
mov    %rax,0x38(%rsp)
mov    %r14d,%edi
call   1050 <htons@plt>
mov    %rax,0x28(%rsp)
lea    0x30(%rsp),%rsi
lea    0xdb4(%rip),%rdi
call   10a0 <inet_aton@plt>
test   %rax,%rax
je     1448 <main+0x278>
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1070 <memset@plt>
mov    0x0(%r13),%rax
mov    %rax,0x20(%rsp)
mov    %r15d,%edi
call   1050 <htons@plt>
mov    %rax,0x10(%rsp)
lea    0x18(%rsp),%rsi
lea    0xd73(%rip),%rdi
call   10a0 <inet_aton@plt>
test   %rax,%rax
je     1448 <main+0x278>
movaps 0xd1e(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xd22(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xd26(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xd27(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movabs $0x5a0000005b,%rax
mov    %rax,0x90(%rsp)
movabs $0xa00000009,%rax
mov    %rax,0x60(%rsp)
lea    0xd37(%rip),%rdi
call   1030 <puts@plt>
lea    0x70(%rsp),%rsi
lea    0x28(%rsp),%r8
mov    %r12d,%edi
mov    $0x28,%edx
xor    %ecx,%ecx
mov    $0x18,%r9d
call   1080 <sendto@plt>
cmp    $0xffffffff,%eax
je     1451 <main+0x281>
lea    0xd15(%rip),%rdi
call   1030 <puts@plt>
lea    0x40(%rsp),%rsi
xor    %ebx,%ebx
lea    0x10(%rsp),%r8
mov    %ebp,%edi
mov    $0x28,%edx
xor    %ecx,%ecx
mov    $0x18,%r9d
call   1080 <sendto@plt>
cmp    $0xffffffff,%eax
je     1451 <main+0x281>
lea    0xa0(%rsp),%r15
lea    0x28(%rsp),%r8
lea    0xc(%rsp),%r9
mov    %r12d,%edi
mov    %r15,%rsi
mov    $0x200,%edx
xor    %ecx,%ecx
call   10b0 <recvfrom@plt>
mov    0x30(%rsp),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,%r14
mov    0x28(%rsp),%rdi
call   10c0 <ntohs@plt>
lea    0xc71(%rip),%r13
mov    %r13,%rdi
mov    %r14,%rsi
mov    %eax,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r12d,%edi
call   1090 <close@plt>
lea    0x10(%rsp),%r8
lea    0x8(%rsp),%r9
mov    %ebp,%edi
mov    %r15,%rsi
mov    $0x200,%edx
xor    %ecx,%ecx
call   10b0 <recvfrom@plt>
mov    0x18(%rsp),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,%r14
mov    0x10(%rsp),%rdi
call   10c0 <ntohs@plt>
mov    %r13,%rdi
mov    %r14,%rsi
mov    %eax,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebp,%edi
call   1090 <close@plt>
jmp    1462 <main+0x292>
lea    0xc7f(%rip),%rdi
jmp    1458 <main+0x288>
lea    0xc58(%rip),%rdi
jmp    1458 <main+0x288>
lea    0xc39(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x2a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i8*, i32, i8* }
%struct.sockaddr = type { i32 }
@AF_INET = global i8* null
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
@.str = [22 x i8] c"ERRO AO CRIAR SOCKET\0A\00"
@.str.1 = [10 x i8] c"127.0.0.1\00"
@.str.2 = [31 x i8] c"ERRO AO TRANSFORMAR ENDERE\C3\87O\0A\00"
@.str.3 = [19 x i8] c"Enviando o vetorA\0A\00"
@.str.4 = [23 x i8] c"ERRO AO ENVIAR PACOTE\0A\00"
@.str.5 = [19 x i8] c"Enviando o vetorB\0A\00"
@.str.6 = [35 x i8] c"Pacote recebido de %s:%d\0ADado: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.sockaddr_in
%7 = alloca %struct.sockaddr_in
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [512 x i8]
%14 = alloca i32
%15 = alloca i32
%16 = alloca [10 x i32]
%17 = alloca [10 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 24, i32* %11
store i32 24, i32* %12
%18 = load i32, i32* %4
%19 = load i8**, i8*** %5
%20 = call i32 @testArguments(i32 %18, i8** %19)
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @atoi(i8* %23)
store i32 %24, i32* %14
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call i32 @atoi(i8* %27)
store i32 %28, i32* %15
%29 = load i8*, i8** @AF_INET
%30 = load i32, i32* @SOCK_DGRAM
%31 = load i32, i32* @IPPROTO_UDP
%32 = call i32 @socket(i8* %29, i32 %30, i32 %31)
store i32 %32, i32* %8
%33 = icmp eq i32 %32, -1
br i1 %33, label %34, label %36
34: ; preds = %2
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %137
36: ; preds = %2
%37 = load i8*, i8** @AF_INET
%38 = load i32, i32* @SOCK_DGRAM
%39 = load i32, i32* @IPPROTO_UDP
%40 = call i32 @socket(i8* %37, i32 %38, i32 %39)
store i32 %40, i32* %9
%41 = icmp eq i32 %40, -1
br i1 %41, label %42, label %44
42: ; preds = %36
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %137
44: ; preds = %36
%45 = bitcast %struct.sockaddr_in* %6 to i8*
%46 = call i32 @memset(i8* %45, i32 0, i32 24)
%47 = load i8*, i8** @AF_INET
%48 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 2
store i8* %47, i8** %48
%49 = load i32, i32* %14
%50 = call i8* @htons(i32 %49)
%51 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
store i8* %50, i8** %51
%52 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 1
%53 = call i64 @inet_aton(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32* %52)
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %44
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %137
57: ; preds = %44
%58 = bitcast %struct.sockaddr_in* %7 to i8*
%59 = call i32 @memset(i8* %58, i32 0, i32 24)
%60 = load i8*, i8** @AF_INET
%61 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 2
store i8* %60, i8** %61
%62 = load i32, i32* %15
%63 = call i8* @htons(i32 %62)
%64 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
store i8* %63, i8** %64
%65 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
%66 = call i64 @inet_aton(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32* %65)
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %57
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %137
70: ; preds = %57
store i32 0, i32* %10
br label %71
71: ; preds = %85, %70
%72 = load i32, i32* %10
%73 = icmp slt i32 %72, 10
br i1 %73, label %74, label %88
74: ; preds = %71
%75 = load i32, i32* %10
%76 = sub nsw i32 99, %75
%77 = load i32, i32* %10
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [10 x i32], [10 x i32]* %16, i64 0, i64 %78
store i32 %76, i32* %79
%80 = load i32, i32* %10
%81 = add nsw i32 %80, 1
%82 = load i32, i32* %10
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [10 x i32], [10 x i32]* %17, i64 0, i64 %83
store i32 %81, i32* %84
br label %85
85: ; preds = %74
%86 = load i32, i32* %10
%87 = add nsw i32 %86, 1
store i32 %87, i32* %10
br label %71
88: ; preds = %71
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%90 = load i32, i32* %8
%91 = bitcast [10 x i32]* %16 to i32**
%92 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%93 = load i32, i32* %11
%94 = call i32 @sendto(i32 %90, i32** %91, i32 40, i32 0, %struct.sockaddr* %92, i32 %93)
%95 = icmp eq i32 %94, -1
br i1 %95, label %96, label %98
96: ; preds = %88
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %137
98: ; preds = %88
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%100 = load i32, i32* %9
%101 = bitcast [10 x i32]* %17 to i32**
%102 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%103 = load i32, i32* %12
%104 = call i32 @sendto(i32 %100, i32** %101, i32 40, i32 0, %struct.sockaddr* %102, i32 %103)
%105 = icmp eq i32 %104, -1
br i1 %105, label %106, label %108
106: ; preds = %98
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %137
108: ; preds = %98
%109 = load i32, i32* %8
%110 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%111 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%112 = call i32 @recvfrom(i32 %109, i8* %110, i32 512, i32 0, %struct.sockaddr* %111, i32* %11)
%113 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 1
%114 = load i32, i32* %113
%115 = call i8* @inet_ntoa(i32 %114)
%116 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
%117 = load i8*, i8** %116
%118 = call i32 @ntohs(i8* %117)
%119 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i8* %115, i32 %118, i8* %119)
%121 = load i32, i32* %8
%122 = call i32 @close(i32 %121)
%123 = load i32, i32* %9
%124 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%125 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%126 = call i32 @recvfrom(i32 %123, i8* %124, i32 512, i32 0, %struct.sockaddr* %125, i32* %12)
%127 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
%128 = load i32, i32* %127
%129 = call i8* @inet_ntoa(i32 %128)
%130 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%131 = load i8*, i8** %130
%132 = call i32 @ntohs(i8* %131)
%133 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i8* %129, i32 %132, i8* %133)
%135 = load i32, i32* %9
%136 = call i32 @close(i32 %135)
store i32 0, i32* %3
br label %137
137: ; preds = %108, %106, %96, %68, %55, %42, %34
%138 = load i32, i32* %3
ret i32 %138
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i8*, i32, i8* }
%struct.sockaddr = type { i32 }
@AF_INET = global i8* null
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
@.str.1 = [10 x i8] c"127.0.0.1\00"
@.str.6 = [35 x i8] c"Pacote recebido de %s:%d\0ADado: %s\0A\00"
@str = [18 x i8] c"Enviando o vetorA\00"
@str.7 = [18 x i8] c"Enviando o vetorB\00"
@str.9 = [22 x i8] c"ERRO AO ENVIAR PACOTE\00"
@str.11 = [30 x i8] c"ERRO AO TRANSFORMAR ENDERE\C3\87O\00"
@str.13 = [21 x i8] c"ERRO AO CRIAR SOCKET\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca i32
%7 = alloca [512 x i8]
%8 = alloca [10 x i32]
%9 = alloca [10 x i32]
%10 = bitcast %struct.sockaddr_in* %3 to i8*
%11 = bitcast %struct.sockaddr_in* %4 to i8*
%12 = bitcast i32* %5 to i8*
store i32 24, i32* %5
%13 = bitcast i32* %6 to i8*
store i32 24, i32* %6
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%15 = tail call i32 @testArguments(i32 %0, i8** %1)
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32 @atoi(i8* %17)
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = tail call i32 @atoi(i8* %20)
%22 = bitcast [10 x i32]* %8 to i8*
%23 = bitcast [10 x i32]* %9 to i8*
%24 = load i8*, i8** @AF_INET
%25 = load i32, i32* @SOCK_DGRAM
%26 = load i32, i32* @IPPROTO_UDP
%27 = tail call i32 @socket(i8* %24, i32 %25, i32 %26)
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %31
29: ; preds = %2
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.13, i64 0, i64 0))
br label %102
31: ; preds = %2
%32 = load i8*, i8** @AF_INET
%33 = load i32, i32* @SOCK_DGRAM
%34 = load i32, i32* @IPPROTO_UDP
%35 = tail call i32 @socket(i8* %32, i32 %33, i32 %34)
%36 = icmp eq i32 %35, -1
br i1 %36, label %37, label %39
37: ; preds = %31
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.13, i64 0, i64 0))
br label %102
39: ; preds = %31
%40 = call i32 @memset(i8* %10, i32 0, i32 24)
%41 = load i8*, i8** @AF_INET
%42 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i8* %41, i8** %42
%43 = call i8* @htons(i32 %18)
%44 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i8* %43, i8** %44
%45 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
%46 = call i64 @inet_aton(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32* %45)
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %39
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.11, i64 0, i64 0))
br label %102
50: ; preds = %39
%51 = call i32 @memset(i8* %11, i32 0, i32 24)
%52 = load i8*, i8** @AF_INET
%53 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2
store i8* %52, i8** %53
%54 = call i8* @htons(i32 %21)
%55 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
store i8* %54, i8** %55
%56 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1
%57 = call i64 @inet_aton(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32* %56)
%58 = icmp eq i64 %57, 0
br i1 %58, label %75, label %59
59: ; preds = %50
%60 = bitcast [10 x i32]* %8 to <4 x i32>*
store <4 x i32> <i32 99, i32 98, i32 97, i32 96>, <4 x i32>* %60
%61 = bitcast [10 x i32]* %9 to <4 x i32>*
store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %61
%62 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 4
%63 = getelementptr inbounds [10 x i32], [10 x i32]* %9, i64 0, i64 4
%64 = bitcast i32* %62 to <4 x i32>*
store <4 x i32> <i32 95, i32 94, i32 93, i32 92>, <4 x i32>* %64
%65 = bitcast i32* %63 to <4 x i32>*
store <4 x i32> <i32 5, i32 6, i32 7, i32 8>, <4 x i32>* %65
%66 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 8
store i32 91, i32* %66
%67 = getelementptr inbounds [10 x i32], [10 x i32]* %9, i64 0, i64 8
store i32 9, i32* %67
%68 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 9
store i32 90, i32* %68
%69 = getelementptr inbounds [10 x i32], [10 x i32]* %9, i64 0, i64 9
store i32 10, i32* %69
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%71 = bitcast [10 x i32]* %8 to i32**
%72 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%73 = call i32 @sendto(i32 %27, i32** %71, i32 40, i32 0, %struct.sockaddr* %72, i32 24)
%74 = icmp eq i32 %73, -1
br i1 %74, label %77, label %79
75: ; preds = %50
%76 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.11, i64 0, i64 0))
br label %102
77: ; preds = %59
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.9, i64 0, i64 0))
br label %102
79: ; preds = %59
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.7, i64 0, i64 0))
%81 = bitcast [10 x i32]* %9 to i32**
%82 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%83 = call i32 @sendto(i32 %35, i32** %81, i32 40, i32 0, %struct.sockaddr* %82, i32 24)
%84 = icmp eq i32 %83, -1
br i1 %84, label %85, label %87
85: ; preds = %79
%86 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.9, i64 0, i64 0))
br label %102
87: ; preds = %79
%88 = call i32 @recvfrom(i32 %27, i8* %14, i32 512, i32 0, %struct.sockaddr* %72, i32* %5)
%89 = load i32, i32* %45
%90 = call i8* @inet_ntoa(i32 %89)
%91 = load i8*, i8** %44
%92 = call i32 @ntohs(i8* %91)
%93 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i8* %90, i32 %92, i8* %14)
%94 = call i32 @close(i32 %27)
%95 = call i32 @recvfrom(i32 %35, i8* %14, i32 512, i32 0, %struct.sockaddr* %82, i32* %6)
%96 = load i32, i32* %56
%97 = call i8* @inet_ntoa(i32 %96)
%98 = load i8*, i8** %55
%99 = call i32 @ntohs(i8* %98)
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i8* %97, i32 %99, i8* %14)
%101 = call i32 @close(i32 %35)
br label %102
102: ; preds = %87, %85, %77, %75, %48, %37, %29
%103 = phi i32 [ 1, %29 ], [ 1, %37 ], [ 1, %48 ], [ 1, %75 ], [ 1, %77 ], [ 1, %85 ], [ 0, %87 ]
ret i32 %103
}