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

/* Variables and functions */
void *AF_INET;
void *INADDR_ANY;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_BROADCAST;
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
void *htons(int);
int /*<<< orphan*/ memset(int /*<<< orphan*/, char, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *,
             int /*<<< orphan*/ *);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
bool receiver_run() {
  int sockfd;
  char buf[10];
  struct sockaddr_in sendaddr;
  struct sockaddr_in recvaddr;
  int numbytes;
  int addr_len;
  int broadcast = 1;
  if ((sockfd = socket(PF_INET, SOCK_DGRAM, 0)) == -1) {
    perror("socket");
    exit(1);
  }
  if ((setsockopt(sockfd, SOL_SOCKET, SO_BROADCAST, &broadcast,
                  sizeof broadcast)) == -1) {
    perror("setsockopt - SO_SOCKET ");
    exit(1);
  }
  printf("Socket created\n");
  sendaddr.sin_family = AF_INET;
  sendaddr.sin_port = htons(8000);
  sendaddr.sin_addr.s_addr = INADDR_ANY;
  memset(sendaddr.sin_zero, '\0', sizeof sendaddr.sin_zero);
  recvaddr.sin_family = AF_INET;
  recvaddr.sin_port = htons(8000);
  recvaddr.sin_addr.s_addr = INADDR_ANY;
  memset(recvaddr.sin_zero, '\0', sizeof recvaddr.sin_zero);
  if (bind(sockfd, (struct sockaddr *)&recvaddr, sizeof recvaddr) == -1) {
    perror("bind");
    exit(1);
  }
  while (true) {
    addr_len = sizeof sendaddr;
    if ((numbytes =
             recvfrom(sockfd, buf, sizeof buf, 0, (struct sockaddr *)&sendaddr,
                      (socklen_t *)&addr_len)) == -1) {
      perror("recvfrom");
      buf[0] = '\1';
      break;
    }
    printf("%s", buf);
    if (*buf == 0)
      break;
    else if (*buf == 'F') {
      system("./st key push s1");
    } else if (*buf == 'S') {
      system("./st key push s2; ./st key release s2; ./st key release s1");
    } else if (*buf == 'R') {
      system("./st key release s2; ./st key release s1");
    } else if (*buf == 'X') {
      break;
    }
  }
  close(sockfd);
  return *buf;
}


x86 assembly (clang, -O0):
<receiver_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x1,-0x5c(%rbp)
mov    0x2df2(%rip),%rax
mov    (%rax),%edi
mov    0x2e01(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10d0 <socket@plt>
mov    %eax,-0x4(%rbp)
cmp    $0xffffffff,%eax
jne    11fa <receiver_run+0x4a>
lea    0xe15(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x4(%rbp),%edi
mov    0x2de4(%rip),%rax
mov    (%rax),%esi
mov    0x2dbb(%rip),%rax
mov    (%rax),%edx
lea    -0x5c(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    123d <receiver_run+0x8d>
lea    0xdd9(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2d8e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1f40,%edi
call   1050 <htons@plt>
mov    %rax,-0x20(%rbp)
mov    0x2d6a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%edi
xor    %esi,%esi
mov    $0x4,%edx
call   1070 <memset@plt>
mov    0x2d55(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    $0x1f40,%edi
call   1050 <htons@plt>
mov    %rax,-0x40(%rbp)
mov    0x2d31(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
mov    -0x50(%rbp),%edi
xor    %esi,%esi
mov    $0x4,%edx
call   1070 <memset@plt>
mov    -0x4(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    $0x20,%edx
call   10a0 <bind@plt>
cmp    $0xffffffff,%eax
jne    12ed <receiver_run+0x13d>
lea    0xd51(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
jmp    12f2 <receiver_run+0x142>
movl   $0x20,-0x58(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xe(%rbp),%rsi
lea    -0x30(%rbp),%r8
mov    $0xa,%edx
xor    %ecx,%ecx
lea    -0x58(%rbp),%r9
call   1090 <recvfrom@plt>
mov    %eax,-0x54(%rbp)
cmp    $0xffffffff,%eax
jne    1335 <receiver_run+0x185>
lea    0xd0d(%rip),%rdi
call   10b0 <perror@plt>
movb   $0x1,-0xe(%rbp)
jmp    13de <receiver_run+0x22e>
lea    -0xe(%rbp),%rsi
lea    0xcfd(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movsbl -0xe(%rbp),%eax
cmp    $0x0,%eax
jne    1359 <receiver_run+0x1a9>
jmp    13de <receiver_run+0x22e>
movsbl -0xe(%rbp),%eax
cmp    $0x46,%eax
jne    1377 <receiver_run+0x1c7>
lea    0xcd3(%rip),%rdi
call   1040 <system@plt>
jmp    13d4 <receiver_run+0x224>
movsbl -0xe(%rbp),%eax
cmp    $0x53,%eax
jne    1395 <receiver_run+0x1e5>
lea    0xcc6(%rip),%rdi
call   1040 <system@plt>
jmp    13cf <receiver_run+0x21f>
movsbl -0xe(%rbp),%eax
cmp    $0x52,%eax
jne    13b3 <receiver_run+0x203>
lea    0xcba(%rip),%rdi
call   1040 <system@plt>
jmp    13ca <receiver_run+0x21a>
movsbl -0xe(%rbp),%eax
cmp    $0x58,%eax
jne    13c5 <receiver_run+0x215>
jmp    13de <receiver_run+0x22e>
jmp    13ca <receiver_run+0x21a>
jmp    13cf <receiver_run+0x21f>
jmp    13d4 <receiver_run+0x224>
jmp    13d9 <receiver_run+0x229>
jmp    12f2 <receiver_run+0x142>
mov    -0x4(%rbp),%edi
call   1080 <close@plt>
movsbl -0xe(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receiver_run>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
movl   $0x1,0x8(%rsp)
mov    0x2ddb(%rip),%rax
mov    (%rax),%edi
mov    0x2dea(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10e0 <socket@plt>
cmp    $0xffffffff,%eax
je     13ab <receiver_run+0x1eb>
mov    %eax,%r14d
mov    0x2de6(%rip),%rax
mov    (%rax),%esi
mov    0x2dbd(%rip),%rax
mov    (%rax),%edx
lea    0x8(%rsp),%rcx
mov    %r14d,%edi
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
cmp    $0xffffffff,%eax
je     13b4 <receiver_run+0x1f4>
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
mov    0x2da4(%rip),%rbx
mov    (%rbx),%rax
mov    %rax,0x30(%rsp)
mov    $0x1f40,%edi
call   1060 <htons@plt>
mov    %rax,0x28(%rsp)
mov    0x2d7e(%rip),%rbp
mov    0x0(%rbp),%rax
mov    %rax,0x20(%rsp)
xor    %esi,%esi
mov    $0x4,%edx
call   1080 <memset@plt>
mov    (%rbx),%rax
mov    %rax,0x50(%rsp)
mov    $0x1f40,%edi
call   1060 <htons@plt>
mov    %rax,0x48(%rsp)
mov    0x0(%rbp),%rax
mov    %rax,0x40(%rsp)
xor    %esi,%esi
mov    $0x4,%edx
call   1080 <memset@plt>
lea    0x38(%rsp),%rsi
mov    %r14d,%edi
mov    $0x20,%edx
call   10b0 <bind@plt>
cmp    $0xffffffff,%eax
je     13bd <receiver_run+0x1fd>
movl   $0x20,0x4(%rsp)
lea    0xe(%rsp),%rsi
lea    0x18(%rsp),%r8
lea    0x4(%rsp),%r9
mov    %r14d,%edi
mov    $0xa,%edx
xor    %ecx,%ecx
call   10a0 <recvfrom@plt>
cmp    $0xffffffff,%eax
je     137e <receiver_run+0x1be>
lea    0xd8d(%rip),%r15
lea    0xe(%rsp),%rbp
lea    0x18(%rsp),%r12
lea    0x4(%rsp),%rbx
lea    0xcfe(%rip),%r13
jmp    1341 <receiver_run+0x181>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xd88(%rip),%rdi
call   1050 <system@plt>
movl   $0x20,0x4(%rsp)
mov    %r14d,%edi
mov    %rbp,%rsi
mov    $0xa,%edx
xor    %ecx,%ecx
mov    %r12,%r8
mov    %rbx,%r9
call   10a0 <recvfrom@plt>
cmp    $0xffffffff,%eax
je     137e <receiver_run+0x1be>
mov    %r15,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl 0xe(%rsp),%eax
lea    -0x46(%rax),%ecx
cmp    $0x12,%cl
ja     1378 <receiver_run+0x1b8>
movzbl %cl,%eax
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
lea    0xd0f(%rip),%rdi
jmp    *%rax
lea    0xd17(%rip),%rdi
jmp    1317 <receiver_run+0x157>
test   %al,%al
jne    131c <receiver_run+0x15c>
jmp    138f <receiver_run+0x1cf>
lea    0xceb(%rip),%rdi
call   10c0 <perror@plt>
movb   $0x1,0xe(%rsp)
mov    %r14d,%edi
call   1090 <close@plt>
movsbl 0xe(%rsp),%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc9a(%rip),%rdi
jmp    13c4 <receiver_run+0x204>
lea    0xc98(%rip),%rdi
jmp    13c4 <receiver_run+0x204>
lea    0xca7(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i8*, i8* }
%struct.TYPE_2__ = type { i8* }
%struct.sockaddr = type { i32 }
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [7 x i8] c"socket\00"
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
@.str.1 = [24 x i8] c"setsockopt - SO_SOCKET \00"
@.str.2 = [16 x i8] c"Socket created\0A\00"
@AF_INET = global i8* null
@INADDR_ANY = global i8* null
@.str.3 = [5 x i8] c"bind\00"
@.str.4 = [9 x i8] c"recvfrom\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [17 x i8] c"./st key push s1\00"
@.str.7 = [59 x i8] c"./st key push s2; ./st key release s2; ./st key release s1\00"
@.str.8 = [41 x i8] c"./st key release s2; ./st key release s1\00"
define i32 @receiver_run() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 1, i32* %7
%8 = load i32, i32* @PF_INET
%9 = load i32, i32* @SOCK_DGRAM
%10 = call i32 @socket(i32 %8, i32 %9, i32 0)
store i32 %10, i32* %1
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %0
%13 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %0
%16 = load i32, i32* %1
%17 = load i32, i32* @SOL_SOCKET
%18 = load i32, i32* @SO_BROADCAST
%19 = call i32 @setsockopt(i32 %16, i32 %17, i32 %18, i32* %7, i32 4)
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %24
21: ; preds = %15
%22 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %15
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%26 = load i8*, i8** @AF_INET
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 3
store i8* %26, i8** %27
%28 = call i8* @htons(i32 8000)
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 2
store i8* %28, i8** %29
%30 = load i8*, i8** @INADDR_ANY
%31 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 1
%32 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %31, i32 0, i32 0
store i8* %30, i8** %32
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%34 = load i32, i32* %33
%35 = call i32 @memset(i32 %34, i8 signext 0, i32 4)
%36 = load i8*, i8** @AF_INET
%37 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 3
store i8* %36, i8** %37
%38 = call i8* @htons(i32 8000)
%39 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 2
store i8* %38, i8** %39
%40 = load i8*, i8** @INADDR_ANY
%41 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 1
%42 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %41, i32 0, i32 0
store i8* %40, i8** %42
%43 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%44 = load i32, i32* %43
%45 = call i32 @memset(i32 %44, i8 signext 0, i32 4)
%46 = load i32, i32* %1
%47 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%48 = call i32 @bind(i32 %46, %struct.sockaddr* %47, i32 32)
%49 = icmp eq i32 %48, -1
br i1 %49, label %50, label %53
50: ; preds = %24
%51 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%52 = call i32 @exit(i32 1)
unreachable
53: ; preds = %24
br label %54
54: ; preds = %53, %102
store i32 32, i32* %6
%55 = load i32, i32* %1
%56 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%57 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%58 = call i32 @recvfrom(i32 %55, i8* %56, i32 10, i32 0, %struct.sockaddr* %57, i32* %6)
store i32 %58, i32* %5
%59 = icmp eq i32 %58, -1
br i1 %59, label %60, label %63
60: ; preds = %54
%61 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%62 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
store i8 1, i8* %62
br label %103
63: ; preds = %54
%64 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %64)
%66 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %71
70: ; preds = %63
br label %103
71: ; preds = %63
%72 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp eq i32 %74, 70
br i1 %75, label %76, label %78
76: ; preds = %71
%77 = call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
br label %101
78: ; preds = %71
%79 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp eq i32 %81, 83
br i1 %82, label %83, label %85
83: ; preds = %78
%84 = call i32 @system(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.7, i64 0, i64 0))
br label %100
85: ; preds = %78
%86 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%87 = load i8, i8* %86
%88 = sext i8 %87 to i32
%89 = icmp eq i32 %88, 82
br i1 %89, label %90, label %92
90: ; preds = %85
%91 = call i32 @system(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0))
br label %99
92: ; preds = %85
%93 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp eq i32 %95, 88
br i1 %96, label %97, label %98
97: ; preds = %92
br label %103
98: ; preds = %92
br label %99
99: ; preds = %98, %90
br label %100
100: ; preds = %99, %83
br label %101
101: ; preds = %100, %76
br label %102
102: ; preds = %101
br label %54
103: ; preds = %97, %70, %60
%104 = load i32, i32* %1
%105 = call i32 @close(i32 %104)
%106 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%107 = load i8, i8* %106
%108 = sext i8 %107 to i32
ret i32 %108
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i8*, i8* }
%struct.TYPE_2__ = type { i8* }
%struct.sockaddr = type { i32 }
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [7 x i8] c"socket\00"
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
@.str.1 = [24 x i8] c"setsockopt - SO_SOCKET \00"
@AF_INET = global i8* null
@INADDR_ANY = global i8* null
@.str.3 = [5 x i8] c"bind\00"
@.str.4 = [9 x i8] c"recvfrom\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [17 x i8] c"./st key push s1\00"
@.str.7 = [59 x i8] c"./st key push s2; ./st key release s2; ./st key release s1\00"
@.str.8 = [41 x i8] c"./st key release s2; ./st key release s1\00"
@str = [15 x i8] c"Socket created\00"
define i32 @receiver_run() {
%1 = alloca [10 x i8]
%2 = alloca %struct.sockaddr_in
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = alloca i32
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%7 = bitcast %struct.sockaddr_in* %2 to i8*
%8 = bitcast %struct.sockaddr_in* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
store i32 1, i32* %5
%11 = load i32, i32* @PF_INET
%12 = load i32, i32* @SOCK_DGRAM
%13 = tail call i32 @socket(i32 %11, i32 %12, i32 0)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %18
15: ; preds = %0
%16 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%17 = tail call i32 @exit(i32 1)
unreachable
18: ; preds = %0
%19 = load i32, i32* @SOL_SOCKET
%20 = load i32, i32* @SO_BROADCAST
%21 = call i32 @setsockopt(i32 %13, i32 %19, i32 %20, i32* %5, i32 4)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %26
23: ; preds = %18
%24 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%25 = call i32 @exit(i32 1)
unreachable
26: ; preds = %18
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%28 = load i8*, i8** @AF_INET
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 3
store i8* %28, i8** %29
%30 = call i8* @htons(i32 8000)
%31 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 2
store i8* %30, i8** %31
%32 = load i8*, i8** @INADDR_ANY
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 1, i32 0
store i8* %32, i8** %33
%34 = call i32 @memset(i32 undef, i8 signext 0, i32 4)
%35 = load i8*, i8** @AF_INET
%36 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 3
store i8* %35, i8** %36
%37 = call i8* @htons(i32 8000)
%38 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i8* %37, i8** %38
%39 = load i8*, i8** @INADDR_ANY
%40 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
store i8* %39, i8** %40
%41 = call i32 @memset(i32 undef, i8 signext 0, i32 4)
%42 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%43 = call i32 @bind(i32 %13, %struct.sockaddr* %42, i32 32)
%44 = icmp eq i32 %43, -1
br i1 %44, label %49, label %45
45: ; preds = %26
%46 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
store i32 32, i32* %4
%47 = call i32 @recvfrom(i32 %13, i8* %6, i32 10, i32 0, %struct.sockaddr* %46, i32* %4)
%48 = icmp eq i32 %47, -1
br i1 %48, label %52, label %54
49: ; preds = %26
%50 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%51 = call i32 @exit(i32 1)
unreachable
52: ; preds = %62, %45
%53 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
store i8 1, i8* %6
br label %65
54: ; preds = %45, %62
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%56 = load i8, i8* %6
switch i8 %56, label %62 [
i8 0, label %65
i8 70, label %59
i8 83, label %57
i8 82, label %58
i8 88, label %65
]
57: ; preds = %54
br label %59
58: ; preds = %54
br label %59
59: ; preds = %54, %57, %58
%60 = phi i8* [ getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), %58 ], [ getelementptr inbounds ([59 x i8], [59 x i8]* @.str.7, i64 0, i64 0), %57 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), %54 ]
%61 = call i32 @system(i8* %60)
br label %62
62: ; preds = %59, %54
store i32 32, i32* %4
%63 = call i32 @recvfrom(i32 %13, i8* %6, i32 10, i32 0, %struct.sockaddr* %46, i32* %4)
%64 = icmp eq i32 %63, -1
br i1 %64, label %52, label %54
65: ; preds = %54, %54, %52
%66 = call i32 @close(i32 %13)
%67 = load i8, i8* %6
%68 = sext i8 %67 to i32
ret i32 %68
}