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

/* Variables and functions */
void *AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SOCK_DGRAM;
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
void *htons(int);
scalar_t__ inet_aton(char *, TYPE_1__ *);
int /*<<< orphan*/ memset(char *, int, int);
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(void *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char **argv) {
  struct sockaddr_in cli_addr;
  struct sockaddr_in remaddr;
  int s = 0;
  char buf[1024];
  char *server = "192.168.1.4";
  socklen_t addrlen = sizeof(remaddr);
  int recvlen;
  if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
    printf("open socket fail.\n");
    return 0;
  }
  memset((char *)&cli_addr, 0, sizeof(cli_addr));
  cli_addr.sin_family = AF_INET;
  cli_addr.sin_addr.s_addr = htonl(INADDR_ANY);
  cli_addr.sin_port = htons(0);
  if (bind(s, (struct sockaddr *)&cli_addr, sizeof(cli_addr)) < 0) {
    printf("bind failed.\n");
    return 0;
  }
  memset((char *)&remaddr, 0, sizeof(remaddr));
  remaddr.sin_family = AF_INET;
  remaddr.sin_port = htons(11111);
  if (inet_aton(server, &remaddr.sin_addr) == 0) {
    printf("inet_aton() failed.\n");
    return 1;
  }
  printf("sending packet to %s port %s\n", server, "11111");
  sprintf(buf, "%s", argv[1]);
  if (sendto(s, buf, strlen(buf), 0, (struct sockaddr *)&remaddr, addrlen) ==
      -1) {
    printf("sendto fail\n");
    return 1;
  }
  memset(buf, 0x00, 1024);
  recvlen = recvfrom(s, buf, 1024, 0, (struct sockaddr *)&cli_addr, &addrlen);
  printf("received %d bytes\n", recvlen);
  if (recvlen > 0) {
    buf[recvlen] = 0;
    printf("received message:%s\n", buf);
  }
  close(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x470,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x44(%rbp)
lea    0xe19(%rip),%rax
mov    %rax,-0x458(%rbp)
movl   $0x18,-0x45c(%rbp)
mov    0x2de9(%rip),%rax
mov    (%rax),%rdi
mov    0x2dcf(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
mov    %eax,-0x44(%rbp)
cmp    $0xffffffff,%eax
jne    1238 <main+0x78>
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1433 <main+0x273>
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1070 <memset@plt>
mov    0x2d99(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    0x2d83(%rip),%rax
mov    (%rax),%edi
call   1060 <htonl@plt>
mov    %eax,-0x28(%rbp)
xor    %edi,%edi
call   1040 <htons@plt>
mov    %rax,-0x20(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0x18,%edx
call   10c0 <bind@plt>
cmp    $0x0,%rax
jge    12a7 <main+0xe7>
lea    0xd8b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1433 <main+0x273>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1070 <memset@plt>
mov    0x2d2a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    $0x2b67,%edi
call   1040 <htons@plt>
mov    %rax,-0x38(%rbp)
mov    -0x458(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   10a0 <inet_aton@plt>
cmp    $0x0,%rax
jne    1307 <main+0x147>
lea    0xd39(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1433 <main+0x273>
mov    -0x458(%rbp),%rsi
lea    0xd2d(%rip),%rdi
lea    0xd44(%rip),%rdx
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x450(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd2d(%rip),%rsi
call   10d0 <sprintf@plt>
mov    -0x44(%rbp),%eax
mov    %eax,-0x46c(%rbp)
lea    -0x450(%rbp),%rax
mov    %rax,-0x468(%rbp)
lea    -0x450(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x46c(%rbp),%edi
mov    -0x468(%rbp),%rsi
mov    %eax,%edx
lea    -0x40(%rbp),%r8
mov    -0x45c(%rbp),%r9d
xor    %ecx,%ecx
call   1080 <sendto@plt>
cmp    $0xffffffff,%eax
jne    13a5 <main+0x1e5>
lea    0xcd7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1433 <main+0x273>
lea    -0x450(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    -0x44(%rbp),%edi
lea    -0x450(%rbp),%rsi
lea    -0x28(%rbp),%r8
mov    $0x400,%edx
xor    %ecx,%ecx
lea    -0x45c(%rbp),%r9
call   10b0 <recvfrom@plt>
mov    %eax,-0x460(%rbp)
mov    -0x460(%rbp),%esi
lea    0xc8a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x460(%rbp)
jle    1424 <main+0x264>
movslq -0x460(%rbp),%rax
movb   $0x0,-0x450(%rbp,%rax,1)
lea    -0x450(%rbp),%rsi
lea    0xc6c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x44(%rbp),%edi
call   1090 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x470,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x440,%rsp
mov    %rsi,%r14
movl   $0x18,0xc(%rsp)
mov    0x2df7(%rip),%r12
mov    (%r12),%rdi
mov    0x2ddc(%rip),%rax
mov    (%rax),%esi
xor    %ebp,%ebp
xor    %edx,%edx
call   10f0 <socket@plt>
cmp    $0xffffffff,%eax
je     1374 <main+0x1a4>
mov    %eax,%r15d
lea    0x10(%rsp),%rbx
xor    %ebp,%ebp
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1090 <memset@plt>
mov    (%r12),%rax
mov    %rax,0x20(%rsp)
mov    0x2da7(%rip),%rax
mov    (%rax),%edi
call   1080 <htonl@plt>
mov    %eax,0x10(%rsp)
xor    %edi,%edi
call   1060 <htons@plt>
mov    %rax,0x18(%rsp)
mov    %r15d,%edi
mov    %rbx,%rsi
mov    $0x18,%edx
call   10e0 <bind@plt>
test   %rax,%rax
js     1382 <main+0x1b2>
lea    0x28(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1090 <memset@plt>
mov    (%r12),%rax
mov    %rax,0x38(%rsp)
mov    $0x2b67,%edi
call   1060 <htons@plt>
mov    %rax,0x30(%rsp)
lea    0xd64(%rip),%rdi
mov    %rbx,%rsi
call   10c0 <inet_aton@plt>
test   %rax,%rax
je     1390 <main+0x1c0>
lea    0xd58(%rip),%rdi
lea    0xd45(%rip),%rsi
lea    0xd68(%rip),%rdx
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%r14),%rsi
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x28(%rsp),%r8
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
mov    $0x18,%r9d
call   10a0 <sendto@plt>
cmp    $0xffffffff,%eax
je     1399 <main+0x1c9>
lea    0x40(%rsp),%rbx
xor    %ebp,%ebp
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1090 <memset@plt>
lea    0x10(%rsp),%r8
lea    0xc(%rsp),%r9
mov    %r15d,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   10d0 <recvfrom@plt>
mov    %eax,%r14d
lea    0xcef(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
test   %r14d,%r14d
jle    136a <main+0x19a>
mov    %r14d,%eax
movb   $0x0,0x40(%rsp,%rax,1)
lea    0xce5(%rip),%rdi
lea    0x40(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15d,%edi
call   10b0 <close@plt>
jmp    13aa <main+0x1da>
lea    0xd0a(%rip),%rdi
call   1040 <puts@plt>
jmp    13aa <main+0x1da>
lea    0xcef(%rip),%rdi
call   1040 <puts@plt>
jmp    13aa <main+0x1da>
lea    0xccd(%rip),%rdi
jmp    13a0 <main+0x1d0>
lea    0xcb8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x440,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i8*, i8* }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [12 x i8] c"192.168.1.4\00"
@AF_INET = global i8* null
@SOCK_DGRAM = global i32 0
@.str.1 = [19 x i8] c"open socket fail.\0A\00"
@INADDR_ANY = global i32 0
@.str.2 = [14 x i8] c"bind failed.\0A\00"
@.str.3 = [21 x i8] c"inet_aton() failed.\0A\00"
@.str.4 = [30 x i8] c"sending packet to %s port %s\0A\00"
@.str.5 = [6 x i8] c"11111\00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [13 x i8] c"sendto fail\0A\00"
@.str.8 = [19 x i8] c"received %d bytes\0A\00"
@.str.9 = [21 x i8] c"received message:%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 [1024 x i8]
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %10
store i32 24, i32* %11
%13 = load i8*, i8** @AF_INET
%14 = load i32, i32* @SOCK_DGRAM
%15 = call i32 @socket(i8* %13, i32 %14, i32 0)
store i32 %15, i32* %8
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %87
19: ; preds = %2
%20 = bitcast %struct.sockaddr_in* %6 to i8*
%21 = call i32 @memset(i8* %20, i32 0, i32 24)
%22 = load i8*, i8** @AF_INET
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 2
store i8* %22, i8** %23
%24 = load i32, i32* @INADDR_ANY
%25 = call i32 @htonl(i32 %24)
%26 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
%27 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %26, i32 0, i32 0
store i32 %25, i32* %27
%28 = call i8* @htons(i32 0)
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 1
store i8* %28, i8** %29
%30 = load i32, i32* %8
%31 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%32 = call i64 @bind(i32 %30, %struct.sockaddr* %31, i32 24)
%33 = icmp slt i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %19
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %87
36: ; preds = %19
%37 = bitcast %struct.sockaddr_in* %7 to i8*
%38 = call i32 @memset(i8* %37, i32 0, i32 24)
%39 = load i8*, i8** @AF_INET
%40 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 2
store i8* %39, i8** %40
%41 = call i8* @htons(i32 11111)
%42 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
store i8* %41, i8** %42
%43 = load i8*, i8** %10
%44 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%45 = call i64 @inet_aton(i8* %43, %struct.TYPE_2__* %44)
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %36
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %87
49: ; preds = %36
%50 = load i8*, i8** %10
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%52 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 1
%55 = load i8*, i8** %54
%56 = call i32 @sprintf(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %55)
%57 = load i32, i32* %8
%58 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%59 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%60 = call i32 @strlen(i8* %59)
%61 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%62 = load i32, i32* %11
%63 = call i32 @sendto(i32 %57, i8* %58, i32 %60, i32 0, %struct.sockaddr* %61, i32 %62)
%64 = icmp eq i32 %63, -1
br i1 %64, label %65, label %67
65: ; preds = %49
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %3
br label %87
67: ; preds = %49
%68 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%69 = call i32 @memset(i8* %68, i32 0, i32 1024)
%70 = load i32, i32* %8
%71 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%72 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%73 = call i32 @recvfrom(i32 %70, i8* %71, i32 1024, i32 0, %struct.sockaddr* %72, i32* %11)
store i32 %73, i32* %12
%74 = load i32, i32* %12
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 %74)
%76 = load i32, i32* %12
%77 = icmp sgt i32 %76, 0
br i1 %77, label %78, label %84
78: ; preds = %67
%79 = load i32, i32* %12
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 %80
store i8 0, i8* %81
%82 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8* %82)
br label %84
84: ; preds = %78, %67
%85 = load i32, i32* %8
%86 = call i32 @close(i32 %85)
store i32 0, i32* %3
br label %87
87: ; preds = %84, %65, %47, %34, %17
%88 = load i32, i32* %3
ret i32 %88
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i8*, i8* }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [12 x i8] c"192.168.1.4\00"
@AF_INET = global i8* null
@SOCK_DGRAM = global i32 0
@INADDR_ANY = global i32 0
@.str.4 = [30 x i8] c"sending packet to %s port %s\0A\00"
@.str.5 = [6 x i8] c"11111\00"
@.str.8 = [19 x i8] c"received %d bytes\0A\00"
@.str.9 = [21 x i8] c"received message:%s\0A\00"
@str = [12 x i8] c"sendto fail\00"
@str.10 = [20 x i8] c"inet_aton() failed.\00"
@str.11 = [13 x i8] c"bind failed.\00"
@str.12 = [18 x i8] c"open socket fail.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = alloca [1024 x i8]
%6 = alloca i32
%7 = bitcast %struct.sockaddr_in* %3 to i8*
%8 = bitcast %struct.sockaddr_in* %4 to i8*
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%10 = bitcast i32* %6 to i8*
store i32 24, i32* %6
%11 = load i8*, i8** @AF_INET
%12 = load i32, i32* @SOCK_DGRAM
%13 = tail call i32 @socket(i8* %11, i32 %12, i32 0)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.12, i64 0, i64 0))
br label %64
17: ; preds = %2
%18 = call i32 @memset(i8* %7, i32 0, i32 24)
%19 = load i8*, i8** @AF_INET
%20 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i8* %19, i8** %20
%21 = load i32, i32* @INADDR_ANY
%22 = call i32 @htonl(i32 %21)
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0, i32 0
store i32 %22, i32* %23
%24 = call i8* @htons(i32 0)
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
store i8* %24, i8** %25
%26 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%27 = call i64 @bind(i32 %13, %struct.sockaddr* %26, i32 24)
%28 = icmp slt i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %17
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.11, i64 0, i64 0))
br label %64
31: ; preds = %17
%32 = call i32 @memset(i8* %8, i32 0, i32 24)
%33 = load i8*, i8** @AF_INET
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 2
store i8* %33, i8** %34
%35 = call i8* @htons(i32 11111)
%36 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1
store i8* %35, i8** %36
%37 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
%38 = call i64 @inet_aton(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %struct.TYPE_2__* %37)
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %31
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.10, i64 0, i64 0))
br label %64
42: ; preds = %31
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%44 = getelementptr inbounds i8*, i8** %1, i64 1
%45 = load i8*, i8** %44
%46 = call i8* @strcpy(i8* %9, i8* dereferenceable(1) %45)
%47 = call i32 @strlen(i8* %9)
%48 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%49 = call i32 @sendto(i32 %13, i8* %9, i32 %47, i32 0, %struct.sockaddr* %48, i32 24)
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %53
51: ; preds = %42
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %64
53: ; preds = %42
%54 = call i32 @memset(i8* %9, i32 0, i32 1024)
%55 = call i32 @recvfrom(i32 %13, i8* %9, i32 1024, i32 0, %struct.sockaddr* %26, i32* %6)
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 %55)
%57 = icmp sgt i32 %55, 0
br i1 %57, label %58, label %62
58: ; preds = %53
%59 = zext i32 %55 to i64
%60 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 %59
store i8 0, i8* %60
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8* %9)
br label %62
62: ; preds = %58, %53
%63 = call i32 @close(i32 %13)
br label %64
64: ; preds = %62, %51, %40, %29, %15
%65 = phi i32 [ 0, %15 ], [ 0, %29 ], [ 1, %40 ], [ 1, %51 ], [ 0, %62 ]
ret i32 %65
}