; LLVM IR from guanzhi/GmSSL :: src (tls12)

; 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.SM2_KEY = type { %struct.SM2_Z256_POINT, [4 x i64] }
%struct.SM2_Z256_POINT = type { [4 x i64], [4 x i64], [4 x i64] }
%struct.SM2_SIGN_CTX = type { %struct.SM3_CTX, %struct.SM3_CTX, %struct.SM2_KEY, [4 x i64], [32 x %struct.SM2_SIGN_PRE_COMP], i32, [16 x %struct.SM2_Z256_POINT] }
%struct.SM3_CTX = type { [8 x i32], i64, [64 x i8], i64 }
%struct.SM2_SIGN_PRE_COMP = type { [4 x i64], [4 x i64] }
%struct.TLS_CONNECT = type { i32, i32, [64 x i32], i64, i32, [18437 x i8], i64, [18437 x i8], [18437 x i8], ptr, i64, i32, [32 x i8], i64, [2048 x i8], i64, [2048 x i8], i64, [2048 x i8], i64, %struct.SM2_KEY, %struct.SM2_KEY, i32, [48 x i8], [96 x i8], %struct.SM3_HMAC_CTX, %struct.SM3_HMAC_CTX, %struct.SM4_KEY, %struct.SM4_KEY, [8 x i8], [8 x i8], [12 x i8], [12 x i8], %struct.BLOCK_CIPHER_KEY, %struct.BLOCK_CIPHER_KEY, i32 }
%struct.SM3_HMAC_CTX = type { %struct.SM3_CTX, [64 x i8] }
%struct.SM4_KEY = type { [32 x i32] }
%struct.BLOCK_CIPHER_KEY = type { %union.anon, ptr }
%union.anon = type { %struct.SM4_KEY }

@tls12_ciphers = external hidden constant [1 x i32], align 4
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@__const.tls12_do_connect.supported_groups = external hidden unnamed_addr constant [1 x i32], align 4
@__const.tls12_do_connect.signature_algors = external hidden unnamed_addr constant [1 x i32], align 4
@__FUNCTION__.tls12_do_connect = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [25 x i8], align 1

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @tls_record_get_handshake_server_key_exchange_ecdhe(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @tls_record_get_handshake(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @tls_record_set_handshake_client_key_exchange_ecdhe(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @tls12_do_connect(ptr noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca [309 x i8], align 16
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca [32 x i8], align 16
  %10 = alloca [32 x i8], align 16
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca [512 x i8], align 16
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %struct.SM2_KEY, align 8
  %24 = alloca %struct.SM2_SIGN_CTX, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i64, align 8
  %27 = alloca [48 x i8], align 16
  %28 = alloca %struct.SM3_CTX, align 8
  %29 = alloca %struct.SM3_CTX, align 8
  %30 = alloca [32 x i8], align 16
  %31 = alloca ptr, align 8
  %32 = alloca i64, align 8
  %33 = alloca [12 x i8], align 1
  %34 = alloca i32, align 4
  %35 = alloca ptr, align 8
  %36 = alloca ptr, align 8
  %37 = alloca i64, align 8
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca [1 x i32], align 4
  %42 = alloca i64, align 8
  %43 = alloca [1 x i32], align 4
  %44 = alloca i64, align 8
  %45 = alloca [1 x i32], align 4
  %46 = alloca i64, align 8
  %47 = alloca i32, align 4
  %48 = alloca %struct.SM2_Z256_POINT, align 8
  %49 = alloca ptr, align 8
  %50 = alloca i64, align 8
  %51 = alloca ptr, align 8
  %52 = alloca i64, align 8
  %53 = alloca i32, align 4
  %54 = alloca %struct.SM2_KEY, align 8
  %55 = alloca [64 x i8], align 16
  %56 = alloca [72 x i8], align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 -1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.TLS_CONNECT, ptr %57, i32 0, i32 7
  %59 = getelementptr inbounds [18437 x i8], ptr %58, i64 0, i64 0
  store ptr %59, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 309, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 512, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store i64 0, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 -1, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 -1, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 -1, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 128, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 3976, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr %27) #7
  call void @llvm.lifetime.start.p0(i64 112, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 112, ptr %29) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %30) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %33) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #7
  store i32 5, ptr %38, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #7
  store i32 0, ptr %39, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #7
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = call i32 @tls_record_set_protocol(ptr noundef %60, i32 noundef 769)
  %62 = getelementptr inbounds [309 x i8], ptr %6, i64 0, i64 0
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.TLS_CONNECT, ptr %63, i32 0, i32 0
  %65 = load i32, ptr %64, align 8, !tbaa !13
  %66 = call i32 @tls_record_set_protocol(ptr noundef %62, i32 noundef %65)
  call void @sm3_init(ptr noundef %28)
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.TLS_CONNECT, ptr %67, i32 0, i32 17
  %69 = load i64, ptr %68, align 8, !tbaa !21
  %70 = icmp ne i64 %69, 0
  br i1 %70, label %71, label %75

71:                                               ; preds = %1
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.TLS_CONNECT, ptr %72, i32 0, i32 20
  %74 = call i32 @sm2_sign_init(ptr noundef %24, ptr noundef %73, ptr noundef @.str.2, i64 noundef 16)
  br label %75

75:                                               ; preds = %71, %1
  %76 = getelementptr inbounds [32 x i8], ptr %9, i64 0, i64 0
  %77 = call i32 @tls_random_generate(ptr noundef %76)
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #7
  call void @llvm.memset.p0.i64(ptr align 4 %41, i8 0, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #7
  store i64 1, ptr %42, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %43, ptr align 4 @__const.tls12_do_connect.supported_groups, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #7
  store i64 1, ptr %44, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %45, ptr align 4 @__const.tls12_do_connect.signature_algors, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #7
  store i64 1, ptr %46, align 8, !tbaa !11
  %78 = getelementptr inbounds [512 x i8], ptr %16, i64 0, i64 0
  store ptr %78, ptr %36, align 8, !tbaa !5
  store i64 0, ptr %17, align 8, !tbaa !11
  %79 = getelementptr inbounds [1 x i32], ptr %41, i64 0, i64 0
  %80 = load i64, ptr %42, align 8, !tbaa !11
  %81 = call i32 @tls_ec_point_formats_ext_to_bytes(ptr noundef %79, i64 noundef %80, ptr noundef %36, ptr noundef %17)
  %82 = getelementptr inbounds [1 x i32], ptr %43, i64 0, i64 0
  %83 = load i64, ptr %44, align 8, !tbaa !11
  %84 = call i32 @tls_supported_groups_ext_to_bytes(ptr noundef %82, i64 noundef %83, ptr noundef %36, ptr noundef %17)
  %85 = getelementptr inbounds [1 x i32], ptr %45, i64 0, i64 0
  %86 = load i64, ptr %46, align 8, !tbaa !11
  %87 = call i32 @tls_signature_algorithms_ext_to_bytes(ptr noundef %85, i64 noundef %86, ptr noundef %36, ptr noundef %17)
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.TLS_CONNECT, ptr %89, i32 0, i32 0
  %91 = load i32, ptr %90, align 8, !tbaa !13
  %92 = getelementptr inbounds [32 x i8], ptr %9, i64 0, i64 0
  %93 = getelementptr inbounds [512 x i8], ptr %16, i64 0, i64 0
  %94 = load i64, ptr %17, align 8, !tbaa !11
  %95 = call i32 @tls_record_set_handshake_client_hello(ptr noundef %88, ptr noundef %7, i32 noundef %91, ptr noundef %92, ptr noundef null, i64 noundef 0, ptr noundef @tls12_ciphers, i64 noundef 1, ptr noundef %93, i64 noundef %94)
  %96 = icmp ne i32 %95, 1
  br i1 %96, label %97, label %103

97:                                               ; preds = %75
  br label %98

98:                                               ; preds = %97
  %99 = load ptr, ptr @stderr, align 8, !tbaa !5
  %100 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %99, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 258, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %101

101:                                              ; preds = %98
  br label %102

102:                                              ; preds = %101
  br label %1103

103:                                              ; preds = %75
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = load i64, ptr %7, align 8, !tbaa !11
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.TLS_CONNECT, ptr %106, i32 0, i32 4
  %108 = load i32, ptr %107, align 8, !tbaa !22
  %109 = call i32 @tls_record_send(ptr noundef %104, i64 noundef %105, i32 noundef %108)
  %110 = icmp ne i32 %109, 1
  br i1 %110, label %111, label %117

111:                                              ; preds = %103
  br label %112

112:                                              ; preds = %111
  %113 = load ptr, ptr @stderr, align 8, !tbaa !5
  %114 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %113, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 264, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %115

115:                                              ; preds = %112
  br label %116

116:                                              ; preds = %115
  br label %1103

117:                                              ; preds = %103
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = getelementptr inbounds i8, ptr %118, i64 5
  %120 = load i64, ptr %7, align 8, !tbaa !11
  %121 = sub i64 %120, 5
  call void @sm3_update(ptr noundef %28, ptr noundef %119, i64 noundef %121)
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.TLS_CONNECT, ptr %122, i32 0, i32 17
  %124 = load i64, ptr %123, align 8, !tbaa !21
  %125 = icmp ne i64 %124, 0
  br i1 %125, label %126, label %132

126:                                              ; preds = %117
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = getelementptr inbounds i8, ptr %127, i64 5
  %129 = load i64, ptr %7, align 8, !tbaa !11
  %130 = sub i64 %129, 5
  %131 = call i32 @sm2_sign_update(ptr noundef %24, ptr noundef %128, i64 noundef %130)
  br label %132

132:                                              ; preds = %126, %117
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = load ptr, ptr %3, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.TLS_CONNECT, ptr %134, i32 0, i32 4
  %136 = load i32, ptr %135, align 8, !tbaa !22
  %137 = call i32 @tls_record_recv(ptr noundef %133, ptr noundef %7, i32 noundef %136)
  %138 = icmp ne i32 %137, 1
  br i1 %138, label %139, label %147

139:                                              ; preds = %132
  br label %140

140:                                              ; preds = %139
  %141 = load ptr, ptr @stderr, align 8, !tbaa !5
  %142 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %141, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 274, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %143

143:                                              ; preds = %140
  br label %144

144:                                              ; preds = %143
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = call i32 @tls_send_alert(ptr noundef %145, i32 noundef 10)
  br label %1103

147:                                              ; preds = %132
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = getelementptr inbounds i8, ptr %148, i64 1
  %150 = load i8, ptr %149, align 1, !tbaa !23
  %151 = zext i8 %150 to i16
  %152 = zext i16 %151 to i32
  %153 = shl i32 %152, 8
  %154 = load ptr, ptr %5, align 8, !tbaa !5
  %155 = getelementptr inbounds i8, ptr %154, i64 2
  %156 = load i8, ptr %155, align 1, !tbaa !23
  %157 = zext i8 %156 to i32
  %158 = or i32 %153, %157
  %159 = load ptr, ptr %3, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.TLS_CONNECT, ptr %159, i32 0, i32 0
  %161 = load i32, ptr %160, align 8, !tbaa !13
  %162 = icmp ne i32 %158, %161
  br i1 %162, label %163, label %171

163:                                              ; preds = %147
  br label %164

164:                                              ; preds = %163
  %165 = load ptr, ptr @stderr, align 8, !tbaa !5
  %166 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %165, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 280, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %167

167:                                              ; preds = %164
  br label %168

168:                                              ; preds = %167
  %169 = load ptr, ptr %3, align 8, !tbaa !5
  %170 = call i32 @tls_send_alert(ptr noundef %169, i32 noundef 70)
  br label %1103

171:                                              ; preds = %147
  %172 = load ptr, ptr %5, align 8, !tbaa !5
  %173 = call i32 @tls_record_get_handshake_server_hello(ptr noundef %172, ptr noundef %11, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %12, ptr noundef %18, ptr noundef %19)
  %174 = icmp ne i32 %173, 1
  br i1 %174, label %175, label %183

175:                                              ; preds = %171
  br label %176

176:                                              ; preds = %175
  %177 = load ptr, ptr @stderr, align 8, !tbaa !5
  %178 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %177, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 287, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %179

179:                                              ; preds = %176
  br label %180

180:                                              ; preds = %179
  %181 = load ptr, ptr %3, align 8, !tbaa !5
  %182 = call i32 @tls_send_alert(ptr noundef %181, i32 noundef 10)
  br label %1103

183:                                              ; preds = %171
  %184 = load i32, ptr %11, align 4, !tbaa !9
  %185 = load ptr, ptr %3, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.TLS_CONNECT, ptr %185, i32 0, i32 0
  %187 = load i32, ptr %186, align 8, !tbaa !13
  %188 = icmp ne i32 %184, %187
  br i1 %188, label %189, label %197

189:                                              ; preds = %183
  br label %190

190:                                              ; preds = %189
  %191 = load ptr, ptr @stderr, align 8, !tbaa !5
  %192 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %191, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 292, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %193

193:                                              ; preds = %190
  br label %194

194:                                              ; preds = %193
  %195 = load ptr, ptr %3, align 8, !tbaa !5
  %196 = call i32 @tls_send_alert(ptr noundef %195, i32 noundef 70)
  br label %1103

197:                                              ; preds = %183
  %198 = load i32, ptr %12, align 4, !tbaa !9
  %199 = call i32 @tls_cipher_suite_in_list(i32 noundef %198, ptr noundef @tls12_ciphers, i64 noundef 1)
  %200 = icmp ne i32 %199, 1
  br i1 %200, label %201, label %209

201:                                              ; preds = %197
  br label %202

202:                                              ; preds = %201
  %203 = load ptr, ptr @stderr, align 8, !tbaa !5
  %204 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %203, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 298, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %205

205:                                              ; preds = %202
  br label %206

206:                                              ; preds = %205
  %207 = load ptr, ptr %3, align 8, !tbaa !5
  %208 = call i32 @tls_send_alert(ptr noundef %207, i32 noundef 40)
  br label %1103

209:                                              ; preds = %197
  %210 = load ptr, ptr %18, align 8, !tbaa !5
  %211 = icmp ne ptr %210, null
  br i1 %211, label %220, label %212

212:                                              ; preds = %209
  br label %213

213:                                              ; preds = %212
  %214 = load ptr, ptr @stderr, align 8, !tbaa !5
  %215 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %214, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 303, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %216

216:                                              ; preds = %213
  br label %217

217:                                              ; preds = %216
  %218 = load ptr, ptr %3, align 8, !tbaa !5
  %219 = call i32 @tls_send_alert(ptr noundef %218, i32 noundef 10)
  br label %1103

220:                                              ; preds = %209
  %221 = load ptr, ptr %18, align 8, !tbaa !5
  %222 = load i64, ptr %19, align 8, !tbaa !11
  %223 = call i32 @tls_process_server_hello_exts(ptr noundef %221, i64 noundef %222, ptr noundef %20, ptr noundef %21, ptr noundef %22)
  %224 = icmp ne i32 %223, 1
  br i1 %224, label %234, label %225

225:                                              ; preds = %220
  %226 = load i32, ptr %20, align 4, !tbaa !9
  %227 = icmp slt i32 %226, 0
  br i1 %227, label %234, label %228

228:                                              ; preds = %225
  %229 = load i32, ptr %21, align 4, !tbaa !9
  %230 = icmp slt i32 %229, 0
  br i1 %230, label %234, label %231

231:                                              ; preds = %228
  %232 = load i32, ptr %22, align 4, !tbaa !9
  %233 = icmp slt i32 %232, 0
  br i1 %233, label %234, label %242

234:                                              ; preds = %231, %228, %225, %220
  br label %235

235:                                              ; preds = %234
  %236 = load ptr, ptr @stderr, align 8, !tbaa !5
  %237 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %236, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 311, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %238

238:                                              ; preds = %235
  br label %239

239:                                              ; preds = %238
  %240 = load ptr, ptr %3, align 8, !tbaa !5
  %241 = call i32 @tls_send_alert(ptr noundef %240, i32 noundef 10)
  br label %1103

242:                                              ; preds = %231
  %243 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %244 = load ptr, ptr %13, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %243, ptr align 1 %244, i64 32, i1 false)
  %245 = load ptr, ptr %3, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct.TLS_CONNECT, ptr %245, i32 0, i32 12
  %247 = getelementptr inbounds [32 x i8], ptr %246, i64 0, i64 0
  %248 = load ptr, ptr %14, align 8, !tbaa !5
  %249 = load i64, ptr %15, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %247, ptr align 1 %248, i64 %249, i1 false)
  %250 = load i32, ptr %12, align 4, !tbaa !9
  %251 = load ptr, ptr %3, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.TLS_CONNECT, ptr %251, i32 0, i32 11
  store i32 %250, ptr %252, align 8, !tbaa !24
  %253 = load ptr, ptr %5, align 8, !tbaa !5
  %254 = getelementptr inbounds i8, ptr %253, i64 5
  %255 = load i64, ptr %7, align 8, !tbaa !11
  %256 = sub i64 %255, 5
  call void @sm3_update(ptr noundef %28, ptr noundef %254, i64 noundef %256)
  %257 = load ptr, ptr %3, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.TLS_CONNECT, ptr %257, i32 0, i32 17
  %259 = load i64, ptr %258, align 8, !tbaa !21
  %260 = icmp ne i64 %259, 0
  br i1 %260, label %261, label %267

261:                                              ; preds = %242
  %262 = load ptr, ptr %5, align 8, !tbaa !5
  %263 = getelementptr inbounds i8, ptr %262, i64 5
  %264 = load i64, ptr %7, align 8, !tbaa !11
  %265 = sub i64 %264, 5
  %266 = call i32 @sm2_sign_update(ptr noundef %24, ptr noundef %263, i64 noundef %265)
  br label %267

267:                                              ; preds = %261, %242
  %268 = load ptr, ptr %5, align 8, !tbaa !5
  %269 = load ptr, ptr %3, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.TLS_CONNECT, ptr %269, i32 0, i32 4
  %271 = load i32, ptr %270, align 8, !tbaa !22
  %272 = call i32 @tls_record_recv(ptr noundef %268, ptr noundef %7, i32 noundef %271)
  %273 = icmp ne i32 %272, 1
  br i1 %273, label %290, label %274

274:                                              ; preds = %267
  %275 = load ptr, ptr %5, align 8, !tbaa !5
  %276 = getelementptr inbounds i8, ptr %275, i64 1
  %277 = load i8, ptr %276, align 1, !tbaa !23
  %278 = zext i8 %277 to i16
  %279 = zext i16 %278 to i32
  %280 = shl i32 %279, 8
  %281 = load ptr, ptr %5, align 8, !tbaa !5
  %282 = getelementptr inbounds i8, ptr %281, i64 2
  %283 = load i8, ptr %282, align 1, !tbaa !23
  %284 = zext i8 %283 to i32
  %285 = or i32 %280, %284
  %286 = load ptr, ptr %3, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.TLS_CONNECT, ptr %286, i32 0, i32 0
  %288 = load i32, ptr %287, align 8, !tbaa !13
  %289 = icmp ne i32 %285, %288
  br i1 %289, label %290, label %298

290:                                              ; preds = %274, %267
  br label %291

291:                                              ; preds = %290
  %292 = load ptr, ptr @stderr, align 8, !tbaa !5
  %293 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %292, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 326, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %294

294:                                              ; preds = %291
  br label %295

295:                                              ; preds = %294
  %296 = load ptr, ptr %3, align 8, !tbaa !5
  %297 = call i32 @tls_send_alert(ptr noundef %296, i32 noundef 10)
  br label %1103

298:                                              ; preds = %274
  %299 = load ptr, ptr %5, align 8, !tbaa !5
  %300 = load ptr, ptr %3, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct.TLS_CONNECT, ptr %300, i32 0, i32 14
  %302 = getelementptr inbounds [2048 x i8], ptr %301, i64 0, i64 0
  %303 = load ptr, ptr %3, align 8, !tbaa !5
  %304 = getelementptr inbounds %struct.TLS_CONNECT, ptr %303, i32 0, i32 15
  %305 = call i32 @tls_record_get_handshake_certificate(ptr noundef %299, ptr noundef %302, ptr noundef %304)
  %306 = icmp ne i32 %305, 1
  br i1 %306, label %307, label %315

307:                                              ; preds = %298
  br label %308

308:                                              ; preds = %307
  %309 = load ptr, ptr @stderr, align 8, !tbaa !5
  %310 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %309, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 334, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %311

311:                                              ; preds = %308
  br label %312

312:                                              ; preds = %311
  %313 = load ptr, ptr %3, align 8, !tbaa !5
  %314 = call i32 @tls_send_alert(ptr noundef %313, i32 noundef 10)
  br label %1103

315:                                              ; preds = %298
  %316 = load ptr, ptr %5, align 8, !tbaa !5
  %317 = getelementptr inbounds i8, ptr %316, i64 5
  %318 = load i64, ptr %7, align 8, !tbaa !11
  %319 = sub i64 %318, 5
  call void @sm3_update(ptr noundef %28, ptr noundef %317, i64 noundef %319)
  %320 = load ptr, ptr %3, align 8, !tbaa !5
  %321 = getelementptr inbounds %struct.TLS_CONNECT, ptr %320, i32 0, i32 17
  %322 = load i64, ptr %321, align 8, !tbaa !21
  %323 = icmp ne i64 %322, 0
  br i1 %323, label %324, label %330

324:                                              ; preds = %315
  %325 = load ptr, ptr %5, align 8, !tbaa !5
  %326 = getelementptr inbounds i8, ptr %325, i64 5
  %327 = load i64, ptr %7, align 8, !tbaa !11
  %328 = sub i64 %327, 5
  %329 = call i32 @sm2_sign_update(ptr noundef %24, ptr noundef %326, i64 noundef %328)
  br label %330

330:                                              ; preds = %324, %315
  %331 = load ptr, ptr %3, align 8, !tbaa !5
  %332 = getelementptr inbounds %struct.TLS_CONNECT, ptr %331, i32 0, i32 14
  %333 = getelementptr inbounds [2048 x i8], ptr %332, i64 0, i64 0
  %334 = load ptr, ptr %3, align 8, !tbaa !5
  %335 = getelementptr inbounds %struct.TLS_CONNECT, ptr %334, i32 0, i32 15
  %336 = load i64, ptr %335, align 8, !tbaa !25
  %337 = load ptr, ptr %3, align 8, !tbaa !5
  %338 = getelementptr inbounds %struct.TLS_CONNECT, ptr %337, i32 0, i32 18
  %339 = getelementptr inbounds [2048 x i8], ptr %338, i64 0, i64 0
  %340 = load ptr, ptr %3, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct.TLS_CONNECT, ptr %340, i32 0, i32 19
  %342 = load i64, ptr %341, align 8, !tbaa !26
  %343 = load i32, ptr %38, align 4, !tbaa !9
  %344 = call i32 @x509_certs_verify(ptr noundef %333, i64 noundef %336, i32 noundef 0, ptr noundef %339, i64 noundef %342, i32 noundef %343, ptr noundef %40)
  %345 = icmp ne i32 %344, 1
  br i1 %345, label %346, label %354

346:                                              ; preds = %330
  br label %347

347:                                              ; preds = %346
  %348 = load ptr, ptr @stderr, align 8, !tbaa !5
  %349 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %348, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 345, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %350

350:                                              ; preds = %347
  br label %351

351:                                              ; preds = %350
  %352 = load ptr, ptr %3, align 8, !tbaa !5
  %353 = call i32 @tls_send_alert(ptr noundef %352, i32 noundef 42)
  br label %1103

354:                                              ; preds = %330
  %355 = load ptr, ptr %5, align 8, !tbaa !5
  %356 = load ptr, ptr %3, align 8, !tbaa !5
  %357 = getelementptr inbounds %struct.TLS_CONNECT, ptr %356, i32 0, i32 4
  %358 = load i32, ptr %357, align 8, !tbaa !22
  %359 = call i32 @tls_record_recv(ptr noundef %355, ptr noundef %7, i32 noundef %358)
  %360 = icmp ne i32 %359, 1
  br i1 %360, label %377, label %361

361:                                              ; preds = %354
  %362 = load ptr, ptr %5, align 8, !tbaa !5
  %363 = getelementptr inbounds i8, ptr %362, i64 1
  %364 = load i8, ptr %363, align 1, !tbaa !23
  %365 = zext i8 %364 to i16
  %366 = zext i16 %365 to i32
  %367 = shl i32 %366, 8
  %368 = load ptr, ptr %5, align 8, !tbaa !5
  %369 = getelementptr inbounds i8, ptr %368, i64 2
  %370 = load i8, ptr %369, align 1, !tbaa !23
  %371 = zext i8 %370 to i32
  %372 = or i32 %367, %371
  %373 = load ptr, ptr %3, align 8, !tbaa !5
  %374 = getelementptr inbounds %struct.TLS_CONNECT, ptr %373, i32 0, i32 0
  %375 = load i32, ptr %374, align 8, !tbaa !13
  %376 = icmp ne i32 %372, %375
  br i1 %376, label %377, label %385

377:                                              ; preds = %361, %354
  br label %378

378:                                              ; preds = %377
  %379 = load ptr, ptr @stderr, align 8, !tbaa !5
  %380 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %379, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 354, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %381

381:                                              ; preds = %378
  br label %382

382:                                              ; preds = %381
  %383 = load ptr, ptr %3, align 8, !tbaa !5
  %384 = call i32 @tls_send_alert(ptr noundef %383, i32 noundef 10)
  br label %1103

385:                                              ; preds = %361
  %386 = load ptr, ptr %5, align 8, !tbaa !5
  %387 = call i32 @tls_record_get_handshake_server_key_exchange_ecdhe(ptr noundef %386, ptr noundef %47, ptr noundef %48, ptr noundef %25, ptr noundef %26)
  %388 = icmp ne i32 %387, 1
  br i1 %388, label %389, label %397

389:                                              ; preds = %385
  br label %390

390:                                              ; preds = %389
  %391 = load ptr, ptr @stderr, align 8, !tbaa !5
  %392 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %391, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 363, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %393

393:                                              ; preds = %390
  br label %394

394:                                              ; preds = %393
  %395 = load ptr, ptr %3, align 8, !tbaa !5
  %396 = call i32 @tls_send_alert(ptr noundef %395, i32 noundef 10)
  br label %1103

397:                                              ; preds = %385
  %398 = load i32, ptr %47, align 4, !tbaa !9
  %399 = icmp ne i32 %398, 41
  br i1 %399, label %400, label %408

400:                                              ; preds = %397
  br label %401

401:                                              ; preds = %400
  %402 = load ptr, ptr @stderr, align 8, !tbaa !5
  %403 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %402, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 368, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %404

404:                                              ; preds = %401
  br label %405

405:                                              ; preds = %404
  %406 = load ptr, ptr %3, align 8, !tbaa !5
  %407 = call i32 @tls_send_alert(ptr noundef %406, i32 noundef 10)
  br label %1103

408:                                              ; preds = %397
  %409 = load ptr, ptr %5, align 8, !tbaa !5
  %410 = getelementptr inbounds i8, ptr %409, i64 5
  %411 = load i64, ptr %7, align 8, !tbaa !11
  %412 = sub i64 %411, 5
  call void @sm3_update(ptr noundef %28, ptr noundef %410, i64 noundef %412)
  %413 = load ptr, ptr %3, align 8, !tbaa !5
  %414 = getelementptr inbounds %struct.TLS_CONNECT, ptr %413, i32 0, i32 17
  %415 = load i64, ptr %414, align 8, !tbaa !21
  %416 = icmp ne i64 %415, 0
  br i1 %416, label %417, label %423

417:                                              ; preds = %408
  %418 = load ptr, ptr %5, align 8, !tbaa !5
  %419 = getelementptr inbounds i8, ptr %418, i64 5
  %420 = load i64, ptr %7, align 8, !tbaa !11
  %421 = sub i64 %420, 5
  %422 = call i32 @sm2_sign_update(ptr noundef %24, ptr noundef %419, i64 noundef %421)
  br label %423

423:                                              ; preds = %417, %408
  %424 = load ptr, ptr %3, align 8, !tbaa !5
  %425 = getelementptr inbounds %struct.TLS_CONNECT, ptr %424, i32 0, i32 14
  %426 = getelementptr inbounds [2048 x i8], ptr %425, i64 0, i64 0
  %427 = load ptr, ptr %3, align 8, !tbaa !5
  %428 = getelementptr inbounds %struct.TLS_CONNECT, ptr %427, i32 0, i32 15
  %429 = load i64, ptr %428, align 8, !tbaa !25
  %430 = call i32 @x509_certs_get_cert_by_index(ptr noundef %426, i64 noundef %429, i32 noundef 0, ptr noundef %35, ptr noundef %37)
  %431 = icmp ne i32 %430, 1
  br i1 %431, label %437, label %432

432:                                              ; preds = %423
  %433 = load ptr, ptr %35, align 8, !tbaa !5
  %434 = load i64, ptr %37, align 8, !tbaa !11
  %435 = call i32 @x509_cert_get_subject_public_key(ptr noundef %433, i64 noundef %434, ptr noundef %23)
  %436 = icmp ne i32 %435, 1
  br i1 %436, label %437, label %445

437:                                              ; preds = %432, %423
  br label %438

438:                                              ; preds = %437
  %439 = load ptr, ptr @stderr, align 8, !tbaa !5
  %440 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %439, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 379, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %441

441:                                              ; preds = %438
  br label %442

442:                                              ; preds = %441
  %443 = load ptr, ptr %3, align 8, !tbaa !5
  %444 = call i32 @tls_send_alert(ptr noundef %443, i32 noundef 42)
  br label %1103

445:                                              ; preds = %432
  %446 = getelementptr inbounds [32 x i8], ptr %9, i64 0, i64 0
  %447 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %448 = load i32, ptr %47, align 4, !tbaa !9
  %449 = load ptr, ptr %25, align 8, !tbaa !5
  %450 = load i64, ptr %26, align 8, !tbaa !11
  %451 = call i32 @tls_verify_server_ecdh_params(ptr noundef %23, ptr noundef %446, ptr noundef %447, i32 noundef %448, ptr noundef %48, ptr noundef %449, i64 noundef %450)
  %452 = icmp ne i32 %451, 1
  br i1 %452, label %453, label %461

453:                                              ; preds = %445
  br label %454

454:                                              ; preds = %453
  %455 = load ptr, ptr @stderr, align 8, !tbaa !5
  %456 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %455, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 385, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %457

457:                                              ; preds = %454
  br label %458

458:                                              ; preds = %457
  %459 = load ptr, ptr %3, align 8, !tbaa !5
  %460 = call i32 @tls_send_alert(ptr noundef %459, i32 noundef 80)
  br label %1103

461:                                              ; preds = %445
  %462 = load ptr, ptr %5, align 8, !tbaa !5
  %463 = load ptr, ptr %3, align 8, !tbaa !5
  %464 = getelementptr inbounds %struct.TLS_CONNECT, ptr %463, i32 0, i32 4
  %465 = load i32, ptr %464, align 8, !tbaa !22
  %466 = call i32 @tls_record_recv(ptr noundef %462, ptr noundef %7, i32 noundef %465)
  %467 = icmp ne i32 %466, 1
  br i1 %467, label %488, label %468

468:                                              ; preds = %461
  %469 = load ptr, ptr %5, align 8, !tbaa !5
  %470 = getelementptr inbounds i8, ptr %469, i64 1
  %471 = load i8, ptr %470, align 1, !tbaa !23
  %472 = zext i8 %471 to i16
  %473 = zext i16 %472 to i32
  %474 = shl i32 %473, 8
  %475 = load ptr, ptr %5, align 8, !tbaa !5
  %476 = getelementptr inbounds i8, ptr %475, i64 2
  %477 = load i8, ptr %476, align 1, !tbaa !23
  %478 = zext i8 %477 to i32
  %479 = or i32 %474, %478
  %480 = load ptr, ptr %3, align 8, !tbaa !5
  %481 = getelementptr inbounds %struct.TLS_CONNECT, ptr %480, i32 0, i32 0
  %482 = load i32, ptr %481, align 8, !tbaa !13
  %483 = icmp ne i32 %479, %482
  br i1 %483, label %488, label %484

484:                                              ; preds = %468
  %485 = load ptr, ptr %5, align 8, !tbaa !5
  %486 = call i32 @tls_record_get_handshake(ptr noundef %485, ptr noundef %34, ptr noundef %35, ptr noundef %37)
  %487 = icmp ne i32 %486, 1
  br i1 %487, label %488, label %496

488:                                              ; preds = %484, %468, %461
  br label %489

489:                                              ; preds = %488
  %490 = load ptr, ptr @stderr, align 8, !tbaa !5
  %491 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %490, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 394, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %492

492:                                              ; preds = %489
  br label %493

493:                                              ; preds = %492
  %494 = load ptr, ptr %3, align 8, !tbaa !5
  %495 = call i32 @tls_send_alert(ptr noundef %494, i32 noundef 10)
  br label %1103

496:                                              ; preds = %484
  %497 = load i32, ptr %34, align 4, !tbaa !9
  %498 = icmp eq i32 %497, 13
  br i1 %498, label %499, label %598

499:                                              ; preds = %496
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %52) #7
  %500 = load ptr, ptr %5, align 8, !tbaa !5
  %501 = call i32 @tls_record_get_handshake_certificate_request(ptr noundef %500, ptr noundef %49, ptr noundef %50, ptr noundef %51, ptr noundef %52)
  %502 = icmp ne i32 %501, 1
  br i1 %502, label %503, label %511

503:                                              ; preds = %499
  br label %504

504:                                              ; preds = %503
  %505 = load ptr, ptr @stderr, align 8, !tbaa !5
  %506 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %505, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 409, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %507

507:                                              ; preds = %504
  br label %508

508:                                              ; preds = %507
  %509 = load ptr, ptr %3, align 8, !tbaa !5
  %510 = call i32 @tls_send_alert(ptr noundef %509, i32 noundef 10)
  store i32 4, ptr %53, align 4
  br label %595

511:                                              ; preds = %499
  %512 = load ptr, ptr %3, align 8, !tbaa !5
  %513 = getelementptr inbounds %struct.TLS_CONNECT, ptr %512, i32 0, i32 17
  %514 = load i64, ptr %513, align 8, !tbaa !21
  %515 = icmp ne i64 %514, 0
  br i1 %515, label %524, label %516

516:                                              ; preds = %511
  br label %517

517:                                              ; preds = %516
  %518 = load ptr, ptr @stderr, align 8, !tbaa !5
  %519 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %518, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 414, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %520

520:                                              ; preds = %517
  br label %521

521:                                              ; preds = %520
  %522 = load ptr, ptr %3, align 8, !tbaa !5
  %523 = call i32 @tls_send_alert(ptr noundef %522, i32 noundef 80)
  store i32 4, ptr %53, align 4
  br label %595

524:                                              ; preds = %511
  %525 = load ptr, ptr %49, align 8, !tbaa !5
  %526 = load i64, ptr %50, align 8, !tbaa !11
  %527 = load ptr, ptr %3, align 8, !tbaa !5
  %528 = getelementptr inbounds %struct.TLS_CONNECT, ptr %527, i32 0, i32 16
  %529 = getelementptr inbounds [2048 x i8], ptr %528, i64 0, i64 0
  %530 = load ptr, ptr %3, align 8, !tbaa !5
  %531 = getelementptr inbounds %struct.TLS_CONNECT, ptr %530, i32 0, i32 17
  %532 = load i64, ptr %531, align 8, !tbaa !21
  %533 = call i32 @tls_cert_types_accepted(ptr noundef %525, i64 noundef %526, ptr noundef %529, i64 noundef %532)
  %534 = icmp ne i32 %533, 1
  br i1 %534, label %546, label %535

535:                                              ; preds = %524
  %536 = load ptr, ptr %51, align 8, !tbaa !5
  %537 = load i64, ptr %52, align 8, !tbaa !11
  %538 = load ptr, ptr %3, align 8, !tbaa !5
  %539 = getelementptr inbounds %struct.TLS_CONNECT, ptr %538, i32 0, i32 16
  %540 = getelementptr inbounds [2048 x i8], ptr %539, i64 0, i64 0
  %541 = load ptr, ptr %3, align 8, !tbaa !5
  %542 = getelementptr inbounds %struct.TLS_CONNECT, ptr %541, i32 0, i32 17
  %543 = load i64, ptr %542, align 8, !tbaa !21
  %544 = call i32 @tls_authorities_issued_certificate(ptr noundef %536, i64 noundef %537, ptr noundef %540, i64 noundef %543)
  %545 = icmp ne i32 %544, 1
  br i1 %545, label %546, label %554

546:                                              ; preds = %535, %524
  br label %547

547:                                              ; preds = %546
  %548 = load ptr, ptr @stderr, align 8, !tbaa !5
  %549 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %548, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 420, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %550

550:                                              ; preds = %547
  br label %551

551:                                              ; preds = %550
  %552 = load ptr, ptr %3, align 8, !tbaa !5
  %553 = call i32 @tls_send_alert(ptr noundef %552, i32 noundef 43)
  store i32 4, ptr %53, align 4
  br label %595

554:                                              ; preds = %535
  %555 = load ptr, ptr %5, align 8, !tbaa !5
  %556 = getelementptr inbounds i8, ptr %555, i64 5
  %557 = load i64, ptr %7, align 8, !tbaa !11
  %558 = sub i64 %557, 5
  call void @sm3_update(ptr noundef %28, ptr noundef %556, i64 noundef %558)
  %559 = load ptr, ptr %5, align 8, !tbaa !5
  %560 = getelementptr inbounds i8, ptr %559, i64 5
  %561 = load i64, ptr %7, align 8, !tbaa !11
  %562 = sub i64 %561, 5
  %563 = call i32 @sm2_sign_update(ptr noundef %24, ptr noundef %560, i64 noundef %562)
  %564 = load ptr, ptr %5, align 8, !tbaa !5
  %565 = load ptr, ptr %3, align 8, !tbaa !5
  %566 = getelementptr inbounds %struct.TLS_CONNECT, ptr %565, i32 0, i32 4
  %567 = load i32, ptr %566, align 8, !tbaa !22
  %568 = call i32 @tls_record_recv(ptr noundef %564, ptr noundef %7, i32 noundef %567)
  %569 = icmp ne i32 %568, 1
  br i1 %569, label %586, label %570

570:                                              ; preds = %554
  %571 = load ptr, ptr %5, align 8, !tbaa !5
  %572 = getelementptr inbounds i8, ptr %571, i64 1
  %573 = load i8, ptr %572, align 1, !tbaa !23
  %574 = zext i8 %573 to i16
  %575 = zext i16 %574 to i32
  %576 = shl i32 %575, 8
  %577 = load ptr, ptr %5, align 8, !tbaa !5
  %578 = getelementptr inbounds i8, ptr %577, i64 2
  %579 = load i8, ptr %578, align 1, !tbaa !23
  %580 = zext i8 %579 to i32
  %581 = or i32 %576, %580
  %582 = load ptr, ptr %3, align 8, !tbaa !5
  %583 = getelementptr inbounds %struct.TLS_CONNECT, ptr %582, i32 0, i32 0
  %584 = load i32, ptr %583, align 8, !tbaa !13
  %585 = icmp ne i32 %581, %584
  br i1 %585, label %586, label %594

586:                                              ; preds = %570, %554
  br label %587

587:                                              ; preds = %586
  %588 = load ptr, ptr @stderr, align 8, !tbaa !5
  %589 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %588, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 430, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %590

590:                                              ; preds = %587
  br label %591

591:                                              ; preds = %590
  %592 = load ptr, ptr %3, align 8, !tbaa !5
  %593 = call i32 @tls_send_alert(ptr noundef %592, i32 noundef 10)
  store i32 4, ptr %53, align 4
  br label %595

594:                                              ; preds = %570
  store i32 0, ptr %53, align 4
  br label %595

595:                                              ; preds = %594, %591, %551, %521, %508
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #7
  %596 = load i32, ptr %53, align 4
  switch i32 %596, label %1106 [
    i32 0, label %597
    i32 4, label %1103
  ]

597:                                              ; preds = %595
  br label %603

598:                                              ; preds = %496
  %599 = load ptr, ptr %3, align 8, !tbaa !5
  %600 = getelementptr inbounds %struct.TLS_CONNECT, ptr %599, i32 0, i32 17
  store i64 0, ptr %600, align 8, !tbaa !21
  %601 = load ptr, ptr %3, align 8, !tbaa !5
  %602 = getelementptr inbounds %struct.TLS_CONNECT, ptr %601, i32 0, i32 20
  call void @gmssl_secure_clear(ptr noundef %602, i64 noundef 128)
  br label %603

603:                                              ; preds = %598, %597
  %604 = load ptr, ptr %5, align 8, !tbaa !5
  %605 = call i32 @tls_record_get_handshake_server_hello_done(ptr noundef %604)
  %606 = icmp ne i32 %605, 1
  br i1 %606, label %607, label %615

607:                                              ; preds = %603
  br label %608

608:                                              ; preds = %607
  %609 = load ptr, ptr @stderr, align 8, !tbaa !5
  %610 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %609, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 442, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %611

611:                                              ; preds = %608
  br label %612

612:                                              ; preds = %611
  %613 = load ptr, ptr %3, align 8, !tbaa !5
  %614 = call i32 @tls_send_alert(ptr noundef %613, i32 noundef 10)
  br label %1103

615:                                              ; preds = %603
  %616 = load ptr, ptr %5, align 8, !tbaa !5
  %617 = getelementptr inbounds i8, ptr %616, i64 5
  %618 = load i64, ptr %7, align 8, !tbaa !11
  %619 = sub i64 %618, 5
  call void @sm3_update(ptr noundef %28, ptr noundef %617, i64 noundef %619)
  %620 = load ptr, ptr %3, align 8, !tbaa !5
  %621 = getelementptr inbounds %struct.TLS_CONNECT, ptr %620, i32 0, i32 17
  %622 = load i64, ptr %621, align 8, !tbaa !21
  %623 = icmp ne i64 %622, 0
  br i1 %623, label %624, label %630

624:                                              ; preds = %615
  %625 = load ptr, ptr %5, align 8, !tbaa !5
  %626 = getelementptr inbounds i8, ptr %625, i64 5
  %627 = load i64, ptr %7, align 8, !tbaa !11
  %628 = sub i64 %627, 5
  %629 = call i32 @sm2_sign_update(ptr noundef %24, ptr noundef %626, i64 noundef %628)
  br label %630

630:                                              ; preds = %624, %615
  %631 = load ptr, ptr %3, align 8, !tbaa !5
  %632 = getelementptr inbounds %struct.TLS_CONNECT, ptr %631, i32 0, i32 17
  %633 = load i64, ptr %632, align 8, !tbaa !21
  %634 = icmp ne i64 %633, 0
  br i1 %634, label %635, label %677

635:                                              ; preds = %630
  %636 = load ptr, ptr %5, align 8, !tbaa !5
  %637 = load ptr, ptr %3, align 8, !tbaa !5
  %638 = getelementptr inbounds %struct.TLS_CONNECT, ptr %637, i32 0, i32 16
  %639 = getelementptr inbounds [2048 x i8], ptr %638, i64 0, i64 0
  %640 = load ptr, ptr %3, align 8, !tbaa !5
  %641 = getelementptr inbounds %struct.TLS_CONNECT, ptr %640, i32 0, i32 17
  %642 = load i64, ptr %641, align 8, !tbaa !21
  %643 = call i32 @tls_record_set_handshake_certificate(ptr noundef %636, ptr noundef %7, ptr noundef %639, i64 noundef %642)
  %644 = icmp ne i32 %643, 1
  br i1 %644, label %645, label %653

645:                                              ; preds = %635
  br label %646

646:                                              ; preds = %645
  %647 = load ptr, ptr @stderr, align 8, !tbaa !5
  %648 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %647, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 454, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %649

649:                                              ; preds = %646
  br label %650

650:                                              ; preds = %649
  %651 = load ptr, ptr %3, align 8, !tbaa !5
  %652 = call i32 @tls_send_alert(ptr noundef %651, i32 noundef 80)
  br label %1103

653:                                              ; preds = %635
  %654 = load ptr, ptr %5, align 8, !tbaa !5
  %655 = load i64, ptr %7, align 8, !tbaa !11
  %656 = load ptr, ptr %3, align 8, !tbaa !5
  %657 = getelementptr inbounds %struct.TLS_CONNECT, ptr %656, i32 0, i32 4
  %658 = load i32, ptr %657, align 8, !tbaa !22
  %659 = call i32 @tls_record_send(ptr noundef %654, i64 noundef %655, i32 noundef %658)
  %660 = icmp ne i32 %659, 1
  br i1 %660, label %661, label %667

661:                                              ; preds = %653
  br label %662

662:                                              ; preds = %661
  %663 = load ptr, ptr @stderr, align 8, !tbaa !5
  %664 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %663, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 460, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %665

665:                                              ; preds = %662
  br label %666

666:                                              ; preds = %665
  br label %1103

667:                                              ; preds = %653
  %668 = load ptr, ptr %5, align 8, !tbaa !5
  %669 = getelementptr inbounds i8, ptr %668, i64 5
  %670 = load i64, ptr %7, align 8, !tbaa !11
  %671 = sub i64 %670, 5
  call void @sm3_update(ptr noundef %28, ptr noundef %669, i64 noundef %671)
  %672 = load ptr, ptr %5, align 8, !tbaa !5
  %673 = getelementptr inbounds i8, ptr %672, i64 5
  %674 = load i64, ptr %7, align 8, !tbaa !11
  %675 = sub i64 %674, 5
  %676 = call i32 @sm2_sign_update(ptr noundef %24, ptr noundef %673, i64 noundef %675)
  br label %677

677:                                              ; preds = %667, %630
  %678 = call i32 @sm2_key_generate(ptr noundef %54)
  %679 = call i32 @sm2_do_ecdh(ptr noundef %54, ptr noundef %48, ptr noundef %48)
  %680 = getelementptr inbounds [64 x i8], ptr %55, i64 0, i64 0
  %681 = call i32 @sm2_z256_point_to_bytes(ptr noundef %48, ptr noundef %680)
  %682 = getelementptr inbounds [48 x i8], ptr %27, i64 0, i64 0
  %683 = getelementptr inbounds [64 x i8], ptr %55, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %682, ptr align 16 %683, i64 32, i1 false)
  %684 = getelementptr inbounds [48 x i8], ptr %27, i64 0, i64 0
  %685 = getelementptr inbounds [32 x i8], ptr %9, i64 0, i64 0
  %686 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %687 = load ptr, ptr %3, align 8, !tbaa !5
  %688 = getelementptr inbounds %struct.TLS_CONNECT, ptr %687, i32 0, i32 23
  %689 = getelementptr inbounds [48 x i8], ptr %688, i64 0, i64 0
  %690 = call i32 @tls_prf(ptr noundef %684, i64 noundef 32, ptr noundef @.str.3, ptr noundef %685, i64 noundef 32, ptr noundef %686, i64 noundef 32, i64 noundef 48, ptr noundef %689)
  %691 = icmp ne i32 %690, 1
  br i1 %691, label %703, label %692

692:                                              ; preds = %677
  %693 = load ptr, ptr %3, align 8, !tbaa !5
  %694 = getelementptr inbounds %struct.TLS_CONNECT, ptr %693, i32 0, i32 23
  %695 = getelementptr inbounds [48 x i8], ptr %694, i64 0, i64 0
  %696 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %697 = getelementptr inbounds [32 x i8], ptr %9, i64 0, i64 0
  %698 = load ptr, ptr %3, align 8, !tbaa !5
  %699 = getelementptr inbounds %struct.TLS_CONNECT, ptr %698, i32 0, i32 24
  %700 = getelementptr inbounds [96 x i8], ptr %699, i64 0, i64 0
  %701 = call i32 @tls_prf(ptr noundef %695, i64 noundef 48, ptr noundef @.str.4, ptr noundef %696, i64 noundef 32, ptr noundef %697, i64 noundef 32, i64 noundef 96, ptr noundef %700)
  %702 = icmp ne i32 %701, 1
  br i1 %702, label %703, label %711

703:                                              ; preds = %692, %677
  br label %704

704:                                              ; preds = %703
  %705 = load ptr, ptr @stderr, align 8, !tbaa !5
  %706 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %705, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 486, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %707

707:                                              ; preds = %704
  br label %708

708:                                              ; preds = %707
  %709 = load ptr, ptr %3, align 8, !tbaa !5
  %710 = call i32 @tls_send_alert(ptr noundef %709, i32 noundef 80)
  br label %1103

711:                                              ; preds = %692
  %712 = load ptr, ptr %3, align 8, !tbaa !5
  %713 = getelementptr inbounds %struct.TLS_CONNECT, ptr %712, i32 0, i32 25
  %714 = load ptr, ptr %3, align 8, !tbaa !5
  %715 = getelementptr inbounds %struct.TLS_CONNECT, ptr %714, i32 0, i32 24
  %716 = getelementptr inbounds [96 x i8], ptr %715, i64 0, i64 0
  call void @sm3_hmac_init(ptr noundef %713, ptr noundef %716, i64 noundef 32)
  %717 = load ptr, ptr %3, align 8, !tbaa !5
  %718 = getelementptr inbounds %struct.TLS_CONNECT, ptr %717, i32 0, i32 26
  %719 = load ptr, ptr %3, align 8, !tbaa !5
  %720 = getelementptr inbounds %struct.TLS_CONNECT, ptr %719, i32 0, i32 24
  %721 = getelementptr inbounds [96 x i8], ptr %720, i64 0, i64 0
  %722 = getelementptr inbounds i8, ptr %721, i64 32
  call void @sm3_hmac_init(ptr noundef %718, ptr noundef %722, i64 noundef 32)
  %723 = load ptr, ptr %3, align 8, !tbaa !5
  %724 = getelementptr inbounds %struct.TLS_CONNECT, ptr %723, i32 0, i32 27
  %725 = load ptr, ptr %3, align 8, !tbaa !5
  %726 = getelementptr inbounds %struct.TLS_CONNECT, ptr %725, i32 0, i32 24
  %727 = getelementptr inbounds [96 x i8], ptr %726, i64 0, i64 0
  %728 = getelementptr inbounds i8, ptr %727, i64 64
  call void @sm4_set_encrypt_key(ptr noundef %724, ptr noundef %728)
  %729 = load ptr, ptr %3, align 8, !tbaa !5
  %730 = getelementptr inbounds %struct.TLS_CONNECT, ptr %729, i32 0, i32 28
  %731 = load ptr, ptr %3, align 8, !tbaa !5
  %732 = getelementptr inbounds %struct.TLS_CONNECT, ptr %731, i32 0, i32 24
  %733 = getelementptr inbounds [96 x i8], ptr %732, i64 0, i64 0
  %734 = getelementptr inbounds i8, ptr %733, i64 80
  call void @sm4_set_decrypt_key(ptr noundef %730, ptr noundef %734)
  %735 = load ptr, ptr @stderr, align 8, !tbaa !5
  %736 = getelementptr inbounds [48 x i8], ptr %27, i64 0, i64 0
  %737 = getelementptr inbounds [32 x i8], ptr %9, i64 0, i64 0
  %738 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %739 = load ptr, ptr %3, align 8, !tbaa !5
  %740 = getelementptr inbounds %struct.TLS_CONNECT, ptr %739, i32 0, i32 23
  %741 = getelementptr inbounds [48 x i8], ptr %740, i64 0, i64 0
  %742 = load ptr, ptr %3, align 8, !tbaa !5
  %743 = getelementptr inbounds %struct.TLS_CONNECT, ptr %742, i32 0, i32 24
  %744 = getelementptr inbounds [96 x i8], ptr %743, i64 0, i64 0
  %745 = call i32 @tls_secrets_print(ptr noundef %735, ptr noundef %736, i64 noundef 48, ptr noundef %737, ptr noundef %738, ptr noundef %741, ptr noundef %744, i64 noundef 96, i32 noundef 0, i32 noundef 4)
  %746 = load ptr, ptr %5, align 8, !tbaa !5
  %747 = getelementptr inbounds %struct.SM2_KEY, ptr %54, i32 0, i32 0
  %748 = call i32 @tls_record_set_handshake_client_key_exchange_ecdhe(ptr noundef %746, ptr noundef %7, ptr noundef %747)
  %749 = icmp ne i32 %748, 1
  br i1 %749, label %750, label %758

750:                                              ; preds = %711
  br label %751

751:                                              ; preds = %750
  %752 = load ptr, ptr @stderr, align 8, !tbaa !5
  %753 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %752, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 505, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %754

754:                                              ; preds = %751
  br label %755

755:                                              ; preds = %754
  %756 = load ptr, ptr %3, align 8, !tbaa !5
  %757 = call i32 @tls_send_alert(ptr noundef %756, i32 noundef 80)
  br label %1103

758:                                              ; preds = %711
  %759 = load ptr, ptr %5, align 8, !tbaa !5
  %760 = load i64, ptr %7, align 8, !tbaa !11
  %761 = load ptr, ptr %3, align 8, !tbaa !5
  %762 = getelementptr inbounds %struct.TLS_CONNECT, ptr %761, i32 0, i32 4
  %763 = load i32, ptr %762, align 8, !tbaa !22
  %764 = call i32 @tls_record_send(ptr noundef %759, i64 noundef %760, i32 noundef %763)
  %765 = icmp ne i32 %764, 1
  br i1 %765, label %766, label %772

766:                                              ; preds = %758
  br label %767

767:                                              ; preds = %766
  %768 = load ptr, ptr @stderr, align 8, !tbaa !5
  %769 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %768, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 511, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %770

770:                                              ; preds = %767
  br label %771

771:                                              ; preds = %770
  br label %1103

772:                                              ; preds = %758
  %773 = load ptr, ptr %5, align 8, !tbaa !5
  %774 = getelementptr inbounds i8, ptr %773, i64 5
  %775 = load i64, ptr %7, align 8, !tbaa !11
  %776 = sub i64 %775, 5
  call void @sm3_update(ptr noundef %28, ptr noundef %774, i64 noundef %776)
  %777 = load ptr, ptr %3, align 8, !tbaa !5
  %778 = getelementptr inbounds %struct.TLS_CONNECT, ptr %777, i32 0, i32 17
  %779 = load i64, ptr %778, align 8, !tbaa !21
  %780 = icmp ne i64 %779, 0
  br i1 %780, label %781, label %787

781:                                              ; preds = %772
  %782 = load ptr, ptr %5, align 8, !tbaa !5
  %783 = getelementptr inbounds i8, ptr %782, i64 5
  %784 = load i64, ptr %7, align 8, !tbaa !11
  %785 = sub i64 %784, 5
  %786 = call i32 @sm2_sign_update(ptr noundef %24, ptr noundef %783, i64 noundef %785)
  br label %787

787:                                              ; preds = %781, %772
  %788 = load ptr, ptr %3, align 8, !tbaa !5
  %789 = getelementptr inbounds %struct.TLS_CONNECT, ptr %788, i32 0, i32 17
  %790 = load i64, ptr %789, align 8, !tbaa !21
  %791 = icmp ne i64 %790, 0
  br i1 %791, label %792, label %832

792:                                              ; preds = %787
  call void @llvm.lifetime.start.p0(i64 72, ptr %56) #7
  %793 = getelementptr inbounds [72 x i8], ptr %56, i64 0, i64 0
  %794 = call i32 @sm2_sign_finish(ptr noundef %24, ptr noundef %793, ptr noundef %26)
  %795 = icmp ne i32 %794, 1
  br i1 %795, label %802, label %796

796:                                              ; preds = %792
  %797 = load ptr, ptr %5, align 8, !tbaa !5
  %798 = getelementptr inbounds [72 x i8], ptr %56, i64 0, i64 0
  %799 = load i64, ptr %26, align 8, !tbaa !11
  %800 = call i32 @tls_record_set_handshake_certificate_verify(ptr noundef %797, ptr noundef %7, ptr noundef %798, i64 noundef %799)
  %801 = icmp ne i32 %800, 1
  br i1 %801, label %802, label %810

802:                                              ; preds = %796, %792
  br label %803

803:                                              ; preds = %802
  %804 = load ptr, ptr @stderr, align 8, !tbaa !5
  %805 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %804, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 524, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %806

806:                                              ; preds = %803
  br label %807

807:                                              ; preds = %806
  %808 = load ptr, ptr %3, align 8, !tbaa !5
  %809 = call i32 @tls_send_alert(ptr noundef %808, i32 noundef 80)
  store i32 4, ptr %53, align 4
  br label %829

810:                                              ; preds = %796
  %811 = load ptr, ptr %5, align 8, !tbaa !5
  %812 = load i64, ptr %7, align 8, !tbaa !11
  %813 = load ptr, ptr %3, align 8, !tbaa !5
  %814 = getelementptr inbounds %struct.TLS_CONNECT, ptr %813, i32 0, i32 4
  %815 = load i32, ptr %814, align 8, !tbaa !22
  %816 = call i32 @tls_record_send(ptr noundef %811, i64 noundef %812, i32 noundef %815)
  %817 = icmp ne i32 %816, 1
  br i1 %817, label %818, label %824

818:                                              ; preds = %810
  br label %819

819:                                              ; preds = %818
  %820 = load ptr, ptr @stderr, align 8, !tbaa !5
  %821 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %820, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 530, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %822

822:                                              ; preds = %819
  br label %823

823:                                              ; preds = %822
  store i32 4, ptr %53, align 4
  br label %829

824:                                              ; preds = %810
  %825 = load ptr, ptr %5, align 8, !tbaa !5
  %826 = getelementptr inbounds i8, ptr %825, i64 5
  %827 = load i64, ptr %7, align 8, !tbaa !11
  %828 = sub i64 %827, 5
  call void @sm3_update(ptr noundef %28, ptr noundef %826, i64 noundef %828)
  store i32 0, ptr %53, align 4
  br label %829

829:                                              ; preds = %824, %823, %807
  call void @llvm.lifetime.end.p0(i64 72, ptr %56) #7
  %830 = load i32, ptr %53, align 4
  switch i32 %830, label %1106 [
    i32 0, label %831
    i32 4, label %1103
  ]

831:                                              ; preds = %829
  br label %832

832:                                              ; preds = %831, %787
  %833 = load ptr, ptr %5, align 8, !tbaa !5
  %834 = call i32 @tls_record_set_change_cipher_spec(ptr noundef %833, ptr noundef %7)
  %835 = icmp ne i32 %834, 1
  br i1 %835, label %836, label %844

836:                                              ; preds = %832
  br label %837

837:                                              ; preds = %836
  %838 = load ptr, ptr @stderr, align 8, !tbaa !5
  %839 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %838, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 539, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %840

840:                                              ; preds = %837
  br label %841

841:                                              ; preds = %840
  %842 = load ptr, ptr %3, align 8, !tbaa !5
  %843 = call i32 @tls_send_alert(ptr noundef %842, i32 noundef 80)
  br label %1103

844:                                              ; preds = %832
  %845 = load ptr, ptr %5, align 8, !tbaa !5
  %846 = load i64, ptr %7, align 8, !tbaa !11
  %847 = load ptr, ptr %3, align 8, !tbaa !5
  %848 = getelementptr inbounds %struct.TLS_CONNECT, ptr %847, i32 0, i32 4
  %849 = load i32, ptr %848, align 8, !tbaa !22
  %850 = call i32 @tls_record_send(ptr noundef %845, i64 noundef %846, i32 noundef %849)
  %851 = icmp ne i32 %850, 1
  br i1 %851, label %852, label %858

852:                                              ; preds = %844
  br label %853

853:                                              ; preds = %852
  %854 = load ptr, ptr @stderr, align 8, !tbaa !5
  %855 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %854, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 545, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %856

856:                                              ; preds = %853
  br label %857

857:                                              ; preds = %856
  br label %1103

858:                                              ; preds = %844
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %28, i64 112, i1 false)
  %859 = getelementptr inbounds [32 x i8], ptr %30, i64 0, i64 0
  call void @sm3_finish(ptr noundef %29, ptr noundef %859)
  %860 = load ptr, ptr %3, align 8, !tbaa !5
  %861 = getelementptr inbounds %struct.TLS_CONNECT, ptr %860, i32 0, i32 23
  %862 = getelementptr inbounds [48 x i8], ptr %861, i64 0, i64 0
  %863 = getelementptr inbounds [32 x i8], ptr %30, i64 0, i64 0
  %864 = getelementptr inbounds [12 x i8], ptr %33, i64 0, i64 0
  %865 = call i32 @tls_prf(ptr noundef %862, i64 noundef 48, ptr noundef @.str.5, ptr noundef %863, i64 noundef 32, ptr noundef null, i64 noundef 0, i64 noundef 12, ptr noundef %864)
  %866 = icmp ne i32 %865, 1
  br i1 %866, label %872, label %867

867:                                              ; preds = %858
  %868 = getelementptr inbounds [309 x i8], ptr %6, i64 0, i64 0
  %869 = getelementptr inbounds [12 x i8], ptr %33, i64 0, i64 0
  %870 = call i32 @tls_record_set_handshake_finished(ptr noundef %868, ptr noundef %8, ptr noundef %869, i64 noundef 12)
  %871 = icmp ne i32 %870, 1
  br i1 %871, label %872, label %880

872:                                              ; preds = %867, %858
  br label %873

873:                                              ; preds = %872
  %874 = load ptr, ptr @stderr, align 8, !tbaa !5
  %875 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %874, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 557, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %876

876:                                              ; preds = %873
  br label %877

877:                                              ; preds = %876
  %878 = load ptr, ptr %3, align 8, !tbaa !5
  %879 = call i32 @tls_send_alert(ptr noundef %878, i32 noundef 80)
  br label %1103

880:                                              ; preds = %867
  %881 = getelementptr inbounds [309 x i8], ptr %6, i64 0, i64 0
  %882 = getelementptr inbounds i8, ptr %881, i64 5
  %883 = load i64, ptr %8, align 8, !tbaa !11
  %884 = sub i64 %883, 5
  call void @sm3_update(ptr noundef %28, ptr noundef %882, i64 noundef %884)
  %885 = load ptr, ptr %3, align 8, !tbaa !5
  %886 = getelementptr inbounds %struct.TLS_CONNECT, ptr %885, i32 0, i32 25
  %887 = load ptr, ptr %3, align 8, !tbaa !5
  %888 = getelementptr inbounds %struct.TLS_CONNECT, ptr %887, i32 0, i32 27
  %889 = load ptr, ptr %3, align 8, !tbaa !5
  %890 = getelementptr inbounds %struct.TLS_CONNECT, ptr %889, i32 0, i32 29
  %891 = getelementptr inbounds [8 x i8], ptr %890, i64 0, i64 0
  %892 = getelementptr inbounds [309 x i8], ptr %6, i64 0, i64 0
  %893 = load i64, ptr %8, align 8, !tbaa !11
  %894 = load ptr, ptr %5, align 8, !tbaa !5
  %895 = call i32 @tls_record_encrypt(ptr noundef %886, ptr noundef %888, ptr noundef %891, ptr noundef %892, i64 noundef %893, ptr noundef %894, ptr noundef %7)
  %896 = icmp ne i32 %895, 1
  br i1 %896, label %897, label %905

897:                                              ; preds = %880
  br label %898

898:                                              ; preds = %897
  %899 = load ptr, ptr @stderr, align 8, !tbaa !5
  %900 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %899, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 568, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %901

901:                                              ; preds = %898
  br label %902

902:                                              ; preds = %901
  %903 = load ptr, ptr %3, align 8, !tbaa !5
  %904 = call i32 @tls_send_alert(ptr noundef %903, i32 noundef 80)
  br label %1103

905:                                              ; preds = %880
  %906 = load ptr, ptr %3, align 8, !tbaa !5
  %907 = getelementptr inbounds %struct.TLS_CONNECT, ptr %906, i32 0, i32 29
  %908 = getelementptr inbounds [8 x i8], ptr %907, i64 0, i64 0
  %909 = call i32 @tls_seq_num_incr(ptr noundef %908)
  %910 = load ptr, ptr %5, align 8, !tbaa !5
  %911 = load i64, ptr %7, align 8, !tbaa !11
  %912 = load ptr, ptr %3, align 8, !tbaa !5
  %913 = getelementptr inbounds %struct.TLS_CONNECT, ptr %912, i32 0, i32 4
  %914 = load i32, ptr %913, align 8, !tbaa !22
  %915 = call i32 @tls_record_send(ptr noundef %910, i64 noundef %911, i32 noundef %914)
  %916 = icmp ne i32 %915, 1
  br i1 %916, label %917, label %923

917:                                              ; preds = %905
  br label %918

918:                                              ; preds = %917
  %919 = load ptr, ptr @stderr, align 8, !tbaa !5
  %920 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %919, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 575, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %921

921:                                              ; preds = %918
  br label %922

922:                                              ; preds = %921
  br label %1103

923:                                              ; preds = %905
  %924 = load ptr, ptr %5, align 8, !tbaa !5
  %925 = load ptr, ptr %3, align 8, !tbaa !5
  %926 = getelementptr inbounds %struct.TLS_CONNECT, ptr %925, i32 0, i32 4
  %927 = load i32, ptr %926, align 8, !tbaa !22
  %928 = call i32 @tls_record_recv(ptr noundef %924, ptr noundef %7, i32 noundef %927)
  %929 = icmp ne i32 %928, 1
  br i1 %929, label %946, label %930

930:                                              ; preds = %923
  %931 = load ptr, ptr %5, align 8, !tbaa !5
  %932 = getelementptr inbounds i8, ptr %931, i64 1
  %933 = load i8, ptr %932, align 1, !tbaa !23
  %934 = zext i8 %933 to i16
  %935 = zext i16 %934 to i32
  %936 = shl i32 %935, 8
  %937 = load ptr, ptr %5, align 8, !tbaa !5
  %938 = getelementptr inbounds i8, ptr %937, i64 2
  %939 = load i8, ptr %938, align 1, !tbaa !23
  %940 = zext i8 %939 to i32
  %941 = or i32 %936, %940
  %942 = load ptr, ptr %3, align 8, !tbaa !5
  %943 = getelementptr inbounds %struct.TLS_CONNECT, ptr %942, i32 0, i32 0
  %944 = load i32, ptr %943, align 8, !tbaa !13
  %945 = icmp ne i32 %941, %944
  br i1 %945, label %946, label %954

946:                                              ; preds = %930, %923
  br label %947

947:                                              ; preds = %946
  %948 = load ptr, ptr @stderr, align 8, !tbaa !5
  %949 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %948, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 583, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %950

950:                                              ; preds = %947
  br label %951

951:                                              ; preds = %950
  %952 = load ptr, ptr %3, align 8, !tbaa !5
  %953 = call i32 @tls_send_alert(ptr noundef %952, i32 noundef 10)
  br label %1103

954:                                              ; preds = %930
  %955 = load ptr, ptr %5, align 8, !tbaa !5
  %956 = call i32 @tls_record_get_change_cipher_spec(ptr noundef %955)
  %957 = icmp ne i32 %956, 1
  br i1 %957, label %958, label %966

958:                                              ; preds = %954
  br label %959

959:                                              ; preds = %958
  %960 = load ptr, ptr @stderr, align 8, !tbaa !5
  %961 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %960, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 589, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %962

962:                                              ; preds = %959
  br label %963

963:                                              ; preds = %962
  %964 = load ptr, ptr %3, align 8, !tbaa !5
  %965 = call i32 @tls_send_alert(ptr noundef %964, i32 noundef 10)
  br label %1103

966:                                              ; preds = %954
  %967 = load ptr, ptr %5, align 8, !tbaa !5
  %968 = load ptr, ptr %3, align 8, !tbaa !5
  %969 = getelementptr inbounds %struct.TLS_CONNECT, ptr %968, i32 0, i32 4
  %970 = load i32, ptr %969, align 8, !tbaa !22
  %971 = call i32 @tls_record_recv(ptr noundef %967, ptr noundef %7, i32 noundef %970)
  %972 = icmp ne i32 %971, 1
  br i1 %972, label %989, label %973

973:                                              ; preds = %966
  %974 = load ptr, ptr %5, align 8, !tbaa !5
  %975 = getelementptr inbounds i8, ptr %974, i64 1
  %976 = load i8, ptr %975, align 1, !tbaa !23
  %977 = zext i8 %976 to i16
  %978 = zext i16 %977 to i32
  %979 = shl i32 %978, 8
  %980 = load ptr, ptr %5, align 8, !tbaa !5
  %981 = getelementptr inbounds i8, ptr %980, i64 2
  %982 = load i8, ptr %981, align 1, !tbaa !23
  %983 = zext i8 %982 to i32
  %984 = or i32 %979, %983
  %985 = load ptr, ptr %3, align 8, !tbaa !5
  %986 = getelementptr inbounds %struct.TLS_CONNECT, ptr %985, i32 0, i32 0
  %987 = load i32, ptr %986, align 8, !tbaa !13
  %988 = icmp ne i32 %984, %987
  br i1 %988, label %989, label %997

989:                                              ; preds = %973, %966
  br label %990

990:                                              ; preds = %989
  %991 = load ptr, ptr @stderr, align 8, !tbaa !5
  %992 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %991, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 598, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %993

993:                                              ; preds = %990
  br label %994

994:                                              ; preds = %993
  %995 = load ptr, ptr %3, align 8, !tbaa !5
  %996 = call i32 @tls_send_alert(ptr noundef %995, i32 noundef 10)
  br label %1103

997:                                              ; preds = %973
  %998 = load i64, ptr %7, align 8, !tbaa !11
  %999 = icmp ugt i64 %998, 309
  br i1 %999, label %1000, label %1008

1000:                                             ; preds = %997
  br label %1001

1001:                                             ; preds = %1000
  %1002 = load ptr, ptr @stderr, align 8, !tbaa !5
  %1003 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1002, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 603, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %1004

1004:                                             ; preds = %1001
  br label %1005

1005:                                             ; preds = %1004
  %1006 = load ptr, ptr %3, align 8, !tbaa !5
  %1007 = call i32 @tls_send_alert(ptr noundef %1006, i32 noundef 20)
  br label %1103

1008:                                             ; preds = %997
  %1009 = load ptr, ptr %3, align 8, !tbaa !5
  %1010 = getelementptr inbounds %struct.TLS_CONNECT, ptr %1009, i32 0, i32 26
  %1011 = load ptr, ptr %3, align 8, !tbaa !5
  %1012 = getelementptr inbounds %struct.TLS_CONNECT, ptr %1011, i32 0, i32 28
  %1013 = load ptr, ptr %3, align 8, !tbaa !5
  %1014 = getelementptr inbounds %struct.TLS_CONNECT, ptr %1013, i32 0, i32 30
  %1015 = getelementptr inbounds [8 x i8], ptr %1014, i64 0, i64 0
  %1016 = load ptr, ptr %5, align 8, !tbaa !5
  %1017 = load i64, ptr %7, align 8, !tbaa !11
  %1018 = getelementptr inbounds [309 x i8], ptr %6, i64 0, i64 0
  %1019 = call i32 @tls_record_decrypt(ptr noundef %1010, ptr noundef %1012, ptr noundef %1015, ptr noundef %1016, i64 noundef %1017, ptr noundef %1018, ptr noundef %8)
  %1020 = icmp ne i32 %1019, 1
  br i1 %1020, label %1021, label %1029

1021:                                             ; preds = %1008
  br label %1022

1022:                                             ; preds = %1021
  %1023 = load ptr, ptr @stderr, align 8, !tbaa !5
  %1024 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1023, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 611, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %1025

1025:                                             ; preds = %1022
  br label %1026

1026:                                             ; preds = %1025
  %1027 = load ptr, ptr %3, align 8, !tbaa !5
  %1028 = call i32 @tls_send_alert(ptr noundef %1027, i32 noundef 20)
  br label %1103

1029:                                             ; preds = %1008
  %1030 = load ptr, ptr %3, align 8, !tbaa !5
  %1031 = getelementptr inbounds %struct.TLS_CONNECT, ptr %1030, i32 0, i32 30
  %1032 = getelementptr inbounds [8 x i8], ptr %1031, i64 0, i64 0
  %1033 = call i32 @tls_seq_num_incr(ptr noundef %1032)
  %1034 = getelementptr inbounds [309 x i8], ptr %6, i64 0, i64 0
  %1035 = call i32 @tls_record_get_handshake_finished(ptr noundef %1034, ptr noundef %31, ptr noundef %32)
  %1036 = icmp ne i32 %1035, 1
  br i1 %1036, label %1037, label %1045

1037:                                             ; preds = %1029
  br label %1038

1038:                                             ; preds = %1037
  %1039 = load ptr, ptr @stderr, align 8, !tbaa !5
  %1040 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1039, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 618, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %1041

1041:                                             ; preds = %1038
  br label %1042

1042:                                             ; preds = %1041
  %1043 = load ptr, ptr %3, align 8, !tbaa !5
  %1044 = call i32 @tls_send_alert(ptr noundef %1043, i32 noundef 10)
  br label %1103

1045:                                             ; preds = %1029
  %1046 = load i64, ptr %32, align 8, !tbaa !11
  %1047 = icmp ne i64 %1046, 12
  br i1 %1047, label %1048, label %1056

1048:                                             ; preds = %1045
  br label %1049

1049:                                             ; preds = %1048
  %1050 = load ptr, ptr @stderr, align 8, !tbaa !5
  %1051 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1050, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 623, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %1052

1052:                                             ; preds = %1049
  br label %1053

1053:                                             ; preds = %1052
  %1054 = load ptr, ptr %3, align 8, !tbaa !5
  %1055 = call i32 @tls_send_alert(ptr noundef %1054, i32 noundef 10)
  br label %1103

1056:                                             ; preds = %1045
  %1057 = getelementptr inbounds [32 x i8], ptr %30, i64 0, i64 0
  call void @sm3_finish(ptr noundef %28, ptr noundef %1057)
  %1058 = load ptr, ptr %3, align 8, !tbaa !5
  %1059 = getelementptr inbounds %struct.TLS_CONNECT, ptr %1058, i32 0, i32 23
  %1060 = getelementptr inbounds [48 x i8], ptr %1059, i64 0, i64 0
  %1061 = getelementptr inbounds [32 x i8], ptr %30, i64 0, i64 0
  %1062 = getelementptr inbounds [12 x i8], ptr %33, i64 0, i64 0
  %1063 = call i32 @tls_prf(ptr noundef %1060, i64 noundef 48, ptr noundef @.str.6, ptr noundef %1061, i64 noundef 32, ptr noundef null, i64 noundef 0, i64 noundef 12, ptr noundef %1062)
  %1064 = icmp ne i32 %1063, 1
  br i1 %1064, label %1065, label %1073

1065:                                             ; preds = %1056
  br label %1066

1066:                                             ; preds = %1065
  %1067 = load ptr, ptr @stderr, align 8, !tbaa !5
  %1068 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1067, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 630, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %1069

1069:                                             ; preds = %1066
  br label %1070

1070:                                             ; preds = %1069
  %1071 = load ptr, ptr %3, align 8, !tbaa !5
  %1072 = call i32 @tls_send_alert(ptr noundef %1071, i32 noundef 80)
  br label %1103

1073:                                             ; preds = %1056
  %1074 = load ptr, ptr %31, align 8, !tbaa !5
  %1075 = getelementptr inbounds [12 x i8], ptr %33, i64 0, i64 0
  %1076 = call i32 @memcmp(ptr noundef %1074, ptr noundef %1075, i64 noundef 12) #8
  %1077 = icmp ne i32 %1076, 0
  br i1 %1077, label %1078, label %1086

1078:                                             ; preds = %1073
  br label %1079

1079:                                             ; preds = %1078
  %1080 = load ptr, ptr @stderr, align 8, !tbaa !5
  %1081 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1080, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 635, ptr noundef @__FUNCTION__.tls12_do_connect) #7
  br label %1082

1082:                                             ; preds = %1079
  br label %1083

1083:                                             ; preds = %1082
  %1084 = load ptr, ptr %3, align 8, !tbaa !5
  %1085 = call i32 @tls_send_alert(ptr noundef %1084, i32 noundef 51)
  br label %1103

1086:                                             ; preds = %1073
  %1087 = load ptr, ptr %3, align 8, !tbaa !5
  %1088 = getelementptr inbounds %struct.TLS_CONNECT, ptr %1087, i32 0, i32 35
  %1089 = load i32, ptr %1088, align 8, !tbaa !27
  %1090 = icmp ne i32 %1089, 0
  br i1 %1090, label %1094, label %1091

1091:                                             ; preds = %1086
  %1092 = load ptr, ptr @stderr, align 8, !tbaa !5
  %1093 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1092, ptr noundef @.str.7) #7
  br label %1094

1094:                                             ; preds = %1091, %1086
  %1095 = load ptr, ptr %3, align 8, !tbaa !5
  %1096 = getelementptr inbounds %struct.TLS_CONNECT, ptr %1095, i32 0, i32 0
  %1097 = load i32, ptr %1096, align 8, !tbaa !13
  %1098 = load ptr, ptr %3, align 8, !tbaa !5
  %1099 = getelementptr inbounds %struct.TLS_CONNECT, ptr %1098, i32 0, i32 0
  store i32 %1097, ptr %1099, align 8, !tbaa !13
  %1100 = load i32, ptr %12, align 4, !tbaa !9
  %1101 = load ptr, ptr %3, align 8, !tbaa !5
  %1102 = getelementptr inbounds %struct.TLS_CONNECT, ptr %1101, i32 0, i32 11
  store i32 %1100, ptr %1102, align 8, !tbaa !24
  store i32 1, ptr %4, align 4, !tbaa !9
  br label %1103

1103:                                             ; preds = %1094, %1083, %1070, %1053, %1042, %1026, %1005, %994, %963, %951, %922, %902, %877, %857, %841, %829, %771, %755, %708, %666, %650, %612, %595, %493, %458, %442, %405, %394, %382, %351, %312, %295, %239, %217, %206, %194, %180, %168, %144, %116, %102
  call void @gmssl_secure_clear(ptr noundef %24, i64 noundef 3976)
  %1104 = getelementptr inbounds [48 x i8], ptr %27, i64 0, i64 0
  call void @gmssl_secure_clear(ptr noundef %1104, i64 noundef 48)
  %1105 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %1105, ptr %2, align 4
  store i32 1, ptr %53, align 4
  br label %1106

1106:                                             ; preds = %1103, %829, %595
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 3976, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 309, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  %1107 = load i32, ptr %2, align 4
  ret i32 %1107
}

declare i32 @tls_record_set_protocol(ptr noundef, i32 noundef) #3

declare void @sm3_init(ptr noundef) #3

declare i32 @sm2_sign_init(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @tls_random_generate(ptr noundef) #3

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

; 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) #5

declare i32 @tls_ec_point_formats_ext_to_bytes(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #3

declare i32 @tls_supported_groups_ext_to_bytes(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #3

declare i32 @tls_signature_algorithms_ext_to_bytes(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #3

declare i32 @tls_record_set_handshake_client_hello(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) #3

declare i32 @tls_record_send(ptr noundef, i64 noundef, i32 noundef) #3

declare void @sm3_update(ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @sm2_sign_update(ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @tls_record_recv(ptr noundef, ptr noundef, i32 noundef) #3

declare i32 @tls_send_alert(ptr noundef, i32 noundef) #3

declare i32 @tls_record_get_handshake_server_hello(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @tls_cipher_suite_in_list(i32 noundef, ptr noundef, i64 noundef) #3

declare i32 @tls_process_server_hello_exts(ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @tls_record_get_handshake_certificate(ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @x509_certs_verify(ptr noundef, i64 noundef, i32 noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef) #3

declare i32 @x509_certs_get_cert_by_index(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) #3

declare i32 @x509_cert_get_subject_public_key(ptr noundef, i64 noundef, ptr noundef) #3

declare i32 @tls_verify_server_ecdh_params(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @tls_record_get_handshake_certificate_request(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @tls_cert_types_accepted(ptr noundef, i64 noundef, ptr noundef, i64 noundef) #3

declare i32 @tls_authorities_issued_certificate(ptr noundef, i64 noundef, ptr noundef, i64 noundef) #3

declare void @gmssl_secure_clear(ptr noundef, i64 noundef) #3

declare i32 @tls_record_get_handshake_server_hello_done(ptr noundef) #3

declare i32 @tls_record_set_handshake_certificate(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @sm2_key_generate(ptr noundef) #3

declare i32 @sm2_do_ecdh(ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @sm2_z256_point_to_bytes(ptr noundef, ptr noundef) #3

declare i32 @tls_prf(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

declare void @sm3_hmac_init(ptr noundef, ptr noundef, i64 noundef) #3

declare void @sm4_set_encrypt_key(ptr noundef, ptr noundef) #3

declare void @sm4_set_decrypt_key(ptr noundef, ptr noundef) #3

declare i32 @tls_secrets_print(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i32 noundef, i32 noundef) #3

declare i32 @sm2_sign_finish(ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @tls_record_set_handshake_certificate_verify(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @tls_record_set_change_cipher_spec(ptr noundef, ptr noundef) #3

declare void @sm3_finish(ptr noundef, ptr noundef) #3

declare i32 @tls_record_set_handshake_finished(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @tls_record_encrypt(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) #3

declare i32 @tls_seq_num_incr(ptr noundef) #3

declare i32 @tls_record_get_change_cipher_spec(ptr noundef) #3

declare i32 @tls_record_decrypt(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) #3

declare i32 @tls_record_get_handshake_finished(ptr noundef, ptr noundef, ptr noundef) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"", !10, i64 0, !10, i64 4, !7, i64 8, !12, i64 264, !10, i64 272, !7, i64 276, !12, i64 18720, !7, i64 18728, !7, i64 37165, !6, i64 55608, !12, i64 55616, !10, i64 55624, !7, i64 55628, !12, i64 55664, !7, i64 55672, !12, i64 57720, !7, i64 57728, !12, i64 59776, !7, i64 59784, !12, i64 61832, !15, i64 61840, !15, i64 61968, !10, i64 62096, !7, i64 62100, !7, i64 62148, !17, i64 62248, !17, i64 62424, !19, i64 62600, !19, i64 62728, !7, i64 62856, !7, i64 62864, !7, i64 62872, !7, i64 62884, !20, i64 62896, !20, i64 63032, !10, i64 63168}
!15 = !{!"", !16, i64 0, !7, i64 96}
!16 = !{!"", !7, i64 0, !7, i64 32, !7, i64 64}
!17 = !{!"", !18, i64 0, !7, i64 112}
!18 = !{!"", !7, i64 0, !12, i64 32, !7, i64 40, !12, i64 104}
!19 = !{!"", !7, i64 0}
!20 = !{!"BLOCK_CIPHER_KEY", !7, i64 0, !6, i64 128}
!21 = !{!14, !12, i64 59776}
!22 = !{!14, !10, i64 272}
!23 = !{!7, !7, i64 0}
!24 = !{!14, !10, i64 55624}
!25 = !{!14, !12, i64 57720}
!26 = !{!14, !12, i64 61832}
!27 = !{!14, !10, i64 63168}


; 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"

%struct.SM2_KEY = type { %struct.SM2_Z256_POINT, [4 x i64] }
%struct.SM2_Z256_POINT = type { [4 x i64], [4 x i64], [4 x i64] }
%struct.SM2_SIGN_CTX = type { %struct.SM3_CTX, %struct.SM3_CTX, %struct.SM2_KEY, [4 x i64], [32 x %struct.SM2_SIGN_PRE_COMP], i32, [16 x %struct.SM2_Z256_POINT] }
%struct.SM3_CTX = type { [8 x i32], i64, [64 x i8], i64 }
%struct.SM2_SIGN_PRE_COMP = type { [4 x i64], [4 x i64] }

@tls12_ciphers = external hidden constant [1 x i32], align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@__const.tls12_do_connect.supported_groups = external hidden unnamed_addr constant [1 x i32], align 4
@__const.tls12_do_connect.signature_algors = external hidden unnamed_addr constant [1 x i32], align 4
@__FUNCTION__.tls12_do_connect = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [25 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @tls_record_get_handshake_server_key_exchange_ecdhe(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @tls_record_set_handshake_client_key_exchange_ecdhe(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @tls12_do_connect(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca [309 x i8], align 16
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca [32 x i8], align 16
  %6 = alloca [32 x i8], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca [512 x i8], align 16
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %struct.SM2_KEY, align 8
  %20 = alloca %struct.SM2_SIGN_CTX, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = alloca [48 x i8], align 16
  %24 = alloca %struct.SM3_CTX, align 8
  %25 = alloca %struct.SM3_CTX, align 8
  %26 = alloca [32 x i8], align 16
  %27 = alloca ptr, align 8
  %28 = alloca i64, align 8
  %29 = alloca [12 x i8], align 1
  %30 = alloca i32, align 4
  %31 = alloca ptr, align 8
  %32 = alloca ptr, align 8
  %33 = alloca i64, align 8
  %34 = alloca i32, align 4
  %35 = alloca [1 x i32], align 4
  %36 = alloca [1 x i32], align 4
  %37 = alloca [1 x i32], align 4
  %38 = alloca i32, align 4
  %39 = alloca %struct.SM2_Z256_POINT, align 8
  %40 = alloca ptr, align 8
  %41 = alloca i64, align 8
  %42 = alloca ptr, align 8
  %43 = alloca i64, align 8
  %44 = alloca %struct.SM2_KEY, align 8
  %45 = alloca [64 x i8], align 16
  %46 = alloca [72 x i8], align 16
  %47 = getelementptr inbounds i8, ptr %0, i64 18728
  call void @llvm.lifetime.start.p0(i64 309, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  store i64 0, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #6
  store i32 -1, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #6
  store i32 -1, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #6
  store i32 -1, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %19) #6
  call void @llvm.lifetime.start.p0(i64 3976, ptr nonnull %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %23) #6
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %24) #6
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %25) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %26) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %27) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %28) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %29) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %30) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %31) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %32) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %33) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %34) #6
  %48 = tail call i32 @tls_record_set_protocol(ptr noundef nonnull %47, i32 noundef 769) #6
  %49 = load i32, ptr %0, align 8, !tbaa !11
  %50 = call i32 @tls_record_set_protocol(ptr noundef nonnull %2, i32 noundef %49) #6
  call void @sm3_init(ptr noundef nonnull %24) #6
  %51 = getelementptr inbounds i8, ptr %0, i64 59776
  %52 = load i64, ptr %51, align 8, !tbaa !20
  %.not = icmp eq i64 %52, 0
  br i1 %.not, label %56, label %53

53:                                               ; preds = %1
  %54 = getelementptr inbounds i8, ptr %0, i64 61840
  %55 = call i32 @sm2_sign_init(ptr noundef nonnull %20, ptr noundef nonnull %54, ptr noundef nonnull @.str.2, i64 noundef 16) #6
  br label %56

56:                                               ; preds = %53, %1
  %57 = call i32 @tls_random_generate(ptr noundef nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %35) #6
  store i32 0, ptr %35, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %36) #6
  %58 = load i32, ptr @__const.tls12_do_connect.supported_groups, align 4
  store i32 %58, ptr %36, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %37) #6
  %59 = load i32, ptr @__const.tls12_do_connect.signature_algors, align 4
  store i32 %59, ptr %37, align 4
  store ptr %12, ptr %32, align 8, !tbaa !21
  store i64 0, ptr %13, align 8, !tbaa !5
  %60 = call i32 @tls_ec_point_formats_ext_to_bytes(ptr noundef nonnull %35, i64 noundef 1, ptr noundef nonnull %32, ptr noundef nonnull %13) #6
  %61 = call i32 @tls_supported_groups_ext_to_bytes(ptr noundef nonnull %36, i64 noundef 1, ptr noundef nonnull %32, ptr noundef nonnull %13) #6
  %62 = call i32 @tls_signature_algorithms_ext_to_bytes(ptr noundef nonnull %37, i64 noundef 1, ptr noundef nonnull %32, ptr noundef nonnull %13) #6
  %63 = load i32, ptr %0, align 8, !tbaa !11
  %64 = load i64, ptr %13, align 8, !tbaa !5
  %65 = call i32 @tls_record_set_handshake_client_hello(ptr noundef nonnull %47, ptr noundef nonnull %3, i32 noundef %63, ptr noundef nonnull %5, ptr noundef null, i64 noundef 0, ptr noundef nonnull @tls12_ciphers, i64 noundef 1, ptr noundef nonnull %12, i64 noundef %64) #6
  %.not194 = icmp eq i32 %65, 1
  br i1 %.not194, label %69, label %66

66:                                               ; preds = %56
  %67 = load ptr, ptr @stderr, align 8, !tbaa !21
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 258, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  br label %530

69:                                               ; preds = %56
  %70 = load i64, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds i8, ptr %0, i64 272
  %72 = load i32, ptr %71, align 8, !tbaa !22
  %73 = call i32 @tls_record_send(ptr noundef nonnull %47, i64 noundef %70, i32 noundef %72) #6
  %.not195 = icmp eq i32 %73, 1
  br i1 %.not195, label %77, label %74

74:                                               ; preds = %69
  %75 = load ptr, ptr @stderr, align 8, !tbaa !21
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 264, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  br label %530

77:                                               ; preds = %69
  %78 = getelementptr inbounds i8, ptr %0, i64 18733
  %79 = load i64, ptr %3, align 8, !tbaa !5
  %80 = add i64 %79, -5
  call void @sm3_update(ptr noundef nonnull %24, ptr noundef nonnull %78, i64 noundef %80) #6
  %81 = load i64, ptr %51, align 8, !tbaa !20
  %.not196 = icmp eq i64 %81, 0
  br i1 %.not196, label %86, label %82

82:                                               ; preds = %77
  %83 = load i64, ptr %3, align 8, !tbaa !5
  %84 = add i64 %83, -5
  %85 = call i32 @sm2_sign_update(ptr noundef nonnull %20, ptr noundef nonnull %78, i64 noundef %84) #6
  br label %86

86:                                               ; preds = %82, %77
  %87 = load i32, ptr %71, align 8, !tbaa !22
  %88 = call i32 @tls_record_recv(ptr noundef nonnull %47, ptr noundef nonnull %3, i32 noundef %87) #6
  %.not197 = icmp eq i32 %88, 1
  br i1 %.not197, label %93, label %89

89:                                               ; preds = %86
  %90 = load ptr, ptr @stderr, align 8, !tbaa !21
  %91 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 274, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %92 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #6
  br label %530

93:                                               ; preds = %86
  %94 = getelementptr inbounds i8, ptr %0, i64 18729
  %95 = load i8, ptr %94, align 1, !tbaa !23
  %96 = zext i8 %95 to i32
  %97 = shl nuw nsw i32 %96, 8
  %98 = getelementptr inbounds i8, ptr %0, i64 18730
  %99 = load i8, ptr %98, align 1, !tbaa !23
  %100 = zext i8 %99 to i32
  %101 = or disjoint i32 %97, %100
  %102 = load i32, ptr %0, align 8, !tbaa !11
  %.not198 = icmp eq i32 %101, %102
  br i1 %.not198, label %107, label %103

103:                                              ; preds = %93
  %104 = load ptr, ptr @stderr, align 8, !tbaa !21
  %105 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 280, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %106 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 70) #6
  br label %530

107:                                              ; preds = %93
  %108 = call i32 @tls_record_get_handshake_server_hello(ptr noundef nonnull %47, ptr noundef nonnull %7, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %8, ptr noundef nonnull %14, ptr noundef nonnull %15) #6
  %.not199 = icmp eq i32 %108, 1
  br i1 %.not199, label %113, label %109

109:                                              ; preds = %107
  %110 = load ptr, ptr @stderr, align 8, !tbaa !21
  %111 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %110, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 287, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %112 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #6
  br label %530

113:                                              ; preds = %107
  %114 = load i32, ptr %7, align 4, !tbaa !9
  %115 = load i32, ptr %0, align 8, !tbaa !11
  %.not200 = icmp eq i32 %114, %115
  br i1 %.not200, label %120, label %116

116:                                              ; preds = %113
  %117 = load ptr, ptr @stderr, align 8, !tbaa !21
  %118 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %117, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 292, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %119 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 70) #6
  br label %530

120:                                              ; preds = %113
  %121 = load i32, ptr %8, align 4, !tbaa !9
  %122 = call i32 @tls_cipher_suite_in_list(i32 noundef %121, ptr noundef nonnull @tls12_ciphers, i64 noundef 1) #6
  %.not201 = icmp eq i32 %122, 1
  br i1 %.not201, label %127, label %123

123:                                              ; preds = %120
  %124 = load ptr, ptr @stderr, align 8, !tbaa !21
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %124, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 298, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %126 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 40) #6
  br label %530

127:                                              ; preds = %120
  %128 = load ptr, ptr %14, align 8, !tbaa !21
  %.not202 = icmp eq ptr %128, null
  br i1 %.not202, label %129, label %133

129:                                              ; preds = %127
  %130 = load ptr, ptr @stderr, align 8, !tbaa !21
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 303, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %132 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #6
  br label %530

133:                                              ; preds = %127
  %134 = load i64, ptr %15, align 8, !tbaa !5
  %135 = call i32 @tls_process_server_hello_exts(ptr noundef nonnull %128, i64 noundef %134, ptr noundef nonnull %16, ptr noundef nonnull %17, ptr noundef nonnull %18) #6
  %136 = icmp ne i32 %135, 1
  %137 = load i32, ptr %16, align 4
  %138 = icmp slt i32 %137, 0
  %or.cond = select i1 %136, i1 true, i1 %138
  %139 = load i32, ptr %17, align 4
  %140 = icmp slt i32 %139, 0
  %or.cond3 = select i1 %or.cond, i1 true, i1 %140
  %141 = load i32, ptr %18, align 4
  %142 = icmp slt i32 %141, 0
  %or.cond5 = select i1 %or.cond3, i1 true, i1 %142
  br i1 %or.cond5, label %143, label %147

143:                                              ; preds = %133
  %144 = load ptr, ptr @stderr, align 8, !tbaa !21
  %145 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %144, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 311, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %146 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #6
  br label %530

147:                                              ; preds = %133
  %148 = load ptr, ptr %9, align 8, !tbaa !21
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %6, ptr noundef nonnull align 1 dereferenceable(32) %148, i64 32, i1 false)
  %149 = getelementptr inbounds i8, ptr %0, i64 55628
  %150 = load ptr, ptr %10, align 8, !tbaa !21
  %151 = load i64, ptr %11, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %149, ptr align 1 %150, i64 %151, i1 false)
  %152 = load i32, ptr %8, align 4, !tbaa !9
  %153 = getelementptr inbounds i8, ptr %0, i64 55624
  store i32 %152, ptr %153, align 8, !tbaa !24
  %154 = load i64, ptr %3, align 8, !tbaa !5
  %155 = add i64 %154, -5
  call void @sm3_update(ptr noundef nonnull %24, ptr noundef nonnull %78, i64 noundef %155) #6
  %156 = load i64, ptr %51, align 8, !tbaa !20
  %.not203 = icmp eq i64 %156, 0
  br i1 %.not203, label %161, label %157

157:                                              ; preds = %147
  %158 = load i64, ptr %3, align 8, !tbaa !5
  %159 = add i64 %158, -5
  %160 = call i32 @sm2_sign_update(ptr noundef nonnull %20, ptr noundef nonnull %78, i64 noundef %159) #6
  br label %161

161:                                              ; preds = %157, %147
  %162 = load i32, ptr %71, align 8, !tbaa !22
  %163 = call i32 @tls_record_recv(ptr noundef nonnull %47, ptr noundef nonnull %3, i32 noundef %162) #6
  %.not204 = icmp eq i32 %163, 1
  br i1 %.not204, label %164, label %172

164:                                              ; preds = %161
  %165 = load i8, ptr %94, align 1, !tbaa !23
  %166 = zext i8 %165 to i32
  %167 = shl nuw nsw i32 %166, 8
  %168 = load i8, ptr %98, align 1, !tbaa !23
  %169 = zext i8 %168 to i32
  %170 = or disjoint i32 %167, %169
  %171 = load i32, ptr %0, align 8, !tbaa !11
  %.not205 = icmp eq i32 %170, %171
  br i1 %.not205, label %176, label %172

172:                                              ; preds = %161, %164
  %173 = load ptr, ptr @stderr, align 8, !tbaa !21
  %174 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %173, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 326, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %175 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #6
  br label %530

176:                                              ; preds = %164
  %177 = getelementptr inbounds i8, ptr %0, i64 55672
  %178 = getelementptr inbounds i8, ptr %0, i64 57720
  %179 = call i32 @tls_record_get_handshake_certificate(ptr noundef nonnull %47, ptr noundef nonnull %177, ptr noundef nonnull %178) #6
  %.not206 = icmp eq i32 %179, 1
  br i1 %.not206, label %184, label %180

180:                                              ; preds = %176
  %181 = load ptr, ptr @stderr, align 8, !tbaa !21
  %182 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %181, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 334, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %183 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #6
  br label %530

184:                                              ; preds = %176
  %185 = load i64, ptr %3, align 8, !tbaa !5
  %186 = add i64 %185, -5
  call void @sm3_update(ptr noundef nonnull %24, ptr noundef nonnull %78, i64 noundef %186) #6
  %187 = load i64, ptr %51, align 8, !tbaa !20
  %.not207 = icmp eq i64 %187, 0
  br i1 %.not207, label %192, label %188

188:                                              ; preds = %184
  %189 = load i64, ptr %3, align 8, !tbaa !5
  %190 = add i64 %189, -5
  %191 = call i32 @sm2_sign_update(ptr noundef nonnull %20, ptr noundef nonnull %78, i64 noundef %190) #6
  br label %192

192:                                              ; preds = %188, %184
  %193 = load i64, ptr %178, align 8, !tbaa !25
  %194 = getelementptr inbounds i8, ptr %0, i64 59784
  %195 = getelementptr inbounds i8, ptr %0, i64 61832
  %196 = load i64, ptr %195, align 8, !tbaa !26
  %197 = call i32 @x509_certs_verify(ptr noundef nonnull %177, i64 noundef %193, i32 noundef 0, ptr noundef nonnull %194, i64 noundef %196, i32 noundef 5, ptr noundef nonnull %34) #6
  %.not208 = icmp eq i32 %197, 1
  br i1 %.not208, label %202, label %198

198:                                              ; preds = %192
  %199 = load ptr, ptr @stderr, align 8, !tbaa !21
  %200 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %199, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 345, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %201 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 42) #6
  br label %530

202:                                              ; preds = %192
  %203 = load i32, ptr %71, align 8, !tbaa !22
  %204 = call i32 @tls_record_recv(ptr noundef nonnull %47, ptr noundef nonnull %3, i32 noundef %203) #6
  %.not209 = icmp eq i32 %204, 1
  br i1 %.not209, label %205, label %213

205:                                              ; preds = %202
  %206 = load i8, ptr %94, align 1, !tbaa !23
  %207 = zext i8 %206 to i32
  %208 = shl nuw nsw i32 %207, 8
  %209 = load i8, ptr %98, align 1, !tbaa !23
  %210 = zext i8 %209 to i32
  %211 = or disjoint i32 %208, %210
  %212 = load i32, ptr %0, align 8, !tbaa !11
  %.not210 = icmp eq i32 %211, %212
  br i1 %.not210, label %217, label %213

213:                                              ; preds = %202, %205
  %214 = load ptr, ptr @stderr, align 8, !tbaa !21
  %215 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %214, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 354, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %216 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #6
  br label %530

217:                                              ; preds = %205
  %218 = call i32 @tls_record_get_handshake_server_key_exchange_ecdhe(ptr noundef nonnull %47, ptr noundef nonnull %38, ptr noundef nonnull %39, ptr noundef nonnull %21, ptr noundef nonnull %22)
  %.not211 = icmp eq i32 %218, 1
  br i1 %.not211, label %223, label %219

219:                                              ; preds = %217
  %220 = load ptr, ptr @stderr, align 8, !tbaa !21
  %221 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %220, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 363, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %222 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #6
  br label %530

223:                                              ; preds = %217
  %224 = load i32, ptr %38, align 4, !tbaa !9
  %.not212 = icmp eq i32 %224, 41
  br i1 %.not212, label %229, label %225

225:                                              ; preds = %223
  %226 = load ptr, ptr @stderr, align 8, !tbaa !21
  %227 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %226, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 368, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %228 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #6
  br label %530

229:                                              ; preds = %223
  %230 = load i64, ptr %3, align 8, !tbaa !5
  %231 = add i64 %230, -5
  call void @sm3_update(ptr noundef nonnull %24, ptr noundef nonnull %78, i64 noundef %231) #6
  %232 = load i64, ptr %51, align 8, !tbaa !20
  %.not213 = icmp eq i64 %232, 0
  br i1 %.not213, label %237, label %233

233:                                              ; preds = %229
  %234 = load i64, ptr %3, align 8, !tbaa !5
  %235 = add i64 %234, -5
  %236 = call i32 @sm2_sign_update(ptr noundef nonnull %20, ptr noundef nonnull %78, i64 noundef %235) #6
  br label %237

237:                                              ; preds = %233, %229
  %238 = load i64, ptr %178, align 8, !tbaa !25
  %239 = call i32 @x509_certs_get_cert_by_index(ptr noundef nonnull %177, i64 noundef %238, i32 noundef 0, ptr noundef nonnull %31, ptr noundef nonnull %33) #6
  %.not214 = icmp eq i32 %239, 1
  br i1 %.not214, label %240, label %244

240:                                              ; preds = %237
  %241 = load ptr, ptr %31, align 8, !tbaa !21
  %242 = load i64, ptr %33, align 8, !tbaa !5
  %243 = call i32 @x509_cert_get_subject_public_key(ptr noundef %241, i64 noundef %242, ptr noundef nonnull %19) #6
  %.not215 = icmp eq i32 %243, 1
  br i1 %.not215, label %248, label %244

244:                                              ; preds = %237, %240
  %245 = load ptr, ptr @stderr, align 8, !tbaa !21
  %246 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %245, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 379, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %247 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 42) #6
  br label %530

248:                                              ; preds = %240
  %249 = load i32, ptr %38, align 4, !tbaa !9
  %250 = load ptr, ptr %21, align 8, !tbaa !21
  %251 = load i64, ptr %22, align 8, !tbaa !5
  %252 = call i32 @tls_verify_server_ecdh_params(ptr noundef nonnull %19, ptr noundef nonnull %5, ptr noundef nonnull %6, i32 noundef %249, ptr noundef nonnull %39, ptr noundef %250, i64 noundef %251) #6
  %.not216 = icmp eq i32 %252, 1
  br i1 %.not216, label %257, label %253

253:                                              ; preds = %248
  %254 = load ptr, ptr @stderr, align 8, !tbaa !21
  %255 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %254, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 385, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %256 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #6
  br label %530

257:                                              ; preds = %248
  %258 = load i32, ptr %71, align 8, !tbaa !22
  %259 = call i32 @tls_record_recv(ptr noundef nonnull %47, ptr noundef nonnull %3, i32 noundef %258) #6
  %.not217 = icmp eq i32 %259, 1
  br i1 %.not217, label %260, label %270

260:                                              ; preds = %257
  %261 = load i8, ptr %94, align 1, !tbaa !23
  %262 = zext i8 %261 to i32
  %263 = shl nuw nsw i32 %262, 8
  %264 = load i8, ptr %98, align 1, !tbaa !23
  %265 = zext i8 %264 to i32
  %266 = or disjoint i32 %263, %265
  %267 = load i32, ptr %0, align 8, !tbaa !11
  %.not218 = icmp eq i32 %266, %267
  br i1 %.not218, label %268, label %270

268:                                              ; preds = %260
  %269 = call i32 @tls_record_get_handshake(ptr noundef nonnull %47, ptr noundef nonnull %30, ptr noundef nonnull %31, ptr noundef nonnull %33) #6
  %.not219 = icmp eq i32 %269, 1
  br i1 %.not219, label %274, label %270

270:                                              ; preds = %257, %260, %268
  %271 = load ptr, ptr @stderr, align 8, !tbaa !21
  %272 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %271, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 394, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %273 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #6
  br label %530

274:                                              ; preds = %268
  %275 = load i32, ptr %30, align 4, !tbaa !9
  %276 = icmp eq i32 %275, 13
  br i1 %276, label %277, label %311

277:                                              ; preds = %274
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %40) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %41) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %42) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %43) #6
  %278 = call i32 @tls_record_get_handshake_certificate_request(ptr noundef nonnull %47, ptr noundef nonnull %40, ptr noundef nonnull %41, ptr noundef nonnull %42, ptr noundef nonnull %43) #6
  %.not220 = icmp eq i32 %278, 1
  br i1 %.not220, label %279, label %.thread

279:                                              ; preds = %277
  %280 = load i64, ptr %51, align 8, !tbaa !20
  %.not221 = icmp eq i64 %280, 0
  br i1 %.not221, label %.thread, label %281

281:                                              ; preds = %279
  %282 = load ptr, ptr %40, align 8, !tbaa !21
  %283 = load i64, ptr %41, align 8, !tbaa !5
  %284 = getelementptr inbounds i8, ptr %0, i64 57728
  %285 = call i32 @tls_cert_types_accepted(ptr noundef %282, i64 noundef %283, ptr noundef nonnull %284, i64 noundef %280) #6
  %.not222 = icmp eq i32 %285, 1
  br i1 %.not222, label %286, label %.thread

286:                                              ; preds = %281
  %287 = load ptr, ptr %42, align 8, !tbaa !21
  %288 = load i64, ptr %43, align 8, !tbaa !5
  %289 = load i64, ptr %51, align 8, !tbaa !20
  %290 = call i32 @tls_authorities_issued_certificate(ptr noundef %287, i64 noundef %288, ptr noundef nonnull %284, i64 noundef %289) #6
  %.not223 = icmp eq i32 %290, 1
  br i1 %.not223, label %291, label %.thread

291:                                              ; preds = %286
  %292 = load i64, ptr %3, align 8, !tbaa !5
  %293 = add i64 %292, -5
  call void @sm3_update(ptr noundef nonnull %24, ptr noundef nonnull %78, i64 noundef %293) #6
  %294 = load i64, ptr %3, align 8, !tbaa !5
  %295 = add i64 %294, -5
  %296 = call i32 @sm2_sign_update(ptr noundef nonnull %20, ptr noundef nonnull %78, i64 noundef %295) #6
  %297 = load i32, ptr %71, align 8, !tbaa !22
  %298 = call i32 @tls_record_recv(ptr noundef nonnull %47, ptr noundef nonnull %3, i32 noundef %297) #6
  %.not224 = icmp eq i32 %298, 1
  br i1 %.not224, label %299, label %.thread

299:                                              ; preds = %291
  %300 = load i8, ptr %94, align 1, !tbaa !23
  %301 = zext i8 %300 to i32
  %302 = shl nuw nsw i32 %301, 8
  %303 = load i8, ptr %98, align 1, !tbaa !23
  %304 = zext i8 %303 to i32
  %305 = or disjoint i32 %302, %304
  %306 = load i32, ptr %0, align 8, !tbaa !11
  %.not225 = icmp eq i32 %305, %306
  br i1 %.not225, label %310, label %.thread

.thread:                                          ; preds = %299, %291, %286, %281, %279, %277
  %.sink273 = phi i32 [ 409, %277 ], [ 414, %279 ], [ 420, %281 ], [ 420, %286 ], [ 430, %291 ], [ 430, %299 ]
  %.sink = phi i32 [ 10, %277 ], [ 80, %279 ], [ 43, %281 ], [ 43, %286 ], [ 10, %291 ], [ 10, %299 ]
  %307 = load ptr, ptr @stderr, align 8, !tbaa !21
  %308 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %307, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef %.sink273, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %309 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef %.sink) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %43) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %42) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %41) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %40) #6
  br label %530

310:                                              ; preds = %299
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %43) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %42) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %41) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %40) #6
  br label %313

311:                                              ; preds = %274
  store i64 0, ptr %51, align 8, !tbaa !20
  %312 = getelementptr inbounds i8, ptr %0, i64 61840
  call void @gmssl_secure_clear(ptr noundef nonnull %312, i64 noundef 128) #6
  br label %313

313:                                              ; preds = %310, %311
  %314 = call i32 @tls_record_get_handshake_server_hello_done(ptr noundef nonnull %47) #6
  %.not226 = icmp eq i32 %314, 1
  br i1 %.not226, label %319, label %315

315:                                              ; preds = %313
  %316 = load ptr, ptr @stderr, align 8, !tbaa !21
  %317 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %316, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 442, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %318 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #6
  br label %530

319:                                              ; preds = %313
  %320 = load i64, ptr %3, align 8, !tbaa !5
  %321 = add i64 %320, -5
  call void @sm3_update(ptr noundef nonnull %24, ptr noundef nonnull %78, i64 noundef %321) #6
  %322 = load i64, ptr %51, align 8, !tbaa !20
  %.not227 = icmp eq i64 %322, 0
  br i1 %.not227, label %.thread263, label %323

323:                                              ; preds = %319
  %324 = load i64, ptr %3, align 8, !tbaa !5
  %325 = add i64 %324, -5
  %326 = call i32 @sm2_sign_update(ptr noundef nonnull %20, ptr noundef nonnull %78, i64 noundef %325) #6
  %.pr = load i64, ptr %51, align 8, !tbaa !20
  %.not228 = icmp eq i64 %.pr, 0
  br i1 %.not228, label %.thread263, label %327

327:                                              ; preds = %323
  %328 = getelementptr inbounds i8, ptr %0, i64 57728
  %329 = call i32 @tls_record_set_handshake_certificate(ptr noundef nonnull %47, ptr noundef nonnull %3, ptr noundef nonnull %328, i64 noundef %.pr) #6
  %.not229 = icmp eq i32 %329, 1
  br i1 %.not229, label %334, label %330

330:                                              ; preds = %327
  %331 = load ptr, ptr @stderr, align 8, !tbaa !21
  %332 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %331, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 454, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %333 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #6
  br label %530

334:                                              ; preds = %327
  %335 = load i64, ptr %3, align 8, !tbaa !5
  %336 = load i32, ptr %71, align 8, !tbaa !22
  %337 = call i32 @tls_record_send(ptr noundef nonnull %47, i64 noundef %335, i32 noundef %336) #6
  %.not230 = icmp eq i32 %337, 1
  br i1 %.not230, label %341, label %338

338:                                              ; preds = %334
  %339 = load ptr, ptr @stderr, align 8, !tbaa !21
  %340 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %339, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 460, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  br label %530

341:                                              ; preds = %334
  %342 = load i64, ptr %3, align 8, !tbaa !5
  %343 = add i64 %342, -5
  call void @sm3_update(ptr noundef nonnull %24, ptr noundef nonnull %78, i64 noundef %343) #6
  %344 = load i64, ptr %3, align 8, !tbaa !5
  %345 = add i64 %344, -5
  %346 = call i32 @sm2_sign_update(ptr noundef nonnull %20, ptr noundef nonnull %78, i64 noundef %345) #6
  br label %.thread263

.thread263:                                       ; preds = %319, %341, %323
  %347 = call i32 @sm2_key_generate(ptr noundef nonnull %44) #6
  %348 = call i32 @sm2_do_ecdh(ptr noundef nonnull %44, ptr noundef nonnull %39, ptr noundef nonnull %39) #6
  %349 = call i32 @sm2_z256_point_to_bytes(ptr noundef nonnull %39, ptr noundef nonnull %45) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %23, ptr noundef nonnull align 16 dereferenceable(32) %45, i64 32, i1 false)
  %350 = getelementptr inbounds i8, ptr %0, i64 62100
  %351 = call i32 @tls_prf(ptr noundef nonnull %23, i64 noundef 32, ptr noundef nonnull @.str.3, ptr noundef nonnull %5, i64 noundef 32, ptr noundef nonnull %6, i64 noundef 32, i64 noundef 48, ptr noundef nonnull %350) #6
  %.not231 = icmp eq i32 %351, 1
  br i1 %.not231, label %352, label %355

352:                                              ; preds = %.thread263
  %353 = getelementptr inbounds i8, ptr %0, i64 62148
  %354 = call i32 @tls_prf(ptr noundef nonnull %350, i64 noundef 48, ptr noundef nonnull @.str.4, ptr noundef nonnull %6, i64 noundef 32, ptr noundef nonnull %5, i64 noundef 32, i64 noundef 96, ptr noundef nonnull %353) #6
  %.not232 = icmp eq i32 %354, 1
  br i1 %.not232, label %359, label %355

355:                                              ; preds = %.thread263, %352
  %356 = load ptr, ptr @stderr, align 8, !tbaa !21
  %357 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %356, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 486, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %358 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #6
  br label %530

359:                                              ; preds = %352
  %360 = getelementptr inbounds i8, ptr %0, i64 62248
  call void @sm3_hmac_init(ptr noundef nonnull %360, ptr noundef nonnull %353, i64 noundef 32) #6
  %361 = getelementptr inbounds i8, ptr %0, i64 62424
  %362 = getelementptr inbounds i8, ptr %0, i64 62180
  call void @sm3_hmac_init(ptr noundef nonnull %361, ptr noundef nonnull %362, i64 noundef 32) #6
  %363 = getelementptr inbounds i8, ptr %0, i64 62600
  %364 = getelementptr inbounds i8, ptr %0, i64 62212
  call void @sm4_set_encrypt_key(ptr noundef nonnull %363, ptr noundef nonnull %364) #6
  %365 = getelementptr inbounds i8, ptr %0, i64 62728
  %366 = getelementptr inbounds i8, ptr %0, i64 62228
  call void @sm4_set_decrypt_key(ptr noundef nonnull %365, ptr noundef nonnull %366) #6
  %367 = load ptr, ptr @stderr, align 8, !tbaa !21
  %368 = call i32 @tls_secrets_print(ptr noundef %367, ptr noundef nonnull %23, i64 noundef 48, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %350, ptr noundef nonnull %353, i64 noundef 96, i32 noundef 0, i32 noundef 4) #6
  %369 = call i32 @tls_record_set_handshake_client_key_exchange_ecdhe(ptr noundef nonnull %47, ptr noundef nonnull %3, ptr noundef nonnull %44)
  %.not233 = icmp eq i32 %369, 1
  br i1 %.not233, label %374, label %370

370:                                              ; preds = %359
  %371 = load ptr, ptr @stderr, align 8, !tbaa !21
  %372 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %371, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 505, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %373 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #6
  br label %530

374:                                              ; preds = %359
  %375 = load i64, ptr %3, align 8, !tbaa !5
  %376 = load i32, ptr %71, align 8, !tbaa !22
  %377 = call i32 @tls_record_send(ptr noundef nonnull %47, i64 noundef %375, i32 noundef %376) #6
  %.not234 = icmp eq i32 %377, 1
  br i1 %.not234, label %381, label %378

378:                                              ; preds = %374
  %379 = load ptr, ptr @stderr, align 8, !tbaa !21
  %380 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %379, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 511, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  br label %530

381:                                              ; preds = %374
  %382 = load i64, ptr %3, align 8, !tbaa !5
  %383 = add i64 %382, -5
  call void @sm3_update(ptr noundef nonnull %24, ptr noundef nonnull %78, i64 noundef %383) #6
  %384 = load i64, ptr %51, align 8, !tbaa !20
  %.not235 = icmp eq i64 %384, 0
  br i1 %.not235, label %.thread266, label %385

385:                                              ; preds = %381
  %386 = load i64, ptr %3, align 8, !tbaa !5
  %387 = add i64 %386, -5
  %388 = call i32 @sm2_sign_update(ptr noundef nonnull %20, ptr noundef nonnull %78, i64 noundef %387) #6
  %.pr265 = load i64, ptr %51, align 8, !tbaa !20
  %.not236 = icmp eq i64 %.pr265, 0
  br i1 %.not236, label %.thread266, label %389

389:                                              ; preds = %385
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %46) #6
  %390 = call i32 @sm2_sign_finish(ptr noundef nonnull %20, ptr noundef nonnull %46, ptr noundef nonnull %22) #6
  %.not237 = icmp eq i32 %390, 1
  br i1 %.not237, label %391, label %394

391:                                              ; preds = %389
  %392 = load i64, ptr %22, align 8, !tbaa !5
  %393 = call i32 @tls_record_set_handshake_certificate_verify(ptr noundef nonnull %47, ptr noundef nonnull %3, ptr noundef nonnull %46, i64 noundef %392) #6
  %.not238 = icmp eq i32 %393, 1
  br i1 %.not238, label %398, label %394

394:                                              ; preds = %389, %391
  %395 = load ptr, ptr @stderr, align 8, !tbaa !21
  %396 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %395, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 524, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %397 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #6
  br label %.thread269

398:                                              ; preds = %391
  %399 = load i64, ptr %3, align 8, !tbaa !5
  %400 = load i32, ptr %71, align 8, !tbaa !22
  %401 = call i32 @tls_record_send(ptr noundef nonnull %47, i64 noundef %399, i32 noundef %400) #6
  %.not239 = icmp eq i32 %401, 1
  br i1 %.not239, label %405, label %402

402:                                              ; preds = %398
  %403 = load ptr, ptr @stderr, align 8, !tbaa !21
  %404 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %403, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 530, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  br label %.thread269

.thread269:                                       ; preds = %394, %402
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %46) #6
  br label %530

405:                                              ; preds = %398
  %406 = load i64, ptr %3, align 8, !tbaa !5
  %407 = add i64 %406, -5
  call void @sm3_update(ptr noundef nonnull %24, ptr noundef nonnull %78, i64 noundef %407) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %46) #6
  br label %.thread266

.thread266:                                       ; preds = %381, %405, %385
  %408 = call i32 @tls_record_set_change_cipher_spec(ptr noundef nonnull %47, ptr noundef nonnull %3) #6
  %.not240 = icmp eq i32 %408, 1
  br i1 %.not240, label %413, label %409

409:                                              ; preds = %.thread266
  %410 = load ptr, ptr @stderr, align 8, !tbaa !21
  %411 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %410, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 539, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %412 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #6
  br label %530

413:                                              ; preds = %.thread266
  %414 = load i64, ptr %3, align 8, !tbaa !5
  %415 = load i32, ptr %71, align 8, !tbaa !22
  %416 = call i32 @tls_record_send(ptr noundef nonnull %47, i64 noundef %414, i32 noundef %415) #6
  %.not241 = icmp eq i32 %416, 1
  br i1 %.not241, label %420, label %417

417:                                              ; preds = %413
  %418 = load ptr, ptr @stderr, align 8, !tbaa !21
  %419 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %418, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 545, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  br label %530

420:                                              ; preds = %413
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(112) %25, ptr noundef nonnull align 8 dereferenceable(112) %24, i64 112, i1 false)
  call void @sm3_finish(ptr noundef nonnull %25, ptr noundef nonnull %26) #6
  %421 = call i32 @tls_prf(ptr noundef nonnull %350, i64 noundef 48, ptr noundef nonnull @.str.5, ptr noundef nonnull %26, i64 noundef 32, ptr noundef null, i64 noundef 0, i64 noundef 12, ptr noundef nonnull %29) #6
  %.not242 = icmp eq i32 %421, 1
  br i1 %.not242, label %422, label %424

422:                                              ; preds = %420
  %423 = call i32 @tls_record_set_handshake_finished(ptr noundef nonnull %2, ptr noundef nonnull %4, ptr noundef nonnull %29, i64 noundef 12) #6
  %.not243 = icmp eq i32 %423, 1
  br i1 %.not243, label %428, label %424

424:                                              ; preds = %420, %422
  %425 = load ptr, ptr @stderr, align 8, !tbaa !21
  %426 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %425, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 557, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %427 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #6
  br label %530

428:                                              ; preds = %422
  %429 = getelementptr inbounds i8, ptr %2, i64 5
  %430 = load i64, ptr %4, align 8, !tbaa !5
  %431 = add i64 %430, -5
  call void @sm3_update(ptr noundef nonnull %24, ptr noundef nonnull %429, i64 noundef %431) #6
  %432 = getelementptr inbounds i8, ptr %0, i64 62856
  %433 = load i64, ptr %4, align 8, !tbaa !5
  %434 = call i32 @tls_record_encrypt(ptr noundef nonnull %360, ptr noundef nonnull %363, ptr noundef nonnull %432, ptr noundef nonnull %2, i64 noundef %433, ptr noundef nonnull %47, ptr noundef nonnull %3) #6
  %.not244 = icmp eq i32 %434, 1
  br i1 %.not244, label %439, label %435

435:                                              ; preds = %428
  %436 = load ptr, ptr @stderr, align 8, !tbaa !21
  %437 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %436, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 568, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %438 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #6
  br label %530

439:                                              ; preds = %428
  %440 = call i32 @tls_seq_num_incr(ptr noundef nonnull %432) #6
  %441 = load i64, ptr %3, align 8, !tbaa !5
  %442 = load i32, ptr %71, align 8, !tbaa !22
  %443 = call i32 @tls_record_send(ptr noundef nonnull %47, i64 noundef %441, i32 noundef %442) #6
  %.not245 = icmp eq i32 %443, 1
  br i1 %.not245, label %447, label %444

444:                                              ; preds = %439
  %445 = load ptr, ptr @stderr, align 8, !tbaa !21
  %446 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %445, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 575, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  br label %530

447:                                              ; preds = %439
  %448 = load i32, ptr %71, align 8, !tbaa !22
  %449 = call i32 @tls_record_recv(ptr noundef nonnull %47, ptr noundef nonnull %3, i32 noundef %448) #6
  %.not246 = icmp eq i32 %449, 1
  br i1 %.not246, label %450, label %458

450:                                              ; preds = %447
  %451 = load i8, ptr %94, align 1, !tbaa !23
  %452 = zext i8 %451 to i32
  %453 = shl nuw nsw i32 %452, 8
  %454 = load i8, ptr %98, align 1, !tbaa !23
  %455 = zext i8 %454 to i32
  %456 = or disjoint i32 %453, %455
  %457 = load i32, ptr %0, align 8, !tbaa !11
  %.not247 = icmp eq i32 %456, %457
  br i1 %.not247, label %462, label %458

458:                                              ; preds = %447, %450
  %459 = load ptr, ptr @stderr, align 8, !tbaa !21
  %460 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %459, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 583, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %461 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #6
  br label %530

462:                                              ; preds = %450
  %463 = call i32 @tls_record_get_change_cipher_spec(ptr noundef nonnull %47) #6
  %.not248 = icmp eq i32 %463, 1
  br i1 %.not248, label %468, label %464

464:                                              ; preds = %462
  %465 = load ptr, ptr @stderr, align 8, !tbaa !21
  %466 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %465, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 589, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %467 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #6
  br label %530

468:                                              ; preds = %462
  %469 = load i32, ptr %71, align 8, !tbaa !22
  %470 = call i32 @tls_record_recv(ptr noundef nonnull %47, ptr noundef nonnull %3, i32 noundef %469) #6
  %.not249 = icmp eq i32 %470, 1
  br i1 %.not249, label %471, label %479

471:                                              ; preds = %468
  %472 = load i8, ptr %94, align 1, !tbaa !23
  %473 = zext i8 %472 to i32
  %474 = shl nuw nsw i32 %473, 8
  %475 = load i8, ptr %98, align 1, !tbaa !23
  %476 = zext i8 %475 to i32
  %477 = or disjoint i32 %474, %476
  %478 = load i32, ptr %0, align 8, !tbaa !11
  %.not250 = icmp eq i32 %477, %478
  br i1 %.not250, label %483, label %479

479:                                              ; preds = %468, %471
  %480 = load ptr, ptr @stderr, align 8, !tbaa !21
  %481 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %480, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 598, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %482 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #6
  br label %530

483:                                              ; preds = %471
  %484 = load i64, ptr %3, align 8, !tbaa !5
  %485 = icmp ugt i64 %484, 309
  br i1 %485, label %486, label %490

486:                                              ; preds = %483
  %487 = load ptr, ptr @stderr, align 8, !tbaa !21
  %488 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %487, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 603, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %489 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 20) #6
  br label %530

490:                                              ; preds = %483
  %491 = getelementptr inbounds i8, ptr %0, i64 62864
  %492 = call i32 @tls_record_decrypt(ptr noundef nonnull %361, ptr noundef nonnull %365, ptr noundef nonnull %491, ptr noundef nonnull %47, i64 noundef %484, ptr noundef nonnull %2, ptr noundef nonnull %4) #6
  %.not251 = icmp eq i32 %492, 1
  br i1 %.not251, label %497, label %493

493:                                              ; preds = %490
  %494 = load ptr, ptr @stderr, align 8, !tbaa !21
  %495 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %494, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 611, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %496 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 20) #6
  br label %530

497:                                              ; preds = %490
  %498 = call i32 @tls_seq_num_incr(ptr noundef nonnull %491) #6
  %499 = call i32 @tls_record_get_handshake_finished(ptr noundef nonnull %2, ptr noundef nonnull %27, ptr noundef nonnull %28) #6
  %.not252 = icmp eq i32 %499, 1
  br i1 %.not252, label %504, label %500

500:                                              ; preds = %497
  %501 = load ptr, ptr @stderr, align 8, !tbaa !21
  %502 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %501, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 618, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %503 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #6
  br label %530

504:                                              ; preds = %497
  %505 = load i64, ptr %28, align 8, !tbaa !5
  %.not253 = icmp eq i64 %505, 12
  br i1 %.not253, label %510, label %506

506:                                              ; preds = %504
  %507 = load ptr, ptr @stderr, align 8, !tbaa !21
  %508 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %507, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 623, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %509 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #6
  br label %530

510:                                              ; preds = %504
  call void @sm3_finish(ptr noundef nonnull %24, ptr noundef nonnull %26) #6
  %511 = call i32 @tls_prf(ptr noundef nonnull %350, i64 noundef 48, ptr noundef nonnull @.str.6, ptr noundef nonnull %26, i64 noundef 32, ptr noundef null, i64 noundef 0, i64 noundef 12, ptr noundef nonnull %29) #6
  %.not254 = icmp eq i32 %511, 1
  br i1 %.not254, label %516, label %512

512:                                              ; preds = %510
  %513 = load ptr, ptr @stderr, align 8, !tbaa !21
  %514 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %513, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 630, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %515 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #6
  br label %530

516:                                              ; preds = %510
  %517 = load ptr, ptr %27, align 8, !tbaa !21
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(12) %517, ptr noundef nonnull dereferenceable(12) %29, i64 12)
  %.not255 = icmp eq i32 %bcmp, 0
  br i1 %.not255, label %522, label %518

518:                                              ; preds = %516
  %519 = load ptr, ptr @stderr, align 8, !tbaa !21
  %520 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %519, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 635, ptr noundef nonnull @__FUNCTION__.tls12_do_connect) #7
  %521 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 51) #6
  br label %530

522:                                              ; preds = %516
  %523 = getelementptr inbounds i8, ptr %0, i64 63168
  %524 = load i32, ptr %523, align 8, !tbaa !27
  %.not256 = icmp eq i32 %524, 0
  br i1 %.not256, label %525, label %528

525:                                              ; preds = %522
  %526 = load ptr, ptr @stderr, align 8, !tbaa !21
  %527 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %526, ptr noundef nonnull @.str.7) #7
  br label %528

528:                                              ; preds = %525, %522
  %529 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %529, ptr %153, align 8, !tbaa !24
  br label %530

530:                                              ; preds = %.thread269, %.thread, %528, %518, %512, %506, %500, %493, %486, %479, %464, %458, %444, %435, %424, %417, %409, %378, %370, %355, %338, %330, %315, %270, %253, %244, %225, %219, %213, %198, %180, %172, %143, %129, %123, %116, %109, %103, %89, %74, %66
  %.0189 = phi i32 [ -1, %66 ], [ -1, %74 ], [ -1, %89 ], [ -1, %103 ], [ -1, %109 ], [ -1, %116 ], [ -1, %123 ], [ -1, %143 ], [ -1, %172 ], [ -1, %180 ], [ -1, %198 ], [ -1, %213 ], [ -1, %219 ], [ -1, %225 ], [ -1, %244 ], [ -1, %253 ], [ -1, %270 ], [ -1, %315 ], [ -1, %330 ], [ -1, %338 ], [ -1, %355 ], [ -1, %370 ], [ -1, %378 ], [ -1, %409 ], [ -1, %417 ], [ -1, %424 ], [ -1, %435 ], [ -1, %444 ], [ -1, %458 ], [ -1, %464 ], [ -1, %479 ], [ -1, %486 ], [ -1, %493 ], [ -1, %500 ], [ -1, %506 ], [ -1, %512 ], [ -1, %518 ], [ 1, %528 ], [ -1, %129 ], [ -1, %.thread ], [ -1, %.thread269 ]
  call void @gmssl_secure_clear(ptr noundef nonnull %20, i64 noundef 3976) #6
  call void @gmssl_secure_clear(ptr noundef nonnull %23, i64 noundef 48) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %37) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %36) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %35) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %34) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %33) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %32) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %31) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %30) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %29) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %27) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %26) #6
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %25) #6
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %24) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #6
  call void @llvm.lifetime.end.p0(i64 3976, ptr nonnull %20) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 309, ptr nonnull %2) #6
  ret i32 %.0189
}

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

declare void @sm3_init(ptr noundef) local_unnamed_addr #3

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

declare i32 @tls_random_generate(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress 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) #4

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

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

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

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

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

declare void @sm3_update(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

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

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

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

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

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

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

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

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

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

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

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

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

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

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

declare void @gmssl_secure_clear(ptr noundef, i64 noundef) local_unnamed_addr #3

declare i32 @tls_record_get_handshake_server_hello_done(ptr noundef) local_unnamed_addr #3

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

declare i32 @sm2_key_generate(ptr noundef) local_unnamed_addr #3

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

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

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

declare void @sm3_hmac_init(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

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

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

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

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

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

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

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

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

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

declare i32 @tls_seq_num_incr(ptr noundef) local_unnamed_addr #3

declare i32 @tls_record_get_change_cipher_spec(ptr noundef) local_unnamed_addr #3

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

declare i32 @tls_record_get_handshake_finished(ptr noundef, ptr noundef, 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 #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind willreturn memory(argmem: read) }
attributes #6 = { nounwind }
attributes #7 = { cold 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 = !{!"long", !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 = !{!12, !10, i64 0}
!12 = !{!"", !10, i64 0, !10, i64 4, !7, i64 8, !6, i64 264, !10, i64 272, !7, i64 276, !6, i64 18720, !7, i64 18728, !7, i64 37165, !13, i64 55608, !6, i64 55616, !10, i64 55624, !7, i64 55628, !6, i64 55664, !7, i64 55672, !6, i64 57720, !7, i64 57728, !6, i64 59776, !7, i64 59784, !6, i64 61832, !14, i64 61840, !14, i64 61968, !10, i64 62096, !7, i64 62100, !7, i64 62148, !16, i64 62248, !16, i64 62424, !18, i64 62600, !18, i64 62728, !7, i64 62856, !7, i64 62864, !7, i64 62872, !7, i64 62884, !19, i64 62896, !19, i64 63032, !10, i64 63168}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"", !15, i64 0, !7, i64 96}
!15 = !{!"", !7, i64 0, !7, i64 32, !7, i64 64}
!16 = !{!"", !17, i64 0, !7, i64 112}
!17 = !{!"", !7, i64 0, !6, i64 32, !7, i64 40, !6, i64 104}
!18 = !{!"", !7, i64 0}
!19 = !{!"BLOCK_CIPHER_KEY", !7, i64 0, !13, i64 128}
!20 = !{!12, !6, i64 59776}
!21 = !{!13, !13, i64 0}
!22 = !{!12, !10, i64 272}
!23 = !{!7, !7, i64 0}
!24 = !{!12, !10, i64 55624}
!25 = !{!12, !6, i64 57720}
!26 = !{!12, !6, i64 61832}
!27 = !{!12, !10, i64 63168}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass