#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_zero;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef size_t ssize_t;
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ htons(int);
scalar_t__ inet_aton(char *, int /*<<< orphan*/ *);
char *inet_ntoa(int /*<<< orphan*/);
int /*<<< orphan*/ memset(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
size_t recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *,
                int /*<<< orphan*/ *);
size_t sendto(int, char *, int /*<<< orphan*/, int /*<<< orphan*/,
              struct sockaddr const *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char **argv) {
  int iSocketClient;
  ssize_t iSendLen;
  ssize_t iRecvLen;
  socklen_t iAddrLen;
  char strRecvBuf[1000];
  struct sockaddr_in tSocketServerAddr;
  if (argc != 3) {
    printf("Usage : %s <serverip> dbglevelh=<0-9>.\n", argv[0]);
    printf("Usage : %s <serverip> setclient\n", argv[0]);
    printf("Usage : %s <serverip> stdout= 0 | 1\n", argv[0]);
    printf("Usage : %s <serverip> show\n", argv[0]);
    return -1;
  }
  iSocketClient = socket(AF_INET, SOCK_DGRAM, 0);
  if (-1 == iSocketClient) {
    printf("socket error\n");
    return -1;
  }
  tSocketServerAddr.sin_family = AF_INET;
  tSocketServerAddr.sin_port = htons(8888);
  if (0 == inet_aton(argv[1], &tSocketServerAddr.sin_addr)) {
    printf("Invalid serverip.\n");
    close(iSocketClient);
    return -1;
  }
  memset(tSocketServerAddr.sin_zero, 0, 8);
  if (0 == strcmp(argv[2], "show")) {
    iSendLen = sendto(iSocketClient, "setclient", strlen("setclient"), 0,
                      (const struct sockaddr *)&tSocketServerAddr,
                      sizeof(struct sockaddr));
    while (1) {
      iRecvLen = recvfrom(iSocketClient, strRecvBuf, 999, 0,
                          (struct sockaddr *)&tSocketServerAddr, &iAddrLen);
      if (iRecvLen > 0) {
        strRecvBuf[iRecvLen] = '\0';
        printf("Get Message from %s:%s\n",
               inet_ntoa(tSocketServerAddr.sin_addr), strRecvBuf);
      }
    }
  } else {
    iSendLen = sendto(iSocketClient, argv[2], strlen(argv[2]), 0,
                      (const struct sockaddr *)&tSocketServerAddr,
                      sizeof(struct sockaddr));
  }
  close(iSocketClient);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1233 <main+0x83>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1409 <main+0x259>
mov    0x2dae(%rip),%rax
mov    (%rax),%edi
mov    0x2d9d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10d0 <socket@plt>
mov    %eax,-0x14(%rbp)
mov    $0xffffffff,%eax
cmp    -0x14(%rbp),%eax
jne    1277 <main+0xc7>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1409 <main+0x259>
mov    0x2d6a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x424(%rbp)
mov    $0x22b8,%edi
call   1050 <htons@plt>
mov    %eax,-0x428(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x430(%rbp),%rsi
call   10b0 <inet_aton@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    12da <main+0x12a>
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1409 <main+0x259>
mov    -0x42c(%rbp),%edi
xor    %esi,%esi
mov    $0x8,%edx
call   1070 <memset@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdb0(%rip),%rsi
call   10a0 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    13ae <main+0x1fe>
mov    -0x14(%rbp),%eax
mov    %eax,-0x434(%rbp)
lea    0xd92(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x434(%rbp),%edi
mov    %eax,%edx
lea    -0x430(%rbp),%r8
lea    0xd77(%rip),%rsi
xor    %ecx,%ecx
mov    $0x4,%r9d
call   1080 <sendto@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x420(%rbp),%rsi
lea    -0x430(%rbp),%r8
mov    $0x3e7,%edx
xor    %ecx,%ecx
lea    -0x2c(%rbp),%r9
call   10c0 <recvfrom@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jbe    13a9 <main+0x1f9>
mov    -0x28(%rbp),%rax
movb   $0x0,-0x420(%rbp,%rax,1)
mov    -0x430(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rsi
lea    -0x420(%rbp),%rdx
lea    0xd18(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    134a <main+0x19a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x444(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x440(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <strlen@plt>
mov    -0x444(%rbp),%edi
mov    -0x440(%rbp),%rsi
mov    %eax,%edx
lea    -0x430(%rbp),%r8
xor    %ecx,%ecx
mov    $0x4,%r9d
call   1080 <sendto@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x410,%rsp
mov    %rsi,%r14
cmp    $0x3,%edi
jne    1286 <main+0xc6>
mov    0x2e06(%rip),%rbx
mov    (%rbx),%edi
mov    0x2df5(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
cmp    $0xffffffff,%eax
je     12cc <main+0x10c>
mov    %eax,%r15d
mov    (%rbx),%eax
mov    %eax,0x14(%rsp)
mov    $0x22b8,%edi
call   1060 <htons@plt>
mov    %eax,0x10(%rsp)
mov    0x8(%r14),%rdi
lea    0x8(%rsp),%rsi
call   10c0 <inet_aton@plt>
test   %rax,%rax
je     12da <main+0x11a>
mov    0xc(%rsp),%edi
xor    %ebp,%ebp
xor    %esi,%esi
mov    $0x8,%edx
call   1080 <memset@plt>
mov    0x10(%r14),%rdi
lea    0xe42(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1305 <main+0x145>
mov    0x10(%r14),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x8(%rsp),%r8
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
mov    $0x4,%r9d
call   1090 <sendto@plt>
mov    %r15d,%edi
call   10a0 <close@plt>
jmp    12f3 <main+0x133>
mov    (%r14),%rsi
lea    0xd70(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r14),%rsi
lea    0xd87(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r14),%rsi
lea    0xd97(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%r14),%rsi
lea    0xdab(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    12ee <main+0x12e>
lea    0xdf0(%rip),%rdi
call   1030 <puts@plt>
jmp    12ee <main+0x12e>
lea    0xdd0(%rip),%rdi
call   1030 <puts@plt>
mov    %r15d,%edi
call   10a0 <close@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x410,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd83(%rip),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x8(%rsp),%r14
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
mov    %r14,%r8
mov    $0x4,%r9d
call   1090 <sendto@plt>
lea    0x20(%rsp),%rbx
lea    0x1c(%rsp),%rbp
lea    0xd57(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15d,%edi
mov    %rbx,%rsi
mov    $0x3e7,%edx
xor    %ecx,%ecx
mov    %r14,%r8
mov    %rbp,%r9
call   10d0 <recvfrom@plt>
test   %rax,%rax
je     1350 <main+0x190>
movb   $0x0,0x20(%rsp,%rax,1)
mov    0x8(%rsp),%edi
call   1040 <inet_ntoa@plt>
mov    %r12,%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1350 <main+0x190>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, i32, i32, i32 }
%struct.sockaddr = type { i32 }
@.str = [40 x i8] c"Usage : %s <serverip> dbglevelh=<0-9>.\0A\00"
@.str.1 = [33 x i8] c"Usage : %s <serverip> setclient\0A\00"
@.str.2 = [37 x i8] c"Usage : %s <serverip> stdout= 0 | 1\0A\00"
@.str.3 = [28 x i8] c"Usage : %s <serverip> show\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str.4 = [14 x i8] c"socket error\0A\00"
@.str.5 = [19 x i8] c"Invalid serverip.\0A\00"
@.str.6 = [5 x i8] c"show\00"
@.str.7 = [10 x i8] c"setclient\00"
@.str.8 = [24 x i8] c"Get Message from %s:%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
%10 = alloca [1000 x i8]
%11 = alloca %struct.sockaddr_in
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 3
br i1 %13, label %14, label %31
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %17)
%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 ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %21)
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 0
%25 = load i8*, i8** %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %25)
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 0
%29 = load i8*, i8** %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i8* %29)
store i32 -1, i32* %3
br label %98
31: ; preds = %2
%32 = load i32, i32* @AF_INET
%33 = load i32, i32* @SOCK_DGRAM
%34 = call i32 @socket(i32 %32, i32 %33, i32 0)
store i32 %34, i32* %6
%35 = load i32, i32* %6
%36 = icmp eq i32 -1, %35
br i1 %36, label %37, label %39
37: ; preds = %31
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %98
39: ; preds = %31
%40 = load i32, i32* @AF_INET
%41 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 3
store i32 %40, i32* %41
%42 = call i32 @htons(i32 8888)
%43 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 2
store i32 %42, i32* %43
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 1
%46 = load i8*, i8** %45
%47 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
%48 = call i64 @inet_aton(i8* %46, i32* %47)
%49 = icmp eq i64 0, %48
br i1 %49, label %50, label %54
50: ; preds = %39
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%52 = load i32, i32* %6
%53 = call i32 @close(i32 %52)
store i32 -1, i32* %3
br label %98
54: ; preds = %39
%55 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 1
%56 = load i32, i32* %55
%57 = call i32 @memset(i32 %56, i32 0, i32 8)
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 2
%60 = load i8*, i8** %59
%61 = call i64 @strcmp(i8* %60, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%62 = icmp eq i64 0, %61
br i1 %62, label %63, label %84
63: ; preds = %54
%64 = load i32, i32* %6
%65 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%66 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%67 = call i64 @sendto(i32 %64, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 %65, i32 0, %struct.sockaddr* %66, i32 4)
store i64 %67, i64* %7
br label %68
68: ; preds = %63, %83
%69 = load i32, i32* %6
%70 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%71 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%72 = call i64 @recvfrom(i32 %69, i8* %70, i32 999, i32 0, %struct.sockaddr* %71, i32* %9)
store i64 %72, i64* %8
%73 = load i64, i64* %8
%74 = icmp ugt i64 %73, 0
br i1 %74, label %75, label %83
75: ; preds = %68
%76 = load i64, i64* %8
%77 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 %76
store i8 0, i8* %77
%78 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
%79 = load i32, i32* %78
%80 = call i8* @inet_ntoa(i32 %79)
%81 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i8* %80, i8* %81)
br label %83
83: ; preds = %75, %68
br label %68
84: ; preds = %54
%85 = load i32, i32* %6
%86 = load i8**, i8*** %5
%87 = getelementptr inbounds i8*, i8** %86, i64 2
%88 = load i8*, i8** %87
%89 = load i8**, i8*** %5
%90 = getelementptr inbounds i8*, i8** %89, i64 2
%91 = load i8*, i8** %90
%92 = call i32 @strlen(i8* %91)
%93 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%94 = call i64 @sendto(i32 %85, i8* %88, i32 %92, i32 0, %struct.sockaddr* %93, i32 4)
store i64 %94, i64* %7
br label %95
95: ; preds = %84
%96 = load i32, i32* %6
%97 = call i32 @close(i32 %96)
store i32 0, i32* %3
br label %98
98: ; preds = %95, %50, %37, %14
%99 = load i32, i32* %3
ret i32 %99
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, i32, i32, i32 }
%struct.sockaddr = type { i32 }
@.str = [40 x i8] c"Usage : %s <serverip> dbglevelh=<0-9>.\0A\00"
@.str.1 = [33 x i8] c"Usage : %s <serverip> setclient\0A\00"
@.str.2 = [37 x i8] c"Usage : %s <serverip> stdout= 0 | 1\0A\00"
@.str.3 = [28 x i8] c"Usage : %s <serverip> show\0A\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str.6 = [5 x i8] c"show\00"
@.str.7 = [10 x i8] c"setclient\00"
@.str.8 = [24 x i8] c"Get Message from %s:%s\0A\00"
@str = [18 x i8] c"Invalid serverip.\00"
@str.9 = [13 x i8] c"socket error\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca [1000 x i8]
%5 = alloca %struct.sockaddr_in
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%8 = bitcast %struct.sockaddr_in* %5 to i8*
%9 = icmp eq i32 %0, 3
br i1 %9, label %19, label %10
10: ; preds = %2
%11 = load i8*, i8** %1
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %1
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%17 = load i8*, i8** %1
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i8* %17)
br label %66
19: ; preds = %2
%20 = load i32, i32* @AF_INET
%21 = load i32, i32* @SOCK_DGRAM
%22 = tail call i32 @socket(i32 %20, i32 %21, i32 0)
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %26
24: ; preds = %19
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.9, i64 0, i64 0))
br label %66
26: ; preds = %19
%27 = load i32, i32* @AF_INET
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 3
store i32 %27, i32* %28
%29 = tail call i32 @htons(i32 8888)
%30 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 2
store i32 %29, i32* %30
%31 = getelementptr inbounds i8*, i8** %1, i64 1
%32 = load i8*, i8** %31
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 0
%34 = call i64 @inet_aton(i8* %32, i32* %33)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %26
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%38 = call i32 @close(i32 %22)
br label %66
39: ; preds = %26
%40 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 1
%41 = load i32, i32* %40
%42 = call i32 @memset(i32 %41, i32 0, i32 8)
%43 = getelementptr inbounds i8*, i8** %1, i64 2
%44 = load i8*, i8** %43
%45 = call i64 @strcmp(i8* %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %60
47: ; preds = %39
%48 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%49 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%50 = call i64 @sendto(i32 %22, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 %48, i32 0, %struct.sockaddr* %49, i32 4)
br label %51
51: ; preds = %59, %47
%52 = call i64 @recvfrom(i32 %22, i8* %7, i32 999, i32 0, %struct.sockaddr* %49, i32* %3)
%53 = icmp eq i64 %52, 0
br i1 %53, label %59, label %54
54: ; preds = %51
%55 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %52
store i8 0, i8* %55
%56 = load i32, i32* %33
%57 = call i8* @inet_ntoa(i32 %56)
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i8* %57, i8* %7)
br label %59
59: ; preds = %54, %51
br label %51
60: ; preds = %39
%61 = load i8*, i8** %43
%62 = call i32 @strlen(i8* %61)
%63 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%64 = call i64 @sendto(i32 %22, i8* %61, i32 %62, i32 0, %struct.sockaddr* %63, i32 4)
%65 = call i32 @close(i32 %22)
br label %66
66: ; preds = %60, %36, %24, %10
%67 = phi i32 [ -1, %10 ], [ -1, %24 ], [ -1, %36 ], [ 0, %60 ]
ret i32 %67
}