#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 in_addr {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  struct in_addr sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct hostent {
  scalar_t__ *h_addr_list;
};
typedef int /*<<< orphan*/ serverAddr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
unsigned short atoi(char *);
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
char getchar();
struct hostent *gethostbyname(char *);
int htonl(int /*<<< orphan*/);
int /*<<< orphan*/ htons(unsigned short);
int /*<<< orphan*/ memset(struct sockaddr_in *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ send(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ shutdown(int, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  struct sockaddr_in serverAddr;
  ;
  char c;
  unsigned short portnum;
  char *hostName;
  struct hostent *hptr;
  int sock;
  if (argc < 2) {
    printf("usage: %s <hostname/IP Addr> <port number>\n", argv[0]);
    printf("Example:\n");
    printf(
        "%s myhost 2345 -- would connect to host \"myhost\" on port 2345 0\n",
        argv[0]);
    printf("%s 192.168.100.1 2345 -- would connect to 192.168.100.1 on port "
           "2345 0\n",
           argv[0]);
    exit(1);
  }
  hostName = argv[1];
  portnum = atoi(argv[2]);
  if ((hptr = gethostbyname(hostName)) == NULL) {
    fprintf(stderr, "gethostbyname error for host %s!\n", hostName);
    exit(1);
  }
  memset(&serverAddr, 0x0, sizeof(serverAddr));
  if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    fprintf(stderr, "socket failed, \n");
    exit(1);
  }
  serverAddr.sin_family = AF_INET;
  serverAddr.sin_port = htons(portnum);
  serverAddr.sin_addr = *(struct in_addr *)*hptr->h_addr_list;
  printf("Server's address is %x:\n", htonl(serverAddr.sin_addr.s_addr));
  if (connect(sock, (struct sockaddr *)&serverAddr, sizeof(serverAddr)) != 0) {
    printf("Connect failed:\n");
    shutdown(sock, 2);
    close(sock);
    exit(1);
  }
  printf("Connected...\n Press <ESC> to exit \n\n");
  while (1) {
    c = getchar();
    if (c != 0x1b) {
      send(sock, &c, 1, 0);
    } else {
      break;
    }
  }
  shutdown(sock, 2);
  close(sock);
  printf("\n...goodbye\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1257 <main+0x77>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10d0 <atoi@plt>
mov    %ax,-0x24(%rbp)
mov    -0x30(%rbp),%rdi
call   10b0 <gethostbyname@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    12b0 <main+0xd0>
mov    0x2d46(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rdx
lea    0xe20(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1080 <memset@plt>
mov    0x2d21(%rip),%rax
mov    (%rax),%edi
mov    0x2d00(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
mov    %eax,-0x3c(%rbp)
cmp    $0x0,%eax
jge    1306 <main+0x126>
mov    0x2cec(%rip),%rax
mov    (%rax),%edi
lea    0xdec(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    0x2cdb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
movzwl -0x24(%rbp),%edi
call   1040 <htons@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
call   1070 <htonl@plt>
mov    %eax,%esi
lea    0xdb4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x3c(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0xc,%edx
call   10f0 <connect@plt>
cmp    $0x0,%rax
je     138d <main+0x1ad>
lea    0xda4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x3c(%rbp),%edi
mov    $0x2,%esi
call   1030 <shutdown@plt>
mov    -0x3c(%rbp),%edi
call   1090 <close@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0xd88(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   10a0 <getchar@plt>
mov    %al,-0x21(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x1b,%eax
je     13ca <main+0x1ea>
mov    -0x3c(%rbp),%edi
lea    -0x21(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
jmp    13cf <main+0x1ef>
jmp    13d4 <main+0x1f4>
jmp    139b <main+0x1bb>
mov    -0x3c(%rbp),%edi
mov    $0x2,%esi
call   1030 <shutdown@plt>
mov    -0x3c(%rbp),%edi
call   1090 <close@plt>
lea    0xd51(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
cmp    $0x1,%edi
jle    131c <main+0x12c>
mov    0x8(%rbx),%rbp
mov    0x10(%rbx),%rdi
call   10e0 <atoi@plt>
mov    %eax,%r15d
mov    %rbp,%rdi
call   10c0 <gethostbyname@plt>
test   %rax,%rax
je     1365 <main+0x175>
mov    %rax,%r14
lea    0x8(%rsp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1090 <memset@plt>
mov    0x2da6(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2d84(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
test   %eax,%eax
js     1389 <main+0x199>
mov    %eax,%ebx
mov    0x0(%rbp),%eax
mov    %eax,0x10(%rsp)
movzwl %r15w,%edi
call   1050 <htons@plt>
mov    %eax,0xc(%rsp)
mov    (%r14),%rax
mov    (%rax),%rax
mov    (%rax),%edi
mov    %edi,0x8(%rsp)
call   1080 <htonl@plt>
lea    0xe5d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %ebx,%edi
mov    $0xc,%edx
call   1100 <connect@plt>
test   %rax,%rax
jne    13aa <main+0x1ba>
lea    0xe4c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   10b0 <getchar@plt>
mov    %al,0x7(%rsp)
cmp    $0x1b,%al
je     12f0 <main+0x100>
lea    0x7(%rsp),%rbp
xchg   %ax,%ax
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
xor    %eax,%eax
call   10b0 <getchar@plt>
mov    %al,0x7(%rsp)
cmp    $0x1b,%al
jne    12d0 <main+0xe0>
mov    %ebx,%edi
mov    $0x2,%esi
call   1040 <shutdown@plt>
mov    %ebx,%edi
call   10a0 <close@plt>
lea    0xe1b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%rsi
lea    0xcda(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe0d(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xce9(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%rbx),%rsi
lea    0xd19(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    0x2c6c(%rip),%rax
mov    (%rax),%edi
lea    0xd40(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    0x2c48(%rip),%rax
mov    (%rax),%edi
lea    0xd3e(%rip),%rsi
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
lea    0xd80(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
mov    $0x2,%esi
call   1040 <shutdown@plt>
mov    %ebx,%edi
call   10a0 <close@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.in_addr, i32, i32 }
%struct.in_addr = type { i32 }
%struct.hostent = type { i64* }
%struct.sockaddr = type { i32 }
@.str = [44 x i8] c"usage: %s <hostname/IP Addr> <port number>\0A\00"
@.str.1 = [10 x i8] c"Example:\0A\00"
@.str.2 = [65 x i8] c"%s myhost 2345 -- would connect to host \22myhost\22 on port 2345 0\0A\00"
@.str.3 = [72 x i8] c"%s 192.168.100.1 2345 -- would connect to 192.168.100.1 on port 2345 0\0A\00"
@stderr = global i32 0
@.str.4 = [34 x i8] c"gethostbyname error for host %s!\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.5 = [17 x i8] c"socket failed, \0A\00"
@.str.6 = [25 x i8] c"Server's address is %x:\0A\00"
@.str.7 = [17 x i8] c"Connect failed:\0A\00"
@.str.8 = [37 x i8] c"Connected...\0A Press <ESC> to exit \0A\0A\00"
@.str.9 = [13 x i8] c"\0A...goodbye\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.sockaddr_in
%7 = alloca i8
%8 = alloca i16
%9 = alloca i8*
%10 = alloca %struct.hostent*
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %29
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 ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0), i8* %22)
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.3, i64 0, i64 0), i8* %26)
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %2
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
store i8* %32, i8** %9
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = call zeroext i16 @atoi(i8* %35)
store i16 %36, i16* %8
%37 = load i8*, i8** %9
%38 = call %struct.hostent* @gethostbyname(i8* %37)
store %struct.hostent* %38, %struct.hostent** %10
%39 = icmp eq %struct.hostent* %38, null
br i1 %39, label %40, label %45
40: ; preds = %29
%41 = load i32, i32* @stderr
%42 = load i8*, i8** %9
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i8* %42)
%44 = call i32 @exit(i32 1)
unreachable
45: ; preds = %29
%46 = call i32 @memset(%struct.sockaddr_in* %6, i32 0, i32 12)
%47 = load i32, i32* @AF_INET
%48 = load i32, i32* @SOCK_STREAM
%49 = call i32 @socket(i32 %47, i32 %48, i32 0)
store i32 %49, i32* %11
%50 = icmp slt i32 %49, 0
br i1 %50, label %51, label %55
51: ; preds = %45
%52 = load i32, i32* @stderr
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%54 = call i32 @exit(i32 1)
unreachable
55: ; preds = %45
%56 = load i32, i32* @AF_INET
%57 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 2
store i32 %56, i32* %57
%58 = load i16, i16* %8
%59 = call i32 @htons(i16 zeroext %58)
%60 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 1
store i32 %59, i32* %60
%61 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
%62 = load %struct.hostent*, %struct.hostent** %10
%63 = getelementptr inbounds %struct.hostent, %struct.hostent* %62, i32 0, i32 0
%64 = load i64*, i64** %63
%65 = load i64, i64* %64
%66 = inttoptr i64 %65 to %struct.in_addr*
%67 = bitcast %struct.in_addr* %61 to i8*
%68 = bitcast %struct.in_addr* %66 to i8*
%69 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
%70 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %69, i32 0, i32 0
%71 = load i32, i32* %70
%72 = call i32 @htonl(i32 %71)
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %72)
%74 = load i32, i32* %11
%75 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%76 = call i64 @connect(i32 %74, %struct.sockaddr* %75, i32 12)
%77 = icmp ne i64 %76, 0
br i1 %77, label %78, label %85
78: ; preds = %55
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
%80 = load i32, i32* %11
%81 = call i32 @shutdown(i32 %80, i32 2)
%82 = load i32, i32* %11
%83 = call i32 @close(i32 %82)
%84 = call i32 @exit(i32 1)
unreachable
85: ; preds = %55
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0))
br label %87
87: ; preds = %85, %96
%88 = call signext i8 (...) @getchar()
store i8 %88, i8* %7
%89 = load i8, i8* %7
%90 = sext i8 %89 to i32
%91 = icmp ne i32 %90, 27
br i1 %91, label %92, label %95
92: ; preds = %87
%93 = load i32, i32* %11
%94 = call i32 @send(i32 %93, i8* %7, i32 1, i32 0)
br label %96
95: ; preds = %87
br label %97
96: ; preds = %92
br label %87
97: ; preds = %95
%98 = load i32, i32* %11
%99 = call i32 @shutdown(i32 %98, i32 2)
%100 = load i32, i32* %11
%101 = call i32 @close(i32 %100)
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
%103 = load i32, i32* %3
ret i32 %103
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.in_addr, i32, i32 }
%struct.in_addr = type { i32 }
%struct.hostent = type { i64* }
%struct.sockaddr = type { i32 }
@.str = [44 x i8] c"usage: %s <hostname/IP Addr> <port number>\0A\00"
@.str.2 = [65 x i8] c"%s myhost 2345 -- would connect to host \22myhost\22 on port 2345 0\0A\00"
@.str.3 = [72 x i8] c"%s 192.168.100.1 2345 -- would connect to 192.168.100.1 on port 2345 0\0A\00"
@stderr = global i32 0
@.str.4 = [34 x i8] c"gethostbyname error for host %s!\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.5 = [17 x i8] c"socket failed, \0A\00"
@.str.6 = [25 x i8] c"Server's address is %x:\0A\00"
@str = [36 x i8] c"Connected...\0A Press <ESC> to exit \0A\00"
@str.10 = [12 x i8] c"\0A...goodbye\00"
@str.11 = [16 x i8] c"Connect failed:\00"
@str.12 = [9 x i8] c"Example:\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca i8
%5 = bitcast %struct.sockaddr_in* %3 to i8*
%6 = icmp slt i32 %0, 2
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i8*, i8** %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.12, i64 0, i64 0))
%11 = load i8*, i8** %1
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str.3, i64 0, i64 0), i8* %13)
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = tail call zeroext i16 @atoi(i8* %20)
%22 = tail call %struct.hostent* @gethostbyname(i8* %18)
%23 = icmp eq %struct.hostent* %22, null
br i1 %23, label %24, label %28
24: ; preds = %16
%25 = load i32, i32* @stderr
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i8* %18)
%27 = tail call i32 @exit(i32 1)
unreachable
28: ; preds = %16
%29 = call i32 @memset(%struct.sockaddr_in* %3, i32 0, i32 12)
%30 = load i32, i32* @AF_INET
%31 = load i32, i32* @SOCK_STREAM
%32 = call i32 @socket(i32 %30, i32 %31, i32 0)
%33 = icmp slt i32 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %28
%35 = load i32, i32* @stderr
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%37 = call i32 @exit(i32 1)
unreachable
38: ; preds = %28
%39 = load i32, i32* @AF_INET
%40 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %39, i32* %40
%41 = call i32 @htons(i16 zeroext %21)
%42 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
store i32 %41, i32* %42
%43 = getelementptr inbounds %struct.hostent, %struct.hostent* %22, i64 0, i32 0
%44 = load i64*, i64** %43
%45 = load i64, i64* %44
%46 = inttoptr i64 %45 to i32*
%47 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0, i32 0
%48 = load i32, i32* %46
store i32 %48, i32* %47
%49 = call i32 @htonl(i32 %48)
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %49)
%51 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%52 = call i64 @connect(i32 %32, %struct.sockaddr* %51, i32 12)
%53 = icmp eq i64 %52, 0
br i1 %53, label %59, label %54
54: ; preds = %38
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.11, i64 0, i64 0))
%56 = call i32 @shutdown(i32 %32, i32 2)
%57 = call i32 @close(i32 %32)
%58 = call i32 @exit(i32 1)
unreachable
59: ; preds = %38
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%61 = call signext i8 (...) @getchar()
store i8 %61, i8* %4
%62 = icmp eq i8 %61, 27
br i1 %62, label %67, label %63
63: ; preds = %59, %63
%64 = call i32 @send(i32 %32, i8* %4, i32 1, i32 0)
%65 = call signext i8 (...) @getchar()
store i8 %65, i8* %4
%66 = icmp eq i8 %65, 27
br i1 %66, label %67, label %63
67: ; preds = %63, %59
%68 = call i32 @shutdown(i32 %32, i32 2)
%69 = call i32 @close(i32 %32)
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.10, i64 0, i64 0))
ret i32 0
}