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

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_KEEPALIVE;
int /*<<< orphan*/ SO_REUSEADDR;
int /*<<< orphan*/ close(int);
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ inet_addr(char *);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, char, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int recv(int, char *, int, int /*<<< orphan*/);
int send(int, char *, int, int /*<<< orphan*/);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int main() {
  int Sock_fd;
  struct sockaddr_in Srv_addr;
  if ((Sock_fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
    perror("socket");
    exit(1);
  }
  int True = 1;
  if (setsockopt(Sock_fd, SOL_SOCKET, SO_KEEPALIVE, &True, sizeof(int)) == -1) {
    perror("setsockopt");
    exit(2);
  }
  if (setsockopt(Sock_fd, SOL_SOCKET, SO_REUSEADDR, &True, sizeof(int)) == -1) {
    perror("setsockopt");
    exit(3);
  }
  Srv_addr.sin_family = AF_INET;
  Srv_addr.sin_port = htons(1337);
  Srv_addr.sin_addr.s_addr = inet_addr("127.0.0.1");
  memset(&(Srv_addr.sin_zero), '\0', 8);
  if (connect(Sock_fd, (struct sockaddr *)&Srv_addr, sizeof(struct sockaddr)) ==
      -1) {
    perror("connect");
    exit(4);
  }
  char Buff[8192];
  if (recv(Sock_fd, Buff, 8192, 0) == -1) {
    perror("recv");
    exit(5);
  }
  printf("%s\n", Buff);
  while (1) {
    printf("*******************************************************************"
           "*\n");
    printf("\nGépelje be a kívánt parancsot:\n");
    fgets(Buff, 512, stdin);
    Buff[strlen(Buff) - 1] = '\0';
    if (strcmp(Buff, "(vége)") == 0) {
      if (send(Sock_fd, Buff, 8192, 0) == -1) {
        perror("send");
        exit(6);
      }
      break;
    }
    if (send(Sock_fd, Buff, 8192, 0) == -1) {
      perror("send");
      exit(7);
    }
    if (recv(Sock_fd, Buff, 8192, 0) == -1) {
      perror("recv");
      exit(8);
    }
    printf("%s\n", Buff);
  }
  close(Sock_fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2020,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
mov    0x2db6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    123d <main+0x4d>
lea    0xdd2(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2d9a(%rip),%rax
mov    (%rax),%esi
mov    0x2d59(%rip),%rax
mov    (%rax),%edx
lea    -0x1c(%rbp),%rcx
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    1287 <main+0x97>
lea    0xd8f(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x2,%edi
call   10f0 <exit@plt>
mov    -0x8(%rbp),%edi
mov    0x2d57(%rip),%rax
mov    (%rax),%esi
mov    0x2d26(%rip),%rax
mov    (%rax),%edx
lea    -0x1c(%rbp),%rcx
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    12ca <main+0xda>
lea    0xd4c(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x3,%edi
call   10f0 <exit@plt>
mov    0x2d0f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x539,%edi
call   1060 <htons@plt>
mov    %eax,-0x10(%rbp)
lea    0xd28(%rip),%rdi
call   10c0 <inet_addr@plt>
mov    %eax,-0x14(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1090 <memset@plt>
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1100 <connect@plt>
cmp    $0xffffffff,%eax
jne    1332 <main+0x142>
lea    0xcf9(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x4,%edi
call   10f0 <exit@plt>
mov    -0x8(%rbp),%edi
lea    -0x2020(%rbp),%rsi
mov    $0x2000,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
jne    1367 <main+0x177>
lea    0xccc(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x5,%edi
call   10f0 <exit@plt>
lea    -0x2020(%rbp),%rsi
lea    0xcb4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xcaa(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xce2(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x2020(%rbp),%rdi
mov    0x2c32(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   10b0 <fgets@plt>
lea    -0x2020(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x2020(%rbp,%rax,1)
lea    -0x2020(%rbp),%rdi
lea    0xcbe(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    1422 <main+0x232>
mov    -0x8(%rbp),%edi
lea    -0x2020(%rbp),%rsi
mov    $0x2000,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
cmp    $0xffffffff,%eax
jne    141d <main+0x22d>
lea    0xc91(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x6,%edi
call   10f0 <exit@plt>
jmp    14a6 <main+0x2b6>
mov    -0x8(%rbp),%edi
lea    -0x2020(%rbp),%rsi
mov    $0x2000,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
cmp    $0xffffffff,%eax
jne    1457 <main+0x267>
lea    0xc57(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x7,%edi
call   10f0 <exit@plt>
mov    -0x8(%rbp),%edi
lea    -0x2020(%rbp),%rsi
mov    $0x2000,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
jne    148c <main+0x29c>
lea    0xba7(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x8,%edi
call   10f0 <exit@plt>
lea    -0x2020(%rbp),%rsi
lea    0xb8f(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    137c <main+0x18c>
mov    -0x8(%rbp),%edi
call   10a0 <close@plt>
xor    %eax,%eax
add    $0x2020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2028,%rsp
mov    0x2dd8(%rip),%rbx
mov    (%rbx),%edi
mov    0x2db7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
cmp    $0xffffffff,%eax
je     13dd <main+0x1ed>
mov    %eax,%r13d
movl   $0x1,0xc(%rsp)
mov    0x2db3(%rip),%rbp
mov    0x0(%rbp),%esi
mov    0x2d71(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rcx
mov    %r13d,%edi
mov    $0x4,%r8d
call   1050 <setsockopt@plt>
cmp    $0xffffffff,%eax
je     13f3 <main+0x203>
mov    0x0(%rbp),%esi
mov    0x2d59(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rcx
mov    %r13d,%edi
mov    $0x4,%r8d
call   1050 <setsockopt@plt>
cmp    $0xffffffff,%eax
je     1409 <main+0x219>
mov    (%rbx),%eax
mov    %eax,0x1c(%rsp)
mov    $0x539,%edi
call   1070 <htons@plt>
mov    %eax,0x18(%rsp)
lea    0xd72(%rip),%rdi
call   10c0 <inet_addr@plt>
mov    %eax,0x14(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1090 <memset@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1100 <connect@plt>
cmp    $0xffffffff,%eax
je     141f <main+0x22f>
lea    0x20(%rsp),%rbx
mov    %r13d,%edi
mov    %rbx,%rsi
mov    $0x2000,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
je     1435 <main+0x245>
lea    0xd7e(%rip),%r15
mov    0x2cd4(%rip),%r14
lea    0xd1e(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xd17(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x200,%esi
call   10b0 <fgets@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rdi
mov    %r12,%rsi
call   10d0 <strcmp@plt>
mov    %rax,%rbp
mov    %r13d,%edi
mov    %rbx,%rsi
mov    $0x2000,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
test   %rbp,%rbp
je     13a2 <main+0x1b2>
cmp    $0xffffffff,%eax
je     13c7 <main+0x1d7>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    $0x2000,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
jne    1310 <main+0x120>
lea    0xc91(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x8,%edi
call   10f0 <exit@plt>
cmp    $0xffffffff,%eax
je     144b <main+0x25b>
mov    %r13d,%edi
call   10a0 <close@plt>
xor    %eax,%eax
add    $0x2028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc63(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x7,%edi
call   10f0 <exit@plt>
lea    0xc1c(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0xc0d(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x2,%edi
call   10f0 <exit@plt>
lea    0xbf7(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x3,%edi
call   10f0 <exit@plt>
lea    0xbf6(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x4,%edi
call   10f0 <exit@plt>
lea    0xbe8(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x5,%edi
call   10f0 <exit@plt>
lea    0xbdf(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x6,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [7 x i8] c"socket\00"
@SOL_SOCKET = global i32 0
@SO_KEEPALIVE = global i32 0
@.str.1 = [11 x i8] c"setsockopt\00"
@SO_REUSEADDR = global i32 0
@.str.2 = [10 x i8] c"127.0.0.1\00"
@.str.3 = [8 x i8] c"connect\00"
@.str.4 = [5 x i8] c"recv\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [70 x i8] c"********************************************************************\0A\00"
@.str.7 = [36 x i8] c"\0AG\C3\A9pelje be a k\C3\ADv\C3\A1nt parancsot:\0A\00"
@stdin = global i32 0
@.str.8 = [8 x i8] c"(v\C3\A9ge)\00"
@.str.9 = [5 x i8] c"send\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = alloca [8192 x i8]
store i32 0, i32* %1
%6 = load i32, i32* @AF_INET
%7 = load i32, i32* @SOCK_STREAM
%8 = call i32 @socket(i32 %6, i32 %7, i32 0)
store i32 %8, i32* %2
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %0
store i32 1, i32* %4
%14 = load i32, i32* %2
%15 = load i32, i32* @SOL_SOCKET
%16 = load i32, i32* @SO_KEEPALIVE
%17 = call i32 @setsockopt(i32 %14, i32 %15, i32 %16, i32* %4, i32 4)
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 @exit(i32 2)
unreachable
22: ; preds = %13
%23 = load i32, i32* %2
%24 = load i32, i32* @SOL_SOCKET
%25 = load i32, i32* @SO_REUSEADDR
%26 = call i32 @setsockopt(i32 %23, i32 %24, i32 %25, i32* %4, i32 4)
%27 = icmp eq i32 %26, -1
br i1 %27, label %28, label %31
28: ; preds = %22
%29 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%30 = call i32 @exit(i32 3)
unreachable
31: ; preds = %22
%32 = load i32, i32* @AF_INET
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 3
store i32 %32, i32* %33
%34 = call i32 @htons(i32 1337)
%35 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 2
store i32 %34, i32* %35
%36 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%37 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 1
%38 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %37, i32 0, i32 0
store i32 %36, i32* %38
%39 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%40 = call i32 @memset(i32* %39, i8 signext 0, i32 8)
%41 = load i32, i32* %2
%42 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%43 = call i32 @connect(i32 %41, %struct.sockaddr* %42, i32 4)
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %48
45: ; preds = %31
%46 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%47 = call i32 @exit(i32 4)
unreachable
48: ; preds = %31
%49 = load i32, i32* %2
%50 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%51 = call i32 @recv(i32 %49, i8* %50, i32 8192, i32 0)
%52 = icmp eq i32 %51, -1
br i1 %52, label %53, label %56
53: ; preds = %48
%54 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%55 = call i32 @exit(i32 5)
unreachable
56: ; preds = %48
%57 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %57)
br label %59
59: ; preds = %56, %98
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.6, i64 0, i64 0))
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0))
%62 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%63 = load i32, i32* @stdin
%64 = call i32 @fgets(i8* %62, i32 512, i32 %63)
%65 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%66 = call i32 @strlen(i8* %65)
%67 = sub nsw i32 %66, 1
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 %68
store i8 0, i8* %69
%70 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%71 = call i64 @strcmp(i8* %70, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %82
73: ; preds = %59
%74 = load i32, i32* %2
%75 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%76 = call i32 @send(i32 %74, i8* %75, i32 8192, i32 0)
%77 = icmp eq i32 %76, -1
br i1 %77, label %78, label %81
78: ; preds = %73
%79 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%80 = call i32 @exit(i32 6)
unreachable
81: ; preds = %73
br label %101
82: ; preds = %59
%83 = load i32, i32* %2
%84 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%85 = call i32 @send(i32 %83, i8* %84, i32 8192, i32 0)
%86 = icmp eq i32 %85, -1
br i1 %86, label %87, label %90
87: ; preds = %82
%88 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%89 = call i32 @exit(i32 7)
unreachable
90: ; preds = %82
%91 = load i32, i32* %2
%92 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%93 = call i32 @recv(i32 %91, i8* %92, i32 8192, i32 0)
%94 = icmp eq i32 %93, -1
br i1 %94, label %95, label %98
95: ; preds = %90
%96 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%97 = call i32 @exit(i32 8)
unreachable
98: ; preds = %90
%99 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %99)
br label %59
101: ; preds = %81
%102 = load i32, i32* %2
%103 = call i32 @close(i32 %102)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [7 x i8] c"socket\00"
@SOL_SOCKET = global i32 0
@SO_KEEPALIVE = global i32 0
@.str.1 = [11 x i8] c"setsockopt\00"
@SO_REUSEADDR = global i32 0
@.str.2 = [10 x i8] c"127.0.0.1\00"
@.str.3 = [8 x i8] c"connect\00"
@.str.4 = [5 x i8] c"recv\00"
@stdin = global i32 0
@.str.8 = [8 x i8] c"(v\C3\A9ge)\00"
@.str.9 = [5 x i8] c"send\00"
@str = [69 x i8] c"********************************************************************\00"
@str.10 = [35 x i8] c"\0AG\C3\A9pelje be a k\C3\ADv\C3\A1nt parancsot:\00"
define i32 @main() {
%1 = alloca %struct.sockaddr_in
%2 = alloca i32
%3 = alloca [8192 x i8]
%4 = bitcast %struct.sockaddr_in* %1 to i8*
%5 = load i32, i32* @AF_INET
%6 = load i32, i32* @SOCK_STREAM
%7 = tail call i32 @socket(i32 %5, i32 %6, i32 0)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %0
%13 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%14 = load i32, i32* @SOL_SOCKET
%15 = load i32, i32* @SO_KEEPALIVE
%16 = call i32 @setsockopt(i32 %7, i32 %14, i32 %15, i32* %2, i32 4)
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @exit(i32 2)
unreachable
21: ; preds = %12
%22 = load i32, i32* @SOL_SOCKET
%23 = load i32, i32* @SO_REUSEADDR
%24 = call i32 @setsockopt(i32 %7, i32 %22, i32 %23, i32* %2, i32 4)
%25 = icmp eq i32 %24, -1
br i1 %25, label %26, label %29
26: ; preds = %21
%27 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%28 = call i32 @exit(i32 3)
unreachable
29: ; preds = %21
%30 = load i32, i32* @AF_INET
%31 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 3
store i32 %30, i32* %31
%32 = call i32 @htons(i32 1337)
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 2
store i32 %32, i32* %33
%34 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%35 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 1, i32 0
store i32 %34, i32* %35
%36 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 0
%37 = call i32 @memset(i32* %36, i8 signext 0, i32 8)
%38 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%39 = call i32 @connect(i32 %7, %struct.sockaddr* %38, i32 4)
%40 = icmp eq i32 %39, -1
br i1 %40, label %41, label %44
41: ; preds = %29
%42 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%43 = call i32 @exit(i32 4)
unreachable
44: ; preds = %29
%45 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%46 = call i32 @recv(i32 %7, i8* %45, i32 8192, i32 0)
%47 = icmp eq i32 %46, -1
br i1 %47, label %48, label %51
48: ; preds = %44
%49 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%50 = call i32 @exit(i32 5)
unreachable
51: ; preds = %44, %73
%52 = call i32 @puts(i8* %45)
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str, i64 0, i64 0))
%54 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.10, i64 0, i64 0))
%55 = load i32, i32* @stdin
%56 = call i32 @fgets(i8* %45, i32 512, i32 %55)
%57 = call i32 @strlen(i8* %45)
%58 = add nsw i32 %57, -1
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 %59
store i8 0, i8* %60
%61 = call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%62 = icmp eq i64 %61, 0
%63 = call i32 @send(i32 %7, i8* %45, i32 8192, i32 0)
%64 = icmp eq i32 %63, -1
br i1 %62, label %65, label %69
65: ; preds = %51
br i1 %64, label %66, label %79
66: ; preds = %65
%67 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%68 = call i32 @exit(i32 6)
unreachable
69: ; preds = %51
br i1 %64, label %70, label %73
70: ; preds = %69
%71 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%72 = call i32 @exit(i32 7)
unreachable
73: ; preds = %69
%74 = call i32 @recv(i32 %7, i8* %45, i32 8192, i32 0)
%75 = icmp eq i32 %74, -1
br i1 %75, label %76, label %51
76: ; preds = %73
%77 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%78 = call i32 @exit(i32 8)
unreachable
79: ; preds = %65
%80 = call i32 @close(i32 %7)
ret i32 0
}