#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ servaddr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int BUFSIZ;
int /*<<< orphan*/ SOCK_DGRAM;
int atoi(char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ inet_addr(char *);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int recvfrom(int, char *, int, int /*<<< orphan*/, int /*<<< orphan*/ *,
             int /*<<< orphan*/ *);
int /*<<< orphan*/ sendto(int, char *, int /*<<< orphan*/, int /*<<< orphan*/,
                          struct sockaddr *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char **argv) {
  int sockfd, n;
  struct sockaddr_in servaddr, cliaddr;
  char sendline[1000000];
  char recvline[1000000];
  char buf[BUFSIZ];
  if (argc != 2) {
    printf("usage: ex04c <IP address>\n");
    exit(1);
  }
  sockfd = socket(AF_INET, SOCK_DGRAM, 0);
  memset(&servaddr, 0, sizeof(servaddr));
  servaddr.sin_family = AF_INET;
  servaddr.sin_addr.s_addr = inet_addr(argv[1]);
  servaddr.sin_port = htons(32000);
  int count = 0;
  int number1, number2, sum, server_sum;
  while (fgets(buf, BUFSIZ, stdin) != NULL) {
    strcpy(sendline, buf);
    ++count;
    if (count == 1) {
      number1 = atoi(buf);
    } else if (count == 2) {
      number2 = atoi(buf);
    }
    sendto(sockfd, sendline, strlen(sendline), 0, (struct sockaddr *)&servaddr,
           sizeof(servaddr));
    n = recvfrom(sockfd, recvline, 1000000, 0, NULL, NULL);
    recvline[n] = 0;
    fputs(recvline, stdout);
    if (count >= 2) {
      sum = number1 + number2;
      server_sum = atoi(recvline);
      if (sum == server_sum) {
        close(sockfd);
        exit(0);
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e8500,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2dc8(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x1e84c8(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x1e84f0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x1e84d0(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     124e <main+0x6e>
lea    0xdc1(%rip),%rdi
call   1060 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    0x2d93(%rip),%rax
mov    (%rax),%edi
mov    0x2d7a(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
mov    %eax,-0x14(%rbp)
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1080 <memset@plt>
mov    0x2d67(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <inet_addr@plt>
mov    %eax,-0x24(%rbp)
mov    $0x7d00,%edi
call   1050 <htons@plt>
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x1e84d4(%rbp)
mov    -0x1e84f0(%rbp),%rdi
mov    0x2d0d(%rip),%rax
mov    (%rax),%esi
mov    0x2d1c(%rip),%rax
mov    (%rax),%edx
call   10b0 <fgets@plt>
cmp    $0x0,%rax
je     1420 <main+0x240>
mov    -0x1e84f0(%rbp),%rsi
lea    -0xf4280(%rbp),%rdi
call   1030 <strcpy@plt>
mov    -0x1e84d4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1e84d4(%rbp)
cmpl   $0x1,-0x1e84d4(%rbp)
jne    131b <main+0x13b>
mov    -0x1e84f0(%rbp),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x1e84d8(%rbp)
jmp    133f <main+0x15f>
cmpl   $0x2,-0x1e84d4(%rbp)
jne    133a <main+0x15a>
mov    -0x1e84f0(%rbp),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x1e84dc(%rbp)
jmp    133f <main+0x15f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1e84fc(%rbp)
lea    -0xf4280(%rbp),%rax
mov    %rax,-0x1e84f8(%rbp)
lea    -0xf4280(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1e84fc(%rbp),%edi
mov    -0x1e84f8(%rbp),%rsi
mov    %eax,%edx
lea    -0x28(%rbp),%r8
xor    %ecx,%ecx
mov    $0xc,%r9d
call   1090 <sendto@plt>
mov    -0x14(%rbp),%edi
lea    -0x1e84c0(%rbp),%rsi
mov    $0xf4240,%edx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   10d0 <recvfrom@plt>
mov    %eax,-0x18(%rbp)
movslq -0x18(%rbp),%rax
movb   $0x0,-0x1e84c0(%rbp,%rax,1)
lea    -0x1e84c0(%rbp),%rdi
mov    0x2c03(%rip),%rax
mov    (%rax),%esi
call   1070 <fputs@plt>
cmpl   $0x2,-0x1e84d4(%rbp)
jl     141b <main+0x23b>
mov    -0x1e84d8(%rbp),%eax
add    -0x1e84dc(%rbp),%eax
mov    %eax,-0x1e84e0(%rbp)
lea    -0x1e84c0(%rbp),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x1e84e4(%rbp)
mov    -0x1e84e0(%rbp),%eax
cmp    -0x1e84e4(%rbp),%eax
jne    1416 <main+0x236>
mov    -0x14(%rbp),%edi
call   10a0 <close@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
jmp    141b <main+0x23b>
jmp    12ad <main+0xcd>
mov    -0x1e84c8(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1e8498,%rsp
mov    %rsp,-0x40(%rbp)
mov    0x2dc9(%rip),%r13
mov    0x0(%r13),%eax
mov    %rsp,%r12
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
cmp    $0x2,%edi
jne    14a3 <main+0x2c3>
mov    %rsi,%r15
mov    0x2dc1(%rip),%rbx
mov    (%rbx),%edi
mov    0x2da8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
mov    %eax,%r14d
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1080 <memset@plt>
mov    (%rbx),%eax
mov    %eax,-0x30(%rbp)
mov    0x8(%r15),%rdi
call   10c0 <inet_addr@plt>
mov    %eax,-0x34(%rbp)
mov    $0x7d00,%edi
call   1060 <htons@plt>
mov    %eax,-0x38(%rbp)
mov    0x0(%r13),%esi
mov    0x2d6b(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
call   10b0 <fgets@plt>
test   %rax,%rax
je     147f <main+0x29f>
lea    -0x1e84c0(%rbp),%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rdi
call   10e0 <atoi@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    -0x38(%rbp),%r8
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
mov    $0xc,%r9d
call   1090 <sendto@plt>
lea    -0xf4280(%rbp),%rbx
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0xf4240,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   10d0 <recvfrom@plt>
cltq
movb   $0x0,-0xf4280(%rbp,%rax,1)
mov    0x2cca(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1070 <fputs@plt>
mov    0x2cc1(%rip),%rax
mov    (%rax),%esi
mov    0x2cd0(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
call   10b0 <fgets@plt>
test   %rax,%rax
je     147f <main+0x29f>
lea    -0x1e84c0(%rbp),%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rdi
call   10e0 <atoi@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    -0x38(%rbp),%r8
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
mov    $0xc,%r9d
call   1090 <sendto@plt>
lea    -0xf4280(%rbp),%rbx
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0xf4240,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   10d0 <recvfrom@plt>
cltq
movb   $0x0,-0xf4280(%rbp,%rax,1)
mov    0x2c2f(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1070 <fputs@plt>
add    %r13d,%r15d
mov    %rbx,%rdi
call   10e0 <atoi@plt>
cmp    %eax,%r15d
je     1494 <main+0x2b4>
mov    %r15d,%r13d
mov    0x2c0f(%rip),%rax
mov    (%rax),%esi
mov    0x2c1e(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
call   10b0 <fgets@plt>
test   %rax,%rax
je     147f <main+0x29f>
lea    -0x1e84c0(%rbp),%rbx
lea    -0xf4280(%rbp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
lea    -0x38(%rbp),%r8
mov    $0xc,%r9d
call   1090 <sendto@plt>
mov    %r14d,%edi
mov    %r15,%rsi
mov    $0xf4240,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   10d0 <recvfrom@plt>
cltq
movb   $0x0,-0xf4280(%rbp,%rax,1)
mov    0x2b7b(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdi
call   1070 <fputs@plt>
mov    %r15,%rdi
call   10e0 <atoi@plt>
cmp    %eax,%r13d
je     1494 <main+0x2b4>
mov    0x2b65(%rip),%rax
mov    (%rax),%esi
mov    0x2b74(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
call   10b0 <fgets@plt>
test   %rax,%rax
jne    13f0 <main+0x210>
mov    -0x40(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14d,%edi
call   10a0 <close@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
lea    0xb56(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@BUFSIZ = global i32 0
@.str = [27 x i8] c"usage: ex04c <IP address>\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@stdin = global i32 0
@stdout = 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 %struct.sockaddr_in
%10 = alloca [1000000 x i8]
%11 = alloca [1000000 x i8]
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%19 = load i32, i32* @BUFSIZ
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %12
%22 = alloca i8, i64 %20
store i64 %20, i64* %13
%23 = load i32, i32* %4
%24 = icmp ne i32 %23, 2
br i1 %24, label %25, label %28
25: ; preds = %2
%26 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%27 = call i32 @exit(i32 1)
unreachable
28: ; preds = %2
%29 = load i32, i32* @AF_INET
%30 = load i32, i32* @SOCK_DGRAM
%31 = call i32 @socket(i32 %29, i32 %30, i32 0)
store i32 %31, i32* %6
%32 = call i32 @memset(%struct.sockaddr_in* %8, i32 0, i32 12)
%33 = load i32, i32* @AF_INET
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 2
store i32 %33, i32* %34
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = call i32 @inet_addr(i8* %37)
%39 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 1
%40 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %39, i32 0, i32 0
store i32 %38, i32* %40
%41 = call i32 @htons(i32 32000)
%42 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
store i32 %41, i32* %42
store i32 0, i32* %14
br label %43
43: ; preds = %95, %28
%44 = load i32, i32* @BUFSIZ
%45 = load i32, i32* @stdin
%46 = call i32* @fgets(i8* %22, i32 %44, i32 %45)
%47 = icmp ne i32* %46, null
br i1 %47, label %48, label %96
48: ; preds = %43
%49 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %10, i64 0, i64 0
%50 = call i32 @strcpy(i8* %49, i8* %22)
%51 = load i32, i32* %14
%52 = add nsw i32 %51, 1
store i32 %52, i32* %14
%53 = load i32, i32* %14
%54 = icmp eq i32 %53, 1
br i1 %54, label %55, label %57
55: ; preds = %48
%56 = call i32 @atoi(i8* %22)
store i32 %56, i32* %15
br label %63
57: ; preds = %48
%58 = load i32, i32* %14
%59 = icmp eq i32 %58, 2
br i1 %59, label %60, label %62
60: ; preds = %57
%61 = call i32 @atoi(i8* %22)
store i32 %61, i32* %16
br label %62
62: ; preds = %60, %57
br label %63
63: ; preds = %62, %55
%64 = load i32, i32* %6
%65 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %10, i64 0, i64 0
%66 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %10, i64 0, i64 0
%67 = call i32 @strlen(i8* %66)
%68 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%69 = call i32 @sendto(i32 %64, i8* %65, i32 %67, i32 0, %struct.sockaddr* %68, i32 12)
%70 = load i32, i32* %6
%71 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%72 = call i32 @recvfrom(i32 %70, i8* %71, i32 1000000, i32 0, i32* null, i32* null)
store i32 %72, i32* %7
%73 = load i32, i32* %7
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 %74
store i8 0, i8* %75
%76 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%77 = load i32, i32* @stdout
%78 = call i32 @fputs(i8* %76, i32 %77)
%79 = load i32, i32* %14
%80 = icmp sge i32 %79, 2
br i1 %80, label %81, label %95
81: ; preds = %63
%82 = load i32, i32* %15
%83 = load i32, i32* %16
%84 = add nsw i32 %82, %83
store i32 %84, i32* %17
%85 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%86 = call i32 @atoi(i8* %85)
store i32 %86, i32* %18
%87 = load i32, i32* %17
%88 = load i32, i32* %18
%89 = icmp eq i32 %87, %88
br i1 %89, label %90, label %94
90: ; preds = %81
%91 = load i32, i32* %6
%92 = call i32 @close(i32 %91)
%93 = call i32 @exit(i32 0)
unreachable
94: ; preds = %81
br label %95
95: ; preds = %94, %63
br label %43
96: ; preds = %43
%97 = load i8*, i8** %12
%98 = load i32, i32* %3
ret i32 %98
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@BUFSIZ = global i32 0
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@stdin = global i32 0
@stdout = global i32 0
@str = [26 x i8] c"usage: ex04c <IP address>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [1000000 x i8]
%5 = alloca [1000000 x i8]
%6 = bitcast %struct.sockaddr_in* %3 to i8*
%7 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %5, i64 0, i64 0
%9 = load i32, i32* @BUFSIZ
%10 = zext i32 %9 to i64
%11 = tail call i8* @llvm.stacksave()
%12 = alloca i8, i64 %10
%13 = icmp eq i32 %0, 2
br i1 %13, label %17, label %14
14: ; preds = %2
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = load i32, i32* @AF_INET
%19 = load i32, i32* @SOCK_DGRAM
%20 = tail call i32 @socket(i32 %18, i32 %19, i32 0)
%21 = call i32 @memset(%struct.sockaddr_in* %3, i32 0, i32 12)
%22 = load i32, i32* @AF_INET
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %22, i32* %23
%24 = getelementptr inbounds i8*, i8** %1, i64 1
%25 = load i8*, i8** %24
%26 = call i32 @inet_addr(i8* %25)
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
store i32 %26, i32* %27
%28 = call i32 @htons(i32 32000)
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %28, i32* %29
%30 = load i32, i32* @BUFSIZ
%31 = load i32, i32* @stdin
%32 = call i32* @fgets(i8* %12, i32 %30, i32 %31)
%33 = icmp eq i32* %32, null
br i1 %33, label %88, label %34
34: ; preds = %17
%35 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%36 = call i32 @strcpy(i8* %7, i8* %12)
%37 = call i32 @atoi(i8* %12)
%38 = call i32 @strlen(i8* %7)
%39 = call i32 @sendto(i32 %20, i8* %7, i32 %38, i32 0, %struct.sockaddr* %35, i32 12)
%40 = call i32 @recvfrom(i32 %20, i8* %8, i32 1000000, i32 0, i32* null, i32* null)
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %5, i64 0, i64 %41
store i8 0, i8* %42
%43 = load i32, i32* @stdout
%44 = call i32 @fputs(i8* %8, i32 %43)
%45 = load i32, i32* @BUFSIZ
%46 = load i32, i32* @stdin
%47 = call i32* @fgets(i8* %12, i32 %45, i32 %46)
%48 = icmp eq i32* %47, null
br i1 %48, label %88, label %49
49: ; preds = %34
%50 = call i32 @strcpy(i8* %7, i8* %12)
%51 = call i32 @atoi(i8* %12)
%52 = call i32 @strlen(i8* %7)
%53 = call i32 @sendto(i32 %20, i8* %7, i32 %52, i32 0, %struct.sockaddr* %35, i32 12)
%54 = call i32 @recvfrom(i32 %20, i8* %8, i32 1000000, i32 0, i32* null, i32* null)
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %5, i64 0, i64 %55
store i8 0, i8* %56
%57 = load i32, i32* @stdout
%58 = call i32 @fputs(i8* %8, i32 %57)
%59 = add nsw i32 %37, %51
%60 = call i32 @atoi(i8* %8)
%61 = icmp eq i32 %59, %60
br i1 %61, label %80, label %62
62: ; preds = %49
%63 = load i32, i32* @BUFSIZ
%64 = load i32, i32* @stdin
%65 = call i32* @fgets(i8* %12, i32 %63, i32 %64)
%66 = icmp eq i32* %65, null
br i1 %66, label %88, label %67
67: ; preds = %62
%68 = add nsw i32 %37, %51
br label %69
69: ; preds = %67, %83
%70 = call i32 @strcpy(i8* %7, i8* %12)
%71 = call i32 @strlen(i8* %7)
%72 = call i32 @sendto(i32 %20, i8* %7, i32 %71, i32 0, %struct.sockaddr* %35, i32 12)
%73 = call i32 @recvfrom(i32 %20, i8* %8, i32 1000000, i32 0, i32* null, i32* null)
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %5, i64 0, i64 %74
store i8 0, i8* %75
%76 = load i32, i32* @stdout
%77 = call i32 @fputs(i8* %8, i32 %76)
%78 = call i32 @atoi(i8* %8)
%79 = icmp eq i32 %68, %78
br i1 %79, label %80, label %83
80: ; preds = %69, %49
%81 = call i32 @close(i32 %20)
%82 = call i32 @exit(i32 0)
unreachable
83: ; preds = %69
%84 = load i32, i32* @BUFSIZ
%85 = load i32, i32* @stdin
%86 = call i32* @fgets(i8* %12, i32 %84, i32 %85)
%87 = icmp eq i32* %86, null
br i1 %87, label %88, label %69
88: ; preds = %62, %83, %34, %17
ret i32 0
}