#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_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct hostent {
  int /*<<< orphan*/ h_length;
  int /*<<< orphan*/ h_addr;
};
typedef int /*<<< orphan*/ serv_addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ SOCK_STREAM;
int atoi(char *);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ *strstr(char *, char *);
int write(int, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int sockfd, portno, n;
  struct sockaddr_in serv_addr;
  struct hostent *server;
  char buffer[256];
  if (argc < 2) {
    printf("\nPort number is missing...\n");
    exit(0);
  }
  portno = atoi(argv[1]);
  sockfd = socket(AF_INET, SOCK_STREAM, 0);
  if (sockfd < 0)
    error(EXIT_FAILURE, 0, "ERROR opening socket\n");
  server = gethostbyname("129.120.151.94");
  if (server == NULL) {
    printf("\nERROR, no such host...\n");
    exit(0);
  }
  bzero((char *)&serv_addr, sizeof(serv_addr));
  serv_addr.sin_family = AF_INET;
  serv_addr.sin_port = htons(portno);
  memcpy(&serv_addr.sin_addr, server->h_addr, server->h_length);
  if (connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0)
    error(EXIT_FAILURE, 0, "ERROR connecting the server...\n");
  int quit = 0;
  while (quit == 0) {
    printf("\nEnter message (use Bye to end): ");
    bzero(buffer, 256);
    fgets(buffer, 256, stdin);
    n = write(sockfd, buffer, strlen(buffer));
    if (n < 0) {
      error(EXIT_FAILURE, 0, "ERROR writing to socket");
    }
    if (strstr(buffer, "Bye") == NULL) {
      bzero(buffer, 256);
      n = read(sockfd, buffer, 255);
      if (n < 0)
        error(EXIT_FAILURE, 0, "ERROR reading from socket");
      else {
        printf("The number of vowels present is %s\n", buffer);
      }
    } else {
      printf("Goodbye\n");
      quit = 1;
    }
  }
  close(sockfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1238 <main+0x38>
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    0x2d99(%rip),%rax
mov    (%rax),%edi
mov    0x2d78(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1285 <main+0x85>
mov    0x2d53(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
lea    0xd9c(%rip),%rdx
call   10c0 <error@plt>
lea    0xda6(%rip),%rdi
call   10a0 <gethostbyname@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    12b5 <main+0xb5>
lea    0xd9a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
lea    -0x28(%rbp),%rdi
mov    $0xc,%esi
call   10d0 <bzero@plt>
mov    0x2d1e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
call   1050 <htons@plt>
mov    %eax,-0x24(%rbp)
lea    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x30(%rbp),%rax
mov    (%rax),%edx
call   10b0 <memcpy@plt>
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0xc,%edx
call   1100 <connect@plt>
cmp    $0x0,%rax
jge    1322 <main+0x122>
mov    0x2cb6(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
lea    0xd3d(%rip),%rdx
call   10c0 <error@plt>
movl   $0x0,-0x134(%rbp)
cmpl   $0x0,-0x134(%rbp)
jne    146f <main+0x26f>
lea    0xd3a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x130(%rbp),%rdi
mov    $0x100,%esi
call   10d0 <bzero@plt>
lea    -0x130(%rbp),%rdi
mov    0x2c7a(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1090 <fgets@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x144(%rbp)
lea    -0x130(%rbp),%rax
mov    %rax,-0x140(%rbp)
lea    -0x130(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x144(%rbp),%edi
mov    -0x140(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    13cd <main+0x1cd>
mov    0x2c0b(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
lea    0xcd4(%rip),%rdx
call   10c0 <error@plt>
lea    -0x130(%rbp),%rdi
lea    0xcd9(%rip),%rsi
call   1110 <strstr@plt>
cmp    $0x0,%rax
jne    1452 <main+0x252>
lea    -0x130(%rbp),%rdi
mov    $0x100,%esi
call   10d0 <bzero@plt>
mov    -0x14(%rbp),%edi
lea    -0x130(%rbp),%rsi
mov    $0xff,%edx
call   1080 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1438 <main+0x238>
mov    0x2ba5(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
lea    0xc8a(%rip),%rdx
call   10c0 <error@plt>
jmp    144d <main+0x24d>
lea    -0x130(%rbp),%rsi
lea    0xc8c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    146a <main+0x26a>
lea    0xc9d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x134(%rbp)
jmp    132c <main+0x12c>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
cmp    $0x1,%edi
jle    13e4 <main+0x1d4>
mov    0x8(%rsi),%rdi
call   10f0 <atoi@plt>
mov    %eax,%r14d
mov    0x2dab(%rip),%r12
mov    (%r12),%edi
mov    0x2d88(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    126e <main+0x5e>
mov    0x2d6a(%rip),%rax
mov    (%rax),%edi
lea    0xd99(%rip),%rdx
xor    %esi,%esi
call   10d0 <error@plt>
lea    0xda1(%rip),%rdi
call   10b0 <gethostbyname@plt>
test   %rax,%rax
je     13ed <main+0x1dd>
mov    %rax,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0xc,%esi
call   10e0 <bzero@plt>
mov    (%r12),%eax
mov    %eax,0x8(%rsp)
mov    %r14d,%edi
call   1060 <htons@plt>
mov    %eax,0x4(%rsp)
mov    (%rbx),%edx
mov    0x4(%rbx),%esi
mov    %r15,%rdi
call   10c0 <memcpy@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    $0xc,%edx
call   1110 <connect@plt>
test   %rax,%rax
jns    12e2 <main+0xd2>
mov    0x2cf6(%rip),%rax
mov    (%rax),%edi
lea    0xd4a(%rip),%rdx
xor    %esi,%esi
call   10d0 <error@plt>
lea    0xd5c(%rip),%r14
lea    0x10(%rsp),%rbx
mov    0x2ceb(%rip),%r15
mov    0x2ccc(%rip),%r13
lea    0xd7c(%rip),%r12
jmp    1321 <main+0x111>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xd86(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
mov    $0x100,%esi
call   10e0 <bzero@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x100,%esi
call   10a0 <fgets@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
test   %eax,%eax
jns    1372 <main+0x162>
mov    0x0(%r13),%edi
xor    %esi,%esi
lea    0xcfa(%rip),%rdx
call   10d0 <error@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1120 <strstr@plt>
test   %rax,%rax
jne    13bd <main+0x1ad>
mov    %rbx,%rdi
mov    $0x100,%esi
call   10e0 <bzero@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0xff,%edx
call   1090 <read@plt>
test   %eax,%eax
jns    1310 <main+0x100>
mov    0x0(%r13),%edi
xor    %esi,%esi
lea    0xcd0(%rip),%rdx
call   10d0 <error@plt>
jmp    1321 <main+0x111>
lea    0xcfd(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
call   1080 <close@plt>
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcf6(%rip),%rdi
jmp    13f4 <main+0x1e4>
lea    0xcd5(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.hostent = type { i32, i32 }
%struct.sockaddr = type { i32 }
@.str = [28 x i8] c"\0APort number is missing...\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@EXIT_FAILURE = global i32 0
@.str.1 = [22 x i8] c"ERROR opening socket\0A\00"
@.str.2 = [15 x i8] c"129.120.151.94\00"
@.str.3 = [25 x i8] c"\0AERROR, no such host...\0A\00"
@.str.4 = [32 x i8] c"ERROR connecting the server...\0A\00"
@.str.5 = [34 x i8] c"\0AEnter message (use Bye to end): \00"
@stdin = global i32 0
@.str.6 = [24 x i8] c"ERROR writing to socket\00"
@.str.7 = [4 x i8] c"Bye\00"
@.str.8 = [26 x i8] c"ERROR reading from socket\00"
@.str.9 = [36 x i8] c"The number of vowels present is %s\0A\00"
@.str.10 = [9 x i8] c"Goodbye\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 %struct.sockaddr_in
%10 = alloca %struct.hostent*
%11 = alloca [256 x i8]
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 2
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 0)
unreachable
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
store i32 %22, i32* %7
%23 = load i32, i32* @AF_INET
%24 = load i32, i32* @SOCK_STREAM
%25 = call i32 @socket(i32 %23, i32 %24, i32 0)
store i32 %25, i32* %6
%26 = load i32, i32* %6
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %18
%29 = load i32, i32* @EXIT_FAILURE
%30 = call i32 @error(i32 %29, i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %28, %18
%32 = call %struct.hostent* @gethostbyname(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
store %struct.hostent* %32, %struct.hostent** %10
%33 = load %struct.hostent*, %struct.hostent** %10
%34 = icmp eq %struct.hostent* %33, null
br i1 %34, label %35, label %38
35: ; preds = %31
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%37 = call i32 @exit(i32 0)
unreachable
38: ; preds = %31
%39 = bitcast %struct.sockaddr_in* %9 to i8*
%40 = call i32 @bzero(i8* %39, i32 12)
%41 = load i32, i32* @AF_INET
%42 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 2
store i32 %41, i32* %42
%43 = load i32, i32* %7
%44 = call i32 @htons(i32 %43)
%45 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 1
store i32 %44, i32* %45
%46 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
%47 = load %struct.hostent*, %struct.hostent** %10
%48 = getelementptr inbounds %struct.hostent, %struct.hostent* %47, i32 0, i32 1
%49 = load i32, i32* %48
%50 = load %struct.hostent*, %struct.hostent** %10
%51 = getelementptr inbounds %struct.hostent, %struct.hostent* %50, i32 0, i32 0
%52 = load i32, i32* %51
%53 = call i32 @memcpy(i32* %46, i32 %49, i32 %52)
%54 = load i32, i32* %6
%55 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%56 = call i64 @connect(i32 %54, %struct.sockaddr* %55, i32 12)
%57 = icmp slt i64 %56, 0
br i1 %57, label %58, label %61
58: ; preds = %38
%59 = load i32, i32* @EXIT_FAILURE
%60 = call i32 @error(i32 %59, i32 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
br label %61
61: ; preds = %58, %38
store i32 0, i32* %12
br label %62
62: ; preds = %103, %61
%63 = load i32, i32* %12
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %104
65: ; preds = %62
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
%67 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%68 = call i32 @bzero(i8* %67, i32 256)
%69 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%70 = load i32, i32* @stdin
%71 = call i32 @fgets(i8* %69, i32 256, i32 %70)
%72 = load i32, i32* %6
%73 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%74 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%75 = call i32 @strlen(i8* %74)
%76 = call i32 @write(i32 %72, i8* %73, i32 %75)
store i32 %76, i32* %8
%77 = load i32, i32* %8
%78 = icmp slt i32 %77, 0
br i1 %78, label %79, label %82
79: ; preds = %65
%80 = load i32, i32* @EXIT_FAILURE
%81 = call i32 @error(i32 %80, i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
br label %82
82: ; preds = %79, %65
%83 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%84 = call i32* @strstr(i8* %83, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%85 = icmp eq i32* %84, null
br i1 %85, label %86, label %101
86: ; preds = %82
%87 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%88 = call i32 @bzero(i8* %87, i32 256)
%89 = load i32, i32* %6
%90 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%91 = call i32 @read(i32 %89, i8* %90, i32 255)
store i32 %91, i32* %8
%92 = load i32, i32* %8
%93 = icmp slt i32 %92, 0
br i1 %93, label %94, label %97
94: ; preds = %86
%95 = load i32, i32* @EXIT_FAILURE
%96 = call i32 @error(i32 %95, i32 0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
br label %100
97: ; preds = %86
%98 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), i8* %98)
br label %100
100: ; preds = %97, %94
br label %103
101: ; preds = %82
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
store i32 1, i32* %12
br label %103
103: ; preds = %101, %100
br label %62
104: ; preds = %62
%105 = load i32, i32* %6
%106 = call i32 @close(i32 %105)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, i32, i32 }
%struct.hostent = type { i32, i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@EXIT_FAILURE = global i32 0
@.str.1 = [22 x i8] c"ERROR opening socket\0A\00"
@.str.2 = [15 x i8] c"129.120.151.94\00"
@.str.4 = [32 x i8] c"ERROR connecting the server...\0A\00"
@.str.5 = [34 x i8] c"\0AEnter message (use Bye to end): \00"
@stdin = global i32 0
@.str.6 = [24 x i8] c"ERROR writing to socket\00"
@.str.7 = [4 x i8] c"Bye\00"
@.str.8 = [26 x i8] c"ERROR reading from socket\00"
@.str.9 = [36 x i8] c"The number of vowels present is %s\0A\00"
@str = [8 x i8] c"Goodbye\00"
@str.11 = [24 x i8] c"\0AERROR, no such host...\00"
@str.12 = [27 x i8] c"\0APort number is missing...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [256 x i8]
%5 = bitcast %struct.sockaddr_in* %3 to i8*
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = icmp slt i32 %0, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.12, i64 0, i64 0))
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32 @atoi(i8* %13)
%15 = load i32, i32* @AF_INET
%16 = load i32, i32* @SOCK_STREAM
%17 = tail call i32 @socket(i32 %15, i32 %16, i32 0)
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %11
%20 = load i32, i32* @EXIT_FAILURE
%21 = tail call i32 @error(i32 %20, i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %19, %11
%23 = tail call %struct.hostent* @gethostbyname(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp eq %struct.hostent* %23, null
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.11, i64 0, i64 0))
%27 = tail call i32 @exit(i32 0)
unreachable
28: ; preds = %22
%29 = call i32 @bzero(i8* %5, i32 12)
%30 = load i32, i32* @AF_INET
%31 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %30, i32* %31
%32 = tail call i32 @htons(i32 %14)
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
store i32 %32, i32* %33
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
%35 = getelementptr inbounds %struct.hostent, %struct.hostent* %23, i64 0, i32 1
%36 = load i32, i32* %35
%37 = getelementptr inbounds %struct.hostent, %struct.hostent* %23, i64 0, i32 0
%38 = load i32, i32* %37
%39 = call i32 @memcpy(i32* %34, i32 %36, i32 %38)
%40 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%41 = call i64 @connect(i32 %17, %struct.sockaddr* %40, i32 12)
%42 = icmp slt i64 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %28
%44 = load i32, i32* @EXIT_FAILURE
%45 = call i32 @error(i32 %44, i32 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
br label %46
46: ; preds = %43, %28
br label %47
47: ; preds = %68, %46
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
%49 = call i32 @bzero(i8* %6, i32 256)
%50 = load i32, i32* @stdin
%51 = call i32 @fgets(i8* %6, i32 256, i32 %50)
%52 = call i32 @strlen(i8* %6)
%53 = call i32 @write(i32 %17, i8* %6, i32 %52)
%54 = icmp slt i32 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %47
%56 = load i32, i32* @EXIT_FAILURE
%57 = call i32 @error(i32 %56, i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
br label %58
58: ; preds = %55, %47
%59 = call i32* @strstr(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%60 = icmp eq i32* %59, null
br i1 %60, label %61, label %71
61: ; preds = %58
%62 = call i32 @bzero(i8* %6, i32 256)
%63 = call i32 @read(i32 %17, i8* %6, i32 255)
%64 = icmp slt i32 %63, 0
br i1 %64, label %65, label %69
65: ; preds = %61
%66 = load i32, i32* @EXIT_FAILURE
%67 = call i32 @error(i32 %66, i32 0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
br label %68
68: ; preds = %65, %69
br label %47
69: ; preds = %61
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), i8* %6)
br label %68
71: ; preds = %58
%72 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%73 = call i32 @close(i32 %17)
ret i32 0
}