#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\n\r\n", argv[1]);
  printf("Starting EBB SSL Web Browser C Example\n");
  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);
  printf("End of EBB SSL Socket Example\n");
  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    0xd92(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x8f0(%rbp),%rsi
lea    0xda5(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jg     12cb <main+0x7b>
lea    0xda5(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    14dd <main+0x28d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <gethostbyname@plt>
mov    %rax,-0x908(%rbp)
cmpq   $0x0,-0x908(%rbp)
jne    1305 <main+0xb5>
lea    0xd99(%rip),%rdi
call   1130 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14dd <main+0x28d>
mov    0x2cdc(%rip),%rax
mov    (%rax),%edi
mov    0x2cc3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1170 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1343 <main+0xf3>
lea    0xd90(%rip),%rdi
call   1130 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14dd <main+0x28d>
lea    -0x900(%rbp),%rdi
mov    $0xc,%esi
call   1140 <bzero@plt>
movl   $0x1bb,-0x18(%rbp)
mov    0x2c86(%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    13ce <main+0x17e>
lea    0xd38(%rip),%rdi
call   1130 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14dd <main+0x28d>
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    1459 <main+0x209>
lea    0xcdd(%rip),%rdi
call   1130 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14dd <main+0x28d>
mov    -0x918(%rbp),%rdi
lea    -0x7f0(%rbp),%rsi
mov    $0x7d0,%edx
call   10b0 <SSL_read@plt>
cmp    $0x0,%rax
jge    1493 <main+0x243>
lea    0xcd2(%rip),%rdi
call   1130 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14dd <main+0x28d>
lea    -0x7f0(%rbp),%rsi
lea    0xce4(%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>
lea    0xccc(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@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    0xeb2(%rip),%rdi
call   1050 <puts@plt>
lea    0xd80(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
cmp    $0x1,%ebp
jg     12c2 <main+0x62>
lea    0xed5(%rip),%rdi
call   1050 <puts@plt>
mov    $0x2,%ebp
jmp    1429 <main+0x1c9>
mov    0x8(%rbx),%rdi
call   10e0 <gethostbyname@plt>
test   %rax,%rax
je     13f4 <main+0x194>
mov    %rax,%rbx
mov    0x2d0a(%rip),%r14
mov    (%r14),%edi
mov    0x2cf0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1180 <socket@plt>
test   %eax,%eax
js     13fd <main+0x19d>
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     1406 <main+0x1a6>
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     140f <main+0x1af>
lea    0x110(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x7d0,%edx
call   10c0 <SSL_read@plt>
test   %rax,%rax
js     1418 <main+0x1b8>
lea    0xd70(%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>
lea    0xd7d(%rip),%rdi
call   1050 <puts@plt>
jmp    1429 <main+0x1c9>
lea    0xc3a(%rip),%rdi
jmp    141f <main+0x1bf>
lea    0xc66(%rip),%rdi
jmp    141f <main+0x1bf>
lea    0xc90(%rip),%rdi
jmp    141f <main+0x1bf>
lea    0xcb7(%rip),%rdi
jmp    141f <main+0x1bf>
lea    0xcdd(%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 = [29 x i8] c"GET / HTTP/1.1\0D\0AHost: %s\0D\0A\0D\0A\00"
@.str.1 = [40 x i8] c"Starting EBB SSL Web Browser C Example\0A\00"
@.str.2 = [24 x i8] c"Sending the message: %s\00"
@.str.3 = [48 x i8] c"Incorrect usage, use: ./webBrowserSSL hostname\0A\00"
@.str.4 = [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.5 = [51 x i8] c"Socket Client: error opening TCP IP-based socket.\0A\00"
@.str.6 = [48 x i8] c"Socket Client: error connecting to the server.\0A\00"
@.str.7 = [47 x i8] c"Socket Client: error writing to the SSl socket\00"
@.str.8 = [49 x i8] c"Socket Client: error reading from the SSL socket\00"
@.str.9 = [22 x i8] c"**START**\0A%s\0A**END**\0A\00"
@.str.10 = [31 x i8] c"End of EBB SSL Socket Example\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 ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%21 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %21)
%23 = load i32, i32* %4
%24 = icmp sle i32 %23, 1
br i1 %24, label %25, label %27
25: ; preds = %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
store i32 2, i32* %3
br label %104
27: ; preds = %2
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call %struct.hostent* @gethostbyname(i8* %30)
store %struct.hostent* %31, %struct.hostent** %12
%32 = load %struct.hostent*, %struct.hostent** %12
%33 = icmp eq %struct.hostent* %32, null
br i1 %33, label %34, label %36
34: ; preds = %27
%35 = call i32 @perror(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %104
36: ; preds = %27
%37 = load i32, i32* @AF_INET
%38 = load i32, i32* @SOCK_STREAM
%39 = call i32 @socket(i32 %37, i32 %38, i32 0)
store i32 %39, i32* %6
%40 = load i32, i32* %6
%41 = icmp slt i32 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %36
%43 = call i32 @perror(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %3
br label %104
44: ; preds = %36
%45 = bitcast %struct.sockaddr_in* %11 to i8*
%46 = call i32 @bzero(i8* %45, i32 12)
store i32 443, i32* %7
%47 = load i32, i32* @AF_INET
%48 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 2
store i32 %47, i32* %48
%49 = load i32, i32* %7
%50 = call i32 @htons(i32 %49)
%51 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 1
store i32 %50, i32* %51
%52 = load %struct.hostent*, %struct.hostent** %12
%53 = getelementptr inbounds %struct.hostent, %struct.hostent* %52, i32 0, i32 1
%54 = load i64, i64* %53
%55 = inttoptr i64 %54 to i8*
%56 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
%57 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %56, i32 0, i32 0
%58 = bitcast i32* %57 to i8*
%59 = load %struct.hostent*, %struct.hostent** %12
%60 = getelementptr inbounds %struct.hostent, %struct.hostent* %59, i32 0, i32 0
%61 = load i32, i32* %60
%62 = call i32 @bcopy(i8* %55, i8* %58, i32 %61)
%63 = load i32, i32* %6
%64 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%65 = call i64 @connect(i32 %63, %struct.sockaddr* %64, i32 12)
%66 = icmp slt i64 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %44
%68 = call i32 @perror(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %104
69: ; preds = %44
%70 = call i32 (...) @SSL_load_error_strings()
%71 = call i32 (...) @SSL_library_init()
%72 = call i32 (...) @SSLv23_client_method()
%73 = call i32* @SSL_CTX_new(i32 %72)
store i32* %73, i32** %13
%74 = load i32*, i32** %13
%75 = call i32* @SSL_new(i32* %74)
store i32* %75, i32** %14
%76 = load i32*, i32** %14
%77 = load i32, i32* %6
%78 = call i32 @SSL_set_fd(i32* %76, i32 %77)
%79 = load i32*, i32** %14
%80 = call i32 @SSL_connect(i32* %79)
%81 = load i32*, i32** %14
%82 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 0
%83 = call i64 @SSL_write(i32* %81, i8* %82, i32 255)
%84 = icmp slt i64 %83, 0
br i1 %84, label %85, label %87
85: ; preds = %69
%86 = call i32 @perror(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %3
br label %104
87: ; preds = %69
%88 = load i32*, i32** %14
%89 = getelementptr inbounds [2000 x i8], [2000 x i8]* %9, i64 0, i64 0
%90 = call i64 @SSL_read(i32* %88, i8* %89, i32 2000)
%91 = icmp slt i64 %90, 0
br i1 %91, label %92, label %94
92: ; preds = %87
%93 = call i32 @perror(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %3
br label %104
94: ; preds = %87
%95 = getelementptr inbounds [2000 x i8], [2000 x i8]* %9, i64 0, i64 0
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i8* %95)
%97 = load i32*, i32** %14
%98 = call i32 @SSL_free(i32* %97)
%99 = load i32, i32* %6
%100 = call i32 @close(i32 %99)
%101 = load i32*, i32** %13
%102 = call i32 @SSL_CTX_free(i32* %101)
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %3
br label %104
104: ; preds = %94, %92, %85, %67, %42, %34, %25
%105 = load i32, i32* %3
ret i32 %105
}

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