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

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int inet_pton(int /*<<< orphan*/, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int recvfrom(int, char *, int, int /*<<< orphan*/, int /*<<< orphan*/ *,
             int /*<<< orphan*/ *);
int sendto(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int);
int /*<<< orphan*/ sleep(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int strlen(char *);
int main(int argc, char **argv) {
  int sockfd;
  int retval;
  struct sockaddr_in remote_addr;
  socklen_t addr_len;
  char buff[256];
  if (argc != 4) {
    fprintf(stderr, "Invocation: %s <IPv4 ADDRESS> <PORT> <MESSAGE>\n",
            argv[0]);
    exit(EXIT_FAILURE);
  }
  if (strlen(argv[3]) > 255) {
    fprintf(stdout, "Truncating message.\n");
    argv[3][255] = '\0';
  }
  sockfd = socket(PF_INET, SOCK_DGRAM, 0);
  if (sockfd == -1) {
    perror("socket()");
    exit(EXIT_FAILURE);
  }
  memset(&remote_addr, 0, sizeof(remote_addr));
  remote_addr.sin_family = AF_INET;
  retval = inet_pton(AF_INET, argv[1], &remote_addr.sin_addr);
  if (retval == 0) {
    fprintf(stderr, "inet_pton(): invalid network address!\n");
    exit(EXIT_FAILURE);
  } else if (retval == -1) {
    perror("inet_pton()");
    exit(EXIT_FAILURE);
  }
  remote_addr.sin_port = htons(atoi(argv[2]));
  addr_len = sizeof(remote_addr);
  sleep(1);
  fprintf(stdout, "Sending message to %s.\nWaiting for server response...\n",
          argv[1]);
  sleep(2);
  retval = sendto(sockfd, argv[3], strlen(argv[3]), 0,
                  (struct sockaddr *)&remote_addr, addr_len);
  if (retval == -1) {
    perror("sendto()");
    exit(EXIT_FAILURE);
  }
  retval = recvfrom(sockfd, buff, sizeof(buff), 0, NULL, NULL);
  if (retval == -1) {
    perror("recvfrom()");
    exit(EXIT_FAILURE);
  }
  buff[retval] = '\0';
  fprintf(stdout, "Server response: '%s'\n", buff);
  close(sockfd);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     121f <main+0x4f>
mov    0x2dd6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdf6(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2da8(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <strlen@plt>
cmp    $0xff,%eax
jle    125d <main+0x8d>
mov    0x2d7a(%rip),%rax
mov    (%rax),%edi
lea    0xde9(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
movb   $0x0,0xff(%rax)
mov    0x2d64(%rip),%rax
mov    (%rax),%edi
mov    0x2d73(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    129d <main+0xcd>
lea    0xdbb(%rip),%rdi
call   10b0 <perror@plt>
mov    0x2d2a(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1050 <memset@plt>
mov    0x2d34(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2d28(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    -0x28(%rbp),%rdx
add    $0x4,%rdx
call   1090 <inet_pton@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1309 <main+0x139>
mov    0x2ce5(%rip),%rax
mov    (%rax),%edi
lea    0xd5a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2cbe(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
cmpl   $0xffffffff,-0x18(%rbp)
jne    132d <main+0x15d>
lea    0xd5b(%rip),%rdi
call   10b0 <perror@plt>
mov    0x2c9a(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    1332 <main+0x162>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,%edi
call   1040 <htons@plt>
mov    %eax,-0x28(%rbp)
movl   $0xc,-0x2c(%rbp)
mov    $0x1,%edi
call   10e0 <sleep@plt>
mov    0x2c57(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd0f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x2,%edi
call   10e0 <sleep@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x13c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x138(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <strlen@plt>
mov    -0x13c(%rbp),%edi
mov    -0x138(%rbp),%rsi
mov    %eax,%edx
lea    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
xor    %ecx,%ecx
call   1060 <sendto@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    13ed <main+0x21d>
lea    0xcde(%rip),%rdi
call   10b0 <perror@plt>
mov    0x2bda(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    -0x14(%rbp),%edi
lea    -0x130(%rbp),%rsi
mov    $0x100,%edx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   10a0 <recvfrom@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1432 <main+0x262>
lea    0xca2(%rip),%rdi
call   10b0 <perror@plt>
mov    0x2b95(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
movslq -0x18(%rbp),%rax
movb   $0x0,-0x130(%rbp,%rax,1)
mov    0x2b73(%rip),%rax
mov    (%rax),%edi
lea    -0x130(%rbp),%rdx
lea    0xc77(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
mov    0x2b45(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x110,%rsp
mov    %rsi,%rbx
cmp    $0x4,%edi
jne    123f <main+0x6f>
mov    0x18(%rbx),%rdi
call   1030 <strlen@plt>
cmp    $0x100,%eax
jl     1215 <main+0x45>
mov    0x2dbe(%rip),%rax
mov    (%rax),%edi
lea    0xe2d(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x18(%rbx),%rax
movb   $0x0,0xff(%rax)
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
mov    0x2dbb(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
cmp    $0xffffffff,%eax
jne    125e <main+0x8e>
lea    0xe0b(%rip),%rdi
jmp    1354 <main+0x184>
mov    0x2d8a(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xdae(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1359 <main+0x189>
mov    %eax,%ebp
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1050 <memset@plt>
mov    0x2d72(%rip),%rax
mov    (%rax),%edi
mov    %edi,0x8(%rsp)
mov    0x8(%rbx),%rsi
lea    0x4(%rsp),%rdx
call   1090 <inet_pton@plt>
cmp    $0xffffffff,%eax
je     12af <main+0xdf>
test   %eax,%eax
jne    12bb <main+0xeb>
mov    0x2d36(%rip),%rax
mov    (%rax),%edi
lea    0xdab(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1359 <main+0x189>
lea    0xdbf(%rip),%rdi
jmp    1354 <main+0x184>
mov    0x10(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,%edi
call   1040 <htons@plt>
mov    %eax,(%rsp)
mov    $0x1,%edi
call   10e0 <sleep@plt>
mov    0x2cd9(%rip),%r14
mov    (%r14),%edi
mov    0x8(%rbx),%rdx
lea    0xd94(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x2,%edi
call   10e0 <sleep@plt>
mov    0x18(%rbx),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rsp,%r8
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
mov    $0xc,%r9d
call   1060 <sendto@plt>
cmp    $0xffffffff,%eax
jne    132f <main+0x15f>
lea    0xd8b(%rip),%rdi
jmp    1354 <main+0x184>
lea    0x10(%rsp),%rsi
mov    %ebp,%edi
mov    $0x100,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   10a0 <recvfrom@plt>
cmp    $0xffffffff,%eax
jne    1367 <main+0x197>
lea    0xd6d(%rip),%rdi
call   10b0 <perror@plt>
mov    0x2c60(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
cltq
movb   $0x0,0x10(%rsp,%rax,1)
mov    (%r14),%edi
lea    0xd54(%rip),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %ebp,%edi
call   1070 <close@plt>
mov    0x2c1e(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [48 x i8] c"Invocation: %s <IPv4 ADDRESS> <PORT> <MESSAGE>\0A\00"
@EXIT_FAILURE = global i32 0
@stdout = global i32 0
@.str.1 = [21 x i8] c"Truncating message.\0A\00"
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str.2 = [9 x i8] c"socket()\00"
@AF_INET = global i32 0
@.str.3 = [39 x i8] c"inet_pton(): invalid network address!\0A\00"
@.str.4 = [12 x i8] c"inet_pton()\00"
@.str.5 = [55 x i8] c"Sending message to %s.\0AWaiting for server response...\0A\00"
@.str.6 = [9 x i8] c"sendto()\00"
@.str.7 = [11 x i8] c"recvfrom()\00"
@.str.8 = [23 x i8] c"Server response: '%s'\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.sockaddr_in
%9 = alloca i32
%10 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 4
br i1 %12, label %13, label %21
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = load i32, i32* @EXIT_FAILURE
%20 = call i32 @exit(i32 %19)
unreachable
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 3
%24 = load i8*, i8** %23
%25 = call i32 @strlen(i8* %24)
%26 = icmp sgt i32 %25, 255
br i1 %26, label %27, label %34
27: ; preds = %21
%28 = load i32, i32* @stdout
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 3
%32 = load i8*, i8** %31
%33 = getelementptr inbounds i8, i8* %32, i64 255
store i8 0, i8* %33
br label %34
34: ; preds = %27, %21
%35 = load i32, i32* @PF_INET
%36 = load i32, i32* @SOCK_DGRAM
%37 = call i32 @socket(i32 %35, i32 %36, i32 0)
store i32 %37, i32* %6
%38 = load i32, i32* %6
%39 = icmp eq i32 %38, -1
br i1 %39, label %40, label %44
40: ; preds = %34
%41 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%42 = load i32, i32* @EXIT_FAILURE
%43 = call i32 @exit(i32 %42)
unreachable
44: ; preds = %34
%45 = call i32 @memset(%struct.sockaddr_in* %8, i32 0, i32 12)
%46 = load i32, i32* @AF_INET
%47 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 2
store i32 %46, i32* %47
%48 = load i32, i32* @AF_INET
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 1
%51 = load i8*, i8** %50
%52 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 1
%53 = call i32 @inet_pton(i32 %48, i8* %51, i32* %52)
store i32 %53, i32* %7
%54 = load i32, i32* %7
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %61
56: ; preds = %44
%57 = load i32, i32* @stderr
%58 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%59 = load i32, i32* @EXIT_FAILURE
%60 = call i32 @exit(i32 %59)
unreachable
61: ; preds = %44
%62 = load i32, i32* %7
%63 = icmp eq i32 %62, -1
br i1 %63, label %64, label %68
64: ; preds = %61
%65 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%66 = load i32, i32* @EXIT_FAILURE
%67 = call i32 @exit(i32 %66)
unreachable
68: ; preds = %61
br label %69
69: ; preds = %68
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 2
%72 = load i8*, i8** %71
%73 = call i32 @atoi(i8* %72)
%74 = call i32 @htons(i32 %73)
%75 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
store i32 %74, i32* %75
store i32 12, i32* %9
%76 = call i32 @sleep(i32 1)
%77 = load i32, i32* @stdout
%78 = load i8**, i8*** %5
%79 = getelementptr inbounds i8*, i8** %78, i64 1
%80 = load i8*, i8** %79
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0), i8* %80)
%82 = call i32 @sleep(i32 2)
%83 = load i32, i32* %6
%84 = load i8**, i8*** %5
%85 = getelementptr inbounds i8*, i8** %84, i64 3
%86 = load i8*, i8** %85
%87 = load i8**, i8*** %5
%88 = getelementptr inbounds i8*, i8** %87, i64 3
%89 = load i8*, i8** %88
%90 = call i32 @strlen(i8* %89)
%91 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%92 = load i32, i32* %9
%93 = call i32 @sendto(i32 %83, i8* %86, i32 %90, i32 0, %struct.sockaddr* %91, i32 %92)
store i32 %93, i32* %7
%94 = load i32, i32* %7
%95 = icmp eq i32 %94, -1
br i1 %95, label %96, label %100
96: ; preds = %69
%97 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%98 = load i32, i32* @EXIT_FAILURE
%99 = call i32 @exit(i32 %98)
unreachable
100: ; preds = %69
%101 = load i32, i32* %6
%102 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%103 = call i32 @recvfrom(i32 %101, i8* %102, i32 256, i32 0, i32* null, i32* null)
store i32 %103, i32* %7
%104 = load i32, i32* %7
%105 = icmp eq i32 %104, -1
br i1 %105, label %106, label %110
106: ; preds = %100
%107 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%108 = load i32, i32* @EXIT_FAILURE
%109 = call i32 @exit(i32 %108)
unreachable
110: ; preds = %100
%111 = load i32, i32* %7
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 %112
store i8 0, i8* %113
%114 = load i32, i32* @stdout
%115 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%116 = call i32 (i32, i8*, ...) @fprintf(i32 %114, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i8* %115)
%117 = load i32, i32* %6
%118 = call i32 @close(i32 %117)
%119 = load i32, i32* @EXIT_SUCCESS
%120 = call i32 @exit(i32 %119)
unreachable
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [48 x i8] c"Invocation: %s <IPv4 ADDRESS> <PORT> <MESSAGE>\0A\00"
@EXIT_FAILURE = global i32 0
@stdout = global i32 0
@.str.1 = [21 x i8] c"Truncating message.\0A\00"
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str.2 = [9 x i8] c"socket()\00"
@AF_INET = global i32 0
@.str.3 = [39 x i8] c"inet_pton(): invalid network address!\0A\00"
@.str.4 = [12 x i8] c"inet_pton()\00"
@.str.5 = [55 x i8] c"Sending message to %s.\0AWaiting for server response...\0A\00"
@.str.6 = [9 x i8] c"sendto()\00"
@.str.7 = [11 x i8] c"recvfrom()\00"
@.str.8 = [23 x i8] c"Server response: '%s'\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [256 x i8]
%5 = bitcast %struct.sockaddr_in* %3 to i8*
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 4
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 3
%16 = load i8*, i8** %15
%17 = tail call i32 @strlen(i8* %16)
%18 = icmp sgt i32 %17, 255
br i1 %18, label %19, label %24
19: ; preds = %14
%20 = load i32, i32* @stdout
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%22 = load i8*, i8** %15
%23 = getelementptr inbounds i8, i8* %22, i64 255
store i8 0, i8* %23
br label %24
24: ; preds = %19, %14
%25 = load i32, i32* @PF_INET
%26 = load i32, i32* @SOCK_DGRAM
%27 = tail call i32 @socket(i32 %25, i32 %26, i32 0)
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %33
29: ; preds = %24
%30 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%31 = load i32, i32* @EXIT_FAILURE
%32 = tail call i32 @exit(i32 %31)
unreachable
33: ; preds = %24
%34 = call i32 @memset(%struct.sockaddr_in* %3, i32 0, i32 12)
%35 = load i32, i32* @AF_INET
%36 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %35, i32* %36
%37 = getelementptr inbounds i8*, i8** %1, i64 1
%38 = load i8*, i8** %37
%39 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
%40 = call i32 @inet_pton(i32 %35, i8* %38, i32* %39)
switch i32 %40, label %50 [
i32 0, label %41
i32 -1, label %46
]
41: ; preds = %33
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%44 = load i32, i32* @EXIT_FAILURE
%45 = call i32 @exit(i32 %44)
unreachable
46: ; preds = %33
%47 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%48 = load i32, i32* @EXIT_FAILURE
%49 = call i32 @exit(i32 %48)
unreachable
50: ; preds = %33
%51 = getelementptr inbounds i8*, i8** %1, i64 2
%52 = load i8*, i8** %51
%53 = call i32 @atoi(i8* %52)
%54 = call i32 @htons(i32 %53)
%55 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %54, i32* %55
%56 = call i32 @sleep(i32 1)
%57 = load i32, i32* @stdout
%58 = load i8*, i8** %37
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0), i8* %58)
%60 = call i32 @sleep(i32 2)
%61 = load i8*, i8** %15
%62 = call i32 @strlen(i8* %61)
%63 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%64 = call i32 @sendto(i32 %27, i8* %61, i32 %62, i32 0, %struct.sockaddr* %63, i32 12)
%65 = icmp eq i32 %64, -1
br i1 %65, label %66, label %70
66: ; preds = %50
%67 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%68 = load i32, i32* @EXIT_FAILURE
%69 = call i32 @exit(i32 %68)
unreachable
70: ; preds = %50
%71 = call i32 @recvfrom(i32 %27, i8* %6, i32 256, i32 0, i32* null, i32* null)
%72 = icmp eq i32 %71, -1
br i1 %72, label %73, label %77
73: ; preds = %70
%74 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%75 = load i32, i32* @EXIT_FAILURE
%76 = call i32 @exit(i32 %75)
unreachable
77: ; preds = %70
%78 = sext i32 %71 to i64
%79 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %78
store i8 0, i8* %79
%80 = load i32, i32* @stdout
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i8* %6)
%82 = call i32 @close(i32 %27)
%83 = load i32, i32* @EXIT_SUCCESS
%84 = call i32 @exit(i32 %83)
unreachable
}