; LLVM IR from gost-engine/engine :: test_tls (test)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.certkey = type { ptr, ptr }

@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [34 x i8], align 1
@verbose = external hidden global i32, align 4
@.str.13 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [14 x i8], align 1
@stdout = external global ptr, align 8
@.str.21 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [56 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @test(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %struct.certkey, align 8
  %7 = alloca %struct.certkey, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = alloca i64, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca [512 x i8], align 16
  %22 = alloca [512 x i8], align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !9
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef %23)
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %30

27:                                               ; preds = %2
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %28)
  br label %30

30:                                               ; preds = %27, %2
  %31 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #7
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = call { ptr, ptr } @certgen(ptr noundef %32, ptr noundef %33)
  %35 = getelementptr inbounds { ptr, ptr }, ptr %7, i32 0, i32 0
  %36 = extractvalue { ptr, ptr } %34, 0
  store ptr %36, ptr %35, align 8
  %37 = getelementptr inbounds { ptr, ptr }, ptr %7, i32 0, i32 1
  %38 = extractvalue { ptr, ptr } %34, 1
  store ptr %38, ptr %37, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %39 = call ptr @TLS_server_method()
  %40 = call ptr @SSL_CTX_new(ptr noundef %39)
  store ptr %40, ptr %9, align 8, !tbaa !5
  %41 = icmp ne ptr %40, null
  br i1 %41, label %44, label %42

42:                                               ; preds = %30
  %43 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %43)
  call void @OPENSSL_die(ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 171) #8
  unreachable

44:                                               ; preds = %30
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.certkey, ptr %6, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !12
  %48 = call i32 @SSL_CTX_use_certificate(ptr noundef %45, ptr noundef %47)
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %52, label %50

50:                                               ; preds = %44
  %51 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %51)
  call void @OPENSSL_die(ptr noundef @.str.5, ptr noundef @.str.4, i32 noundef 172) #8
  unreachable

52:                                               ; preds = %44
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.certkey, ptr %6, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8, !tbaa !14
  %56 = call i32 @SSL_CTX_use_PrivateKey(ptr noundef %53, ptr noundef %55)
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %60, label %58

58:                                               ; preds = %52
  %59 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %59)
  call void @OPENSSL_die(ptr noundef @.str.6, ptr noundef @.str.4, i32 noundef 173) #8
  unreachable

60:                                               ; preds = %52
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = call i32 @SSL_CTX_check_private_key(ptr noundef %61)
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %66, label %64

64:                                               ; preds = %60
  %65 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %65)
  call void @OPENSSL_die(ptr noundef @.str.7, ptr noundef @.str.4, i32 noundef 174) #8
  unreachable

66:                                               ; preds = %60
  %67 = call ptr @TLS_client_method()
  %68 = call ptr @SSL_CTX_new(ptr noundef %67)
  store ptr %68, ptr %8, align 8, !tbaa !5
  %69 = icmp ne ptr %68, null
  br i1 %69, label %72, label %70

70:                                               ; preds = %66
  %71 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %71)
  call void @OPENSSL_die(ptr noundef @.str.8, ptr noundef @.str.4, i32 noundef 176) #8
  unreachable

72:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = call ptr @SSL_new(ptr noundef %73)
  store ptr %74, ptr %10, align 8, !tbaa !5
  %75 = icmp ne ptr %74, null
  br i1 %75, label %78, label %76

76:                                               ; preds = %72
  %77 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %77)
  call void @OPENSSL_die(ptr noundef @.str.9, ptr noundef @.str.4, i32 noundef 180) #8
  unreachable

78:                                               ; preds = %72
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = call ptr @SSL_new(ptr noundef %79)
  store ptr %80, ptr %11, align 8, !tbaa !5
  %81 = icmp ne ptr %80, null
  br i1 %81, label %84, label %82

82:                                               ; preds = %78
  %83 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %83)
  call void @OPENSSL_die(ptr noundef @.str.10, ptr noundef @.str.4, i32 noundef 181) #8
  unreachable

84:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %85 = call ptr @BIO_s_mem()
  %86 = call ptr @BIO_new(ptr noundef %85)
  store ptr %86, ptr %12, align 8, !tbaa !5
  %87 = icmp ne ptr %86, null
  br i1 %87, label %90, label %88

88:                                               ; preds = %84
  %89 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %89)
  call void @OPENSSL_die(ptr noundef @.str.11, ptr noundef @.str.4, i32 noundef 183) #8
  unreachable

90:                                               ; preds = %84
  %91 = call ptr @BIO_s_mem()
  %92 = call ptr @BIO_new(ptr noundef %91)
  store ptr %92, ptr %13, align 8, !tbaa !5
  %93 = icmp ne ptr %92, null
  br i1 %93, label %96, label %94

94:                                               ; preds = %90
  %95 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %95)
  call void @OPENSSL_die(ptr noundef @.str.12, ptr noundef @.str.4, i32 noundef 184) #8
  unreachable

96:                                               ; preds = %90
  %97 = load ptr, ptr %12, align 8, !tbaa !5
  %98 = call i64 @BIO_ctrl(ptr noundef %97, i32 noundef 130, i64 noundef -1, ptr noundef null)
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = call i64 @BIO_ctrl(ptr noundef %99, i32 noundef 130, i64 noundef -1, ptr noundef null)
  %101 = load ptr, ptr %10, align 8, !tbaa !5
  %102 = load ptr, ptr %13, align 8, !tbaa !5
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  call void @SSL_set_bio(ptr noundef %101, ptr noundef %102, ptr noundef %103)
  %104 = load ptr, ptr %12, align 8, !tbaa !5
  %105 = call i32 @BIO_up_ref(ptr noundef %104)
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = call i32 @BIO_up_ref(ptr noundef %106)
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  %109 = load ptr, ptr %12, align 8, !tbaa !5
  %110 = load ptr, ptr %13, align 8, !tbaa !5
  call void @SSL_set_bio(ptr noundef %108, ptr noundef %109, ptr noundef %110)
  store ptr null, ptr %13, align 8, !tbaa !5
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 -1, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 -1, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  br label %111

111:                                              ; preds = %189, %96
  store i32 3, ptr %16, align 4, !tbaa !9
  br label %112

112:                                              ; preds = %136, %111
  %113 = load i32, ptr %14, align 4, !tbaa !9
  %114 = icmp sle i32 %113, 0
  br i1 %114, label %115, label %118

115:                                              ; preds = %112
  %116 = load i32, ptr %16, align 4, !tbaa !9
  %117 = icmp eq i32 %116, 3
  br label %118

118:                                              ; preds = %115, %112
  %119 = phi i1 [ false, %112 ], [ %117, %115 ]
  br i1 %119, label %120, label %137

120:                                              ; preds = %118
  %121 = load ptr, ptr %11, align 8, !tbaa !5
  %122 = call i32 @SSL_connect(ptr noundef %121)
  store i32 %122, ptr %14, align 4, !tbaa !9
  %123 = load i32, ptr %14, align 4, !tbaa !9
  %124 = icmp sle i32 %123, 0
  br i1 %124, label %125, label %129

125:                                              ; preds = %120
  %126 = load ptr, ptr %11, align 8, !tbaa !5
  %127 = load i32, ptr %14, align 4, !tbaa !9
  %128 = call i32 @SSL_get_error(ptr noundef %126, i32 noundef %127)
  store i32 %128, ptr %16, align 4, !tbaa !9
  br label %129

129:                                              ; preds = %125, %120
  %130 = load i32, ptr @verbose, align 4, !tbaa !9
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %136

132:                                              ; preds = %129
  %133 = load i32, ptr %14, align 4, !tbaa !9
  %134 = load i32, ptr %16, align 4, !tbaa !9
  %135 = call i32 (ptr, ...) @printf(ptr noundef @.str.13, i32 noundef %133, i32 noundef %134)
  br label %136

136:                                              ; preds = %132, %129
  br label %112, !llvm.loop !15

137:                                              ; preds = %118
  %138 = load i32, ptr %14, align 4, !tbaa !9
  %139 = icmp sle i32 %138, 0
  br i1 %139, label %140, label %145

140:                                              ; preds = %137
  %141 = load i32, ptr %16, align 4, !tbaa !9
  %142 = icmp ne i32 %141, 2
  br i1 %142, label %143, label %145

143:                                              ; preds = %140
  %144 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %144)
  call void @OPENSSL_die(ptr noundef @.str.14, ptr noundef @.str.4, i32 noundef 209) #8
  unreachable

145:                                              ; preds = %140, %137
  store i32 3, ptr %16, align 4, !tbaa !9
  br label %146

146:                                              ; preds = %170, %145
  %147 = load i32, ptr %15, align 4, !tbaa !9
  %148 = icmp sle i32 %147, 0
  br i1 %148, label %149, label %152

149:                                              ; preds = %146
  %150 = load i32, ptr %16, align 4, !tbaa !9
  %151 = icmp eq i32 %150, 3
  br label %152

152:                                              ; preds = %149, %146
  %153 = phi i1 [ false, %146 ], [ %151, %149 ]
  br i1 %153, label %154, label %171

154:                                              ; preds = %152
  %155 = load ptr, ptr %10, align 8, !tbaa !5
  %156 = call i32 @SSL_accept(ptr noundef %155)
  store i32 %156, ptr %15, align 4, !tbaa !9
  %157 = load i32, ptr %15, align 4, !tbaa !9
  %158 = icmp sle i32 %157, 0
  br i1 %158, label %159, label %163

159:                                              ; preds = %154
  %160 = load ptr, ptr %10, align 8, !tbaa !5
  %161 = load i32, ptr %15, align 4, !tbaa !9
  %162 = call i32 @SSL_get_error(ptr noundef %160, i32 noundef %161)
  store i32 %162, ptr %16, align 4, !tbaa !9
  br label %163

163:                                              ; preds = %159, %154
  %164 = load i32, ptr @verbose, align 4, !tbaa !9
  %165 = icmp ne i32 %164, 0
  br i1 %165, label %166, label %170

166:                                              ; preds = %163
  %167 = load i32, ptr %15, align 4, !tbaa !9
  %168 = load i32, ptr %16, align 4, !tbaa !9
  %169 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef %167, i32 noundef %168)
  br label %170

170:                                              ; preds = %166, %163
  br label %146, !llvm.loop !17

171:                                              ; preds = %152
  %172 = load i32, ptr %15, align 4, !tbaa !9
  %173 = icmp sle i32 %172, 0
  br i1 %173, label %174, label %182

174:                                              ; preds = %171
  %175 = load i32, ptr %16, align 4, !tbaa !9
  %176 = icmp ne i32 %175, 2
  br i1 %176, label %177, label %182

177:                                              ; preds = %174
  %178 = load i32, ptr %16, align 4, !tbaa !9
  %179 = icmp ne i32 %178, 4
  br i1 %179, label %180, label %182

180:                                              ; preds = %177
  %181 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %181)
  call void @OPENSSL_die(ptr noundef @.str.16, ptr noundef @.str.4, i32 noundef 222) #8
  unreachable

182:                                              ; preds = %177, %174, %171
  br label %183

183:                                              ; preds = %182
  %184 = load i32, ptr %14, align 4, !tbaa !9
  %185 = icmp sle i32 %184, 0
  br i1 %185, label %189, label %186

186:                                              ; preds = %183
  %187 = load i32, ptr %15, align 4, !tbaa !9
  %188 = icmp sle i32 %187, 0
  br label %189

189:                                              ; preds = %186, %183
  %190 = phi i1 [ true, %183 ], [ %188, %186 ]
  br i1 %190, label %111, label %191, !llvm.loop !18

191:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %192 = load ptr, ptr %11, align 8, !tbaa !5
  %193 = call i32 @SSL_read_ex(ptr noundef %192, ptr noundef %17, i64 noundef 1, ptr noundef %18)
  %194 = icmp ne i32 %193, 0
  br i1 %194, label %195, label %197

195:                                              ; preds = %191
  %196 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %196)
  call void @OPENSSL_die(ptr noundef @.str.17, ptr noundef @.str.4, i32 noundef 229) #8
  unreachable

197:                                              ; preds = %191
  %198 = load ptr, ptr %11, align 8, !tbaa !5
  %199 = call i32 @SSL_read_ex(ptr noundef %198, ptr noundef %17, i64 noundef 1, ptr noundef %18)
  %200 = icmp ne i32 %199, 0
  br i1 %200, label %201, label %203

201:                                              ; preds = %197
  %202 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %202)
  call void @OPENSSL_die(ptr noundef @.str.17, ptr noundef @.str.4, i32 noundef 230) #8
  unreachable

203:                                              ; preds = %197
  %204 = load ptr, ptr %11, align 8, !tbaa !5
  %205 = call i32 @SSL_do_handshake(ptr noundef %204)
  %206 = icmp eq i32 %205, 1
  br i1 %206, label %209, label %207

207:                                              ; preds = %203
  %208 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %208)
  call void @OPENSSL_die(ptr noundef @.str.18, ptr noundef @.str.4, i32 noundef 233) #8
  unreachable

209:                                              ; preds = %203
  %210 = load ptr, ptr %11, align 8, !tbaa !5
  %211 = call ptr @SSL_get_version(ptr noundef %210)
  %212 = call i32 (ptr, ...) @printf(ptr noundef @.str.19, ptr noundef %211)
  %213 = load ptr, ptr %11, align 8, !tbaa !5
  %214 = call ptr @SSL_get_current_cipher(ptr noundef %213)
  %215 = call ptr @SSL_CIPHER_get_name(ptr noundef %214)
  %216 = call i32 (ptr, ...) @printf(ptr noundef @.str.20, ptr noundef %215)
  %217 = load i32, ptr @verbose, align 4, !tbaa !9
  %218 = icmp ne i32 %217, 0
  br i1 %218, label %219, label %225

219:                                              ; preds = %209
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %220 = load ptr, ptr %11, align 8, !tbaa !5
  %221 = call ptr @SSL_get_session(ptr noundef %220)
  store ptr %221, ptr %19, align 8, !tbaa !5
  %222 = load ptr, ptr @stdout, align 8, !tbaa !5
  %223 = load ptr, ptr %19, align 8, !tbaa !5
  %224 = call i32 @SSL_SESSION_print_fp(ptr noundef %222, ptr noundef %223)
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %225

225:                                              ; preds = %219, %209
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %226

226:                                              ; preds = %284, %225
  %227 = load i32, ptr %20, align 4, !tbaa !9
  %228 = icmp slt i32 %227, 16
  br i1 %228, label %229, label %287

229:                                              ; preds = %226
  call void @llvm.lifetime.start.p0(i64 512, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 512, ptr %22) #7
  %230 = getelementptr inbounds [512 x i8], ptr %21, i64 0, i64 0
  %231 = load i32, ptr %20, align 4, !tbaa !9
  %232 = add nsw i32 99, %231
  %233 = trunc i32 %232 to i8
  call void @llvm.memset.p0.i64(ptr align 16 %230, i8 %233, i64 512, i1 false)
  %234 = load ptr, ptr %10, align 8, !tbaa !5
  %235 = getelementptr inbounds [512 x i8], ptr %21, i64 0, i64 0
  %236 = call i32 @SSL_write(ptr noundef %234, ptr noundef %235, i32 noundef 512)
  %237 = sext i32 %236 to i64
  %238 = icmp eq i64 %237, 512
  br i1 %238, label %241, label %239

239:                                              ; preds = %229
  %240 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %240)
  call void @OPENSSL_die(ptr noundef @.str.21, ptr noundef @.str.4, i32 noundef 247) #8
  unreachable

241:                                              ; preds = %229
  %242 = load ptr, ptr %11, align 8, !tbaa !5
  %243 = getelementptr inbounds [512 x i8], ptr %22, i64 0, i64 0
  %244 = call i32 @SSL_read(ptr noundef %242, ptr noundef %243, i32 noundef 512)
  %245 = sext i32 %244 to i64
  %246 = icmp eq i64 %245, 512
  br i1 %246, label %249, label %247

247:                                              ; preds = %241
  %248 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %248)
  call void @OPENSSL_die(ptr noundef @.str.22, ptr noundef @.str.4, i32 noundef 248) #8
  unreachable

249:                                              ; preds = %241
  %250 = getelementptr inbounds [512 x i8], ptr %21, i64 0, i64 0
  %251 = getelementptr inbounds [512 x i8], ptr %22, i64 0, i64 0
  %252 = call i32 @memcmp(ptr noundef %250, ptr noundef %251, i64 noundef 512) #9
  %253 = icmp eq i32 %252, 0
  br i1 %253, label %256, label %254

254:                                              ; preds = %249
  %255 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %255)
  call void @OPENSSL_die(ptr noundef @.str.23, ptr noundef @.str.4, i32 noundef 249) #8
  unreachable

256:                                              ; preds = %249
  %257 = getelementptr inbounds [512 x i8], ptr %22, i64 0, i64 0
  %258 = load i32, ptr %20, align 4, !tbaa !9
  %259 = add nsw i32 115, %258
  %260 = trunc i32 %259 to i8
  call void @llvm.memset.p0.i64(ptr align 16 %257, i8 %260, i64 512, i1 false)
  %261 = load ptr, ptr %11, align 8, !tbaa !5
  %262 = getelementptr inbounds [512 x i8], ptr %22, i64 0, i64 0
  %263 = call i32 @SSL_write(ptr noundef %261, ptr noundef %262, i32 noundef 512)
  %264 = sext i32 %263 to i64
  %265 = icmp eq i64 %264, 512
  br i1 %265, label %268, label %266

266:                                              ; preds = %256
  %267 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %267)
  call void @OPENSSL_die(ptr noundef @.str.24, ptr noundef @.str.4, i32 noundef 252) #8
  unreachable

268:                                              ; preds = %256
  %269 = load ptr, ptr %10, align 8, !tbaa !5
  %270 = getelementptr inbounds [512 x i8], ptr %21, i64 0, i64 0
  %271 = call i32 @SSL_read(ptr noundef %269, ptr noundef %270, i32 noundef 512)
  %272 = sext i32 %271 to i64
  %273 = icmp eq i64 %272, 512
  br i1 %273, label %276, label %274

274:                                              ; preds = %268
  %275 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %275)
  call void @OPENSSL_die(ptr noundef @.str.25, ptr noundef @.str.4, i32 noundef 253) #8
  unreachable

276:                                              ; preds = %268
  %277 = getelementptr inbounds [512 x i8], ptr %21, i64 0, i64 0
  %278 = getelementptr inbounds [512 x i8], ptr %22, i64 0, i64 0
  %279 = call i32 @memcmp(ptr noundef %277, ptr noundef %278, i64 noundef 512) #9
  %280 = icmp eq i32 %279, 0
  br i1 %280, label %283, label %281

281:                                              ; preds = %276
  %282 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %282)
  call void @OPENSSL_die(ptr noundef @.str.23, ptr noundef @.str.4, i32 noundef 254) #8
  unreachable

283:                                              ; preds = %276
  call void @llvm.lifetime.end.p0(i64 512, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr %21) #7
  br label %284

284:                                              ; preds = %283
  %285 = load i32, ptr %20, align 4, !tbaa !9
  %286 = add nsw i32 %285, 1
  store i32 %286, ptr %20, align 4, !tbaa !9
  br label %226, !llvm.loop !19

287:                                              ; preds = %226
  %288 = load ptr, ptr %11, align 8, !tbaa !5
  %289 = call i32 @SSL_shutdown(ptr noundef %288)
  %290 = load ptr, ptr %10, align 8, !tbaa !5
  %291 = call i32 @SSL_shutdown(ptr noundef %290)
  %292 = load ptr, ptr %10, align 8, !tbaa !5
  call void @SSL_free(ptr noundef %292)
  %293 = load ptr, ptr %11, align 8, !tbaa !5
  call void @SSL_free(ptr noundef %293)
  %294 = load ptr, ptr %9, align 8, !tbaa !5
  call void @SSL_CTX_free(ptr noundef %294)
  %295 = load ptr, ptr %8, align 8, !tbaa !5
  call void @SSL_CTX_free(ptr noundef %295)
  %296 = getelementptr inbounds %struct.certkey, ptr %6, i32 0, i32 1
  %297 = load ptr, ptr %296, align 8, !tbaa !12
  call void @X509_free(ptr noundef %297)
  %298 = getelementptr inbounds %struct.certkey, ptr %6, i32 0, i32 0
  %299 = load ptr, ptr %298, align 8, !tbaa !14
  call void @EVP_PKEY_free(ptr noundef %299)
  %300 = load i32, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  ret i32 %300
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare hidden { ptr, ptr } @certgen(ptr noundef, ptr noundef) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare ptr @SSL_CTX_new(ptr noundef) #2

declare ptr @TLS_server_method() #2

declare void @ERR_print_errors_fp(ptr noundef) #2

; Function Attrs: noreturn
declare void @OPENSSL_die(ptr noundef, ptr noundef, i32 noundef) #4

declare i32 @SSL_CTX_use_certificate(ptr noundef, ptr noundef) #2

declare i32 @SSL_CTX_use_PrivateKey(ptr noundef, ptr noundef) #2

declare i32 @SSL_CTX_check_private_key(ptr noundef) #2

declare ptr @TLS_client_method() #2

declare ptr @SSL_new(ptr noundef) #2

declare ptr @BIO_new(ptr noundef) #2

declare ptr @BIO_s_mem() #2

declare i64 @BIO_ctrl(ptr noundef, i32 noundef, i64 noundef, ptr noundef) #2

declare void @SSL_set_bio(ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @BIO_up_ref(ptr noundef) #2

declare i32 @SSL_connect(ptr noundef) #2

declare i32 @SSL_get_error(ptr noundef, i32 noundef) #2

declare i32 @SSL_accept(ptr noundef) #2

declare i32 @SSL_read_ex(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #2

declare i32 @SSL_do_handshake(ptr noundef) #2

declare ptr @SSL_get_version(ptr noundef) #2

declare ptr @SSL_CIPHER_get_name(ptr noundef) #2

declare ptr @SSL_get_current_cipher(ptr noundef) #2

declare ptr @SSL_get_session(ptr noundef) #2

declare i32 @SSL_SESSION_print_fp(ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

declare i32 @SSL_write(ptr noundef, ptr noundef, i32 noundef) #2

declare i32 @SSL_read(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #6

declare i32 @SSL_shutdown(ptr noundef) #2

declare void @SSL_free(ptr noundef) #2

declare void @SSL_CTX_free(ptr noundef) #2

declare void @X509_free(ptr noundef) #2

declare void @EVP_PKEY_free(ptr noundef) #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { noreturn }
attributes #9 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!12 = !{!13, !6, i64 8}
!13 = !{!"certkey", !6, i64 0, !6, i64 8}
!14 = !{!13, !6, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [34 x i8], align 1
@verbose = external hidden local_unnamed_addr global i32, align 4
@.str.13 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [14 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.21 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [56 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @test(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca i8, align 1
  %4 = alloca i64, align 8
  %5 = alloca [512 x i8], align 16
  %6 = alloca [512 x i8], align 16
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %0)
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %10, label %8

8:                                                ; preds = %2
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %1)
  br label %10

10:                                               ; preds = %8, %2
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %12 = tail call { ptr, ptr } @certgen(ptr noundef %0, ptr noundef %1)
  %13 = extractvalue { ptr, ptr } %12, 0
  %14 = extractvalue { ptr, ptr } %12, 1
  %15 = tail call ptr @TLS_server_method() #7
  %16 = tail call ptr @SSL_CTX_new(ptr noundef %15) #7
  %.not86 = icmp eq ptr %16, null
  br i1 %.not86, label %17, label %19

17:                                               ; preds = %10
  %18 = load ptr, ptr @stderr, align 8, !tbaa !5
  tail call void @ERR_print_errors_fp(ptr noundef %18) #7
  tail call void @OPENSSL_die(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef 171) #8
  unreachable

19:                                               ; preds = %10
  %20 = tail call i32 @SSL_CTX_use_certificate(ptr noundef nonnull %16, ptr noundef %14) #7
  %.not87 = icmp eq i32 %20, 0
  br i1 %.not87, label %21, label %23

21:                                               ; preds = %19
  %22 = load ptr, ptr @stderr, align 8, !tbaa !5
  tail call void @ERR_print_errors_fp(ptr noundef %22) #7
  tail call void @OPENSSL_die(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.4, i32 noundef 172) #8
  unreachable

23:                                               ; preds = %19
  %24 = tail call i32 @SSL_CTX_use_PrivateKey(ptr noundef nonnull %16, ptr noundef %13) #7
  %.not88 = icmp eq i32 %24, 0
  br i1 %.not88, label %25, label %27

25:                                               ; preds = %23
  %26 = load ptr, ptr @stderr, align 8, !tbaa !5
  tail call void @ERR_print_errors_fp(ptr noundef %26) #7
  tail call void @OPENSSL_die(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.4, i32 noundef 173) #8
  unreachable

27:                                               ; preds = %23
  %28 = tail call i32 @SSL_CTX_check_private_key(ptr noundef nonnull %16) #7
  %.not89 = icmp eq i32 %28, 0
  br i1 %.not89, label %29, label %31

29:                                               ; preds = %27
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  tail call void @ERR_print_errors_fp(ptr noundef %30) #7
  tail call void @OPENSSL_die(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.4, i32 noundef 174) #8
  unreachable

31:                                               ; preds = %27
  %32 = tail call ptr @TLS_client_method() #7
  %33 = tail call ptr @SSL_CTX_new(ptr noundef %32) #7
  %.not90 = icmp eq ptr %33, null
  br i1 %.not90, label %34, label %36

34:                                               ; preds = %31
  %35 = load ptr, ptr @stderr, align 8, !tbaa !5
  tail call void @ERR_print_errors_fp(ptr noundef %35) #7
  tail call void @OPENSSL_die(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.4, i32 noundef 176) #8
  unreachable

36:                                               ; preds = %31
  %37 = tail call ptr @SSL_new(ptr noundef nonnull %16) #7
  %.not91 = icmp eq ptr %37, null
  br i1 %.not91, label %38, label %40

38:                                               ; preds = %36
  %39 = load ptr, ptr @stderr, align 8, !tbaa !5
  tail call void @ERR_print_errors_fp(ptr noundef %39) #7
  tail call void @OPENSSL_die(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.4, i32 noundef 180) #8
  unreachable

40:                                               ; preds = %36
  %41 = tail call ptr @SSL_new(ptr noundef nonnull %33) #7
  %.not92 = icmp eq ptr %41, null
  br i1 %.not92, label %42, label %44

42:                                               ; preds = %40
  %43 = load ptr, ptr @stderr, align 8, !tbaa !5
  tail call void @ERR_print_errors_fp(ptr noundef %43) #7
  tail call void @OPENSSL_die(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.4, i32 noundef 181) #8
  unreachable

44:                                               ; preds = %40
  %45 = tail call ptr @BIO_s_mem() #7
  %46 = tail call ptr @BIO_new(ptr noundef %45) #7
  %.not93 = icmp eq ptr %46, null
  br i1 %.not93, label %47, label %49

47:                                               ; preds = %44
  %48 = load ptr, ptr @stderr, align 8, !tbaa !5
  tail call void @ERR_print_errors_fp(ptr noundef %48) #7
  tail call void @OPENSSL_die(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.4, i32 noundef 183) #8
  unreachable

49:                                               ; preds = %44
  %50 = tail call ptr @BIO_s_mem() #7
  %51 = tail call ptr @BIO_new(ptr noundef %50) #7
  %.not94 = icmp eq ptr %51, null
  br i1 %.not94, label %52, label %54

52:                                               ; preds = %49
  %53 = load ptr, ptr @stderr, align 8, !tbaa !5
  tail call void @ERR_print_errors_fp(ptr noundef %53) #7
  tail call void @OPENSSL_die(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.4, i32 noundef 184) #8
  unreachable

54:                                               ; preds = %49
  %55 = tail call i64 @BIO_ctrl(ptr noundef nonnull %46, i32 noundef 130, i64 noundef -1, ptr noundef null) #7
  %56 = tail call i64 @BIO_ctrl(ptr noundef nonnull %51, i32 noundef 130, i64 noundef -1, ptr noundef null) #7
  tail call void @SSL_set_bio(ptr noundef nonnull %37, ptr noundef nonnull %51, ptr noundef nonnull %46) #7
  %57 = tail call i32 @BIO_up_ref(ptr noundef nonnull %46) #7
  %58 = tail call i32 @BIO_up_ref(ptr noundef nonnull %51) #7
  tail call void @SSL_set_bio(ptr noundef nonnull %41, ptr noundef nonnull %46, ptr noundef nonnull %51) #7
  br label %59

59:                                               ; preds = %._crit_edge105.thread, %54
  %.075 = phi i32 [ -1, %54 ], [ %.176.lcssa118, %._crit_edge105.thread ]
  %.073 = phi i32 [ -1, %54 ], [ %.174.fr.lcssa123, %._crit_edge105.thread ]
  %60 = icmp slt i32 %.075, 1
  br i1 %60, label %.lr.ph, label %.preheader

.lr.ph:                                           ; preds = %59, %69
  %61 = tail call i32 @SSL_connect(ptr noundef nonnull %41) #7
  %62 = icmp slt i32 %61, 1
  br i1 %62, label %63, label %65

63:                                               ; preds = %.lr.ph
  %64 = tail call i32 @SSL_get_error(ptr noundef nonnull %41, i32 noundef %61) #7
  br label %65

65:                                               ; preds = %63, %.lr.ph
  %.1 = phi i32 [ %64, %63 ], [ 3, %.lr.ph ]
  %66 = load i32, ptr @verbose, align 4, !tbaa !9
  %.not100 = icmp eq i32 %66, 0
  br i1 %.not100, label %69, label %67

67:                                               ; preds = %65
  %68 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13, i32 noundef %61, i32 noundef %.1)
  br label %69

69:                                               ; preds = %67, %65
  %70 = icmp eq i32 %.1, 3
  %71 = select i1 %62, i1 %70, i1 false
  br i1 %71, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %69
  %72 = icmp ne i32 %.1, 2
  %or.cond = select i1 %62, i1 %72, i1 false
  br i1 %or.cond, label %74, label %.preheader

.preheader:                                       ; preds = %59, %._crit_edge
  %.lcssa119 = phi i1 [ %62, %._crit_edge ], [ false, %59 ]
  %.176.lcssa118 = phi i32 [ %61, %._crit_edge ], [ %.075, %59 ]
  %73 = icmp slt i32 %.073, 1
  br i1 %73, label %.lr.ph104, label %._crit_edge105.thread

74:                                               ; preds = %._crit_edge
  %75 = load ptr, ptr @stderr, align 8, !tbaa !5
  tail call void @ERR_print_errors_fp(ptr noundef %75) #7
  tail call void @OPENSSL_die(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.4, i32 noundef 209) #8
  unreachable

.lr.ph104:                                        ; preds = %.preheader, %84
  %76 = tail call i32 @SSL_accept(ptr noundef nonnull %37) #7
  %.174.fr = freeze i32 %76
  %77 = icmp slt i32 %.174.fr, 1
  br i1 %77, label %78, label %80

78:                                               ; preds = %.lr.ph104
  %79 = tail call i32 @SSL_get_error(ptr noundef nonnull %37, i32 noundef %.174.fr) #7
  br label %80

80:                                               ; preds = %78, %.lr.ph104
  %.3 = phi i32 [ %79, %78 ], [ 3, %.lr.ph104 ]
  %81 = load i32, ptr @verbose, align 4, !tbaa !9
  %.not99 = icmp eq i32 %81, 0
  br i1 %.not99, label %84, label %82

82:                                               ; preds = %80
  %83 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef %.174.fr, i32 noundef %.3)
  br label %84

84:                                               ; preds = %82, %80
  %85 = icmp eq i32 %.3, 3
  %86 = select i1 %77, i1 %85, i1 false
  br i1 %86, label %.lr.ph104, label %._crit_edge105, !llvm.loop !13

._crit_edge105:                                   ; preds = %84
  br i1 %77, label %switch.early.test, label %._crit_edge105.thread

switch.early.test:                                ; preds = %._crit_edge105
  switch i32 %.3, label %87 [
    i32 4, label %._crit_edge105.thread
    i32 2, label %._crit_edge105.thread
  ]

87:                                               ; preds = %switch.early.test
  %88 = load ptr, ptr @stderr, align 8, !tbaa !5
  tail call void @ERR_print_errors_fp(ptr noundef %88) #7
  tail call void @OPENSSL_die(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.4, i32 noundef 222) #8
  unreachable

._crit_edge105.thread:                            ; preds = %.preheader, %switch.early.test, %switch.early.test, %._crit_edge105
  %.lcssa101124 = phi i1 [ true, %switch.early.test ], [ true, %switch.early.test ], [ false, %._crit_edge105 ], [ false, %.preheader ]
  %.174.fr.lcssa123 = phi i32 [ %.174.fr, %switch.early.test ], [ %.174.fr, %switch.early.test ], [ %.174.fr, %._crit_edge105 ], [ %.073, %.preheader ]
  %89 = or i1 %.lcssa119, %.lcssa101124
  br i1 %89, label %59, label %90, !llvm.loop !14

90:                                               ; preds = %._crit_edge105.thread
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %91 = call i32 @SSL_read_ex(ptr noundef nonnull %41, ptr noundef nonnull %3, i64 noundef 1, ptr noundef nonnull %4) #7
  %.not95 = icmp eq i32 %91, 0
  br i1 %.not95, label %94, label %92

92:                                               ; preds = %90
  %93 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %93) #7
  call void @OPENSSL_die(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.4, i32 noundef 229) #8
  unreachable

94:                                               ; preds = %90
  %95 = call i32 @SSL_read_ex(ptr noundef nonnull %41, ptr noundef nonnull %3, i64 noundef 1, ptr noundef nonnull %4) #7
  %.not96 = icmp eq i32 %95, 0
  br i1 %.not96, label %98, label %96

96:                                               ; preds = %94
  %97 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %97) #7
  call void @OPENSSL_die(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.4, i32 noundef 230) #8
  unreachable

98:                                               ; preds = %94
  %99 = call i32 @SSL_do_handshake(ptr noundef nonnull %41) #7
  %100 = icmp eq i32 %99, 1
  br i1 %100, label %103, label %101

101:                                              ; preds = %98
  %102 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %102) #7
  call void @OPENSSL_die(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.4, i32 noundef 233) #8
  unreachable

103:                                              ; preds = %98
  %104 = call ptr @SSL_get_version(ptr noundef nonnull %41) #7
  %105 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, ptr noundef %104)
  %106 = call ptr @SSL_get_current_cipher(ptr noundef nonnull %41) #7
  %107 = call ptr @SSL_CIPHER_get_name(ptr noundef %106) #7
  %108 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20, ptr noundef %107)
  %109 = load i32, ptr @verbose, align 4, !tbaa !9
  %.not97 = icmp eq i32 %109, 0
  br i1 %.not97, label %.preheader129, label %110

110:                                              ; preds = %103
  %111 = call ptr @SSL_get_session(ptr noundef nonnull %41) #7
  %112 = load ptr, ptr @stdout, align 8, !tbaa !5
  %113 = call i32 @SSL_SESSION_print_fp(ptr noundef %112, ptr noundef %111) #7
  br label %.preheader129

.preheader129:                                    ; preds = %110, %103
  br label %114

114:                                              ; preds = %.preheader129, %145
  %.0109 = phi i32 [ %146, %145 ], [ 0, %.preheader129 ]
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %6) #7
  %115 = trunc nuw i32 %.0109 to i8
  %116 = add nuw nsw i8 %115, 99
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(512) %5, i8 %116, i64 512, i1 false)
  %117 = call i32 @SSL_write(ptr noundef nonnull %37, ptr noundef nonnull %5, i32 noundef 512) #7
  %118 = icmp eq i32 %117, 512
  br i1 %118, label %121, label %119

119:                                              ; preds = %114
  %120 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %120) #7
  call void @OPENSSL_die(ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.4, i32 noundef 247) #8
  unreachable

121:                                              ; preds = %114
  %122 = call i32 @SSL_read(ptr noundef nonnull %41, ptr noundef nonnull %6, i32 noundef 512) #7
  %123 = icmp eq i32 %122, 512
  br i1 %123, label %126, label %124

124:                                              ; preds = %121
  %125 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %125) #7
  call void @OPENSSL_die(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.4, i32 noundef 248) #8
  unreachable

126:                                              ; preds = %121
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(512) %5, ptr noundef nonnull dereferenceable(512) %6, i64 512)
  %127 = icmp eq i32 %bcmp, 0
  br i1 %127, label %130, label %128

128:                                              ; preds = %126
  %129 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %129) #7
  call void @OPENSSL_die(ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.4, i32 noundef 249) #8
  unreachable

130:                                              ; preds = %126
  %131 = add nuw i8 %115, 115
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(512) %6, i8 %131, i64 512, i1 false)
  %132 = call i32 @SSL_write(ptr noundef nonnull %41, ptr noundef nonnull %6, i32 noundef 512) #7
  %133 = icmp eq i32 %132, 512
  br i1 %133, label %136, label %134

134:                                              ; preds = %130
  %135 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %135) #7
  call void @OPENSSL_die(ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.4, i32 noundef 252) #8
  unreachable

136:                                              ; preds = %130
  %137 = call i32 @SSL_read(ptr noundef nonnull %37, ptr noundef nonnull %5, i32 noundef 512) #7
  %138 = icmp eq i32 %137, 512
  br i1 %138, label %141, label %139

139:                                              ; preds = %136
  %140 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %140) #7
  call void @OPENSSL_die(ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.4, i32 noundef 253) #8
  unreachable

141:                                              ; preds = %136
  %bcmp98 = call i32 @bcmp(ptr noundef nonnull dereferenceable(512) %5, ptr noundef nonnull dereferenceable(512) %6, i64 512)
  %142 = icmp eq i32 %bcmp98, 0
  br i1 %142, label %145, label %143

143:                                              ; preds = %141
  %144 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %144) #7
  call void @OPENSSL_die(ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.4, i32 noundef 254) #8
  unreachable

145:                                              ; preds = %141
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %5) #7
  %146 = add nuw nsw i32 %.0109, 1
  %exitcond.not = icmp eq i32 %146, 16
  br i1 %exitcond.not, label %147, label %114, !llvm.loop !15

147:                                              ; preds = %145
  %148 = call i32 @SSL_shutdown(ptr noundef nonnull %41) #7
  %149 = call i32 @SSL_shutdown(ptr noundef nonnull %37) #7
  call void @SSL_free(ptr noundef nonnull %37) #7
  call void @SSL_free(ptr noundef nonnull %41) #7
  call void @SSL_CTX_free(ptr noundef nonnull %16) #7
  call void @SSL_CTX_free(ptr noundef nonnull %33) #7
  call void @X509_free(ptr noundef %14) #7
  call void @EVP_PKEY_free(ptr noundef %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #7
  ret i32 0
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden { ptr, ptr } @certgen(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare ptr @SSL_CTX_new(ptr noundef) local_unnamed_addr #3

declare ptr @TLS_server_method() local_unnamed_addr #3

declare void @ERR_print_errors_fp(ptr noundef) local_unnamed_addr #3

; Function Attrs: noreturn
declare void @OPENSSL_die(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare i32 @SSL_CTX_use_certificate(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @SSL_CTX_use_PrivateKey(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @SSL_CTX_check_private_key(ptr noundef) local_unnamed_addr #3

declare ptr @TLS_client_method() local_unnamed_addr #3

declare ptr @SSL_new(ptr noundef) local_unnamed_addr #3

declare ptr @BIO_new(ptr noundef) local_unnamed_addr #3

declare ptr @BIO_s_mem() local_unnamed_addr #3

declare i64 @BIO_ctrl(ptr noundef, i32 noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

declare void @SSL_set_bio(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @BIO_up_ref(ptr noundef) local_unnamed_addr #3

declare i32 @SSL_connect(ptr noundef) local_unnamed_addr #3

declare i32 @SSL_get_error(ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @SSL_accept(ptr noundef) local_unnamed_addr #3

declare i32 @SSL_read_ex(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

declare i32 @SSL_do_handshake(ptr noundef) local_unnamed_addr #3

declare ptr @SSL_get_version(ptr noundef) local_unnamed_addr #3

declare ptr @SSL_CIPHER_get_name(ptr noundef) local_unnamed_addr #3

declare ptr @SSL_get_current_cipher(ptr noundef) local_unnamed_addr #3

declare ptr @SSL_get_session(ptr noundef) local_unnamed_addr #3

declare i32 @SSL_SESSION_print_fp(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

declare i32 @SSL_write(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @SSL_read(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @SSL_shutdown(ptr noundef) local_unnamed_addr #3

declare void @SSL_free(ptr noundef) local_unnamed_addr #3

declare void @SSL_CTX_free(ptr noundef) local_unnamed_addr #3

declare void @X509_free(ptr noundef) local_unnamed_addr #3

declare void @EVP_PKEY_free(ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #6

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nofree nounwind willreturn memory(argmem: read) }
attributes #7 = { nounwind }
attributes #8 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass