#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_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ server_addr;
typedef int /*<<< orphan*/ client_addr;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ atoi(char *);
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(struct sockaddr_in *, int);
int close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
scalar_t__ inet_aton(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int *);
int sendto(int, char *, int /*<<< orphan*/, int /*<<< orphan*/,
           struct sockaddr *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char *argv[]) {
  struct sockaddr_in server_addr, client_addr;
  int serverfd;
  socklen_t client_addr_len = sizeof(struct sockaddr);
  char buf[1024 + 1];
  int n;
  if (argc != 3) {
    perror("Please use 3 args\n");
    exit(1);
  }
  serverfd = socket(AF_INET, SOCK_DGRAM, 0);
  if (serverfd == -1) {
    perror("****Create UDP socket");
    exit(1);
  }
  bzero(&server_addr, sizeof(server_addr));
  server_addr.sin_family = AF_INET;
  server_addr.sin_port = htons(atoi(argv[2]));
  if (inet_aton(argv[1], &server_addr.sin_addr) == 0) {
    perror("Host wrong.");
  }
  if (bind(serverfd, (struct sockaddr *)&server_addr, sizeof(server_addr)) ==
      -1) {
    perror("Bind the IP and PORT");
    exit(1);
  }
  while (1) {
    memset(buf, 0, 1024 + 1);
    n = recvfrom(serverfd, buf, 1024, 0, (struct sockaddr *)&client_addr,
                 &client_addr_len);
    if (n == -1) {
      perror("Receive ");
      exit(1);
    }
    if (strcmp(buf, "exit\n") == 0) {
      break;
    } else {
      buf[n] = '\0';
      printf("Client says : %s\n", buf);
      printf("You would say :");
      fgets(buf, sizeof(buf), stdin);
      n = sendto(serverfd, buf, strlen(buf), 0, (struct sockaddr *)&client_addr,
                 sizeof(client_addr));
      if (n == -1) {
        perror("Reply sent");
        exit(1);
      }
    }
  }
  if (close(serverfd) == -1) {
    perror("Close");
    exit(1);
  }
  puts("UDP Server has been closed");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x38(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1250 <main+0x40>
lea    0xdbf(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
mov    0x2d91(%rip),%rax
mov    (%rax),%edi
mov    0x2d78(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
jne    128c <main+0x7c>
lea    0xd96(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
lea    -0x20(%rbp),%rdi
mov    $0xc,%esi
call   1100 <bzero@plt>
mov    0x2d47(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1110 <atoi@plt>
mov    %eax,%edi
call   1050 <htons@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x20(%rbp),%rsi
call   10c0 <inet_aton@plt>
cmp    $0x0,%rax
jne    12e4 <main+0xd4>
lea    0xd4a(%rip),%rdi
call   10f0 <perror@plt>
mov    -0x34(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0xc,%edx
call   10e0 <bind@plt>
cmp    $0xffffffff,%eax
jne    1314 <main+0x104>
lea    0xd30(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
jmp    1319 <main+0x109>
lea    -0x440(%rbp),%rdi
xor    %esi,%esi
mov    $0x401,%edx
call   1070 <memset@plt>
mov    -0x34(%rbp),%edi
lea    -0x440(%rbp),%rsi
lea    -0x30(%rbp),%r8
mov    $0x400,%edx
xor    %ecx,%ecx
lea    -0x38(%rbp),%r9
call   10d0 <recvfrom@plt>
mov    %eax,-0x444(%rbp)
cmpl   $0xffffffff,-0x444(%rbp)
jne    1373 <main+0x163>
lea    0xce6(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
lea    -0x440(%rbp),%rdi
lea    0xcd2(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    1395 <main+0x185>
jmp    1457 <main+0x247>
movslq -0x444(%rbp),%rax
movb   $0x0,-0x440(%rbp,%rax,1)
lea    -0x440(%rbp),%rsi
lea    0xca7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xcab(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x440(%rbp),%rdi
mov    0x2c0b(%rip),%rax
mov    (%rax),%edx
mov    $0x401,%esi
call   10a0 <fgets@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x454(%rbp)
lea    -0x440(%rbp),%rax
mov    %rax,-0x450(%rbp)
lea    -0x440(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x454(%rbp),%edi
mov    -0x450(%rbp),%rsi
mov    %eax,%edx
lea    -0x30(%rbp),%r8
xor    %ecx,%ecx
mov    $0xc,%r9d
call   1080 <sendto@plt>
mov    %eax,-0x444(%rbp)
cmpl   $0xffffffff,-0x444(%rbp)
jne    144d <main+0x23d>
lea    0xc3d(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
jmp    1452 <main+0x242>
jmp    1319 <main+0x109>
mov    -0x34(%rbp),%edi
call   1090 <close@plt>
cmp    $0xffffffff,%eax
jne    147e <main+0x26e>
lea    0xc17(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
lea    0xc07(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x438,%rsp
movl   $0x4,0xc(%rsp)
cmp    $0x3,%edi
jne    13d3 <main+0x1c3>
mov    %rsi,%rbx
mov    0x2dac(%rip),%r15
mov    (%r15),%edi
mov    0x2d92(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
cmp    $0xffffffff,%eax
je     13dc <main+0x1cc>
mov    %eax,%ebp
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0xc,%esi
call   1100 <bzero@plt>
mov    (%r15),%eax
mov    %eax,0x18(%rsp)
mov    0x10(%rbx),%rdi
call   1110 <atoi@plt>
mov    %eax,%edi
call   1050 <htons@plt>
mov    %eax,0x14(%rsp)
mov    0x8(%rbx),%rdi
mov    %r14,%rsi
call   10c0 <inet_aton@plt>
test   %rax,%rax
je     13ac <main+0x19c>
lea    0x10(%rsp),%rsi
mov    %ebp,%edi
mov    $0xc,%edx
call   10e0 <bind@plt>
cmp    $0xffffffff,%eax
je     13e5 <main+0x1d5>
lea    0x30(%rsp),%rbx
lea    0x20(%rsp),%r14
lea    0xc(%rsp),%r15
lea    0xd87(%rip),%r12
nopl   0x0(%rax)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x401,%edx
call   1070 <memset@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
mov    %r14,%r8
mov    %r15,%r9
call   10d0 <recvfrom@plt>
cmp    $0xffffffff,%eax
je     13bd <main+0x1ad>
mov    %eax,%r13d
mov    %rbx,%rdi
mov    %r12,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1380 <main+0x170>
movslq %r13d,%rax
movb   $0x0,0x30(%rsp,%rax,1)
lea    0xd38(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd39(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2ca0(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x401,%esi
call   10a0 <fgets@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
mov    %r14,%r8
mov    $0xc,%r9d
call   1080 <sendto@plt>
cmp    $0xffffffff,%eax
jne    12d0 <main+0xc0>
lea    0xcfd(%rip),%rdi
jmp    13c4 <main+0x1b4>
mov    %ebp,%edi
call   1090 <close@plt>
cmp    $0xffffffff,%eax
je     13ee <main+0x1de>
lea    0xcf9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x438,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc76(%rip),%rdi
call   10f0 <perror@plt>
jmp    129c <main+0x8c>
lea    0xc86(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
lea    0xc26(%rip),%rdi
jmp    13c4 <main+0x1b4>
lea    0xc30(%rip),%rdi
jmp    13c4 <main+0x1b4>
lea    0xc49(%rip),%rdi
jmp    13c4 <main+0x1b4>
lea    0xc91(%rip),%rdi
jmp    13c4 <main+0x1b4>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.sockaddr = type { i32 }
@.str = [19 x i8] c"Please use 3 args\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str.1 = [22 x i8] c"****Create UDP socket\00"
@.str.2 = [12 x i8] c"Host wrong.\00"
@.str.3 = [21 x i8] c"Bind the IP and PORT\00"
@.str.4 = [9 x i8] c"Receive \00"
@.str.5 = [6 x i8] c"exit\0A\00"
@.str.6 = [18 x i8] c"Client says : %s\0A\00"
@.str.7 = [16 x i8] c"You would say :\00"
@stdin = global i32 0
@.str.8 = [11 x i8] c"Reply sent\00"
@.str.9 = [6 x i8] c"Close\00"
@.str.10 = [27 x i8] c"UDP Server has been closed\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 i32
%10 = alloca [1025 x i8]
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 4, i32* %9
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 3
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = load i32, i32* @AF_INET
%19 = load i32, i32* @SOCK_DGRAM
%20 = call i32 @socket(i32 %18, i32 %19, i32 0)
store i32 %20, i32* %8
%21 = load i32, i32* %8
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %26
23: ; preds = %17
%24 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%25 = call i32 @exit(i32 1)
unreachable
26: ; preds = %17
%27 = call i32 @bzero(%struct.sockaddr_in* %6, i32 12)
%28 = load i32, i32* @AF_INET
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 2
store i32 %28, i32* %29
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
%33 = call i32 @atoi(i8* %32)
%34 = call i32 @htons(i32 %33)
%35 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 1
store i32 %34, i32* %35
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
%40 = call i64 @inet_aton(i8* %38, i32* %39)
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %26
%43 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %44
44: ; preds = %42, %26
%45 = load i32, i32* %8
%46 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%47 = call i32 @bind(i32 %45, %struct.sockaddr* %46, i32 12)
%48 = icmp eq i32 %47, -1
br i1 %48, label %49, label %52
49: ; preds = %44
%50 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%51 = call i32 @exit(i32 1)
unreachable
52: ; preds = %44
br label %53
53: ; preds = %52, %92
%54 = getelementptr inbounds [1025 x i8], [1025 x i8]* %10, i64 0, i64 0
%55 = call i32 @memset(i8* %54, i32 0, i32 1025)
%56 = load i32, i32* %8
%57 = getelementptr inbounds [1025 x i8], [1025 x i8]* %10, i64 0, i64 0
%58 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%59 = call i32 @recvfrom(i32 %56, i8* %57, i32 1024, i32 0, %struct.sockaddr* %58, i32* %9)
store i32 %59, i32* %11
%60 = load i32, i32* %11
%61 = icmp eq i32 %60, -1
br i1 %61, label %62, label %65
62: ; preds = %53
%63 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%64 = call i32 @exit(i32 1)
unreachable
65: ; preds = %53
%66 = getelementptr inbounds [1025 x i8], [1025 x i8]* %10, i64 0, i64 0
%67 = call i64 @strcmp(i8* %66, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %70
69: ; preds = %65
br label %93
70: ; preds = %65
%71 = load i32, i32* %11
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [1025 x i8], [1025 x i8]* %10, i64 0, i64 %72
store i8 0, i8* %73
%74 = getelementptr inbounds [1025 x i8], [1025 x i8]* %10, i64 0, i64 0
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* %74)
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%77 = getelementptr inbounds [1025 x i8], [1025 x i8]* %10, i64 0, i64 0
%78 = load i32, i32* @stdin
%79 = call i32 @fgets(i8* %77, i32 1025, i32 %78)
%80 = load i32, i32* %8
%81 = getelementptr inbounds [1025 x i8], [1025 x i8]* %10, i64 0, i64 0
%82 = getelementptr inbounds [1025 x i8], [1025 x i8]* %10, i64 0, i64 0
%83 = call i32 @strlen(i8* %82)
%84 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%85 = call i32 @sendto(i32 %80, i8* %81, i32 %83, i32 0, %struct.sockaddr* %84, i32 12)
store i32 %85, i32* %11
%86 = load i32, i32* %11
%87 = icmp eq i32 %86, -1
br i1 %87, label %88, label %91
88: ; preds = %70
%89 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%90 = call i32 @exit(i32 1)
unreachable
91: ; preds = %70
br label %92
92: ; preds = %91
br label %53
93: ; preds = %69
%94 = load i32, i32* %8
%95 = call i32 @close(i32 %94)
%96 = icmp eq i32 %95, -1
br i1 %96, label %97, label %100
97: ; preds = %93
%98 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%99 = call i32 @exit(i32 1)
unreachable
100: ; preds = %93
%101 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.sockaddr = type { i32 }
@.str = [19 x i8] c"Please use 3 args\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str.1 = [22 x i8] c"****Create UDP socket\00"
@.str.2 = [12 x i8] c"Host wrong.\00"
@.str.3 = [21 x i8] c"Bind the IP and PORT\00"
@.str.4 = [9 x i8] c"Receive \00"
@.str.5 = [6 x i8] c"exit\0A\00"
@.str.6 = [18 x i8] c"Client says : %s\0A\00"
@.str.7 = [16 x i8] c"You would say :\00"
@stdin = global i32 0
@.str.8 = [11 x i8] c"Reply sent\00"
@.str.9 = [6 x i8] c"Close\00"
@.str.10 = [27 x i8] c"UDP Server has been closed\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca [1025 x i8]
%7 = bitcast %struct.sockaddr_in* %3 to i8*
%8 = bitcast %struct.sockaddr_in* %4 to i8*
%9 = bitcast i32* %5 to i8*
store i32 4, i32* %5
%10 = getelementptr inbounds [1025 x i8], [1025 x i8]* %6, i64 0, i64 0
%11 = icmp eq i32 %0, 3
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%14 = tail call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i32, i32* @AF_INET
%17 = load i32, i32* @SOCK_DGRAM
%18 = tail call i32 @socket(i32 %16, i32 %17, i32 0)
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%22 = tail call i32 @exit(i32 1)
unreachable
23: ; preds = %15
%24 = call i32 @bzero(%struct.sockaddr_in* %3, i32 12)
%25 = load i32, i32* @AF_INET
%26 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %25, i32* %26
%27 = getelementptr inbounds i8*, i8** %1, i64 2
%28 = load i8*, i8** %27
%29 = tail call i32 @atoi(i8* %28)
%30 = tail call i32 @htons(i32 %29)
%31 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
store i32 %30, i32* %31
%32 = getelementptr inbounds i8*, i8** %1, i64 1
%33 = load i8*, i8** %32
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
%35 = call i64 @inet_aton(i8* %33, i32* %34)
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %23
%38 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %39
39: ; preds = %37, %23
%40 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%41 = call i32 @bind(i32 %18, %struct.sockaddr* %40, i32 12)
%42 = icmp eq i32 %41, -1
br i1 %42, label %45, label %43
43: ; preds = %39
%44 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
br label %48
45: ; preds = %39
%46 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%47 = call i32 @exit(i32 1)
unreachable
48: ; preds = %43, %58
%49 = call i32 @memset(i8* %10, i32 0, i32 1025)
%50 = call i32 @recvfrom(i32 %18, i8* %10, i32 1024, i32 0, %struct.sockaddr* %44, i32* %5)
%51 = icmp eq i32 %50, -1
br i1 %51, label %52, label %55
52: ; preds = %48
%53 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%54 = call i32 @exit(i32 1)
unreachable
55: ; preds = %48
%56 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %71, label %58
58: ; preds = %55
%59 = sext i32 %50 to i64
%60 = getelementptr inbounds [1025 x i8], [1025 x i8]* %6, i64 0, i64 %59
store i8 0, i8* %60
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* %10)
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%63 = load i32, i32* @stdin
%64 = call i32 @fgets(i8* %10, i32 1025, i32 %63)
%65 = call i32 @strlen(i8* %10)
%66 = call i32 @sendto(i32 %18, i8* %10, i32 %65, i32 0, %struct.sockaddr* %44, i32 12)
%67 = icmp eq i32 %66, -1
br i1 %67, label %68, label %48
68: ; preds = %58
%69 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%70 = call i32 @exit(i32 1)
unreachable
71: ; preds = %55
%72 = call i32 @close(i32 %18)
%73 = icmp eq i32 %72, -1
br i1 %73, label %74, label %77
74: ; preds = %71
%75 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%76 = call i32 @exit(i32 1)
unreachable
77: ; preds = %71
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0))
ret i32 0
}