#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  int sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ mestre;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ IPPROTO_UDP;
int /*<<< orphan*/ SOCK_DGRAM;
int atoi(char *);
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int htons(int);
char *inet_ntoa(TYPE_1__);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int recvfrom(int, int **, int, int /*<<< orphan*/, struct sockaddr *, int *);
int /*<<< orphan*/ sendto(int, char *, int, int /*<<< orphan*/,
                          struct sockaddr *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
int /*<<< orphan*/ testArguments(int, char **);
int main(int argc, char *argv[]) {
  struct sockaddr_in mestre;
  int s, i;
  socklen_t slen = sizeof(mestre);
  char buf[512];
  testArguments(argc, argv);
  int PORT = atoi(argv[1]);
  int vetor[10], soma = 0;
  if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
    printf("ERRO NA CRICAO DO SOCKET");
    return 1;
  }
  memset((char *)&mestre, 0, sizeof(mestre));
  mestre.sin_family = AF_INET;
  mestre.sin_port = htons(PORT);
  mestre.sin_addr.s_addr = htonl(INADDR_ANY);
  if (bind(s, (struct sockaddr *)&mestre, sizeof(mestre)) == -1) {
    printf("ERRO NO BINDING");
    return 1;
  }
  for (i = 0; i < 10; i++)
    vetor[i] = -1;
  if (recvfrom(s, &vetor, sizeof(int) * 10, 0, (struct sockaddr *)&mestre,
               &slen) == -1) {
    printf("ERRO AO RECEBER DADO");
    return 1;
  }
  for (i = 0; i < 10; i++)
    printf("Pacote recebido de %s:%d\nDado: %d\n", inet_ntoa(mestre.sin_addr),
           htons(mestre.sin_port), vetor[i]);
  for (i = 0; i < 10; i++)
    soma += vetor[i];
  sprintf(buf, "Escravo na porta#%d: soma do vetor=%d", htons(mestre.sin_port),
          soma);
  sendto(s, buf, 512, 0, (struct sockaddr *)&mestre, slen);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x280,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xc,-0x2c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10d0 <testArguments@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x234(%rbp)
movl   $0x0,-0x264(%rbp)
mov    0x2dd8(%rip),%rax
mov    (%rax),%edi
mov    0x2dbf(%rip),%rax
mov    (%rax),%esi
mov    0x2d9e(%rip),%rax
mov    (%rax),%edx
call   10e0 <socket@plt>
mov    %eax,-0x24(%rbp)
cmp    $0xffffffff,%eax
jne    124f <main+0x8f>
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1411 <main+0x251>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1070 <memset@plt>
mov    0x2d82(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x234(%rbp),%edi
call   1040 <htons@plt>
mov    %eax,-0x20(%rbp)
mov    0x2d60(%rip),%rax
mov    (%rax),%edi
call   1060 <htonl@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0xc,%edx
call   10a0 <bind@plt>
cmp    $0xffffffff,%eax
jne    12be <main+0xfe>
lea    0xd6e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1411 <main+0x251>
movl   $0x0,-0x28(%rbp)
cmpl   $0xa,-0x28(%rbp)
jge    12ec <main+0x12c>
movslq -0x28(%rbp),%rax
movl   $0xffffffff,-0x260(%rbp,%rax,4)
ff ff ff ff
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12c5 <main+0x105>
mov    -0x24(%rbp),%edi
lea    -0x260(%rbp),%rsi
lea    -0x20(%rbp),%r8
mov    $0x28,%edx
xor    %ecx,%ecx
lea    -0x2c(%rbp),%r9
call   1090 <recvfrom@plt>
cmp    $0xffffffff,%eax
jne    132d <main+0x16d>
lea    0xd0f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1411 <main+0x251>
movl   $0x0,-0x28(%rbp)
cmpl   $0xa,-0x28(%rbp)
jge    1385 <main+0x1c5>
mov    -0x1c(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,-0x270(%rbp)
mov    -0x20(%rbp),%edi
call   1040 <htons@plt>
mov    -0x270(%rbp),%rsi
mov    %eax,%edx
movslq -0x28(%rbp),%rax
mov    -0x260(%rbp,%rax,4),%ecx
lea    0xcce(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1334 <main+0x174>
movl   $0x0,-0x28(%rbp)
cmpl   $0xa,-0x28(%rbp)
jge    13bb <main+0x1fb>
movslq -0x28(%rbp),%rax
mov    -0x260(%rbp,%rax,4),%eax
add    -0x264(%rbp),%eax
mov    %eax,-0x264(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    138c <main+0x1cc>
lea    -0x230(%rbp),%rax
mov    %rax,-0x278(%rbp)
mov    -0x20(%rbp),%edi
call   1040 <htons@plt>
mov    -0x278(%rbp),%rdi
mov    %eax,%edx
mov    -0x264(%rbp),%ecx
lea    0xc7a(%rip),%rsi
call   10c0 <sprintf@plt>
mov    -0x24(%rbp),%edi
lea    -0x230(%rbp),%rsi
lea    -0x20(%rbp),%r8
mov    -0x2c(%rbp),%r9d
mov    $0x200,%edx
xor    %ecx,%ecx
call   1080 <sendto@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x280,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x240,%rsp
mov    %rsi,%rbx
movl   $0xc,0xc(%rsp)
call   10d0 <testArguments@plt>
mov    0x8(%rbx),%rdi
call   10b0 <atoi@plt>
mov    %eax,%ebp
mov    0x2df7(%rip),%rbx
mov    (%rbx),%edi
mov    0x2dde(%rip),%rax
mov    (%rax),%esi
mov    0x2dbd(%rip),%rax
mov    (%rax),%edx
call   10e0 <socket@plt>
cmp    $0xffffffff,%eax
je     149b <main+0x2db>
mov    %eax,%r15d
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1070 <memset@plt>
mov    (%rbx),%eax
mov    %eax,0x8(%rsp)
mov    %ebp,%edi
call   1040 <htons@plt>
mov    %eax,(%rsp)
mov    0x2da1(%rip),%rax
mov    (%rax),%edi
call   1060 <htonl@plt>
mov    %eax,0x4(%rsp)
mov    %r15d,%edi
mov    %r14,%rsi
mov    $0xc,%edx
call   10a0 <bind@plt>
cmp    $0xffffffff,%eax
je     14a4 <main+0x2e4>
pcmpeqd %xmm0,%xmm0
movdqa %xmm0,0x20(%rsp)
movdqa %xmm0,0x10(%rsp)
movq   $0xffffffffffffffff,0x30(%rsp)
ff ff
lea    0x10(%rsp),%rsi
xor    %r12d,%r12d
mov    %rsp,%r8
lea    0xc(%rsp),%r9
mov    %r15d,%edi
mov    $0x28,%edx
xor    %ecx,%ecx
call   1090 <recvfrom@plt>
cmp    $0xffffffff,%eax
je     14ad <main+0x2ed>
mov    0x4(%rsp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rbx
mov    (%rsp),%edi
call   1040 <htons@plt>
mov    0x10(%rsp),%ecx
lea    0xd7b(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rbx
mov    (%rsp),%edi
call   1040 <htons@plt>
mov    0x14(%rsp),%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rbx
mov    (%rsp),%edi
call   1040 <htons@plt>
mov    0x18(%rsp),%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rbx
mov    (%rsp),%edi
call   1040 <htons@plt>
mov    0x1c(%rsp),%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rbx
mov    (%rsp),%edi
call   1040 <htons@plt>
mov    0x20(%rsp),%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rbx
mov    (%rsp),%edi
call   1040 <htons@plt>
mov    0x24(%rsp),%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rbx
mov    (%rsp),%edi
call   1040 <htons@plt>
mov    0x28(%rsp),%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rbx
mov    (%rsp),%edi
call   1040 <htons@plt>
mov    0x2c(%rsp),%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rbx
mov    (%rsp),%edi
call   1040 <htons@plt>
mov    0x30(%rsp),%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rbx
mov    (%rsp),%edi
call   1040 <htons@plt>
mov    0x34(%rsp),%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movdqu 0x18(%rsp),%xmm0
movdqu 0x28(%rsp),%xmm1
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%ebx
add    0x14(%rsp),%ebx
add    0x10(%rsp),%ebx
mov    (%rsp),%edi
call   1040 <htons@plt>
lea    0xbf3(%rip),%rsi
lea    0x40(%rsp),%rbp
mov    %rbp,%rdi
mov    %eax,%edx
mov    %ebx,%ecx
call   10c0 <sprintf@plt>
mov    0xc(%rsp),%r9d
mov    %rsp,%r8
mov    %r15d,%edi
mov    %rbp,%rsi
mov    $0x200,%edx
xor    %ecx,%ecx
call   1080 <sendto@plt>
jmp    14c1 <main+0x301>
lea    0xb5e(%rip),%rdi
jmp    14b4 <main+0x2f4>
lea    0xb6e(%rip),%rdi
jmp    14b4 <main+0x2f4>
lea    0xb75(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%r12d
mov    %r12d,%eax
add    $0x240,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
@.str = [25 x i8] c"ERRO NA CRICAO DO SOCKET\00"
@INADDR_ANY = global i32 0
@.str.1 = [16 x i8] c"ERRO NO BINDING\00"
@.str.2 = [21 x i8] c"ERRO AO RECEBER DADO\00"
@.str.3 = [35 x i8] c"Pacote recebido de %s:%d\0ADado: %d\0A\00"
@.str.4 = [38 x i8] c"Escravo na porta#%d: soma do vetor=%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.sockaddr_in
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [512 x i8]
%11 = alloca i32
%12 = alloca [10 x i32]
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 12, i32* %9
%14 = load i32, i32* %4
%15 = load i8**, i8*** %5
%16 = call i32 @testArguments(i32 %14, i8** %15)
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
store i32 %20, i32* %11
store i32 0, i32* %13
%21 = load i32, i32* @AF_INET
%22 = load i32, i32* @SOCK_DGRAM
%23 = load i32, i32* @IPPROTO_UDP
%24 = call i32 @socket(i32 %21, i32 %22, i32 %23)
store i32 %24, i32* %7
%25 = icmp eq i32 %24, -1
br i1 %25, label %26, label %28
26: ; preds = %2
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %111
28: ; preds = %2
%29 = bitcast %struct.sockaddr_in* %6 to i8*
%30 = call i32 @memset(i8* %29, i32 0, i32 12)
%31 = load i32, i32* @AF_INET
%32 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 2
store i32 %31, i32* %32
%33 = load i32, i32* %11
%34 = call i32 @htons(i32 %33)
%35 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
store i32 %34, i32* %35
%36 = load i32, i32* @INADDR_ANY
%37 = call i32 @htonl(i32 %36)
%38 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 1
%39 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %38, i32 0, i32 0
store i32 %37, i32* %39
%40 = load i32, i32* %7
%41 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%42 = call i32 @bind(i32 %40, %struct.sockaddr* %41, i32 12)
%43 = icmp eq i32 %42, -1
br i1 %43, label %44, label %46
44: ; preds = %28
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %111
46: ; preds = %28
store i32 0, i32* %8
br label %47
47: ; preds = %54, %46
%48 = load i32, i32* %8
%49 = icmp slt i32 %48, 10
br i1 %49, label %50, label %57
50: ; preds = %47
%51 = load i32, i32* %8
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [10 x i32], [10 x i32]* %12, i64 0, i64 %52
store i32 -1, i32* %53
br label %54
54: ; preds = %50
%55 = load i32, i32* %8
%56 = add nsw i32 %55, 1
store i32 %56, i32* %8
br label %47
57: ; preds = %47
%58 = load i32, i32* %7
%59 = bitcast [10 x i32]* %12 to i32**
%60 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%61 = call i32 @recvfrom(i32 %58, i32** %59, i32 40, i32 0, %struct.sockaddr* %60, i32* %9)
%62 = icmp eq i32 %61, -1
br i1 %62, label %63, label %65
63: ; preds = %57
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %111
65: ; preds = %57
store i32 0, i32* %8
br label %66
66: ; preds = %82, %65
%67 = load i32, i32* %8
%68 = icmp slt i32 %67, 10
br i1 %68, label %69, label %85
69: ; preds = %66
%70 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 1
%71 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %70, i32 0, i32 0
%72 = load i32, i32* %71
%73 = call i8* @inet_ntoa(i32 %72)
%74 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
%75 = load i32, i32* %74
%76 = call i32 @htons(i32 %75)
%77 = load i32, i32* %8
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [10 x i32], [10 x i32]* %12, i64 0, i64 %78
%80 = load i32, i32* %79
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8* %73, i32 %76, i32 %80)
br label %82
82: ; preds = %69
%83 = load i32, i32* %8
%84 = add nsw i32 %83, 1
store i32 %84, i32* %8
br label %66
85: ; preds = %66
store i32 0, i32* %8
br label %86
86: ; preds = %96, %85
%87 = load i32, i32* %8
%88 = icmp slt i32 %87, 10
br i1 %88, label %89, label %99
89: ; preds = %86
%90 = load i32, i32* %8
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [10 x i32], [10 x i32]* %12, i64 0, i64 %91
%93 = load i32, i32* %92
%94 = load i32, i32* %13
%95 = add nsw i32 %94, %93
store i32 %95, i32* %13
br label %96
96: ; preds = %89
%97 = load i32, i32* %8
%98 = add nsw i32 %97, 1
store i32 %98, i32* %8
br label %86
99: ; preds = %86
%100 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%101 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
%102 = load i32, i32* %101
%103 = call i32 @htons(i32 %102)
%104 = load i32, i32* %13
%105 = call i32 @sprintf(i8* %100, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 %103, i32 %104)
%106 = load i32, i32* %7
%107 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%108 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%109 = load i32, i32* %9
%110 = call i32 @sendto(i32 %106, i8* %107, i32 512, i32 0, %struct.sockaddr* %108, i32 %109)
store i32 0, i32* %3
br label %111
111: ; preds = %99, %63, %44, %26
%112 = load i32, i32* %3
ret i32 %112
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
@.str = [25 x i8] c"ERRO NA CRICAO DO SOCKET\00"
@INADDR_ANY = global i32 0
@.str.1 = [16 x i8] c"ERRO NO BINDING\00"
@.str.2 = [21 x i8] c"ERRO AO RECEBER DADO\00"
@.str.3 = [35 x i8] c"Pacote recebido de %s:%d\0ADado: %d\0A\00"
@.str.4 = [38 x i8] c"Escravo na porta#%d: soma do vetor=%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = alloca [512 x i8]
%6 = alloca [10 x i32]
%7 = bitcast [10 x i32]* %6 to i8*
%8 = bitcast %struct.sockaddr_in* %3 to i8*
%9 = bitcast i32* %4 to i8*
store i32 12, i32* %4
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%11 = tail call i32 @testArguments(i32 %0, i8** %1)
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32 @atoi(i8* %13)
%15 = load i32, i32* @AF_INET
%16 = load i32, i32* @SOCK_DGRAM
%17 = load i32, i32* @IPPROTO_UDP
%18 = tail call i32 @socket(i32 %15, i32 %16, i32 %17)
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %125
22: ; preds = %2
%23 = call i32 @memset(i8* %8, i32 0, i32 12)
%24 = load i32, i32* @AF_INET
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %24, i32* %25
%26 = call i32 @htons(i32 %14)
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %26, i32* %27
%28 = load i32, i32* @INADDR_ANY
%29 = call i32 @htonl(i32 %28)
%30 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
store i32 %29, i32* %30
%31 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%32 = call i32 @bind(i32 %18, %struct.sockaddr* %31, i32 12)
%33 = icmp eq i32 %32, -1
br i1 %33, label %38, label %34
34: ; preds = %22
%35 = bitcast [10 x i32]* %6 to i32**
%36 = call i32 @recvfrom(i32 %18, i32** %35, i32 40, i32 0, %struct.sockaddr* %31, i32* %4)
%37 = icmp eq i32 %36, -1
br i1 %37, label %123, label %40
38: ; preds = %22
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %125
40: ; preds = %34
%41 = load i32, i32* %30
%42 = call i8* @inet_ntoa(i32 %41)
%43 = load i32, i32* %27
%44 = call i32 @htons(i32 %43)
%45 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
%46 = load i32, i32* %45
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8* %42, i32 %44, i32 %46)
%48 = load i32, i32* %30
%49 = call i8* @inet_ntoa(i32 %48)
%50 = load i32, i32* %27
%51 = call i32 @htons(i32 %50)
%52 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 1
%53 = load i32, i32* %52
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8* %49, i32 %51, i32 %53)
%55 = load i32, i32* %30
%56 = call i8* @inet_ntoa(i32 %55)
%57 = load i32, i32* %27
%58 = call i32 @htons(i32 %57)
%59 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 2
%60 = load i32, i32* %59
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8* %56, i32 %58, i32 %60)
%62 = load i32, i32* %30
%63 = call i8* @inet_ntoa(i32 %62)
%64 = load i32, i32* %27
%65 = call i32 @htons(i32 %64)
%66 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 3
%67 = load i32, i32* %66
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8* %63, i32 %65, i32 %67)
%69 = load i32, i32* %30
%70 = call i8* @inet_ntoa(i32 %69)
%71 = load i32, i32* %27
%72 = call i32 @htons(i32 %71)
%73 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 4
%74 = load i32, i32* %73
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8* %70, i32 %72, i32 %74)
%76 = load i32, i32* %30
%77 = call i8* @inet_ntoa(i32 %76)
%78 = load i32, i32* %27
%79 = call i32 @htons(i32 %78)
%80 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 5
%81 = load i32, i32* %80
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8* %77, i32 %79, i32 %81)
%83 = load i32, i32* %30
%84 = call i8* @inet_ntoa(i32 %83)
%85 = load i32, i32* %27
%86 = call i32 @htons(i32 %85)
%87 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 6
%88 = load i32, i32* %87
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8* %84, i32 %86, i32 %88)
%90 = load i32, i32* %30
%91 = call i8* @inet_ntoa(i32 %90)
%92 = load i32, i32* %27
%93 = call i32 @htons(i32 %92)
%94 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 7
%95 = load i32, i32* %94
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8* %91, i32 %93, i32 %95)
%97 = load i32, i32* %30
%98 = call i8* @inet_ntoa(i32 %97)
%99 = load i32, i32* %27
%100 = call i32 @htons(i32 %99)
%101 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 8
%102 = load i32, i32* %101
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8* %98, i32 %100, i32 %102)
%104 = load i32, i32* %30
%105 = call i8* @inet_ntoa(i32 %104)
%106 = load i32, i32* %27
%107 = call i32 @htons(i32 %106)
%108 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 9
%109 = load i32, i32* %108
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8* %105, i32 %107, i32 %109)
%111 = load i32, i32* %45
%112 = load i32, i32* %52
%113 = bitcast i32* %59 to <8 x i32>*
%114 = load <8 x i32>, <8 x i32>* %113
%115 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %114)
%116 = add nsw i32 %115, %112
%117 = add nsw i32 %116, %111
%118 = load i32, i32* %27
%119 = call i32 @htons(i32 %118)
%120 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 %119, i32 %117)
%121 = load i32, i32* %4
%122 = call i32 @sendto(i32 %18, i8* %10, i32 512, i32 0, %struct.sockaddr* %31, i32 %121)
br label %125
123: ; preds = %34
%124 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %125
125: ; preds = %40, %123, %38, %20
%126 = phi i32 [ 1, %20 ], [ 1, %38 ], [ 1, %123 ], [ 0, %40 ]
ret i32 %126
}