#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 addrinfo {
  int /*<<< orphan*/ ai_addrlen;
  int /*<<< orphan*/ ai_addr;
  int /*<<< orphan*/ ai_protocol;
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
  struct addrinfo *ai_next;
};

/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int EXIT_FAILURE;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_BROADCAST;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
char *gai_strerror(int);
int /*<<< orphan*/ getString(char *, int, char *);
int getaddrinfo(char *, char *, struct addrinfo *, struct addrinfo **);
int /*<<< orphan*/ memset(struct addrinfo *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int, char *);
int sendto(int, char *, int /*<<< orphan*/, int /*<<< orphan*/,
           int /*<<< orphan*/, int /*<<< orphan*/);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char *argv[]) {
  int socketFileDesc;
  struct addrinfo hints, *serverInfo, *aiPtr;
  int getInfoResult;
  int numBytes;
  int broadcast;
  char message[100];
  if (argc != 2) {
    fprintf(stderr, "usage: talker hostname\n");
    exit(1);
  }
  memset(&hints, 0, sizeof hints);
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_DGRAM;
  getInfoResult = getaddrinfo(argv[1], "8675", &hints, &serverInfo);
  if (getInfoResult != 0) {
    fprintf(stderr, "RoboServer: getaddrinfo: %s\n",
            gai_strerror(getInfoResult));
    exit(EXIT_FAILURE);
  }
  for (aiPtr = serverInfo; aiPtr != NULL; aiPtr = aiPtr->ai_next) {
    socketFileDesc =
        socket(aiPtr->ai_family, aiPtr->ai_socktype, aiPtr->ai_protocol);
    if (socketFileDesc == -1) {
      perror("RoboServer: socket error");
    } else {
      break;
    }
  }
  if (aiPtr == NULL) {
    fprintf(stderr, "RoboServer: failed to bind socket\n");
    exit(EXIT_FAILURE);
  }
  freeaddrinfo(serverInfo);
  broadcast = 1;
  if (setsockopt(socketFileDesc, SOL_SOCKET, SO_BROADCAST, &broadcast,
                 sizeof broadcast) == -1) {
    perror("setsockopt (SO_BROADCAST)");
    exit(1);
  }
  while (strcmp(message, "exit") != 0) {
    getString(message, 100, ":::");
    numBytes = sendto(socketFileDesc, message, strlen(message), 0,
                      aiPtr->ai_addr, aiPtr->ai_addrlen);
    if (numBytes == -1) {
      perror("RoboServer: sendto problem");
      exit(EXIT_FAILURE);
    }
    printf("RoboServer: sent %d bytes to %s\n", numBytes, argv[1]);
  }
  close(socketFileDesc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1234 <main+0x44>
mov    0x2da6(%rip),%rax
mov    (%rax),%edi
lea    0xddd(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1080 <memset@plt>
mov    0x2d95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    0x2d81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdad(%rip),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x40(%rbp),%rcx
call   10f0 <getaddrinfo@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
je     12c1 <main+0xd1>
mov    0x2d34(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc4(%rbp)
mov    -0x4c(%rbp),%edi
call   1070 <gai_strerror@plt>
mov    -0xc4(%rbp),%edi
mov    %rax,%rdx
lea    0xd71(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    0x2cfe(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     1327 <main+0x137>
mov    -0x48(%rbp),%rax
mov    0x10(%rax),%edi
mov    -0x48(%rbp),%rax
mov    0xc(%rax),%esi
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%edx
call   1110 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    130c <main+0x11c>
lea    0xd38(%rip),%rdi
call   10d0 <perror@plt>
jmp    1311 <main+0x121>
jmp    1327 <main+0x137>
jmp    1316 <main+0x126>
mov    -0x48(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x48(%rbp)
jmp    12c9 <main+0xd9>
cmpq   $0x0,-0x48(%rbp)
jne    1357 <main+0x167>
mov    0x2c87(%rip),%rax
mov    (%rax),%edi
lea    0xd11(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    0x2c68(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    -0x40(%rbp),%rdi
call   1100 <freeaddrinfo@plt>
movl   $0x1,-0x54(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2c77(%rip),%rax
mov    (%rax),%esi
mov    0x2c56(%rip),%rax
mov    (%rax),%edx
lea    -0x54(%rbp),%rcx
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    13aa <main+0x1ba>
lea    0xcdb(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
jmp    13af <main+0x1bf>
lea    -0xc0(%rbp),%rdi
lea    0xcd3(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
je     146f <main+0x27f>
lea    -0xc0(%rbp),%rdi
mov    $0x64,%esi
lea    0xcb6(%rip),%rdx
call   1030 <getString@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0xd4(%rbp)
lea    -0xc0(%rbp),%rax
mov    %rax,-0xd0(%rbp)
lea    -0xc0(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0xd4(%rbp),%edi
mov    -0xd0(%rbp),%rsi
mov    %eax,%edx
mov    -0x48(%rbp),%rax
mov    0x4(%rax),%r8d
mov    -0x48(%rbp),%rax
mov    (%rax),%r9d
xor    %ecx,%ecx
call   1090 <sendto@plt>
mov    %eax,-0x50(%rbp)
cmpl   $0xffffffff,-0x50(%rbp)
jne    1453 <main+0x263>
lea    0xc59(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2b6c(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    -0x50(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xc4f(%rip),%rdi
call   1060 <printf@plt>
jmp    13af <main+0x1bf>
mov    -0x14(%rbp),%edi
call   10a0 <close@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
cmp    $0x2,%edi
jne    13a9 <main+0x1b9>
mov    %rsi,%r15
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1080 <memset@plt>
mov    0x2db8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x20(%rsp)
mov    0x2da3(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x1c(%rsp)
mov    0x8(%r15),%rdi
lea    0xdd2(%rip),%rsi
lea    0x8(%rsp),%rcx
mov    %rbx,%rdx
call   10f0 <getaddrinfo@plt>
test   %eax,%eax
jne    13ca <main+0x1da>
mov    0x8(%rsp),%r14
test   %r14,%r14
je     1293 <main+0xa3>
lea    0xdce(%rip),%rbx
mov    0x10(%r14),%edi
mov    0x8(%r14),%edx
mov    0xc(%r14),%esi
call   1110 <socket@plt>
cmp    $0xffffffff,%eax
jne    12af <main+0xbf>
mov    %rbx,%rdi
call   10d0 <perror@plt>
mov    0x18(%r14),%r14
test   %r14,%r14
jne    126c <main+0x7c>
mov    0x2d26(%rip),%rax
mov    (%rax),%edi
lea    0xdb0(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
jmp    139b <main+0x1ab>
mov    %eax,%ebp
mov    0x8(%rsp),%rdi
call   1100 <freeaddrinfo@plt>
movl   $0x1,0x4(%rsp)
mov    0x2d1e(%rip),%rax
mov    (%rax),%esi
mov    0x2cfd(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    %ebp,%edi
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
cmp    $0xffffffff,%eax
je     13ef <main+0x1ff>
lea    0xd99(%rip),%rsi
lea    0x30(%rsp),%rdi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1374 <main+0x184>
lea    0x30(%rsp),%rbx
lea    0xda2(%rip),%r12
lea    0xd77(%rip),%r13
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x64,%esi
lea    0xd66(%rip),%rdx
call   1030 <getString@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    (%r14),%r9d
mov    0x4(%r14),%r8d
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1090 <sendto@plt>
cmp    $0xffffffff,%eax
je     138f <main+0x19f>
mov    0x8(%r15),%rdx
mov    %r12,%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
jne    1320 <main+0x130>
mov    %ebp,%edi
call   10a0 <close@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd03(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2c16(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    0x2c10(%rip),%rax
mov    (%rax),%edi
lea    0xc47(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    0x2bef(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1070 <gai_strerror@plt>
lea    0xc3c(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   10c0 <fprintf@plt>
jmp    139b <main+0x1ab>
lea    0xc80(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32, i32, i32, i32, i32, %struct.addrinfo* }
@stderr = global i32 0
@.str = [24 x i8] c"usage: talker hostname\0A\00"
@AF_UNSPEC = global i32 0
@SOCK_DGRAM = global i32 0
@.str.1 = [5 x i8] c"8675\00"
@.str.2 = [29 x i8] c"RoboServer: getaddrinfo: %s\0A\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [25 x i8] c"RoboServer: socket error\00"
@.str.4 = [35 x i8] c"RoboServer: failed to bind socket\0A\00"
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
@.str.5 = [26 x i8] c"setsockopt (SO_BROADCAST)\00"
@.str.6 = [5 x i8] c"exit\00"
@.str.7 = [4 x i8] c":::\00"
@.str.8 = [27 x i8] c"RoboServer: sendto problem\00"
@.str.9 = [33 x i8] c"RoboServer: sent %d bytes to %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.addrinfo
%8 = alloca %struct.addrinfo*
%9 = alloca %struct.addrinfo*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 2
br i1 %15, label %16, label %20
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %2
%21 = call i32 @memset(%struct.addrinfo* %7, i32 0, i32 32)
%22 = load i32, i32* @AF_UNSPEC
%23 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %7, i32 0, i32 4
store i32 %22, i32* %23
%24 = load i32, i32* @SOCK_DGRAM
%25 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %7, i32 0, i32 3
store i32 %24, i32* %25
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @getaddrinfo(i8* %28, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.addrinfo* %7, %struct.addrinfo** %8)
store i32 %29, i32* %10
%30 = load i32, i32* %10
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %39
32: ; preds = %20
%33 = load i32, i32* @stderr
%34 = load i32, i32* %10
%35 = call i8* @gai_strerror(i32 %34)
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %35)
%37 = load i32, i32* @EXIT_FAILURE
%38 = call i32 @exit(i32 %37)
unreachable
39: ; preds = %20
%40 = load %struct.addrinfo*, %struct.addrinfo** %8
store %struct.addrinfo* %40, %struct.addrinfo** %9
br label %41
41: ; preds = %61, %39
%42 = load %struct.addrinfo*, %struct.addrinfo** %9
%43 = icmp ne %struct.addrinfo* %42, null
br i1 %43, label %44, label %65
44: ; preds = %41
%45 = load %struct.addrinfo*, %struct.addrinfo** %9
%46 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %45, i32 0, i32 4
%47 = load i32, i32* %46
%48 = load %struct.addrinfo*, %struct.addrinfo** %9
%49 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %48, i32 0, i32 3
%50 = load i32, i32* %49
%51 = load %struct.addrinfo*, %struct.addrinfo** %9
%52 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %51, i32 0, i32 2
%53 = load i32, i32* %52
%54 = call i32 @socket(i32 %47, i32 %50, i32 %53)
store i32 %54, i32* %6
%55 = load i32, i32* %6
%56 = icmp eq i32 %55, -1
br i1 %56, label %57, label %59
57: ; preds = %44
%58 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %60
59: ; preds = %44
br label %65
60: ; preds = %57
br label %61
61: ; preds = %60
%62 = load %struct.addrinfo*, %struct.addrinfo** %9
%63 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %62, i32 0, i32 5
%64 = load %struct.addrinfo*, %struct.addrinfo** %63
store %struct.addrinfo* %64, %struct.addrinfo** %9
br label %41
65: ; preds = %59, %41
%66 = load %struct.addrinfo*, %struct.addrinfo** %9
%67 = icmp eq %struct.addrinfo* %66, null
br i1 %67, label %68, label %73
68: ; preds = %65
%69 = load i32, i32* @stderr
%70 = call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%71 = load i32, i32* @EXIT_FAILURE
%72 = call i32 @exit(i32 %71)
unreachable
73: ; preds = %65
%74 = load %struct.addrinfo*, %struct.addrinfo** %8
%75 = call i32 @freeaddrinfo(%struct.addrinfo* %74)
store i32 1, i32* %12
%76 = load i32, i32* %6
%77 = load i32, i32* @SOL_SOCKET
%78 = load i32, i32* @SO_BROADCAST
%79 = call i32 @setsockopt(i32 %76, i32 %77, i32 %78, i32* %12, i32 4)
%80 = icmp eq i32 %79, -1
br i1 %80, label %81, label %84
81: ; preds = %73
%82 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%83 = call i32 @exit(i32 1)
unreachable
84: ; preds = %73
br label %85
85: ; preds = %109, %84
%86 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%87 = call i64 @strcmp(i8* %86, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%88 = icmp ne i64 %87, 0
br i1 %88, label %89, label %115
89: ; preds = %85
%90 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%91 = call i32 @getString(i8* %90, i32 100, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%92 = load i32, i32* %6
%93 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%94 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%95 = call i32 @strlen(i8* %94)
%96 = load %struct.addrinfo*, %struct.addrinfo** %9
%97 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %96, i32 0, i32 1
%98 = load i32, i32* %97
%99 = load %struct.addrinfo*, %struct.addrinfo** %9
%100 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %99, i32 0, i32 0
%101 = load i32, i32* %100
%102 = call i32 @sendto(i32 %92, i8* %93, i32 %95, i32 0, i32 %98, i32 %101)
store i32 %102, i32* %11
%103 = load i32, i32* %11
%104 = icmp eq i32 %103, -1
br i1 %104, label %105, label %109
105: ; preds = %89
%106 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
%107 = load i32, i32* @EXIT_FAILURE
%108 = call i32 @exit(i32 %107)
unreachable
109: ; preds = %89
%110 = load i32, i32* %11
%111 = load i8**, i8*** %5
%112 = getelementptr inbounds i8*, i8** %111, i64 1
%113 = load i8*, i8** %112
%114 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i32 %110, i8* %113)
br label %85
115: ; preds = %85
%116 = load i32, i32* %6
%117 = call i32 @close(i32 %116)
ret i32 0
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32, i32, i32, i32, %struct.addrinfo* }
@stderr = global i32 0
@.str = [24 x i8] c"usage: talker hostname\0A\00"
@AF_UNSPEC = global i32 0
@SOCK_DGRAM = global i32 0
@.str.1 = [5 x i8] c"8675\00"
@.str.2 = [29 x i8] c"RoboServer: getaddrinfo: %s\0A\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [25 x i8] c"RoboServer: socket error\00"
@.str.4 = [35 x i8] c"RoboServer: failed to bind socket\0A\00"
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
@.str.5 = [26 x i8] c"setsockopt (SO_BROADCAST)\00"
@.str.6 = [5 x i8] c"exit\00"
@.str.7 = [4 x i8] c":::\00"
@.str.8 = [27 x i8] c"RoboServer: sendto problem\00"
@.str.9 = [33 x i8] c"RoboServer: sent %d bytes to %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.addrinfo
%4 = alloca %struct.addrinfo*
%5 = alloca i32
%6 = alloca [100 x i8]
%7 = bitcast %struct.addrinfo* %3 to i8*
%8 = bitcast %struct.addrinfo** %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%11 = icmp eq i32 %0, 2
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = call i32 @memset(%struct.addrinfo* %3, i32 0, i32 32)
%18 = load i32, i32* @AF_UNSPEC
%19 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 4
store i32 %18, i32* %19
%20 = load i32, i32* @SOCK_DGRAM
%21 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 3
store i32 %20, i32* %21
%22 = getelementptr inbounds i8*, i8** %1, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @getaddrinfo(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.addrinfo* %3, %struct.addrinfo** %4)
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %16
%27 = load %struct.addrinfo*, %struct.addrinfo** %4
%28 = icmp eq %struct.addrinfo* %27, null
br i1 %28, label %50, label %35
29: ; preds = %16
%30 = load i32, i32* @stderr
%31 = call i8* @gai_strerror(i32 %24)
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %31)
%33 = load i32, i32* @EXIT_FAILURE
%34 = call i32 @exit(i32 %33)
unreachable
35: ; preds = %26, %45
%36 = phi %struct.addrinfo* [ %48, %45 ], [ %27, %26 ]
%37 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %36, i64 0, i32 4
%38 = load i32, i32* %37
%39 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %36, i64 0, i32 3
%40 = load i32, i32* %39
%41 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %36, i64 0, i32 2
%42 = load i32, i32* %41
%43 = call i32 @socket(i32 %38, i32 %40, i32 %42)
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %55
45: ; preds = %35
%46 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%47 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %36, i64 0, i32 5
%48 = load %struct.addrinfo*, %struct.addrinfo** %47
%49 = icmp eq %struct.addrinfo* %48, null
br i1 %49, label %50, label %35
50: ; preds = %45, %26
%51 = load i32, i32* @stderr
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%53 = load i32, i32* @EXIT_FAILURE
%54 = call i32 @exit(i32 %53)
unreachable
55: ; preds = %35
%56 = load %struct.addrinfo*, %struct.addrinfo** %4
%57 = call i32 @freeaddrinfo(%struct.addrinfo* %56)
store i32 1, i32* %5
%58 = load i32, i32* @SOL_SOCKET
%59 = load i32, i32* @SO_BROADCAST
%60 = call i32 @setsockopt(i32 %43, i32 %58, i32 %59, i32* %5, i32 4)
%61 = icmp eq i32 %60, -1
br i1 %61, label %68, label %62
62: ; preds = %55
%63 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %87, label %65
65: ; preds = %62
%66 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %36, i64 0, i32 1
%67 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %36, i64 0, i32 0
br label %71
68: ; preds = %55
%69 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%70 = call i32 @exit(i32 1)
unreachable
71: ; preds = %65, %82
%72 = call i32 @getString(i8* %10, i32 100, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%73 = call i32 @strlen(i8* %10)
%74 = load i32, i32* %66
%75 = load i32, i32* %67
%76 = call i32 @sendto(i32 %43, i8* %10, i32 %73, i32 0, i32 %74, i32 %75)
%77 = icmp eq i32 %76, -1
br i1 %77, label %78, label %82
78: ; preds = %71
%79 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
%80 = load i32, i32* @EXIT_FAILURE
%81 = call i32 @exit(i32 %80)
unreachable
82: ; preds = %71
%83 = load i8*, i8** %22
%84 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i32 %76, i8* %83)
%85 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%86 = icmp eq i64 %85, 0
br i1 %86, label %87, label %71
87: ; preds = %82, %62
%88 = call i32 @close(i32 %43)
ret i32 0
}