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

; 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_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_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_PRE_COMP = type { [4 x i64], [4 x i64] }
%struct.SM2_VERIFY_CTX = type { %struct.SM3_CTX, %struct.SM3_CTX, %struct.SM2_KEY, [16 x %struct.SM2_Z256_POINT] }
%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 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@__const.tlcp_do_accept.server_ciphers = external hidden unnamed_addr constant [1 x i32], align 4
@__FUNCTION__.tlcp_do_accept = external hidden unnamed_addr constant [15 x i8], align 1
@__const.tlcp_do_accept.cert_types = external hidden unnamed_addr constant [1 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @tlcp_record_set_handshake_server_key_exchange_pke(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #0

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

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

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

declare void @sm3_init(ptr noundef) #3

declare i32 @tls_random_generate(ptr 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 @tls_record_recv(ptr noundef, ptr noundef, i32 noundef) #3

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

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

declare i32 @tls_record_get_handshake_certificate(ptr noundef, ptr 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 void @tls_uint24_to_bytes(i32 noundef, ptr noundef, ptr noundef) #3

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

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

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

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

declare i32 @tls_record_set_handshake_certificate(ptr noundef, ptr noundef, ptr noundef, i64 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 void @sm3_finish(ptr noundef, ptr noundef) #3

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

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

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

declare i32 @tls_record_set_change_cipher_spec(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) #5

; Function Attrs: nounwind uwtable
define dso_local i32 @tlcp_do_accept(ptr noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca [309 x i8], align 16
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca [1 x i32], align 4
  %11 = alloca [32 x i8], align 16
  %12 = alloca [32 x i8], align 16
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = alloca [3 x i8], align 1
  %24 = alloca %struct.SM2_SIGN_CTX, align 8
  %25 = alloca [72 x i8], align 16
  %26 = alloca i64, align 8
  %27 = alloca %struct.SM2_KEY, align 8
  %28 = alloca %struct.SM2_VERIFY_CTX, align 8
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca i64, align 8
  %34 = alloca [255 x i8], align 16
  %35 = alloca i64, align 8
  %36 = alloca %struct.SM3_CTX, align 8
  %37 = alloca %struct.SM3_CTX, align 8
  %38 = alloca [32 x i8], align 16
  %39 = alloca [12 x i8], align 1
  %40 = alloca ptr, align 8
  %41 = alloca i64, align 8
  %42 = alloca ptr, align 8
  %43 = alloca ptr, align 8
  %44 = alloca i64, align 8
  %45 = alloca [1 x i8], align 1
  %46 = alloca [16377 x i8], align 16
  %47 = alloca i64, align 8
  %48 = alloca i32, align 4
  %49 = alloca %struct.SM3_CTX, align 8
  %50 = alloca [32 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 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.TLS_CONNECT, ptr %51, i32 0, i32 7
  %53 = getelementptr inbounds [18437 x i8], ptr %52, i64 0, i64 0
  store ptr %53, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 309, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 @__const.tlcp_do_accept.server_ciphers, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, 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 8, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  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 8, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 3, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 3976, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 72, ptr %25) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 128, ptr %27) #7
  call void @llvm.lifetime.start.p0(i64 1888, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  store i32 5, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  call void @llvm.lifetime.start.p0(i64 255, ptr %34) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #7
  call void @llvm.lifetime.start.p0(i64 112, ptr %36) #7
  call void @llvm.lifetime.start.p0(i64 112, ptr %37) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %38) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %39) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #7
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.TLS_CONNECT, ptr %54, i32 0, i32 19
  %56 = load i64, ptr %55, align 8, !tbaa !11
  %57 = icmp ne i64 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %1
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %58, %1
  call void @sm3_init(ptr noundef %36)
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.TLS_CONNECT, ptr %61, i32 0, i32 4
  %63 = load i32, ptr %62, align 8, !tbaa !20
  %64 = call i32 @tls_record_recv(ptr noundef %60, ptr noundef %8, i32 noundef %63)
  %65 = icmp ne i32 %64, 1
  br i1 %65, label %66, label %74

66:                                               ; preds = %59
  br label %67

67:                                               ; preds = %66
  %68 = load ptr, ptr @stderr, align 8, !tbaa !5
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 643, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %70

70:                                               ; preds = %67
  br label %71

71:                                               ; preds = %70
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = call i32 @tls_send_alert(ptr noundef %72, i32 noundef 10)
  br label %934

74:                                               ; preds = %59
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds i8, ptr %75, i64 1
  %77 = load i8, ptr %76, align 1, !tbaa !21
  %78 = zext i8 %77 to i16
  %79 = zext i16 %78 to i32
  %80 = shl i32 %79, 8
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %81, i64 2
  %83 = load i8, ptr %82, align 1, !tbaa !21
  %84 = zext i8 %83 to i32
  %85 = or i32 %80, %84
  %86 = icmp ne i32 %85, 257
  br i1 %86, label %87, label %95

87:                                               ; preds = %74
  br label %88

88:                                               ; preds = %87
  %89 = load ptr, ptr @stderr, align 8, !tbaa !5
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 649, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %91

91:                                               ; preds = %88
  br label %92

92:                                               ; preds = %91
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = call i32 @tls_send_alert(ptr noundef %93, i32 noundef 70)
  br label %934

95:                                               ; preds = %74
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = call i32 @tls_record_get_handshake_client_hello(ptr noundef %96, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18, ptr noundef %19, ptr noundef %20)
  %98 = icmp ne i32 %97, 1
  br i1 %98, label %99, label %107

99:                                               ; preds = %95
  br label %100

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

103:                                              ; preds = %100
  br label %104

104:                                              ; preds = %103
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = call i32 @tls_send_alert(ptr noundef %105, i32 noundef 10)
  br label %934

107:                                              ; preds = %95
  %108 = load i32, ptr %13, align 4, !tbaa !9
  %109 = icmp ne i32 %108, 257
  br i1 %109, label %110, label %118

110:                                              ; preds = %107
  br label %111

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

114:                                              ; preds = %111
  br label %115

115:                                              ; preds = %114
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = call i32 @tls_send_alert(ptr noundef %116, i32 noundef 70)
  br label %934

118:                                              ; preds = %107
  %119 = getelementptr inbounds [32 x i8], ptr %11, i64 0, i64 0
  %120 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %119, ptr align 1 %120, i64 32, i1 false)
  %121 = load ptr, ptr %17, align 8, !tbaa !5
  %122 = load i64, ptr %18, align 8, !tbaa !22
  %123 = getelementptr inbounds [1 x i32], ptr %10, i64 0, i64 0
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.TLS_CONNECT, ptr %124, i32 0, i32 11
  %126 = call i32 @tls_cipher_suites_select(ptr noundef %121, i64 noundef %122, ptr noundef %123, i64 noundef 1, ptr noundef %125)
  %127 = icmp ne i32 %126, 1
  br i1 %127, label %128, label %136

128:                                              ; preds = %118
  br label %129

129:                                              ; preds = %128
  %130 = load ptr, ptr @stderr, align 8, !tbaa !5
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 670, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %132

132:                                              ; preds = %129
  br label %133

133:                                              ; preds = %132
  %134 = load ptr, ptr %3, align 8, !tbaa !5
  %135 = call i32 @tls_send_alert(ptr noundef %134, i32 noundef 71)
  br label %934

136:                                              ; preds = %118
  %137 = load ptr, ptr %19, align 8, !tbaa !5
  %138 = icmp ne ptr %137, null
  br i1 %138, label %139, label %147

139:                                              ; preds = %136
  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 676, ptr noundef @__FUNCTION__.tlcp_do_accept) #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 %934

147:                                              ; preds = %136
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = getelementptr inbounds i8, ptr %148, i64 5
  %150 = load i64, ptr %8, align 8, !tbaa !22
  %151 = sub i64 %150, 5
  call void @sm3_update(ptr noundef %36, ptr noundef %149, i64 noundef %151)
  %152 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %153 = call i32 @tls_random_generate(ptr noundef %152)
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %156 = load ptr, ptr %3, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.TLS_CONNECT, ptr %156, i32 0, i32 11
  %158 = load i32, ptr %157, align 8, !tbaa !23
  %159 = call i32 @tls_record_set_handshake_server_hello(ptr noundef %154, ptr noundef %8, i32 noundef 257, ptr noundef %155, ptr noundef null, i64 noundef 0, i32 noundef %158, ptr noundef null, i64 noundef 0)
  %160 = icmp ne i32 %159, 1
  br i1 %160, label %161, label %169

161:                                              ; preds = %147
  br label %162

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

165:                                              ; preds = %162
  br label %166

166:                                              ; preds = %165
  %167 = load ptr, ptr %3, align 8, !tbaa !5
  %168 = call i32 @tls_send_alert(ptr noundef %167, i32 noundef 80)
  br label %934

169:                                              ; preds = %147
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = load i64, ptr %8, align 8, !tbaa !22
  %172 = load ptr, ptr %3, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.TLS_CONNECT, ptr %172, i32 0, i32 4
  %174 = load i32, ptr %173, align 8, !tbaa !20
  %175 = call i32 @tls_record_send(ptr noundef %170, i64 noundef %171, i32 noundef %174)
  %176 = icmp ne i32 %175, 1
  br i1 %176, label %177, label %183

177:                                              ; preds = %169
  br label %178

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

181:                                              ; preds = %178
  br label %182

182:                                              ; preds = %181
  br label %934

183:                                              ; preds = %169
  %184 = load ptr, ptr %6, align 8, !tbaa !5
  %185 = getelementptr inbounds i8, ptr %184, i64 5
  %186 = load i64, ptr %8, align 8, !tbaa !22
  %187 = sub i64 %186, 5
  call void @sm3_update(ptr noundef %36, ptr noundef %185, i64 noundef %187)
  %188 = load ptr, ptr %6, align 8, !tbaa !5
  %189 = load ptr, ptr %3, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.TLS_CONNECT, ptr %189, i32 0, i32 14
  %191 = getelementptr inbounds [2048 x i8], ptr %190, i64 0, i64 0
  %192 = load ptr, ptr %3, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.TLS_CONNECT, ptr %192, i32 0, i32 15
  %194 = load i64, ptr %193, align 8, !tbaa !24
  %195 = call i32 @tls_record_set_handshake_certificate(ptr noundef %188, ptr noundef %8, ptr noundef %191, i64 noundef %194)
  %196 = icmp ne i32 %195, 1
  br i1 %196, label %197, label %205

197:                                              ; preds = %183
  br label %198

198:                                              ; preds = %197
  %199 = load ptr, ptr @stderr, align 8, !tbaa !5
  %200 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %199, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 703, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %201

201:                                              ; preds = %198
  br label %202

202:                                              ; preds = %201
  %203 = load ptr, ptr %3, align 8, !tbaa !5
  %204 = call i32 @tls_send_alert(ptr noundef %203, i32 noundef 80)
  br label %934

205:                                              ; preds = %183
  %206 = load ptr, ptr %6, align 8, !tbaa !5
  %207 = load i64, ptr %8, align 8, !tbaa !22
  %208 = load ptr, ptr %3, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.TLS_CONNECT, ptr %208, i32 0, i32 4
  %210 = load i32, ptr %209, align 8, !tbaa !20
  %211 = call i32 @tls_record_send(ptr noundef %206, i64 noundef %207, i32 noundef %210)
  %212 = icmp ne i32 %211, 1
  br i1 %212, label %213, label %219

213:                                              ; preds = %205
  br label %214

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

217:                                              ; preds = %214
  br label %218

218:                                              ; preds = %217
  br label %934

219:                                              ; preds = %205
  %220 = load ptr, ptr %6, align 8, !tbaa !5
  %221 = getelementptr inbounds i8, ptr %220, i64 5
  %222 = load i64, ptr %8, align 8, !tbaa !22
  %223 = sub i64 %222, 5
  call void @sm3_update(ptr noundef %36, ptr noundef %221, i64 noundef %223)
  %224 = load ptr, ptr %3, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.TLS_CONNECT, ptr %224, i32 0, i32 14
  %226 = getelementptr inbounds [2048 x i8], ptr %225, i64 0, i64 0
  %227 = load ptr, ptr %3, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.TLS_CONNECT, ptr %227, i32 0, i32 15
  %229 = load i64, ptr %228, align 8, !tbaa !24
  %230 = call i32 @x509_certs_get_cert_by_index(ptr noundef %226, i64 noundef %229, i32 noundef 1, ptr noundef %21, ptr noundef %22)
  %231 = icmp ne i32 %230, 1
  br i1 %231, label %232, label %238

232:                                              ; preds = %219
  br label %233

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

236:                                              ; preds = %233
  br label %237

237:                                              ; preds = %236
  br label %934

238:                                              ; preds = %219
  %239 = getelementptr inbounds [3 x i8], ptr %23, i64 0, i64 0
  store ptr %239, ptr %42, align 8, !tbaa !5
  store i64 0, ptr %44, align 8, !tbaa !22
  %240 = load i64, ptr %22, align 8, !tbaa !22
  %241 = trunc i64 %240 to i32
  call void @tls_uint24_to_bytes(i32 noundef %241, ptr noundef %42, ptr noundef %44)
  %242 = load ptr, ptr %3, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.TLS_CONNECT, ptr %242, i32 0, i32 20
  %244 = call i32 @sm2_sign_init(ptr noundef %24, ptr noundef %243, ptr noundef @.str.4, i64 noundef 16)
  %245 = icmp ne i32 %244, 1
  br i1 %245, label %267, label %246

246:                                              ; preds = %238
  %247 = getelementptr inbounds [32 x i8], ptr %11, i64 0, i64 0
  %248 = call i32 @sm2_sign_update(ptr noundef %24, ptr noundef %247, i64 noundef 32)
  %249 = icmp ne i32 %248, 1
  br i1 %249, label %267, label %250

250:                                              ; preds = %246
  %251 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %252 = call i32 @sm2_sign_update(ptr noundef %24, ptr noundef %251, i64 noundef 32)
  %253 = icmp ne i32 %252, 1
  br i1 %253, label %267, label %254

254:                                              ; preds = %250
  %255 = getelementptr inbounds [3 x i8], ptr %23, i64 0, i64 0
  %256 = call i32 @sm2_sign_update(ptr noundef %24, ptr noundef %255, i64 noundef 3)
  %257 = icmp ne i32 %256, 1
  br i1 %257, label %267, label %258

258:                                              ; preds = %254
  %259 = load ptr, ptr %21, align 8, !tbaa !5
  %260 = load i64, ptr %22, align 8, !tbaa !22
  %261 = call i32 @sm2_sign_update(ptr noundef %24, ptr noundef %259, i64 noundef %260)
  %262 = icmp ne i32 %261, 1
  br i1 %262, label %267, label %263

263:                                              ; preds = %258
  %264 = getelementptr inbounds [72 x i8], ptr %25, i64 0, i64 0
  %265 = call i32 @sm2_sign_finish(ptr noundef %24, ptr noundef %264, ptr noundef %26)
  %266 = icmp ne i32 %265, 1
  br i1 %266, label %267, label %275

267:                                              ; preds = %263, %258, %254, %250, %246, %238
  br label %268

268:                                              ; preds = %267
  %269 = load ptr, ptr @stderr, align 8, !tbaa !5
  %270 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %269, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 729, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %271

271:                                              ; preds = %268
  br label %272

272:                                              ; preds = %271
  %273 = load ptr, ptr %3, align 8, !tbaa !5
  %274 = call i32 @tls_send_alert(ptr noundef %273, i32 noundef 80)
  br label %934

275:                                              ; preds = %263
  %276 = load ptr, ptr %6, align 8, !tbaa !5
  %277 = getelementptr inbounds [72 x i8], ptr %25, i64 0, i64 0
  %278 = load i64, ptr %26, align 8, !tbaa !22
  %279 = call i32 @tlcp_record_set_handshake_server_key_exchange_pke(ptr noundef %276, ptr noundef %8, ptr noundef %277, i64 noundef %278)
  %280 = icmp ne i32 %279, 1
  br i1 %280, label %281, label %289

281:                                              ; preds = %275
  br label %282

282:                                              ; preds = %281
  %283 = load ptr, ptr @stderr, align 8, !tbaa !5
  %284 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %283, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 734, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %285

285:                                              ; preds = %282
  br label %286

286:                                              ; preds = %285
  %287 = load ptr, ptr %3, align 8, !tbaa !5
  %288 = call i32 @tls_send_alert(ptr noundef %287, i32 noundef 80)
  br label %934

289:                                              ; preds = %275
  %290 = load ptr, ptr %6, align 8, !tbaa !5
  %291 = load i64, ptr %8, align 8, !tbaa !22
  %292 = load ptr, ptr %3, align 8, !tbaa !5
  %293 = getelementptr inbounds %struct.TLS_CONNECT, ptr %292, i32 0, i32 4
  %294 = load i32, ptr %293, align 8, !tbaa !20
  %295 = call i32 @tls_record_send(ptr noundef %290, i64 noundef %291, i32 noundef %294)
  %296 = icmp ne i32 %295, 1
  br i1 %296, label %297, label %303

297:                                              ; preds = %289
  br label %298

298:                                              ; preds = %297
  %299 = load ptr, ptr @stderr, align 8, !tbaa !5
  %300 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %299, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 740, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %301

301:                                              ; preds = %298
  br label %302

302:                                              ; preds = %301
  br label %934

303:                                              ; preds = %289
  %304 = load ptr, ptr %6, align 8, !tbaa !5
  %305 = getelementptr inbounds i8, ptr %304, i64 5
  %306 = load i64, ptr %8, align 8, !tbaa !22
  %307 = sub i64 %306, 5
  call void @sm3_update(ptr noundef %36, ptr noundef %305, i64 noundef %307)
  %308 = load i32, ptr %5, align 4, !tbaa !9
  %309 = icmp ne i32 %308, 0
  br i1 %309, label %310, label %361

310:                                              ; preds = %303
  call void @llvm.lifetime.start.p0(i64 1, ptr %45) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %45, ptr align 1 @__const.tlcp_do_accept.cert_types, i64 1, i1 false)
  call void @llvm.lifetime.start.p0(i64 16377, ptr %46) #7
  call void @llvm.memset.p0.i64(ptr align 16 %46, i8 0, i64 16377, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #7
  store i64 0, ptr %47, align 8, !tbaa !22
  %311 = getelementptr inbounds [16377 x i8], ptr %46, i64 0, i64 0
  %312 = load ptr, ptr %3, align 8, !tbaa !5
  %313 = getelementptr inbounds %struct.TLS_CONNECT, ptr %312, i32 0, i32 18
  %314 = getelementptr inbounds [2048 x i8], ptr %313, i64 0, i64 0
  %315 = load ptr, ptr %3, align 8, !tbaa !5
  %316 = getelementptr inbounds %struct.TLS_CONNECT, ptr %315, i32 0, i32 19
  %317 = load i64, ptr %316, align 8, !tbaa !11
  %318 = call i32 @tls_authorities_from_certs(ptr noundef %311, ptr noundef %47, i64 noundef 16377, ptr noundef %314, i64 noundef %317)
  %319 = icmp ne i32 %318, 1
  br i1 %319, label %320, label %326

320:                                              ; preds = %310
  br label %321

321:                                              ; preds = %320
  %322 = load ptr, ptr @stderr, align 8, !tbaa !5
  %323 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %322, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 754, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %324

324:                                              ; preds = %321
  br label %325

325:                                              ; preds = %324
  store i32 4, ptr %48, align 4
  br label %358

326:                                              ; preds = %310
  %327 = load ptr, ptr %6, align 8, !tbaa !5
  %328 = getelementptr inbounds [1 x i8], ptr %45, i64 0, i64 0
  %329 = getelementptr inbounds [16377 x i8], ptr %46, i64 0, i64 0
  %330 = load i64, ptr %47, align 8, !tbaa !22
  %331 = call i32 @tls_record_set_handshake_certificate_request(ptr noundef %327, ptr noundef %8, ptr noundef %328, i64 noundef 1, ptr noundef %329, i64 noundef %330)
  %332 = icmp ne i32 %331, 1
  br i1 %332, label %333, label %339

333:                                              ; preds = %326
  br label %334

334:                                              ; preds = %333
  %335 = load ptr, ptr @stderr, align 8, !tbaa !5
  %336 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %335, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 760, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %337

337:                                              ; preds = %334
  br label %338

338:                                              ; preds = %337
  store i32 4, ptr %48, align 4
  br label %358

339:                                              ; preds = %326
  %340 = load ptr, ptr %6, align 8, !tbaa !5
  %341 = load i64, ptr %8, align 8, !tbaa !22
  %342 = load ptr, ptr %3, align 8, !tbaa !5
  %343 = getelementptr inbounds %struct.TLS_CONNECT, ptr %342, i32 0, i32 4
  %344 = load i32, ptr %343, align 8, !tbaa !20
  %345 = call i32 @tls_record_send(ptr noundef %340, i64 noundef %341, i32 noundef %344)
  %346 = icmp ne i32 %345, 1
  br i1 %346, label %347, label %353

347:                                              ; preds = %339
  br label %348

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

351:                                              ; preds = %348
  br label %352

352:                                              ; preds = %351
  store i32 4, ptr %48, align 4
  br label %358

353:                                              ; preds = %339
  %354 = load ptr, ptr %6, align 8, !tbaa !5
  %355 = getelementptr inbounds i8, ptr %354, i64 5
  %356 = load i64, ptr %8, align 8, !tbaa !22
  %357 = sub i64 %356, 5
  call void @sm3_update(ptr noundef %36, ptr noundef %355, i64 noundef %357)
  store i32 0, ptr %48, align 4
  br label %358

358:                                              ; preds = %353, %352, %338, %325
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #7
  call void @llvm.lifetime.end.p0(i64 16377, ptr %46) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %45) #7
  %359 = load i32, ptr %48, align 4
  switch i32 %359, label %937 [
    i32 0, label %360
    i32 4, label %934
  ]

360:                                              ; preds = %358
  br label %361

361:                                              ; preds = %360, %303
  %362 = load ptr, ptr %6, align 8, !tbaa !5
  %363 = call i32 @tls_record_set_handshake_server_hello_done(ptr noundef %362, ptr noundef %8)
  %364 = load ptr, ptr %6, align 8, !tbaa !5
  %365 = load i64, ptr %8, align 8, !tbaa !22
  %366 = load ptr, ptr %3, align 8, !tbaa !5
  %367 = getelementptr inbounds %struct.TLS_CONNECT, ptr %366, i32 0, i32 4
  %368 = load i32, ptr %367, align 8, !tbaa !20
  %369 = call i32 @tls_record_send(ptr noundef %364, i64 noundef %365, i32 noundef %368)
  %370 = icmp ne i32 %369, 1
  br i1 %370, label %371, label %377

371:                                              ; preds = %361
  br label %372

372:                                              ; preds = %371
  %373 = load ptr, ptr @stderr, align 8, !tbaa !5
  %374 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %373, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 776, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %375

375:                                              ; preds = %372
  br label %376

376:                                              ; preds = %375
  br label %934

377:                                              ; preds = %361
  %378 = load ptr, ptr %6, align 8, !tbaa !5
  %379 = getelementptr inbounds i8, ptr %378, i64 5
  %380 = load i64, ptr %8, align 8, !tbaa !22
  %381 = sub i64 %380, 5
  call void @sm3_update(ptr noundef %36, ptr noundef %379, i64 noundef %381)
  %382 = load ptr, ptr %3, align 8, !tbaa !5
  %383 = getelementptr inbounds %struct.TLS_CONNECT, ptr %382, i32 0, i32 19
  %384 = load i64, ptr %383, align 8, !tbaa !11
  %385 = icmp ne i64 %384, 0
  br i1 %385, label %386, label %459

386:                                              ; preds = %377
  %387 = load ptr, ptr %6, align 8, !tbaa !5
  %388 = load ptr, ptr %3, align 8, !tbaa !5
  %389 = getelementptr inbounds %struct.TLS_CONNECT, ptr %388, i32 0, i32 4
  %390 = load i32, ptr %389, align 8, !tbaa !20
  %391 = call i32 @tls_record_recv(ptr noundef %387, ptr noundef %8, i32 noundef %390)
  %392 = icmp ne i32 %391, 1
  br i1 %392, label %406, label %393

393:                                              ; preds = %386
  %394 = load ptr, ptr %6, align 8, !tbaa !5
  %395 = getelementptr inbounds i8, ptr %394, i64 1
  %396 = load i8, ptr %395, align 1, !tbaa !21
  %397 = zext i8 %396 to i16
  %398 = zext i16 %397 to i32
  %399 = shl i32 %398, 8
  %400 = load ptr, ptr %6, align 8, !tbaa !5
  %401 = getelementptr inbounds i8, ptr %400, i64 2
  %402 = load i8, ptr %401, align 1, !tbaa !21
  %403 = zext i8 %402 to i32
  %404 = or i32 %399, %403
  %405 = icmp ne i32 %404, 257
  br i1 %405, label %406, label %414

406:                                              ; preds = %393, %386
  br label %407

407:                                              ; preds = %406
  %408 = load ptr, ptr @stderr, align 8, !tbaa !5
  %409 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %408, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 786, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %410

410:                                              ; preds = %407
  br label %411

411:                                              ; preds = %410
  %412 = load ptr, ptr %3, align 8, !tbaa !5
  %413 = call i32 @tls_send_alert(ptr noundef %412, i32 noundef 10)
  br label %934

414:                                              ; preds = %393
  %415 = load ptr, ptr %6, align 8, !tbaa !5
  %416 = load ptr, ptr %3, align 8, !tbaa !5
  %417 = getelementptr inbounds %struct.TLS_CONNECT, ptr %416, i32 0, i32 16
  %418 = getelementptr inbounds [2048 x i8], ptr %417, i64 0, i64 0
  %419 = load ptr, ptr %3, align 8, !tbaa !5
  %420 = getelementptr inbounds %struct.TLS_CONNECT, ptr %419, i32 0, i32 17
  %421 = call i32 @tls_record_get_handshake_certificate(ptr noundef %415, ptr noundef %418, ptr noundef %420)
  %422 = icmp ne i32 %421, 1
  br i1 %422, label %423, label %431

423:                                              ; preds = %414
  br label %424

424:                                              ; preds = %423
  %425 = load ptr, ptr @stderr, align 8, !tbaa !5
  %426 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %425, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 792, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %427

427:                                              ; preds = %424
  br label %428

428:                                              ; preds = %427
  %429 = load ptr, ptr %3, align 8, !tbaa !5
  %430 = call i32 @tls_send_alert(ptr noundef %429, i32 noundef 10)
  br label %934

431:                                              ; preds = %414
  %432 = load ptr, ptr %3, align 8, !tbaa !5
  %433 = getelementptr inbounds %struct.TLS_CONNECT, ptr %432, i32 0, i32 16
  %434 = getelementptr inbounds [2048 x i8], ptr %433, i64 0, i64 0
  %435 = load ptr, ptr %3, align 8, !tbaa !5
  %436 = getelementptr inbounds %struct.TLS_CONNECT, ptr %435, i32 0, i32 17
  %437 = load i64, ptr %436, align 8, !tbaa !25
  %438 = load ptr, ptr %3, align 8, !tbaa !5
  %439 = getelementptr inbounds %struct.TLS_CONNECT, ptr %438, i32 0, i32 18
  %440 = getelementptr inbounds [2048 x i8], ptr %439, i64 0, i64 0
  %441 = load ptr, ptr %3, align 8, !tbaa !5
  %442 = getelementptr inbounds %struct.TLS_CONNECT, ptr %441, i32 0, i32 19
  %443 = load i64, ptr %442, align 8, !tbaa !11
  %444 = call i32 @x509_certs_verify(ptr noundef %434, i64 noundef %437, i32 noundef 1, ptr noundef %440, i64 noundef %443, i32 noundef 5, ptr noundef %31)
  %445 = icmp ne i32 %444, 1
  br i1 %445, label %446, label %454

446:                                              ; preds = %431
  br label %447

447:                                              ; preds = %446
  %448 = load ptr, ptr @stderr, align 8, !tbaa !5
  %449 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %448, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 798, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %450

450:                                              ; preds = %447
  br label %451

451:                                              ; preds = %450
  %452 = load ptr, ptr %3, align 8, !tbaa !5
  %453 = call i32 @tls_send_alert(ptr noundef %452, i32 noundef 42)
  br label %934

454:                                              ; preds = %431
  %455 = load ptr, ptr %6, align 8, !tbaa !5
  %456 = getelementptr inbounds i8, ptr %455, i64 5
  %457 = load i64, ptr %8, align 8, !tbaa !22
  %458 = sub i64 %457, 5
  call void @sm3_update(ptr noundef %36, ptr noundef %456, i64 noundef %458)
  br label %459

459:                                              ; preds = %454, %377
  %460 = load ptr, ptr %6, align 8, !tbaa !5
  %461 = load ptr, ptr %3, align 8, !tbaa !5
  %462 = getelementptr inbounds %struct.TLS_CONNECT, ptr %461, i32 0, i32 4
  %463 = load i32, ptr %462, align 8, !tbaa !20
  %464 = call i32 @tls_record_recv(ptr noundef %460, ptr noundef %8, i32 noundef %463)
  %465 = icmp ne i32 %464, 1
  br i1 %465, label %479, label %466

466:                                              ; preds = %459
  %467 = load ptr, ptr %6, align 8, !tbaa !5
  %468 = getelementptr inbounds i8, ptr %467, i64 1
  %469 = load i8, ptr %468, align 1, !tbaa !21
  %470 = zext i8 %469 to i16
  %471 = zext i16 %470 to i32
  %472 = shl i32 %471, 8
  %473 = load ptr, ptr %6, align 8, !tbaa !5
  %474 = getelementptr inbounds i8, ptr %473, i64 2
  %475 = load i8, ptr %474, align 1, !tbaa !21
  %476 = zext i8 %475 to i32
  %477 = or i32 %472, %476
  %478 = icmp ne i32 %477, 257
  br i1 %478, label %479, label %487

479:                                              ; preds = %466, %459
  br label %480

480:                                              ; preds = %479
  %481 = load ptr, ptr @stderr, align 8, !tbaa !5
  %482 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %481, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 809, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %483

483:                                              ; preds = %480
  br label %484

484:                                              ; preds = %483
  %485 = load ptr, ptr %3, align 8, !tbaa !5
  %486 = call i32 @tls_send_alert(ptr noundef %485, i32 noundef 10)
  br label %934

487:                                              ; preds = %466
  %488 = load ptr, ptr %6, align 8, !tbaa !5
  %489 = call i32 @tls_record_get_handshake_client_key_exchange_pke(ptr noundef %488, ptr noundef %32, ptr noundef %33)
  %490 = icmp ne i32 %489, 1
  br i1 %490, label %491, label %499

491:                                              ; preds = %487
  br label %492

492:                                              ; preds = %491
  %493 = load ptr, ptr @stderr, align 8, !tbaa !5
  %494 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %493, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 815, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %495

495:                                              ; preds = %492
  br label %496

496:                                              ; preds = %495
  %497 = load ptr, ptr %3, align 8, !tbaa !5
  %498 = call i32 @tls_send_alert(ptr noundef %497, i32 noundef 10)
  br label %934

499:                                              ; preds = %487
  %500 = load ptr, ptr %3, align 8, !tbaa !5
  %501 = getelementptr inbounds %struct.TLS_CONNECT, ptr %500, i32 0, i32 21
  %502 = load ptr, ptr %32, align 8, !tbaa !5
  %503 = load i64, ptr %33, align 8, !tbaa !22
  %504 = getelementptr inbounds [255 x i8], ptr %34, i64 0, i64 0
  %505 = call i32 @sm2_decrypt(ptr noundef %501, ptr noundef %502, i64 noundef %503, ptr noundef %504, ptr noundef %35)
  %506 = icmp ne i32 %505, 1
  br i1 %506, label %507, label %515

507:                                              ; preds = %499
  br label %508

508:                                              ; preds = %507
  %509 = load ptr, ptr @stderr, align 8, !tbaa !5
  %510 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %509, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 821, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %511

511:                                              ; preds = %508
  br label %512

512:                                              ; preds = %511
  %513 = load ptr, ptr %3, align 8, !tbaa !5
  %514 = call i32 @tls_send_alert(ptr noundef %513, i32 noundef 51)
  br label %934

515:                                              ; preds = %499
  %516 = load i64, ptr %35, align 8, !tbaa !22
  %517 = icmp ne i64 %516, 48
  br i1 %517, label %518, label %526

518:                                              ; preds = %515
  br label %519

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

522:                                              ; preds = %519
  br label %523

523:                                              ; preds = %522
  %524 = load ptr, ptr %3, align 8, !tbaa !5
  %525 = call i32 @tls_send_alert(ptr noundef %524, i32 noundef 51)
  br label %934

526:                                              ; preds = %515
  %527 = load ptr, ptr %6, align 8, !tbaa !5
  %528 = getelementptr inbounds i8, ptr %527, i64 5
  %529 = load i64, ptr %8, align 8, !tbaa !22
  %530 = sub i64 %529, 5
  call void @sm3_update(ptr noundef %36, ptr noundef %528, i64 noundef %530)
  %531 = load i32, ptr %5, align 4, !tbaa !9
  %532 = icmp ne i32 %531, 0
  br i1 %532, label %533, label %624

533:                                              ; preds = %526
  call void @llvm.lifetime.start.p0(i64 112, ptr %49) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %49, ptr align 8 %36, i64 112, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.start.p0(i64 32, ptr %50) #7
  %534 = load ptr, ptr %6, align 8, !tbaa !5
  %535 = load ptr, ptr %3, align 8, !tbaa !5
  %536 = getelementptr inbounds %struct.TLS_CONNECT, ptr %535, i32 0, i32 4
  %537 = load i32, ptr %536, align 8, !tbaa !20
  %538 = call i32 @tls_record_recv(ptr noundef %534, ptr noundef %8, i32 noundef %537)
  %539 = icmp ne i32 %538, 1
  br i1 %539, label %553, label %540

540:                                              ; preds = %533
  %541 = load ptr, ptr %6, align 8, !tbaa !5
  %542 = getelementptr inbounds i8, ptr %541, i64 1
  %543 = load i8, ptr %542, align 1, !tbaa !21
  %544 = zext i8 %543 to i16
  %545 = zext i16 %544 to i32
  %546 = shl i32 %545, 8
  %547 = load ptr, ptr %6, align 8, !tbaa !5
  %548 = getelementptr inbounds i8, ptr %547, i64 2
  %549 = load i8, ptr %548, align 1, !tbaa !21
  %550 = zext i8 %549 to i32
  %551 = or i32 %546, %550
  %552 = icmp ne i32 %551, 257
  br i1 %552, label %553, label %561

553:                                              ; preds = %540, %533
  %554 = load ptr, ptr %3, align 8, !tbaa !5
  %555 = call i32 @tls_send_alert(ptr noundef %554, i32 noundef 10)
  br label %556

556:                                              ; preds = %553
  %557 = load ptr, ptr @stderr, align 8, !tbaa !5
  %558 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %557, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 841, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %559

559:                                              ; preds = %556
  br label %560

560:                                              ; preds = %559
  store i32 4, ptr %48, align 4
  br label %621

561:                                              ; preds = %540
  %562 = load ptr, ptr %6, align 8, !tbaa !5
  %563 = call i32 @tls_record_get_handshake_certificate_verify(ptr noundef %562, ptr noundef %29, ptr noundef %26)
  %564 = icmp ne i32 %563, 1
  br i1 %564, label %565, label %573

565:                                              ; preds = %561
  %566 = load ptr, ptr %3, align 8, !tbaa !5
  %567 = call i32 @tls_send_alert(ptr noundef %566, i32 noundef 10)
  br label %568

568:                                              ; preds = %565
  %569 = load ptr, ptr @stderr, align 8, !tbaa !5
  %570 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %569, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 847, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %571

571:                                              ; preds = %568
  br label %572

572:                                              ; preds = %571
  store i32 4, ptr %48, align 4
  br label %621

573:                                              ; preds = %561
  %574 = load ptr, ptr %3, align 8, !tbaa !5
  %575 = getelementptr inbounds %struct.TLS_CONNECT, ptr %574, i32 0, i32 16
  %576 = getelementptr inbounds [2048 x i8], ptr %575, i64 0, i64 0
  %577 = load ptr, ptr %3, align 8, !tbaa !5
  %578 = getelementptr inbounds %struct.TLS_CONNECT, ptr %577, i32 0, i32 17
  %579 = load i64, ptr %578, align 8, !tbaa !25
  %580 = call i32 @x509_certs_get_cert_by_index(ptr noundef %576, i64 noundef %579, i32 noundef 0, ptr noundef %43, ptr noundef %44)
  %581 = icmp ne i32 %580, 1
  br i1 %581, label %587, label %582

582:                                              ; preds = %573
  %583 = load ptr, ptr %43, align 8, !tbaa !5
  %584 = load i64, ptr %44, align 8, !tbaa !22
  %585 = call i32 @x509_cert_get_subject_public_key(ptr noundef %583, i64 noundef %584, ptr noundef %27)
  %586 = icmp ne i32 %585, 1
  br i1 %586, label %587, label %595

587:                                              ; preds = %582, %573
  br label %588

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

591:                                              ; preds = %588
  br label %592

592:                                              ; preds = %591
  %593 = load ptr, ptr %3, align 8, !tbaa !5
  %594 = call i32 @tls_send_alert(ptr noundef %593, i32 noundef 42)
  store i32 4, ptr %48, align 4
  br label %621

595:                                              ; preds = %582
  %596 = getelementptr inbounds [32 x i8], ptr %50, i64 0, i64 0
  call void @sm3_finish(ptr noundef %49, ptr noundef %596)
  %597 = call i32 @sm2_verify_init(ptr noundef %28, ptr noundef %27, ptr noundef @.str.4, i64 noundef 16)
  %598 = icmp ne i32 %597, 1
  br i1 %598, label %608, label %599

599:                                              ; preds = %595
  %600 = getelementptr inbounds [32 x i8], ptr %50, i64 0, i64 0
  %601 = call i32 @sm2_verify_update(ptr noundef %28, ptr noundef %600, i64 noundef 32)
  %602 = icmp ne i32 %601, 1
  br i1 %602, label %608, label %603

603:                                              ; preds = %599
  %604 = load ptr, ptr %29, align 8, !tbaa !5
  %605 = load i64, ptr %26, align 8, !tbaa !22
  %606 = call i32 @sm2_verify_finish(ptr noundef %28, ptr noundef %604, i64 noundef %605)
  %607 = icmp ne i32 %606, 1
  br i1 %607, label %608, label %616

608:                                              ; preds = %603, %599, %595
  br label %609

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

612:                                              ; preds = %609
  br label %613

613:                                              ; preds = %612
  %614 = load ptr, ptr %3, align 8, !tbaa !5
  %615 = call i32 @tls_send_alert(ptr noundef %614, i32 noundef 51)
  store i32 4, ptr %48, align 4
  br label %621

616:                                              ; preds = %603
  %617 = load ptr, ptr %6, align 8, !tbaa !5
  %618 = getelementptr inbounds i8, ptr %617, i64 5
  %619 = load i64, ptr %8, align 8, !tbaa !22
  %620 = sub i64 %619, 5
  call void @sm3_update(ptr noundef %36, ptr noundef %618, i64 noundef %620)
  store i32 0, ptr %48, align 4
  br label %621

621:                                              ; preds = %616, %613, %592, %572, %560
  call void @llvm.lifetime.end.p0(i64 32, ptr %50) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr %49) #7
  %622 = load i32, ptr %48, align 4
  switch i32 %622, label %937 [
    i32 0, label %623
    i32 4, label %934
  ]

623:                                              ; preds = %621
  br label %624

624:                                              ; preds = %623, %526
  %625 = getelementptr inbounds [255 x i8], ptr %34, i64 0, i64 0
  %626 = getelementptr inbounds [32 x i8], ptr %11, i64 0, i64 0
  %627 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %628 = load ptr, ptr %3, align 8, !tbaa !5
  %629 = getelementptr inbounds %struct.TLS_CONNECT, ptr %628, i32 0, i32 23
  %630 = getelementptr inbounds [48 x i8], ptr %629, i64 0, i64 0
  %631 = call i32 @tls_prf(ptr noundef %625, i64 noundef 48, ptr noundef @.str.5, ptr noundef %626, i64 noundef 32, ptr noundef %627, i64 noundef 32, i64 noundef 48, ptr noundef %630)
  %632 = icmp ne i32 %631, 1
  br i1 %632, label %644, label %633

633:                                              ; preds = %624
  %634 = load ptr, ptr %3, align 8, !tbaa !5
  %635 = getelementptr inbounds %struct.TLS_CONNECT, ptr %634, i32 0, i32 23
  %636 = getelementptr inbounds [48 x i8], ptr %635, i64 0, i64 0
  %637 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %638 = getelementptr inbounds [32 x i8], ptr %11, i64 0, i64 0
  %639 = load ptr, ptr %3, align 8, !tbaa !5
  %640 = getelementptr inbounds %struct.TLS_CONNECT, ptr %639, i32 0, i32 24
  %641 = getelementptr inbounds [96 x i8], ptr %640, i64 0, i64 0
  %642 = call i32 @tls_prf(ptr noundef %636, i64 noundef 48, ptr noundef @.str.6, ptr noundef %637, i64 noundef 32, ptr noundef %638, i64 noundef 32, i64 noundef 96, ptr noundef %641)
  %643 = icmp ne i32 %642, 1
  br i1 %643, label %644, label %652

644:                                              ; preds = %633, %624
  br label %645

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

648:                                              ; preds = %645
  br label %649

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

652:                                              ; preds = %633
  %653 = load ptr, ptr %3, align 8, !tbaa !5
  %654 = getelementptr inbounds %struct.TLS_CONNECT, ptr %653, i32 0, i32 25
  %655 = load ptr, ptr %3, align 8, !tbaa !5
  %656 = getelementptr inbounds %struct.TLS_CONNECT, ptr %655, i32 0, i32 24
  %657 = getelementptr inbounds [96 x i8], ptr %656, i64 0, i64 0
  call void @sm3_hmac_init(ptr noundef %654, ptr noundef %657, i64 noundef 32)
  %658 = load ptr, ptr %3, align 8, !tbaa !5
  %659 = getelementptr inbounds %struct.TLS_CONNECT, ptr %658, i32 0, i32 26
  %660 = load ptr, ptr %3, align 8, !tbaa !5
  %661 = getelementptr inbounds %struct.TLS_CONNECT, ptr %660, i32 0, i32 24
  %662 = getelementptr inbounds [96 x i8], ptr %661, i64 0, i64 0
  %663 = getelementptr inbounds i8, ptr %662, i64 32
  call void @sm3_hmac_init(ptr noundef %659, ptr noundef %663, i64 noundef 32)
  %664 = load ptr, ptr %3, align 8, !tbaa !5
  %665 = getelementptr inbounds %struct.TLS_CONNECT, ptr %664, i32 0, i32 27
  %666 = load ptr, ptr %3, align 8, !tbaa !5
  %667 = getelementptr inbounds %struct.TLS_CONNECT, ptr %666, i32 0, i32 24
  %668 = getelementptr inbounds [96 x i8], ptr %667, i64 0, i64 0
  %669 = getelementptr inbounds i8, ptr %668, i64 64
  call void @sm4_set_decrypt_key(ptr noundef %665, ptr noundef %669)
  %670 = load ptr, ptr %3, align 8, !tbaa !5
  %671 = getelementptr inbounds %struct.TLS_CONNECT, ptr %670, i32 0, i32 28
  %672 = load ptr, ptr %3, align 8, !tbaa !5
  %673 = getelementptr inbounds %struct.TLS_CONNECT, ptr %672, i32 0, i32 24
  %674 = getelementptr inbounds [96 x i8], ptr %673, i64 0, i64 0
  %675 = getelementptr inbounds i8, ptr %674, i64 80
  call void @sm4_set_encrypt_key(ptr noundef %671, ptr noundef %675)
  %676 = load ptr, ptr %6, align 8, !tbaa !5
  %677 = load ptr, ptr %3, align 8, !tbaa !5
  %678 = getelementptr inbounds %struct.TLS_CONNECT, ptr %677, i32 0, i32 4
  %679 = load i32, ptr %678, align 8, !tbaa !20
  %680 = call i32 @tls_record_recv(ptr noundef %676, ptr noundef %8, i32 noundef %679)
  %681 = icmp ne i32 %680, 1
  br i1 %681, label %695, label %682

682:                                              ; preds = %652
  %683 = load ptr, ptr %6, align 8, !tbaa !5
  %684 = getelementptr inbounds i8, ptr %683, i64 1
  %685 = load i8, ptr %684, align 1, !tbaa !21
  %686 = zext i8 %685 to i16
  %687 = zext i16 %686 to i32
  %688 = shl i32 %687, 8
  %689 = load ptr, ptr %6, align 8, !tbaa !5
  %690 = getelementptr inbounds i8, ptr %689, i64 2
  %691 = load i8, ptr %690, align 1, !tbaa !21
  %692 = zext i8 %691 to i32
  %693 = or i32 %688, %692
  %694 = icmp ne i32 %693, 257
  br i1 %694, label %695, label %703

695:                                              ; preds = %682, %652
  br label %696

696:                                              ; preds = %695
  %697 = load ptr, ptr @stderr, align 8, !tbaa !5
  %698 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %697, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 897, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %699

699:                                              ; preds = %696
  br label %700

700:                                              ; preds = %699
  %701 = load ptr, ptr %3, align 8, !tbaa !5
  %702 = call i32 @tls_send_alert(ptr noundef %701, i32 noundef 10)
  br label %934

703:                                              ; preds = %682
  %704 = load ptr, ptr %6, align 8, !tbaa !5
  %705 = call i32 @tls_record_get_change_cipher_spec(ptr noundef %704)
  %706 = icmp ne i32 %705, 1
  br i1 %706, label %707, label %715

707:                                              ; preds = %703
  br label %708

708:                                              ; preds = %707
  %709 = load ptr, ptr @stderr, align 8, !tbaa !5
  %710 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %709, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 903, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %711

711:                                              ; preds = %708
  br label %712

712:                                              ; preds = %711
  %713 = load ptr, ptr %3, align 8, !tbaa !5
  %714 = call i32 @tls_send_alert(ptr noundef %713, i32 noundef 10)
  br label %934

715:                                              ; preds = %703
  %716 = load ptr, ptr %6, align 8, !tbaa !5
  %717 = load ptr, ptr %3, align 8, !tbaa !5
  %718 = getelementptr inbounds %struct.TLS_CONNECT, ptr %717, i32 0, i32 4
  %719 = load i32, ptr %718, align 8, !tbaa !20
  %720 = call i32 @tls_record_recv(ptr noundef %716, ptr noundef %8, i32 noundef %719)
  %721 = icmp ne i32 %720, 1
  br i1 %721, label %735, label %722

722:                                              ; preds = %715
  %723 = load ptr, ptr %6, align 8, !tbaa !5
  %724 = getelementptr inbounds i8, ptr %723, i64 1
  %725 = load i8, ptr %724, align 1, !tbaa !21
  %726 = zext i8 %725 to i16
  %727 = zext i16 %726 to i32
  %728 = shl i32 %727, 8
  %729 = load ptr, ptr %6, align 8, !tbaa !5
  %730 = getelementptr inbounds i8, ptr %729, i64 2
  %731 = load i8, ptr %730, align 1, !tbaa !21
  %732 = zext i8 %731 to i32
  %733 = or i32 %728, %732
  %734 = icmp ne i32 %733, 257
  br i1 %734, label %735, label %743

735:                                              ; preds = %722, %715
  br label %736

736:                                              ; preds = %735
  %737 = load ptr, ptr @stderr, align 8, !tbaa !5
  %738 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %737, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 912, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %739

739:                                              ; preds = %736
  br label %740

740:                                              ; preds = %739
  %741 = load ptr, ptr %3, align 8, !tbaa !5
  %742 = call i32 @tls_send_alert(ptr noundef %741, i32 noundef 10)
  br label %934

743:                                              ; preds = %722
  %744 = load i64, ptr %8, align 8, !tbaa !22
  %745 = icmp ugt i64 %744, 309
  br i1 %745, label %746, label %754

746:                                              ; preds = %743
  br label %747

747:                                              ; preds = %746
  %748 = load ptr, ptr @stderr, align 8, !tbaa !5
  %749 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %748, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 917, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %750

750:                                              ; preds = %747
  br label %751

751:                                              ; preds = %750
  %752 = load ptr, ptr %3, align 8, !tbaa !5
  %753 = call i32 @tls_send_alert(ptr noundef %752, i32 noundef 10)
  br label %934

754:                                              ; preds = %743
  %755 = load ptr, ptr %3, align 8, !tbaa !5
  %756 = getelementptr inbounds %struct.TLS_CONNECT, ptr %755, i32 0, i32 25
  %757 = load ptr, ptr %3, align 8, !tbaa !5
  %758 = getelementptr inbounds %struct.TLS_CONNECT, ptr %757, i32 0, i32 27
  %759 = load ptr, ptr %3, align 8, !tbaa !5
  %760 = getelementptr inbounds %struct.TLS_CONNECT, ptr %759, i32 0, i32 29
  %761 = getelementptr inbounds [8 x i8], ptr %760, i64 0, i64 0
  %762 = load ptr, ptr %6, align 8, !tbaa !5
  %763 = load i64, ptr %8, align 8, !tbaa !22
  %764 = getelementptr inbounds [309 x i8], ptr %7, i64 0, i64 0
  %765 = call i32 @tls_record_decrypt(ptr noundef %756, ptr noundef %758, ptr noundef %761, ptr noundef %762, i64 noundef %763, ptr noundef %764, ptr noundef %9)
  %766 = icmp ne i32 %765, 1
  br i1 %766, label %767, label %775

767:                                              ; preds = %754
  br label %768

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

771:                                              ; preds = %768
  br label %772

772:                                              ; preds = %771
  %773 = load ptr, ptr %3, align 8, !tbaa !5
  %774 = call i32 @tls_send_alert(ptr noundef %773, i32 noundef 20)
  br label %934

775:                                              ; preds = %754
  %776 = load ptr, ptr %3, align 8, !tbaa !5
  %777 = getelementptr inbounds %struct.TLS_CONNECT, ptr %776, i32 0, i32 29
  %778 = getelementptr inbounds [8 x i8], ptr %777, i64 0, i64 0
  %779 = call i32 @tls_seq_num_incr(ptr noundef %778)
  %780 = getelementptr inbounds [309 x i8], ptr %7, i64 0, i64 0
  %781 = call i32 @tls_record_get_handshake_finished(ptr noundef %780, ptr noundef %40, ptr noundef %41)
  %782 = icmp ne i32 %781, 1
  br i1 %782, label %783, label %791

783:                                              ; preds = %775
  br label %784

784:                                              ; preds = %783
  %785 = load ptr, ptr @stderr, align 8, !tbaa !5
  %786 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %785, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 934, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %787

787:                                              ; preds = %784
  br label %788

788:                                              ; preds = %787
  %789 = load ptr, ptr %3, align 8, !tbaa !5
  %790 = call i32 @tls_send_alert(ptr noundef %789, i32 noundef 20)
  br label %934

791:                                              ; preds = %775
  %792 = load i64, ptr %41, align 8, !tbaa !22
  %793 = icmp ne i64 %792, 12
  br i1 %793, label %794, label %802

794:                                              ; preds = %791
  br label %795

795:                                              ; preds = %794
  %796 = load ptr, ptr @stderr, align 8, !tbaa !5
  %797 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %796, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 939, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %798

798:                                              ; preds = %795
  br label %799

799:                                              ; preds = %798
  %800 = load ptr, ptr %3, align 8, !tbaa !5
  %801 = call i32 @tls_send_alert(ptr noundef %800, i32 noundef 20)
  br label %934

802:                                              ; preds = %791
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %37, ptr align 8 %36, i64 112, i1 false)
  %803 = getelementptr inbounds [309 x i8], ptr %7, i64 0, i64 0
  %804 = getelementptr inbounds i8, ptr %803, i64 5
  %805 = load i64, ptr %9, align 8, !tbaa !22
  %806 = sub i64 %805, 5
  call void @sm3_update(ptr noundef %36, ptr noundef %804, i64 noundef %806)
  %807 = getelementptr inbounds [32 x i8], ptr %38, i64 0, i64 0
  call void @sm3_finish(ptr noundef %37, ptr noundef %807)
  %808 = load ptr, ptr %3, align 8, !tbaa !5
  %809 = getelementptr inbounds %struct.TLS_CONNECT, ptr %808, i32 0, i32 23
  %810 = getelementptr inbounds [48 x i8], ptr %809, i64 0, i64 0
  %811 = getelementptr inbounds [32 x i8], ptr %38, i64 0, i64 0
  %812 = getelementptr inbounds [12 x i8], ptr %39, i64 0, i64 0
  %813 = call i32 @tls_prf(ptr noundef %810, i64 noundef 48, ptr noundef @.str.7, ptr noundef %811, i64 noundef 32, ptr noundef null, i64 noundef 0, i64 noundef 12, ptr noundef %812)
  %814 = icmp ne i32 %813, 1
  br i1 %814, label %815, label %823

815:                                              ; preds = %802
  br label %816

816:                                              ; preds = %815
  %817 = load ptr, ptr @stderr, align 8, !tbaa !5
  %818 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %817, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 950, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %819

819:                                              ; preds = %816
  br label %820

820:                                              ; preds = %819
  %821 = load ptr, ptr %3, align 8, !tbaa !5
  %822 = call i32 @tls_send_alert(ptr noundef %821, i32 noundef 80)
  br label %934

823:                                              ; preds = %802
  %824 = load ptr, ptr %40, align 8, !tbaa !5
  %825 = getelementptr inbounds [12 x i8], ptr %39, i64 0, i64 0
  %826 = call i32 @memcmp(ptr noundef %824, ptr noundef %825, i64 noundef 12) #8
  %827 = icmp ne i32 %826, 0
  br i1 %827, label %828, label %836

828:                                              ; preds = %823
  br label %829

829:                                              ; preds = %828
  %830 = load ptr, ptr @stderr, align 8, !tbaa !5
  %831 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %830, ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 955, ptr noundef @__FUNCTION__.tlcp_do_accept, ptr noundef @.str.11) #7
  br label %832

832:                                              ; preds = %829
  br label %833

833:                                              ; preds = %832
  %834 = load ptr, ptr %3, align 8, !tbaa !5
  %835 = call i32 @tls_send_alert(ptr noundef %834, i32 noundef 51)
  br label %934

836:                                              ; preds = %823
  %837 = load ptr, ptr %6, align 8, !tbaa !5
  %838 = call i32 @tls_record_set_change_cipher_spec(ptr noundef %837, ptr noundef %8)
  %839 = icmp ne i32 %838, 1
  br i1 %839, label %840, label %848

840:                                              ; preds = %836
  br label %841

841:                                              ; preds = %840
  %842 = load ptr, ptr @stderr, align 8, !tbaa !5
  %843 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %842, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 963, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %844

844:                                              ; preds = %841
  br label %845

845:                                              ; preds = %844
  %846 = load ptr, ptr %3, align 8, !tbaa !5
  %847 = call i32 @tls_send_alert(ptr noundef %846, i32 noundef 80)
  br label %934

848:                                              ; preds = %836
  %849 = load ptr, ptr %6, align 8, !tbaa !5
  %850 = load i64, ptr %8, align 8, !tbaa !22
  %851 = load ptr, ptr %3, align 8, !tbaa !5
  %852 = getelementptr inbounds %struct.TLS_CONNECT, ptr %851, i32 0, i32 4
  %853 = load i32, ptr %852, align 8, !tbaa !20
  %854 = call i32 @tls_record_send(ptr noundef %849, i64 noundef %850, i32 noundef %853)
  %855 = icmp ne i32 %854, 1
  br i1 %855, label %856, label %862

856:                                              ; preds = %848
  br label %857

857:                                              ; preds = %856
  %858 = load ptr, ptr @stderr, align 8, !tbaa !5
  %859 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %858, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 969, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %860

860:                                              ; preds = %857
  br label %861

861:                                              ; preds = %860
  br label %934

862:                                              ; preds = %848
  %863 = getelementptr inbounds [32 x i8], ptr %38, i64 0, i64 0
  call void @sm3_finish(ptr noundef %36, ptr noundef %863)
  %864 = load ptr, ptr %3, align 8, !tbaa !5
  %865 = getelementptr inbounds %struct.TLS_CONNECT, ptr %864, i32 0, i32 23
  %866 = getelementptr inbounds [48 x i8], ptr %865, i64 0, i64 0
  %867 = getelementptr inbounds [32 x i8], ptr %38, i64 0, i64 0
  %868 = getelementptr inbounds [12 x i8], ptr %39, i64 0, i64 0
  %869 = call i32 @tls_prf(ptr noundef %866, i64 noundef 48, ptr noundef @.str.8, ptr noundef %867, i64 noundef 32, ptr noundef null, i64 noundef 0, i64 noundef 12, ptr noundef %868)
  %870 = icmp ne i32 %869, 1
  br i1 %870, label %876, label %871

871:                                              ; preds = %862
  %872 = getelementptr inbounds [309 x i8], ptr %7, i64 0, i64 0
  %873 = getelementptr inbounds [12 x i8], ptr %39, i64 0, i64 0
  %874 = call i32 @tls_record_set_handshake_finished(ptr noundef %872, ptr noundef %9, ptr noundef %873, i64 noundef 12)
  %875 = icmp ne i32 %874, 1
  br i1 %875, label %876, label %884

876:                                              ; preds = %871, %862
  br label %877

877:                                              ; preds = %876
  %878 = load ptr, ptr @stderr, align 8, !tbaa !5
  %879 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %878, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 980, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %880

880:                                              ; preds = %877
  br label %881

881:                                              ; preds = %880
  %882 = load ptr, ptr %3, align 8, !tbaa !5
  %883 = call i32 @tls_send_alert(ptr noundef %882, i32 noundef 80)
  br label %934

884:                                              ; preds = %871
  %885 = load ptr, ptr %3, align 8, !tbaa !5
  %886 = getelementptr inbounds %struct.TLS_CONNECT, ptr %885, i32 0, i32 26
  %887 = load ptr, ptr %3, align 8, !tbaa !5
  %888 = getelementptr inbounds %struct.TLS_CONNECT, ptr %887, i32 0, i32 28
  %889 = load ptr, ptr %3, align 8, !tbaa !5
  %890 = getelementptr inbounds %struct.TLS_CONNECT, ptr %889, i32 0, i32 30
  %891 = getelementptr inbounds [8 x i8], ptr %890, i64 0, i64 0
  %892 = getelementptr inbounds [309 x i8], ptr %7, i64 0, i64 0
  %893 = load i64, ptr %9, align 8, !tbaa !22
  %894 = load ptr, ptr %6, 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 %8)
  %896 = icmp ne i32 %895, 1
  br i1 %896, label %897, label %905

897:                                              ; preds = %884
  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 987, ptr noundef @__FUNCTION__.tlcp_do_accept) #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 %934

905:                                              ; preds = %884
  %906 = load ptr, ptr %3, align 8, !tbaa !5
  %907 = getelementptr inbounds %struct.TLS_CONNECT, ptr %906, i32 0, i32 30
  %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 %6, align 8, !tbaa !5
  %911 = load i64, ptr %8, align 8, !tbaa !22
  %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 !20
  %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 994, ptr noundef @__FUNCTION__.tlcp_do_accept) #7
  br label %921

921:                                              ; preds = %918
  br label %922

922:                                              ; preds = %921
  br label %934

923:                                              ; preds = %905
  %924 = load ptr, ptr %3, align 8, !tbaa !5
  %925 = getelementptr inbounds %struct.TLS_CONNECT, ptr %924, i32 0, i32 0
  store i32 257, ptr %925, align 8, !tbaa !27
  %926 = load ptr, ptr %3, align 8, !tbaa !5
  %927 = getelementptr inbounds %struct.TLS_CONNECT, ptr %926, i32 0, i32 35
  %928 = load i32, ptr %927, align 8, !tbaa !28
  %929 = icmp ne i32 %928, 0
  br i1 %929, label %933, label %930

930:                                              ; preds = %923
  %931 = load ptr, ptr @stderr, align 8, !tbaa !5
  %932 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %931, ptr noundef @.str.12) #7
  br label %933

933:                                              ; preds = %930, %923
  store i32 1, ptr %4, align 4, !tbaa !9
  br label %934

934:                                              ; preds = %933, %922, %902, %881, %861, %845, %833, %820, %799, %788, %772, %751, %740, %712, %700, %649, %621, %523, %512, %496, %484, %451, %428, %411, %376, %358, %302, %286, %272, %237, %218, %202, %182, %166, %144, %133, %115, %104, %92, %71
  call void @gmssl_secure_clear(ptr noundef %24, i64 noundef 3976)
  %935 = getelementptr inbounds [255 x i8], ptr %34, i64 0, i64 0
  call void @gmssl_secure_clear(ptr noundef %935, i64 noundef 255)
  %936 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %936, ptr %2, align 4
  store i32 1, ptr %48, align 4
  br label %937

937:                                              ; preds = %934, %621, %358
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr %36) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 255, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 1888, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 3976, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 3, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, 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 8, 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 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 309, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  %938 = load i32, ptr %2, align 4
  ret i32 %938
}

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

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

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

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

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

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

declare i32 @tls_record_set_handshake_server_hello_done(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 @tls_record_get_handshake_client_key_exchange_pke(ptr noundef, ptr noundef, ptr noundef) #3

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !13, i64 61832}
!12 = !{!"", !10, i64 0, !10, i64 4, !7, i64 8, !13, i64 264, !10, i64 272, !7, i64 276, !13, i64 18720, !7, i64 18728, !7, i64 37165, !6, i64 55608, !13, i64 55616, !10, i64 55624, !7, i64 55628, !13, i64 55664, !7, i64 55672, !13, i64 57720, !7, i64 57728, !13, i64 59776, !7, i64 59784, !13, 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 = !{!"long", !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, !13, i64 32, !7, i64 40, !13, i64 104}
!18 = !{!"", !7, i64 0}
!19 = !{!"BLOCK_CIPHER_KEY", !7, i64 0, !6, i64 128}
!20 = !{!12, !10, i64 272}
!21 = !{!7, !7, i64 0}
!22 = !{!13, !13, i64 0}
!23 = !{!12, !10, i64 55624}
!24 = !{!12, !13, i64 57720}
!25 = !{!12, !13, i64 59776}
!26 = !{i64 0, i64 32, !21, i64 32, i64 8, !22, i64 40, i64 64, !21, i64 104, i64 8, !22}
!27 = !{!12, !10, i64 0}
!28 = !{!12, !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_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_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_PRE_COMP = type { [4 x i64], [4 x i64] }
%struct.SM2_VERIFY_CTX = type { %struct.SM3_CTX, %struct.SM3_CTX, %struct.SM2_KEY, [16 x %struct.SM2_Z256_POINT] }

@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 [58 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@__const.tlcp_do_accept.server_ciphers = external hidden unnamed_addr constant [1 x i32], align 4
@__FUNCTION__.tlcp_do_accept = external hidden unnamed_addr constant [15 x i8], align 1
@__const.tlcp_do_accept.cert_types = external hidden unnamed_addr constant [1 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @tlcp_record_set_handshake_server_key_exchange_pke(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

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

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

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

declare void @sm3_init(ptr noundef) local_unnamed_addr #3

declare i32 @tls_random_generate(ptr 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 @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

; 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_record_get_handshake_certificate(ptr noundef, ptr 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 void @tls_uint24_to_bytes(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

declare i32 @sm2_verify_finish(ptr 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_set_handshake_certificate(ptr noundef, ptr noundef, ptr noundef, i64 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 void @sm3_finish(ptr noundef, 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 @sm2_sign_update(ptr noundef, ptr noundef, i64 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_change_cipher_spec(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: nounwind uwtable
define dso_local noundef i32 @tlcp_do_accept(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca [309 x i8], align 16
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca [1 x i32], align 4
  %6 = alloca [32 x i8], align 16
  %7 = alloca [32 x i8], align 16
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca [3 x i8], align 1
  %19 = alloca %struct.SM2_SIGN_CTX, align 8
  %20 = alloca [72 x i8], align 16
  %21 = alloca i64, align 8
  %22 = alloca %struct.SM2_KEY, align 8
  %23 = alloca %struct.SM2_VERIFY_CTX, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca ptr, align 8
  %27 = alloca i64, align 8
  %28 = alloca [255 x i8], align 16
  %29 = alloca i64, align 8
  %30 = alloca %struct.SM3_CTX, align 8
  %31 = alloca %struct.SM3_CTX, align 8
  %32 = alloca [32 x i8], align 16
  %33 = alloca [12 x i8], align 1
  %34 = alloca ptr, align 8
  %35 = alloca i64, align 8
  %36 = alloca ptr, align 8
  %37 = alloca ptr, align 8
  %38 = alloca i64, align 8
  %39 = alloca [1 x i8], align 1
  %40 = alloca [16377 x i8], align 16
  %41 = alloca i64, align 8
  %42 = alloca %struct.SM3_CTX, align 8
  %43 = alloca [32 x i8], align 16
  %44 = getelementptr inbounds i8, ptr %0, i64 18728
  call void @llvm.lifetime.start.p0(i64 309, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %45 = load i32, ptr @__const.tlcp_do_accept.server_ciphers, align 4
  store i32 %45, ptr %5, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #7
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %18) #7
  call void @llvm.lifetime.start.p0(i64 3976, ptr nonnull %19) #7
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %20) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #7
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %22) #7
  call void @llvm.lifetime.start.p0(i64 1888, ptr nonnull %23) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %24) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %25) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %26) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %27) #7
  call void @llvm.lifetime.start.p0(i64 255, ptr nonnull %28) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %29) #7
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %30) #7
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %31) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %32) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %33) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %34) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %35) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %36) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %37) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %38) #7
  %46 = getelementptr inbounds i8, ptr %0, i64 61832
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %.not = icmp eq i64 %47, 0
  call void @sm3_init(ptr noundef nonnull %30) #7
  %48 = getelementptr inbounds i8, ptr %0, i64 272
  %49 = load i32, ptr %48, align 8, !tbaa !18
  %50 = call i32 @tls_record_recv(ptr noundef nonnull %44, ptr noundef nonnull %3, i32 noundef %49) #7
  %.not147 = icmp eq i32 %50, 1
  br i1 %.not147, label %55, label %51

51:                                               ; preds = %1
  %52 = load ptr, ptr @stderr, align 8, !tbaa !19
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 643, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %54 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %463

55:                                               ; preds = %1
  %56 = getelementptr inbounds i8, ptr %0, i64 18729
  %57 = load i8, ptr %56, align 1, !tbaa !20
  %58 = zext i8 %57 to i32
  %59 = shl nuw nsw i32 %58, 8
  %60 = getelementptr inbounds i8, ptr %0, i64 18730
  %61 = load i8, ptr %60, align 1, !tbaa !20
  %62 = zext i8 %61 to i32
  %63 = or disjoint i32 %59, %62
  %.not148 = icmp eq i32 %63, 257
  br i1 %.not148, label %68, label %64

64:                                               ; preds = %55
  %65 = load ptr, ptr @stderr, align 8, !tbaa !19
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 649, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %67 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 70) #7
  br label %463

68:                                               ; preds = %55
  %69 = call i32 @tls_record_get_handshake_client_hello(ptr noundef nonnull %44, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull %14, ptr noundef nonnull %15) #7
  %.not149 = icmp eq i32 %69, 1
  br i1 %.not149, label %74, label %70

70:                                               ; preds = %68
  %71 = load ptr, ptr @stderr, align 8, !tbaa !19
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 657, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %73 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %463

74:                                               ; preds = %68
  %75 = load i32, ptr %8, align 4, !tbaa !21
  %.not150 = icmp eq i32 %75, 257
  br i1 %.not150, label %80, label %76

76:                                               ; preds = %74
  %77 = load ptr, ptr @stderr, align 8, !tbaa !19
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 662, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %79 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 70) #7
  br label %463

80:                                               ; preds = %74
  %81 = load ptr, ptr %9, align 8, !tbaa !19
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %6, ptr noundef nonnull align 1 dereferenceable(32) %81, i64 32, i1 false)
  %82 = load ptr, ptr %12, align 8, !tbaa !19
  %83 = load i64, ptr %13, align 8, !tbaa !22
  %84 = getelementptr inbounds i8, ptr %0, i64 55624
  %85 = call i32 @tls_cipher_suites_select(ptr noundef %82, i64 noundef %83, ptr noundef nonnull %5, i64 noundef 1, ptr noundef nonnull %84) #7
  %.not151 = icmp eq i32 %85, 1
  br i1 %.not151, label %90, label %86

86:                                               ; preds = %80
  %87 = load ptr, ptr @stderr, align 8, !tbaa !19
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 670, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %89 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 71) #7
  br label %463

90:                                               ; preds = %80
  %91 = load ptr, ptr %14, align 8, !tbaa !19
  %.not152 = icmp eq ptr %91, null
  br i1 %.not152, label %96, label %92

92:                                               ; preds = %90
  %93 = load ptr, ptr @stderr, align 8, !tbaa !19
  %94 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %93, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 676, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %95 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %463

96:                                               ; preds = %90
  %97 = getelementptr inbounds i8, ptr %0, i64 18733
  %98 = load i64, ptr %3, align 8, !tbaa !22
  %99 = add i64 %98, -5
  call void @sm3_update(ptr noundef nonnull %30, ptr noundef nonnull %97, i64 noundef %99) #7
  %100 = call i32 @tls_random_generate(ptr noundef nonnull %7) #7
  %101 = load i32, ptr %84, align 8, !tbaa !23
  %102 = call i32 @tls_record_set_handshake_server_hello(ptr noundef nonnull %44, ptr noundef nonnull %3, i32 noundef 257, ptr noundef nonnull %7, ptr noundef null, i64 noundef 0, i32 noundef %101, ptr noundef null, i64 noundef 0) #7
  %.not153 = icmp eq i32 %102, 1
  br i1 %.not153, label %107, label %103

103:                                              ; preds = %96
  %104 = load ptr, ptr @stderr, align 8, !tbaa !19
  %105 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 688, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %106 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %463

107:                                              ; preds = %96
  %108 = load i64, ptr %3, align 8, !tbaa !22
  %109 = load i32, ptr %48, align 8, !tbaa !18
  %110 = call i32 @tls_record_send(ptr noundef nonnull %44, i64 noundef %108, i32 noundef %109) #7
  %.not154 = icmp eq i32 %110, 1
  br i1 %.not154, label %114, label %111

111:                                              ; preds = %107
  %112 = load ptr, ptr @stderr, align 8, !tbaa !19
  %113 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %112, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 694, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  br label %463

114:                                              ; preds = %107
  %115 = load i64, ptr %3, align 8, !tbaa !22
  %116 = add i64 %115, -5
  call void @sm3_update(ptr noundef nonnull %30, ptr noundef nonnull %97, i64 noundef %116) #7
  %117 = getelementptr inbounds i8, ptr %0, i64 55672
  %118 = getelementptr inbounds i8, ptr %0, i64 57720
  %119 = load i64, ptr %118, align 8, !tbaa !24
  %120 = call i32 @tls_record_set_handshake_certificate(ptr noundef nonnull %44, ptr noundef nonnull %3, ptr noundef nonnull %117, i64 noundef %119) #7
  %.not155 = icmp eq i32 %120, 1
  br i1 %.not155, label %125, label %121

121:                                              ; preds = %114
  %122 = load ptr, ptr @stderr, align 8, !tbaa !19
  %123 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %122, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 703, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %124 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %463

125:                                              ; preds = %114
  %126 = load i64, ptr %3, align 8, !tbaa !22
  %127 = load i32, ptr %48, align 8, !tbaa !18
  %128 = call i32 @tls_record_send(ptr noundef nonnull %44, i64 noundef %126, i32 noundef %127) #7
  %.not156 = icmp eq i32 %128, 1
  br i1 %.not156, label %132, label %129

129:                                              ; preds = %125
  %130 = load ptr, ptr @stderr, align 8, !tbaa !19
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 709, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  br label %463

132:                                              ; preds = %125
  %133 = load i64, ptr %3, align 8, !tbaa !22
  %134 = add i64 %133, -5
  call void @sm3_update(ptr noundef nonnull %30, ptr noundef nonnull %97, i64 noundef %134) #7
  %135 = load i64, ptr %118, align 8, !tbaa !24
  %136 = call i32 @x509_certs_get_cert_by_index(ptr noundef nonnull %117, i64 noundef %135, i32 noundef 1, ptr noundef nonnull %16, ptr noundef nonnull %17) #7
  %.not157 = icmp eq i32 %136, 1
  br i1 %.not157, label %140, label %137

137:                                              ; preds = %132
  %138 = load ptr, ptr @stderr, align 8, !tbaa !19
  %139 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %138, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 718, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  br label %463

140:                                              ; preds = %132
  store ptr %18, ptr %36, align 8, !tbaa !19
  store i64 0, ptr %38, align 8, !tbaa !22
  %141 = load i64, ptr %17, align 8, !tbaa !22
  %142 = trunc i64 %141 to i32
  call void @tls_uint24_to_bytes(i32 noundef %142, ptr noundef nonnull %36, ptr noundef nonnull %38) #7
  %143 = getelementptr inbounds i8, ptr %0, i64 61840
  %144 = call i32 @sm2_sign_init(ptr noundef nonnull %19, ptr noundef nonnull %143, ptr noundef nonnull @.str.4, i64 noundef 16) #7
  %.not158 = icmp eq i32 %144, 1
  br i1 %.not158, label %145, label %157

145:                                              ; preds = %140
  %146 = call i32 @sm2_sign_update(ptr noundef nonnull %19, ptr noundef nonnull %6, i64 noundef 32) #7
  %.not159 = icmp eq i32 %146, 1
  br i1 %.not159, label %147, label %157

147:                                              ; preds = %145
  %148 = call i32 @sm2_sign_update(ptr noundef nonnull %19, ptr noundef nonnull %7, i64 noundef 32) #7
  %.not160 = icmp eq i32 %148, 1
  br i1 %.not160, label %149, label %157

149:                                              ; preds = %147
  %150 = call i32 @sm2_sign_update(ptr noundef nonnull %19, ptr noundef nonnull %18, i64 noundef 3) #7
  %.not161 = icmp eq i32 %150, 1
  br i1 %.not161, label %151, label %157

151:                                              ; preds = %149
  %152 = load ptr, ptr %16, align 8, !tbaa !19
  %153 = load i64, ptr %17, align 8, !tbaa !22
  %154 = call i32 @sm2_sign_update(ptr noundef nonnull %19, ptr noundef %152, i64 noundef %153) #7
  %.not162 = icmp eq i32 %154, 1
  br i1 %.not162, label %155, label %157

155:                                              ; preds = %151
  %156 = call i32 @sm2_sign_finish(ptr noundef nonnull %19, ptr noundef nonnull %20, ptr noundef nonnull %21) #7
  %.not163 = icmp eq i32 %156, 1
  br i1 %.not163, label %161, label %157

157:                                              ; preds = %140, %145, %147, %149, %151, %155
  %158 = load ptr, ptr @stderr, align 8, !tbaa !19
  %159 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %158, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 729, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %160 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %463

161:                                              ; preds = %155
  %162 = load i64, ptr %21, align 8, !tbaa !22
  %163 = call i32 @tlcp_record_set_handshake_server_key_exchange_pke(ptr noundef nonnull %44, ptr noundef nonnull %3, ptr noundef nonnull %20, i64 noundef %162)
  %.not164 = icmp eq i32 %163, 1
  br i1 %.not164, label %168, label %164

164:                                              ; preds = %161
  %165 = load ptr, ptr @stderr, align 8, !tbaa !19
  %166 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %165, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 734, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %167 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %463

168:                                              ; preds = %161
  %169 = load i64, ptr %3, align 8, !tbaa !22
  %170 = load i32, ptr %48, align 8, !tbaa !18
  %171 = call i32 @tls_record_send(ptr noundef nonnull %44, i64 noundef %169, i32 noundef %170) #7
  %.not165 = icmp eq i32 %171, 1
  br i1 %.not165, label %175, label %172

172:                                              ; preds = %168
  %173 = load ptr, ptr @stderr, align 8, !tbaa !19
  %174 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %173, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 740, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  br label %463

175:                                              ; preds = %168
  %176 = load i64, ptr %3, align 8, !tbaa !22
  %177 = add i64 %176, -5
  call void @sm3_update(ptr noundef nonnull %30, ptr noundef nonnull %97, i64 noundef %177) #7
  br i1 %.not, label %195, label %178

178:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %39) #7
  %179 = load i8, ptr @__const.tlcp_do_accept.cert_types, align 1
  store i8 %179, ptr %39, align 1
  call void @llvm.lifetime.start.p0(i64 16377, ptr nonnull %40) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16377) %40, i8 0, i64 16377, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %41) #7
  store i64 0, ptr %41, align 8, !tbaa !22
  %180 = getelementptr inbounds i8, ptr %0, i64 59784
  %181 = load i64, ptr %46, align 8, !tbaa !5
  %182 = call i32 @tls_authorities_from_certs(ptr noundef nonnull %40, ptr noundef nonnull %41, i64 noundef 16377, ptr noundef nonnull %180, i64 noundef %181) #7
  %.not167 = icmp eq i32 %182, 1
  br i1 %.not167, label %183, label %.thread

183:                                              ; preds = %178
  %184 = load i64, ptr %41, align 8, !tbaa !22
  %185 = call i32 @tls_record_set_handshake_certificate_request(ptr noundef nonnull %44, ptr noundef nonnull %3, ptr noundef nonnull %39, i64 noundef 1, ptr noundef nonnull %40, i64 noundef %184) #7
  %.not168 = icmp eq i32 %185, 1
  br i1 %.not168, label %186, label %.thread

186:                                              ; preds = %183
  %187 = load i64, ptr %3, align 8, !tbaa !22
  %188 = load i32, ptr %48, align 8, !tbaa !18
  %189 = call i32 @tls_record_send(ptr noundef nonnull %44, i64 noundef %187, i32 noundef %188) #7
  %.not169 = icmp eq i32 %189, 1
  br i1 %.not169, label %192, label %.thread

.thread:                                          ; preds = %186, %183, %178
  %.sink218 = phi i32 [ 754, %178 ], [ 760, %183 ], [ 765, %186 ]
  %190 = load ptr, ptr @stderr, align 8, !tbaa !19
  %191 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %190, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef %.sink218, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %41) #7
  call void @llvm.lifetime.end.p0(i64 16377, ptr nonnull %40) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %39) #7
  br label %463

192:                                              ; preds = %186
  %193 = load i64, ptr %3, align 8, !tbaa !22
  %194 = add i64 %193, -5
  call void @sm3_update(ptr noundef nonnull %30, ptr noundef nonnull %97, i64 noundef %194) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %41) #7
  call void @llvm.lifetime.end.p0(i64 16377, ptr nonnull %40) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %39) #7
  br label %195

195:                                              ; preds = %192, %175
  %196 = call i32 @tls_record_set_handshake_server_hello_done(ptr noundef nonnull %44, ptr noundef nonnull %3) #7
  %197 = load i64, ptr %3, align 8, !tbaa !22
  %198 = load i32, ptr %48, align 8, !tbaa !18
  %199 = call i32 @tls_record_send(ptr noundef nonnull %44, i64 noundef %197, i32 noundef %198) #7
  %.not170 = icmp eq i32 %199, 1
  br i1 %.not170, label %203, label %200

200:                                              ; preds = %195
  %201 = load ptr, ptr @stderr, align 8, !tbaa !19
  %202 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %201, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 776, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  br label %463

203:                                              ; preds = %195
  %204 = load i64, ptr %3, align 8, !tbaa !22
  %205 = add i64 %204, -5
  call void @sm3_update(ptr noundef nonnull %30, ptr noundef nonnull %97, i64 noundef %205) #7
  %206 = load i64, ptr %46, align 8, !tbaa !5
  %.not171 = icmp eq i64 %206, 0
  br i1 %.not171, label %241, label %207

207:                                              ; preds = %203
  %208 = load i32, ptr %48, align 8, !tbaa !18
  %209 = call i32 @tls_record_recv(ptr noundef nonnull %44, ptr noundef nonnull %3, i32 noundef %208) #7
  %.not172 = icmp eq i32 %209, 1
  br i1 %.not172, label %210, label %217

210:                                              ; preds = %207
  %211 = load i8, ptr %56, align 1, !tbaa !20
  %212 = zext i8 %211 to i32
  %213 = shl nuw nsw i32 %212, 8
  %214 = load i8, ptr %60, align 1, !tbaa !20
  %215 = zext i8 %214 to i32
  %216 = or disjoint i32 %213, %215
  %.not173 = icmp eq i32 %216, 257
  br i1 %.not173, label %221, label %217

217:                                              ; preds = %207, %210
  %218 = load ptr, ptr @stderr, align 8, !tbaa !19
  %219 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %218, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 786, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %220 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %463

221:                                              ; preds = %210
  %222 = getelementptr inbounds i8, ptr %0, i64 57728
  %223 = getelementptr inbounds i8, ptr %0, i64 59776
  %224 = call i32 @tls_record_get_handshake_certificate(ptr noundef nonnull %44, ptr noundef nonnull %222, ptr noundef nonnull %223) #7
  %.not174 = icmp eq i32 %224, 1
  br i1 %.not174, label %229, label %225

225:                                              ; preds = %221
  %226 = load ptr, ptr @stderr, align 8, !tbaa !19
  %227 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %226, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 792, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %228 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %463

229:                                              ; preds = %221
  %230 = load i64, ptr %223, align 8, !tbaa !25
  %231 = getelementptr inbounds i8, ptr %0, i64 59784
  %232 = load i64, ptr %46, align 8, !tbaa !5
  %233 = call i32 @x509_certs_verify(ptr noundef nonnull %222, i64 noundef %230, i32 noundef 1, ptr noundef nonnull %231, i64 noundef %232, i32 noundef 5, ptr noundef nonnull %25) #7
  %.not175 = icmp eq i32 %233, 1
  br i1 %.not175, label %238, label %234

234:                                              ; preds = %229
  %235 = load ptr, ptr @stderr, align 8, !tbaa !19
  %236 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %235, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 798, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %237 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 42) #7
  br label %463

238:                                              ; preds = %229
  %239 = load i64, ptr %3, align 8, !tbaa !22
  %240 = add i64 %239, -5
  call void @sm3_update(ptr noundef nonnull %30, ptr noundef nonnull %97, i64 noundef %240) #7
  br label %241

241:                                              ; preds = %238, %203
  %242 = load i32, ptr %48, align 8, !tbaa !18
  %243 = call i32 @tls_record_recv(ptr noundef nonnull %44, ptr noundef nonnull %3, i32 noundef %242) #7
  %.not176 = icmp eq i32 %243, 1
  br i1 %.not176, label %244, label %251

244:                                              ; preds = %241
  %245 = load i8, ptr %56, align 1, !tbaa !20
  %246 = zext i8 %245 to i32
  %247 = shl nuw nsw i32 %246, 8
  %248 = load i8, ptr %60, align 1, !tbaa !20
  %249 = zext i8 %248 to i32
  %250 = or disjoint i32 %247, %249
  %.not177 = icmp eq i32 %250, 257
  br i1 %.not177, label %255, label %251

251:                                              ; preds = %241, %244
  %252 = load ptr, ptr @stderr, align 8, !tbaa !19
  %253 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %252, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 809, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %254 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %463

255:                                              ; preds = %244
  %256 = call i32 @tls_record_get_handshake_client_key_exchange_pke(ptr noundef nonnull %44, ptr noundef nonnull %26, ptr noundef nonnull %27) #7
  %.not178 = icmp eq i32 %256, 1
  br i1 %.not178, label %261, label %257

257:                                              ; preds = %255
  %258 = load ptr, ptr @stderr, align 8, !tbaa !19
  %259 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %258, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 815, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %260 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %463

261:                                              ; preds = %255
  %262 = getelementptr inbounds i8, ptr %0, i64 61968
  %263 = load ptr, ptr %26, align 8, !tbaa !19
  %264 = load i64, ptr %27, align 8, !tbaa !22
  %265 = call i32 @sm2_decrypt(ptr noundef nonnull %262, ptr noundef %263, i64 noundef %264, ptr noundef nonnull %28, ptr noundef nonnull %29) #7
  %.not179 = icmp eq i32 %265, 1
  br i1 %.not179, label %270, label %266

266:                                              ; preds = %261
  %267 = load ptr, ptr @stderr, align 8, !tbaa !19
  %268 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %267, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 821, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %269 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 51) #7
  br label %463

270:                                              ; preds = %261
  %271 = load i64, ptr %29, align 8, !tbaa !22
  %.not180 = icmp eq i64 %271, 48
  br i1 %.not180, label %276, label %272

272:                                              ; preds = %270
  %273 = load ptr, ptr @stderr, align 8, !tbaa !19
  %274 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %273, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 826, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %275 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 51) #7
  br label %463

276:                                              ; preds = %270
  %277 = load i64, ptr %3, align 8, !tbaa !22
  %278 = add i64 %277, -5
  call void @sm3_update(ptr noundef nonnull %30, ptr noundef nonnull %97, i64 noundef %278) #7
  br i1 %.not, label %327, label %279

279:                                              ; preds = %276
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %42) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(112) %42, ptr noundef nonnull align 8 dereferenceable(112) %30, i64 112, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %43) #7
  %280 = load i32, ptr %48, align 8, !tbaa !18
  %281 = call i32 @tls_record_recv(ptr noundef nonnull %44, ptr noundef nonnull %3, i32 noundef %280) #7
  %.not181 = icmp eq i32 %281, 1
  br i1 %.not181, label %282, label %289

282:                                              ; preds = %279
  %283 = load i8, ptr %56, align 1, !tbaa !20
  %284 = zext i8 %283 to i32
  %285 = shl nuw nsw i32 %284, 8
  %286 = load i8, ptr %60, align 1, !tbaa !20
  %287 = zext i8 %286 to i32
  %288 = or disjoint i32 %285, %287
  %.not182 = icmp eq i32 %288, 257
  br i1 %.not182, label %293, label %289

289:                                              ; preds = %282, %279
  %290 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  %291 = load ptr, ptr @stderr, align 8, !tbaa !19
  %292 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %291, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 841, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  br label %.thread215

293:                                              ; preds = %282
  %294 = call i32 @tls_record_get_handshake_certificate_verify(ptr noundef nonnull %44, ptr noundef nonnull %24, ptr noundef nonnull %21) #7
  %.not183 = icmp eq i32 %294, 1
  br i1 %.not183, label %299, label %295

295:                                              ; preds = %293
  %296 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  %297 = load ptr, ptr @stderr, align 8, !tbaa !19
  %298 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %297, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 847, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  br label %.thread215

299:                                              ; preds = %293
  %300 = getelementptr inbounds i8, ptr %0, i64 57728
  %301 = getelementptr inbounds i8, ptr %0, i64 59776
  %302 = load i64, ptr %301, align 8, !tbaa !25
  %303 = call i32 @x509_certs_get_cert_by_index(ptr noundef nonnull %300, i64 noundef %302, i32 noundef 0, ptr noundef nonnull %37, ptr noundef nonnull %38) #7
  %.not184 = icmp eq i32 %303, 1
  br i1 %.not184, label %304, label %308

304:                                              ; preds = %299
  %305 = load ptr, ptr %37, align 8, !tbaa !19
  %306 = load i64, ptr %38, align 8, !tbaa !22
  %307 = call i32 @x509_cert_get_subject_public_key(ptr noundef %305, i64 noundef %306, ptr noundef nonnull %22) #7
  %.not185 = icmp eq i32 %307, 1
  br i1 %.not185, label %312, label %308

308:                                              ; preds = %299, %304
  %309 = load ptr, ptr @stderr, align 8, !tbaa !19
  %310 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %309, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 852, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %311 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 42) #7
  br label %.thread215

312:                                              ; preds = %304
  call void @sm3_finish(ptr noundef nonnull %42, ptr noundef nonnull %43) #7
  %313 = call i32 @sm2_verify_init(ptr noundef nonnull %23, ptr noundef nonnull %22, ptr noundef nonnull @.str.4, i64 noundef 16) #7
  %.not186 = icmp eq i32 %313, 1
  br i1 %.not186, label %314, label %320

314:                                              ; preds = %312
  %315 = call i32 @sm2_verify_update(ptr noundef nonnull %23, ptr noundef nonnull %43, i64 noundef 32) #7
  %.not187 = icmp eq i32 %315, 1
  br i1 %.not187, label %316, label %320

316:                                              ; preds = %314
  %317 = load ptr, ptr %24, align 8, !tbaa !19
  %318 = load i64, ptr %21, align 8, !tbaa !22
  %319 = call i32 @sm2_verify_finish(ptr noundef nonnull %23, ptr noundef %317, i64 noundef %318) #7
  %.not188 = icmp eq i32 %319, 1
  br i1 %.not188, label %324, label %320

320:                                              ; preds = %312, %314, %316
  %321 = load ptr, ptr @stderr, align 8, !tbaa !19
  %322 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %321, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 861, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %323 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 51) #7
  br label %.thread215

.thread215:                                       ; preds = %289, %295, %308, %320
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %43) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %42) #7
  br label %463

324:                                              ; preds = %316
  %325 = load i64, ptr %3, align 8, !tbaa !22
  %326 = add i64 %325, -5
  call void @sm3_update(ptr noundef nonnull %30, ptr noundef nonnull %97, i64 noundef %326) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %43) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %42) #7
  br label %327

327:                                              ; preds = %324, %276
  %328 = getelementptr inbounds i8, ptr %0, i64 62100
  %329 = call i32 @tls_prf(ptr noundef nonnull %28, i64 noundef 48, ptr noundef nonnull @.str.5, ptr noundef nonnull %6, i64 noundef 32, ptr noundef nonnull %7, i64 noundef 32, i64 noundef 48, ptr noundef nonnull %328) #7
  %.not189 = icmp eq i32 %329, 1
  br i1 %.not189, label %330, label %333

330:                                              ; preds = %327
  %331 = getelementptr inbounds i8, ptr %0, i64 62148
  %332 = call i32 @tls_prf(ptr noundef nonnull %328, i64 noundef 48, ptr noundef nonnull @.str.6, ptr noundef nonnull %7, i64 noundef 32, ptr noundef nonnull %6, i64 noundef 32, i64 noundef 96, ptr noundef nonnull %331) #7
  %.not190 = icmp eq i32 %332, 1
  br i1 %.not190, label %337, label %333

333:                                              ; preds = %327, %330
  %334 = load ptr, ptr @stderr, align 8, !tbaa !19
  %335 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %334, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 876, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %336 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %463

337:                                              ; preds = %330
  %338 = getelementptr inbounds i8, ptr %0, i64 62248
  call void @sm3_hmac_init(ptr noundef nonnull %338, ptr noundef nonnull %331, i64 noundef 32) #7
  %339 = getelementptr inbounds i8, ptr %0, i64 62424
  %340 = getelementptr inbounds i8, ptr %0, i64 62180
  call void @sm3_hmac_init(ptr noundef nonnull %339, ptr noundef nonnull %340, i64 noundef 32) #7
  %341 = getelementptr inbounds i8, ptr %0, i64 62600
  %342 = getelementptr inbounds i8, ptr %0, i64 62212
  call void @sm4_set_decrypt_key(ptr noundef nonnull %341, ptr noundef nonnull %342) #7
  %343 = getelementptr inbounds i8, ptr %0, i64 62728
  %344 = getelementptr inbounds i8, ptr %0, i64 62228
  call void @sm4_set_encrypt_key(ptr noundef nonnull %343, ptr noundef nonnull %344) #7
  %345 = load i32, ptr %48, align 8, !tbaa !18
  %346 = call i32 @tls_record_recv(ptr noundef nonnull %44, ptr noundef nonnull %3, i32 noundef %345) #7
  %.not191 = icmp eq i32 %346, 1
  br i1 %.not191, label %347, label %354

347:                                              ; preds = %337
  %348 = load i8, ptr %56, align 1, !tbaa !20
  %349 = zext i8 %348 to i32
  %350 = shl nuw nsw i32 %349, 8
  %351 = load i8, ptr %60, align 1, !tbaa !20
  %352 = zext i8 %351 to i32
  %353 = or disjoint i32 %350, %352
  %.not192 = icmp eq i32 %353, 257
  br i1 %.not192, label %358, label %354

354:                                              ; preds = %337, %347
  %355 = load ptr, ptr @stderr, align 8, !tbaa !19
  %356 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %355, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 897, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %357 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %463

358:                                              ; preds = %347
  %359 = call i32 @tls_record_get_change_cipher_spec(ptr noundef nonnull %44) #7
  %.not193 = icmp eq i32 %359, 1
  br i1 %.not193, label %364, label %360

360:                                              ; preds = %358
  %361 = load ptr, ptr @stderr, align 8, !tbaa !19
  %362 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %361, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 903, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %363 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %463

364:                                              ; preds = %358
  %365 = load i32, ptr %48, align 8, !tbaa !18
  %366 = call i32 @tls_record_recv(ptr noundef nonnull %44, ptr noundef nonnull %3, i32 noundef %365) #7
  %.not194 = icmp eq i32 %366, 1
  br i1 %.not194, label %367, label %374

367:                                              ; preds = %364
  %368 = load i8, ptr %56, align 1, !tbaa !20
  %369 = zext i8 %368 to i32
  %370 = shl nuw nsw i32 %369, 8
  %371 = load i8, ptr %60, align 1, !tbaa !20
  %372 = zext i8 %371 to i32
  %373 = or disjoint i32 %370, %372
  %.not195 = icmp eq i32 %373, 257
  br i1 %.not195, label %378, label %374

374:                                              ; preds = %364, %367
  %375 = load ptr, ptr @stderr, align 8, !tbaa !19
  %376 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %375, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 912, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %377 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %463

378:                                              ; preds = %367
  %379 = load i64, ptr %3, align 8, !tbaa !22
  %380 = icmp ugt i64 %379, 309
  br i1 %380, label %381, label %385

381:                                              ; preds = %378
  %382 = load ptr, ptr @stderr, align 8, !tbaa !19
  %383 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %382, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 917, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %384 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %463

385:                                              ; preds = %378
  %386 = getelementptr inbounds i8, ptr %0, i64 62856
  %387 = call i32 @tls_record_decrypt(ptr noundef nonnull %338, ptr noundef nonnull %341, ptr noundef nonnull %386, ptr noundef nonnull %44, i64 noundef %379, ptr noundef nonnull %2, ptr noundef nonnull %4) #7
  %.not196 = icmp eq i32 %387, 1
  br i1 %.not196, label %392, label %388

388:                                              ; preds = %385
  %389 = load ptr, ptr @stderr, align 8, !tbaa !19
  %390 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %389, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 927, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %391 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 20) #7
  br label %463

392:                                              ; preds = %385
  %393 = call i32 @tls_seq_num_incr(ptr noundef nonnull %386) #7
  %394 = call i32 @tls_record_get_handshake_finished(ptr noundef nonnull %2, ptr noundef nonnull %34, ptr noundef nonnull %35) #7
  %.not197 = icmp eq i32 %394, 1
  br i1 %.not197, label %399, label %395

395:                                              ; preds = %392
  %396 = load ptr, ptr @stderr, align 8, !tbaa !19
  %397 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %396, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 934, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %398 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 20) #7
  br label %463

399:                                              ; preds = %392
  %400 = load i64, ptr %35, align 8, !tbaa !22
  %.not198 = icmp eq i64 %400, 12
  br i1 %.not198, label %405, label %401

401:                                              ; preds = %399
  %402 = load ptr, ptr @stderr, align 8, !tbaa !19
  %403 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %402, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 939, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %404 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 20) #7
  br label %463

405:                                              ; preds = %399
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(112) %31, ptr noundef nonnull align 8 dereferenceable(112) %30, i64 112, i1 false)
  %406 = getelementptr inbounds i8, ptr %2, i64 5
  %407 = load i64, ptr %4, align 8, !tbaa !22
  %408 = add i64 %407, -5
  call void @sm3_update(ptr noundef nonnull %30, ptr noundef nonnull %406, i64 noundef %408) #7
  call void @sm3_finish(ptr noundef nonnull %31, ptr noundef nonnull %32) #7
  %409 = call i32 @tls_prf(ptr noundef nonnull %328, i64 noundef 48, ptr noundef nonnull @.str.7, ptr noundef nonnull %32, i64 noundef 32, ptr noundef null, i64 noundef 0, i64 noundef 12, ptr noundef nonnull %33) #7
  %.not199 = icmp eq i32 %409, 1
  br i1 %.not199, label %414, label %410

410:                                              ; preds = %405
  %411 = load ptr, ptr @stderr, align 8, !tbaa !19
  %412 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %411, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 950, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %413 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %463

414:                                              ; preds = %405
  %415 = load ptr, ptr %34, align 8, !tbaa !19
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(12) %415, ptr noundef nonnull dereferenceable(12) %33, i64 12)
  %.not200 = icmp eq i32 %bcmp, 0
  br i1 %.not200, label %420, label %416

416:                                              ; preds = %414
  %417 = load ptr, ptr @stderr, align 8, !tbaa !19
  %418 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %417, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 955, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept, ptr noundef nonnull @.str.11) #8
  %419 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 51) #7
  br label %463

420:                                              ; preds = %414
  %421 = call i32 @tls_record_set_change_cipher_spec(ptr noundef nonnull %44, ptr noundef nonnull %3) #7
  %.not201 = icmp eq i32 %421, 1
  br i1 %.not201, label %426, label %422

422:                                              ; preds = %420
  %423 = load ptr, ptr @stderr, align 8, !tbaa !19
  %424 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %423, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 963, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %425 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %463

426:                                              ; preds = %420
  %427 = load i64, ptr %3, align 8, !tbaa !22
  %428 = load i32, ptr %48, align 8, !tbaa !18
  %429 = call i32 @tls_record_send(ptr noundef nonnull %44, i64 noundef %427, i32 noundef %428) #7
  %.not202 = icmp eq i32 %429, 1
  br i1 %.not202, label %433, label %430

430:                                              ; preds = %426
  %431 = load ptr, ptr @stderr, align 8, !tbaa !19
  %432 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %431, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 969, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  br label %463

433:                                              ; preds = %426
  call void @sm3_finish(ptr noundef nonnull %30, ptr noundef nonnull %32) #7
  %434 = call i32 @tls_prf(ptr noundef nonnull %328, i64 noundef 48, ptr noundef nonnull @.str.8, ptr noundef nonnull %32, i64 noundef 32, ptr noundef null, i64 noundef 0, i64 noundef 12, ptr noundef nonnull %33) #7
  %.not203 = icmp eq i32 %434, 1
  br i1 %.not203, label %435, label %437

435:                                              ; preds = %433
  %436 = call i32 @tls_record_set_handshake_finished(ptr noundef nonnull %2, ptr noundef nonnull %4, ptr noundef nonnull %33, i64 noundef 12) #7
  %.not204 = icmp eq i32 %436, 1
  br i1 %.not204, label %441, label %437

437:                                              ; preds = %433, %435
  %438 = load ptr, ptr @stderr, align 8, !tbaa !19
  %439 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %438, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 980, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %440 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %463

441:                                              ; preds = %435
  %442 = getelementptr inbounds i8, ptr %0, i64 62864
  %443 = load i64, ptr %4, align 8, !tbaa !22
  %444 = call i32 @tls_record_encrypt(ptr noundef nonnull %339, ptr noundef nonnull %343, ptr noundef nonnull %442, ptr noundef nonnull %2, i64 noundef %443, ptr noundef nonnull %44, ptr noundef nonnull %3) #7
  %.not205 = icmp eq i32 %444, 1
  br i1 %.not205, label %449, label %445

445:                                              ; preds = %441
  %446 = load ptr, ptr @stderr, align 8, !tbaa !19
  %447 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %446, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 987, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  %448 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %463

449:                                              ; preds = %441
  %450 = call i32 @tls_seq_num_incr(ptr noundef nonnull %442) #7
  %451 = load i64, ptr %3, align 8, !tbaa !22
  %452 = load i32, ptr %48, align 8, !tbaa !18
  %453 = call i32 @tls_record_send(ptr noundef nonnull %44, i64 noundef %451, i32 noundef %452) #7
  %.not206 = icmp eq i32 %453, 1
  br i1 %.not206, label %457, label %454

454:                                              ; preds = %449
  %455 = load ptr, ptr @stderr, align 8, !tbaa !19
  %456 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %455, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 994, ptr noundef nonnull @__FUNCTION__.tlcp_do_accept) #8
  br label %463

457:                                              ; preds = %449
  store i32 257, ptr %0, align 8, !tbaa !27
  %458 = getelementptr inbounds i8, ptr %0, i64 63168
  %459 = load i32, ptr %458, align 8, !tbaa !28
  %.not207 = icmp eq i32 %459, 0
  br i1 %.not207, label %460, label %463

460:                                              ; preds = %457
  %461 = load ptr, ptr @stderr, align 8, !tbaa !19
  %462 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %461, ptr noundef nonnull @.str.12) #8
  br label %463

463:                                              ; preds = %.thread215, %.thread, %457, %460, %454, %445, %437, %430, %422, %416, %410, %401, %395, %388, %381, %374, %360, %354, %333, %272, %266, %257, %251, %234, %225, %217, %200, %172, %164, %157, %137, %129, %121, %111, %103, %92, %86, %76, %70, %64, %51
  %.0144 = phi i32 [ -1, %51 ], [ -1, %64 ], [ -1, %70 ], [ -1, %76 ], [ -1, %86 ], [ -1, %92 ], [ -1, %103 ], [ -1, %111 ], [ -1, %121 ], [ -1, %129 ], [ -1, %137 ], [ -1, %157 ], [ -1, %164 ], [ -1, %172 ], [ -1, %200 ], [ -1, %217 ], [ -1, %225 ], [ -1, %234 ], [ -1, %251 ], [ -1, %257 ], [ -1, %266 ], [ -1, %272 ], [ -1, %333 ], [ -1, %354 ], [ -1, %360 ], [ -1, %374 ], [ -1, %381 ], [ -1, %388 ], [ -1, %395 ], [ -1, %401 ], [ -1, %410 ], [ -1, %416 ], [ -1, %422 ], [ -1, %430 ], [ -1, %437 ], [ -1, %445 ], [ -1, %454 ], [ 1, %460 ], [ 1, %457 ], [ -1, %.thread ], [ -1, %.thread215 ]
  call void @gmssl_secure_clear(ptr noundef nonnull %19, i64 noundef 3976) #7
  call void @gmssl_secure_clear(ptr noundef nonnull %28, i64 noundef 255) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %38) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %37) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %36) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %35) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %34) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %33) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %32) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %31) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %29) #7
  call void @llvm.lifetime.end.p0(i64 255, ptr nonnull %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #7
  call void @llvm.lifetime.end.p0(i64 1888, ptr nonnull %23) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %20) #7
  call void @llvm.lifetime.end.p0(i64 3976, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 309, ptr nonnull %2) #7
  ret i32 %.0144
}

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

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

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

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

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

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

declare i32 @tls_record_set_handshake_server_hello_done(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 @tls_record_get_handshake_client_key_exchange_pke(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

declare i32 @tls_record_get_handshake_certificate_verify(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 #6

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nofree nounwind willreturn memory(argmem: read) }
attributes #7 = { nounwind }
attributes #8 = { 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, !10, i64 61832}
!6 = !{!"", !7, i64 0, !7, i64 4, !8, i64 8, !10, i64 264, !7, i64 272, !8, i64 276, !10, i64 18720, !8, i64 18728, !8, i64 37165, !11, i64 55608, !10, i64 55616, !7, i64 55624, !8, i64 55628, !10, i64 55664, !8, i64 55672, !10, i64 57720, !8, i64 57728, !10, i64 59776, !8, i64 59784, !10, i64 61832, !12, i64 61840, !12, i64 61968, !7, i64 62096, !8, i64 62100, !8, i64 62148, !14, i64 62248, !14, i64 62424, !16, i64 62600, !16, i64 62728, !8, i64 62856, !8, i64 62864, !8, i64 62872, !8, i64 62884, !17, i64 62896, !17, i64 63032, !7, i64 63168}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"", !13, i64 0, !8, i64 96}
!13 = !{!"", !8, i64 0, !8, i64 32, !8, i64 64}
!14 = !{!"", !15, i64 0, !8, i64 112}
!15 = !{!"", !8, i64 0, !10, i64 32, !8, i64 40, !10, i64 104}
!16 = !{!"", !8, i64 0}
!17 = !{!"BLOCK_CIPHER_KEY", !8, i64 0, !11, i64 128}
!18 = !{!6, !7, i64 272}
!19 = !{!11, !11, i64 0}
!20 = !{!8, !8, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{!10, !10, i64 0}
!23 = !{!6, !7, i64 55624}
!24 = !{!6, !10, i64 57720}
!25 = !{!6, !10, i64 59776}
!26 = !{i64 0, i64 32, !20, i64 32, i64 8, !22, i64 40, i64 64, !20, i64 104, i64 8, !22}
!27 = !{!6, !7, i64 0}
!28 = !{!6, !7, i64 63168}


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