#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 {
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ server;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ SOCK_DGRAM;
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(struct sockaddr_in *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
char *inet_ntoa(TYPE_1__);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int *);
int /*<<< orphan*/ sendto(int, char *, int /*<<< orphan*/, int /*<<< orphan*/,
                          struct sockaddr *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strlen(char *);
int main() {
  int sockfd;
  struct sockaddr_in server;
  struct sockaddr_in client;
  socklen_t sin_size;
  int num;
  char recvmsg[100];
  char sendmsg[100];
  char condition[] = "quit";
  if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
    perror("Creating socket failed.");
    exit(1);
  }
  bzero(&server, sizeof(server));
  server.sin_family = AF_INET;
  server.sin_port = htons(1234);
  server.sin_addr.s_addr = htonl(INADDR_ANY);
  if (bind(sockfd, (struct sockaddr *)&server, sizeof(struct sockaddr)) == -1) {
    perror("Bind error.");
    exit(1);
  }
  sin_size = sizeof(struct sockaddr_in);
  while (1) {
    num = recvfrom(sockfd, recvmsg, 100, 0, (struct sockaddr *)&client,
                   &sin_size);
    if (num < 0) {
      perror("recvfrom error\n");
      exit(1);
    }
    recvmsg[num] = '\0';
    printf("You got a message (%s) from %s\n", recvmsg,
           inet_ntoa(client.sin_addr));
    if (strcmp(recvmsg, condition) == 0)
      break;
    int i = 0;
    for (i = 0; i < num; i++) {
      sendmsg[i] = recvmsg[num - 1 - i];
    }
    sendmsg[num] = '\0';
    sendto(sockfd, sendmsg, strlen(sendmsg), 0, (struct sockaddr *)&client,
           sin_size);
  }
  close(sockfd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe08(%rip),%eax
mov    %eax,-0x115(%rbp)
mov    0xe00(%rip),%al
mov    %al,-0x111(%rbp)
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
mov    0x2dbe(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    1245 <main+0x65>
lea    0xdcf(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    -0x18(%rbp),%rdi
mov    $0xc,%esi
call   10e0 <bzero@plt>
mov    0x2d8e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0x4d2,%edi
call   1050 <htons@plt>
mov    %eax,-0x14(%rbp)
mov    0x2d6d(%rip),%rax
mov    (%rax),%edi
call   1070 <htonl@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   10c0 <bind@plt>
cmp    $0xffffffff,%eax
jne    12ad <main+0xcd>
lea    0xd7f(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
movl   $0xc,-0x2c(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xa0(%rbp),%rsi
lea    -0x28(%rbp),%r8
mov    $0x64,%edx
xor    %ecx,%ecx
lea    -0x2c(%rbp),%r9
call   10b0 <recvfrom@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
jge    12f5 <main+0x115>
lea    0xd43(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
movslq -0x30(%rbp),%rax
movb   $0x0,-0xa0(%rbp,%rax,1)
lea    -0xa0(%rbp),%rax
mov    %rax,-0x128(%rbp)
mov    -0x28(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    -0x128(%rbp),%rsi
mov    %rax,%rdx
lea    0xd11(%rip),%rdi
call   1060 <printf@plt>
lea    -0xa0(%rbp),%rdi
lea    -0x115(%rbp),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    134f <main+0x16f>
jmp    13fb <main+0x21b>
movl   $0x0,-0x11c(%rbp)
movl   $0x0,-0x11c(%rbp)
mov    -0x11c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    13a9 <main+0x1c9>
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
sub    -0x11c(%rbp),%eax
cltq
mov    -0xa0(%rbp,%rax,1),%cl
movslq -0x11c(%rbp),%rax
mov    %cl,-0x110(%rbp,%rax,1)
mov    -0x11c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x11c(%rbp)
jmp    1363 <main+0x183>
movslq -0x30(%rbp),%rax
movb   $0x0,-0x110(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
mov    %eax,-0x134(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x130(%rbp)
lea    -0x110(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x134(%rbp),%edi
mov    -0x130(%rbp),%rsi
mov    %eax,%edx
lea    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
xor    %ecx,%ecx
call   1080 <sendto@plt>
jmp    12b4 <main+0xd4>
mov    -0x8(%rbp),%edi
call   1090 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x74697571,0x8(%rsp)
74
mov    0x2de3(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2dc9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
cmp    $0xffffffff,%eax
je     1545 <main+0x365>
mov    %eax,%r12d
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0xc,%esi
call   10e0 <bzero@plt>
mov    0x0(%rbp),%eax
mov    %eax,0x18(%rsp)
mov    $0x4d2,%edi
call   1050 <htons@plt>
mov    %eax,0x14(%rsp)
mov    0x2d8e(%rip),%rax
mov    (%rax),%edi
call   1070 <htonl@plt>
mov    %eax,0x10(%rsp)
mov    %r12d,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   10c0 <bind@plt>
cmp    $0xffffffff,%eax
je     154e <main+0x36e>
movl   $0xc,0x4(%rsp)
lea    0x30(%rsp),%rsi
lea    0x20(%rsp),%r8
lea    0x4(%rsp),%r9
mov    %r12d,%edi
mov    $0x64,%edx
xor    %ecx,%ecx
call   10b0 <recvfrom@plt>
test   %eax,%eax
js     152f <main+0x34f>
lea    0x30(%rsp),%r15
lea    0xa0(%rsp),%r13
lea    0x20(%rsp),%rbp
jmp    130a <main+0x12a>
nopl   0x0(%rax,%rax,1)
movb   $0x0,0xa0(%rsp,%r14,1)
mov    %r13,%rdi
call   1040 <strlen@plt>
mov    0x4(%rsp),%r9d
mov    %r12d,%edi
mov    %r13,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
mov    %rbp,%r8
call   1080 <sendto@plt>
mov    %r12d,%edi
mov    %r15,%rsi
mov    $0x64,%edx
xor    %ecx,%ecx
mov    %rbp,%r8
lea    0x4(%rsp),%r9
call   10b0 <recvfrom@plt>
test   %eax,%eax
js     152f <main+0x34f>
mov    %eax,%r14d
movb   $0x0,0x30(%rsp,%r14,1)
mov    0x20(%rsp),%edi
call   1030 <inet_ntoa@plt>
lea    0xd16(%rip),%rdi
mov    %r15,%rsi
mov    %rax,%rdx
call   1060 <printf@plt>
mov    %r15,%rdi
lea    0x8(%rsp),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1513 <main+0x333>
test   %r14,%r14
je     12c0 <main+0xe0>
cmp    $0x8,%r14d
jae    13d0 <main+0x1f0>
xor    %eax,%eax
mov    %rax,%rcx
test   $0x1,%r14b
je     137a <main+0x19a>
mov    %eax,%ecx
not    %ecx
add    %r14d,%ecx
movslq %ecx,%rcx
mov    0x30(%rsp,%rcx,1),%cl
mov    %cl,0xa0(%rsp,%rax,1)
mov    %rax,%rcx
or     $0x1,%rcx
not    %rax
add    %r14,%rax
je     12c0 <main+0xe0>
mov    %r14,%rax
sub    %rcx,%rax
mov    %ecx,%edx
not    %edx
add    %r14d,%edx
lea    0xa1(%rsp),%rsi
add    %rsi,%rcx
xor    %esi,%esi
movslq %edx,%rdx
movzbl 0x30(%rsp,%rdx,1),%ebx
mov    %bl,-0x1(%rcx,%rsi,1)
lea    -0x1(%rdx),%edi
movslq %edi,%rdi
movzbl 0x30(%rsp,%rdi,1),%ebx
mov    %bl,(%rcx,%rsi,1)
add    $0x2,%rsi
add    $0xfffffffe,%edx
cmp    %rsi,%rax
jne    13a0 <main+0x1c0>
jmp    12c0 <main+0xe0>
nopl   0x0(%rax,%rax,1)
lea    -0x1(%r14),%rax
lea    -0x1(%r14),%ecx
mov    %ecx,%edx
sub    %eax,%edx
cmp    %ecx,%edx
jg     1353 <main+0x173>
shr    $0x20,%rax
mov    $0x0,%eax
jne    1355 <main+0x175>
cmp    $0x20,%r14d
jae    1400 <main+0x220>
xor    %eax,%eax
jmp    14b0 <main+0x2d0>
mov    %r14d,%eax
and    $0xffffffe0,%eax
xor    %edx,%edx
pxor   %xmm3,%xmm3
nopl   0x0(%rax)
movslq %ecx,%rcx
movdqu 0x11(%rsp,%rcx,1),%xmm0
movdqu 0x21(%rsp,%rcx,1),%xmm1
movdqa %xmm1,%xmm2
punpcklbw %xmm3,%xmm2
pshufd $0x4e,%xmm2,%xmm2
pshuflw $0x1b,%xmm2,%xmm2
pshufhw $0x1b,%xmm2,%xmm2
punpckhbw %xmm3,%xmm1
pshufd $0x4e,%xmm1,%xmm1
pshuflw $0x1b,%xmm1,%xmm1
pshufhw $0x1b,%xmm1,%xmm1
packuswb %xmm2,%xmm1
movdqa %xmm0,%xmm2
punpcklbw %xmm3,%xmm2
pshufd $0x4e,%xmm2,%xmm2
pshuflw $0x1b,%xmm2,%xmm2
pshufhw $0x1b,%xmm2,%xmm2
punpckhbw %xmm3,%xmm0
pshufd $0x4e,%xmm0,%xmm0
pshuflw $0x1b,%xmm0,%xmm0
pshufhw $0x1b,%xmm0,%xmm0
packuswb %xmm2,%xmm0
movdqa %xmm1,0xa0(%rsp,%rdx,1)
movdqa %xmm0,0xb0(%rsp,%rdx,1)
add    $0x20,%rdx
add    $0xffffffe0,%ecx
cmp    %rdx,%rax
jne    1410 <main+0x230>
cmp    %r14,%rax
je     12c0 <main+0xe0>
test   $0x18,%r14b
je     1355 <main+0x175>
mov    %rax,%rcx
mov    %r14d,%eax
and    $0xfffffff8,%eax
mov    %ecx,%edx
not    %edx
add    %r14d,%edx
pxor   %xmm1,%xmm1
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movslq %edx,%rdx
movq   0x29(%rsp,%rdx,1),%xmm0
punpcklbw %xmm1,%xmm0
pshufd $0x4e,%xmm0,%xmm0
pshuflw $0x1b,%xmm0,%xmm0
pshufhw $0x1b,%xmm0,%xmm0
packuswb %xmm0,%xmm0
movq   %xmm0,0xa0(%rsp,%rcx,1)
add    $0x8,%rcx
add    $0xfffffff8,%edx
cmp    %rcx,%rax
jne    14d0 <main+0x2f0>
cmp    %r14,%rax
je     12c0 <main+0xe0>
jmp    1355 <main+0x175>
mov    %r12d,%edi
call   1090 <close@plt>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xaf3(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0xab9(%rip),%rdi
jmp    1536 <main+0x356>
lea    0xac8(%rip),%rdi
jmp    1536 <main+0x356>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@__const.main.condition = [5 x i8] c"quit\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [24 x i8] c"Creating socket failed.\00"
@INADDR_ANY = global i32 0
@.str.1 = [12 x i8] c"Bind error.\00"
@.str.2 = [16 x i8] c"recvfrom error\0A\00"
@.str.3 = [32 x i8] c"You got a message (%s) from %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca i32
%7 = alloca [100 x i8]
%8 = alloca [100 x i8]
%9 = alloca [5 x i8]
%10 = alloca i32
store i32 0, i32* %1
%11 = bitcast [5 x i8]* %9 to i8*
%12 = load i32, i32* @AF_INET
%13 = load i32, i32* @SOCK_DGRAM
%14 = call i32 @socket(i32 %12, i32 %13, i32 0)
store i32 %14, i32* %2
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %19
16: ; preds = %0
%17 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %0
%20 = call i32 @bzero(%struct.sockaddr_in* %3, i32 12)
%21 = load i32, i32* @AF_INET
%22 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 2
store i32 %21, i32* %22
%23 = call i32 @htons(i32 1234)
%24 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 1
store i32 %23, i32* %24
%25 = load i32, i32* @INADDR_ANY
%26 = call i32 @htonl(i32 %25)
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%28 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %27, i32 0, i32 0
store i32 %26, i32* %28
%29 = load i32, i32* %2
%30 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%31 = call i32 @bind(i32 %29, %struct.sockaddr* %30, i32 4)
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %36
33: ; preds = %19
%34 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %19
store i32 12, i32* %5
br label %37
37: ; preds = %36, %81
%38 = load i32, i32* %2
%39 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%40 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%41 = call i32 @recvfrom(i32 %38, i8* %39, i32 100, i32 0, %struct.sockaddr* %40, i32* %5)
store i32 %41, i32* %6
%42 = load i32, i32* %6
%43 = icmp slt i32 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %37
%45 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %37
%48 = load i32, i32* %6
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %49
store i8 0, i8* %50
%51 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%52 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%53 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %52, i32 0, i32 0
%54 = load i32, i32* %53
%55 = call i8* @inet_ntoa(i32 %54)
%56 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i8* %51, i8* %55)
%57 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%58 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
%59 = call i64 @strcmp(i8* %57, i8* %58)
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %62
61: ; preds = %47
br label %92
62: ; preds = %47
store i32 0, i32* %10
store i32 0, i32* %10
br label %63
63: ; preds = %78, %62
%64 = load i32, i32* %10
%65 = load i32, i32* %6
%66 = icmp slt i32 %64, %65
br i1 %66, label %67, label %81
67: ; preds = %63
%68 = load i32, i32* %6
%69 = sub nsw i32 %68, 1
%70 = load i32, i32* %10
%71 = sub nsw i32 %69, %70
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %72
%74 = load i8, i8* %73
%75 = load i32, i32* %10
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 %76
store i8 %74, i8* %77
br label %78
78: ; preds = %67
%79 = load i32, i32* %10
%80 = add nsw i32 %79, 1
store i32 %80, i32* %10
br label %63
81: ; preds = %63
%82 = load i32, i32* %6
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 %83
store i8 0, i8* %84
%85 = load i32, i32* %2
%86 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%87 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%88 = call i32 @strlen(i8* %87)
%89 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%90 = load i32, i32* %5
%91 = call i32 @sendto(i32 %85, i8* %86, i32 %88, i32 0, %struct.sockaddr* %89, i32 %90)
br label %37
92: ; preds = %61
%93 = load i32, i32* %2
%94 = call i32 @close(i32 %93)
%95 = load i32, i32* %1
ret i32 %95
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@__const.main.condition = [5 x i8] c"quit\00"
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [24 x i8] c"Creating socket failed.\00"
@INADDR_ANY = global i32 0
@.str.1 = [12 x i8] c"Bind error.\00"
@.str.2 = [16 x i8] c"recvfrom error\0A\00"
@.str.3 = [32 x i8] c"You got a message (%s) from %s\0A\00"
define i32 @main() {
%1 = alloca %struct.sockaddr_in
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
%6 = alloca [5 x i8]
%7 = bitcast %struct.sockaddr_in* %1 to i8*
%8 = bitcast %struct.sockaddr_in* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%13 = load i32, i32* @AF_INET
%14 = load i32, i32* @SOCK_DGRAM
%15 = tail call i32 @socket(i32 %13, i32 %14, i32 0)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %20
17: ; preds = %0
%18 = tail call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32 @exit(i32 1)
unreachable
20: ; preds = %0
%21 = call i32 @bzero(%struct.sockaddr_in* %1, i32 12)
%22 = load i32, i32* @AF_INET
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 2
store i32 %22, i32* %23
%24 = tail call i32 @htons(i32 1234)
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 1
store i32 %24, i32* %25
%26 = load i32, i32* @INADDR_ANY
%27 = tail call i32 @htonl(i32 %26)
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 0, i32 0
store i32 %27, i32* %28
%29 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%30 = call i32 @bind(i32 %15, %struct.sockaddr* %29, i32 4)
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %35
32: ; preds = %20
%33 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%34 = call i32 @exit(i32 1)
unreachable
35: ; preds = %20
store i32 12, i32* %3
%36 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%37 = call i32 @recvfrom(i32 %15, i8* %10, i32 100, i32 0, %struct.sockaddr* %36, i32* %3)
%38 = icmp slt i32 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %35
%40 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0, i32 0
br label %44
41: ; preds = %153, %35
%42 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%43 = call i32 @exit(i32 1)
unreachable
44: ; preds = %39, %153
%45 = phi i32 [ %37, %39 ], [ %158, %153 ]
%46 = zext i32 %45 to i64
%47 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %46
store i8 0, i8* %47
%48 = load i32, i32* %40
%49 = call i8* @inet_ntoa(i32 %48)
%50 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i8* %10, i8* %49)
%51 = call i64 @strcmp(i8* %10, i8* %12)
%52 = icmp eq i64 %51, 0
br i1 %52, label %160, label %53
53: ; preds = %44
%54 = icmp eq i32 %45, 0
br i1 %54, label %153, label %55
55: ; preds = %53
%56 = icmp ult i32 %45, 8
br i1 %56, label %116, label %57
57: ; preds = %55
%58 = add nsw i64 %46, -1
%59 = add i32 %45, -1
%60 = trunc i64 %58 to i32
%61 = sub i32 %59, %60
%62 = icmp sgt i32 %61, %59
%63 = icmp ugt i64 %58, 4294967295
%64 = or i1 %62, %63
br i1 %64, label %116, label %65
65: ; preds = %57
%66 = icmp ult i32 %45, 32
br i1 %66, label %95, label %67
67: ; preds = %65
%68 = and i64 %46, 4294967264
br label %69
69: ; preds = %69, %67
%70 = phi i64 [ 0, %67 ], [ %88, %69 ]
%71 = trunc i64 %70 to i32
%72 = xor i32 %71, -1
%73 = add i32 %45, %72
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %74
%76 = getelementptr inbounds i8, i8* %75, i64 -15
%77 = bitcast i8* %76 to <16 x i8>*
%78 = load <16 x i8>, <16 x i8>* %77
%79 = shufflevector <16 x i8> %78, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%80 = getelementptr inbounds i8, i8* %75, i64 -31
%81 = bitcast i8* %80 to <16 x i8>*
%82 = load <16 x i8>, <16 x i8>* %81
%83 = shufflevector <16 x i8> %82, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%84 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %70
%85 = bitcast i8* %84 to <16 x i8>*
store <16 x i8> %79, <16 x i8>* %85
%86 = getelementptr inbounds i8, i8* %84, i64 16
%87 = bitcast i8* %86 to <16 x i8>*
store <16 x i8> %83, <16 x i8>* %87
%88 = add nuw i64 %70, 32
%89 = icmp eq i64 %88, %68
br i1 %89, label %90, label %69
90: ; preds = %69
%91 = icmp eq i64 %68, %46
br i1 %91, label %153, label %92
92: ; preds = %90
%93 = and i64 %46, 24
%94 = icmp eq i64 %93, 0
br i1 %94, label %116, label %95
95: ; preds = %65, %92
%96 = phi i64 [ %68, %92 ], [ 0, %65 ]
%97 = zext i32 %45 to i64
%98 = and i64 %97, 4294967288
br label %99
99: ; preds = %99, %95
%100 = phi i64 [ %96, %95 ], [ %112, %99 ]
%101 = trunc i64 %100 to i32
%102 = xor i32 %101, -1
%103 = add i32 %45, %102
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %104
%106 = getelementptr inbounds i8, i8* %105, i64 -7
%107 = bitcast i8* %106 to <8 x i8>*
%108 = load <8 x i8>, <8 x i8>* %107
%109 = shufflevector <8 x i8> %108, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%110 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %100
%111 = bitcast i8* %110 to <8 x i8>*
store <8 x i8> %109, <8 x i8>* %111
%112 = add nuw i64 %100, 8
%113 = icmp eq i64 %112, %98
br i1 %113, label %114, label %99
114: ; preds = %99
%115 = icmp eq i64 %98, %97
br i1 %115, label %153, label %116
116: ; preds = %57, %55, %92, %114
%117 = phi i64 [ 0, %55 ], [ 0, %57 ], [ %68, %92 ], [ %98, %114 ]
%118 = xor i64 %117, -1
%119 = and i64 %46, 1
%120 = icmp eq i64 %119, 0
br i1 %120, label %130, label %121
121: ; preds = %116
%122 = trunc i64 %117 to i32
%123 = xor i32 %122, -1
%124 = add i32 %45, %123
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %125
%127 = load i8, i8* %126
%128 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %117
store i8 %127, i8* %128
%129 = or i64 %117, 1
br label %130
130: ; preds = %121, %116
%131 = phi i64 [ %117, %116 ], [ %129, %121 ]
%132 = sub nsw i64 0, %46
%133 = icmp eq i64 %118, %132
br i1 %133, label %153, label %134
134: ; preds = %130, %134
%135 = phi i64 [ %151, %134 ], [ %131, %130 ]
%136 = trunc i64 %135 to i32
%137 = xor i32 %136, -1
%138 = add i32 %45, %137
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %139
%141 = load i8, i8* %140
%142 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %135
store i8 %141, i8* %142
%143 = add nuw nsw i64 %135, 1
%144 = trunc i64 %143 to i32
%145 = xor i32 %144, -1
%146 = add i32 %45, %145
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %147
%149 = load i8, i8* %148
%150 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %143
store i8 %149, i8* %150
%151 = add nuw nsw i64 %135, 2
%152 = icmp eq i64 %151, %46
br i1 %152, label %153, label %134
153: ; preds = %130, %134, %90, %114, %53
%154 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %46
store i8 0, i8* %154
%155 = call i32 @strlen(i8* %11)
%156 = load i32, i32* %3
%157 = call i32 @sendto(i32 %15, i8* %11, i32 %155, i32 0, %struct.sockaddr* %36, i32 %156)
%158 = call i32 @recvfrom(i32 %15, i8* %10, i32 100, i32 0, %struct.sockaddr* %36, i32* %3)
%159 = icmp slt i32 %158, 0
br i1 %159, label %41, label %44
160: ; preds = %44
%161 = call i32 @close(i32 %15)
ret i32 0
}