#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;
  void *ai_flags;
  void *ai_socktype;
  int /*<<< orphan*/ ai_protocol;
  int /*<<< orphan*/ ai_family;
};

/* Variables and functions */
void *AI_ADDRCONFIG;
int EXIT_SUCCESS;
void *SOCK_DGRAM;
scalar_t__ bind(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ error(char *, ...);
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ gai_strerror(int);
int getaddrinfo(char *, char *, struct addrinfo *, struct addrinfo **);
int /*<<< orphan*/ memset(struct addrinfo *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int sendto(int, char *, int /*<<< orphan*/, int /*<<< orphan*/,
           int /*<<< orphan*/, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, void *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strlen(char *);
int main(int argc, char **argv) {
  int sk;
  struct addrinfo *client, *server;
  struct addrinfo hints;
  char buf[1024];
  int n;
  if (argc < 3) {
    error("Usage: %s server_ip server_port [my_ip]", argv[0]);
  }
  memset(&hints, 0, sizeof hints);
  hints.ai_socktype = SOCK_DGRAM;
  hints.ai_flags = AI_ADDRCONFIG;
  n = getaddrinfo(argv[1], argv[2], &hints, &server);
  if (n != 0) {
    error("getaddrinfo: %s", gai_strerror(n));
  }
  sk = socket(server->ai_family, server->ai_socktype, server->ai_protocol);
  if (sk == -1) {
    error("Problem creating socket");
  }
  if (argc > 3) {
    memset(&hints, 0, sizeof hints);
    hints.ai_socktype = SOCK_DGRAM;
    hints.ai_flags = AI_ADDRCONFIG;
    n = getaddrinfo(argv[3], NULL, &hints, &client);
    if (n != 0) {
      error("getaddrinfo: %s", gai_strerror(n));
    }
    if (bind(sk, client->ai_addr, client->ai_addrlen) != 0) {
      error("Problem creating socket");
    }
  }
  while (fgets(buf, sizeof buf, stdin)) {
    n = sendto(sk, buf, strlen(buf), 0, server->ai_addr, server->ai_addrlen);
    if (n < 0) {
      perror("Problem sending data");
    }
  }
  return EXIT_SUCCESS;
}


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)
cmpl   $0x3,-0x8(%rbp)
jge    11d8 <main+0x38>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1090 <error@plt>
lea    -0x48(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1050 <memset@plt>
mov    0x2df1(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    0x2dc3(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    -0x48(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   10b0 <getaddrinfo@plt>
mov    %eax,-0x454(%rbp)
cmpl   $0x0,-0x454(%rbp)
je     124f <main+0xaf>
mov    -0x454(%rbp),%edi
call   1040 <gai_strerror@plt>
mov    %eax,%esi
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1090 <error@plt>
mov    -0x28(%rbp),%rax
mov    0x1c(%rax),%edi
mov    -0x28(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x28(%rbp),%rax
mov    0x18(%rax),%edx
call   10c0 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1285 <main+0xe5>
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1090 <error@plt>
cmpl   $0x3,-0x8(%rbp)
jle    1334 <main+0x194>
lea    -0x48(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1050 <memset@plt>
mov    0x2d3a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    0x2d0c(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x48(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   10b0 <getaddrinfo@plt>
mov    %eax,-0x454(%rbp)
cmpl   $0x0,-0x454(%rbp)
je     1302 <main+0x162>
mov    -0x454(%rbp),%edi
call   1040 <gai_strerror@plt>
mov    %eax,%esi
lea    0xd2d(%rip),%rdi
mov    $0x0,%al
call   1090 <error@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
call   1080 <bind@plt>
cmp    $0x0,%rax
je     132f <main+0x18f>
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   1090 <error@plt>
jmp    1334 <main+0x194>
jmp    1339 <main+0x199>
lea    -0x450(%rbp),%rdi
mov    0x2ca1(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     13c9 <main+0x229>
mov    -0x14(%rbp),%eax
mov    %eax,-0x464(%rbp)
lea    -0x450(%rbp),%rax
mov    %rax,-0x460(%rbp)
lea    -0x450(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x464(%rbp),%edi
mov    -0x460(%rbp),%rsi
mov    %eax,%edx
mov    -0x28(%rbp),%rax
mov    0x4(%rax),%r8d
mov    -0x28(%rbp),%rax
mov    (%rax),%r9d
xor    %ecx,%ecx
call   1060 <sendto@plt>
mov    %eax,-0x454(%rbp)
cmpl   $0x0,-0x454(%rbp)
jge    13c4 <main+0x224>
lea    0xc91(%rip),%rdi
call   10a0 <perror@plt>
jmp    1339 <main+0x199>
mov    0x2c00(%rip),%rax
mov    (%rax),%eax
add    $0x470,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x430,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
cmp    $0x2,%edi
jg     11ca <main+0x2a>
mov    (%r14),%rsi
lea    0xe3d(%rip),%rdi
xor    %eax,%eax
call   1090 <error@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1050 <memset@plt>
mov    0x2dfb(%rip),%r15
mov    (%r15),%rax
mov    %rax,0x20(%rsp)
mov    0x2dcc(%rip),%r12
mov    (%r12),%rax
mov    %rax,0x18(%rsp)
mov    0x8(%r14),%rdi
mov    0x10(%r14),%rsi
mov    %rsp,%rcx
mov    %rbx,%rdx
call   10b0 <getaddrinfo@plt>
test   %eax,%eax
je     122b <main+0x8b>
mov    %eax,%edi
call   1040 <gai_strerror@plt>
lea    0xe06(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <error@plt>
mov    (%rsp),%rax
mov    0x1c(%rax),%edi
mov    0x10(%rax),%rsi
mov    0x18(%rax),%edx
call   10c0 <socket@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     124f <main+0xaf>
cmp    $0x4,%ebp
jge    1262 <main+0xc2>
jmp    12d9 <main+0x139>
lea    0xde2(%rip),%rdi
xor    %eax,%eax
call   1090 <error@plt>
cmp    $0x4,%ebp
jl     12d9 <main+0x139>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1050 <memset@plt>
mov    (%r15),%rax
mov    %rax,0x20(%rsp)
mov    (%r12),%rax
mov    %rax,0x18(%rsp)
mov    0x18(%r14),%rdi
lea    0x8(%rsp),%rcx
xor    %esi,%esi
mov    %rbp,%rdx
call   10b0 <getaddrinfo@plt>
test   %eax,%eax
je     12b5 <main+0x115>
mov    %eax,%edi
call   1040 <gai_strerror@plt>
lea    0xd7c(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <error@plt>
mov    0x8(%rsp),%rax
mov    (%rax),%edx
mov    0x4(%rax),%esi
mov    %ebx,%edi
call   1080 <bind@plt>
test   %rax,%rax
je     12d9 <main+0x139>
lea    0xd66(%rip),%rdi
xor    %eax,%eax
call   1090 <error@plt>
mov    0x2d08(%rip),%r15
mov    (%r15),%edx
lea    0x30(%rsp),%rdi
mov    $0x400,%esi
call   1070 <fgets@plt>
test   %rax,%rax
je     1354 <main+0x1b4>
lea    0x30(%rsp),%rbp
lea    0xd4d(%rip),%r14
jmp    1325 <main+0x185>
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15),%edx
mov    %rbp,%rdi
mov    $0x400,%esi
call   1070 <fgets@plt>
test   %rax,%rax
je     1354 <main+0x1b4>
mov    %rbp,%rdi
call   1030 <strlen@plt>
mov    (%rsp),%rcx
mov    (%rcx),%r9d
mov    0x4(%rcx),%r8d
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <sendto@plt>
test   %eax,%eax
jns    1310 <main+0x170>
mov    %r14,%rdi
call   10a0 <perror@plt>
jmp    1310 <main+0x170>
mov    0x2c75(%rip),%rax
mov    (%rax),%eax
add    $0x430,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.addrinfo = type { i32, i32, i8*, i8*, i32, i32 }
@.str = [40 x i8] c"Usage: %s server_ip server_port [my_ip]\00"
@SOCK_DGRAM = global i8* null
@AI_ADDRCONFIG = global i8* null
@.str.1 = [16 x i8] c"getaddrinfo: %s\00"
@.str.2 = [24 x i8] c"Problem creating socket\00"
@stdin = global i32 0
@.str.3 = [21 x i8] c"Problem sending data\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 %struct.addrinfo*
%8 = alloca %struct.addrinfo*
%9 = alloca %struct.addrinfo
%10 = alloca [1024 x i8]
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 3
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %14, %2
%20 = call i32 @memset(%struct.addrinfo* %9, i32 0, i32 32)
%21 = load i8*, i8** @SOCK_DGRAM
%22 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %9, i32 0, i32 3
store i8* %21, i8** %22
%23 = load i8*, i8** @AI_ADDRCONFIG
%24 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %9, i32 0, i32 2
store i8* %23, i8** %24
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i32 @getaddrinfo(i8* %27, i8* %30, %struct.addrinfo* %9, %struct.addrinfo** %8)
store i32 %31, i32* %11
%32 = load i32, i32* %11
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %19
%35 = load i32, i32* %11
%36 = call i32 @gai_strerror(i32 %35)
%37 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %34, %19
%39 = load %struct.addrinfo*, %struct.addrinfo** %8
%40 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %39, i32 0, i32 5
%41 = load i32, i32* %40
%42 = load %struct.addrinfo*, %struct.addrinfo** %8
%43 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %42, i32 0, i32 3
%44 = load i8*, i8** %43
%45 = load %struct.addrinfo*, %struct.addrinfo** %8
%46 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %45, i32 0, i32 4
%47 = load i32, i32* %46
%48 = call i32 @socket(i32 %41, i8* %44, i32 %47)
store i32 %48, i32* %6
%49 = load i32, i32* %6
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %53
51: ; preds = %38
%52 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %53
53: ; preds = %51, %38
%54 = load i32, i32* %4
%55 = icmp sgt i32 %54, 3
br i1 %55, label %56, label %85
56: ; preds = %53
%57 = call i32 @memset(%struct.addrinfo* %9, i32 0, i32 32)
%58 = load i8*, i8** @SOCK_DGRAM
%59 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %9, i32 0, i32 3
store i8* %58, i8** %59
%60 = load i8*, i8** @AI_ADDRCONFIG
%61 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %9, i32 0, i32 2
store i8* %60, i8** %61
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 3
%64 = load i8*, i8** %63
%65 = call i32 @getaddrinfo(i8* %64, i8* null, %struct.addrinfo* %9, %struct.addrinfo** %7)
store i32 %65, i32* %11
%66 = load i32, i32* %11
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %72
68: ; preds = %56
%69 = load i32, i32* %11
%70 = call i32 @gai_strerror(i32 %69)
%71 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %70)
br label %72
72: ; preds = %68, %56
%73 = load i32, i32* %6
%74 = load %struct.addrinfo*, %struct.addrinfo** %7
%75 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %74, i32 0, i32 1
%76 = load i32, i32* %75
%77 = load %struct.addrinfo*, %struct.addrinfo** %7
%78 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %77, i32 0, i32 0
%79 = load i32, i32* %78
%80 = call i64 @bind(i32 %73, i32 %76, i32 %79)
%81 = icmp ne i64 %80, 0
br i1 %81, label %82, label %84
82: ; preds = %72
%83 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %84
84: ; preds = %82, %72
br label %85
85: ; preds = %84, %53
br label %86
86: ; preds = %107, %85
%87 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%88 = load i32, i32* @stdin
%89 = call i64 @fgets(i8* %87, i32 1024, i32 %88)
%90 = icmp ne i64 %89, 0
br i1 %90, label %91, label %108
91: ; preds = %86
%92 = load i32, i32* %6
%93 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%94 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%95 = call i32 @strlen(i8* %94)
%96 = load %struct.addrinfo*, %struct.addrinfo** %8
%97 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %96, i32 0, i32 1
%98 = load i32, i32* %97
%99 = load %struct.addrinfo*, %struct.addrinfo** %8
%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 slt i32 %103, 0
br i1 %104, label %105, label %107
105: ; preds = %91
%106 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %107
107: ; preds = %105, %91
br label %86
108: ; preds = %86
%109 = load i32, i32* @EXIT_SUCCESS
ret i32 %109
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32, i8*, i8*, i32, i32 }
@.str = [40 x i8] c"Usage: %s server_ip server_port [my_ip]\00"
@SOCK_DGRAM = global i8* null
@AI_ADDRCONFIG = global i8* null
@.str.1 = [16 x i8] c"getaddrinfo: %s\00"
@.str.2 = [24 x i8] c"Problem creating socket\00"
@stdin = global i32 0
@.str.3 = [21 x i8] c"Problem sending data\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.addrinfo*
%4 = alloca %struct.addrinfo*
%5 = alloca %struct.addrinfo
%6 = alloca [1024 x i8]
%7 = bitcast %struct.addrinfo** %3 to i8*
%8 = bitcast %struct.addrinfo** %4 to i8*
%9 = bitcast %struct.addrinfo* %5 to i8*
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%11 = icmp slt i32 %0, 3
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i8*, i8** %1
%14 = tail call i32 (i8*, ...) @error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %2
%16 = call i32 @memset(%struct.addrinfo* %5, i32 0, i32 32)
%17 = load i8*, i8** @SOCK_DGRAM
%18 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %5, i64 0, i32 3
store i8* %17, i8** %18
%19 = load i8*, i8** @AI_ADDRCONFIG
%20 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %5, i64 0, i32 2
store i8* %19, i8** %20
%21 = getelementptr inbounds i8*, i8** %1, i64 1
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8*, i8** %1, i64 2
%24 = load i8*, i8** %23
%25 = call i32 @getaddrinfo(i8* %22, i8* %24, %struct.addrinfo* %5, %struct.addrinfo** %4)
%26 = icmp eq i32 %25, 0
br i1 %26, label %30, label %27
27: ; preds = %15
%28 = call i32 @gai_strerror(i32 %25)
%29 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %28)
br label %30
30: ; preds = %27, %15
%31 = load %struct.addrinfo*, %struct.addrinfo** %4
%32 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %31, i64 0, i32 5
%33 = load i32, i32* %32
%34 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %31, i64 0, i32 3
%35 = load i8*, i8** %34
%36 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %31, i64 0, i32 4
%37 = load i32, i32* %36
%38 = call i32 @socket(i32 %33, i8* %35, i32 %37)
%39 = icmp eq i32 %38, -1
br i1 %39, label %40, label %42
40: ; preds = %30
%41 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %42
42: ; preds = %40, %30
%43 = icmp sgt i32 %0, 3
br i1 %43, label %44, label %65
44: ; preds = %42
%45 = call i32 @memset(%struct.addrinfo* %5, i32 0, i32 32)
%46 = load i8*, i8** @SOCK_DGRAM
store i8* %46, i8** %18
%47 = load i8*, i8** @AI_ADDRCONFIG
store i8* %47, i8** %20
%48 = getelementptr inbounds i8*, i8** %1, i64 3
%49 = load i8*, i8** %48
%50 = call i32 @getaddrinfo(i8* %49, i8* null, %struct.addrinfo* %5, %struct.addrinfo** %3)
%51 = icmp eq i32 %50, 0
br i1 %51, label %55, label %52
52: ; preds = %44
%53 = call i32 @gai_strerror(i32 %50)
%54 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %52, %44
%56 = load %struct.addrinfo*, %struct.addrinfo** %3
%57 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %56, i64 0, i32 1
%58 = load i32, i32* %57
%59 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %56, i64 0, i32 0
%60 = load i32, i32* %59
%61 = call i64 @bind(i32 %38, i32 %58, i32 %60)
%62 = icmp eq i64 %61, 0
br i1 %62, label %65, label %63
63: ; preds = %55
%64 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %65
65: ; preds = %55, %63, %42
%66 = load i32, i32* @stdin
%67 = call i64 @fgets(i8* %10, i32 1024, i32 %66)
%68 = icmp eq i64 %67, 0
br i1 %68, label %84, label %69
69: ; preds = %65, %80
%70 = call i32 @strlen(i8* %10)
%71 = load %struct.addrinfo*, %struct.addrinfo** %4
%72 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %71, i64 0, i32 1
%73 = load i32, i32* %72
%74 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %71, i64 0, i32 0
%75 = load i32, i32* %74
%76 = call i32 @sendto(i32 %38, i8* %10, i32 %70, i32 0, i32 %73, i32 %75)
%77 = icmp slt i32 %76, 0
br i1 %77, label %78, label %80
78: ; preds = %69
%79 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %80
80: ; preds = %78, %69
%81 = load i32, i32* @stdin
%82 = call i64 @fgets(i8* %10, i32 1024, i32 %81)
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %69
84: ; preds = %80, %65
%85 = load i32, i32* @EXIT_SUCCESS
ret i32 %85
}