#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;
};
struct hostent {
  int /*<<< orphan*/ h_length;
  scalar_t__ h_addr;
};
typedef int /*<<< orphan*/ serverAddress;
typedef int /*<<< orphan*/ readBuffer;
typedef int /*<<< orphan*/ message;
typedef int /*<<< orphan*/ SSL_CTX;
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SSL_CTX_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *SSL_CTX_new(int /*<<< orphan*/);
int /*<<< orphan*/ SSL_connect(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
int /*<<< orphan*/ *SSL_new(int /*<<< orphan*/ *);
scalar_t__ SSL_read(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ SSL_set_fd(int /*<<< orphan*/ *, int);
scalar_t__ SSL_write(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ SSLv23_client_method();
int /*<<< orphan*/ bcopy(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int main(int argc, char *argv[]) {
  int socketfd, portNumber, length;
  char readBuffer[2000], message[255];
  struct sockaddr_in serverAddress;
  struct hostent *server;
  sprintf(message, "GET / HTTP/1.1\r\nHost: %s\r\nConnection: close\r\n\r\n",
          argv[1]);
  printf("Sending the message: %s", message);
  if (argc <= 1) {
    printf("Incorrect usage, use: ./webbrowserSSL hostname\n");
    return 2;
  }
  server = gethostbyname(argv[1]);
  if (server == NULL) {
    perror("Socket Client: error - unable to resolve host name.\n");
    return 1;
  }
  socketfd = socket(AF_INET, SOCK_STREAM, 0);
  if (socketfd < 0) {
    perror("Socket Client: error opening TCP IP-based socket.\n");
    return 1;
  }
  bzero((char *)&serverAddress, sizeof(serverAddress));
  portNumber = 443;
  serverAddress.sin_family = AF_INET;
  serverAddress.sin_port = htons(portNumber);
  bcopy((char *)server->h_addr, (char *)&serverAddress.sin_addr.s_addr,
        server->h_length);
  if (connect(socketfd, (struct sockaddr *)&serverAddress,
              sizeof(serverAddress)) < 0) {
    perror("Socket Client: error connecting to the server.\n");
    return 1;
  }
  SSL_load_error_strings();
  SSL_library_init();
  SSL_CTX *ssl_ctx = SSL_CTX_new(SSLv23_client_method());
  SSL *conn = SSL_new(ssl_ctx);
  SSL_set_fd(conn, socketfd);
  SSL_connect(conn);
  if (SSL_write(conn, message, sizeof(message)) < 0) {
    perror("Socket Client: error writing to the SSl socket");
    return 1;
  }
  if (SSL_read(conn, readBuffer, sizeof(readBuffer)) < 0) {
    perror("Socket Client: error reading from the SSL socket");
    return 1;
  }
  printf("**START**\n%s\n**END**\n", readBuffer);
  SSL_free(conn);
  close(socketfd);
  SSL_CTX_free(ssl_ctx);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x920,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8f0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd81(%rip),%rsi
call   1150 <sprintf@plt>
lea    -0x8f0(%rbp),%rsi
lea    0xd9e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jg     12bd <main+0x6d>
lea    0xd9e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    14c1 <main+0x271>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <gethostbyname@plt>
mov    %rax,-0x908(%rbp)
cmpq   $0x0,-0x908(%rbp)
jne    12f7 <main+0xa7>
lea    0xd92(%rip),%rdi
call   1130 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c1 <main+0x271>
mov    0x2cea(%rip),%rax
mov    (%rax),%edi
mov    0x2cd1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1170 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1335 <main+0xe5>
lea    0xd89(%rip),%rdi
call   1130 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c1 <main+0x271>
lea    -0x900(%rbp),%rdi
mov    $0xc,%esi
call   1140 <bzero@plt>
movl   $0x1bb,-0x18(%rbp)
mov    0x2c94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8f8(%rbp)
mov    -0x18(%rbp),%edi
call   1070 <htons@plt>
mov    %eax,-0x8fc(%rbp)
mov    -0x908(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x900(%rbp),%rsi
mov    -0x908(%rbp),%rax
mov    (%rax),%edx
call   10f0 <bcopy@plt>
mov    -0x14(%rbp),%edi
lea    -0x900(%rbp),%rsi
mov    $0xc,%edx
call   1160 <connect@plt>
cmp    $0x0,%rax
jge    13c0 <main+0x170>
lea    0xd31(%rip),%rdi
call   1130 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c1 <main+0x271>
mov    $0x0,%al
call   1120 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   10a0 <SSL_library_init@plt>
mov    $0x0,%al
call   1040 <SSLv23_client_method@plt>
mov    %eax,%edi
call   10e0 <SSL_CTX_new@plt>
mov    %rax,-0x910(%rbp)
mov    -0x910(%rbp),%rdi
call   10c0 <SSL_new@plt>
mov    %rax,-0x918(%rbp)
mov    -0x918(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <SSL_set_fd@plt>
mov    -0x918(%rbp),%rdi
call   1100 <SSL_connect@plt>
mov    -0x918(%rbp),%rdi
lea    -0x8f0(%rbp),%rsi
mov    $0xff,%edx
call   1030 <SSL_write@plt>
cmp    $0x0,%rax
jge    144b <main+0x1fb>
lea    0xcd6(%rip),%rdi
call   1130 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c1 <main+0x271>
mov    -0x918(%rbp),%rdi
lea    -0x7f0(%rbp),%rsi
mov    $0x7d0,%edx
call   10b0 <SSL_read@plt>
cmp    $0x0,%rax
jge    1485 <main+0x235>
lea    0xccb(%rip),%rdi
call   1130 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14c1 <main+0x271>
lea    -0x7f0(%rbp),%rsi
lea    0xcdd(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x918(%rbp),%rdi
call   1050 <SSL_free@plt>
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
mov    -0x910(%rbp),%rdi
call   1110 <SSL_CTX_free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x920,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x8e8,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdx
lea    0xd83(%rip),%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1160 <sprintf@plt>
lea    0xd9f(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
cmp    $0x1,%ebp
jg     12b6 <main+0x56>
lea    0xeaf(%rip),%rdi
call   1050 <puts@plt>
mov    $0x2,%ebp
jmp    1411 <main+0x1b1>
mov    0x8(%rbx),%rdi
call   10e0 <gethostbyname@plt>
test   %rax,%rax
je     13dc <main+0x17c>
mov    %rax,%rbx
mov    0x2d16(%rip),%r14
mov    (%r14),%edi
mov    0x2cfc(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1180 <socket@plt>
test   %eax,%eax
js     13e5 <main+0x185>
mov    %eax,%r15d
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    $0xc,%esi
call   1150 <bzero@plt>
mov    (%r14),%eax
mov    %eax,0x8(%rsp)
mov    $0x1bb,%edi
call   1080 <htons@plt>
mov    %eax,0x4(%rsp)
mov    0x8(%rbx),%rsi
mov    (%rbx),%edx
mov    %rbp,%rdi
call   1100 <memmove@plt>
mov    %r15d,%edi
mov    %rbp,%rsi
mov    $0xc,%edx
call   1170 <connect@plt>
test   %rax,%rax
js     13ee <main+0x18e>
xor    %eax,%eax
call   1130 <SSL_load_error_strings@plt>
xor    %eax,%eax
call   10b0 <SSL_library_init@plt>
xor    %eax,%eax
call   1040 <SSLv23_client_method@plt>
mov    %eax,%edi
call   10f0 <SSL_CTX_new@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   10d0 <SSL_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15d,%esi
call   1070 <SSL_set_fd@plt>
mov    %rbx,%rdi
call   1110 <SSL_connect@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    $0xff,%edx
call   1030 <SSL_write@plt>
test   %rax,%rax
js     13f7 <main+0x197>
lea    0x110(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x7d0,%edx
call   10c0 <SSL_read@plt>
test   %rax,%rax
js     1400 <main+0x1a0>
lea    0xd8f(%rip),%rdi
xor    %ebp,%ebp
lea    0x110(%rsp),%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %rbx,%rdi
call   1060 <SSL_free@plt>
mov    %r15d,%edi
call   10a0 <close@plt>
mov    %r14,%rdi
call   1120 <SSL_CTX_free@plt>
jmp    1411 <main+0x1b1>
lea    0xc65(%rip),%rdi
jmp    1407 <main+0x1a7>
lea    0xc91(%rip),%rdi
jmp    1407 <main+0x1a7>
lea    0xcbb(%rip),%rdi
jmp    1407 <main+0x1a7>
lea    0xce2(%rip),%rdi
jmp    1407 <main+0x1a7>
lea    0xd08(%rip),%rdi
call   1140 <perror@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8e8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i32, i64 }
%struct.sockaddr = type { i32 }
@.str = [48 x i8] c"GET / HTTP/1.1\0D\0AHost: %s\0D\0AConnection: close\0D\0A\0D\0A\00"
@.str.1 = [24 x i8] c"Sending the message: %s\00"
@.str.2 = [48 x i8] c"Incorrect usage, use: ./webbrowserSSL hostname\0A\00"
@.str.3 = [53 x i8] c"Socket Client: error - unable to resolve host name.\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.4 = [51 x i8] c"Socket Client: error opening TCP IP-based socket.\0A\00"
@.str.5 = [48 x i8] c"Socket Client: error connecting to the server.\0A\00"
@.str.6 = [47 x i8] c"Socket Client: error writing to the SSl socket\00"
@.str.7 = [49 x i8] c"Socket Client: error reading from the SSL socket\00"
@.str.8 = [22 x i8] c"**START**\0A%s\0A**END**\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 [2000 x i8]
%10 = alloca [255 x i8]
%11 = alloca %struct.sockaddr_in
%12 = alloca %struct.hostent*
%13 = alloca i32*
%14 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 0
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 0
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = load i32, i32* %4
%23 = icmp sle i32 %22, 1
br i1 %23, label %24, label %26
24: ; preds = %2
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
store i32 2, i32* %3
br label %102
26: ; preds = %2
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call %struct.hostent* @gethostbyname(i8* %29)
store %struct.hostent* %30, %struct.hostent** %12
%31 = load %struct.hostent*, %struct.hostent** %12
%32 = icmp eq %struct.hostent* %31, null
br i1 %32, label %33, label %35
33: ; preds = %26
%34 = call i32 @perror(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %102
35: ; preds = %26
%36 = load i32, i32* @AF_INET
%37 = load i32, i32* @SOCK_STREAM
%38 = call i32 @socket(i32 %36, i32 %37, i32 0)
store i32 %38, i32* %6
%39 = load i32, i32* %6
%40 = icmp slt i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %35
%42 = call i32 @perror(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %102
43: ; preds = %35
%44 = bitcast %struct.sockaddr_in* %11 to i8*
%45 = call i32 @bzero(i8* %44, i32 12)
store i32 443, i32* %7
%46 = load i32, i32* @AF_INET
%47 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 2
store i32 %46, i32* %47
%48 = load i32, i32* %7
%49 = call i32 @htons(i32 %48)
%50 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 1
store i32 %49, i32* %50
%51 = load %struct.hostent*, %struct.hostent** %12
%52 = getelementptr inbounds %struct.hostent, %struct.hostent* %51, i32 0, i32 1
%53 = load i64, i64* %52
%54 = inttoptr i64 %53 to i8*
%55 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
%56 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %55, i32 0, i32 0
%57 = bitcast i32* %56 to i8*
%58 = load %struct.hostent*, %struct.hostent** %12
%59 = getelementptr inbounds %struct.hostent, %struct.hostent* %58, i32 0, i32 0
%60 = load i32, i32* %59
%61 = call i32 @bcopy(i8* %54, i8* %57, i32 %60)
%62 = load i32, i32* %6
%63 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%64 = call i64 @connect(i32 %62, %struct.sockaddr* %63, i32 12)
%65 = icmp slt i64 %64, 0
br i1 %65, label %66, label %68
66: ; preds = %43
%67 = call i32 @perror(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %3
br label %102
68: ; preds = %43
%69 = call i32 (...) @SSL_load_error_strings()
%70 = call i32 (...) @SSL_library_init()
%71 = call i32 (...) @SSLv23_client_method()
%72 = call i32* @SSL_CTX_new(i32 %71)
store i32* %72, i32** %13
%73 = load i32*, i32** %13
%74 = call i32* @SSL_new(i32* %73)
store i32* %74, i32** %14
%75 = load i32*, i32** %14
%76 = load i32, i32* %6
%77 = call i32 @SSL_set_fd(i32* %75, i32 %76)
%78 = load i32*, i32** %14
%79 = call i32 @SSL_connect(i32* %78)
%80 = load i32*, i32** %14
%81 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 0
%82 = call i64 @SSL_write(i32* %80, i8* %81, i32 255)
%83 = icmp slt i64 %82, 0
br i1 %83, label %84, label %86
84: ; preds = %68
%85 = call i32 @perror(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %102
86: ; preds = %68
%87 = load i32*, i32** %14
%88 = getelementptr inbounds [2000 x i8], [2000 x i8]* %9, i64 0, i64 0
%89 = call i64 @SSL_read(i32* %87, i8* %88, i32 2000)
%90 = icmp slt i64 %89, 0
br i1 %90, label %91, label %93
91: ; preds = %86
%92 = call i32 @perror(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %3
br label %102
93: ; preds = %86
%94 = getelementptr inbounds [2000 x i8], [2000 x i8]* %9, i64 0, i64 0
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8* %94)
%96 = load i32*, i32** %14
%97 = call i32 @SSL_free(i32* %96)
%98 = load i32, i32* %6
%99 = call i32 @close(i32 %98)
%100 = load i32*, i32** %13
%101 = call i32 @SSL_CTX_free(i32* %100)
store i32 0, i32* %3
br label %102
102: ; preds = %93, %91, %84, %66, %41, %33, %24
%103 = load i32, i32* %3
ret i32 %103
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i32, i64 }
%struct.sockaddr = type { i32 }
@.str = [48 x i8] c"GET / HTTP/1.1\0D\0AHost: %s\0D\0AConnection: close\0D\0A\0D\0A\00"
@.str.1 = [24 x i8] c"Sending the message: %s\00"
@.str.3 = [53 x i8] c"Socket Client: error - unable to resolve host name.\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.4 = [51 x i8] c"Socket Client: error opening TCP IP-based socket.\0A\00"
@.str.5 = [48 x i8] c"Socket Client: error connecting to the server.\0A\00"
@.str.6 = [47 x i8] c"Socket Client: error writing to the SSl socket\00"
@.str.7 = [49 x i8] c"Socket Client: error reading from the SSL socket\00"
@.str.8 = [22 x i8] c"**START**\0A%s\0A**END**\0A\00"
@str = [47 x i8] c"Incorrect usage, use: ./webbrowserSSL hostname\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2000 x i8]
%4 = alloca [255 x i8]
%5 = alloca %struct.sockaddr_in
%6 = getelementptr inbounds [2000 x i8], [2000 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%8 = bitcast %struct.sockaddr_in* %5 to i8*
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%13 = icmp slt i32 %0, 2
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
br label %67
16: ; preds = %2
%17 = load i8*, i8** %9
%18 = call %struct.hostent* @gethostbyname(i8* %17)
%19 = icmp eq %struct.hostent* %18, null
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @perror(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
br label %67
22: ; preds = %16
%23 = load i32, i32* @AF_INET
%24 = load i32, i32* @SOCK_STREAM
%25 = call i32 @socket(i32 %23, i32 %24, i32 0)
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = call i32 @perror(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
br label %67
29: ; preds = %22
%30 = call i32 @bzero(i8* %8, i32 12)
%31 = load i32, i32* @AF_INET
%32 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 2
store i32 %31, i32* %32
%33 = call i32 @htons(i32 443)
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 1
store i32 %33, i32* %34
%35 = getelementptr inbounds %struct.hostent, %struct.hostent* %18, i64 0, i32 1
%36 = load i64, i64* %35
%37 = inttoptr i64 %36 to i8*
%38 = getelementptr inbounds %struct.hostent, %struct.hostent* %18, i64 0, i32 0
%39 = load i32, i32* %38
%40 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%41 = call i64 @connect(i32 %25, %struct.sockaddr* %40, i32 12)
%42 = icmp slt i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %29
%44 = call i32 @perror(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0))
br label %67
45: ; preds = %29
%46 = call i32 (...) @SSL_load_error_strings()
%47 = call i32 (...) @SSL_library_init()
%48 = call i32 (...) @SSLv23_client_method()
%49 = call i32* @SSL_CTX_new(i32 %48)
%50 = call i32* @SSL_new(i32* %49)
%51 = call i32 @SSL_set_fd(i32* %50, i32 %25)
%52 = call i32 @SSL_connect(i32* %50)
%53 = call i64 @SSL_write(i32* %50, i8* %7, i32 255)
%54 = icmp slt i64 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %45
%56 = call i32 @perror(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
br label %67
57: ; preds = %45
%58 = call i64 @SSL_read(i32* %50, i8* %6, i32 2000)
%59 = icmp slt i64 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %57
%61 = call i32 @perror(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0))
br label %67
62: ; preds = %57
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8* %6)
%64 = call i32 @SSL_free(i32* %50)
%65 = call i32 @close(i32 %25)
%66 = call i32 @SSL_CTX_free(i32* %49)
br label %67
67: ; preds = %55, %60, %62, %43, %27, %20, %14
%68 = phi i32 [ 2, %14 ], [ 1, %20 ], [ 1, %27 ], [ 1, %43 ], [ 1, %55 ], [ 1, %60 ], [ 0, %62 ]
ret i32 %68
}