#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 socklen_t;
typedef int /*<<< orphan*/ servaddr;
typedef int /*<<< orphan*/ cliaddr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SOCK_DGRAM;
int atoi(char *);
int /*<<< orphan*/ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
char *inet_ntoa(TYPE_1__);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int ntohs(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int *);
int /*<<< orphan*/ sendto(int, char *, int, int /*<<< orphan*/,
                          struct sockaddr *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main(int argc, char **argv) {
  int sockfd, n;
  struct sockaddr_in servaddr, cliaddr;
  socklen_t len;
  char mesg[1000000];
  char buf[100];
  char temp[100];
  sockfd = socket(AF_INET, SOCK_DGRAM, 0);
  memset(&servaddr, 0, sizeof(servaddr));
  servaddr.sin_family = AF_INET;
  servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
  servaddr.sin_port = htons(32000);
  bind(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr));
  int count = 0;
  int number1 = 0, number2 = 0;
  int mesg_len = 0;
  for (;;) {
    len = sizeof(cliaddr);
    int check = 1;
    int number = 0;
    n = recvfrom(sockfd, mesg, 1000000, 0, (struct sockaddr *)&cliaddr, &len);
    for (int i = 0; i < n - 1; ++i) {
      if ((int)mesg[i] < '0' || (int)mesg[i] > '9') {
        strcpy(mesg, "숫자가 아닙니다 다시 입력해 주십시오\n");
        check = 0;
        break;
      }
    }
    if (check) {
      ++count;
      sprintf(temp, "%d 번째의 숫자가 입력되었습니다\n", count);
      if (count == 1) {
        number1 = atoi(mesg);
      } else if (count == 2) {
        number2 = atoi(mesg);
        sprintf(temp,
                "%d 번째의 숫자가 입력되었습니다. 두 수의 합을 보려면 엔터를 "
                "눌러주세요\n",
                count);
      }
      strcpy(mesg, temp);
    }
    if (count < 2) {
      mesg_len = strlen(mesg);
      strcpy(buf, inet_ntoa(cliaddr.sin_addr));
      sendto(sockfd, mesg, mesg_len, 0, (struct sockaddr *)&cliaddr,
             sizeof(cliaddr));
      printf("-------------------------------------------------------\n");
      mesg[mesg_len] = 0;
      printf("Received the following %d bytes from %s:%d:\n", n, buf,
             ntohs(cliaddr.sin_port));
      printf("%s", mesg);
      printf("-------------------------------------------------------\n");
    }
    if (count >= 2) {
      sprintf(temp, "%d\n", number1 + number2);
      strcpy(mesg, temp);
      mesg_len = strlen(mesg);
      mesg[mesg_len] = 0;
      sendto(sockfd, mesg, mesg_len, 0, (struct sockaddr *)&cliaddr,
             sizeof(cliaddr));
      printf("-------------------------------------------------------\n");
      printf("Received the following %d bytes from %s:%d:\n", n, buf,
             ntohs(cliaddr.sin_port));
      printf("%s", mesg);
      printf("-------------------------------------------------------\n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf43b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2de8(%rip),%rax
mov    (%rax),%edi
mov    0x2dcf(%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   1090 <memset@plt>
mov    0x2dbc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2da8(%rip),%rax
mov    (%rax),%edi
call   1080 <htonl@plt>
mov    %eax,-0x24(%rbp)
mov    $0x7d00,%edi
call   1060 <htons@plt>
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0xc,%edx
call   10d0 <bind@plt>
movl   $0x0,-0xf4364(%rbp)
movl   $0x0,-0xf4368(%rbp)
movl   $0x0,-0xf436c(%rbp)
movl   $0x0,-0xf4370(%rbp)
movl   $0xc,-0x3c(%rbp)
movl   $0x1,-0xf4374(%rbp)
movl   $0x0,-0xf4378(%rbp)
mov    -0x14(%rbp),%edi
lea    -0xf4280(%rbp),%rsi
lea    -0x38(%rbp),%r8
mov    $0xf4240,%edx
xor    %ecx,%ecx
lea    -0x3c(%rbp),%r9
call   10b0 <recvfrom@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0xf437c(%rbp)
mov    -0xf437c(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    134d <main+0x16d>
movslq -0xf437c(%rbp),%rax
movsbl -0xf4280(%rbp,%rax,1),%eax
ff
cmp    $0x30,%eax
jl     1312 <main+0x132>
movslq -0xf437c(%rbp),%rax
movsbl -0xf4280(%rbp,%rax,1),%eax
ff
cmp    $0x39,%eax
jle    1334 <main+0x154>
lea    -0xf4280(%rbp),%rdi
lea    0xce0(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0xf4374(%rbp)
jmp    134d <main+0x16d>
jmp    1339 <main+0x159>
mov    -0xf437c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf437c(%rbp)
jmp    12ce <main+0xee>
cmpl   $0x0,-0xf4374(%rbp)
je     13f6 <main+0x216>
mov    -0xf4364(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf4364(%rbp)
lea    -0xf4360(%rbp),%rdi
mov    -0xf4364(%rbp),%edx
lea    0xcb9(%rip),%rsi
call   10f0 <sprintf@plt>
cmpl   $0x1,-0xf4364(%rbp)
jne    13a6 <main+0x1c6>
lea    -0xf4280(%rbp),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0xf4368(%rbp)
jmp    13e3 <main+0x203>
cmpl   $0x2,-0xf4364(%rbp)
jne    13de <main+0x1fe>
lea    -0xf4280(%rbp),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0xf436c(%rbp)
lea    -0xf4360(%rbp),%rdi
mov    -0xf4364(%rbp),%edx
lea    0xc8b(%rip),%rsi
call   10f0 <sprintf@plt>
jmp    13e3 <main+0x203>
lea    -0xf4280(%rbp),%rdi
lea    -0xf4360(%rbp),%rsi
call   1030 <strcpy@plt>
cmpl   $0x2,-0xf4364(%rbp)
jge    14d7 <main+0x2f7>
lea    -0xf4280(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0xf4370(%rbp)
lea    -0xf42f0(%rbp),%rax
mov    %rax,-0xf4398(%rbp)
mov    -0x34(%rbp),%edi
call   1040 <inet_ntoa@plt>
mov    -0xf4398(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x14(%rbp),%edi
lea    -0xf4280(%rbp),%rsi
mov    -0xf4370(%rbp),%edx
lea    -0x38(%rbp),%r8
xor    %ecx,%ecx
mov    $0xc,%r9d
call   10a0 <sendto@plt>
lea    0xc67(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movslq -0xf4370(%rbp),%rax
movb   $0x0,-0xf4280(%rbp,%rax,1)
mov    -0x18(%rbp),%eax
mov    %eax,-0xf438c(%rbp)
lea    -0xf42f0(%rbp),%rax
mov    %rax,-0xf4388(%rbp)
mov    -0x38(%rbp),%edi
call   10c0 <ntohs@plt>
mov    -0xf438c(%rbp),%esi
mov    -0xf4388(%rbp),%rdx
mov    %eax,%ecx
lea    0xc55(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xf4280(%rbp),%rsi
lea    0xc6d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xbf9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
cmpl   $0x2,-0xf4364(%rbp)
jl     15c5 <main+0x3e5>
lea    -0xf4360(%rbp),%rdi
mov    -0xf4368(%rbp),%edx
add    -0xf436c(%rbp),%edx
lea    0xc34(%rip),%rsi
call   10f0 <sprintf@plt>
lea    -0xf4280(%rbp),%rdi
lea    -0xf4360(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xf4280(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0xf4370(%rbp)
movslq -0xf4370(%rbp),%rax
movb   $0x0,-0xf4280(%rbp,%rax,1)
mov    -0x14(%rbp),%edi
lea    -0xf4280(%rbp),%rsi
mov    -0xf4370(%rbp),%edx
lea    -0x38(%rbp),%r8
xor    %ecx,%ecx
mov    $0xc,%r9d
call   10a0 <sendto@plt>
lea    0xb6a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0xf43a4(%rbp)
lea    -0xf42f0(%rbp),%rax
mov    %rax,-0xf43a0(%rbp)
mov    -0x38(%rbp),%edi
call   10c0 <ntohs@plt>
mov    -0xf43a4(%rbp),%esi
mov    -0xf43a0(%rbp),%rdx
mov    %eax,%ecx
lea    0xb67(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xf4280(%rbp),%rsi
lea    0xb7f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xb0b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1288 <main+0xa8>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf4368,%rsp
mov    0x2de0(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2dc6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
mov    %eax,%ebx
lea    0x28(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   10a0 <memset@plt>
mov    0x0(%rbp),%eax
mov    %eax,0x30(%rsp)
mov    0x2da1(%rip),%rax
mov    (%rax),%edi
call   1090 <htonl@plt>
mov    %eax,0x2c(%rsp)
mov    $0x7d00,%edi
call   1070 <htons@plt>
mov    %eax,0x28(%rsp)
mov    %ebx,0x4(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0xc,%edx
call   10e0 <bind@plt>
lea    0x120(%rsp),%rbx
lea    0xb0(%rsp),%r15
lea    0x40(%rsp),%r12
xor    %eax,%eax
mov    %rax,0x20(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %ebp,%ebp
jmp    133f <main+0x14f>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x20(%rsp),%rax
mov    0x18(%rsp),%rcx
lea    (%rcx,%rax,1),%edx
mov    %r12,%rdi
lea    0xe42(%rip),%rsi
call   1100 <sprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
movslq %eax,%rdx
movb   $0x0,0x120(%rsp,%rdx,1)
mov    0x4(%rsp),%edi
mov    %rbx,%rsi
xor    %ecx,%ecx
lea    0x8(%rsp),%r8
mov    $0xc,%r9d
call   10b0 <sendto@plt>
lea    0xe03(%rip),%rbp
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%edi
call   10d0 <ntohs@plt>
lea    0xdb7(%rip),%rdi
mov    0x38(%rsp),%rsi
mov    %r15,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xdcc(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    %r14d,%ebp
movl   $0xc,0x14(%rsp)
mov    0x4(%rsp),%edi
mov    %rbx,%rsi
mov    $0xf4240,%edx
xor    %ecx,%ecx
lea    0x8(%rsp),%r8
lea    0x14(%rsp),%r9
call   10c0 <recvfrom@plt>
cmp    $0x2,%eax
mov    %rax,0x38(%rsp)
jl     1399 <main+0x1a9>
lea    -0x1(%rax),%esi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl 0x120(%rsp,%rcx,1),%edx
add    $0xc6,%dl
add    $0x1,%rcx
cmp    $0xf5,%dl
jbe    1400 <main+0x210>
cmp    %rcx,%rsi
jne    1380 <main+0x190>
lea    0x1(%rbp),%r13d
mov    %r12,%rdi
lea    0xc8f(%rip),%rsi
mov    %r13d,%edx
call   1100 <sprintf@plt>
test   %ebp,%ebp
je     13e0 <main+0x1f0>
cmp    $0x2,%r13d
jne    13ed <main+0x1fd>
mov    %rbx,%rdi
call   10f0 <atoi@plt>
mov    %rax,0x18(%rsp)
mov    %r12,%rdi
lea    0xc94(%rip),%rsi
mov    $0x2,%edx
call   1100 <sprintf@plt>
jmp    13ed <main+0x1fd>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   10f0 <atoi@plt>
mov    %rax,0x20(%rsp)
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
jmp    1412 <main+0x222>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
lea    0xbf6(%rip),%rsi
call   1030 <strcpy@plt>
mov    %ebp,%r13d
mov    %r13d,%r14d
cmp    $0x1,%r13d
jg     12a0 <main+0xb0>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebp
mov    0xc(%rsp),%edi
call   1050 <inet_ntoa@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    0x4(%rsp),%edi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %ecx,%ecx
lea    0x8(%rsp),%r8
mov    $0xc,%r9d
call   10b0 <sendto@plt>
mov    %rbx,%r13
lea    0xc9b(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
movslq %ebp,%rax
mov    %rbx,%rbp
mov    %r13,%rbx
lea    0x40(%rsp),%r12
movb   $0x0,0x120(%rsp,%rax,1)
jmp    1302 <main+0x112>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@INADDR_ANY = global i32 0
@.str = [54 x i8] c"\EC\88\AB\EC\9E\90\EA\B0\80 \EC\95\84\EB\8B\99\EB\8B\88\EB\8B\A4 \EB\8B\A4\EC\8B\9C \EC\9E\85\EB\A0\A5\ED\95\B4 \EC\A3\BC\EC\8B\AD\EC\8B\9C\EC\98\A4\0A\00"
@.str.1 = [46 x i8] c"%d \EB\B2\88\EC\A7\B8\EC\9D\98 \EC\88\AB\EC\9E\90\EA\B0\80 \EC\9E\85\EB\A0\A5\EB\90\98\EC\97\88\EC\8A\B5\EB\8B\88\EB\8B\A4\0A\00"
@.str.2 = [101 x i8] c"%d \EB\B2\88\EC\A7\B8\EC\9D\98 \EC\88\AB\EC\9E\90\EA\B0\80 \EC\9E\85\EB\A0\A5\EB\90\98\EC\97\88\EC\8A\B5\EB\8B\88\EB\8B\A4. \EB\91\90 \EC\88\98\EC\9D\98 \ED\95\A9\EC\9D\84 \EB\B3\B4\EB\A0\A4\EB\A9\B4 \EC\97\94\ED\84\B0\EB\A5\BC \EB\88\8C\EB\9F\AC\EC\A3\BC\EC\84\B8\EC\9A\94\0A\00"
@.str.3 = [57 x i8] c"-------------------------------------------------------\0A\00"
@.str.4 = [45 x i8] c"Received the following %d bytes from %s:%d:\0A\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [4 x i8] c"%d\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 %struct.sockaddr_in
%9 = alloca %struct.sockaddr_in
%10 = alloca i32
%11 = alloca [1000000 x i8]
%12 = alloca [100 x i8]
%13 = alloca [100 x i8]
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%21 = load i32, i32* @AF_INET
%22 = load i32, i32* @SOCK_DGRAM
%23 = call i32 @socket(i32 %21, i32 %22, i32 0)
store i32 %23, i32* %6
%24 = call i32 @memset(%struct.sockaddr_in* %8, i32 0, i32 12)
%25 = load i32, i32* @AF_INET
%26 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 2
store i32 %25, i32* %26
%27 = load i32, i32* @INADDR_ANY
%28 = call i32 @htonl(i32 %27)
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 1
%30 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %29, i32 0, i32 0
store i32 %28, i32* %30
%31 = call i32 @htons(i32 32000)
%32 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
store i32 %31, i32* %32
%33 = load i32, i32* %6
%34 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%35 = call i32 @bind(i32 %33, %struct.sockaddr* %34, i32 12)
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
store i32 0, i32* %17
br label %36
36: ; preds = %157, %2
store i32 12, i32* %10
store i32 1, i32* %18
store i32 0, i32* %19
%37 = load i32, i32* %6
%38 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%39 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%40 = call i32 @recvfrom(i32 %37, i8* %38, i32 1000000, i32 0, %struct.sockaddr* %39, i32* %10)
store i32 %40, i32* %7
store i32 0, i32* %20
br label %41
41: ; preds = %64, %36
%42 = load i32, i32* %20
%43 = load i32, i32* %7
%44 = sub nsw i32 %43, 1
%45 = icmp slt i32 %42, %44
br i1 %45, label %46, label %67
46: ; preds = %41
%47 = load i32, i32* %20
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 %48
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp slt i32 %51, 48
br i1 %52, label %60, label %53
53: ; preds = %46
%54 = load i32, i32* %20
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 %55
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = icmp sgt i32 %58, 57
br i1 %59, label %60, label %63
60: ; preds = %53, %46
%61 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%62 = call i32 @strcpy(i8* %61, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %18
br label %67
63: ; preds = %53
br label %64
64: ; preds = %63
%65 = load i32, i32* %20
%66 = add nsw i32 %65, 1
store i32 %66, i32* %20
br label %41
67: ; preds = %60, %41
%68 = load i32, i32* %18
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %95
70: ; preds = %67
%71 = load i32, i32* %14
%72 = add nsw i32 %71, 1
store i32 %72, i32* %14
%73 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%74 = load i32, i32* %14
%75 = call i32 @sprintf(i8* %73, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %74)
%76 = load i32, i32* %14
%77 = icmp eq i32 %76, 1
br i1 %77, label %78, label %81
78: ; preds = %70
%79 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%80 = call i32 @atoi(i8* %79)
store i32 %80, i32* %15
br label %91
81: ; preds = %70
%82 = load i32, i32* %14
%83 = icmp eq i32 %82, 2
br i1 %83, label %84, label %90
84: ; preds = %81
%85 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%86 = call i32 @atoi(i8* %85)
store i32 %86, i32* %16
%87 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%88 = load i32, i32* %14
%89 = call i32 @sprintf(i8* %87, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.2, i64 0, i64 0), i32 %88)
br label %90
90: ; preds = %84, %81
br label %91
91: ; preds = %90, %78
%92 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%93 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%94 = call i32 @strcpy(i8* %92, i8* %93)
br label %95
95: ; preds = %91, %67
%96 = load i32, i32* %14
%97 = icmp slt i32 %96, 2
br i1 %97, label %98, label %125
98: ; preds = %95
%99 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%100 = call i32 @strlen(i8* %99)
store i32 %100, i32* %17
%101 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%102 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 1
%103 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %102, i32 0, i32 0
%104 = load i32, i32* %103
%105 = call i8* @inet_ntoa(i32 %104)
%106 = call i32 @strcpy(i8* %101, i8* %105)
%107 = load i32, i32* %6
%108 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%109 = load i32, i32* %17
%110 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%111 = call i32 @sendto(i32 %107, i8* %108, i32 %109, i32 0, %struct.sockaddr* %110, i32 12)
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0))
%113 = load i32, i32* %17
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 %114
store i8 0, i8* %115
%116 = load i32, i32* %7
%117 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%118 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
%119 = load i32, i32* %118
%120 = call i32 @ntohs(i32 %119)
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i32 %116, i8* %117, i32 %120)
%122 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %122)
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0))
br label %125
125: ; preds = %98, %95
%126 = load i32, i32* %14
%127 = icmp sge i32 %126, 2
br i1 %127, label %128, label %157
128: ; preds = %125
%129 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%130 = load i32, i32* %15
%131 = load i32, i32* %16
%132 = add nsw i32 %130, %131
%133 = call i32 @sprintf(i8* %129, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %132)
%134 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%135 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%136 = call i32 @strcpy(i8* %134, i8* %135)
%137 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%138 = call i32 @strlen(i8* %137)
store i32 %138, i32* %17
%139 = load i32, i32* %17
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 %140
store i8 0, i8* %141
%142 = load i32, i32* %6
%143 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%144 = load i32, i32* %17
%145 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%146 = call i32 @sendto(i32 %142, i8* %143, i32 %144, i32 0, %struct.sockaddr* %145, i32 12)
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0))
%148 = load i32, i32* %7
%149 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%150 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
%151 = load i32, i32* %150
%152 = call i32 @ntohs(i32 %151)
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i32 %148, i8* %149, i32 %152)
%154 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %154)
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0))
br label %157
157: ; preds = %128, %125
br label %36
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@INADDR_ANY = global i32 0
@.str = [54 x i8] c"\EC\88\AB\EC\9E\90\EA\B0\80 \EC\95\84\EB\8B\99\EB\8B\88\EB\8B\A4 \EB\8B\A4\EC\8B\9C \EC\9E\85\EB\A0\A5\ED\95\B4 \EC\A3\BC\EC\8B\AD\EC\8B\9C\EC\98\A4\0A\00"
@.str.1 = [46 x i8] c"%d \EB\B2\88\EC\A7\B8\EC\9D\98 \EC\88\AB\EC\9E\90\EA\B0\80 \EC\9E\85\EB\A0\A5\EB\90\98\EC\97\88\EC\8A\B5\EB\8B\88\EB\8B\A4\0A\00"
@.str.2 = [101 x i8] c"%d \EB\B2\88\EC\A7\B8\EC\9D\98 \EC\88\AB\EC\9E\90\EA\B0\80 \EC\9E\85\EB\A0\A5\EB\90\98\EC\97\88\EC\8A\B5\EB\8B\88\EB\8B\A4. \EB\91\90 \EC\88\98\EC\9D\98 \ED\95\A9\EC\9D\84 \EB\B3\B4\EB\A0\A4\EB\A9\B4 \EC\97\94\ED\84\B0\EB\A5\BC \EB\88\8C\EB\9F\AC\EC\A3\BC\EC\84\B8\EC\9A\94\0A\00"
@.str.4 = [45 x i8] c"Received the following %d bytes from %s:%d:\0A\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [4 x i8] c"%d\0A\00"
@str.9 = [56 x i8] c"-------------------------------------------------------\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca [1000000 x i8]
%7 = alloca [100 x i8]
%8 = alloca [100 x i8]
%9 = bitcast %struct.sockaddr_in* %3 to i8*
%10 = bitcast %struct.sockaddr_in* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%15 = load i32, i32* @AF_INET
%16 = load i32, i32* @SOCK_DGRAM
%17 = tail call i32 @socket(i32 %15, i32 %16, i32 0)
%18 = call i32 @memset(%struct.sockaddr_in* %3, i32 0, i32 12)
%19 = load i32, i32* @AF_INET
%20 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %19, i32* %20
%21 = load i32, i32* @INADDR_ANY
%22 = call i32 @htonl(i32 %21)
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
store i32 %22, i32* %23
%24 = call i32 @htons(i32 32000)
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %24, i32* %25
%26 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%27 = call i32 @bind(i32 %17, %struct.sockaddr* %26, i32 12)
%28 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
%30 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 1, i32 0
br label %31
31: ; preds = %91, %2
%32 = phi i32 [ 0, %2 ], [ %67, %91 ]
%33 = phi i32 [ 0, %2 ], [ %68, %91 ]
%34 = phi i32 [ 0, %2 ], [ %69, %91 ]
store i32 12, i32* %5
%35 = call i32 @recvfrom(i32 %17, i8* %12, i32 1000000, i32 0, %struct.sockaddr* %28, i32* %5)
%36 = icmp sgt i32 %35, 1
br i1 %36, label %37, label %51
37: ; preds = %31
%38 = add nsw i32 %35, -1
%39 = zext i32 %38 to i64
br label %42
40: ; preds = %42
%41 = icmp eq i64 %48, %39
br i1 %41, label %51, label %42
42: ; preds = %37, %40
%43 = phi i64 [ 0, %37 ], [ %48, %40 ]
%44 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %6, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = add i8 %45, -58
%47 = icmp ult i8 %46, -10
%48 = add nuw nsw i64 %43, 1
br i1 %47, label %49, label %40
49: ; preds = %42
%50 = call i32 @strcpy(i8* %12, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
br label %66
51: ; preds = %40, %31
%52 = add nsw i32 %34, 1
%53 = call i32 @sprintf(i8* %14, i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %52)
%54 = icmp eq i32 %34, 0
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = call i32 @atoi(i8* %12)
br label %62
57: ; preds = %51
%58 = icmp eq i32 %52, 2
br i1 %58, label %59, label %62
59: ; preds = %57
%60 = call i32 @atoi(i8* %12)
%61 = call i32 @sprintf(i8* %14, i8* dereferenceable(1) getelementptr inbounds ([101 x i8], [101 x i8]* @.str.2, i64 0, i64 0), i32 2)
br label %62
62: ; preds = %57, %59, %55
%63 = phi i32 [ %56, %55 ], [ %32, %59 ], [ %32, %57 ]
%64 = phi i32 [ %33, %55 ], [ %60, %59 ], [ %33, %57 ]
%65 = call i32 @strcpy(i8* %12, i8* %14)
br label %66
66: ; preds = %49, %62
%67 = phi i32 [ %63, %62 ], [ %32, %49 ]
%68 = phi i32 [ %64, %62 ], [ %33, %49 ]
%69 = phi i32 [ %52, %62 ], [ %34, %49 ]
%70 = icmp slt i32 %69, 2
br i1 %70, label %71, label %81
71: ; preds = %66
%72 = call i32 @strlen(i8* %12)
%73 = load i32, i32* %30
%74 = call i8* @inet_ntoa(i32 %73)
%75 = call i32 @strcpy(i8* %13, i8* %74)
%76 = call i32 @sendto(i32 %17, i8* %12, i32 %72, i32 0, %struct.sockaddr* %28, i32 12)
%77 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.9, i64 0, i64 0))
%78 = sext i32 %72 to i64
%79 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %6, i64 0, i64 %78
store i8 0, i8* %79
%80 = load i32, i32* %29
br label %91
81: ; preds = %66
%82 = add nsw i32 %68, %67
%83 = call i32 @sprintf(i8* %14, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %82)
%84 = call i32 @strcpy(i8* %12, i8* %14)
%85 = call i32 @strlen(i8* %12)
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %6, i64 0, i64 %86
store i8 0, i8* %87
%88 = call i32 @sendto(i32 %17, i8* %12, i32 %85, i32 0, %struct.sockaddr* %28, i32 12)
%89 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.9, i64 0, i64 0))
%90 = load i32, i32* %29
br label %91
91: ; preds = %71, %81
%92 = phi i32 [ %80, %71 ], [ %90, %81 ]
%93 = phi i8* [ getelementptr inbounds ([56 x i8], [56 x i8]* @str.9, i64 0, i64 0), %71 ], [ getelementptr inbounds ([56 x i8], [56 x i8]* @str.9, i64 0, i64 0), %81 ]
%94 = call i32 @ntohs(i32 %92)
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i32 %35, i8* %13, i32 %94)
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %12)
%97 = call i32 @puts(i8* dereferenceable(1) %93)
br label %31
}