#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 /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ serv_addr;
typedef int /*<<< orphan*/ cli_addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int atoi(char *);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ inet_addr(char *);
char *inet_ntoa(TYPE_1__);
int ntohs(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int *);
int sendto(int, char *, int /*<<< orphan*/, int /*<<< orphan*/,
           struct sockaddr *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strlen(char *);
int main(int argc, char *argv[]) {
  int sockfd, portno;
  socklen_t cli_len;
  char buffer[256];
  struct sockaddr_in serv_addr, cli_addr;
  int numbytes;
  if (argc < 2) {
    printf("Usage: %s <port>\n", argv[0]);
    fprintf(stderr, "ERROR, no port provided\n");
    return -1;
    ;
  }
  if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
    perror("sws: error on socket()");
    return -1;
  }
  bzero((char *)&serv_addr, sizeof(serv_addr));
  portno = atoi(argv[1]);
  serv_addr.sin_family = AF_INET;
  serv_addr.sin_addr.s_addr = inet_addr("10.10.1.100");
  serv_addr.sin_port = htons(portno);
  if (bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) {
    close(sockfd);
    perror("sws: error on binding!");
    return -1;
  }
  printf("sws: waiting to recvfrom...\n");
  cli_len = sizeof(cli_addr);
  if ((numbytes = recvfrom(sockfd, buffer, 256 - 1, 0,
                           (struct sockaddr *)&cli_addr, &cli_len)) == -1) {
    perror("sws: error on recvfrom()!");
    return -1;
  }
  printf("sws: received packet from IP: %s and Port: %d\n",
         inet_ntoa(cli_addr.sin_addr), ntohs(cli_addr.sin_port));
  printf("listener: received packet is %d bytes long\n", numbytes);
  buffer[numbytes] = '\0';
  printf("listener: packet contains \"%s\" \n", buffer);
  if ((numbytes = sendto(sockfd, buffer, strlen(buffer), 0,
                         (struct sockaddr *)&cli_addr, cli_len)) == -1) {
    perror("sws: error in sendto()");
    return -1;
  }
  close(sockfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1249 <main+0x59>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2da1(%rip),%rax
mov    (%rax),%edi
lea    0xdda(%rip),%rsi
call   10a0 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1457 <main+0x267>
mov    0x2d98(%rip),%rax
mov    (%rax),%edi
mov    0x2d87(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    1286 <main+0x96>
lea    0xdb6(%rip),%rdi
call   10e0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1457 <main+0x267>
lea    -0x130(%rbp),%rdi
mov    $0xc,%esi
call   10f0 <bzero@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    0x2d3a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x128(%rbp)
lea    0xd85(%rip),%rdi
call   1090 <inet_addr@plt>
mov    %eax,-0x12c(%rbp)
mov    -0x18(%rbp),%edi
call   1050 <htons@plt>
mov    %eax,-0x130(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x130(%rbp),%rsi
mov    $0xc,%edx
call   10d0 <bind@plt>
cmp    $0x0,%rax
jge    1314 <main+0x124>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
lea    0xd4b(%rip),%rdi
call   10e0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1457 <main+0x267>
lea    0xd4a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xc,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x120(%rbp),%rsi
lea    -0x140(%rbp),%r8
mov    $0xff,%edx
xor    %ecx,%ecx
lea    -0x1c(%rbp),%r9
call   10b0 <recvfrom@plt>
mov    %eax,-0x144(%rbp)
cmp    $0xffffffff,%eax
jne    1371 <main+0x181>
lea    0xd22(%rip),%rdi
call   10e0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1457 <main+0x267>
mov    -0x13c(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,-0x160(%rbp)
mov    -0x140(%rbp),%edi
call   10c0 <ntohs@plt>
mov    -0x160(%rbp),%rsi
mov    %eax,%edx
lea    0xcfe(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x144(%rbp),%esi
lea    0xd19(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0x144(%rbp),%rax
movb   $0x0,-0x120(%rbp,%rax,1)
lea    -0x120(%rbp),%rsi
lea    0xd21(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x154(%rbp)
lea    -0x120(%rbp),%rax
mov    %rax,-0x150(%rbp)
lea    -0x120(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x154(%rbp),%edi
mov    -0x150(%rbp),%rsi
mov    %eax,%edx
lea    -0x140(%rbp),%r8
mov    -0x1c(%rbp),%r9d
xor    %ecx,%ecx
call   1070 <sendto@plt>
mov    %eax,-0x144(%rbp)
cmp    $0xffffffff,%eax
jne    1448 <main+0x258>
lea    0xce1(%rip),%rdi
call   10e0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1457 <main+0x267>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x138,%rsp
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     1246 <main+0x46>
mov    (%rbx),%rsi
lea    0xde1(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2da3(%rip),%rax
mov    (%rax),%edi
lea    0xddc(%rip),%rsi
call   10b0 <fprintf@plt>
mov    $0xffffffff,%r15d
jmp    1388 <main+0x188>
mov    0x2d9b(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2d89(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
cmp    $0xffffffff,%eax
je     1399 <main+0x199>
mov    %eax,%r14d
lea    0x20(%rsp),%r15
mov    %r15,%rdi
mov    $0xc,%esi
call   1100 <bzero@plt>
mov    0x8(%rbx),%rdi
call   1110 <atoi@plt>
mov    %eax,%ebx
mov    0x0(%rbp),%eax
mov    %eax,0x28(%rsp)
lea    0xdab(%rip),%rdi
call   10a0 <inet_addr@plt>
mov    %eax,0x24(%rsp)
mov    %ebx,%edi
call   1060 <htons@plt>
mov    %eax,0x20(%rsp)
mov    %r14d,%edi
mov    %r15,%rsi
mov    $0xc,%edx
call   10e0 <bind@plt>
test   %rax,%rax
js     13a2 <main+0x1a2>
lea    0xe47(%rip),%rdi
call   1030 <puts@plt>
movl   $0xc,0xc(%rsp)
lea    0x30(%rsp),%rsi
lea    0x10(%rsp),%r8
lea    0xc(%rsp),%r9
mov    %r14d,%edi
mov    $0xff,%edx
xor    %ecx,%ecx
call   10c0 <recvfrom@plt>
cmp    $0xffffffff,%eax
je     13b3 <main+0x1b3>
mov    %eax,%ebx
mov    0x14(%rsp),%edi
call   1040 <inet_ntoa@plt>
mov    %rax,%rbp
mov    0x10(%rsp),%edi
call   10d0 <ntohs@plt>
lea    0xd62(%rip),%rdi
xor    %r15d,%r15d
mov    %rbp,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xd7b(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
movslq %ebx,%rax
movb   $0x0,0x30(%rsp,%rax,1)
lea    0xd8f(%rip),%rdi
lea    0x30(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    0xc(%rsp),%r9d
lea    0x10(%rsp),%r8
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <sendto@plt>
cmp    $0xffffffff,%eax
je     13bc <main+0x1bc>
mov    %r14d,%edi
call   1090 <close@plt>
mov    %r15d,%eax
add    $0x138,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc8b(%rip),%rdi
jmp    13c3 <main+0x1c3>
mov    %r14d,%edi
call   1090 <close@plt>
lea    0xc9d(%rip),%rdi
jmp    13c3 <main+0x1c3>
lea    0xcab(%rip),%rdi
jmp    13c3 <main+0x1c3>
lea    0xd38(%rip),%rdi
call   10f0 <perror@plt>
jmp    123b <main+0x3b>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [18 x i8] c"Usage: %s <port>\0A\00"
@stderr = global i32 0
@.str.1 = [25 x i8] c"ERROR, no port provided\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str.2 = [23 x i8] c"sws: error on socket()\00"
@.str.3 = [12 x i8] c"10.10.1.100\00"
@.str.4 = [23 x i8] c"sws: error on binding!\00"
@.str.5 = [29 x i8] c"sws: waiting to recvfrom...\0A\00"
@.str.6 = [26 x i8] c"sws: error on recvfrom()!\00"
@.str.7 = [47 x i8] c"sws: received packet from IP: %s and Port: %d\0A\00"
@.str.8 = [44 x i8] c"listener: received packet is %d bytes long\0A\00"
@.str.9 = [33 x i8] c"listener: packet contains \22%s\22 \0A\00"
@.str.10 = [23 x i8] c"sws: error in sendto()\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [256 x i8]
%10 = alloca %struct.sockaddr_in
%11 = alloca %struct.sockaddr_in
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 2
br i1 %14, label %15, label %22
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %90
22: ; preds = %2
%23 = load i32, i32* @AF_INET
%24 = load i32, i32* @SOCK_DGRAM
%25 = call i32 @socket(i32 %23, i32 %24, i32 0)
store i32 %25, i32* %6
%26 = icmp eq i32 %25, -1
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %90
29: ; preds = %22
%30 = bitcast %struct.sockaddr_in* %10 to i8*
%31 = call i32 @bzero(i8* %30, i32 12)
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i32 @atoi(i8* %34)
store i32 %35, i32* %7
%36 = load i32, i32* @AF_INET
%37 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 2
store i32 %36, i32* %37
%38 = call i32 @inet_addr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%39 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 1
%40 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %39, i32 0, i32 0
store i32 %38, i32* %40
%41 = load i32, i32* %7
%42 = call i32 @htons(i32 %41)
%43 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 0
store i32 %42, i32* %43
%44 = load i32, i32* %6
%45 = bitcast %struct.sockaddr_in* %10 to %struct.sockaddr*
%46 = call i64 @bind(i32 %44, %struct.sockaddr* %45, i32 12)
%47 = icmp slt i64 %46, 0
br i1 %47, label %48, label %52
48: ; preds = %29
%49 = load i32, i32* %6
%50 = call i32 @close(i32 %49)
%51 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %90
52: ; preds = %29
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
store i32 12, i32* %8
%54 = load i32, i32* %6
%55 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%56 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%57 = call i32 @recvfrom(i32 %54, i8* %55, i32 255, i32 0, %struct.sockaddr* %56, i32* %8)
store i32 %57, i32* %12
%58 = icmp eq i32 %57, -1
br i1 %58, label %59, label %61
59: ; preds = %52
%60 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
store i32 -1, i32* %3
br label %90
61: ; preds = %52
%62 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 1
%63 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %62, i32 0, i32 0
%64 = load i32, i32* %63
%65 = call i8* @inet_ntoa(i32 %64)
%66 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
%67 = load i32, i32* %66
%68 = call i32 @ntohs(i32 %67)
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0), i8* %65, i32 %68)
%70 = load i32, i32* %12
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i32 %70)
%72 = load i32, i32* %12
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 %73
store i8 0, i8* %74
%75 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i8* %75)
%77 = load i32, i32* %6
%78 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%79 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%80 = call i32 @strlen(i8* %79)
%81 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%82 = load i32, i32* %8
%83 = call i32 @sendto(i32 %77, i8* %78, i32 %80, i32 0, %struct.sockaddr* %81, i32 %82)
store i32 %83, i32* %12
%84 = icmp eq i32 %83, -1
br i1 %84, label %85, label %87
85: ; preds = %61
%86 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0))
store i32 -1, i32* %3
br label %90
87: ; preds = %61
%88 = load i32, i32* %6
%89 = call i32 @close(i32 %88)
store i32 0, i32* %3
br label %90
90: ; preds = %87, %85, %59, %48, %27, %15
%91 = load i32, i32* %3
ret i32 %91
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [18 x i8] c"Usage: %s <port>\0A\00"
@stderr = global i32 0
@.str.1 = [25 x i8] c"ERROR, no port provided\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str.2 = [23 x i8] c"sws: error on socket()\00"
@.str.3 = [12 x i8] c"10.10.1.100\00"
@.str.4 = [23 x i8] c"sws: error on binding!\00"
@.str.6 = [26 x i8] c"sws: error on recvfrom()!\00"
@.str.7 = [47 x i8] c"sws: received packet from IP: %s and Port: %d\0A\00"
@.str.8 = [44 x i8] c"listener: received packet is %d bytes long\0A\00"
@.str.9 = [33 x i8] c"listener: packet contains \22%s\22 \0A\00"
@.str.10 = [23 x i8] c"sws: error in sendto()\00"
@str = [28 x i8] c"sws: waiting to recvfrom...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca [256 x i8]
%5 = alloca %struct.sockaddr_in
%6 = alloca %struct.sockaddr_in
%7 = bitcast i32* %3 to i8*
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%9 = bitcast %struct.sockaddr_in* %5 to i8*
%10 = bitcast %struct.sockaddr_in* %6 to i8*
%11 = icmp slt i32 %0, 2
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8*, i8** %1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @stderr
%16 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %68
17: ; preds = %2
%18 = load i32, i32* @AF_INET
%19 = load i32, i32* @SOCK_DGRAM
%20 = tail call i32 @socket(i32 %18, i32 %19, i32 0)
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = tail call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %68
24: ; preds = %17
%25 = call i32 @bzero(i8* %9, i32 12)
%26 = getelementptr inbounds i8*, i8** %1, i64 1
%27 = load i8*, i8** %26
%28 = tail call i32 @atoi(i8* %27)
%29 = load i32, i32* @AF_INET
%30 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 2
store i32 %29, i32* %30
%31 = tail call i32 @inet_addr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%32 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 1, i32 0
store i32 %31, i32* %32
%33 = tail call i32 @htons(i32 %28)
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 0
store i32 %33, i32* %34
%35 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%36 = call i64 @bind(i32 %20, %struct.sockaddr* %35, i32 12)
%37 = icmp slt i64 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %24
%39 = call i32 @close(i32 %20)
%40 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
br label %68
41: ; preds = %24
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
store i32 12, i32* %3
%43 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%44 = call i32 @recvfrom(i32 %20, i8* %8, i32 255, i32 0, %struct.sockaddr* %43, i32* %3)
%45 = icmp eq i32 %44, -1
br i1 %45, label %46, label %48
46: ; preds = %41
%47 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
br label %68
48: ; preds = %41
%49 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 1, i32 0
%50 = load i32, i32* %49
%51 = call i8* @inet_ntoa(i32 %50)
%52 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 0
%53 = load i32, i32* %52
%54 = call i32 @ntohs(i32 %53)
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0), i8* %51, i32 %54)
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i32 %44)
%57 = sext i32 %44 to i64
%58 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %57
store i8 0, i8* %58
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i8* %8)
%60 = call i32 @strlen(i8* %8)
%61 = load i32, i32* %3
%62 = call i32 @sendto(i32 %20, i8* %8, i32 %60, i32 0, %struct.sockaddr* %43, i32 %61)
%63 = icmp eq i32 %62, -1
br i1 %63, label %64, label %66
64: ; preds = %48
%65 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0))
br label %68
66: ; preds = %48
%67 = call i32 @close(i32 %20)
br label %68
68: ; preds = %66, %64, %46, %38, %22, %12
%69 = phi i32 [ -1, %12 ], [ -1, %22 ], [ -1, %38 ], [ -1, %46 ], [ -1, %64 ], [ 0, %66 ]
ret i32 %69
}