#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;
typedef int /*<<< orphan*/ send_number;
typedef int /*<<< orphan*/ recv_number;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int BUFSIZ;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
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, int *, int, int /*<<< orphan*/, int /*<<< orphan*/ *,
             int /*<<< orphan*/ *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ sendto(int, int *, int, int /*<<< orphan*/,
                          struct sockaddr *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int sockfd, send_number, recv_number, n;
  struct sockaddr_in servaddr, cliaddr;
  char sendline[1000000];
  char recvline[1000000];
  char buf[BUFSIZ];
  int count = 0, number1, number2;
  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);
  while (1) {
    switch (count) {
    case 0:
      scanf("%d", &send_number);
      printf("클라이언트에서 첫번째로 보내는 수는 %d 입니다 \n", send_number);
      sendto(sockfd, &send_number, sizeof(send_number), 0,
             (struct sockaddr *)&servaddr, sizeof(servaddr));
      n = recvfrom(sockfd, &recv_number, sizeof(recv_number), 0, NULL, NULL);
      printf("서버측에서 받았다는 첫번째 수는 %d 입니다 \n", recv_number);
      ++count;
      number1 = send_number;
      break;
    case 1:
      scanf("%d", &send_number);
      printf("클라이언트에서 두번째로 보내는 수는 %d 입니다 \n", send_number);
      sendto(sockfd, &send_number, sizeof(send_number), 0,
             (struct sockaddr *)&servaddr, sizeof(servaddr));
      n = recvfrom(sockfd, &recv_number, sizeof(recv_number), 0, NULL, NULL);
      printf("서버측에서 계산한 첫번째 수 + 두번째 수는 %d 입니다 \n",
             recv_number);
      number2 = send_number;
      if (number1 + number2 == recv_number) {
        printf("서버측에서 계산한답과, 클라이언트에서 계산한답이 같으므로 접속 "
               "종료\n");
        close(sockfd);
        exit(0);
      }
      ++count;
      break;
    default:
      break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e84e0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e10(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x1e84c8(%rbp)
mov    %rax,-0x1e84d0(%rbp)
movl   $0x0,-0x1e84d4(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11ff <main+0x5f>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    0x2de2(%rip),%rax
mov    (%rax),%edi
mov    0x2dd1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10c0 <socket@plt>
mov    %eax,-0x14(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1050 <memset@plt>
mov    0x2db6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <inet_addr@plt>
mov    %eax,-0x2c(%rbp)
mov    $0x7d00,%edi
call   1030 <htons@plt>
mov    %eax,-0x30(%rbp)
jmp    1259 <main+0xb9>
mov    -0x1e84d4(%rbp),%eax
mov    %eax,-0x1e84e0(%rbp)
test   %eax,%eax
je     1286 <main+0xe6>
jmp    1272 <main+0xd2>
mov    -0x1e84e0(%rbp),%eax
sub    $0x1,%eax
je     1310 <main+0x170>
jmp    13cc <main+0x22c>
lea    0xd8e(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   10a0 <scanf@plt>
mov    -0x18(%rbp),%esi
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0x30(%rbp),%r8
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    $0xc,%r9d
call   1060 <sendto@plt>
mov    -0x14(%rbp),%edi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   1090 <recvfrom@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1e84d4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1e84d4(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1e84d8(%rbp)
jmp    13d1 <main+0x231>
lea    0xd04(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   10a0 <scanf@plt>
mov    -0x18(%rbp),%esi
lea    0xd74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0x30(%rbp),%r8
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    $0xc,%r9d
call   1060 <sendto@plt>
mov    -0x14(%rbp),%edi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   1090 <recvfrom@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xd6b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1e84dc(%rbp)
mov    -0x1e84d8(%rbp),%eax
add    -0x1e84dc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    13b8 <main+0x218>
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
xor    %edi,%edi
call   10b0 <exit@plt>
mov    -0x1e84d4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1e84d4(%rbp)
jmp    13d1 <main+0x231>
jmp    13d1 <main+0x231>
jmp    1254 <main+0xb4>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
cmp    $0x2,%edi
jne    1327 <main+0x177>
mov    %rsi,%rbp
mov    0x2e17(%rip),%r15
mov    (%r15),%edi
mov    0x2e05(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10d0 <socket@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1060 <memset@plt>
mov    (%r15),%eax
mov    %eax,0x10(%rsp)
mov    0x8(%rbp),%rdi
call   1090 <inet_addr@plt>
mov    %eax,0xc(%rsp)
mov    $0x7d00,%edi
call   1040 <htons@plt>
mov    %eax,0x8(%rsp)
lea    0xddd(%rip),%r15
mov    %rsp,%r12
lea    0x4(%rsp),%rbp
xor    %eax,%eax
jmp    12b0 <main+0x100>
mov    %r15,%rdi
mov    %r12,%rsi
call   10b0 <scanf@plt>
mov    (%rsp),%esi
lea    0xe3c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
mov    %r12,%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    %r14,%r8
mov    $0xc,%r9d
call   1070 <sendto@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   10a0 <recvfrom@plt>
mov    0x4(%rsp),%esi
lea    0xe3c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%ecx
add    %r13d,%ecx
mov    $0x2,%eax
cmp    0x4(%rsp),%ecx
je     133d <main+0x18d>
cs nopw 0x0(%rax,%rax,1)
cmp    $0x1,%eax
je     1232 <main+0x82>
test   %eax,%eax
jne    12b0 <main+0x100>
mov    %r15,%rdi
mov    %r12,%rsi
call   10b0 <scanf@plt>
mov    (%rsp),%esi
lea    0xd31(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
mov    %r12,%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    %r14,%r8
mov    $0xc,%r9d
call   1070 <sendto@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   10a0 <recvfrom@plt>
mov    0x4(%rsp),%esi
lea    0xd31(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%eax
mov    (%rsp),%r13d
jmp    12b0 <main+0x100>
lea    0xe44(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
lea    0xdcc(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1080 <close@plt>
xor    %edi,%edi
call   10c0 <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
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [67 x i8] c"\ED\81\B4\EB\9D\BC\EC\9D\B4\EC\96\B8\ED\8A\B8\EC\97\90\EC\84\9C \EC\B2\AB\EB\B2\88\EC\A7\B8\EB\A1\9C \EB\B3\B4\EB\82\B4\EB\8A\94 \EC\88\98\EB\8A\94 %d \EC\9E\85\EB\8B\88\EB\8B\A4 \0A\00"
@.str.3 = [61 x i8] c"\EC\84\9C\EB\B2\84\EC\B8\A1\EC\97\90\EC\84\9C \EB\B0\9B\EC\95\98\EB\8B\A4\EB\8A\94 \EC\B2\AB\EB\B2\88\EC\A7\B8 \EC\88\98\EB\8A\94 %d \EC\9E\85\EB\8B\88\EB\8B\A4 \0A\00"
@.str.4 = [67 x i8] c"\ED\81\B4\EB\9D\BC\EC\9D\B4\EC\96\B8\ED\8A\B8\EC\97\90\EC\84\9C \EB\91\90\EB\B2\88\EC\A7\B8\EB\A1\9C \EB\B3\B4\EB\82\B4\EB\8A\94 \EC\88\98\EB\8A\94 %d \EC\9E\85\EB\8B\88\EB\8B\A4 \0A\00"
@.str.5 = [74 x i8] c"\EC\84\9C\EB\B2\84\EC\B8\A1\EC\97\90\EC\84\9C \EA\B3\84\EC\82\B0\ED\95\9C \EC\B2\AB\EB\B2\88\EC\A7\B8 \EC\88\98 + \EB\91\90\EB\B2\88\EC\A7\B8 \EC\88\98\EB\8A\94 %d \EC\9E\85\EB\8B\88\EB\8B\A4 \0A\00"
@.str.6 = [99 x i8] c"\EC\84\9C\EB\B2\84\EC\B8\A1\EC\97\90\EC\84\9C \EA\B3\84\EC\82\B0\ED\95\9C\EB\8B\B5\EA\B3\BC, \ED\81\B4\EB\9D\BC\EC\9D\B4\EC\96\B8\ED\8A\B8\EC\97\90\EC\84\9C \EA\B3\84\EC\82\B0\ED\95\9C\EB\8B\B5\EC\9D\B4 \EA\B0\99\EC\9C\BC\EB\AF\80\EB\A1\9C \EC\A0\91\EC\86\8D \EC\A2\85\EB\A3\8C\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 i32
%9 = alloca i32
%10 = alloca %struct.sockaddr_in
%11 = alloca %struct.sockaddr_in
%12 = alloca [1000000 x i8]
%13 = alloca [1000000 x i8]
%14 = alloca i8*
%15 = alloca i64
%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** %14
%22 = alloca i8, i64 %20
store i64 %20, i64* %15
store i32 0, i32* %16
%23 = load i32, i32* %4
%24 = icmp ne i32 %23, 2
br i1 %24, label %25, label %28
25: ; preds = %2
%26 = call i32 (i8*, ...) @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* %10, i32 0, i32 12)
%33 = load i32, i32* @AF_INET
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, 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* %10, 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* %10, i32 0, i32 0
store i32 %41, i32* %42
br label %43
43: ; preds = %86, %28
br label %44
44: ; preds = %43
%45 = load i32, i32* %16
switch i32 %45, label %85 [
i32 0, label %46
i32 1, label %60
]
46: ; preds = %44
%47 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%48 = load i32, i32* %7
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0), i32 %48)
%50 = load i32, i32* %6
%51 = bitcast %struct.sockaddr_in* %10 to %struct.sockaddr*
%52 = call i32 @sendto(i32 %50, i32* %7, i32 4, i32 0, %struct.sockaddr* %51, i32 12)
%53 = load i32, i32* %6
%54 = call i32 @recvfrom(i32 %53, i32* %8, i32 4, i32 0, i32* null, i32* null)
store i32 %54, i32* %9
%55 = load i32, i32* %8
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0), i32 %55)
%57 = load i32, i32* %16
%58 = add nsw i32 %57, 1
store i32 %58, i32* %16
%59 = load i32, i32* %7
store i32 %59, i32* %17
br label %86
60: ; preds = %44
%61 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%62 = load i32, i32* %7
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.4, i64 0, i64 0), i32 %62)
%64 = load i32, i32* %6
%65 = bitcast %struct.sockaddr_in* %10 to %struct.sockaddr*
%66 = call i32 @sendto(i32 %64, i32* %7, i32 4, i32 0, %struct.sockaddr* %65, i32 12)
%67 = load i32, i32* %6
%68 = call i32 @recvfrom(i32 %67, i32* %8, i32 4, i32 0, i32* null, i32* null)
store i32 %68, i32* %9
%69 = load i32, i32* %8
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.5, i64 0, i64 0), i32 %69)
%71 = load i32, i32* %7
store i32 %71, i32* %18
%72 = load i32, i32* %17
%73 = load i32, i32* %18
%74 = add nsw i32 %72, %73
%75 = load i32, i32* %8
%76 = icmp eq i32 %74, %75
br i1 %76, label %77, label %82
77: ; preds = %60
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.6, i64 0, i64 0))
%79 = load i32, i32* %6
%80 = call i32 @close(i32 %79)
%81 = call i32 @exit(i32 0)
unreachable
82: ; preds = %60
%83 = load i32, i32* %16
%84 = add nsw i32 %83, 1
store i32 %84, i32* %16
br label %86
85: ; preds = %44
br label %86
86: ; preds = %85, %82, %46
br label %43
}

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
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [67 x i8] c"\ED\81\B4\EB\9D\BC\EC\9D\B4\EC\96\B8\ED\8A\B8\EC\97\90\EC\84\9C \EC\B2\AB\EB\B2\88\EC\A7\B8\EB\A1\9C \EB\B3\B4\EB\82\B4\EB\8A\94 \EC\88\98\EB\8A\94 %d \EC\9E\85\EB\8B\88\EB\8B\A4 \0A\00"
@.str.3 = [61 x i8] c"\EC\84\9C\EB\B2\84\EC\B8\A1\EC\97\90\EC\84\9C \EB\B0\9B\EC\95\98\EB\8B\A4\EB\8A\94 \EC\B2\AB\EB\B2\88\EC\A7\B8 \EC\88\98\EB\8A\94 %d \EC\9E\85\EB\8B\88\EB\8B\A4 \0A\00"
@.str.4 = [67 x i8] c"\ED\81\B4\EB\9D\BC\EC\9D\B4\EC\96\B8\ED\8A\B8\EC\97\90\EC\84\9C \EB\91\90\EB\B2\88\EC\A7\B8\EB\A1\9C \EB\B3\B4\EB\82\B4\EB\8A\94 \EC\88\98\EB\8A\94 %d \EC\9E\85\EB\8B\88\EB\8B\A4 \0A\00"
@.str.5 = [74 x i8] c"\EC\84\9C\EB\B2\84\EC\B8\A1\EC\97\90\EC\84\9C \EA\B3\84\EC\82\B0\ED\95\9C \EC\B2\AB\EB\B2\88\EC\A7\B8 \EC\88\98 + \EB\91\90\EB\B2\88\EC\A7\B8 \EC\88\98\EB\8A\94 %d \EC\9E\85\EB\8B\88\EB\8B\A4 \0A\00"
@str = [98 x i8] c"\EC\84\9C\EB\B2\84\EC\B8\A1\EC\97\90\EC\84\9C \EA\B3\84\EC\82\B0\ED\95\9C\EB\8B\B5\EA\B3\BC, \ED\81\B4\EB\9D\BC\EC\9D\B4\EC\96\B8\ED\8A\B8\EC\97\90\EC\84\9C \EA\B3\84\EC\82\B0\ED\95\9C\EB\8B\B5\EC\9D\B4 \EA\B0\99\EC\9C\BC\EB\AF\80\EB\A1\9C \EC\A0\91\EC\86\8D \EC\A2\85\EB\A3\8C\00"
@str.7 = [26 x i8] c"usage: ex04c <IP address>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sockaddr_in
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast %struct.sockaddr_in* %5 to i8*
%9 = icmp eq i32 %0, 2
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.7, i64 0, i64 0))
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i32, i32* @AF_INET
%15 = load i32, i32* @SOCK_DGRAM
%16 = tail call i32 @socket(i32 %14, i32 %15, i32 0)
%17 = call i32 @memset(%struct.sockaddr_in* %5, i32 0, i32 12)
%18 = load i32, i32* @AF_INET
%19 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 2
store i32 %18, i32* %19
%20 = getelementptr inbounds i8*, i8** %1, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @inet_addr(i8* %21)
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, 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* %5, i64 0, i32 0
store i32 %24, i32* %25
%26 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
br label %27
27: ; preds = %13, %33
%28 = phi i32 [ 0, %13 ], [ 1, %33 ]
%29 = phi i32 [ undef, %13 ], [ %41, %33 ]
br label %30
30: ; preds = %27, %42
%31 = phi i32 [ 2, %42 ], [ %28, %27 ]
br label %32
32: ; preds = %30, %32
switch i32 %31, label %32 [
i32 0, label %33
i32 1, label %42
]
33: ; preds = %32
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%35 = load i32, i32* %3
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0), i32 %35)
%37 = call i32 @sendto(i32 %16, i32* %3, i32 4, i32 0, %struct.sockaddr* %26, i32 12)
%38 = call i32 @recvfrom(i32 %16, i32* %4, i32 4, i32 0, i32* null, i32* null)
%39 = load i32, i32* %4
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0), i32 %39)
%41 = load i32, i32* %3
br label %27
42: ; preds = %32
%43 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%44 = load i32, i32* %3
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.4, i64 0, i64 0), i32 %44)
%46 = call i32 @sendto(i32 %16, i32* %3, i32 4, i32 0, %struct.sockaddr* %26, i32 12)
%47 = call i32 @recvfrom(i32 %16, i32* %4, i32 4, i32 0, i32* null, i32* null)
%48 = load i32, i32* %4
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @.str.5, i64 0, i64 0), i32 %48)
%50 = load i32, i32* %3
%51 = add nsw i32 %50, %29
%52 = load i32, i32* %4
%53 = icmp eq i32 %51, %52
br i1 %53, label %54, label %30
54: ; preds = %42
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @str, i64 0, i64 0))
%56 = call i32 @close(i32 %16)
%57 = call i32 @exit(i32 0)
unreachable
}