#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 */
typedef int /*<<< orphan*/ yes;
struct in_addr {
  int dummy;
};
struct sockaddr_in {
  struct in_addr sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct hostent {
  scalar_t__ h_addr;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ server;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_BROADCAST;
int /*<<< orphan*/ bzero(struct sockaddr_in *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ printf(char *, ...);
int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int *);
int /*<<< orphan*/ sendto(int, char *, int /*<<< orphan*/, int /*<<< orphan*/,
                          struct sockaddr *, int);
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char *argv[]) {
  int fd, numbytes;
  char recvbuf[100];
  char sendbuf[100];
  struct hostent *he;
  struct sockaddr_in server, client;
  int yes;
  FILE *file;
  if (argc != 2) {
    printf("Usage: %s <IP Address> \n", argv[0]);
    exit(1);
  }
  if ((file = fopen("client.c", "r")) == NULL) {
    printf("open out.txt error....\n");
    exit(-1);
  }
  if ((he = gethostbyname(argv[1])) == NULL) {
    printf("gethostbyname() error\n");
    exit(1);
  }
  if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
    printf("socket() error\n");
    exit(1);
  }
  yes = 1;
  setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &yes, sizeof(yes));
  bzero(&server, sizeof(server));
  server.sin_family = AF_INET;
  server.sin_port = htons(1234);
  server.sin_addr = *((struct in_addr *)he->h_addr);
  socklen_t len;
  len = sizeof(struct sockaddr_in);
  while (fgets(sendbuf, 100, file)) {
    printf("%s", sendbuf);
    sendto(fd, sendbuf, strlen(sendbuf), 0, (struct sockaddr *)&server, len);
    if ((numbytes = recvfrom(fd, recvbuf, 100, 0, (struct sockaddr *)&server,
                             &len)) == -1) {
      printf("recvfrom() error\n");
      break;
    }
    recvbuf[numbytes] = '\0';
  }
  close(file);
  close(fd);
  return 0;
}


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   $0x2,-0x8(%rbp)
je     1212 <main+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0xe00(%rip),%rdi
lea    0xe02(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x128(%rbp)
cmp    $0x0,%rax
jne    124e <main+0x7e>
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <gethostbyname@plt>
mov    %rax,-0xf8(%rbp)
cmp    $0x0,%rax
jne    1284 <main+0xb4>
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    0x2d55(%rip),%rax
mov    (%rax),%edi
mov    0x2d44(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10f0 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    12c1 <main+0xf1>
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
movl   $0x1,-0x11c(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2d13(%rip),%rax
mov    (%rax),%esi
mov    0x2cf2(%rip),%rax
mov    (%rax),%edx
lea    -0x11c(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
lea    -0x108(%rbp),%rdi
mov    $0xc,%esi
call   10d0 <bzero@plt>
mov    0x2cd6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x100(%rbp)
mov    $0x4d2,%edi
call   1050 <htons@plt>
mov    %eax,-0x104(%rbp)
mov    -0xf8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x108(%rbp)
movl   $0xc,-0x12c(%rbp)
lea    -0xf0(%rbp),%rdi
mov    -0x128(%rbp),%rdx
mov    $0x64,%esi
call   1090 <fgets@plt>
cmp    $0x0,%rax
je     140a <main+0x23a>
lea    -0xf0(%rbp),%rsi
lea    0xcf5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x13c(%rbp)
lea    -0xf0(%rbp),%rax
mov    %rax,-0x138(%rbp)
lea    -0xf0(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x13c(%rbp),%edi
mov    -0x138(%rbp),%rsi
mov    %eax,%edx
lea    -0x108(%rbp),%r8
mov    -0x12c(%rbp),%r9d
xor    %ecx,%ecx
call   1070 <sendto@plt>
mov    -0x14(%rbp),%edi
lea    -0x80(%rbp),%rsi
lea    -0x108(%rbp),%r8
mov    $0x64,%edx
xor    %ecx,%ecx
lea    -0x12c(%rbp),%r9
call   10b0 <recvfrom@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    13fc <main+0x22c>
lea    0xc76(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    140a <main+0x23a>
movslq -0x18(%rbp),%rax
movb   $0x0,-0x80(%rbp,%rax,1)
jmp    133e <main+0x16e>
mov    -0x128(%rbp),%rax
mov    %eax,%edi
call   1080 <close@plt>
mov    -0x14(%rbp),%edi
call   1080 <close@plt>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    138b <main+0x1ab>
lea    0xe15(%rip),%rdi
lea    0xe4e(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     13a6 <main+0x1c6>
mov    %rax,%r15
mov    0x8(%rbx),%rdi
call   10b0 <gethostbyname@plt>
test   %rax,%rax
je     13bc <main+0x1dc>
mov    %rax,%r14
mov    0x2da8(%rip),%rbx
mov    (%rbx),%edi
mov    0x2d97(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
cmp    $0xffffffff,%eax
je     13c5 <main+0x1e5>
mov    %eax,%ebp
movl   $0x1,0xc(%rsp)
mov    0x2d84(%rip),%rax
mov    (%rax),%esi
mov    0x2d63(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rcx
mov    %ebp,%edi
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
lea    0x10(%rsp),%rdi
mov    $0xc,%esi
call   10e0 <bzero@plt>
mov    (%rbx),%eax
mov    %eax,0x18(%rsp)
mov    $0x4d2,%edi
call   1060 <htons@plt>
mov    %eax,0x14(%rsp)
mov    (%r14),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
movl   $0xc,0x8(%rsp)
lea    0x20(%rsp),%rdi
mov    $0x64,%esi
mov    %r15,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     1368 <main+0x188>
lea    0x20(%rsp),%rbx
lea    0x10(%rsp),%r12
lea    0x90(%rsp),%r13
lea    0x8(%rsp),%r14
nopw   0x0(%rax,%rax,1)
lea    0xd2b(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    0x8(%rsp),%r9d
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
mov    %r12,%r8
call   1080 <sendto@plt>
mov    %ebp,%edi
mov    %r13,%rsi
mov    $0x64,%edx
xor    %ecx,%ecx
mov    %r12,%r8
mov    %r14,%r9
call   10c0 <recvfrom@plt>
cmp    $0xffffffff,%eax
je     135c <main+0x17c>
cltq
movb   $0x0,0x90(%rsp,%rax,1)
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %r15,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
jne    12f0 <main+0x110>
jmp    1368 <main+0x188>
lea    0xcc2(%rip),%rdi
call   1030 <puts@plt>
mov    %r15d,%edi
call   1090 <close@plt>
mov    %ebp,%edi
call   1090 <close@plt>
xor    %eax,%eax
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%rsi
lea    0xc6b(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0xcae(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   10f0 <exit@plt>
lea    0xc82(%rip),%rdi
jmp    13cc <main+0x1ec>
lea    0xc6a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.hostent = type { i64 }
%struct.sockaddr_in = type { %struct.in_addr, i32, i32 }
%struct.in_addr = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [25 x i8] c"Usage: %s <IP Address> \0A\00"
@.str.1 = [9 x i8] c"client.c\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [24 x i8] c"open out.txt error....\0A\00"
@.str.4 = [23 x i8] c"gethostbyname() error\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str.5 = [16 x i8] c"socket() error\0A\00"
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [18 x i8] c"recvfrom() error\0A\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 [100 x i8]
%9 = alloca [100 x i8]
%10 = alloca %struct.hostent*
%11 = alloca %struct.sockaddr_in
%12 = alloca %struct.sockaddr_in
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 2
br i1 %17, label %18, label %24
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %2
%25 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %25, i32** %14
%26 = icmp eq i32* %25, null
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%29 = call i32 @exit(i32 -1)
unreachable
30: ; preds = %24
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call %struct.hostent* @gethostbyname(i8* %33)
store %struct.hostent* %34, %struct.hostent** %10
%35 = icmp eq %struct.hostent* %34, null
br i1 %35, label %36, label %39
36: ; preds = %30
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%38 = call i32 @exit(i32 1)
unreachable
39: ; preds = %30
%40 = load i32, i32* @AF_INET
%41 = load i32, i32* @SOCK_DGRAM
%42 = call i32 @socket(i32 %40, i32 %41, i32 0)
store i32 %42, i32* %6
%43 = icmp eq i32 %42, -1
br i1 %43, label %44, label %47
44: ; preds = %39
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %39
store i32 1, i32* %13
%48 = load i32, i32* %6
%49 = load i32, i32* @SOL_SOCKET
%50 = load i32, i32* @SO_BROADCAST
%51 = call i32 @setsockopt(i32 %48, i32 %49, i32 %50, i32* %13, i32 4)
%52 = call i32 @bzero(%struct.sockaddr_in* %11, i32 12)
%53 = load i32, i32* @AF_INET
%54 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 2
store i32 %53, i32* %54
%55 = call i32 @htons(i32 1234)
%56 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 1
store i32 %55, i32* %56
%57 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
%58 = load %struct.hostent*, %struct.hostent** %10
%59 = getelementptr inbounds %struct.hostent, %struct.hostent* %58, i32 0, i32 0
%60 = load i64, i64* %59
%61 = inttoptr i64 %60 to %struct.in_addr*
%62 = bitcast %struct.in_addr* %57 to i8*
%63 = bitcast %struct.in_addr* %61 to i8*
store i32 12, i32* %15
br label %64
64: ; preds = %86, %47
%65 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%66 = load i32*, i32** %14
%67 = call i64 @fgets(i8* %65, i32 100, i32* %66)
%68 = icmp ne i64 %67, 0
br i1 %68, label %69, label %90
69: ; preds = %64
%70 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %70)
%72 = load i32, i32* %6
%73 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%74 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%75 = call i32 @strlen(i8* %74)
%76 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%77 = load i32, i32* %15
%78 = call i32 @sendto(i32 %72, i8* %73, i32 %75, i32 0, %struct.sockaddr* %76, i32 %77)
%79 = load i32, i32* %6
%80 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%81 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%82 = call i32 @recvfrom(i32 %79, i8* %80, i32 100, i32 0, %struct.sockaddr* %81, i32* %15)
store i32 %82, i32* %7
%83 = icmp eq i32 %82, -1
br i1 %83, label %84, label %86
84: ; preds = %69
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
br label %90
86: ; preds = %69
%87 = load i32, i32* %7
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 %88
store i8 0, i8* %89
br label %64
90: ; preds = %84, %64
%91 = load i32*, i32** %14
%92 = ptrtoint i32* %91 to i32
%93 = call i32 @close(i32 %92)
%94 = load i32, i32* %6
%95 = call i32 @close(i32 %94)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.in_addr, i32, i32 }
%struct.in_addr = type { i32 }
%struct.hostent = type { i64 }
%struct.sockaddr = type { i32 }
@.str = [25 x i8] c"Usage: %s <IP Address> \0A\00"
@.str.1 = [9 x i8] c"client.c\00"
@.str.2 = [2 x i8] c"r\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
@.str.6 = [3 x i8] c"%s\00"
@str = [17 x i8] c"recvfrom() error\00"
@str.8 = [15 x i8] c"socket() error\00"
@str.9 = [22 x i8] c"gethostbyname() error\00"
@str.10 = [23 x i8] c"open out.txt error....\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca %struct.sockaddr_in
%6 = alloca i32
%7 = alloca i32
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%10 = bitcast %struct.sockaddr_in* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = icmp eq i32 %0, 2
br i1 %12, label %17, label %13
13: ; preds = %2
%14 = load i8*, i8** %1
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.10, i64 0, i64 0))
%22 = tail call i32 @exit(i32 -1)
unreachable
23: ; preds = %17
%24 = getelementptr inbounds i8*, i8** %1, i64 1
%25 = load i8*, i8** %24
%26 = tail call %struct.hostent* @gethostbyname(i8* %25)
%27 = icmp eq %struct.hostent* %26, null
br i1 %27, label %28, label %31
28: ; preds = %23
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.9, i64 0, i64 0))
%30 = tail call i32 @exit(i32 1)
unreachable
31: ; preds = %23
%32 = load i32, i32* @AF_INET
%33 = load i32, i32* @SOCK_DGRAM
%34 = tail call i32 @socket(i32 %32, i32 %33, i32 0)
%35 = icmp eq i32 %34, -1
br i1 %35, label %36, label %39
36: ; preds = %31
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.8, i64 0, i64 0))
%38 = tail call i32 @exit(i32 1)
unreachable
39: ; preds = %31
store i32 1, i32* %6
%40 = load i32, i32* @SOL_SOCKET
%41 = load i32, i32* @SO_BROADCAST
%42 = call i32 @setsockopt(i32 %34, i32 %40, i32 %41, i32* %6, i32 4)
%43 = call i32 @bzero(%struct.sockaddr_in* %5, i32 12)
%44 = load i32, i32* @AF_INET
%45 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 2
store i32 %44, i32* %45
%46 = call i32 @htons(i32 1234)
%47 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 1
store i32 %46, i32* %47
%48 = getelementptr inbounds %struct.hostent, %struct.hostent* %26, i64 0, i32 0
%49 = load i64, i64* %48
%50 = inttoptr i64 %49 to i32*
%51 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 0, i32 0
%52 = load i32, i32* %50
store i32 %52, i32* %51
%53 = bitcast i32* %7 to i8*
store i32 12, i32* %7
%54 = call i64 @fgets(i8* %9, i32 100, i32* %18)
%55 = icmp eq i64 %54, 0
br i1 %55, label %72, label %56
56: ; preds = %39
%57 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
br label %58
58: ; preds = %56, %67
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %9)
%60 = call i32 @strlen(i8* %9)
%61 = load i32, i32* %7
%62 = call i32 @sendto(i32 %34, i8* %9, i32 %60, i32 0, %struct.sockaddr* %57, i32 %61)
%63 = call i32 @recvfrom(i32 %34, i8* %8, i32 100, i32 0, %struct.sockaddr* %57, i32* %7)
%64 = icmp eq i32 %63, -1
br i1 %64, label %65, label %67
65: ; preds = %58
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %72
67: ; preds = %58
%68 = sext i32 %63 to i64
%69 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %68
store i8 0, i8* %69
%70 = call i64 @fgets(i8* %9, i32 100, i32* %18)
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %58
72: ; preds = %67, %39, %65
%73 = ptrtoint i32* %18 to i64
%74 = trunc i64 %73 to i32
%75 = call i32 @close(i32 %74)
%76 = call i32 @close(i32 %34)
ret i32 0
}